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-78", "mangaid": "78", "zh_title": "链锯人", "hant_title": "鏈鋸人", "en_title": "链锯人 (Bilimanga #78)", "author": "藤本树", "tags": ["奇幻", "热血", "战斗", "惊悚", "恋爱", "战斗热血", "日本漫画", "漫画"], "zh_desc": "淀治是个背负了父亲遗留下的庞大债务,因此过著极端负穷生活的少年,他救了恶魔波奇塔,并与牠一起以恶魔猎人的身分斩杀低阶恶魔来换取酬劳。有一天,流氓骗了淀治,让他成为一堆恶魔的祭品,淀治在临死之际,波奇塔牺牲自己,把心脏给了他,让他复活并拥有了恶魔的力量,只要一拉位在心脏那边的链子就能发动。之后淀治被公安人员看上,因此成为公安的恶魔猎人…\n\n📚 作品信息:作者 藤本树 · 评分 9.9 · 共收录 24 卷 / 222 话章节目录与高清彩页/条漫预览。", "hant_desc": "淀治是個背負了父親遺留下的龐大債務,因此過著極端負窮生活的少年,他救了惡魔波奇塔,並與牠一起以惡魔獵人的身分斬殺低階惡魔來換取酬勞。有一天,流氓騙了淀治,讓他成為一堆惡魔的祭品,淀治在臨死之際,波奇塔犧牲自己,把心臟給了他,讓他復活並擁有了惡魔的力量,只要一拉位在心臟那邊的鏈子就能發動。之後淀治被公安人員看上,因此成為公安的惡魔獵人…\n\n📚 作品資訊:作者 藤本樹 · 評分 9.9 · 共收錄 24 卷 / 222 話章節目錄與高清彩頁/條漫預覽。", "en_desc": "Popular serialized manga '链锯人' (鏈鋸人) by 藤本树. Includes 24 volumes and 222 chapters with full online vertical/page-flip web reader.", "pages": ["https://media.huangguodrama.ai/motion/comics/bilimanga-78/page_01.jpg", "https://media.huangguodrama.ai/motion/comics/bilimanga-78/page_02.jpg", "https://media.huangguodrama.ai/motion/comics/bilimanga-78/page_03.jpg", "https://media.huangguodrama.ai/motion/comics/bilimanga-78/page_04.jpg", "https://media.huangguodrama.ai/motion/comics/bilimanga-78/page_05.jpg", "https://media.huangguodrama.ai/motion/comics/bilimanga-78/page_06.jpg"], "volumes": [{"title_hant": "鏈鋸人 1", "title_zh": "链锯人 1", "cover_id": 100918, "first_chap_id": 4616, "cover_url": "https://i.motiezw.com/cover/78/100918.jpg"}, {"title_hant": "鏈鋸人 2", "title_zh": "链锯人 2", "cover_id": 103832, "first_chap_id": 4760, "cover_url": "https://i.motiezw.com/cover/78/103832.jpg"}, {"title_hant": "鏈鋸人 3", "title_zh": "链锯人 3", "cover_id": 104003, "first_chap_id": 4769, "cover_url": "https://i.motiezw.com/cover/78/104003.jpg"}, {"title_hant": "鏈鋸人 4", "title_zh": "链锯人 4", "cover_id": 104194, "first_chap_id": 4779, "cover_url": "https://i.motiezw.com/cover/78/104194.jpg"}, {"title_hant": "鏈鋸人 5", "title_zh": "链锯人 5", "cover_id": 104385, "first_chap_id": 4789, "cover_url": "https://i.motiezw.com/cover/78/104385.jpg"}, {"title_hant": "鏈鋸人 6", "title_zh": "链锯人 6", "cover_id": 104584, "first_chap_id": 4800, "cover_url": "https://i.motiezw.com/cover/78/104584.jpg"}, {"title_hant": "鏈鋸人 7", "title_zh": "链锯人 7", "cover_id": 104775, "first_chap_id": 4809, "cover_url": "https://i.motiezw.com/cover/78/104775.jpg"}, {"title_hant": "鏈鋸人 8", "title_zh": "链锯人 8", "cover_id": 104973, "first_chap_id": 4819, "cover_url": "https://i.motiezw.com/cover/78/104973.jpg"}, {"title_hant": "鏈鋸人 9", "title_zh": "链锯人 9", "cover_id": 105164, "first_chap_id": 4829, "cover_url": "https://i.motiezw.com/cover/78/105164.jpg"}, {"title_hant": "鏈鋸人 10", "title_zh": "链锯人 10", "cover_id": 105356, "first_chap_id": 4839, "cover_url": "https://i.motiezw.com/cover/78/105356.jpg"}, {"title_hant": "鏈鋸人 11", "title_zh": "链锯人 11", "cover_id": 106891, "first_chap_id": 4891, "cover_url": "https://i.motiezw.com/cover/78/106891.jpg"}, {"title_hant": "鏈鋸人 12", "title_zh": "链锯人 12", "cover_id": 107083, "first_chap_id": 4900, "cover_url": "https://i.motiezw.com/cover/78/107083.jpg"}], "chapters": [{"cid": "4616", "title": "第1話 狗與鏈鋸", "title_zh": "第1话 狗与链锯"}, {"cid": "4617", "title": "第2話 波奇塔的行蹤", "title_zh": "第2话 波奇塔的行踪"}, {"cid": "4618", "title": "第3話 抵達東京", "title_zh": "第3话 抵达东京"}, {"cid": "4619", "title": "第4話 力量", "title_zh": "第4话 力量"}, {"cid": "4620", "title": "第5話 揉匈部的方法", "title_zh": "第5话 揉匈部的方法"}, {"cid": "4621", "title": "第6話 使役", "title_zh": "第6话 使役"}, {"cid": "4622", "title": "第7話 喵子的下落", "title_zh": "第7话 喵子的下落"}, {"cid": "4760", "title": "第8話 鏈鋸人VS蝙蝠", "title_zh": "第8话 链锯人VS蝙蝠"}, {"cid": "4761", "title": "第9話 救出", "title_zh": "第9话 救出"}, {"cid": "4759", "title": "第10話 叩", "title_zh": "第10话 叩"}, {"cid": "4762", "title": "第11話 妥協", "title_zh": "第11话 妥协"}, {"cid": "4763", "title": "第12話 揉", "title_zh": "第12话 揉"}, {"cid": "4764", "title": "第13話 鎗之惡魔", "title_zh": "第13话 鎗之恶魔"}, {"cid": "4765", "title": "第14話 SS的溫", "title_zh": "第14话 SS的温"}, {"cid": "4766", "title": "第15話 無盡的8樓", "title_zh": "第15话 无尽的8楼"}, {"cid": "4767", "title": "第16話 第一次的味道", "title_zh": "第16话 第一次的味道"}, {"cid": "4769", "title": "第17話 殺死淀治", "title_zh": "第17话 杀死淀治"}, {"cid": "4770", "title": "第18話 鏈鋸VS永遠", "title_zh": "第18话 链锯VS永远"}, {"cid": "4771", "title": "第19話 諾貝爾獎", "title_zh": "第19话 诺贝尔奖"}, {"cid": "4772", "title": "第20話 喝酒", "title_zh": "第20话 喝酒"}, {"cid": "4773", "title": "第21話 接溫的味道", "title_zh": "第21话 接温的味道"}, {"cid": "4775", "title": "第23話 鎗聲", "title_zh": "第23话 鎗声"}, {"cid": "4776", "title": "第24話 詛咒", "title_zh": "第24话 诅咒"}, {"cid": "4777", "title": "第25話 幽靈、蛇、鏈鋸", "title_zh": "第25话 幽灵、蛇、链锯"}, {"cid": "4779", "title": "第26話 鎗為強", "title_zh": "第26话 鎗为强"}, {"cid": "4780", "title": "第27話 從京都", "title_zh": "第27话 从京都"}, {"cid": "4781", "title": "第28話 秘密與謊言", "title_zh": "第28话 秘密与谎言"}, {"cid": "4782", "title": "第29話 100分滿分", "title_zh": "第29话 100分满分"}, {"cid": "4783", "title": "第30話 傷痕累累", "title_zh": "第30话 伤痕累累"}, {"cid": "4784", "title": "第31話 未來最棒", "title_zh": "第31话 未来最棒"}, {"cid": "4785", "title": "第32話 反覆再反覆", "title_zh": "第32话 反复再反复"}, {"cid": "4786", "title": "第33話 作戰開始", "title_zh": "第33话 作战开始"}, {"cid": "4787", "title": "第34話 全員集合", "title_zh": "第34话 全员集合"}, {"cid": "4789", "title": "第35話 未成年", "title_zh": "第35话 未成年"}, {"cid": "4790", "title": "第36話 日本刀 VS 鏈鋸", "title_zh": "第36话 日本刀 VS 链锯"}, {"cid": "4791", "title": "第37話 電車、頭、鏈鋸", "title_zh": "第37话 电车、头、链锯"}, {"cid": "4792", "title": "第38話 輕鬆復仇!", "title_zh": "第38话 轻松复仇!"}, {"cid": "4793", "title": "第39話 一定會哭", "title_zh": "第39话 一定会哭"}, {"cid": "4794", "title": "第40話 戀愛、花朵、鏈鋸", "title_zh": "第40话 恋爱、花朵、链锯"}, {"cid": "4795", "title": "第41話 暴風雨前夕", "title_zh": "第41话 暴风雨前夕"}, {"cid": "4796", "title": "第42話 教我游泳", "title_zh": "第42话 教我游泳"}, {"cid": "4797", "title": "第43話 Jane在教堂裡沉睡", "title_zh": "第43话 Jane在教堂里沉睡"}, {"cid": "4800", "title": "第45話 爆炸的好日子", "title_zh": "第45话 爆炸的好日子"}, {"cid": "4801", "title": "第46話 殺光的旋律", "title_zh": "第46话 杀光的旋律"}, {"cid": "4802", "title": "第47話 N人緣", "title_zh": "第47话 N人缘"}, {"cid": "4803", "title": "第48話 碰!碰!碰!", "title_zh": "第48话 碰!碰!碰!"}, {"cid": "4804", "title": "第49話 鯊魚颶風", "title_zh": "第49话 鲨鱼飓风"}, {"cid": "4805", "title": "第50話 風飛鯊", "title_zh": "第50话 风飞鲨"}, {"cid": "4806", "title": "第51話 DARK DIVING", "title_zh": "第51话 DARK DIVING"}, {"cid": "4807", "title": "第52話 失戀、花、鏈鋸", "title_zh": "第52话 失恋、花、链锯"}, {"cid": "4809", "title": "第53話 夢境中", "title_zh": "第53话 梦境中"}, {"cid": "4810", "title": "第54話 要去江之島的話", "title_zh": "第54话 要去江之岛的话"}, {"cid": "4811", "title": "第55話 LET'S GO", "title_zh": "第55话 LET'S GO"}, {"cid": "4812", "title": "第56話 詛咒和第一次", "title_zh": "第56话 诅咒和第一次"}, {"cid": "4813", "title": "第57話 突然", "title_zh": "第57话 突然"}, {"cid": "4814", "title": "第58話 黑瀨勇太郎", "title_zh": "第58话 黑濑勇太郎"}, {"cid": "4815", "title": "第59話 亂七八糟", "title_zh": "第59话 乱七八糟"}, {"cid": "4816", "title": "第60話 光星與魔人們四十九人斬", "title_zh": "第60话 光星与魔人们四十九人斩"}, {"cid": "4817", "title": "第61話 新聞主播", "title_zh": "第61话 新闻主播"}, {"cid": "4819", "title": "第62話 超亂七八糟", "title_zh": "第62话 超乱七八糟"}]};
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>