forked from paulphilip/pythoncode
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.html
More file actions
79 lines (74 loc) · 2.94 KB
/
index.html
File metadata and controls
79 lines (74 loc) · 2.94 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
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Holi Celebration Animation</title>
<style>
@import url('https://fonts.googleapis.com/css2?family=Great+Vibes&display=swap');
body {
margin: 0;
overflow: hidden;
background: linear-gradient(45deg, #ff4e50, #fc913a, #f9d423, #8ac926, #1982c4, #6a4c93);
background-size: 400% 400%;
animation: gradientShift 12s infinite alternate ease-in-out;
display: flex;
justify-content: center;
align-items: center;
height: 100vh;
flex-direction: column;
}
@keyframes gradientShift {
0% { background-position: 0% 50%; }
100% { background-position: 100% 50%; }
}
.wish-text {
font-family: 'Great Vibes', cursive;
font-size: 3em;
color: white;
text-shadow: 3px 3px 10px rgba(0, 0, 0, 0.3);
animation: fadeIn 2s ease-in-out;
}
@keyframes fadeIn {
from { opacity: 0; transform: translateY(-20px); }
to { opacity: 1; transform: translateY(0); }
}
</style>
</head>
<body>
<div class="wish-text">Belated Happy Holi! 🌸🎨✨</div>
<script>
function createParticle(x, y, color) {
const particle = document.createElement('div');
particle.classList.add('particle');
document.body.appendChild(particle);
particle.style.backgroundColor = color;
particle.style.left = `${x}px`;
particle.style.top = `${y}px`;
particle.style.opacity = 1;
const angle = Math.random() * 2 * Math.PI;
const speed = Math.random() * 12 + 3;
const xMove = Math.cos(angle) * speed * (Math.random() * 1.5);
const yMove = Math.sin(angle) * speed * (Math.random() * 1.5);
particle.animate([
{ transform: `translate(0, 0) scale(1) rotate(0deg)`, opacity: 1 },
{ transform: `translate(${xMove}px, ${yMove}px) scale(${Math.random() * 2 + 1}) rotate(${Math.random() * 360}deg)`, opacity: 0 }
], {
duration: 1200 + Math.random() * 800,
easing: 'ease-out'
});
setTimeout(() => particle.remove(), 2000);
}
function generateConfetti() {
for (let i = 0; i < 50; i++) {
const x = Math.random() * window.innerWidth;
const y = Math.random() * window.innerHeight;
const color = `hsl(${Math.random() * 360}, 100%, ${Math.random() * 30 + 50}%)`;
createParticle(x, y, color);
}
setTimeout(generateConfetti, 2200);
}
generateConfetti();
</script>
</body>
</html>