-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathdata_cn.html
More file actions
550 lines (497 loc) · 25.3 KB
/
Copy pathdata_cn.html
File metadata and controls
550 lines (497 loc) · 25.3 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
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
546
547
548
549
550
<!DOCTYPE html>
<html lang="zh">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>趣味数据 - 番组季节追踪</title>
<meta name="description" content="探索动画趋势、统计和见解。">
<!-- Favicon -->
<link rel="icon"
href="data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 100 100'><text y='0.9em' font-size='90'>📊</text></svg>">
<!-- Tailwind CSS CDN -->
<script src="https://cdn.tailwindcss.com"></script>
<!-- Chart.js CDN -->
<script src="https://cdn.jsdelivr.net/npm/chart.js@4.4.0/dist/chart.umd.min.js"></script>
<style>
body {
font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
}
/* Dark Mode Variables and Styles */
:root {
--bg-primary: #f9fafb;
--bg-secondary: #ffffff;
--bg-tertiary: #f3f4f6;
--text-primary: #111827;
--text-secondary: #6b7280;
--border-color: #e5e7eb;
--border-color-light: #d1d5db;
--shadow: rgba(0, 0, 0, 0.1);
--shadow-hover: rgba(0, 0, 0, 0.15);
}
.dark {
--bg-primary: #111827;
--bg-secondary: #1f2937;
--bg-tertiary: #374151;
--text-primary: #f9fafb;
--text-secondary: #d1d5db;
--border-color: #374151;
--border-color-light: #4b5563;
--shadow: rgba(0, 0, 0, 0.3);
--shadow-hover: rgba(0, 0, 0, 0.5);
}
body {
background-color: var(--bg-primary);
color: var(--text-primary);
}
/* Dark Mode Toggle Button */
.theme-toggle {
position: relative;
width: 60px;
height: 30px;
background-color: var(--bg-tertiary);
border-radius: 15px;
cursor: pointer;
transition: background-color 0.3s ease;
border: 2px solid var(--border-color);
}
.theme-toggle-slider {
position: absolute;
top: 2px;
left: 2px;
width: 22px;
height: 22px;
background-color: var(--bg-secondary);
border-radius: 50%;
transition: transform 0.3s ease;
display: flex;
align-items: center;
justify-content: center;
font-size: 12px;
}
.dark .theme-toggle-slider {
transform: translateX(30px);
}
/* Keyframe Animations */
@keyframes fadeIn {
from {
opacity: 0;
transform: translateY(20px);
}
to {
opacity: 1;
transform: translateY(0);
}
}
.animate-fade-in {
animation: fadeIn 0.6s ease-out;
}
/* Smooth scroll */
html {
scroll-behavior: smooth;
}
/* Language Dropdown Styles */
.lang-dropdown {
position: relative;
display: inline-block;
}
.lang-dropdown-button {
display: flex;
align-items: center;
gap: 6px;
padding: 8px 12px;
border-radius: 8px;
font-size: 14px;
font-weight: 500;
cursor: pointer;
transition: all 0.2s ease;
border: 1px solid var(--border-color);
background-color: var(--bg-tertiary);
color: var(--text-primary);
}
.lang-dropdown-button:hover {
background-color: var(--bg-secondary);
}
.lang-dropdown-menu {
position: absolute;
top: calc(100% + 4px);
right: 0;
min-width: 120px;
background-color: var(--bg-secondary);
border: 1px solid var(--border-color);
border-radius: 8px;
box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
opacity: 0;
visibility: hidden;
transform: translateY(-8px);
transition: all 0.2s ease;
z-index: 1000;
overflow: hidden;
}
.lang-dropdown.open .lang-dropdown-menu {
opacity: 1;
visibility: visible;
transform: translateY(0);
}
.lang-dropdown-item {
display: block;
padding: 10px 16px;
color: var(--text-primary);
text-decoration: none;
transition: background-color 0.2s ease;
cursor: pointer;
font-size: 14px;
}
.lang-dropdown-item:hover {
background-color: var(--bg-tertiary);
}
.lang-dropdown-item.active {
background-color: var(--bg-tertiary);
font-weight: 600;
}
/* Button styles with dark mode support */
.btn-primary {
background-color: #1f2937;
color: #ffffff;
transition: all 0.2s ease;
}
.btn-primary:hover {
background-color: #374151;
}
.dark .btn-primary {
background-color: #4b5563;
color: #ffffff;
}
.dark .btn-primary:hover {
background-color: #6b7280;
}
.btn-secondary {
background-color: var(--bg-tertiary);
color: var(--text-primary);
transition: all 0.2s ease;
}
.btn-secondary:hover {
background-color: var(--border-color-light);
}
.dark .btn-secondary:hover {
background-color: #4b5563;
}
</style>
</head>
<body class="min-h-screen flex flex-col" style="background-color: var(--bg-primary);">
<!-- Header -->
<header class="sticky top-0 z-50 shadow-md animate-fade-in"
style="background-color: var(--bg-secondary); border-bottom: 1px solid var(--border-color);">
<div class="max-w-7xl mx-auto px-4 py-6">
<div class="flex items-center justify-between">
<div>
<h1 class="text-3xl font-bold" style="color: var(--text-primary);">📊 趣味数据</h1>
<p class="mt-1" style="color: var(--text-secondary);">探索动画趋势、统计和见解</p>
</div>
<nav class="flex gap-3 items-center">
<a href="index_cn.html" class="px-4 py-2 rounded-lg transition-colors"
style="background-color: var(--bg-tertiary); color: var(--text-primary);">
首页
</a>
<a href="data_cn.html" class="px-4 py-2 rounded-lg transition-colors btn-primary">
数据
</a>
<a href="random_cn.html" class="px-4 py-2 rounded-lg transition-colors"
style="background-color: var(--bg-tertiary); color: var(--text-primary);">
随机
</a>
<div class="lang-dropdown" id="lang-dropdown">
<button class="lang-dropdown-button" id="lang-dropdown-button" aria-label="选择语言">
<span>🌐</span>
<span id="lang-current">中文</span>
<svg class="w-4 h-4" fill="none" stroke="currentColor" viewBox="0 0 24 24">
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2"
d="M19 9l-7 7-7-7"></path>
</svg>
</button>
<div class="lang-dropdown-menu">
<a href="#" class="lang-dropdown-item" data-lang="en" data-page="data">English</a>
<a href="#" class="lang-dropdown-item active" data-lang="zh" data-page="data_cn">中文</a>
</div>
</div>
<div class="theme-toggle" id="theme-toggle" role="button" aria-label="Toggle dark mode">
<div class="theme-toggle-slider">
<span id="theme-icon">☀️</span>
</div>
</div>
</nav>
</div>
</div>
</header>
<!-- Main Content -->
<main class="container mx-auto px-4 py-8 flex-grow">
<!-- Rating Trend Graph -->
<div id="rating-trend-section" class="rounded-lg p-6 mb-8 animate-fade-in"
style="background-color: var(--bg-secondary); border: 1px solid var(--border-color);">
<h2 class="text-2xl font-bold mb-4" style="color: var(--text-primary);">📈 平均评分趋势</h2>
<p class="mb-6" style="color: var(--text-secondary);">动画评分随时间的演变(数据来自 Bangumi)</p>
<div class="relative" style="height: 400px;">
<canvas id="rating-trend-chart"></canvas>
</div>
<div class="mt-4 grid grid-cols-1 sm:grid-cols-3 gap-4 text-center">
<div class="rounded-lg p-3" style="background-color: var(--bg-tertiary);">
<div class="text-2xl font-bold" style="color: var(--text-primary);" id="overall-avg">-</div>
<div class="text-sm" style="color: var(--text-secondary);">总体平均</div>
</div>
<div class="rounded-lg p-3" style="background-color: var(--bg-tertiary);">
<div class="text-2xl font-bold text-green-600" id="highest-avg">-</div>
<div class="text-sm" style="color: var(--text-secondary);">最高季度</div>
</div>
<div class="rounded-lg p-3" style="background-color: var(--bg-tertiary);">
<div class="text-2xl font-bold text-red-600" id="lowest-avg">-</div>
<div class="text-sm" style="color: var(--text-secondary);">最低季度</div>
</div>
</div>
</div>
<!-- Genre Trends -->
<div id="genre-trends-section" class="rounded-lg p-6 mb-8 animate-fade-in"
style="background-color: var(--bg-secondary); border: 1px solid var(--border-color);">
<h2 class="text-2xl font-bold mb-4" style="color: var(--text-primary);">🎭 类型趋势随时间变化(按年)</h2>
<p class="mb-6" style="color: var(--text-secondary);">十大最受欢迎的动画类型 - 绝对数量 vs 产量占比</p>
<div class="grid grid-cols-1 gap-6">
<div>
<h3 class="text-lg font-semibold mb-3" style="color: var(--text-primary);">绝对数量</h3>
<div class="relative" style="height: 450px;">
<canvas id="genre-trends-chart"></canvas>
</div>
</div>
<div>
<h3 class="text-lg font-semibold mb-3" style="color: var(--text-primary);">占总产量的百分比</h3>
<div class="relative" style="height: 450px;">
<canvas id="genre-trends-percentage-chart"></canvas>
</div>
</div>
</div>
</div>
<!-- Genre Trends By Season -->
<div id="genre-trends-by-season-section" class="rounded-lg p-6 mb-8 animate-fade-in"
style="background-color: var(--bg-secondary); border: 1px solid var(--border-color);">
<h2 class="text-2xl font-bold mb-4" style="color: var(--text-primary);">🎭 类型趋势随时间变化(按季度)</h2>
<p class="mb-6" style="color: var(--text-secondary);">按季度追踪的十大最受欢迎动画类型,用于更细致的趋势分析</p>
<div class="grid grid-cols-1 gap-6">
<div>
<h3 class="text-lg font-semibold mb-3" style="color: var(--text-primary);">绝对数量</h3>
<div class="relative" style="height: 450px;">
<canvas id="genre-trends-by-season-chart"></canvas>
</div>
</div>
<div>
<h3 class="text-lg font-semibold mb-3" style="color: var(--text-primary);">占总产量百分比</h3>
<div class="relative" style="height: 450px;">
<canvas id="genre-trends-by-season-percentage-chart"></canvas>
</div>
</div>
</div>
</div>
<!-- Production Volume -->
<div id="production-volume-section" class="rounded-lg p-6 mb-8 animate-fade-in"
style="background-color: var(--bg-secondary); border: 1px solid var(--border-color);">
<h2 class="text-2xl font-bold mb-4" style="color: var(--text-primary);">📈 动画产量</h2>
<p class="mb-6" style="color: var(--text-secondary);">每年制作的 TV 动画总数 - 追踪行业增长</p>
<div class="relative" style="height: 400px;">
<canvas id="production-volume-chart"></canvas>
</div>
<div class="mt-4 grid grid-cols-1 sm:grid-cols-3 gap-4 text-center">
<div class="rounded-lg p-3" style="background-color: var(--bg-tertiary);">
<div class="text-2xl font-bold" style="color: var(--text-primary);" id="total-anime">-</div>
<div class="text-sm" style="color: var(--text-secondary);">动画总数 (2006-2026)</div>
</div>
<div class="rounded-lg p-3" style="background-color: var(--bg-tertiary);">
<div class="text-2xl font-bold text-blue-600" id="avg-per-year">-</div>
<div class="text-sm" style="color: var(--text-secondary);">年均产量</div>
</div>
<div class="rounded-lg p-3" style="background-color: var(--bg-tertiary);">
<div class="text-2xl font-bold text-green-600" id="peak-year">-</div>
<div class="text-sm" style="color: var(--text-secondary);">峰值年份</div>
</div>
</div>
</div>
<!-- Seasonal Patterns -->
<div id="seasonal-patterns-section" class="rounded-lg p-6 mb-8 animate-fade-in"
style="background-color: var(--bg-secondary); border: 1px solid var(--border-color);">
<h2 class="text-2xl font-bold mb-4" style="color: var(--text-primary);">🗓️ 季节性模式</h2>
<p class="mb-6" style="color: var(--text-secondary);">历史数据中哪个季度评分最高、动画最多?</p>
<div class="grid grid-cols-1 lg:grid-cols-2 gap-6">
<div class="relative" style="height: 350px;">
<canvas id="seasonal-ratings-chart"></canvas>
</div>
<div class="relative" style="height: 350px;">
<canvas id="seasonal-counts-chart"></canvas>
</div>
</div>
<div class="mt-4 grid grid-cols-1 sm:grid-cols-2 gap-4 text-center">
<div class="rounded-lg p-3" style="background-color: var(--bg-tertiary);">
<div class="text-xl font-bold text-blue-600" id="highest-rated-season">-</div>
<div class="text-sm" style="color: var(--text-secondary);">评分最高季度</div>
</div>
<div class="rounded-lg p-3" style="background-color: var(--bg-tertiary);">
<div class="text-xl font-bold text-green-600" id="most-productive-season">-</div>
<div class="text-sm" style="color: var(--text-secondary);">产量最高季度</div>
</div>
</div>
</div>
<!-- Studio Rankings -->
<div id="studio-rankings-section" class="rounded-lg p-6 mb-8 animate-fade-in"
style="background-color: var(--bg-secondary); border: 1px solid var(--border-color);">
<h2 class="text-2xl font-bold mb-4" style="color: var(--text-primary);">🏢 制作公司排名</h2>
<p class="mb-6" style="color: var(--text-secondary);">比较最多产的制作公司 vs 质量最高的制作公司</p>
<div class="grid grid-cols-1 lg:grid-cols-2 gap-6">
<div>
<h3 class="text-lg font-semibold mb-3" style="color: var(--text-primary);">产量 TOP 15</h3>
<div class="relative" style="height: 500px;">
<canvas id="studio-quantity-chart"></canvas>
</div>
</div>
<div>
<h3 class="text-lg font-semibold mb-3" style="color: var(--text-primary);">质量 TOP 15</h3>
<div class="relative" style="height: 500px;">
<canvas id="studio-quality-chart"></canvas>
</div>
</div>
</div>
</div>
<!-- Studio Scatter Plot -->
<div id="studio-scatter-section" class="rounded-lg p-6 mb-8 animate-fade-in"
style="background-color: var(--bg-secondary); border: 1px solid var(--border-color);">
<h2 class="text-2xl font-bold mb-4" style="color: var(--text-primary);">🎯 制作公司表现分析</h2>
<p class="mb-6" style="color: var(--text-secondary);">制作公司平均评分 vs 作品数量 - 带平均参考线</p>
<div class="relative" style="height: 600px;">
<canvas id="studio-scatter-chart"></canvas>
</div>
<div class="mt-4 grid grid-cols-1 sm:grid-cols-3 gap-4 text-center">
<div class="rounded-lg p-3" style="background-color: var(--bg-tertiary);">
<div class="text-2xl font-bold" style="color: var(--text-primary);" id="total-studios">-
</div>
<div class="text-sm" style="color: var(--text-secondary);">制作公司总数</div>
</div>
<div class="rounded-lg p-3" style="background-color: var(--bg-tertiary);">
<div class="text-2xl font-bold text-red-600" id="mean-rating">-</div>
<div class="text-sm" style="color: var(--text-secondary);">平均评分</div>
</div>
<div class="rounded-lg p-3" style="background-color: var(--bg-tertiary);">
<div class="text-2xl font-bold text-green-600" id="mean-count">-</div>
<div class="text-sm" style="color: var(--text-secondary);">平均作品数</div>
</div>
</div>
</div>
<!-- Studio Scatter Plot (Filtered 5+ Anime) -->
<div id="studio-scatter-filtered-section" class="rounded-lg p-6 mb-8 animate-fade-in"
style="background-color: var(--bg-secondary); border: 1px solid var(--border-color);">
<h2 class="text-2xl font-bold mb-4" style="color: var(--text-primary);">🎯 制作公司表现分析 (5+ 动画)</h2>
<p class="mb-6" style="color: var(--text-secondary);">筛选视图:仅显示作品数5部以上的制作公司 - 带平均参考线</p>
<div class="relative" style="height: 600px;">
<canvas id="studio-scatter-filtered-chart"></canvas>
</div>
<div class="mt-4 grid grid-cols-1 sm:grid-cols-3 gap-4 text-center">
<div class="rounded-lg p-3" style="background-color: var(--bg-tertiary);">
<div class="text-2xl font-bold" style="color: var(--text-primary);" id="total-studios-filtered">-
</div>
<div class="text-sm" style="color: var(--text-secondary);">制作公司总数(5部以上)</div>
</div>
<div class="rounded-lg p-3" style="background-color: var(--bg-tertiary);">
<div class="text-2xl font-bold text-red-600" id="mean-rating-filtered">-</div>
<div class="text-sm" style="color: var(--text-secondary);">平均评分</div>
</div>
<div class="rounded-lg p-3" style="background-color: var(--bg-tertiary);">
<div class="text-2xl font-bold text-green-600" id="mean-count-filtered">-</div>
<div class="text-sm" style="color: var(--text-secondary);">平均产量</div>
</div>
</div>
</div>
<!-- Studio Scatter Plot (Filtered 10+ Anime) -->
<div id="studio-scatter-filtered-10-section" class="rounded-lg p-6 mb-8 animate-fade-in"
style="background-color: var(--bg-secondary); border: 1px solid var(--border-color);">
<h2 class="text-2xl font-bold mb-4" style="color: var(--text-primary);">🎯 制作公司表现分析 (10+ 动画)</h2>
<p class="mb-6" style="color: var(--text-secondary);">聚焦视图:仅显示作品数10部以上的主要制作公司 - 带平均参考线</p>
<div class="relative" style="height: 600px;">
<canvas id="studio-scatter-filtered-10-chart"></canvas>
</div>
<div class="mt-4 grid grid-cols-1 sm:grid-cols-3 gap-4 text-center">
<div class="rounded-lg p-3" style="background-color: var(--bg-tertiary);">
<div class="text-2xl font-bold" style="color: var(--text-primary);" id="total-studios-filtered-10">-
</div>
<div class="text-sm" style="color: var(--text-secondary);">制作公司总数(10部以上)</div>
</div>
<div class="rounded-lg p-3" style="background-color: var(--bg-tertiary);">
<div class="text-2xl font-bold text-red-600" id="mean-rating-filtered-10">-</div>
<div class="text-sm" style="color: var(--text-secondary);">平均评分</div>
</div>
<div class="rounded-lg p-3" style="background-color: var(--bg-tertiary);">
<div class="text-2xl font-bold text-green-600" id="mean-count-filtered-10">-</div>
<div class="text-sm" style="color: var(--text-secondary);">平均产量</div>
</div>
</div>
</div>
</main>
<!-- Footer -->
<footer class="mt-auto" style="background-color: var(--bg-secondary); border-top: 1px solid var(--border-color);">
<div class="max-w-7xl mx-auto px-4 py-6 text-center text-sm" style="color: var(--text-secondary);">
<p>数据来自 <a href="https://bgm.tv/" target="_blank" class="hover:underline"
style="color: var(--text-primary);">Bangumi 番组计划</a> • 自动更新</p>
<p class="mt-2" style="color: var(--text-secondary); font-size: 0.75rem;">
⚠️ 中文版和英文版使用不同数据源(Bangumi vs MyAnimeList),数据可能存在差异
</p>
<p class="mt-2">
本项目开源 •
<a href="https://github.com/Ate329/anime-stats-tracker" target="_blank" class="hover:underline"
style="color: var(--text-primary);">在 GitHub 上查看</a>
</p>
<p class="mt-1">Created by <a href="https://github.com/Ate329" target="_blank" class="hover:underline"
style="color: var(--text-primary);">@Ate329</a></p>
</div>
</footer>
<!-- Script -->
<script>
// Dark mode toggle functionality
const themeToggle = document.getElementById('theme-toggle');
const themeIcon = document.getElementById('theme-icon');
const html = document.documentElement;
// Check for saved theme preference or default to light mode
const currentTheme = localStorage.getItem('theme') || 'light';
if (currentTheme === 'dark') {
html.classList.add('dark');
themeIcon.textContent = '🌙';
}
themeToggle.addEventListener('click', () => {
html.classList.toggle('dark');
const isDark = html.classList.contains('dark');
themeIcon.textContent = isDark ? '🌙' : '☀️';
localStorage.setItem('theme', isDark ? 'dark' : 'light');
// Reload all charts with new theme colors
reloadAllCharts();
});
// Language dropdown functionality
const langDropdown = document.getElementById('lang-dropdown');
const langDropdownButton = document.getElementById('lang-dropdown-button');
const langCurrent = document.getElementById('lang-current');
// Toggle dropdown
langDropdownButton.addEventListener('click', (e) => {
e.stopPropagation();
langDropdown.classList.toggle('open');
});
// Close dropdown when clicking outside
document.addEventListener('click', (e) => {
if (!langDropdown.contains(e.target)) {
langDropdown.classList.remove('open');
}
});
// Handle language selection
document.querySelectorAll('.lang-dropdown-item').forEach(item => {
item.addEventListener('click', (e) => {
e.preventDefault();
const targetLang = item.dataset.lang;
const targetPage = item.dataset.page;
// Build the new URL
let newUrl = targetPage + '.html';
// Navigate to the new page
window.location.href = newUrl;
});
});
</script>
<script src="data_cn.js"></script>
</body>
</html>