console
<!DOCTYPE html>
<html lang="zh-CN">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0"/>
<title>郑欣悦圣诞节快乐!</title>
<style>
body {
margin: 0;
padding: 0;
background: linear-gradient(135deg, #0c243e, #1a3a5f);
overflow: hidden;
font-family: "Microsoft YaHei", sans-serif;
height: 100vh;
position: relative;
color: white;
}
/* 飘字样式 */
.message {
position: absolute;
white-space: nowrap;
font-size: 26px;
font-weight: bold;
text-shadow: 0 0 8px rgba(255, 255, 255, 0.9);
opacity: 0.95;
animation: scrollLeft 8s linear infinite; /* 更快!8秒一圈 */
}
@keyframes scrollLeft {
from { transform: translateX(100vw); }
to { transform: translateX(-60%); }
}
/* 多行错开颜色和时间 */
.message:nth-child(1) { top: 10%; color: #ff6ec7; animation-delay: -1s; }
.message:nth-child(2) { top: 20%; color: #6effd9; animation-delay: -2s; }
.message:nth-child(3) { top: 30%; color: #ffcc5c; animation-delay: -3s; }
.message:nth-child(4) { top: 40%; color: #ff7bac; animation-delay: -4s; }
.message:nth-child(5) { top: 50%; color: #a0f0ff; animation-delay: -5s; }
.message:nth-child(6) { top: 60%; color: #ff9a6b; animation-delay: -6s; }
.message:nth-child(7) { top: 70%; color: #d47fff; animation-delay: -7s; }
/* 雪花容器 */
#snowflakes {
position: absolute;
top: 0;
left: 0;
width: 100%;
height: 100%;
pointer-events: none;
z-index: 10;
}
.snowflake {
position: absolute;
background: white;
border-radius: 50%;
opacity: 0.8;
animation: fall linear forwards;
}
@keyframes fall {
to {
transform: translateY(100vh);
}
}
/* 圣诞树(用 CSS 画一个简单但闪亮的) */
.tree {
position: absolute;
bottom: 20px;
right: 30px;
width: 120px;
height: 180px;
z-index: 5;
}
.triangle {
position: absolute;
width: 0;
height: 0;
border-left: 60px solid transparent;
border-right: 60px solid transparent;
border-bottom: 80px solid #0a5f20;
top: 0;
}
.triangle:nth-child(2) {
border-bottom-color: #0d7a2a;
top: 30px;
border-left-width: 50px;
border-right-width: 50px;
}
.triangle:nth-child(3) {
border-bottom-color: #109535;
top: 60px;
border-left-width: 40px;
border-right-width: 40px;
}
.trunk {
position: absolute;
width: 20px;
height: 30px;
background: #8B4513;
bottom: 0;
left: 50px;
}
/* 树上的小灯(闪烁效果) */
.light {
position: absolute;
width: 8px;
height: 8px;
border-radius: 50%;
animation: blink 1.5s infinite alternate;
}
@keyframes blink {
from { opacity: 0.4; }
to { opacity: 1; }
}
.light:nth-child(1) { top: 20px; left: 50px; background: #ff0044; animation-delay: 0s; }
.light:nth-child(2) { top: 40px; left: 80px; background: #00ffcc; animation-delay: 0.3s; }
.light:nth-child(3) { top: 60px; left: 40px; background: #ffff00; animation-delay: 0.6s; }
.light:nth-child(4) { top: 80px; left: 70px; background: #ff66ff; animation-delay: 0.9s; }
.light:nth-child(5) { top: 100px; left: 55px; background: #00ccff; animation-delay: 1.2s; }
</style>
</head>
<body>
<!-- 飘字(7行,更快更密集) -->
<div class="message">�� 郑欣悦圣诞节快乐!愿你平安喜乐~</div>
<div class="message">�� 郑欣悦圣诞节快乐!天天都有好心情!</div>
<div class="message">�� 郑欣悦圣诞节快乐!梦想都闪闪发光!</div>
<div class="message">❄️ 郑欣悦圣诞节快乐!温暖常伴你左右!</div>
<div class="message">�� 郑欣悦圣诞节快乐!未来比星光更璀璨!</div>
<div class="message">❤️ 郑欣悦圣诞节快乐!被爱包围,笑靥如花!</div>
<div class="message">�� 郑欣悦圣诞节快乐!Merry Christmas & Happy New Year!</div>
<!-- 圣诞树 -->
<div class="tree">
<div class="triangle"></div>
<div class="triangle"></div>
<div class="triangle"></div>
<div class="trunk"></div>
<div class="light"></div>
<div class="light"></div>
<div class="light"></div>
<div class="light"></div>
<div class="light"></div>
</div>
<!-- 雪花容器 -->
<div id="snowflakes"></div>
<!-- 背景音乐 -->
<audio id="bgm" loop>
<source src="https://www.soundjay.com/misc/sounds/bell-ringing-01.wav" type="audio/wav">
</audio>
<script>
// 生成雪花
function createSnowflakes() {
const container = document.getElementById('snowflakes');
const snowflakeCount = 120; // 雪花数量
for (let i = 0; i < snowflakeCount; i++) {
const snowflake = document.createElement('div');
snowflake.classList.add('snowflake');
// 随机大小、位置、速度
const size = Math.random() * 6 + 2; // 2~8px
const left = Math.random() * 100; // 水平位置 %
const duration = Math.random() * 8 + 5; // 5~13秒
const delay = Math.random() * 5;
snowflake.style.width = `${size}px`;
snowflake.style.height = `${size}px`;
snowflake.style.left = `${left}%`;
snowflake.style.animationDuration = `${duration}s`;
snowflake.style.animationDelay = `