-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.html
68 lines (68 loc) · 1.75 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
<!DOCTYPE html>
<html lang='zzx,und'>
<head>
<meta charset="UTF-8">
<title>SurveyMonkey (r/SampleSize)</title>
<style>
iframe, video, div {
position: fixed;
top: 0;
left: 0;
width: 100vw;
height: 100vh;
border: none;
}
iframe {
z-index: 100;
}
video {
z-index 1;
background: black;
}
div {
z-index: 10000;
}
</style>
<script src="https://code.jquery.com/jquery-3.3.1.min.js" integrity="sha256-FgpCb/KJQlLNfOu91ta32o/NMZxltwRo8QtmkMRdAu8=" crossorigin="anonymous"></script>
<script>
var oldPosition = 0;
var newPosition = 0;
var currentVelocity = 0;
var velocities = [0, 0, 0, 0, 0];
const deactivate = () => {
$('video').css('z-index', '1').prop('volume', 0.5);
}
$(document).ready(() => {
$('div').on('click', () => {
$('div').remove();
window.setTimeout(() => {
$('iframe').get(0).contentWindow.location.replace('https://www.surveymonkey.com/r/DV6XRTV');
$('video').prop('volume', 1.0).css('z-index', '1000').get(0).play();
window.setTimeout(() => {
deactivate();
}, 5000);
}, 5000);
});
window.setInterval(() => {
if (newPosition < 100 && (velocities.reduce((p, c) => p + c, 0) / velocities.length) < -5) {
deactivate();
}
velocities.pop();
velocities.unshift(newPosition - oldPosition);
oldPosition = newPosition;
}, 100);
$(window).on('mousemove', (e) => {
newPosition = e.clientY;
});
});
</script>
</head>
<body>
<div></div>
<video loop preload="auto">
<source src="video.mp4" type="video/mp4">
<source src="video.webm" type="video/webm">
</video>
<iframe src="https://www.surveymonkey.com/r/General-Internet-Usage-Template"></iframe>
</body>
</html>