-
Notifications
You must be signed in to change notification settings - Fork 0
/
2015-08-26.html
146 lines (129 loc) · 3.29 KB
/
2015-08-26.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
<!doctype html>
<html>
<head>
<title>2015/08/26</title>
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, minimum-scale=1">
<style>
html {
width: 100%;
height: 100%;
border: none;
}
html, div {
margin: 0;
padding: 0;
font-size: 10vw;
}
body {
background: royalblue;
-webkit-user-select: none;
overflow: hidden;
}
a {
text-decoration: none;
}
.button {
position: relative;
top: 0;
left: 0;
text-transform: uppercase;
color: yellow;
background-color: transparent;
width: 100%;
height: 100%;
overflow: hidden;
}
.button .text {
position: absolute;
top: 50%;
left: 50%;
-webkit-transform: translate3d(-50%, -50%, 0);
transform: translate3d(-50%, -50%, 0);
text-align: center;
}
.title {
font-size: 1rem;
}
.desc {
font-size: 0.2rem;
}
.button:hover {
cursor: pointer;
}
.button-effect {
position: absolute;
overflow: hidden;
margin: 0;
}
@-webkit-keyframes wave {
from {
width: 0px;
height: 0px;
opacity: 1;
}
to {
width: 2000px;
height: 2000px;
opacity: 0;
}
}
@keyframes wave {
from {
width: 0px;
height: 0px;
opacity: 1;
}
to {
width: 150vh;
height: 150vh;
opacity: 0;
}
}
.effect-wave {
position: absolute;
width: 0;
height: 0;
border-radius: 50%;
-webkit-transform: translateX(-50%) translateY(-50%);
-ms-transform: translateX(-50%) translateY(-50%);
transform: translateX(-50%) translateY(-50%);
background-color: yellow;
opacity: 1;
z-index: 10;
}
.effect-wave.active {
-webkit-animation: wave 1.5s ease;
animation: wave 1.5s ease;
}
</style>
</head>
<body>
<div class="button button-effect">
<div class="text">
<div class="title">jessica</div>
<div class="desc">tap the screen to see the wave</div>
</div>
<div class="effect-wave"></div>
</div>
<script src="//cdn.bootcss.com/jquery/2.1.4/jquery.min.js"></script>
<script>
$('.button-effect').click(function(e){
if ($('.effect-wave').hasClass('active')) {
return;
}
x = e.offsetX;
y = e.offsetY;
$('.effect-wave')
.css({
'top': y,
'left': x
})
.addClass('active');
setTimeout(function(){$('.effect-wave').removeClass('active')}, 700);
})
$('.text').click(function(e) {
e.stopPropagation();
})
</script>
</body>
</html>