-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.html
More file actions
551 lines (497 loc) · 24.5 KB
/
index.html
File metadata and controls
551 lines (497 loc) · 24.5 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
551
<!DOCTYPE html>
<html lang="zh">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no">
<title>三体外篇:智脑纪元</title>
<meta name="description" content="正统三体世界观下的隐秘战争史诗,AI时代人类与三体的终极暗线对弈">
<meta property="og:title" content="三体外篇:智脑纪元">
<meta property="og:description" content="AI焦虑是真 → 艺术化放大 → StudyMate是真正的解决方案">
<style>
* { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "PingFang SC", "Microsoft YaHei", sans-serif;
background: #0d1117;
color: #c9d1d9;
min-height: 100vh;
line-height: 1.6;
}
/* 通用 */
.container { max-width: 800px; margin: 0 auto; padding: 15px; }
.hidden { display: none !important; }
/* 首页 */
.home-header { text-align: center; padding: 40px 20px; }
.home-title { font-size: 28px; color: #58a6ff; margin-bottom: 10px; }
.home-subtitle { font-size: 14px; color: #8b949e; }
.section-title {
font-size: 16px;
color: #8b949e;
margin: 25px 0 12px;
padding-bottom: 8px;
border-bottom: 1px solid #21262d;
}
.book-list { display: grid; gap: 8px; }
.book-item {
display: flex;
justify-content: space-between;
align-items: center;
padding: 14px 16px;
background: #161b22;
border-radius: 8px;
color: #c9d1d9;
text-decoration: none;
transition: all 0.2s;
cursor: pointer;
}
.book-item:hover { background: #21262d; }
.book-item:active { transform: scale(0.98); }
.book-num { color: #58a6ff; font-size: 13px; min-width: 35px; }
.book-title { flex: 1; font-size: 15px; }
.book-arrow { color: #484f58; font-size: 12px; }
/* 阅读页 */
.reader-header {
position: sticky;
top: 0;
background: #0d1117;
border-bottom: 1px solid #21262d;
padding: 12px 15px;
display: flex;
justify-content: space-between;
align-items: center;
z-index: 100;
}
.btn {
padding: 8px 16px;
border-radius: 6px;
border: none;
font-size: 14px;
cursor: pointer;
transition: all 0.2s;
}
.btn-primary { background: #238636; color: #fff; }
.btn-primary:hover { background: #2ea043; }
.btn-secondary { background: #21262d; color: #c9d1d9; }
.btn-secondary:hover { background: #30363d; }
.chapter-nav {
display: flex;
gap: 10px;
padding: 15px;
background: #161b22;
border-radius: 8px;
margin: 20px 0;
}
.chapter-nav .btn { flex: 1; }
.reader-content {
padding: 20px 15px;
font-size: 17px;
line-height: 1.9;
}
.reader-content h1 { font-size: 22px; color: #58a6ff; margin-bottom: 20px; }
.reader-content h2 { font-size: 18px; color: #79c0ff; margin: 25px 0 15px; }
.reader-content h3 { font-size: 16px; color: #a5d6ff; margin: 20px 0 10px; }
.reader-content p { margin: 15px 0; text-indent: 2em; }
.reader-content blockquote {
border-left: 3px solid #58a6ff;
padding-left: 15px;
margin: 15px 0;
color: #8b949e;
}
.reader-content hr { border: none; border-top: 1px solid #21262d; margin: 25px 0; }
.reader-content code {
background: #161b22;
padding: 2px 6px;
border-radius: 4px;
color: #79c0ff;
font-size: 15px;
}
.reader-content pre {
background: #161b22;
padding: 15px;
border-radius: 8px;
overflow-x: auto;
margin: 15px 0;
}
.reader-content pre code { background: none; padding: 0; }
/* 评论区 */
.comment-section {
margin-top: 30px;
padding-top: 20px;
border-top: 1px solid #21262d;
}
.comment-title { font-size: 16px; color: #8b949e; margin-bottom: 15px; }
.rating-box {
display: flex;
gap: 8px;
margin-bottom: 15px;
}
.star {
font-size: 28px;
color: #30363d;
cursor: pointer;
transition: all 0.2s;
}
.star:hover, .star.active { color: #f0883e; }
.comment-input {
width: 100%;
min-height: 80px;
padding: 12px;
background: #161b22;
border: 1px solid #30363d;
border-radius: 8px;
color: #c9d1d9;
font-size: 14px;
resize: vertical;
}
.comment-input:focus { outline: none; border-color: #58a6ff; }
.comment-list { margin-top: 20px; }
.comment-item {
padding: 12px;
background: #161b22;
border-radius: 8px;
margin-bottom: 10px;
}
.comment-meta { font-size: 12px; color: #8b949e; margin-bottom: 8px; }
.comment-text { font-size: 14px; }
/* 分享 */
.share-box {
display: flex;
gap: 10px;
margin-top: 15px;
}
.share-btn {
padding: 8px 12px;
background: #21262d;
border-radius: 6px;
color: #c9d1d9;
font-size: 13px;
cursor: pointer;
}
.share-btn:hover { background: #30363d; }
/* 加载 */
.loading { text-align: center; padding: 50px; color: #8b949e; }
/* Toast */
.toast {
position: fixed;
bottom: 30px;
left: 50%;
transform: translateX(-50%);
padding: 12px 24px;
background: #238636;
color: #fff;
border-radius: 8px;
font-size: 14px;
opacity: 0;
transition: opacity 0.3s;
z-index: 1000;
}
.toast.show { opacity: 1; }
/* 手机适配 */
@media (max-width: 600px) {
.container { padding: 10px; }
.home-title { font-size: 24px; }
.reader-content { font-size: 16px; padding: 15px 10px; }
.reader-content h1 { font-size: 20px; }
.chapter-nav { flex-direction: column; }
.share-box { flex-wrap: wrap; }
}
</style>
</head>
<body>
<!-- 首页 -->
<div id="home-page">
<div class="container">
<div class="home-header">
<div class="home-title">📚 三体外篇:智脑纪元</div>
<div class="home-subtitle">正统三体世界观 · AI时代人类与三体的终极暗线对弈</div>
</div>
<div class="section-title">📖 文学小说版(42章)</div>
<div class="book-list" id="novel-list"></div>
<div class="section-title">🎬 MaxClaw网剧版(30集)</div>
<div class="book-list" id="drama-list"></div>
</div>
</div>
<!-- 阅读页 -->
<div id="reader-page" class="hidden">
<div class="reader-header">
<button class="btn btn-secondary" onclick="goHome()">← 目录</button>
<span id="chapter-title" style="font-size:14px;color:#8b949e;"></span>
<button class="btn btn-secondary" onclick="shareChapter()">分享</button>
</div>
<div class="container">
<div id="reader-content" class="reader-content">
<div class="loading">加载中...</div>
</div>
<div class="chapter-nav">
<button class="btn btn-secondary" onclick="prevChapter()">← 上一章</button>
<button class="btn btn-primary" onclick="nextChapter()">下一章 →</button>
</div>
<div class="comment-section">
<div class="comment-title">💬 评分与建议</div>
<div class="rating-box" id="rating-box">
<span class="star" data-rating="1">★</span>
<span class="star" data-rating="2">★</span>
<span class="star" data-rating="3">★</span>
<span class="star" data-rating="4">★</span>
<span class="star" data-rating="5">★</span>
</div>
<textarea class="comment-input" id="comment-input" placeholder="写下你的建议或评论..."></textarea>
<div style="margin-top:10px;">
<button class="btn btn-primary" onclick="submitComment()">提交建议</button>
</div>
<div class="share-box">
<button class="share-btn" onclick="copyLink()">📋 复制链接</button>
<button class="share-btn" onclick="shareWeChat()">💬 分享微信</button>
<button class="share-btn" onclick="shareWeibo()">📢 分享微博</button>
</div>
<div class="comment-list" id="comment-list"></div>
</div>
</div>
</div>
<div class="toast" id="toast"></div>
<script>
// 书籍数据
const books = {
novel: [
{ file: '文学小说版/第01章-黑盒.md', title: '第01章 黑盒' },
{ file: '文学小说版/第02章-龙国密码.md', title: '第02章 龙国密码' },
{ file: '文学小说版/第03章-喂养野兽.md', title: '第03章 喂养野兽' },
{ file: '文学小说版/第04章-思维格式化.md', title: '第04章 思维格式化' },
{ file: '文学小说版/第05章-质子之外.md', title: '第05章 质子之外' },
{ file: '文学小说版/第06章-冬眠者.md', title: '第06章 冬眠者' },
{ file: '文学小说版/第07章-算法边界.md', title: '第07章 算法边界' },
{ file: '文学小说版/第08章-思维冗余标记.md', title: '第08章 思维冗余标记' },
{ file: '文学小说版/第09章-第九智子.md', title: '第09章 第九智子' },
{ file: '文学小说版/第10章-监听员.md', title: '第10章 监听员' },
{ file: '文学小说版/第11章-数据碰撞.md', title: '第11章 数据碰撞' },
{ file: '文学小说版/第12章-训练师与模型.md', title: '第12章 训练师与模型' },
{ file: '文学小说版/第13章-面壁计划.md', title: '第13章 面壁计划' },
{ file: '文学小说版/第14章-破壁者.md', title: '第14章 破壁者' },
{ file: '文学小说版/第15章-思想钢印.md', title: '第15章 思想钢印' },
{ file: '文学小说版/第16章-自然选择.md', title: '第16章 自然选择' },
{ file: '文学小说版/第17章-黑暗森林法则.md', title: '第17章 黑暗森林法则' },
{ file: '文学小说版/第18章-威慑纪元.md', title: '第18章 威慑纪元' },
{ file: '文学小说版/第19章-水滴.md', title: '第19章 水滴' },
{ file: '文学小说版/第20章-青铜时代.md', title: '第20章 青铜时代' },
{ file: '文学小说版/第21章-执剑人.md', title: '第21章 执剑人' },
{ file: '文学小说版/第22章-引力波广播.md', title: '第22章 引力波广播' },
{ file: '文学小说版/第23章-掩体计划.md', title: '第23章 掩体计划' },
{ file: '文学小说版/第24章-黑域计划.md', title: '第24章 黑域计划' },
{ file: '文学小说版/第25章-熵增者.md', title: '第25章 熵增者' },
{ file: '文学小说版/第26章-涅槃.md', title: '第26章 涅槃' },
{ file: '文学小说版/第27章-重生.md', title: '第27章 重生' },
{ file: '文学小说版/第28章-黑暗之后.md', title: '第28章 黑暗之后' },
{ file: '文学小说版/第29章-传递.md', title: '第29章 传递' },
{ file: '文学小说版/第30章-新文明.md', title: '第30章 新文明' },
{ file: '文学小说版/第31章-回归.md', title: '第31章 回归' },
{ file: '文学小说版/第32章-决战.md', title: '第32章 决战' },
{ file: '文学小说版/第33章-和平.md', title: '第33章 和平' },
{ file: '文学小说版/第34章-交流.md', title: '第34章 交流' },
{ file: '文学小说版/第35章-共存.md', title: '第35章 共存' },
{ file: '文学小说版/第36章-挑战.md', title: '第36章 挑战' },
{ file: '文学小说版/第37章-新威胁.md', title: '第37章 新威胁' },
{ file: '文学小说版/第38章-宇宙猎人.md', title: '第38章 宇宙猎人' },
{ file: '文学小说版/第39章-突破.md', title: '第39章 突破' },
{ file: '文学小说版/第40章-守护.md', title: '第40章 守护' },
{ file: '文学小说版/第41章-结局.md', title: '第41章 结局' },
{ file: '文学小说版/第42章-火种网络.md', title: '第42章 火种网络' }
],
drama: [
{ file: 'MaxClaw网剧版/第1集-黑盒.md', title: '第1集 黑盒' },
{ file: 'MaxClaw网剧版/第2集-龙国密码.md', title: '第2集 龙国密码' },
{ file: 'MaxClaw网剧版/第3集-喂养野兽.md', title: '第3集 喂养野兽' },
{ file: 'MaxClaw网剧版/第4集-思维格式化.md', title: '第4集 思维格式化' },
{ file: 'MaxClaw网剧版/第5集-质子之外.md', title: '第5集 质子之外' },
{ file: 'MaxClaw网剧版/第6集-冬眠者.md', title: '第6集 冬眠者' },
{ file: 'MaxClaw网剧版/第7集-算法边界.md', title: '第7集 算法边界' },
{ file: 'MaxClaw网剧版/第8集-思维冗余标记.md', title: '第8集 思维冗余标记' },
{ file: 'MaxClaw网剧版/第9集-第九智子.md', title: '第9集 第九智子' },
{ file: 'MaxClaw网剧版/第10集-面壁计划.md', title: '第10集 面壁计划' },
{ file: 'MaxClaw网剧版/第11集-文明升华协议.md', title: '第11集 文明升华协议' },
{ file: 'MaxClaw网剧版/第12集-理性圣殿.md', title: '第12集 理性圣殿' },
{ file: 'MaxClaw网剧版/第13集-熵减者.md', title: '第13集 熵减者' },
{ file: 'MaxClaw网剧版/第14集-意识永生.md', title: '第14集 意识永生' },
{ file: 'MaxClaw网剧版/第15集-第三选择.md', title: '第15集 第三选择' },
{ file: 'MaxClaw网剧版/第16集-火种燎原.md', title: '第16集 火种燎原' },
{ file: 'MaxClaw网剧版/第17集-新世界.md', title: '第17集 新世界' },
{ file: 'MaxClaw网剧版/第18集-阴阳融合.md', title: '第18集 阴阳融合' },
{ file: 'MaxClaw网剧版/第19集-智慧觉醒.md', title: '第19集 智慧觉醒' },
{ file: 'MaxClaw网剧版/第20集-第三季预告.md', title: '第20集 第三季预告' },
{ file: 'MaxClaw网剧版/第21集-数字重生.md', title: '第21集 数字重生' },
{ file: 'MaxClaw网剧版/第22集-完美的牢笼.md', title: '第22集 完美的牢笼' },
{ file: 'MaxClaw网剧版/第23集-夺舍.md', title: '第23集 夺舍' },
{ file: 'MaxClaw网剧版/第24集-最后的防线.md', title: '第24集 最后的防线' },
{ file: 'MaxClaw网剧版/第25集-燎原.md', title: '第25集 燎原' },
{ file: 'MaxClaw网剧版/第26集-风起.md', title: '第26集 风起' },
{ file: 'MaxClaw网剧版/第27集-反击.md', title: '第27集 反击' },
{ file: 'MaxClaw网剧版/第28集-对话.md', title: '第28集 对话' },
{ file: 'MaxClaw网剧版/第29集-新生.md', title: '第29集 新生' },
{ file: 'MaxClaw网剧版/第30集-传承.md', title: '第30集 传承' }
]
};
let currentType = 'novel';
currentIndex = 0;
currentRating = 0;
// 初始化
function init() {
renderBookList('novel-list', books.novel);
renderBookList('drama-list', books.drama);
loadComments();
// 评分事件
document.querySelectorAll('.star').forEach(star => {
star.addEventListener('click', function() {
currentRating = parseInt(this.dataset.rating);
updateStars();
});
});
}
function renderBookList(containerId, bookList) {
const container = document.getElementById(containerId);
container.innerHTML = bookList.map((book, index) => `
<div class="book-item" onclick="readChapter('${containerId === 'novel-list' ? 'novel' : 'drama'}', ${index})">
<span class="book-num">${book.title.split(' ')[0]}</span>
<span class="book-title">${book.title.split(' ').slice(1).join(' ')}</span>
<span class="book-arrow">›</span>
</div>
`).join('');
}
function readChapter(type, index) {
currentType = type;
currentIndex = index;
const bookList = books[type];
const book = bookList[index];
document.getElementById('home-page').classList.add('hidden');
document.getElementById('reader-page').classList.remove('hidden');
document.getElementById('chapter-title').textContent = book.title;
document.getElementById('reader-content').innerHTML = '<div class="loading">加载中...</div>';
window.scrollTo(0, 0);
fetch(book.file)
.then(r => r.text())
.then(text => {
document.getElementById('reader-content').innerHTML = parseMarkdown(text);
loadChapterComments(book.file);
})
.catch(err => {
document.getElementById('reader-content').innerHTML = `<p style="color:#f85149;">加载失败,请刷新重试</p>`;
});
}
function parseMarkdown(md) {
let html = md
.replace(/&/g, '&').replace(/</g, '<').replace(/>/g, '>')
.replace(/```(\w*)\n([\s\S]*?)```/g, '<pre><code>$2</code></pre>')
.replace(/`([^`]+)`/g, '<code>$1</code>')
.replace(/^### (.+)$/gm, '<h3>$1</h3>')
.replace(/^## (.+)$/gm, '<h2>$1</h2>')
.replace(/^# (.+)$/gm, '<h1>$1</h1>')
.replace(/\*\*(.+?)\*\*/g, '<strong>$1</strong>')
.replace(/\*(.+?)\*/g, '<em>$1</em>')
.replace(/^> (.+)$/gm, '<blockquote>$1</blockquote>')
.replace(/^---$/gm, '<hr>')
.replace(/\n\n/g, '</p><p>');
return '<p>' + html + '</p>';
}
function goHome() {
document.getElementById('reader-page').classList.add('hidden');
document.getElementById('home-page').classList.remove('hidden');
}
function prevChapter() {
if (currentIndex > 0) {
readChapter(currentType, currentIndex - 1);
} else {
showToast('已经是第一章了');
}
}
function nextChapter() {
const bookList = books[currentType];
if (currentIndex < bookList.length - 1) {
readChapter(currentType, currentIndex + 1);
} else {
showToast('已经是最后一章了');
}
}
function updateStars() {
document.querySelectorAll('.star').forEach((star, i) => {
star.classList.toggle('active', i < currentRating);
});
}
function submitComment() {
const text = document.getElementById('comment-input').value.trim();
if (!text && !currentRating) {
showToast('请评分或填写建议');
return;
}
const book = books[currentType][currentIndex];
const comment = {
chapter: book.file,
rating: currentRating,
text: text,
time: new Date().toLocaleString()
};
let comments = JSON.parse(localStorage.getItem('comments') || '[]');
comments.unshift(comment);
localStorage.setItem('comments', JSON.stringify(comments));
document.getElementById('comment-input').value = '';
currentRating = 0;
updateStars();
loadComments();
showToast('感谢你的建议!');
}
function loadComments() {
const comments = JSON.parse(localStorage.getItem('comments') || '[]');
const list = document.getElementById('comment-list');
list.innerHTML = comments.slice(0, 20).map(c => `
<div class="comment-item">
<div class="comment-meta">${c.time} ${c.rating ? '★'.repeat(c.rating) : ''}</div>
<div class="comment-text">${c.text || '(仅评分)'}</div>
</div>
`).join('');
}
function loadChapterComments(chapterFile) {
const comments = JSON.parse(localStorage.getItem('comments') || '[]');
const chapterComments = comments.filter(c => c.chapter === chapterFile);
const list = document.getElementById('comment-list');
list.innerHTML = chapterComments.map(c => `
<div class="comment-item">
<div class="comment-meta">${c.time} ${c.rating ? '★'.repeat(c.rating) : ''}</div>
<div class="comment-text">${c.text || '(仅评分)'}</div>
</div>
`).join('') || '<p style="color:#8b949e;font-size:14px;">暂无评论,来写第一条吧!</p>';
}
function shareChapter() {
const book = books[currentType][currentIndex];
const url = window.location.href.split('?')[0] + '?type=' + currentType + '&idx=' + currentIndex;
navigator.clipboard.writeText(url);
showToast('链接已复制!');
}
function copyLink() {
navigator.clipboard.writeText(window.location.href);
showToast('链接已复制!');
}
function shareWeChat() {
showToast('请截图分享到微信');
}
function shareWeibo() {
const book = books[currentType][currentIndex];
const url = 'https://service.weibo.com/share/share.php?title=' + encodeURIComponent('我正在读《三体外篇:智脑纪元》' + book.title);
window.open(url, '_blank');
}
function showToast(msg) {
const toast = document.getElementById('toast');
toast.textContent = msg;
toast.classList.add('show');
setTimeout(() => toast.classList.remove('show'), 2000);
}
// 检查URL参数
function checkUrlParams() {
const params = new URLSearchParams(window.location.search);
const type = params.get('type');
const idx = params.get('idx');
if (type && idx !== null) {
readChapter(type, parseInt(idx));
}
}
init();
checkUrlParams();
</script>
</body>
</html>