-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.html
212 lines (185 loc) · 6.27 KB
/
index.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
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
<!DOCTYPE html>
<html>
<head>
<meta content='width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=0' name='viewport' />
<meta name="twitter:card" content="summary" />
<meta name="twitter:title" content="Let me see that Donkey Roll" />
<meta name="twitter:description" content="Instant button that plays 'The Donkey Roll' by The Style Boyz (The Lonely Island)" />
<meta name="twitter:image" content="https://tgeorgiev.github.io/lmstdr/screen.png" />
<meta property="og:type" content="website" />
<meta property="og:title" content="Let me see that Donkey Roll" />
<meta property="og:description" content="Instant button that plays 'The Donkey Roll' by The Style Boyz (The Lonely Island)" />
<meta property="og:image" content="https://tgeorgiev.github.io/lmstdr/screen.png" />
<title>Let me see that Donkey Roll!</title>
<style type="text/css">
html, body, .donkey-roll, .donkey-roll .player-holder {
margin: 0;
width: 100%;
height: 100%;
}
body {
font-family: "HelveticaNeue-Light", "Helvetica Neue Light", "Helvetica Neue", Helvetica, Arial, "Lucida Grande", sans-serif;
}
.donkey-roll .player-holder {
overflow: hidden;
pointer-events: none;
transition: all 0.5s ease-out;
-webkit-clip-path: circle(0% at center);
clip-path: circle(0% at center);
}
.donkey-roll.active .player-holder {
-webkit-clip-path: circle(100% at center);
clip-path: circle(100% at center);
}
.donkey-roll.active .btn {
opacity: 0.5;
}
.donkey-roll.no-touch.active .btn:hover {
opacity: 1;
}
/* Nice 3d buttons thanks to https://css-tricks.com/circular-3d-buttons/
*/
.btn {
display: block;
cursor: pointer;
position: absolute;
top: 50%;
left: 50%;
background-color: #f7f7f7;
background-image: -webkit-gradient(linear, left top, left bottom, from(#f7f7f7), to(#e7e7e7));
background-image: -webkit-linear-gradient(top, #f7f7f7, #e7e7e7);
background-image: -moz-linear-gradient(top, #f7f7f7, #e7e7e7);
background-image: -ms-linear-gradient(top, #f7f7f7, #e7e7e7);
background-image: -o-linear-gradient(top, #f7f7f7, #e7e7e7);
color: #a7a7a7;
margin-left: -70px;
margin-top: -70px;
width: 140px;
height: 140px;
text-align: center;
border-radius: 50%;
box-shadow: 0px 3px 8px #aaa, inset 0px 2px 3px #fff;
-webkit-touch-callout: none;
-webkit-user-select: none;
-khtml-user-select: none;
-moz-user-select: none;
-ms-user-select: none;
user-select: none;
}
.btn .secondary {
margin-top: 50px;
}
.btn .primary {
font-size: 23px
}
.btn:hover {
text-decoration: none;
color: #555;
background: #f5f5f5;
}
.btn:active {
box-shadow: none;
}
.btn:before {
content: "";
display: block;
position: absolute;
top: -18px;
left: -18px;
bottom: -18px;
right: -18px;
border-radius: 50%;
box-shadow: inset 0px 8px 60px #ddd;
}
.donkey-roll .description {
position: absolute;
top: 50%;
left: 0;
right: 0;
margin-top: 80px;
text-align: center;
}
.donkey-roll.active .description {
display: none;
}
</style>
</head>
<body>
<div class="donkey-roll">
<div class="description">
<p>
The <b>Let me see that Donkey Roll</b> button is inspired by the latest dance craze that’s sweeping the nation. Full credit goes to:
</p>
<p>
<b>Artist:</b> <a href="http://www.thelonelyisland.com/">The Lonely Island</a>
</p>
<p>
<b>Album:</b> <a href="http://www.thelonelyisland.com/discography/popstar-never-stop-never-stopping/">Popstar: Never Stop Never Stopping</a>
</p>
<p>
<b>YouTube video:</b> <a href="https://www.youtube.com/watch?v=-mRVK8-XfEU">The Style Boyz (The Lonely Island) - 'The Donkey Roll’ (Official Music Video) | Popstar (2016)</a> published by <a href="https://www.youtube.com/channel/UCxAICW_LdkfFYwTqTHHE0vg">MTV USA</a>
</p>
</div>
<div class="player-holder">
<div id="player"></div>
</div>
<a class="btn">
<div class="secondary">Let them see that</div>
<div class="primary">Donkey Roll!</div>
</a>
</div>
<script type="text/javascript">
console.log('Hey there, don\'t want to interrupt you, just wanted to let you know that you can clone or fork the project here https://github.com/tgeorgiev/lmstdr')
var isTouchDevice = 'ontouchstart' in window || navigator.maxTouchPoints;
var tag = document.createElement('script');
tag.src = 'https://www.youtube.com/player_api';
var firstScriptTag = document.getElementsByTagName('script')[0];
firstScriptTag.parentNode.insertBefore(tag, firstScriptTag);
var player;
function onYouTubePlayerAPIReady() {
player = new YT.Player('player', {
height: '100%',
width: '100%',
videoId: '-mRVK8-XfEU',
playerVars: {
'controls': 0,
'disablekb': 1,
'playsinline': 1,
'rel': 0,
'iv_load_policy': 3
},
events: {
'onReady': onPlayerReady,
'onStateChange': onPlayerStateChange
}
});
}
var btn = document.querySelector('.donkey-roll .btn');
if (!isTouchDevice) {
document.querySelector('.donkey-roll').classList.add('no-touch');
btn.addEventListener('mousedown', letMeSeeThatDonkeyRoll);
} else {
btn.addEventListener('touchstart', letMeSeeThatDonkeyRoll);
}
document.querySelector('.donkey-roll .btn').style = 'display: none';
function onPlayerReady() {
player.setPlaybackQuality('small');
player.seekTo(17);
player.setVolume(0);
player.playVideo();
document.querySelector('.donkey-roll .btn').style = '';
}
function onPlayerStateChange(event) {
if (event.data == YT.PlayerState.ENDED) {
document.querySelector('.donkey-roll').classList.remove('active');
}
}
function letMeSeeThatDonkeyRoll() {
document.querySelector('.donkey-roll').classList.add('active');
player.seekTo(17.75);
player.setVolume(100);
player.playVideo();
}
</script>
</body>
</html>