forked from mauricekuehl/rickroll
-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.html
198 lines (168 loc) · 4.08 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
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
<meta name="viewport" content="width=device-width, minimum-scale=1" />
<title></title>
<style>
#background {
filter: blur(4px);
-webkit-filter: blur(4px);
}
* {
font-family: Arial, Helvetica, sans-serif;
box-sizing: border-box;
}
html, body, .img-background, .background-gradient {
width: 100%;
height: 100%;
padding: 0;
margin: 0;
overflow: hidden;
}
body {
background-color: rgba(0, 0, 0, 0.8);
}
#background {
width: 100vw;
height: 100vh;
position: fixed;
}
#player {
width: 100vw;
height: 100vh;
display: none;
z-index: 50;
position: absolute;
top: 0;
}
.cookie-banner-overlay {
position: absolute;
width: 100vw;
height: 100vh;
display: grid;
place-items: center;
background-color: rgba(0, 0, 0, 0.2);
z-index: 20;
}
.cookie-banner {
width: 34rem;
max-width: 90vw;
background-color: white;
border-radius: 1.5rem;
padding: 1.75rem 2rem;
}
.cookie-banner h2 {
font-size: 1rem;
font-weight: bold;
padding-bottom: 0.5rem;
}
.cookie-banner .text {
font-size: 1.125rem;
line-height: 1.5;
}
.cookie-banner .text button {
border: none;
background-color: white;
cursor: pointer;
font-size: 1.125rem;
text-decoration: underline;
}
.cookie-banner .options button {
border: none;
padding: 1rem 1.25rem;
font-size: 1rem;
font-weight: 700;
border-radius: 5rem;
margin: 0 0.5rem;
margin-top: 1rem;
background-color: white;
cursor: pointer;
}
.cookie-banner .options .accept {
background-color: black;
color: white;
}
.cookie-banner .options button:hover {
background-color: rgba(0, 0, 0, 0.15);
}
.cookie-banner .options .accept:hover {
background-color: rgba(0, 0, 0, 0.75);
}
.cookie-banner .options {
display: flex;
justify-content: right;
}
iframe {
pointer-events: none;
}
@media (max-width: 370px) {
.cookie-banner .options button {
margin: 0.25rem 0;
}
.cookie-banner .options {
flex-direction: column;
}
}
</style>
</head>
<body>
<Body background=background.png>
<!--
<iframe id="background" src="https://fabricmc.net/" frameborder="0"></iframe>
-->
<div class="cookie-banner-overlay">
<div class="cookie-banner">
<h2>Your Privacy Settings</h2>
<div class="text">
For the best experience, we use cookies and similar tools. Learn more
in our <button>Privacy Policy</button>
and
<button>Cookie Policy.</button>
You can update your settings at any time via Privacy Settings.
</div>
<div class="options">
<button>Update Settings</button><button class="accept">Accept</button>
</div>
</div>
</div>
<div id="player"></div>
<script>
var tag = document.createElement("script");
tag.src = "https://www.youtube.com/iframe_api";
var firstScriptTag = document.getElementsByTagName("script")[0];
firstScriptTag.parentNode.insertBefore(tag, firstScriptTag);
var player;
function onYouTubeIframeAPIReady() {
player = new YT.Player("player", {
videoId: "uHgt8giw1LY",
playerVars: {
playsinline: 1,
autoplay: 0, // Set autoplay to 0 to prevent automatic playback
},
events: {
onReady: onPlayerReady,
},
});
}
let toPlay = false;
document.querySelector(".cookie-banner-overlay").addEventListener("click", () => {
toPlay = true;
play();
});
function onPlayerReady(event) {
if (toPlay) {
play();
}
document.querySelector(".cookie-banner-overlay").addEventListener("click", () => {
play();
});
}
function play() {
document.querySelector("#player").style.display = "block";
player.playVideo();
}
</script>
</body>
</html>