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-1262", "mangaid": "1262", "zh_title": "破坏兽", "hant_title": "破壞獸", "en_title": "破坏兽 (Bilimanga #1262)", "author": "本田真吾", "tags": ["科幻", "冒险", "战斗", "末日", "猎奇", "黑暗", "悬疑", "科幻未来"], "zh_desc": "原本应该是跟往常没啥两样的一天,却因著一场大规模地震而彻底改变了少年的人生。他再也无法跟自己的儿时玩伴兼篮球劲敌一较长短,因为前所未见的吃人怪物随著地震出现,吃掉了将校内绝大多数的师生。少年心里所描绘的灿烂未来,顿时充满了致命杀机。少年今后究竟该何去何从?可怕的吃人怪物又是从何而来?破坏兽第1集将引领各位跟随少年展开这趟求生冒险!\n\n📚 作品信息:作者 本田真吾 · 评分 10 · 共收录 21 卷 / 80 话章节目录与高清彩页/条漫预览。", "hant_desc": "原本應該是跟往常沒啥兩樣的一天,卻因著一場大規模地震而徹底改變了少年的人生。他再也無法跟自己的兒時玩伴兼籃球勁敵一較長短,因為前所未見的吃人怪物隨著地震出現,吃掉了將校內絕大多數的師生。少年心裡所描繪的燦爛未來,頓時充滿了致命殺機。少年今後究竟該何去何從?可怕的吃人怪物又是從何而來?破壞獸第1集將引領各位跟隨少年展開這趟求生冒險!\n\n📚 作品資訊:作者 本田真吾 · 評分 10 · 共收錄 21 卷 / 80 話章節目錄與高清彩頁/條漫預覽。", "en_desc": "Popular serialized manga '破坏兽' (破壞獸) by 本田真吾. Includes 21 volumes and 80 chapters with full online vertical/page-flip web reader.", "pages": ["https://media.huangguodrama.ai/motion/comics/bilimanga-1262/page_01.jpg", "https://media.huangguodrama.ai/motion/comics/bilimanga-1262/page_02.jpg", "https://media.huangguodrama.ai/motion/comics/bilimanga-1262/page_03.jpg", "https://media.huangguodrama.ai/motion/comics/bilimanga-1262/page_04.jpg", "https://media.huangguodrama.ai/motion/comics/bilimanga-1262/page_05.jpg", "https://media.huangguodrama.ai/motion/comics/bilimanga-1262/page_06.jpg"], "volumes": [{"title_hant": "破壞獸 1", "title_zh": "破坏兽 1", "cover_id": 2262734, "first_chap_id": 104689, "cover_url": "https://i.motiezw.com/cover/1262/2262734.jpg"}, {"title_hant": "破壞獸 2", "title_zh": "破坏兽 2", "cover_id": 2262915, "first_chap_id": 104694, "cover_url": "https://i.motiezw.com/cover/1262/2262915.jpg"}, {"title_hant": "破壞獸 3", "title_zh": "破坏兽 3", "cover_id": 2263097, "first_chap_id": 104699, "cover_url": "https://i.motiezw.com/cover/1262/2263097.jpg"}, {"title_hant": "破壞獸 4", "title_zh": "破坏兽 4", "cover_id": 2265219, "first_chap_id": 104825, "cover_url": "https://i.motiezw.com/cover/1262/2265219.jpg"}, {"title_hant": "破壞獸 5", "title_zh": "破坏兽 5", "cover_id": 2265408, "first_chap_id": 104830, "cover_url": "https://i.motiezw.com/cover/1262/2265408.jpg"}, {"title_hant": "破壞獸 6", "title_zh": "破坏兽 6", "cover_id": 2265600, "first_chap_id": 104835, "cover_url": "https://i.motiezw.com/cover/1262/2265600.jpg"}, {"title_hant": "破壞獸 7", "title_zh": "破坏兽 7", "cover_id": 2265777, "first_chap_id": 104840, "cover_url": "https://i.motiezw.com/cover/1262/2265777.jpg"}, {"title_hant": "破壞獸 8", "title_zh": "破坏兽 8", "cover_id": 2265950, "first_chap_id": 104845, "cover_url": "https://i.motiezw.com/cover/1262/2265950.jpg"}, {"title_hant": "破壞獸 9", "title_zh": "破坏兽 9", "cover_id": 2266126, "first_chap_id": 104850, "cover_url": "https://i.motiezw.com/cover/1262/2266126.jpg"}, {"title_hant": "破壞獸 10", "title_zh": "破坏兽 10", "cover_id": 2266303, "first_chap_id": 104855, "cover_url": "https://i.motiezw.com/cover/1262/2266303.jpg"}, {"title_hant": "破壞獸 11", "title_zh": "破坏兽 11", "cover_id": 2266671, "first_chap_id": 104864, "cover_url": "https://i.motiezw.com/cover/1262/2266671.jpg"}, {"title_hant": "破壞獸 12", "title_zh": "破坏兽 12", "cover_id": 2266839, "first_chap_id": 104869, "cover_url": "https://i.motiezw.com/cover/1262/2266839.jpg"}], "chapters": [{"cid": "104689", "title": "第1話 Future is... ①", "title_zh": "第1话 Future is... ①"}, {"cid": "104690", "title": "第1話 Future is... ②", "title_zh": "第1话 Future is... ②"}, {"cid": "104691", "title": "第2話 Them", "title_zh": "第2话 Them"}, {"cid": "104692", "title": "第3話 洞穴", "title_zh": "第3话 洞穴"}, {"cid": "104694", "title": "第4話 生存者", "title_zh": "第4话 生存者"}, {"cid": "104695", "title": "第5話 深淵", "title_zh": "第5话 深渊"}, {"cid": "104696", "title": "第6話 包圍", "title_zh": "第6话 包围"}, {"cid": "104697", "title": "第7話 一對", "title_zh": "第7话 一对"}, {"cid": "104699", "title": "第8話 錯亂", "title_zh": "第8话 错乱"}, {"cid": "104700", "title": "第9話 合作", "title_zh": "第9话 合作"}, {"cid": "104701", "title": "第10話 崩壞", "title_zh": "第10话 崩坏"}, {"cid": "104702", "title": "第11話 逃亡", "title_zh": "第11话 逃亡"}, {"cid": "104825", "title": "第12話 遭遇", "title_zh": "第12话 遭遇"}, {"cid": "104826", "title": "第13話 Troopers", "title_zh": "第13话 Troopers"}, {"cid": "104827", "title": "第14話 反擊", "title_zh": "第14话 反击"}, {"cid": "104828", "title": "第15話 ESCAPE FROM⋯", "title_zh": "第15话 ESCAPE FROM⋯"}, {"cid": "104830", "title": "第16話 未來⋯如今", "title_zh": "第16话 未来⋯如今"}, {"cid": "104831", "title": "第17話 邂逅", "title_zh": "第17话 邂逅"}, {"cid": "104832", "title": "第18話 胎動", "title_zh": "第18话 胎动"}, {"cid": "104835", "title": "第20話 狂暴", "title_zh": "第20话 狂暴"}, {"cid": "104836", "title": "第21話 光球", "title_zh": "第21话 光球"}, {"cid": "104837", "title": "第22話 擊破", "title_zh": "第22话 击破"}, {"cid": "104838", "title": "第23話 出現", "title_zh": "第23话 出现"}, {"cid": "104840", "title": "第24話 白崎奈央", "title_zh": "第24话 白崎奈央"}, {"cid": "104841", "title": "第25話 封鎖", "title_zh": "第25话 封锁"}, {"cid": "104842", "title": "第26話 戰爭", "title_zh": "第26话 战争"}, {"cid": "104843", "title": "第27話 黑雨", "title_zh": "第27话 黑雨"}, {"cid": "104845", "title": "第28話 流動", "title_zh": "第28话 流动"}, {"cid": "104846", "title": "第29話 迷霧", "title_zh": "第29话 迷雾"}, {"cid": "104847", "title": "第30話 終結", "title_zh": "第30话 终结"}, {"cid": "104848", "title": "第31話 犧牲", "title_zh": "第31话 牺牲"}, {"cid": "104850", "title": "第32話 威脅", "title_zh": "第32话 威胁"}, {"cid": "104851", "title": "第33話 三足鼎立", "title_zh": "第33话 三足鼎立"}, {"cid": "104852", "title": "第34話 試作型", "title_zh": "第34话 试作型"}, {"cid": "104853", "title": "第35話 鬥魚", "title_zh": "第35话 斗鱼"}, {"cid": "104855", "title": "第36話 Reborn", "title_zh": "第36话 Reborn"}, {"cid": "104856", "title": "第37話 雙刃劍", "title_zh": "第37话 双刃剑"}, {"cid": "104857", "title": "第38話 大海怪", "title_zh": "第38话 大海怪"}, {"cid": "104864", "title": "第40話", "title_zh": "第40话"}, {"cid": "104865", "title": "第41話", "title_zh": "第41话"}, {"cid": "104866", "title": "第42話", "title_zh": "第42话"}, {"cid": "104867", "title": "第43話", "title_zh": "第43话"}, {"cid": "104869", "title": "第44話", "title_zh": "第44话"}, {"cid": "104870", "title": "第45話", "title_zh": "第45话"}, {"cid": "104871", "title": "第46話", "title_zh": "第46话"}, {"cid": "104872", "title": "第47話", "title_zh": "第47话"}, {"cid": "104874", "title": "第48話", "title_zh": "第48话"}, {"cid": "104875", "title": "第49話", "title_zh": "第49话"}, {"cid": "104876", "title": "第50話", "title_zh": "第50话"}, {"cid": "104877", "title": "第51話", "title_zh": "第51话"}, {"cid": "104879", "title": "第52話", "title_zh": "第52话"}, {"cid": "104880", "title": "第52.5話", "title_zh": "第52.5话"}, {"cid": "104881", "title": "第53話", "title_zh": "第53话"}, {"cid": "104882", "title": "第54話", "title_zh": "第54话"}, {"cid": "104884", "title": "第55話", "title_zh": "第55话"}, {"cid": "104885", "title": "第56話", "title_zh": "第56话"}, {"cid": "104886", "title": "第57話", "title_zh": "第57话"}, {"cid": "104889", "title": "第59話", "title_zh": "第59话"}, {"cid": "104890", "title": "第60話", "title_zh": "第60话"}, {"cid": "104891", "title": "第61話", "title_zh": "第61话"}]};
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>