<!DOCTYPE html>
<html lang="zh-CN">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>七夕快乐,我的爱人</title>
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.0.0/css/all.min.css">
<style>
* {
margin: 0;
padding: 0;
box-sizing: border-box;
font-family: 'Microsoft YaHei', sans-serif;
}
body {
background: linear-gradient(135deg, #f8e1f4 0%, #d9a7c7 100%);
color: #6d2c52;
min-height: 100vh;
overflow-x: hidden;
position: relative;
padding: 20px;
display: flex;
justify-content: center;
align-items: center;
}
.container {
max-width: 900px;
width: 100%;
background: rgba(255, 255, 255, 0.95);
border-radius: 20px;
box-shadow: 0 15px 30px rgba(142, 45, 95, 0.2);
overflow: hidden;
position: relative;
z-index: 10;
}
header {
text-align: center;
padding: 50px 20px;
background: linear-gradient(to right, #b24a76, #8e2d5f);
color: white;
position: relative;
}
h1 {
font-size: 3rem;
margin-bottom: 15px;
text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.2);
animation: pulse 2s infinite;
}
@keyframes pulse {
0% { transform: scale(1); }
50% { transform: scale(1.05); }
100% { transform: scale(1); }
}
.subtitle {
font-size: 1.5rem;
margin-bottom: 10px;
opacity: 0.9;
}
.date {
font-size: 1.1rem;
opacity: 0.8;
}
.heart-icon {
position: absolute;
top: 20px;
right: 30px;
font-size: 2rem;
color: rgba(255, 255, 255, 0.7);
animation: heartbeat 1.5s infinite;
}
@keyframes heartbeat {
0% { transform: scale(1); }
50% { transform: scale(1.2); }
100% { transform: scale(1); }
}
.heart-container {
position: absolute;
width: 100%;
height: 100%;
top: 0;
left: 0;
z-index: 1;
}
.heart {
position: absolute;
width: 20px;
height: 20px;
background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%23b24a76'%3E%3Cpath d='M12 21.35l-1.45-1.32C5.4 15.36 2 12.28 2 8.5 2 5.42 4.42 3 7.5 3c1.74 0 3.41.81 4.5 2.09C13.09 3.81 14.76 3 16.5 3 19.58 3 22 5.42 22 8.5c0 3.78-3.4 6.86-8.55 11.54L12 21.35z'/%3E%3C/svg%3E") no-repeat center;
opacity: 0.7;
animation: fall 10s linear infinite;
}
@keyframes fall {
0% {
transform: translateY(-10%) rotate(0deg);
opacity: 0.7;
}
100% {
transform: translateY(100vh) rotate(360deg);
opacity: 0;
}
}
.content {
padding: 50px;
display: flex;
flex-direction: column;
gap: 40px;
}
.love-letter {
background: rgba(255, 245, 250, 0.9);
border-radius: 15px;
padding: 40px;
box-shadow: 0 5px 15px rgba(142, 45, 95, 0.15);
line-height: 1.8;
font-size: 1.1rem;
position: relative;
border-left: 5px solid #b24a76;
}
.love-letter p {
margin-bottom: 20px;
text-align: justify;
}
.signature {
text-align: right;
font-style: italic;
font-weight: bold;
color: #8e2d5f;
margin-top: 20px;
}
.poetry {
text-align: center;
padding: 30px;
background: linear-gradient(to right, #f8d0e2, #f5c0d8);
border-radius: 15px;
}
.poetry-title {
font-size: 1.8rem;
margin-bottom: 25px;
color: #8e2d5f;
font-weight: bold;
}
.poetry-content {
font-style: italic;
line-height: 2;
font-size: 1.2rem;
}
.wishes {
display: grid;
grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
gap: 20px;
margin-top: 20px;
}
.wish-item {
background: linear-gradient(45deg, #f8d0e2, #f5c0d8);
padding: 25px;
border-radius: 10px;
text-align: center;
box-shadow: 0 5px 15px rgba(142, 45, 95, 0.1);
transition: transform 0.3s;
}
.wish-item:hover {
transform: translateY(-5px);
}
.wish-item i {
font-size: 2.5rem;
color: #8e2d5f;
margin-bottom: 15px;
}
.wish-title {
font-weight: bold;
margin-bottom: 10px;
color: #8e2d5f;
font-size: 1.2rem;
}
.interactive {
text-align: center;
padding: 40px 0 20px;
}
.love-btn {
background: #b24a76;
color: white;
border: none;
padding: 15px 40px;
font-size: 1.2rem;
border-radius: 50px;
cursor: pointer;
transition: all 0.3s;
box-shadow: 0 5px 15px rgba(142, 45, 95, 0.3);
display: inline-flex;
align-items: center;
gap: 10px;
}
.love-btn:hover {
background: #8e2d5f;
transform: translateY(-3px);
box-shadow: 0 8px 20px rgba(142, 45, 95, 0.4);
}
.hidden-message {
display: none;
margin-top: 30px;
padding: 30px;
background: rgba(255, 245, 250, 0.95);
border-radius: 15px;
box-shadow: 0 5px 15px rgba(142, 45, 95, 0.2);
text-align: center;
animation: fadeIn 1s;
}
@keyframes fadeIn {
from { opacity: 0; }
to { opacity: 1; }
}
footer {
text-align: center;
padding: 30px;
background: linear-gradient(to right, #b24a76, #8e2d5f);
color: white;
font-size: 0.9rem;
}
@media (max-width: 768px) {
h1 {
font-size: 2.2rem;
}
.subtitle {
font-size: 1.2rem;
}
.content {
padding: 30px 20px;
}
.love-letter {
padding: 25px;
}
.wishes {
grid-template-columns: 1fr;
}
}
</style>
</head>
<body>
<div class="heart-container" id="heartContainer"></div>
<div class="container">
<header>
<div class="heart-icon"><i class="fas fa-heart"></i></div>
<h1>七夕快乐,我的爱人</h1>
<p class="subtitle">牵你的手,朝朝暮暮,牵你的手,等待明天</p>
<p class="date">二零二五年七夕节</p>
</header>
<div class="content">
<div class="love-letter">
<p>亲爱的:</p>
<p>在这个特别的日子里,我想告诉你,遇见你是我一生中最美好的事情。</p>
<p>你的笑容如春风般温暖,你的眼神如星辰般璀璨。每一天因为有你而变得更加有意义,每一刻因为想你而变得更加甜蜜。</p>
<p>我们一起走过的日子,是我生命中最珍贵的记忆。从第一次相遇的心动,到相知相守的温暖,每一个瞬间都深深烙印在我的心中。</p>
<p>愿我们的爱情如同牛郎织女般坚贞,却比他们更加幸福,因为我们能朝夕相伴。</p>
<p>爱你,不止七夕,更在朝朝暮暮。</p>
<p class="signature">永远爱你的远远</p>
</div>
<div class="poetry">
<div class="poetry-title">情诗</div>
<div class="poetry-content">
<p>银汉迢迢暗度,金风玉露一相逢</p>
<p>便胜却人间无数,柔情似水,佳期如梦</p>
<p>忍顾鹊桥归路,两情若是久长时</p>
<p>又岂在朝朝暮暮</p>
</div>
</div>
<div class="wishes">
<div class="wish-item">
<i class="fas fa-heart"></i>
<div class="wish-title">我的愿望</div>
<div>愿与你共度每一个七夕</div>
</div>
<div class="wish-item">
<i class="fas fa-star"></i>
<div class="wish-title">我的承诺</div>
<div>永远珍惜我们的爱情</div>
</div>
<div class="wish-item">
<i class="fas fa-hand-holding-heart"></i>
<div class="wish-title">我的期盼</div>
<div>与你携手走向未来</div>
</div>
</div>
<div class="interactive">
<button class="love-btn" onclick="showMessage()">
<i class="fas fa-gift"></i>点击许下爱的誓言
</button>
<div id="hiddenMessage" class="hidden-message">
<h3>我的誓言</h3>
<p>我愿以真心为聘,以深情为礼,陪你走过每一个春夏秋冬,直到永远。</p>
<p>无论顺境还是逆境,无论富有还是贫穷,无论健康还是疾病,我都将永远爱你,珍惜你,陪伴你。</p>
</div>
</div>
</div>
</div>
<script>
// 创建飘落的爱心
function createHearts() {
const heartContainer = document.getElementById('heartContainer');
const numberOfHearts = 25;
for (let i = 0; i < numberOfHearts; i++) {
const heart = document.createElement('div');
heart.classList.add('heart');
// 随机位置和大小
const size = Math.random() * 15 + 10;
const left = Math.random() * 100;
heart.style.width = `${size}px`;
heart.style.height = `${size}px`;
heart.style.left = `${left}vw`;
heart.style.animationDuration = `${Math.random() * 10 + 5}s`;
heart.style.animationDelay = `${Math.random() * 5}s`;
heartContainer.appendChild(heart);
}
}
// 显示隐藏消息
function showMessage() {
const message = document.getElementById('hiddenMessage');
if (message.style.display === 'block') {
message.style.display = 'none';
} else {
message.style.display = 'block';
}
}
// 页面加载时初始化
window.onload = function() {
createHearts();
};
</script>
</body>
</html>
index.html
style.css
index.js
index.html