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-1457", "mangaid": "1457", "zh_title": "少爷的时代", "hant_title": "少爺的時代", "en_title": "少爷的时代 (Bilimanga #1457)", "author": "关川夏央 / 谷口治郎", "tags": ["历史", "东方", "宅系", "群像", "励志", "历史文化", "日本漫画", "漫画"], "zh_desc": "明治时代远比现代人所想像得更为扰攘繁忙。明治三十八年,本名金之助的夏目漱石三十九岁,正为了想看清混沌不明的未来而痛苦不已。\n\r\n纪实作家关川夏央和漫画大师谷口治郎携手打造的经典漫画,鲜活地描绘在历史长河中奔驰而过的人物群像,以及近代日本的青年时期。\n\n📚 作品信息:作者 关川夏央 / 谷口治郎 · 评分 10 · 共收录 5 卷 / 69 话章节目录与高清彩页/条漫预览。", "hant_desc": "明治時代遠比現代人所想像得更為擾攘繁忙。明治三十八年,本名金之助的夏目漱石三十九歲,正為了想看清混沌不明的未來而痛苦不已。\n\r\n紀實作家關川夏央和漫畫大師谷口治郎攜手打造的經典漫畫,鮮活地描繪在歷史長河中奔馳而過的人物群像,以及近代日本的青年時期。\n\n📚 作品資訊:作者 關川夏央 / 谷口治郎 · 評分 10 · 共收錄 5 卷 / 69 話章節目錄與高清彩頁/條漫預覽。", "en_desc": "Popular serialized manga '少爷的时代' (少爺的時代) by 关川夏央 / 谷口治郎. Includes 5 volumes and 69 chapters with full online vertical/page-flip web reader.", "pages": ["https://media.huangguodrama.ai/motion/comics/bilimanga-1457/page_01.jpg", "https://media.huangguodrama.ai/motion/comics/bilimanga-1457/page_02.jpg", "https://media.huangguodrama.ai/motion/comics/bilimanga-1457/page_03.jpg", "https://media.huangguodrama.ai/motion/comics/bilimanga-1457/page_04.jpg", "https://media.huangguodrama.ai/motion/comics/bilimanga-1457/page_05.jpg", "https://media.huangguodrama.ai/motion/comics/bilimanga-1457/page_06.jpg"], "volumes": [{"title_hant": "少爺的時代 1", "title_zh": "少爷的时代 1", "cover_id": 2644370, "first_chap_id": 121334, "cover_url": "https://i.motiezw.com/cover/1457/2644370.jpg"}, {"title_hant": "少爺的時代 2 秋之舞姬", "title_zh": "少爷的时代 2 秋之舞姬", "cover_id": 2644621, "first_chap_id": 121347, "cover_url": "https://i.motiezw.com/cover/1457/2644621.jpg"}, {"title_hant": "少爺的時代 3 蒼空之下", "title_zh": "少爷的时代 3 苍空之下", "cover_id": 2644914, "first_chap_id": 121362, "cover_url": "https://i.motiezw.com/cover/1457/2644914.jpg"}, {"title_hant": "少爺的時代 4 明治流星雨", "title_zh": "少爷的时代 4 明治流星雨", "cover_id": 2645231, "first_chap_id": 121378, "cover_url": "https://i.motiezw.com/cover/1457/2645231.jpg"}, {"title_hant": "少爺的時代 5 悶悶不樂的漱石", "title_zh": "少爷的时代 5 闷闷不乐的漱石", "cover_id": 2645533, "first_chap_id": 121394, "cover_url": "https://i.motiezw.com/cover/1457/2645533.jpg"}], "chapters": [{"cid": "121334", "title": "第一章 漱石先生喝啤酒發酒瘋的事蹟和經過", "title_zh": "第一章 漱石先生喝啤酒发酒疯的事迹和经过"}, {"cid": "121335", "title": "第二章 漱石對於《少爺》的初期構想", "title_zh": "第二章 漱石对于《少爷》的初期构想"}, {"cid": "121336", "title": "第三章 明治三十八年秋天的日本", "title_zh": "第三章 明治三十八年秋天的日本"}, {"cid": "121337", "title": "第四章 漱石的底片", "title_zh": "第四章 漱石的底片"}, {"cid": "121338", "title": "第五章 明治群像", "title_zh": "第五章 明治群像"}, {"cid": "121339", "title": "第六章 瑪丹娜和阿清", "title_zh": "第六章 玛丹娜和阿清"}, {"cid": "121340", "title": "第七章 風蕭蕭兮墨水寒", "title_zh": "第七章 风萧萧兮墨水寒"}, {"cid": "121341", "title": "第八章 另一位「少爺」", "title_zh": "第八章 另一位「少爷」"}, {"cid": "121342", "title": "第九章 春風一陣", "title_zh": "第九章 春风一阵"}, {"cid": "121343", "title": "第十章 小說家漱石的誕生", "title_zh": "第十章 小说家漱石的诞生"}, {"cid": "121344", "title": "第十一章 明治三十九年的櫻花", "title_zh": "第十一章 明治三十九年的樱花"}, {"cid": "121345", "title": "附錄", "title_zh": "附录"}, {"cid": "121347", "title": "第一章 印度洋上的瞑目", "title_zh": "第一章 印度洋上的瞑目"}, {"cid": "121348", "title": "第二章 一八八八年九月 鷗外歸國", "title_zh": "第二章 一八八八年九月 鸥外归国"}, {"cid": "121349", "title": "第三章 德國N人艾莉絲・拜格列特", "title_zh": "第三章 德国N人艾莉丝・拜格列特"}, {"cid": "121350", "title": "第四章 陽光照耀的坡道", "title_zh": "第四章 阳光照耀的坡道"}, {"cid": "121351", "title": "第五章 明治四十二年七月 駒込千駄木町二十一番地", "title_zh": "第五章 明治四十二年七月 驹込千駄木町二十一番地"}, {"cid": "121352", "title": "第六章 留德日記(一)", "title_zh": "第六章 留德日记(一)"}, {"cid": "121353", "title": "第七章 留德日記(二)", "title_zh": "第七章 留德日记(二)"}, {"cid": "121354", "title": "第八章 我心無所依", "title_zh": "第八章 我心无所依"}, {"cid": "121355", "title": "第九章 兩段悲戀", "title_zh": "第九章 两段悲恋"}, {"cid": "121356", "title": "第十章 東京的冒險", "title_zh": "第十章 东京的冒险"}, {"cid": "121358", "title": "第十二章 越中島驟雨", "title_zh": "第十二章 越中岛骤雨"}, {"cid": "121359", "title": "最終章 寂寞的黃包車", "title_zh": "最终章 寂寞的黄包车"}, {"cid": "121360", "title": "附錄", "title_zh": "附录"}, {"cid": "121362", "title": "第一章 明治四十二年四月三日 煙雨", "title_zh": "第一章 明治四十二年四月三日 烟雨"}, {"cid": "121363", "title": "第二章 刮鬍子", "title_zh": "第二章 刮胡子"}, {"cid": "121364", "title": "第三章 淺草嘈雜的夜晚 被捲入是非", "title_zh": "第三章 浅草嘈杂的夜晚 被卷入是非"}, {"cid": "121365", "title": "第四章 借錢王啄木", "title_zh": "第四章 借钱王啄木"}, {"cid": "121366", "title": "第五章 啄木為何一貧如洗", "title_zh": "第五章 啄木为何一贫如洗"}, {"cid": "121367", "title": "第六章 借錢也是一種表現", "title_zh": "第六章 借钱也是一种表现"}, {"cid": "121368", "title": "第七章 墨田川木芽雨", "title_zh": "第七章 墨田川木芽雨"}, {"cid": "121369", "title": "第八章 火焰般的N人 管野須賀子", "title_zh": "第八章 火焰般的N人 管野须贺子"}, {"cid": "121370", "title": "第九章 退一步則餓死嗎 進一步則爆炸嗎", "title_zh": "第九章 退一步则饿死吗 进一步则爆炸吗"}, {"cid": "121371", "title": "第十章 不斷訴苦的時代", "title_zh": "第十章 不断诉苦的时代"}, {"cid": "121372", "title": "第十一章 N人堅強 男人卻靠不住", "title_zh": "第十一章 N人坚强 男人却靠不住"}, {"cid": "121373", "title": "第十二章 予乃弱者", "title_zh": "第十二章 予乃弱者"}, {"cid": "121374", "title": "第十三章 「憧憬」也可以出賣", "title_zh": "第十三章 「憧憬」也可以出卖"}, {"cid": "121375", "title": "最終章 搬到弓町", "title_zh": "最终章 搬到弓町"}, {"cid": "121376", "title": "附錄", "title_zh": "附录"}, {"cid": "121378", "title": "第一章 秋水被捕", "title_zh": "第一章 秋水被捕"}, {"cid": "121379", "title": "第二章 土佐中村之人、幸德傳次郎", "title_zh": "第二章 土佐中村之人、幸德传次郎"}, {"cid": "121380", "title": "第三章 社會主義是什麼?", "title_zh": "第三章 社会主义是什么?"}, {"cid": "121381", "title": "第四章 日俄戰爭中的他們", "title_zh": "第四章 日俄战争中的他们"}, {"cid": "121383", "title": "第六章 清涼的泥濘、寒村這個年輕人", "title_zh": "第六章 清凉的泥泞、寒村这个年轻人"}, {"cid": "121384", "title": "第七章 寂寞如火的N人、須賀子", "title_zh": "第七章 寂寞如火的N人、须贺子"}, {"cid": "121385", "title": "第八章 無政府共產", "title_zh": "第八章 无政府共产"}, {"cid": "121386", "title": "第九章 運命之車", "title_zh": "第九章 运命之车"}, {"cid": "121387", "title": "第十章 給日本皇帝睦仁君", "title_zh": "第十章 给日本皇帝睦仁君"}, {"cid": "121388", "title": "第十一章 恐怖主義者群像", "title_zh": "第十一章 恐怖主义者群像"}, {"cid": "121389", "title": "第十二章 正義的人們", "title_zh": "第十二章 正义的人们"}, {"cid": "121390", "title": "第十三章 哈雷彗星回歸", "title_zh": "第十三章 哈雷彗星回归"}, {"cid": "121391", "title": "最終章 明治流星雨", "title_zh": "最终章 明治流星雨"}, {"cid": "121392", "title": "附錄", "title_zh": "附录"}, {"cid": "121394", "title": "第一章 下雨", "title_zh": "第一章 下雨"}, {"cid": "121395", "title": "第二章 臍下三寸", "title_zh": "第二章 脐下三寸"}, {"cid": "121396", "title": "第三章 幽明混沌", "title_zh": "第三章 幽明混沌"}, {"cid": "121397", "title": "第四章 立秋小康", "title_zh": "第四章 立秋小康"}, {"cid": "121398", "title": "第五章 傾聽秋風", "title_zh": "第五章 倾听秋风"}, {"cid": "121399", "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>