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>3月的狮子 - 在线漫画阅读器</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-698", "mangaid": "698", "zh_title": "3月的狮子", "hant_title": "3月的獅子", "en_title": "3月的狮子 (Bilimanga #698)", "author": "羽海野千花", "tags": ["青春", "日常", "竞技", "治愈", "群像", "校园青春", "日本漫画", "漫画"], "zh_desc": "独自居住在东京旧市街的17岁职业将棋棋士──桐山零。\n\r\n他是个幼时就因为意外失去家人,怀抱著深沉孤独的少年。\n\r\n出现在这样的他面前的,是明、日向、桃三姊妹。\n\r\n与她们的相处后,零开始…\n\n📚 作品信息:作者 羽海野千花 · 评分 10 · 共收录 19 卷 / 223 话章节目录与高清彩页/条漫预览。", "hant_desc": "獨自居住在東京舊市街的17歲職業將棋棋士──桐山零。\n\r\n他是個幼時就因為意外失去家人,懷抱著深沉孤獨的少年。\n\r\n出現在這樣的他面前的,是明、日向、桃三姊妹。\n\r\n與她們的相處後,零開始…\n\n📚 作品資訊:作者 羽海野千花 · 評分 10 · 共收錄 19 卷 / 223 話章節目錄與高清彩頁/條漫預覽。", "en_desc": "Popular serialized manga '3月的狮子' (3月的獅子) by 羽海野千花. Includes 19 volumes and 223 chapters with full online vertical/page-flip web reader.", "pages": ["https://media.huangguodrama.ai/motion/comics/bilimanga-698/page_01.jpg", "https://media.huangguodrama.ai/motion/comics/bilimanga-698/page_02.jpg", "https://media.huangguodrama.ai/motion/comics/bilimanga-698/page_03.jpg", "https://media.huangguodrama.ai/motion/comics/bilimanga-698/page_04.jpg", "https://media.huangguodrama.ai/motion/comics/bilimanga-698/page_05.jpg", "https://media.huangguodrama.ai/motion/comics/bilimanga-698/page_06.jpg"], "volumes": [{"title_hant": "3月的獅子 1", "title_zh": "3月的狮子 1", "cover_id": 1186798, "first_chap_id": 53169, "cover_url": "https://i.motiezw.com/cover/698/1186798.jpg"}, {"title_hant": "3月的獅子 2", "title_zh": "3月的狮子 2", "cover_id": 1187128, "first_chap_id": 53193, "cover_url": "https://i.motiezw.com/cover/698/1187128.jpg"}, {"title_hant": "3月的獅子 3", "title_zh": "3月的狮子 3", "cover_id": 1187319, "first_chap_id": 53206, "cover_url": "https://i.motiezw.com/cover/698/1187319.jpg"}, {"title_hant": "3月的獅子 4", "title_zh": "3月的狮子 4", "cover_id": 1187512, "first_chap_id": 53219, "cover_url": "https://i.motiezw.com/cover/698/1187512.jpg"}, {"title_hant": "3月的獅子 5", "title_zh": "3月的狮子 5", "cover_id": 1187692, "first_chap_id": 53231, "cover_url": "https://i.motiezw.com/cover/698/1187692.jpg"}, {"title_hant": "3月的獅子 6", "title_zh": "3月的狮子 6", "cover_id": 1187872, "first_chap_id": 53243, "cover_url": "https://i.motiezw.com/cover/698/1187872.jpg"}, {"title_hant": "3月的獅子 7", "title_zh": "3月的狮子 7", "cover_id": 1188058, "first_chap_id": 53255, "cover_url": "https://i.motiezw.com/cover/698/1188058.jpg"}, {"title_hant": "3月的獅子 8", "title_zh": "3月的狮子 8", "cover_id": 1188239, "first_chap_id": 53267, "cover_url": "https://i.motiezw.com/cover/698/1188239.jpg"}, {"title_hant": "3月的獅子 9", "title_zh": "3月的狮子 9", "cover_id": 1188418, "first_chap_id": 53280, "cover_url": "https://i.motiezw.com/cover/698/1188418.jpg"}, {"title_hant": "3月的獅子 10", "title_zh": "3月的狮子 10", "cover_id": 1188597, "first_chap_id": 53292, "cover_url": "https://i.motiezw.com/cover/698/1188597.jpg"}, {"title_hant": "3月的獅子 11", "title_zh": "3月的狮子 11", "cover_id": 1188776, "first_chap_id": 53305, "cover_url": "https://i.motiezw.com/cover/698/1188776.jpg"}, {"title_hant": "3月的獅子 12", "title_zh": "3月的狮子 12", "cover_id": 1188957, "first_chap_id": 53316, "cover_url": "https://i.motiezw.com/cover/698/1188957.jpg"}], "chapters": [{"cid": "53169", "title": "Chapter.1 桐山零", "title_zh": "Chapter.1 桐山零"}, {"cid": "53170", "title": "Chapter.2 河邊的小鎮", "title_zh": "Chapter.2 河边的小镇"}, {"cid": "53171", "title": "Chapter.3 明", "title_zh": "Chapter.3 明"}, {"cid": "53172", "title": "Chapter.4 橋的彼端", "title_zh": "Chapter.4 桥的彼端"}, {"cid": "53173", "title": "Chapter.5 晴信", "title_zh": "Chapter.5 晴信"}, {"cid": "53174", "title": "Chapter.6 夜空的彼端", "title_zh": "Chapter.6 夜空的彼端"}, {"cid": "53175", "title": "Chapter.7 日向", "title_zh": "Chapter.7 日向"}, {"cid": "53176", "title": "Chapter.8 VS.", "title_zh": "Chapter.8 VS."}, {"cid": "53177", "title": "Chapter.9 契約", "title_zh": "Chapter.9 契约"}, {"cid": "53178", "title": "Chapter.10 杜鵑鳥的巢上", "title_zh": "Chapter.10 杜鹃鸟的巢上"}, {"cid": "53179", "title": "附錄", "title_zh": "附录"}, {"cid": "53193", "title": "Chapter.11 神之子(其之①)", "title_zh": "Chapter.11 神之子(其之①)"}, {"cid": "53194", "title": "Chapter.12 神之子(其之②)", "title_zh": "Chapter.12 神之子(其之②)"}, {"cid": "53195", "title": "Chapter.13 神之子(其之③)", "title_zh": "Chapter.13 神之子(其之③)"}, {"cid": "53196", "title": "Chapter.14 重要之物。重要之事。", "title_zh": "Chapter.14 重要之物。重要之事。"}, {"cid": "53197", "title": "Chapter.15 教教我將棋", "title_zh": "Chapter.15 教教我将棋"}, {"cid": "53198", "title": "Chapter.16 記憶中的容貌", "title_zh": "Chapter.16 记忆中的容貌"}, {"cid": "53199", "title": "Chapter.17 遠雷(其之①)", "title_zh": "Chapter.17 远雷(其之①)"}, {"cid": "53200", "title": "Chapter.18 遠雷(其之②)", "title_zh": "Chapter.18 远雷(其之②)"}, {"cid": "53201", "title": "Chapter.19 遠雷(其之③)", "title_zh": "Chapter.19 远雷(其之③)"}, {"cid": "53202", "title": "Chapter.20 受贈的禮物(其之①)", "title_zh": "Chapter.20 受赠的礼物(其之①)"}, {"cid": "53203", "title": "Chapter.21 受贈的禮物(其之②)", "title_zh": "Chapter.21 受赠的礼物(其之②)"}, {"cid": "53206", "title": "Chapter.22 過去一年", "title_zh": "Chapter.22 过去一年"}, {"cid": "53207", "title": "Chapter.23 將來一年", "title_zh": "Chapter.23 将来一年"}, {"cid": "53208", "title": "Chapter.24 在對岸的事物", "title_zh": "Chapter.24 在对岸的事物"}, {"cid": "53209", "title": "Chapter.25 漆黑河流(其之①)", "title_zh": "Chapter.25 漆黑河流(其之①)"}, {"cid": "53210", "title": "Chapter.26 漆黑河流(其之②)", "title_zh": "Chapter.26 漆黑河流(其之②)"}, {"cid": "53211", "title": "Chapter.27 門的另一邊", "title_zh": "Chapter.27 门的另一边"}, {"cid": "53212", "title": "Chapter.28 炫目的黑暗", "title_zh": "Chapter.28 炫目的黑暗"}, {"cid": "53213", "title": "Chapter.29 僅有的涓滴之水", "title_zh": "Chapter.29 仅有的涓滴之水"}, {"cid": "53214", "title": "Chapter.30 月光", "title_zh": "Chapter.30 月光"}, {"cid": "53215", "title": "Chapter.31 自我的糾結團塊", "title_zh": "Chapter.31 自我的纠结团块"}, {"cid": "53216", "title": "Chapter.32 奔馳於夜晚", "title_zh": "Chapter.32 奔驰于夜晚"}, {"cid": "53217", "title": "附錄", "title_zh": "附录"}, {"cid": "53219", "title": "Chapter.33 坡道途中", "title_zh": "Chapter.33 坡道途中"}, {"cid": "53220", "title": "Chapter.34 銀絲線", "title_zh": "Chapter.34 银丝线"}, {"cid": "53221", "title": "Chapter.35 水面", "title_zh": "Chapter.35 水面"}, {"cid": "53222", "title": "Chapter.36 藍S夜晚之底", "title_zh": "Chapter.36 蓝S夜晚之底"}, {"cid": "53223", "title": "Chapter.37 奔流", "title_zh": "Chapter.37 奔流"}, {"cid": "53224", "title": "Chapter.38 經過的時邊", "title_zh": "Chapter.38 经过的时边"}, {"cid": "53225", "title": "Chapter.39 披星戴月", "title_zh": "Chapter.39 披星戴月"}, {"cid": "53226", "title": "Chapter.40 京都①", "title_zh": "Chapter.40 京都①"}, {"cid": "53227", "title": "Chapter.41 京都②", "title_zh": "Chapter.41 京都②"}, {"cid": "53228", "title": "Chapter.42 京都③", "title_zh": "Chapter.42 京都③"}, {"cid": "53231", "title": "Chapter.43 櫻花盛開之時", "title_zh": "Chapter.43 樱花盛开之时"}, {"cid": "53232", "title": "Chapter.44 輕聲細語的嘮叨", "title_zh": "Chapter.44 轻声细语的唠叨"}, {"cid": "53233", "title": "Chapter.45 新學期", "title_zh": "Chapter.45 新学期"}, {"cid": "53234", "title": "Chapter.46 西陽", "title_zh": "Chapter.46 西阳"}, {"cid": "53235", "title": "Chapter.47 彈珠汽水糖", "title_zh": "Chapter.47 弹珠汽水糖"}, {"cid": "53236", "title": "Chapter.48 混沌", "title_zh": "Chapter.48 混沌"}, {"cid": "53237", "title": "Chapter.49 隈倉", "title_zh": "Chapter.49 隈仓"}, {"cid": "53238", "title": "Chapter.50 六月", "title_zh": "Chapter.50 六月"}, {"cid": "53239", "title": "Chapter.51 瓢蟲之木①", "title_zh": "Chapter.51 瓢虫之木①"}, {"cid": "53240", "title": "Chapter.52 瓢蟲之木②", "title_zh": "Chapter.52 瓢虫之木②"}, {"cid": "53241", "title": "Chapter.53 瓢蟲之木③", "title_zh": "Chapter.53 瓢虫之木③"}, {"cid": "53243", "title": "Chapter.54 意念", "title_zh": "Chapter.54 意念"}, {"cid": "53244", "title": "Chapter.55 告白", "title_zh": "Chapter.55 告白"}, {"cid": "53245", "title": "Chapter.56 小小世界", "title_zh": "Chapter.56 小小世界"}, {"cid": "53246", "title": "Chapter.57 信", "title_zh": "Chapter.57 信"}, {"cid": "53247", "title": "Chapter.58 梅雨的開始", "title_zh": "Chapter.58 梅雨的开始"}]};
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>