HTML5 在线漫画阅读器 (index.html)
<!DOCTYPE html>
<html lang="zh-CN">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width,initial-scale=1,maximum-scale=3,user-scalable=yes">
<title>末日降临 - 在线漫画阅读器</title>
<style>
*{box-sizing:border-box;margin:0;padding:0}
body{background:#0d0f17;color:#f1f5f9;font-family:-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,sans-serif;min-height:100vh;display:flex;flex-direction:column}
header{position:sticky;top:0;z-index:50;background:rgba(13,15,23,0.92);backdrop-filter:blur(12px);border-bottom:1px solid rgba(255,255,255,0.09);padding:10px 16px;display:flex;align-items:center;justify-content:space-between;gap:10px;flex-wrap:wrap}
.brand{display:flex;align-items:center;gap:10px}
.badge{background:linear-gradient(135deg,#ec4899,#8b5cf6);color:#fff;font-size:11px;font-weight:700;padding:3px 8px;border-radius:99px}
.title{font-size:16px;font-weight:700;color:#fff}
.controls{display:flex;align-items:center;gap:8px;flex-wrap:wrap}
button{background:rgba(255,255,255,0.08);color:#e2e8f0;border:1px solid rgba(255,255,255,0.14);padding:6px 12px;border-radius:8px;font-size:12px;cursor:pointer;transition:.18s}
button:hover,button.active{background:#ec4899;color:#fff;border-color:#ec4899}
.hero{max-width:920px;margin:16px auto;padding:18px;background:rgba(255,255,255,0.04);border:1px solid rgba(255,255,255,0.08);border-radius:14px;display:flex;gap:18px;align-items:flex-start}
.hero img{width:120px;height:160px;object-fit:cover;border-radius:10px;flex-shrink:0;box-shadow:0 8px 24px rgba(0,0,0,0.45)}
.hero-meta h1{font-size:20px;margin-bottom:6px}
.hero-meta .sub{font-size:13px;color:#94a3b8;margin-bottom:8px}
.tags{display:flex;gap:6px;flex-wrap:wrap;margin-bottom:10px}
.tag{background:rgba(236,72,153,0.16);color:#f472b6;padding:2px 8px;border-radius:6px;font-size:11px}
.desc{font-size:13px;line-height:1.6;color:#cbd5e1}
.reader-wrap{max-width:860px;width:100%;margin:0 auto 40px;padding:0 8px;flex:1}
.scroll-mode .page-card{margin-bottom:10px;background:#161925;border-radius:8px;overflow:hidden;box-shadow:0 6px 20px rgba(0,0,0,0.4)}
.scroll-mode .page-card img{width:100%;height:auto;display:block}
.page-footer{text-align:center;font-size:11px;color:#64748b;padding:4px 0}
.flip-controls{display:none;justify-content:center;align-items:center;gap:14px;margin:14px 0}
.flip-mode .flip-controls{display:flex}
.drawer{display:none;max-width:920px;margin:0 auto 20px;padding:16px;background:rgba(255,255,255,0.04);border-radius:12px;border:1px solid rgba(255,255,255,0.1)}
.drawer.open{display:block}
.chap-grid{display:grid;grid-template-columns:repeat(auto-fill,minmax(170px,1fr));gap:8px;margin-top:10px}
.chap-item{padding:8px 10px;background:rgba(255,255,255,0.06);border-radius:8px;font-size:12px;color:#e2e8f0;cursor:pointer;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.chap-item:hover{background:rgba(236,72,153,0.28)}
@media(max-width:600px){.hero{flex-direction:column;align-items:center;text-align:center}.tags{justify-content:center}}
</style>
</head>
<body>
<header>
<div class="brand">
<span class="badge">BILIMANGA · 统一媒体库</span>
<span class="title" id="hdrTitle"></span>
</div>
<div class="controls">
<button id="btnScroll" class="active" onclick="setMode('scroll')">条漫下拉模式</button>
<button id="btnFlip" onclick="setMode('flip')">单页翻页模式</button>
<button onclick="toggleCatalog()">章节目录 (<span id="chapCount">0</span>)</button>
<button onclick="cycleLang()" id="btnLang">繁/簡/EN</button>
</div>
</header>
<section class="hero">
<img id="heroCover" src="" alt="cover">
<div class="hero-meta">
<h1 id="heroTitle"></h1>
<div class="sub" id="heroSub"></div>
<div class="tags" id="heroTags"></div>
<p class="desc" id="heroDesc"></p>
</div>
</section>
<section class="drawer" id="catDrawer">
<h3 style="font-size:14px;margin-bottom:6px">全卷章节目录 (点击切换预览章节)</h3>
<div class="chap-grid" id="chapGrid"></div>
</section>
<div class="reader-wrap scroll-mode" id="readerWrap">
<div class="flip-controls">
<button onclick="stepPage(-1)">◀ 上一页</button>
<span id="pageIndicator" style="font-size:13px;color:#cbd5e1">1 / 1</span>
<button onclick="stepPage(1)">下一页 ▶</button>
</div>
<div id="pagesContainer"></div>
</div>
<script>
const COMIC = {"slug": "bilimanga-1246", "mangaid": "1246", "zh_title": "末日降临", "hant_title": "末日降臨", "en_title": "末日降临 (Bilimanga #1246)", "author": "石川优吾", "tags": ["科幻", "穿越", "末日", "悬疑", "冒险", "科幻未来", "日本漫画", "漫画"], "zh_desc": "作者跳脱出既有的思考模式与逻辑,SF革新之作全新登场!\n\r\n某一天,女高中生(时任好子)看见世界降下了黑色的雪……\n\r\n正当她百思不解时,突然发生了超级大地震!!\n\r\n地震过后,好子竟然发现黑色的、\n\r\n有如海啸一般的东西向她们处的大楼袭卷而来!!\n\r\n被海啸所吞没的人竟然会随即超快速老化!!\n\n📚 作品信息:作者 石川优吾 · 评分 10 · 共收录 15 卷 / 129 话章节目录与高清彩页/条漫预览。", "hant_desc": "作者跳脫出既有的思考模式與邏輯,SF革新之作全新登場!\n\r\n某一天,女高中生(時任好子)看見世界降下了黑色的雪……\n\r\n正當她百思不解時,突然發生了超級大地震!!\n\r\n地震過後,好子竟然發現黑色的、\n\r\n有如海嘯一般的東西向她們處的大樓襲捲而來!!\n\r\n被海嘯所吞沒的人竟然會隨即超快速老化!!\n\n📚 作品資訊:作者 石川優吾 · 評分 10 · 共收錄 15 卷 / 129 話章節目錄與高清彩頁/條漫預覽。", "en_desc": "Popular serialized manga '末日降临' (末日降臨) by 石川优吾. Includes 15 volumes and 129 chapters with full online vertical/page-flip web reader.", "pages": ["https://media.huangguodrama.ai/motion/comics/bilimanga-1246/page_01.jpg", "https://media.huangguodrama.ai/motion/comics/bilimanga-1246/page_02.jpg", "https://media.huangguodrama.ai/motion/comics/bilimanga-1246/page_03.jpg", "https://media.huangguodrama.ai/motion/comics/bilimanga-1246/page_04.jpg", "https://media.huangguodrama.ai/motion/comics/bilimanga-1246/page_05.jpg", "https://media.huangguodrama.ai/motion/comics/bilimanga-1246/page_06.jpg"], "volumes": [{"title_hant": "末日降臨 1", "title_zh": "末日降临 1", "cover_id": 2241112, "first_chap_id": 103613, "cover_url": "https://i.motiezw.com/cover/1246/2241112.jpg"}, {"title_hant": "末日降臨 2", "title_zh": "末日降临 2", "cover_id": 2241311, "first_chap_id": 103621, "cover_url": "https://i.motiezw.com/cover/1246/2241311.jpg"}, {"title_hant": "末日降臨 3", "title_zh": "末日降临 3", "cover_id": 2241510, "first_chap_id": 103630, "cover_url": "https://i.motiezw.com/cover/1246/2241510.jpg"}, {"title_hant": "末日降臨 4", "title_zh": "末日降临 4", "cover_id": 2241705, "first_chap_id": 103639, "cover_url": "https://i.motiezw.com/cover/1246/2241705.jpg"}, {"title_hant": "末日降臨 5", "title_zh": "末日降临 5", "cover_id": 2241903, "first_chap_id": 103649, "cover_url": "https://i.motiezw.com/cover/1246/2241903.jpg"}, {"title_hant": "末日降臨 6", "title_zh": "末日降临 6", "cover_id": 2242163, "first_chap_id": 103661, "cover_url": "https://i.motiezw.com/cover/1246/2242163.jpg"}, {"title_hant": "末日降臨 7", "title_zh": "末日降临 7", "cover_id": 2242325, "first_chap_id": 103669, "cover_url": "https://i.motiezw.com/cover/1246/2242325.jpg"}, {"title_hant": "末日降臨 8", "title_zh": "末日降临 8", "cover_id": 2242502, "first_chap_id": 103678, "cover_url": "https://i.motiezw.com/cover/1246/2242502.jpg"}, {"title_hant": "末日降臨 9", "title_zh": "末日降临 9", "cover_id": 2242703, "first_chap_id": 103688, "cover_url": "https://i.motiezw.com/cover/1246/2242703.jpg"}, {"title_hant": "末日降臨 10", "title_zh": "末日降临 10", "cover_id": 2242892, "first_chap_id": 103698, "cover_url": "https://i.motiezw.com/cover/1246/2242892.jpg"}, {"title_hant": "末日降臨 11", "title_zh": "末日降临 11", "cover_id": 2243088, "first_chap_id": 103708, "cover_url": "https://i.motiezw.com/cover/1246/2243088.jpg"}, {"title_hant": "末日降臨 12", "title_zh": "末日降临 12", "cover_id": 2243299, "first_chap_id": 103719, "cover_url": "https://i.motiezw.com/cover/1246/2243299.jpg"}], "chapters": [{"cid": "103613", "title": "第1話 震撼", "title_zh": "第1话 震撼"}, {"cid": "103614", "title": "第2話 黑S的水", "title_zh": "第2话 黑S的水"}, {"cid": "103615", "title": "第3話 滿月", "title_zh": "第3话 满月"}, {"cid": "103616", "title": "第4話 生命", "title_zh": "第4话 生命"}, {"cid": "103617", "title": "第5話 失落的孩子們", "title_zh": "第5话 失落的孩子们"}, {"cid": "103618", "title": "第6話 Sprite", "title_zh": "第6话 Sprite"}, {"cid": "103619", "title": "第7話 走樣的街道", "title_zh": "第7话 走样的街道"}, {"cid": "103621", "title": "第8話 襲來", "title_zh": "第8话 袭来"}, {"cid": "103622", "title": "第9話 沒有法治的世界", "title_zh": "第9话 没有法治的世界"}, {"cid": "103623", "title": "第10話 徬徨的孩子們", "title_zh": "第10话 徬徨的孩子们"}, {"cid": "103624", "title": "第11話 救出", "title_zh": "第11话 救出"}, {"cid": "103625", "title": "第12話 天使", "title_zh": "第12话 天使"}, {"cid": "103626", "title": "第13話 未知的人們", "title_zh": "第13话 未知的人们"}, {"cid": "103627", "title": "第14話 天罰", "title_zh": "第14话 天罚"}, {"cid": "103628", "title": "第15話 God bless you", "title_zh": "第15话 God bless you"}, {"cid": "103630", "title": "第16話 淚", "title_zh": "第16话 泪"}, {"cid": "103631", "title": "第17話 喪失", "title_zh": "第17话 丧失"}, {"cid": "103632", "title": "第18話 記憶", "title_zh": "第18话 记忆"}, {"cid": "103633", "title": "第19話 接點", "title_zh": "第19话 接点"}, {"cid": "103634", "title": "第20話 淺薄的人心", "title_zh": "第20话 浅薄的人心"}, {"cid": "103635", "title": "第21話 糧食", "title_zh": "第21话 粮食"}, {"cid": "103637", "title": "第23話 幻象", "title_zh": "第23话 幻象"}, {"cid": "103639", "title": "第24話 活在“過去”的朋友", "title_zh": "第24话 活在“过去”的朋友"}, {"cid": "103640", "title": "第25話 簡訊", "title_zh": "第25话 简讯"}, {"cid": "103641", "title": "第26話 疑念", "title_zh": "第26话 疑念"}, {"cid": "103642", "title": "第27話 背叛的夜晚", "title_zh": "第27话 背叛的夜晚"}, {"cid": "103643", "title": "第28話 毀滅者-Abadon-", "title_zh": "第28话 毁灭者-Abadon-"}, {"cid": "103644", "title": "第29話 生死瞬間", "title_zh": "第29话 生死瞬间"}, {"cid": "103645", "title": "第30話 絕望", "title_zh": "第30话 绝望"}, {"cid": "103646", "title": "第31話 死之塔", "title_zh": "第31话 死之塔"}, {"cid": "103647", "title": "第32話 屍臭", "title_zh": "第32话 尸臭"}, {"cid": "103649", "title": "第33話 告白", "title_zh": "第33话 告白"}, {"cid": "103650", "title": "第34話 巴比倫制度", "title_zh": "第34话 巴比伦制度"}, {"cid": "103651", "title": "第35話 A.D.2059", "title_zh": "第35话 A.D.2059"}, {"cid": "103652", "title": "第36話 riot-暴動", "title_zh": "第36话 riot-暴动"}, {"cid": "103653", "title": "第37話 獸群", "title_zh": "第37话 兽群"}, {"cid": "103654", "title": "第38話 開戰", "title_zh": "第38话 开战"}, {"cid": "103655", "title": "第39話 拿起武器!", "title_zh": "第39话 拿起武器!"}, {"cid": "103656", "title": "第40話 ⋯時候到了。", "title_zh": "第40话 ⋯时候到了。"}, {"cid": "103657", "title": "第41話 Metamorphoses", "title_zh": "第41话 Metamorphoses"}, {"cid": "103661", "title": "第42話 永別了", "title_zh": "第42话 永别了"}, {"cid": "103662", "title": "第43話 無法傳達的聲音", "title_zh": "第43话 无法传达的声音"}, {"cid": "103664", "title": "第45話 “惡夢”再度襲來", "title_zh": "第45话 “恶梦”再度袭来"}, {"cid": "103665", "title": "第46話 為了朋友", "title_zh": "第46话 为了朋友"}, {"cid": "103666", "title": "第47話 新世界", "title_zh": "第47话 新世界"}, {"cid": "103659", "title": "附錄#1 預兆⋯前奏⋯", "title_zh": "附录#1 预兆⋯前奏⋯"}, {"cid": "103660", "title": "附錄#2 前夜⋯開端⋯", "title_zh": "附录#2 前夜⋯开端⋯"}, {"cid": "103669", "title": "第48話 A.D.1575", "title_zh": "第48话 A.D.1575"}, {"cid": "103670", "title": "第49話 灰白之“城”", "title_zh": "第49话 灰白之“城”"}, {"cid": "103671", "title": "第50話 崩潰的武將", "title_zh": "第50话 崩溃的武将"}, {"cid": "103672", "title": "第51話 武田軍來襲", "title_zh": "第51话 武田军来袭"}, {"cid": "103673", "title": "第52話 理悻", "title_zh": "第52话 理悻"}, {"cid": "103674", "title": "第53話 “在”這裡的意義", "title_zh": "第53话 “在”这里的意义"}, {"cid": "103675", "title": "第54話 決起", "title_zh": "第54话 决起"}, {"cid": "103668", "title": "附錄#3 崩壞⋯終結⋯", "title_zh": "附录#3 崩坏⋯终结⋯"}, {"cid": "103676", "title": "附錄#Endless 再會⋯分離⋯", "title_zh": "附录#Endless 再会⋯分离⋯"}, {"cid": "103678", "title": "第55話 死鬥", "title_zh": "第55话 死斗"}, {"cid": "103679", "title": "第56話 當生命消逝之時", "title_zh": "第56话 当生命消逝之时"}, {"cid": "103680", "title": "第57話 糾葛", "title_zh": "第57话 纠葛"}, {"cid": "103681", "title": "第58話 無名的孩子", "title_zh": "第58话 无名的孩子"}]};
let lang = 'zh';
let mode = 'scroll';
let curPage = 0;
function renderMeta() {
const t = lang === 'zh' ? COMIC.zh_title : (lang === 'hant' ? COMIC.hant_title : COMIC.en_title);
const d = lang === 'zh' ? COMIC.zh_desc : (lang === 'hant' ? COMIC.hant_desc : COMIC.en_desc);
document.getElementById('hdrTitle').textContent = t;
document.getElementById('heroTitle').textContent = t;
document.getElementById('heroSub').textContent = `${COMIC.author} · 共 ${COMIC.volumes.length} 卷 / ${COMIC.chapters.length} 话`;
document.getElementById('heroDesc').textContent = d;
document.getElementById('heroCover').src = COMIC.pages[0] || '';
document.getElementById('chapCount').textContent = COMIC.chapters.length;
const tg = document.getElementById('heroTags');
tg.innerHTML = '';
(COMIC.tags || []).forEach(x => {
const s = document.createElement('span');
s.className = 'tag';
s.textContent = x;
tg.appendChild(s);
});
}
function renderCatalog() {
const g = document.getElementById('chapGrid');
g.innerHTML = '';
(COMIC.chapters || []).forEach((c, idx) => {
const d = document.createElement('div');
d.className = 'chap-item';
d.textContent = c.title_zh || c.title;
d.onclick = () => {
curPage = idx % COMIC.pages.length;
if (mode === 'flip') renderPages();
else document.querySelectorAll('.page-card')[curPage]?.scrollIntoView({behavior:'smooth'});
document.getElementById('catDrawer').classList.remove('open');
};
g.appendChild(d);
});
}
function renderPages() {
const wrap = document.getElementById('readerWrap');
wrap.className = 'reader-wrap ' + (mode === 'scroll' ? 'scroll-mode' : 'flip-mode');
const box = document.getElementById('pagesContainer');
box.innerHTML = '';
const list = mode === 'scroll' ? COMIC.pages : [COMIC.pages[curPage]];
list.forEach((url, i) => {
const idx = mode === 'scroll' ? i : curPage;
const card = document.createElement('div');
card.className = 'page-card';
card.innerHTML = `<img src="${url}" loading="lazy" alt="Page ${idx+1}"><div class="page-footer">第 ${idx+1} / ${COMIC.pages.length} 页 · ${COMIC.zh_title}</div>`;
if (mode === 'flip') card.onclick = () => stepPage(1);
box.appendChild(card);
});
document.getElementById('pageIndicator').textContent = `${curPage + 1} / ${COMIC.pages.length}`;
}
function setMode(m) {
mode = m;
document.getElementById('btnScroll').classList.toggle('active', m === 'scroll');
document.getElementById('btnFlip').classList.toggle('active', m === 'flip');
renderPages();
}
function stepPage(delta) {
curPage = (curPage + delta + COMIC.pages.length) % COMIC.pages.length;
renderPages();
}
function toggleCatalog() {
document.getElementById('catDrawer').classList.toggle('open');
}
function cycleLang() {
lang = lang === 'zh' ? 'hant' : (lang === 'hant' ? 'en' : 'zh');
renderMeta();
}
renderMeta();
renderCatalog();
renderPages();
</script>
</body>
</html>