File size: 8,456 Bytes
5326fb6 |
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 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 |
:root {
--color-env: #c41e3a;
--color-env2: #a01729;
--color-flap: #2e7d32;
--color-bg: #165016;
--color-heart: #ff0000;
--color-sparkle: #fff;
--wax-red: #c41e3a;
}
body {
background: radial-gradient(circle at top, #1f1f41, #18101b 80%);
margin: 0;
min-height: 100vh;
display: flex;
flex-direction: column;
align-items: center;
user-select: none;
cursor: auto;
position: relative;
overflow: hidden;
}
.envlope-wrapper {
height: 380px;
margin-top: 50px;
animation: float 3s ease-in-out infinite;
}
#envelope {
position: relative;
width: 380px;
height: 240px;
border-bottom-left-radius: 6px;
border-bottom-right-radius: 6px;
margin: 0 auto;
top: 150px;
background-color: var(--color-flap);
box-shadow: 0 4px 20px rgba(0,0,0,.1);
cursor: pointer;
}
.front {
position: absolute;
width: 0;
height: 0;
z-index: 3;
}
.flap {
border-left: 190px solid transparent;
border-right: 190px solid transparent;
border-bottom: 92px solid transparent;
border-top: 150px solid var(--color-flap);
transform-origin: top;
pointer-events: none;
}
.pocket {
border-left: 190px solid var(--color-env);
border-right: 190px solid var(--color-env);
border-bottom: 90px solid var(--color-env2);
border-top: 150px solid transparent;
border-bottom-left-radius: 6px;
border-bottom-right-radius: 6px;
}
.letter {
position: relative;
background-color: #e0c784;
width: 95%;
margin: 0 auto;
height: 95%;
top: 0%;
border-radius: 15px;
box-shadow: 0 2px 26px rgba(0,0,0,.08);
padding: 15px;
box-sizing: border-box;
overflow: hidden;
border: 6px solid;
border-image: repeating-linear-gradient(
45deg,
#ff0000 0 10px,
#ffffff 10px 20px
) 1;
}
.letter:after {
content: '';
position: absolute;
top: 0;
bottom: 0;
left: 0;
right: 0;
background-image: linear-gradient(180deg,
rgba(255,255,255,0.00) 25%,
rgba(255,231,236,0.70) 55%,
rgba(255,231,236,1.00) 100%);
pointer-events: none;
}
.message {
position: relative;
z-index: 2;
font-family: 'Pacifico', cursive;
color: #054508;
text-align: center;
line-height: 1.4;
padding: 5px;
height: 100%;
overflow-y: auto;
}
.message p {
margin: 10px 0;
font-size: 1.4em;
text-shadow: 0 2px 3px rgba(0,0,0,0.1);
}
.lyrics {
display: none;
font-size: 15px;
line-height: 1.5;
text-align: center;
opacity: 0;
transition: opacity 1s ease-in;
max-height: 130px;
overflow-y: auto;
}
.lyric-page {
display: none;
opacity: 0;
transition: opacity 0.5s ease;
}
.lyric-page.active {
display: block;
opacity: 1;
}
.open .flap {
transform: rotateX(180deg);
transition: transform 0.4s ease, z-index 0.6s;
z-index: 1;
}
.close .flap {
transform: rotateX(0deg);
transition: transform 0.4s 0.6s ease, z-index 1s;
z-index: 5;
}
.close .letter {
transform: translateY(0px);
transition: transform 0.4s ease, z-index 1s;
z-index: 1;
}
.open .letter {
transform: translateY(-80px) rotate(-3deg);
transition: transform 0.4s 0.6s ease, z-index 0.6s;
z-index: 2;
}
.letter-corner {
position: absolute;
width: 20px;
height: 20px;
border: 2px solid #2a470c;
border-radius: 5px;
z-index: 3;
}
.corner-tl { top: 10px; left: 10px; border-right: none; border-bottom: none; }
.corner-br { bottom: 10px; right: 10px; border-left: none; border-top: none; }
.hearts, .sparkles {
position: absolute;
top: 90px;
left: 0;
right: 0;
z-index: 2;
}
.heart, .sparkle {
position: absolute;
bottom: 0;
pointer-events: none;
}
.heart:before,
.heart:after {
content: "";
position: absolute;
left: 25px;
top: 0;
width: 25px;
height: 40px;
background: var(--color-heart);
border-radius: 25px 25px 0 0;
transform: rotate(-45deg);
transform-origin: 0 100%;
}
.heart:after {
left: 0;
transform: rotate(45deg);
transform-origin: 100% 100%;
}
.sparkle {
width: 8px;
height: 8px;
background: var(--color-sparkle);
border-radius: 50%;
animation: sparkleTwinkle 1s infinite;
}
.close .heart,
.close .sparkle {
opacity: 0;
animation: none;
}
.a1 { left: 20%; transform: scale(0.6); animation: slideUp 4s linear infinite, sideSway 2s ease-in-out infinite alternate; }
.a2 { left: 55%; animation: slideUp 5s linear infinite, sideSway 4s ease-in-out infinite alternate; }
.a3 { left: 10%; transform: scale(0.8); animation: slideUp 7s linear infinite, sideSway 2s ease-in-out infinite alternate; }
.s1 { left: 30%; animation: sparkleUp 3s linear infinite; }
.s2 { left: 60%; animation: sparkleUp 4s linear infinite; }
.s3 { left: 45%; animation: sparkleUp 5s linear infinite; }
@keyframes slideUp {
0% { top: 0; }
100% { top: -600px; }
}
@keyframes sideSway {
0% { margin-left: 0; }
50% { margin-left: 50px; }
100% { margin-left: 0; }
}
@keyframes sparkleUp {
0% { transform: translateY(0); opacity: 1; }
100% { transform: translateY(-500px) rotate(360deg); opacity: 0; }
}
@keyframes sparkleTwinkle {
0%, 100% { transform: scale(1); }
50% { transform: scale(1.5); }
}
.controls {
text-align: center;
margin-top: 50px;
}
.controls button {
font-weight: 600;
background: linear-gradient(135deg, #c41e3a, #a01729, #2e7d32);
border: 2px solid #ffd700;
border-radius: 25px;
color: rgb(255, 255, 255);
padding: 12px 28px;
margin: 10px;
font-size: 17px;
cursor: pointer;
font-family: 'Poppins', sans-serif;
/* Hiệu ứng Noel */
box-shadow: 0 4px 15px rgba(0,0,0,0.2),
0 0 10px rgba(255, 215, 0, 0.4);
transition: all 0.35s ease;
letter-spacing: 0.5px;
}
.controls button:hover {
/* Tăng độ sáng và glow */
transform: translateY(-4px) scale(1.07);
background: linear-gradient(135deg, #ff003c, #c41e3a, #3fa34d);
box-shadow: 0 6px 25px rgba(0,0,0,0.25),
0 0 14px rgba(255, 215, 0, 0.6),
0 0 25px rgba(255, 0, 0, 0.4);
}
/* Nhấn xuống */
.controls button:active {
transform: scale(0.96);
box-shadow: 0 3px 12px rgba(0,0,0,0.2);
}
.open .lyrics {
display: block;
opacity: 1;
}
.page-indicator {
position: absolute;
bottom: 5px;
left: 0;
right: 0;
text-align: center;
font-size: 0.8em;
color: #274715;
opacity: 0.7;
}
/* ====== HIỆU ỨNG NGÔI SAO LẤP LÁNH ====== */
.star-field {
position: fixed;
width: 100%;
height: 100%;
top: 0;
left: 0;
overflow: hidden;
pointer-events: none; /* Không cản click */
}
.star {
position: absolute;
width: 3px;
height: 3px;
background: white;
border-radius: 50%;
opacity: 0;
animation: twinkle 2s infinite ease-in-out;
}
@keyframes twinkle {
0% { opacity: 0; transform: scale(0.5); }
50% { opacity: 1; transform: scale(1.5); }
100% { opacity: 0; transform: scale(0.5); }
}
/* ====== HIỆU ỨNG BÔNG TUYẾT RƠI ====== */
.snowflake {
position: fixed;
top: -10px;
color: white;
font-size: 12px;
opacity: 0.8;
pointer-events: none;
animation: fall linear infinite;
}
@keyframes fall {
0% { transform: translateY(0) rotate(0deg); opacity: 0.9; }
100% { transform: translateY(100vh) rotate(360deg); opacity: 0.2; }
}
.santa {
position: fixed;
bottom: 5%;
right: -400px;
width: 400px;
animation: flySanta 12s linear infinite;
z-index: 9999;
}
@media (max-width: 768px) {
.santa {
top: 50%; /* thay đổi theo ý bạn */
width: 250px; /* optional: cho vừa màn điện thoại */
right: -250px; /* optional: chỉnh theo width */
}
}
@keyframes flySanta {
0% {
transform: translateX(0);
}
100% {
transform: translateX(-150vw); /* Bay ra khỏi mép trái */
}
} |