-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathlove.html
More file actions
129 lines (111 loc) · 3.05 KB
/
love.html
File metadata and controls
129 lines (111 loc) · 3.05 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
<!DOCTYPE html>
<html lang="vi">
<head>
<meta charset="UTF-8">
<title>Ha Dung 🧸</title>
<style>
body {
margin: 0;
padding: 0;
overflow: hidden;
background-color: black;
font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}
.float-text, .heart {
position: absolute;
white-space: nowrap;
pointer-events: none;
opacity: 0;
animation: floatUp 8s linear forwards;
}
.float-text {
color: #ffffff;
text-shadow: 0 0 6px #ffffff, 0 0 10px #ff99ff, 0 0 14px #ff33cc;
}
.heart {
color: red;
text-shadow: 0 0 4px red, 0 0 8px #ff5050;
}
@keyframes floatUp {
0% {
transform: translateY(0) scale(1);
opacity: 1;
}
100% {
transform: translateY(-120vh) scale(1.5);
opacity: 0;
}
}
.star {
position: absolute;
width: 2px;
height: 2px;
background: white;
border-radius: 50%;
opacity: 0.7;
animation: twinkle 3s infinite ease-in-out;
box-shadow: 0 0 6px white;
}
@keyframes twinkle {
0%, 100% {
opacity: 0.3;
transform: scale(1);
}
50% {
opacity: 1;
transform: scale(1.5);
}
}
</style>
</head>
<body>
<script>
const messages = [
"Ha Dung 🧸",
"Happy Birthday 🎉🎉🎉"
];
function createFloatingText() {
const el = document.createElement('div');
el.className = 'float-text';
el.innerText = messages[Math.floor(Math.random() * messages.length)];
const size = Math.random() * 18 + 18; // 18px - 36px
el.style.fontSize = size + 'px';
el.style.left = Math.random() * window.innerWidth + 'px';
el.style.top = window.innerHeight + 'px';
el.style.animationDuration = (4 + Math.random() * 4) + 's';
document.body.appendChild(el);
setTimeout(() => document.body.removeChild(el), 9000);
}
function createHeart() {
const el = document.createElement('div');
el.className = 'heart';
el.innerText = '❤️';
const size = Math.random() * 12 + 14; // 14px - 26px
el.style.fontSize = size + 'px';
el.style.left = Math.random() * window.innerWidth + 'px';
el.style.top = window.innerHeight + 'px';
el.style.animationDuration = (4 + Math.random() * 2) + 's';
document.body.appendChild(el);
setTimeout(() => document.body.removeChild(el), 7000);
}
function createStar() {
const star = document.createElement('div');
star.className = 'star';
star.style.left = Math.random() * window.innerWidth + 'px';
star.style.top = Math.random() * window.innerHeight + 'px';
document.body.appendChild(star);
setTimeout(() => document.body.removeChild(star), 6000);
}
// Hiệu ứng liên tục
setInterval(() => {
for (let i = 0; i < 3; i++) createFloatingText();
}, 300);
setInterval(() => {
for (let i = 0; i < 5; i++) createHeart();
}, 500);
setInterval(() => {
for (let i = 0; i < 10; i++) createStar();
}, 800); // Sao xuất hiện đều đặn
</script>
</body>
</html>