-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.html
545 lines (494 loc) · 21.1 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
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
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
<!DOCTYPE html>
<html lang="zh" data-theme="dark">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>新中国历史</title>
<link href="https://cdn.jsdelivr.net/npm/[email protected]/dist/full.css" rel="stylesheet" type="text/css" />
<script src="https://cdn.tailwindcss.com"></script>
<script src="https://cdn.jsdelivr.net/npm/chart.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/animejs/3.2.1/anime.min.js"></script>
<style>
@import url('https://fonts.googleapis.com/css2?family=Noto+Serif+SC:wght@400;700&display=swap');
:root {
--primary-red: #c41e3a;
--gold: #FFD700;
--bg-gradient: linear-gradient(135deg, #c41e3a 0%, #8B0000 100%);
}
body {
font-family: 'Noto Serif SC', serif;
background: var(--bg-gradient);
color: var(--gold);
min-height: 100vh;
background-attachment: fixed;
}
.hero-section {
background-image: url('https://images.unsplash.com/photo-1516094593816-df6d39d4c048');
background-size: cover;
background-position: center;
height: 60vh;
position: relative;
margin-bottom: 2rem;
}
.hero-overlay {
position: absolute;
inset: 0;
background: rgba(0, 0, 0, 0.5);
display: flex;
align-items: center;
justify-content: center;
flex-direction: column;
text-align: center;
}
.section-card {
background: rgba(255, 255, 255, 0.1);
backdrop-filter: blur(10px);
border-radius: 20px;
padding: 2rem;
margin: 2rem 0;
border: 1px solid rgba(255, 215, 0, 0.2);
box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
transition: all 0.3s ease;
}
.section-card:hover {
border-color: rgba(255, 215, 0, 0.4);
transform: translateY(-5px);
}
.timeline-item {
position: relative;
padding: 2rem;
padding-left: 3rem;
margin-left: 2rem;
border-left: 2px solid var(--gold);
margin-bottom: 2rem;
transition: all 0.3s ease;
background: rgba(255, 255, 255, 0.05);
border-radius: 10px;
}
.timeline-item::before {
content: '';
position: absolute;
left: -10px;
top: 2.5rem;
width: 20px;
height: 20px;
border-radius: 50%;
background: var(--gold);
box-shadow: 0 0 15px var(--gold);
transition: all 0.3s ease;
}
.timeline-item:hover::before {
transform: scale(1.2);
box-shadow: 0 0 25px var(--gold);
}
.stats-card {
background: rgba(255, 255, 255, 0.1);
border-radius: 15px;
padding: 1.5rem;
margin: 1rem;
border: 1px solid rgba(255, 215, 0, 0.2);
transition: all 0.3s ease;
backdrop-filter: blur(10px);
}
.stats-card:hover {
border-color: rgba(255, 215, 0, 0.4);
transform: translateY(-3px);
}
.stats-card-image {
width: 100%;
height: 200px;
object-fit: cover;
border-radius: 10px;
margin-bottom: 1rem;
}
.quiz-option {
cursor: pointer;
padding: 1rem;
margin: 0.5rem 0;
border: 1px solid var(--gold);
border-radius: 10px;
transition: all 0.3s ease;
background: rgba(255, 255, 255, 0.1);
}
.quiz-option:hover {
background: rgba(255, 215, 0, 0.2);
transform: translateX(10px);
}
.selected {
background: rgba(255, 215, 0, 0.3);
border-width: 2px;
}
.correct {
background: rgba(0, 255, 0, 0.2);
border-color: #00ff00;
}
.incorrect {
background: rgba(255, 0, 0, 0.2);
border-color: #ff0000;
}
.nav-button {
position: relative;
overflow: hidden;
transition: all 0.3s ease;
}
.nav-button::after {
content: '';
position: absolute;
bottom: 0;
left: 0;
width: 0;
height: 2px;
background: var(--gold);
transition: width 0.3s ease;
}
.nav-button:hover::after {
width: 100%;
}
@keyframes float {
0% { transform: translateY(0px); }
50% { transform: translateY(-10px); }
100% { transform: translateY(0px); }
}
.floating {
animation: float 3s ease-in-out infinite;
}
@media (max-width: 768px) {
.section-card {
margin: 1rem;
padding: 1rem;
}
.timeline-item {
margin-left: 1rem;
padding-left: 2rem;
}
.hero-section {
height: 40vh;
}
}
</style>
</head>
<body class="min-h-screen">
<nav class="sticky top-0 z-50 bg-black bg-opacity-60 backdrop-blur-md p-4 border-b border-gold/20">
<div class="container mx-auto flex justify-between items-center">
<h1 class="text-3xl font-bold bg-clip-text text-transparent bg-gradient-to-r from-yellow-400 to-yellow-600">
新中国历史
</h1>
<div class="space-x-6">
<button class="nav-button btn btn-ghost btn-sm" onclick="scrollToSection('achievements')">重大历史事件</button>
<button class="nav-button btn btn-ghost btn-sm" onclick="scrollToSection('economy')">经济发展</button>
<button class="nav-button btn btn-ghost btn-sm" onclick="scrollToSection('culture')">文化建设</button>
<button class="nav-button btn btn-ghost btn-sm" onclick="scrollToSection('quiz')">知识问答</button>
</div>
</div>
</nav>
<div class="hero-section">
<div class="hero-overlay">
<h1 class="text-5xl font-bold text-white mb-4">新中国发展历程</h1>
<p class="text-xl text-gray-200">见证辉煌历史 展望美好未来</p>
</div>
</div>
<main class="container mx-auto p-4">
<section id="achievements" class="section-card">
<h2 class="text-3xl font-bold mb-8 text-center bg-clip-text text-transparent bg-gradient-to-r from-yellow-400 to-yellow-600">
重大历史事件
</h2>
<div class="timeline">
<div class="timeline-item">
<img src="https://images.unsplash.com/photo-1600880292203-757bb62b4baf" alt="天安门" class="w-full h-48 object-cover rounded-lg mb-4">
<h3 class="text-xl font-bold text-yellow-400">1949年10月1日</h3>
<p class="mt-2">中华人民共和国成立,毛泽东主席在天安门城楼上宣布开国大典</p>
</div>
<div class="timeline-item">
<img src="https://images.unsplash.com/photo-1547981609-4b6bfe67ca0b" alt="改革开放" class="w-full h-48 object-cover rounded-lg mb-4">
<h3 class="text-xl font-bold text-yellow-400">1978年12月</h3>
<p class="mt-2">改革开放政策开始实施,十一届三中全会召开</p>
</div>
<div class="timeline-item">
<img src="https://images.unsplash.com/photo-1518458028785-8fbcd101ebb9" alt="WTO" class="w-full h-48 object-cover rounded-lg mb-4">
<h3 class="text-xl font-bold text-yellow-400">2001年12月11日</h3>
<p class="mt-2">中国正式加入世界贸易组织(WTO)</p>
</div>
<div class="timeline-item">
<img src="https://images.unsplash.com/photo-1508804185872-d7badad00f7d" alt="奥运会" class="w-full h-48 object-cover rounded-lg mb-4">
<h3 class="text-xl font-bold text-yellow-400">2008年8月8日</h3>
<p class="mt-2">北京奥运会开幕,展现中国实力</p>
</div>
</div>
</section>
<section id="economy" class="section-card">
<h2 class="text-3xl font-bold mb-8 text-center bg-clip-text text-transparent bg-gradient-to-r from-yellow-400 to-yellow-600">
经济发展
</h2>
<div class="grid grid-cols-1 md:grid-cols-2 gap-8">
<div class="stats-card floating">
<img src="https://images.unsplash.com/photo-1522202176988-66273c2fd55f" alt="改革开放" class="stats-card-image">
<h3 class="text-xl font-bold text-yellow-400 mb-4">改革开放成就</h3>
<ul class="space-y-3">
<li class="flex items-center">
<span class="mr-2">●</span>
从1978年到2021年,中国GDP年均增长约9.5%
</li>
<li class="flex items-center">
<span class="mr-2">●</span>
成为世界第二大经济体
</li>
<li class="flex items-center">
<span class="mr-2">●</span>
对外贸易总额突破6万亿美元
</li>
</ul>
</div>
<div class="stats-card floating" style="animation-delay: 0.5s">
<img src="https://images.unsplash.com/photo-1518770660439-4636190af475" alt="科技创新" class="stats-card-image">
<h3 class="text-xl font-bold text-yellow-400 mb-4">科技创新</h3>
<ul class="space-y-3">
<li class="flex items-center">
<span class="mr-2">●</span>
载人航天、深海探测、超级计算机等领域取得重大突破
</li>
<li class="flex items-center">
<span class="mr-2">●</span>
5G技术全球领先
</li>
<li class="flex items-center">
<span class="mr-2">●</span>
数字经济蓬勃发展
</li>
</ul>
</div>
</div>
</section>
<section id="culture" class="section-card">
<h2 class="text-3xl font-bold mb-8 text-center bg-clip-text text-transparent bg-gradient-to-r from-yellow-400 to-yellow-600">
文化建设
</h2>
<div class="grid grid-cols-1 md:grid-cols-2 gap-8">
<div class="stats-card floating">
<img src="https://images.unsplash.com/photo-1523050854058-8df90110c9f1" alt="教育发展" class="stats-card-image">
<h3 class="text-xl font-bold text-yellow-400 mb-4">教育发展</h3>
<ul class="space-y-3">
<li class="flex items-center">
<span class="mr-2">●</span>
九年义务教育全面普及
</li>
<li class="flex items-center">
<span class="mr-2">●</span>
高等教育毛入学率超过50%
</li>
<li class="flex items-center">
<span class="mr-2">●</span>
教育经费投入持续增加
</li>
</ul>
</div>
<div class="stats-card floating" style="animation-delay: 0.5s">
<img src="https://images.unsplash.com/photo-1518709268805-4e9042af9f23" alt="文化传承" class="stats-card-image">
<h3 class="text-xl font-bold text-yellow-400 mb-4">文化传承</h3>
<ul class="space-y-3">
<li class="flex items-center">
<span class="mr-2">●</span>
非物质文化遗产保护工作全面开展
</li>
<li class="flex items-center">
<span class="mr-2">●</span>
传统文化创新发展
</li>
<li class="flex items-center">
<span class="mr-2">●</span>
文化产业蓬勃发展
</li>
</ul>
</div>
</div>
</section>
<section id="quiz" class="section-card">
<h2 class="text-3xl font-bold mb-8 text-center bg-clip-text text-transparent bg-gradient-to-r from-yellow-400 to-yellow-600">
历史知识问答
</h2>
<div class="grid grid-cols-1 md:grid-cols-2 gap-8">
<div class="stats-card">
<h3 class="text-xl font-bold text-yellow-400 mb-4">每日一题</h3>
<div id="quiz-container">
<div id="question" class="mb-6"></div>
<div id="options" class="space-y-4"></div>
<div id="explanation" class="mt-6 p-4 rounded-lg bg-black bg-opacity-30 hidden"></div>
<button id="submit-answer" class="btn btn-outline btn-warning mt-6 w-full hover:scale-105 transition-transform">
提交答案
</button>
</div>
</div>
<div class="stats-card">
<h3 class="text-xl font-bold text-yellow-400 mb-4">答题统计</h3>
<canvas id="stats-chart"></canvas>
</div>
</div>
</section>
</main>
<script>
// 动画效果
anime({
targets: '.section-card',
opacity: [0, 1],
translateY: [50, 0],
duration: 1000,
delay: anime.stagger(200),
easing: 'easeOutExpo'
});
// 滚动到指定部分
function scrollToSection(id) {
document.getElementById(id).scrollIntoView({
behavior: 'smooth'
});
}
// 问答系统
const questions = [
{
question: "中华人民共和国成立于哪一年?",
options: ["1948年", "1949年", "1950年", "1951年"],
correct: 1,
explanation: "1949年10月1日,毛泽东主席在天安门城楼上宣布中华人民共和国成立。"
},
{
question: "改革开放政策开始于哪一年?",
options: ["1976年", "1977年", "1978年", "1979年"],
correct: 2,
explanation: "1978年12月,党的十一届三中全会召开,确立改革开放基本国策。"
},
{
question: "中国加入世界贸易组织(WTO)的年份是?",
options: ["2000年", "2001年", "2002年", "2003年"],
correct: 1,
explanation: "2001年12月11日,中国正式加入世界贸易组织,成为第143个成员国。"
}
];
let currentQuestion = 0;
let stats = {
correct: 0,
incorrect: 0
};
// 加载问题
function loadQuestion() {
const question = questions[currentQuestion];
const questionElement = document.getElementById('question');
const optionsElement = document.getElementById('options');
const explanationElement = document.getElementById('explanation');
if (!questionElement || !optionsElement || !explanationElement) {
console.error('找不到必要的DOM元素');
return;
}
try {
// 显示问题
questionElement.innerHTML = `<p class="text-lg font-bold">${question.question}</p>`;
// 生成选项
const optionsHtml = question.options.map((option, index) =>
`<div class="quiz-option" data-index="${index}">${option}</div>`
).join('');
optionsElement.innerHTML = optionsHtml;
explanationElement.classList.add('hidden');
// 添加选项点击事件
document.querySelectorAll('.quiz-option').forEach(option => {
option.addEventListener('click', selectOption);
});
} catch (error) {
console.error('加载问题时出错:', error);
questionElement.innerHTML = '<p class="text-red-500">加载问题时出错,请刷新页面重试</p>';
}
}
// 选择答案
function selectOption(e) {
try {
document.querySelectorAll('.quiz-option').forEach(opt => {
opt.classList.remove('selected');
});
e.target.classList.add('selected');
} catch (error) {
console.error('选择答案时出错:', error);
}
}
// 提交答案
function submitAnswer() {
try {
const selected = document.querySelector('.quiz-option.selected');
if (!selected) {
alert('请选择一个答案');
return;
}
const selectedIndex = parseInt(selected.dataset.index);
const question = questions[currentQuestion];
const explanationElement = document.getElementById('explanation');
if (selectedIndex === question.correct) {
stats.correct++;
selected.classList.add('correct');
} else {
stats.incorrect++;
selected.classList.add('incorrect');
document.querySelectorAll('.quiz-option')[question.correct].classList.add('correct');
}
explanationElement.innerHTML = question.explanation;
explanationElement.classList.remove('hidden');
updateStats();
// 延迟加载下一题
setTimeout(() => {
currentQuestion = (currentQuestion + 1) % questions.length;
loadQuestion();
}, 2000);
} catch (error) {
console.error('提交答案时出错:', error);
alert('提交答案时出错,请重试');
}
}
// 更新统计
function updateStats() {
try {
const ctx = document.getElementById('stats-chart').getContext('2d');
if (!ctx) {
console.error('找不到统计图表元素');
return;
}
// 销毁现有图表
const existingChart = Chart.getChart(ctx.canvas);
if (existingChart) {
existingChart.destroy();
}
// 创建新图表
new Chart(ctx, {
type: 'pie',
data: {
labels: ['正确', '错误'],
datasets: [{
data: [stats.correct, stats.incorrect],
backgroundColor: ['rgba(75, 192, 192, 0.6)', 'rgba(255, 99, 132, 0.6)']
}]
},
options: {
responsive: true,
plugins: {
legend: {
position: 'bottom',
labels: {
color: '#FFD700'
}
}
}
}
});
} catch (error) {
console.error('更新统计时出错:', error);
}
}
// 初始化
document.addEventListener('DOMContentLoaded', () => {
try {
loadQuestion();
const submitButton = document.getElementById('submit-answer');
if (submitButton) {
submitButton.addEventListener('click', submitAnswer);
}
updateStats();
} catch (error) {
console.error('初始化时出错:', error);
}
});
</script>
</body>
</html>