forked from HeWasntOffByMuch/dima-out
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.html
129 lines (121 loc) · 3.32 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
<!DOCTYPE html>
<html lang="en">
<head>
<title>Dima Out</title>
<link rel="preconnect" href="https://fonts.googleapis.com" />
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin />
<link
href="https://fonts.googleapis.com/css2?family=Orbitron:[email protected]&display=swap"
rel="stylesheet"
/>
<script src="https://unpkg.com/[email protected]/dist/peerjs.min.js"></script>
<script src="connectionBroker.js"></script>
<link rel="stylesheet" href="fireworks.css" />
<style>
body {
background-color: black;
margin: 0;
font-family: 'Orbitron', sans-serif;
font-optical-sizing: auto;
font-style: normal;
}
#container {
height: 100vh;
width: 100%;
display: flex;
flex-direction: column;
row-gap: 20px;
justify-content: center;
align-items: center;
}
#timerContainer {
color: white;
font-size: 64px;
}
#dima {
position: relative;
background-image: url('./assets/dima.jpeg');
background-size: cover;
height: 400px;
width: 400px;
}
#thug {
position: absolute;
top: 0;
left: 59%;
translate: -50% 0;
transition: all 775ms;
background-image: url('./assets/glasses.png');
image-rendering: pixelated;
background-size: cover;
height: 100px;
width: 200px;
}
#peers {
color: white;
font-size: 24px;
}
.peer-dot {
display: inline-block;
height: 10px;
width: 10px;
border-radius: 50%;
margin: 0 5px;
background-color: red;
}
/* slow glow effect */
@keyframes daysLeft {
0% {
opacity: 1;
}
30% {
opacity: 0.75;
}
50% {
opacity: 0;
}
76% {
opacity: 0.75;
}
100% {
opacity: 1;
}
}
.animatedBlink {
animation: daysLeft 2.5s infinite;
font-weight: bold;
font-size: 74px;
}
</style>
</head>
<body>
<div id="container">
<div id="timerContainer">
Dima dima i go ni ma in <span id="daysLeft" class="animatedBlink">19</span> days...
</div>
<div id="peers"></div>
<div id="dima"><div id="thug"></div></div>
</div>
<script>
document.addEventListener('DOMContentLoaded', async () => {
const timerContainer = document.querySelector('#daysLeft');
const glasses = document.querySelector('#thug');
const oneDay = 24 * 60 * 60 * 1000;
const firstDate = new Date(2024, 9 - 1, 25);
let secondDate = new Date();
let diffDays = Math.round(Math.abs((firstDate - secondDate) / oneDay));
const startingDiffInDays = 19;
timerContainer.textContent = `${diffDays}`;
setInterval(() => {
secondDate = new Date();
diffDays = Math.round(Math.abs((firstDate - secondDate) / oneDay));
timerContainer.textContent = `${diffDays}`;
glasses.style.translate = `-50% ${
Math.max((startingDiffInDays - diffDays) / startingDiffInDays, 0) * 105
}px`;
}, 1000);
new ConnectionBroker();
});
</script>
</body>
</html>