<!DOCTYPE html>
<html lang="zh-CN">
<head>
<meta charset="UTF-8">
<title>❤ 专属情人节祝福 ❤</title>
<style>
body {
margin: 0;
height: 100vh;
background: linear-gradient(45deg, #ff69b4, #ff1493, #ff00ff);
overflow: hidden;
font-family: '微软雅黑', cursive;
}
.container {
position: relative;
height: 100%;
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
}
.title {
font-size: 3.5em;
color: #fff;
text-shadow: 0 0 15px rgba(255,255,255,0.5);
animation: float 3s ease-in-out infinite;
margin-bottom: 20px;
}
.message {
font-size: 1.8em;
color: #fff;
text-align: center;
line-height: 1.6;
max-width: 80%;
opacity: 0;
animation: fadeIn 2s forwards 1s;
}
.hearts {
position: absolute;
width: 100%;
height: 100%;
pointer-events: none;
}
.heart {
position: absolute;
color: #ff69b4;
animation: fall linear forwards;
}
@keyframes float {
0%, 100% { transform: translateY(0); }
50% { transform: translateY(-20px); }
}
@keyframes fadeIn {
from { opacity: 0; transform: translateY(20px); }
to { opacity: 1; transform: translateY(0); }
}
@keyframes fall {
to {
transform: translateY(100vh) rotate(360deg);
opacity: 0;
}
}
.timer {
font-size: 1.5em;
color: #fff;
margin-top: 30px;
background: rgba(255,255,255,0.1);
padding: 15px 30px;
border-radius: 30px;
backdrop-filter: blur(5px);
}
</style>
</head>
<body>
<div class="container">
<div class="hearts" id="hearts"></div>
<h1 class="title">❤ 亲爱的[XXX] ❤</h1>
<p class="message">
今天是我们的第一个情人节<br>
也是我们共同旅程的起点<br>
愿未来的每一天都有你相伴<br>
你是我生命中最美的礼物<br>
爱你直到永远!❤
</p>
<div class="timer" id="timer"></div>
</div>
<script>
// 创建爱心雨
function createHearts() {
const heartsContainer = document.getElementById('hearts');
for (let i = 0; i < 50; i++) {
const heart = document.createElement('div');
heart.className = 'heart';
heart.innerHTML = '❤';
heart.style.left = Math.random() * 100 + '%';
heart.style.animationDuration = Math.random() * 3 + 2 + 's';
heart.style.fontSize = Math.random() * 20 + 10 + 'px';
heartsContainer.appendChild(heart);
}
}
// 更新计时器
function updateTimer() {
const startDate = new Date('2024-02-14'); // 修改为你们的纪念日
const now = new Date();
const diff = now - startDate;
const days = Math.floor(diff / (1000 * 60 * 60 * 24));
const hours = Math.floor((diff % (1000 * 60 * 60 * 24)) / (1000 * 60 * 60));
const minutes = Math.floor((diff % (1000 * 60 * 60)) / (1000 * 60));
const seconds = Math.floor((diff % (1000 * 60)) / 1000);
document.getElementById('timer').innerHTML =
`我们已经相爱了:<br>${days} 天 ${hours} 小时 ${minutes} 分 ${seconds} 秒`;
}
// 初始化
document.addEventListener('DOMContentLoaded', () => {
createHearts();
setInterval(updateTimer, 1000);
// 点击生成爱心
document.addEventListener('click', (e) => {
const heart = document.createElement('div');
heart.className = 'heart';
heart.innerHTML = '❤';
heart.style.left = e.clientX + 'px';
heart.style.top = e.clientY + 'px';
heart.style.animationDuration = '2s';
heart.style.fontSize = '30px';
document.getElementById('hearts').appendChild(heart);
setTimeout(() => heart.remove(), 2000);
});
});
</script>
</body>
</html>这个页面包含以下特色功能:
- 渐变色浪漫背景
- 持续下落的爱心雨动画
- 浮动标题效果
- 渐显出现的祝福文字
- 实时更新的恋爱计时器
- 点击屏幕生成爱心互动效果
- 模糊特效的计时器面板
- 响应式设计适配各种设备
使用方法:
- 将代码中的[XXX]替换为你的爱人名字
- 修改
startDate为你们的纪念日 - 可以调整颜色、动画速度等参数
- 点击页面任意位置会产生新的爱心
页面视觉效果包括:
- 粉紫色渐变背景
- 不断飘落的彩色爱心
- 文字发光效果
- 柔和的动画过渡
- 互动点击效果
- 实时更新的时间统计
运行效果

















