-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.html
More file actions
287 lines (249 loc) · 8.26 KB
/
index.html
File metadata and controls
287 lines (249 loc) · 8.26 KB
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
<!DOCTYPE html>
<html lang="zh">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>范范占卜</title>
<style>
* {
margin: 0;
padding: 0;
box-sizing: border-box;
}
body {
font-family: 'Comic Sans MS', '楷体', cursive, sans-serif;
background: #0c0e1f;
color: #f0e6d6;
min-height: 100vh;
overflow-x: hidden;
position: relative;
}
/* 星空背景效果 */
.stars {
position: fixed;
top: 0;
left: 0;
width: 100%;
height: 100%;
z-index: -1;
}
.star {
position: absolute;
background-color: white;
border-radius: 50%;
animation: twinkle 5s infinite;
}
@keyframes twinkle {
0%, 100% { opacity: 0.2; }
50% { opacity: 1; }
}
.container {
max-width: 800px;
margin: 0 auto;
padding: 30px 20px;
text-align: center;
z-index: 1;
position: relative;
}
header h1 {
font-size: 3.5rem;
margin-bottom: 15px;
color: #c77dff;
text-shadow: 0 0 10px #9d4edd, 0 0 20px #7b2cbf;
letter-spacing: 2px;
}
.subtitle {
font-size: 1.5rem;
margin-bottom: 40px;
color: #e0aaff;
}
.answer-container {
background: rgba(25, 20, 40, 0.7);
border: 2px solid #7b2cbf;
border-radius: 15px;
padding: 40px 20px;
margin: 30px 0;
box-shadow: 0 0 20px rgba(123, 44, 191, 0.5);
min-height: 200px;
display: flex;
align-items: center;
justify-content: center;
}
#answer {
font-size: 2.5rem;
line-height: 1.4;
color: #f8f9fa;
text-shadow: 0 0 5px #ff9ff3;
}
.btn {
background: linear-gradient(135deg, #7b2cbf, #5a189a);
color: white;
border: none;
border-radius: 50px;
padding: 15px 40px;
font-size: 1.5rem;
cursor: pointer;
margin: 20px 0;
transition: all 0.3s ease;
font-family: 'Comic Sans MS', '楷体', cursive;
box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
}
.btn:hover {
transform: translateY(-3px);
box-shadow: 0 8px 20px rgba(123, 44, 191, 0.6);
background: linear-gradient(135deg, #9d4edd, #7b2cbf);
}
.btn:active {
transform: translateY(1px);
}
footer {
margin-top: 50px;
padding: 20px;
border-top: 1px solid #3c096c;
color: #e0aaff;
font-size: 1.2rem;
}
.wechat-note {
font-size: 0.9rem;
margin-top: 5px;
color: #c77dff;
}
/* 魔法元素装饰 */
.crystal-ball {
width: 150px;
height: 150px;
background: radial-gradient(circle at 30% 30%, #f8f9fa, #e0aaff);
border-radius: 50%;
margin: 0 auto 30px;
box-shadow: 0 0 30px #9d4edd;
position: relative;
animation: float 6s ease-in-out infinite;
}
.crystal-ball:after {
content: '';
position: absolute;
bottom: -10px;
left: 20%;
width: 60%;
height: 20px;
background: rgba(25, 20, 40, 0.7);
border-radius: 50%;
filter: blur(10px);
}
@keyframes float {
0%, 100% { transform: translateY(0); }
50% { transform: translateY(-15px); }
}
/* 响应式设计 */
@media (max-width: 768px) {
header h1 {
font-size: 2.5rem;
}
.subtitle {
font-size: 1.2rem;
}
#answer {
font-size: 2rem;
}
.btn {
padding: 12px 30px;
font-size: 1.2rem;
}
}
</style>
</head>
<body>
<!-- 星空背景 -->
<div class="stars" id="stars"></div>
<div class="container">
<header>
<h1>范范占卜</h1>
<p class="subtitle">静心默念问题,点【获取答案】</p>
</header>
<div class="crystal-ball"></div>
<div class="answer-container">
<div id="answer">你的答案将在这里显示...</div>
</div>
<button class="btn" id="generateBtn">获取答案</button>
<footer>
<div>微信: FanX414</div>
<div class="wechat-note">【加好友占卜】</div>
</footer>
</div>
<script>
// 创建星空背景 [7](@ref)
function createStars() {
const starsContainer = document.getElementById('stars');
const starCount = 150;
for (let i = 0; i < starCount; i++) {
const star = document.createElement('div');
star.classList.add('star');
// 随机大小和位置
const size = Math.random() * 3;
star.style.width = `${size}px`;
star.style.height = `${size}px`;
star.style.left = `${Math.random() * 100}%`;
star.style.top = `${Math.random() * 100}%`;
// 随机动画延迟
star.style.animationDelay = `${Math.random() * 5}s`;
starsContainer.appendChild(star);
}
}
// 答案之书内容 [1,3](@ref)
const answers = [
"是的,毫无疑问。",
"不,现在不是时候。",
"或许,再等等看。",
"相信你的直觉。",
"机会很大,但需努力。",
"保持耐心,好事将至。",
"改变你的视角。",
"跟随你的心。",
"答案在你心中。",
"未来一片光明。",
"谨慎行事。",
"是的,但需要行动。",
"不,避免风险。",
"可能性很高。",
"需要更多信息。",
"顺其自然。",
"会有惊喜。",
"专注当下。",
"放手一搏。",
"结果会超出预期。",
"寻求他人建议。",
"信任这个过程。",
"一切都会好起来。",
"保持积极心态。",
"时机已成熟。",
"重新考虑你的选择。",
"答案即将揭晓。",
"跟随命运的指引。",
"小小冒险会带来回报。",
"倾听内心的声音。"
];
// 随机答案生成函数 [1](@ref)
function generateRandomAnswer() {
const randomIndex = Math.floor(Math.random() * answers.length);
return answers[randomIndex];
}
// 按钮点击事件 [1](@ref)
document.getElementById('generateBtn').addEventListener('click', function() {
const answerElement = document.getElementById('answer');
// 添加一些动画效果
answerElement.style.opacity = '0';
answerElement.style.transform = 'scale(0.8)';
setTimeout(() => {
const randomAnswer = generateRandomAnswer();
answerElement.textContent = randomAnswer;
answerElement.style.opacity = '1';
answerElement.style.transform = 'scale(1)';
}, 300);
});
// 初始化
window.onload = function() {
createStars();
};
</script>
</body>
</html>