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>文豪Stray Dogs - 在线漫画阅读器</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-417", "mangaid": "417", "zh_title": "文豪Stray Dogs", "hant_title": "文豪Stray Dogs", "en_title": "文豪Stray Dogs (Bilimanga #417)", "author": "春河35 / 朝雾カフカ", "tags": ["奇幻", "异能", "战斗", "悬疑", "犯罪", "群像", "战斗热血", "日本漫画"], "zh_desc": "被赶出孤儿院来到横滨的青年‧中岛敦,\n\r\n无意间救了一位自杀失败、在河里浮沉的男子。\n\r\n男子名叫太宰治……隶属于以解决危险事件为业的特殊能力集团「武装侦探社」。\n\r\n他为了解决造成社会不安的「食人虎」骚动,正在进行调查。\n\r\n和食人虎有某种关联的中岛,在太宰的强硬邀请下陪同进行调查,但是──!?\n\r\n\n\r\n以横滨为舞台,文豪特殊能力战斗动作漫画揭开序幕!\n\n📚 作品信息:作者 春河35 / 朝雾カフカ · 评分 10 · 共收录 26 卷 / 119 话章节目录与高清彩页/条漫预览。", "hant_desc": "被趕出孤兒院來到橫濱的青年‧中島敦,\n\r\n無意間救了一位自殺失敗、在河裡浮沉的男子。\n\r\n男子名叫太宰治……隸屬於以解決危險事件為業的特殊能力集團「武裝偵探社」。\n\r\n他為了解決造成社會不安的「食人虎」騷動,正在進行調查。\n\r\n和食人虎有某種關聯的中島,在太宰的強硬邀請下陪同進行調查,但是──!?\n\r\n\n\r\n以橫濱為舞台,文豪特殊能力戰鬥動作漫畫揭開序幕!\n\n📚 作品資訊:作者 春河35 / 朝霧カフカ · 評分 10 · 共收錄 26 卷 / 119 話章節目錄與高清彩頁/條漫預覽。", "en_desc": "Popular serialized manga '文豪Stray Dogs' (文豪Stray Dogs) by 春河35 / 朝雾カフカ. Includes 26 volumes and 119 chapters with full online vertical/page-flip web reader.", "pages": ["https://media.huangguodrama.ai/motion/comics/bilimanga-417/page_01.jpg", "https://media.huangguodrama.ai/motion/comics/bilimanga-417/page_02.jpg", "https://media.huangguodrama.ai/motion/comics/bilimanga-417/page_03.jpg", "https://media.huangguodrama.ai/motion/comics/bilimanga-417/page_04.jpg", "https://media.huangguodrama.ai/motion/comics/bilimanga-417/page_05.jpg", "https://media.huangguodrama.ai/motion/comics/bilimanga-417/page_06.jpg"], "volumes": [{"title_hant": "文豪Stray Dogs 1", "title_zh": "文豪Stray Dogs 1", "cover_id": 716620, "first_chap_id": 33213, "cover_url": "https://i.motiezw.com/cover/417/716620.jpg"}, {"title_hant": "文豪Stray Dogs 2", "title_zh": "文豪Stray Dogs 2", "cover_id": 716828, "first_chap_id": 33219, "cover_url": "https://i.motiezw.com/cover/417/716828.jpg"}, {"title_hant": "文豪Stray Dogs 3", "title_zh": "文豪Stray Dogs 3", "cover_id": 720302, "first_chap_id": 33435, "cover_url": "https://i.motiezw.com/cover/417/720302.jpg"}, {"title_hant": "文豪Stray Dogs 4", "title_zh": "文豪Stray Dogs 4", "cover_id": 720493, "first_chap_id": 33440, "cover_url": "https://i.motiezw.com/cover/417/720493.jpg"}, {"title_hant": "文豪Stray Dogs 5", "title_zh": "文豪Stray Dogs 5", "cover_id": 720672, "first_chap_id": 33445, "cover_url": "https://i.motiezw.com/cover/417/720672.jpg"}, {"title_hant": "文豪Stray Dogs 6", "title_zh": "文豪Stray Dogs 6", "cover_id": 720851, "first_chap_id": 33451, "cover_url": "https://i.motiezw.com/cover/417/720851.jpg"}, {"title_hant": "文豪Stray Dogs 7", "title_zh": "文豪Stray Dogs 7", "cover_id": 721029, "first_chap_id": 33457, "cover_url": "https://i.motiezw.com/cover/417/721029.jpg"}, {"title_hant": "文豪Stray Dogs 8", "title_zh": "文豪Stray Dogs 8", "cover_id": 721225, "first_chap_id": 33463, "cover_url": "https://i.motiezw.com/cover/417/721225.jpg"}, {"title_hant": "文豪Stray Dogs 9", "title_zh": "文豪Stray Dogs 9", "cover_id": 721417, "first_chap_id": 33469, "cover_url": "https://i.motiezw.com/cover/417/721417.jpg"}, {"title_hant": "文豪Stray Dogs 10", "title_zh": "文豪Stray Dogs 10", "cover_id": 721597, "first_chap_id": 33475, "cover_url": "https://i.motiezw.com/cover/417/721597.jpg"}, {"title_hant": "文豪Stray Dogs 11", "title_zh": "文豪Stray Dogs 11", "cover_id": 729634, "first_chap_id": 33736, "cover_url": "https://i.motiezw.com/cover/417/729634.jpg"}, {"title_hant": "文豪Stray Dogs 12", "title_zh": "文豪Stray Dogs 12", "cover_id": 729809, "first_chap_id": 33741, "cover_url": "https://i.motiezw.com/cover/417/729809.jpg"}], "chapters": [{"cid": "33213", "title": "第一話 塞翁失虎", "title_zh": "第一话 塞翁失虎"}, {"cid": "33210", "title": "第二話 炸彈", "title_zh": "第二话 炸弹"}, {"cid": "33211", "title": "第三話 橫濱匪徒天堂(前篇)", "title_zh": "第三话 横滨匪徒天堂(前篇)"}, {"cid": "33212", "title": "第四話 橫濱匪徒天堂(後篇)", "title_zh": "第四话 横滨匪徒天堂(后篇)"}, {"cid": "33214", "title": "後記", "title_zh": "后记"}, {"cid": "33219", "title": "第五話 宿命論者的悲傷", "title_zh": "第五话 宿命论者的悲伤"}, {"cid": "33217", "title": "第六話 Murder on D Street", "title_zh": "第六话 Murder on D Street"}, {"cid": "33218", "title": "第七話 先殺別人後葬自己(前篇)", "title_zh": "第七话 先杀别人后葬自己(前篇)"}, {"cid": "33216", "title": "第八話 先殺別人後葬自己(後篇)", "title_zh": "第八话 先杀别人后葬自己(后篇)"}, {"cid": "33435", "title": "第九話 M麗的人靜默如石像", "title_zh": "第九话 M丽的人静默如石像"}, {"cid": "33436", "title": "第十話 Detective Boys", "title_zh": "第十话 Detective Boys"}, {"cid": "33437", "title": "第十一話 過往的……", "title_zh": "第十一话 过往的……"}, {"cid": "33438", "title": "第十二話 羅生門與虎", "title_zh": "第十二话 罗生门与虎"}, {"cid": "33440", "title": "第十三話 極樂偵探社", "title_zh": "第十三话 极乐侦探社"}, {"cid": "33441", "title": "第十四話 不適合她的職業", "title_zh": "第十四话 不适合她的职业"}, {"cid": "33442", "title": "第十五話 即使不斷地被推回過去(前篇)", "title_zh": "第十五话 即使不断地被推回过去(前篇)"}, {"cid": "33443", "title": "第十六話 即使不斷地被推回過去(後篇)", "title_zh": "第十六话 即使不断地被推回过去(后篇)"}, {"cid": "33445", "title": "第十七話 第一次出任務", "title_zh": "第十七话 第一次出任务"}, {"cid": "33446", "title": "第十八話 花與楓葉、雪與金S", "title_zh": "第十八话 花与枫叶、雪与金S"}, {"cid": "33448", "title": "第二十話 一顆檸檬", "title_zh": "第二十话 一颗柠檬"}, {"cid": "33449", "title": "附錄", "title_zh": "附录"}, {"cid": "33451", "title": "第二十一話 讀書修士與暗黑惡魔", "title_zh": "第二十一话 读书修士与暗黑恶魔"}, {"cid": "33452", "title": "第二十二話 The strategy of conflict", "title_zh": "第二十二话 The strategy of conflict"}, {"cid": "33453", "title": "第二十三話 憤怒的葡萄在眼中結實累累(前篇)", "title_zh": "第二十三话 愤怒的葡萄在眼中结实累累(前篇)"}, {"cid": "33454", "title": "第二十四話 憤怒的葡萄在眼中結實累累(後篇)", "title_zh": "第二十四话 愤怒的葡萄在眼中结实累累(后篇)"}, {"cid": "33455", "title": "附錄", "title_zh": "附录"}, {"cid": "33457", "title": "第二十五話 Q", "title_zh": "第二十五话 Q"}, {"cid": "33458", "title": "第二十六話 Will of Tycoon", "title_zh": "第二十六话 Will of Tycoon"}, {"cid": "33459", "title": "第二十七話 在夢想破碎的海邊", "title_zh": "第二十七话 在梦想破碎的海边"}, {"cid": "33460", "title": "第二十八話 緊急計劃", "title_zh": "第二十八话 紧急计划"}, {"cid": "33461", "title": "第二十九話 即使頭腦會出錯", "title_zh": "第二十九话 即使头脑会出错"}, {"cid": "33463", "title": "第三十話 沈默之塔、烏鴉之宴", "title_zh": "第三十话 沉默之塔、乌鸦之宴"}, {"cid": "33464", "title": "第三十一話 雙黑", "title_zh": "第三十一话 双黑"}, {"cid": "33465", "title": "第三十二話 玻與亂步", "title_zh": "第三十二话 玻与乱步"}, {"cid": "33466", "title": "第三十三話 白鯨徜徉於天之海", "title_zh": "第三十三话 白鲸徜徉于天之海"}, {"cid": "33467", "title": "附錄", "title_zh": "附录"}, {"cid": "33469", "title": "第三十四話 最後的大亭", "title_zh": "第三十四话 最后的大亭"}, {"cid": "33470", "title": "第三十五話 羅生門、虎與最後的大亭", "title_zh": "第三十五话 罗生门、虎与最后的大亭"}, {"cid": "33471", "title": "第三十六話 如果今天能夠卸下包袱", "title_zh": "第三十六话 如果今天能够卸下包袱"}, {"cid": "33473", "title": "附錄", "title_zh": "附录"}, {"cid": "33475", "title": "第三十八話 Slap the Stick", "title_zh": "第三十八话 Slap the Stick"}, {"cid": "33476", "title": "第三十九話 父親的肖像", "title_zh": "第三十九话 父亲的肖像"}, {"cid": "33477", "title": "第四十話 獨自前行", "title_zh": "第四十话 独自前行"}, {"cid": "33478", "title": "第四十一話 Addict", "title_zh": "第四十一话 Addict"}, {"cid": "33479", "title": "第四十二話 降罪人世間乃神之恩典", "title_zh": "第四十二话 降罪人世间乃神之恩典"}, {"cid": "33736", "title": "第四十三話 謝N人的戰爭!", "title_zh": "第四十三话 谢N人的战争!"}, {"cid": "33737", "title": "第四十四話 費茲傑羅再起", "title_zh": "第四十四话 费兹杰罗再起"}, {"cid": "33738", "title": "第四十五話 Fix it, Master Craft.", "title_zh": "第四十五话 Fix it, Master Craft."}, {"cid": "33739", "title": "第四十六話 戴面具的暗殺者", "title_zh": "第四十六话 戴面具的暗杀者"}, {"cid": "33741", "title": "第四十七話 共食 之壹", "title_zh": "第四十七话 共食 之壹"}, {"cid": "33742", "title": "第四十八話 共食 之貳", "title_zh": "第四十八话 共食 之贰"}, {"cid": "33743", "title": "第四十九話 共食 之叄", "title_zh": "第四十九话 共食 之叁"}, {"cid": "33744", "title": "第五十話 共食 之肆", "title_zh": "第五十话 共食 之肆"}, {"cid": "33746", "title": "第五十一話 迴向 之壹", "title_zh": "第五十一话 回向 之壹"}, {"cid": "33747", "title": "第五十二話 迴向 之貳", "title_zh": "第五十二话 回向 之贰"}, {"cid": "33748", "title": "第五十三話 迴向 之參", "title_zh": "第五十三话 回向 之参"}, {"cid": "33749", "title": "第五十四話 毫無破綻的殺人與殺人犯 之壹", "title_zh": "第五十四话 毫无破绽的杀人与杀人犯 之壹"}, {"cid": "33751", "title": "第五十五話 毫無破綻的殺人與殺人犯 之貳", "title_zh": "第五十五话 毫无破绽的杀人与杀人犯 之贰"}, {"cid": "33753", "title": "第五十七話 悲慘星期天 前篇", "title_zh": "第五十七话 悲惨星期天 前篇"}, {"cid": "33754", "title": "第五十八話 悲慘星期天 後篇", "title_zh": "第五十八话 悲惨星期天 后篇"}]};
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>