-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.html
More file actions
213 lines (184 loc) · 10.4 KB
/
Copy pathindex.html
File metadata and controls
213 lines (184 loc) · 10.4 KB
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
213
<!DOCTYPE html>
<html lang="">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>2027 - Countdown</title>
<style>
@import url('https://fonts.googleapis.com/css2?family=Orbitron:wght@400;700;900&display=swap');
* { margin: 0; padding: 0; box-sizing: border-box; font-family: 'Orbitron', sans-serif; }
body { background: linear-gradient(135deg, #0f2027, #203a43, #2c5364); color: #fff; min-height: 100vh; overflow-x: hidden; display: flex; flex-direction: column; }
.intro { position: fixed; inset: 0; display: flex; justify-content: center; align-items: center; background: radial-gradient(circle at center, #0a0f2c, #000); z-index: 9999; opacity: 0; transition: opacity 1s ease; }
.intro.show { opacity: 1; }
.intro h1 { font-size: clamp(6rem, 25vw, 20rem); font-weight: 900; color: #00fffa; letter-spacing: 0.1em; text-shadow: 0 0 20px #00fffa, 0 0 60px #00c0ff; animation: neonPulse 2s infinite alternate, introBounce 2s ease-in-out infinite; }
@keyframes neonPulse { 0% { text-shadow: 0 0 20px #00fffa, 0 0 60px #00c0ff; } 100% { text-shadow: 0 0 50px #00fffa, 0 0 120px #00c0ff; } }
@keyframes introBounce { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-30px); } }
.countdown { flex: 1; display: flex; flex-direction: column; justify-content: center; align-items: center; text-align: center; background: rgba(0,0,0,0.6); padding: 50px 20px; backdrop-filter: blur(8px); transition: opacity 2s ease, transform 2s ease; }
.countdown.hide { opacity: 0; transform: scale(0.5); }
.countdown h1 { font-size: clamp(4rem, 18vw, 15rem); font-weight: 900; color: #00ffcc; letter-spacing: 0.05em; text-shadow: 0 0 30px #00ffcc, 0 0 70px #00aaff; animation: glowPulse 1.5s infinite alternate; }
.countdown h1.final60 { color: #ff4444; text-shadow: 0 0 40px #ff4444, 0 0 80px #ff8888; animation: glowPulse60 1s infinite alternate; }
@keyframes glowPulse { from { text-shadow: 0 0 20px #00ffcc, 0 0 50px #00aaff; } to { text-shadow: 0 0 60px #00ffcc, 0 0 100px #00aaff; } }
@keyframes glowPulse60 { from { text-shadow: 0 0 30px #ff4444, 0 0 60px #ff8888; } to { text-shadow: 0 0 60px #ff4444, 0 0 120px #ff8888; } }
.final { display: none; position: relative; height: 100vh; flex-direction: column; justify-content: center; align-items: center; text-align: center; background: linear-gradient(135deg, #1a2a6c, #b21f1f, #fdbb2d); overflow: hidden; opacity: 0; transition: opacity 2s ease, transform 2s ease; }
.final.show { display: flex; opacity: 1; transform: scale(1); }
.final h1 { font-size: clamp(5rem, 20vw, 18rem); font-weight: 900; color: #fff; text-shadow: 0 0 40px #fff, 0 0 80px #ffea00; animation: finalGlow 1.5s infinite alternate, finalBounce 2s infinite; }
.final div { margin-top: 30px; font-size: 2.5rem; color: #ffe0b3; text-shadow: 0 0 15px #ffe0b3; display: flex; justify-content: center; }
.digit { display: inline-block; width: 2ch; height: 3rem; position: relative; overflow: hidden; }
.digit span { display: block; position: absolute; top: 0; left: 0; width: 100%; transition: transform 0.3s ease; }
#fireworksCanvas { position: absolute; top: 0; left: 0; width: 100%; height: 100%; pointer-events: none; }
</style>
</head>
<body>
<div class="intro" id="intro">
<h1>2027</h1>
</div>
<section class="countdown" id="countdown">
<h1 id="timer">2027</h1>
<p id="tagline"></p>
</section>
<section class="final" id="final">
<canvas id="fireworksCanvas"></canvas>
<h1 id="happy"></h1>
<div id="chrono">
<div class="digit"><span>0</span></div>
<div class="digit"><span>0</span></div>
<div>:</div>
<div class="digit"><span>0</span></div>
<div class="digit"><span>0</span></div>
<div>:</div>
<div class="digit"><span>0</span></div>
<div class="digit"><span>0</span></div>
</div>
</section>
<script>
const timer = document.getElementById('timer');
const countdownSection = document.getElementById('countdown');
const finalSection = document.getElementById('final');
const happy = document.getElementById('happy');
const chronoDiv = document.getElementById('chrono');
const intro = document.getElementById('intro');
const canvas = document.getElementById('fireworksCanvas');
const ctx = canvas.getContext('2d');
const userLocale = navigator.language || 'en-US';
document.documentElement.lang = userLocale.split('-')[0];
let targetDate = new Date('2027-01-01T00:00:00');
let introShown = false;
function showIntro() {
if (!introShown) {
introShown = true;
intro.classList.add('show');
setTimeout(() => { intro.classList.remove('show'); }, 4000);
}
}
function fitText() {
const container = timer.parentElement;
const maxWidth = container.offsetWidth * 0.95;
const maxHeight = container.offsetHeight * 0.5;
let fontSize = Math.min(container.offsetWidth / 6, 220);
timer.style.fontSize = fontSize + 'px';
while ((timer.scrollWidth > maxWidth || timer.scrollHeight > maxHeight) && fontSize > 40) {
fontSize -= 2;
timer.style.fontSize = fontSize + 'px';
}
}
showIntro();
function createFirework(x, y) {
const particles = [];
for (let i = 0; i < 30; i++) {
particles.push({ x, y, vx: Math.random() * 4 - 2, vy: Math.random() * -5 - 2, alpha: 1, color: Math.random()*360 });
}
return particles;
}
let fireworks = [];
function animateFireworks() {
canvas.width = window.innerWidth;
canvas.height = window.innerHeight;
ctx.clearRect(0, 0, canvas.width, canvas.height);
fireworks.forEach((firework, idx) => {
firework.forEach(p => {
p.x += p.vx; p.y += p.vy; p.alpha -= 0.02; p.vy += 0.05;
ctx.fillStyle = `hsla(${p.color}, 100%, 60%, ${p.alpha})`;
ctx.fillRect(p.x, p.y, 3, 3);
});
fireworks[idx] = firework.filter(p => p.alpha > 0);
});
fireworks = fireworks.filter(fw => fw.length > 0);
requestAnimationFrame(animateFireworks);
}
animateFireworks();
function showFinal() {
countdownSection.style.transition = 'opacity 1.5s ease, transform 1.5s ease';
countdownSection.style.opacity = '0';
countdownSection.style.transform = 'scale(0.7) rotate(-5deg)';
setTimeout(() => {
countdownSection.style.display = 'none';
finalSection.classList.add('show');
finalSection.style.transform = 'scale(1.2)';
finalSection.style.opacity = '0';
setTimeout(() => { finalSection.style.transition = 'opacity 1.5s ease, transform 1.5s ease'; finalSection.style.opacity = '1'; finalSection.style.transform = 'scale(1)'; }, 50);
}, 1500);
}
function animateDigit(span, newVal) {
const oldSpan = document.createElement('span');
oldSpan.textContent = span.textContent;
oldSpan.style.position = 'absolute';
oldSpan.style.top = '0';
oldSpan.style.left = '0';
oldSpan.style.width = '100%';
oldSpan.style.transition = 'transform 0.5s ease';
span.parentNode.appendChild(oldSpan);
requestAnimationFrame(() => {
oldSpan.style.transform = 'translateY(-100%)';
span.textContent = newVal;
span.style.transform = 'translateY(100%)';
span.style.transition = 'transform 0.5s ease';
requestAnimationFrame(() => { span.style.transform = 'translateY(0)'; });
});
setTimeout(() => { oldSpan.remove(); }, 500);
}
function updateCountdown() {
const now = new Date();
const diff = targetDate - now;
if (diff <= 0) {
showFinal();
happy.textContent = userLocale.startsWith('fr') ? 'Bonne année !' : 'Happy New Year!';
setInterval(() => {
fireworks.push(createFirework(Math.random()*window.innerWidth, Math.random()*window.innerHeight/2));
}, 500);
const start = new Date();
setInterval(() => {
const elapsed = Math.floor((new Date() - start) / 1000);
const h = String(Math.floor(elapsed / 3600)).padStart(2, '0');
const m = String(Math.floor((elapsed % 3600) / 60)).padStart(2, '0');
const s = String(elapsed % 60).padStart(2, '0');
const chronoDigits = [h[0], h[1], m[0], m[1], s[0], s[1]];
Array.from(chronoDiv.querySelectorAll('.digit')).forEach((div, i) => {
const span = div.querySelector('span');
if (span.textContent !== chronoDigits[i]) {
animateDigit(span, chronoDigits[i]);
}
});
}, 1000);
clearInterval(interval);
return;
}
const totalSeconds = Math.floor(diff / 1000);
if (totalSeconds <= 60) {
timer.textContent = `${totalSeconds}s`;
timer.classList.add('final60');
} else {
const days = Math.floor(totalSeconds / (3600 * 24));
const hours = Math.floor((totalSeconds % (3600 * 24)) / 3600);
const minutes = Math.floor((totalSeconds % 3600) / 60);
const seconds = totalSeconds % 60;
timer.textContent = `${String(days).padStart(2,'0')}:${String(hours).padStart(2,'0')}:${String(minutes).padStart(2,'0')}:${String(seconds).padStart(2,'0')}`;
timer.classList.remove('final60');
}
fitText();
}
updateCountdown();
let interval = setInterval(updateCountdown, 1000);
window.addEventListener('resize', fitText);
</script>
</body>
</html>