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-175", "mangaid": "175", "zh_title": "东京喰种", "hant_title": "東京喰種", "en_title": "东京喰种 (Bilimanga #175)", "author": "石田スイ", "tags": ["猎奇", "奇幻", "战斗", "惊悚", "冒险", "神鬼", "悬疑惊悚", "日本漫画"], "zh_desc": "在东京街头,一切成谜的吃人怪人「喰种」正悄悄在人类世界扩张他们的势力──\n\r\n平凡的大学生金木研因为遭到喰种猎食而性命垂危。医生为他进行了器官移植手术,然而器官提供者其实是喰种…。在病床上醒来的金木很快就感觉到身体不对劲,原本记忆中美味的食物全都走味到难以下咽。\n\r\n一开始,即使好几天不吃东西他也不会饿,但不久,激烈的空腹感开始折磨他。当他意识到,能引起他食欲的对象只剩下街上错身而过的男男女女,他绝望的日子也就此开始──\n\n📚 作品信息:作者 石田スイ · 评分 10 · 共收录 14 卷 / 145 话章节目录与高清彩页/条漫预览。", "hant_desc": "在東京街頭,一切成謎的吃人怪人「喰種」正悄悄在人類世界擴張他們的勢力──\n\r\n平凡的大學生金木研因為遭到喰種獵食而性命垂危。醫生為他進行了器官移植手術,然而器官提供者其實是喰種…。在病床上醒來的金木很快就感覺到身體不對勁,原本記憶中美味的食物全都走味到難以下嚥。\n\r\n一開始,即使好幾天不吃東西他也不會餓,但不久,激烈的空腹感開始折磨他。當他意識到,能引起他食慾的對象只剩下街上錯身而過的男男女女,他絕望的日子也就此開始──\n\n📚 作品資訊:作者 石田スイ · 評分 10 · 共收錄 14 卷 / 145 話章節目錄與高清彩頁/條漫預覽。", "en_desc": "Popular serialized manga '东京喰种' (東京喰種) by 石田スイ. Includes 14 volumes and 145 chapters with full online vertical/page-flip web reader.", "pages": ["https://media.huangguodrama.ai/motion/comics/bilimanga-175/page_01.jpg", "https://media.huangguodrama.ai/motion/comics/bilimanga-175/page_02.jpg", "https://media.huangguodrama.ai/motion/comics/bilimanga-175/page_03.jpg", "https://media.huangguodrama.ai/motion/comics/bilimanga-175/page_04.jpg", "https://media.huangguodrama.ai/motion/comics/bilimanga-175/page_05.jpg", "https://media.huangguodrama.ai/motion/comics/bilimanga-175/page_06.jpg"], "volumes": [{"title_hant": "東京喰種 1", "title_zh": "东京喰种 1", "cover_id": 324109, "first_chap_id": 15225, "cover_url": "https://i.motiezw.com/cover/175/324109.jpg"}, {"title_hant": "東京喰種 2", "title_zh": "东京喰种 2", "cover_id": 324331, "first_chap_id": 15235, "cover_url": "https://i.motiezw.com/cover/175/324331.jpg"}, {"title_hant": "東京喰種 3", "title_zh": "东京喰种 3", "cover_id": 324540, "first_chap_id": 15246, "cover_url": "https://i.motiezw.com/cover/175/324540.jpg"}, {"title_hant": "東京喰種 4", "title_zh": "东京喰种 4", "cover_id": 324734, "first_chap_id": 15257, "cover_url": "https://i.motiezw.com/cover/175/324734.jpg"}, {"title_hant": "東京喰種 5", "title_zh": "东京喰种 5", "cover_id": 324928, "first_chap_id": 15268, "cover_url": "https://i.motiezw.com/cover/175/324928.jpg"}, {"title_hant": "東京喰種 6", "title_zh": "东京喰种 6", "cover_id": 325129, "first_chap_id": 15280, "cover_url": "https://i.motiezw.com/cover/175/325129.jpg"}, {"title_hant": "東京喰種 7", "title_zh": "东京喰种 7", "cover_id": 325330, "first_chap_id": 15292, "cover_url": "https://i.motiezw.com/cover/175/325330.jpg"}, {"title_hant": "東京喰種 8", "title_zh": "东京喰种 8", "cover_id": 325531, "first_chap_id": 15304, "cover_url": "https://i.motiezw.com/cover/175/325531.jpg"}, {"title_hant": "東京喰種 9", "title_zh": "东京喰种 9", "cover_id": 325745, "first_chap_id": 15316, "cover_url": "https://i.motiezw.com/cover/175/325745.jpg"}, {"title_hant": "東京喰種 10", "title_zh": "东京喰种 10", "cover_id": 325945, "first_chap_id": 15328, "cover_url": "https://i.motiezw.com/cover/175/325945.jpg"}, {"title_hant": "東京喰種 11", "title_zh": "东京喰种 11", "cover_id": 326161, "first_chap_id": 15340, "cover_url": "https://i.motiezw.com/cover/175/326161.jpg"}, {"title_hant": "東京喰種 12", "title_zh": "东京喰种 12", "cover_id": 326378, "first_chap_id": 15353, "cover_url": "https://i.motiezw.com/cover/175/326378.jpg"}], "chapters": [{"cid": "15225", "title": "001 悲劇", "title_zh": "001 悲剧"}, {"cid": "15226", "title": "002 異變", "title_zh": "002 异变"}, {"cid": "15227", "title": "003 糟透", "title_zh": "003 糟透"}, {"cid": "15228", "title": "004 咖啡", "title_zh": "004 咖啡"}, {"cid": "15229", "title": "005 喰場", "title_zh": "005 喰场"}, {"cid": "15230", "title": "006 歸巢", "title_zh": "006 归巢"}, {"cid": "15231", "title": "007 欺罔", "title_zh": "007 欺罔"}, {"cid": "15232", "title": "008 赫子", "title_zh": "008 赫子"}, {"cid": "15233", "title": "009 孵化", "title_zh": "009 孵化"}, {"cid": "15235", "title": "010 古董", "title_zh": "010 古董"}, {"cid": "15236", "title": "011 面具", "title_zh": "011 面具"}, {"cid": "15237", "title": "012 任務", "title_zh": "012 任务"}, {"cid": "15238", "title": "013 白鴿", "title_zh": "013 白鸽"}, {"cid": "15239", "title": "014 驟雨", "title_zh": "014 骤雨"}, {"cid": "15240", "title": "015 母N", "title_zh": "015 母N"}, {"cid": "15241", "title": "016 幽禁", "title_zh": "016 幽禁"}, {"cid": "15242", "title": "017 兔面", "title_zh": "017 兔面"}, {"cid": "15243", "title": "018 未開", "title_zh": "018 未开"}, {"cid": "15244", "title": "019 地下", "title_zh": "019 地下"}, {"cid": "15246", "title": "020 白門", "title_zh": "020 白门"}, {"cid": "15247", "title": "021 哀悼", "title_zh": "021 哀悼"}, {"cid": "15249", "title": "023 失蹤", "title_zh": "023 失踪"}, {"cid": "15250", "title": "024 隱刃", "title_zh": "024 隐刃"}, {"cid": "15251", "title": "025 開眼", "title_zh": "025 开眼"}, {"cid": "15252", "title": "026 對手", "title_zh": "026 对手"}, {"cid": "15253", "title": "027 三人", "title_zh": "027 三人"}, {"cid": "15254", "title": "028 圓環", "title_zh": "028 圆环"}, {"cid": "15255", "title": "029 真戶", "title_zh": "029 真户"}, {"cid": "15257", "title": "030 苦味", "title_zh": "030 苦味"}, {"cid": "15258", "title": "031 依子", "title_zh": "031 依子"}, {"cid": "15259", "title": "032 M食", "title_zh": "032 M食"}, {"cid": "15260", "title": "033 甜言", "title_zh": "033 甜言"}, {"cid": "15261", "title": "034 滑台", "title_zh": "034 滑台"}, {"cid": "15262", "title": "035 獨鬥", "title_zh": "035 独斗"}, {"cid": "15263", "title": "036 準備", "title_zh": "036 准备"}, {"cid": "15264", "title": "037 晚餐", "title_zh": "037 晚餐"}, {"cid": "15265", "title": "038 解體", "title_zh": "038 解体"}, {"cid": "15266", "title": "039 饗宴", "title_zh": "039 飨宴"}, {"cid": "15268", "title": "040 招待", "title_zh": "040 招待"}, {"cid": "15269", "title": "041 月光", "title_zh": "041 月光"}, {"cid": "15270", "title": "042 攀爬", "title_zh": "042 攀爬"}, {"cid": "15271", "title": "043 殘痕", "title_zh": "043 残痕"}, {"cid": "15272", "title": "044 受禸", "title_zh": "044 受禸"}, {"cid": "15274", "title": "046 燈火", "title_zh": "046 灯火"}, {"cid": "15275", "title": "番外篇 利世", "title_zh": "番外篇 利世"}, {"cid": "15276", "title": "047 偽名", "title_zh": "047 伪名"}, {"cid": "15277", "title": "048 耳骨", "title_zh": "048 耳骨"}, {"cid": "15278", "title": "附錄", "title_zh": "附录"}, {"cid": "15280", "title": "049 籠鳥", "title_zh": "049 笼鸟"}, {"cid": "15281", "title": "050 萬丈", "title_zh": "050 万丈"}, {"cid": "15282", "title": "051 敕令", "title_zh": "051 敕令"}, {"cid": "15283", "title": "052 強奪", "title_zh": "052 强夺"}, {"cid": "15284", "title": "053 講習", "title_zh": "053 讲习"}, {"cid": "15285", "title": "054 青桐", "title_zh": "054 青桐"}, {"cid": "15286", "title": "055 策畫", "title_zh": "055 策画"}, {"cid": "15287", "title": "056 蠢動", "title_zh": "056 蠢动"}, {"cid": "15288", "title": "057 奔逃", "title_zh": "057 奔逃"}, {"cid": "15289", "title": "058 歪笑", "title_zh": "058 歪笑"}, {"cid": "15290", "title": "附錄", "title_zh": "附录"}, {"cid": "15292", "title": "059 歇業", "title_zh": "059 歇业"}]};
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>