-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.html
164 lines (147 loc) · 5.82 KB
/
index.html
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
<!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 {
font-family: Arial, sans-serif;
margin: 0;
padding: 0;
height: 100vh;
background-image: url('background.jpg');
background-size: cover;
background-position: center;
background-attachment: fixed;
overflow: hidden; /* 防止雪花超出页面 */
}
.background {
position: absolute;
top: 0;
left: 0;
width: 100%;
height: 100%;
background-image: url('background.jpg');
background-size: cover;
background-position: center;
filter: blur(8px); /* 背景模糊效果 */
z-index: -1; /* 保证背景位于内容后面 */
}
.container {
position: absolute;
top: 50%;
left: 50%;
transform: translate(-50%, -50%); /* 定位居中 */
width: 1200px; /* 横向长度 */
height: 600px; /* 纵向长度 */
background: rgba(255, 255, 255, 0.8); /* 半透明背景 */
padding: 20px;
border-radius: 8px;
box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
z-index: 1; /* 保证内容在模糊背景之上 */
display: flex;
flex-direction: column;
justify-content: center;
align-items: center;
text-align: center; /* 确保文本居中 */
}
h1 {
color: #333;
}
.profile-img {
display: block;
margin: 0 auto 20px;
width: 150px;
height: 150px;
border-radius: 50%;
object-fit: cover;
}
p {
line-height: 1.6;
color: #555;
margin: 10px 0;
}
button {
display: block;
margin: 20px auto;
padding: 10px 20px;
border: none;
border-radius: 5px;
background-color: #007bff;
color: white;
font-size: 16px;
cursor: pointer;
}
button:hover {
background-color: #0056b3;
}
/* 雪花的样式 */
.snowflake {
position: absolute;
top: -10px;
z-index: 9999;
pointer-events: none;
color: #fff;
font-size: 3rem;
opacity: 0.8;
user-select: none;
animation: fall 10s linear infinite;
}
/* 雪花下落的动画 */
@keyframes fall {
0% {
transform: translateX(0) translateY(0);
opacity: 0.8;
}
100% {
transform: translateX(100px) translateY(100vh);
opacity: 0;
}
}
.snowflakes {
position: absolute;
width: 100%;
height: 100%;
}
</style>
</head>
<body>
<div class="background"></div> <!-- 背景区域 -->
<!-- 雪花飘落的效果 -->
<div class="snowflakes" aria-live="polite">
<div class="snowflake" style="left: 5%; animation-duration: 8s; animation-delay: 0s;">❄</div>
<div class="snowflake" style="left: 10%; animation-duration: 9s; animation-delay: 1s;">❄</div>
<div class="snowflake" style="left: 15%; animation-duration: 7s; animation-delay: 2s;">❄</div>
<div class="snowflake" style="left: 20%; animation-duration: 6s; animation-delay: 3s;">❄</div>
<div class="snowflake" style="left: 25%; animation-duration: 10s; animation-delay: 4s;">❄</div>
<div class="snowflake" style="left: 30%; animation-duration: 12s; animation-delay: 5s;">❄</div>
<div class="snowflake" style="left: 35%; animation-duration: 9s; animation-delay: 6s;">❄</div>
<div class="snowflake" style="left: 40%; animation-duration: 8s; animation-delay: 7s;">❄</div>
<div class="snowflake" style="left: 45%; animation-duration: 7s; animation-delay: 8s;">❄</div>
<div class="snowflake" style="left: 50%; animation-duration: 11s; animation-delay: 9s;">❄</div>
<div class="snowflake" style="left: 55%; animation-duration: 12s; animation-delay: 10s;">❄</div>
<div class="snowflake" style="left: 60%; animation-duration: 9s; animation-delay: 11s;">❄</div>
<div class="snowflake" style="left: 65%; animation-duration: 8s; animation-delay: 12s;">❄</div>
<div class="snowflake" style="left: 70%; animation-duration: 10s; animation-delay: 13s;">❄</div>
<div class="snowflake" style="left: 75%; animation-duration: 11s; animation-delay: 14s;">❄</div>
<div class="snowflake" style="left: 80%; animation-duration: 6s; animation-delay: 15s;">❄</div>
<div class="snowflake" style="left: 85%; animation-duration: 7s; animation-delay: 16s;">❄</div>
<div class="snowflake" style="left: 90%; animation-duration: 8s; animation-delay: 17s;">❄</div>
<div class="snowflake" style="left: 95%; animation-duration: 9s; animation-delay: 18s;">❄</div>
</div>
<div class="container">
<h1>个人简介</h1>
<img src="profile2.png" alt="个人头像" class="profile-img">
<p>姓名:史大有</p>
<p>学号:2435055016</p>
<p>格言:你说得对,但是原神是一款3D开放世界游戏,前面忘了,后面忘了,原神启动!</p>
<button onclick="showMessage()">了解更多</button>
</div>
<script>
function showMessage() {
alert("前面的区域请等以后再来探索吧~");
}
</script>
</body>
</html>