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-997", "mangaid": "997", "zh_title": "通灵童子 完全版", "hant_title": "通靈童子 完全版", "en_title": "通灵童子 完全版 (Bilimanga #997)", "author": "武井宏之", "tags": ["奇幻", "冒险", "战斗", "异能", "人外", "神鬼", "奇幻冒险", "日本漫画"], "zh_desc": "据说通灵人拥有不可思议的能力,能连结阴阳两界、心灵与身体、过去与未来,并和神、精灵、死者之灵交流!我们班的转学生──麻仓叶,其实就是个通灵人!为了成为能掌管世间所有灵魂的通灵王,麻仓叶及伙伴们参加了通灵人大战!增加刊头角色设定及及全新彩稿的通灵童子完全版登场!\n\n📚 作品信息:作者 武井宏之 · 评分 10 · 共收录 27 卷 / 313 话章节目录与高清彩页/条漫预览。", "hant_desc": "據說通靈人擁有不可思議的能力,能連結陰陽兩界、心靈與身體、過去與未來,並和神、精靈、死者之靈交流!我們班的轉學生──麻倉葉,其實就是個通靈人!為了成為能掌管世間所有靈魂的通靈王,麻倉葉及夥伴們參加了通靈人大戰!增加刊頭角色設定及及全新彩稿的通靈童子完全版登場!\n\n📚 作品資訊:作者 武井宏之 · 評分 10 · 共收錄 27 卷 / 313 話章節目錄與高清彩頁/條漫預覽。", "en_desc": "Popular serialized manga '通灵童子 完全版' (通靈童子 完全版) by 武井宏之. Includes 27 volumes and 313 chapters with full online vertical/page-flip web reader.", "pages": ["https://media.huangguodrama.ai/motion/comics/bilimanga-997/page_01.jpg", "https://media.huangguodrama.ai/motion/comics/bilimanga-997/page_02.jpg", "https://media.huangguodrama.ai/motion/comics/bilimanga-997/page_03.jpg", "https://media.huangguodrama.ai/motion/comics/bilimanga-997/page_04.jpg", "https://media.huangguodrama.ai/motion/comics/bilimanga-997/page_05.jpg", "https://media.huangguodrama.ai/motion/comics/bilimanga-997/page_06.jpg"], "volumes": [{"title_hant": "通靈童子 完全版 1", "title_zh": "通灵童子 完全版 1", "cover_id": 1763984, "first_chap_id": 81701, "cover_url": "https://i.motiezw.com/cover/997/1763984.jpg"}, {"title_hant": "通靈童子 完全版 2", "title_zh": "通灵童子 完全版 2", "cover_id": 1764209, "first_chap_id": 81711, "cover_url": "https://i.motiezw.com/cover/997/1764209.jpg"}, {"title_hant": "通靈童子 完全版 3", "title_zh": "通灵童子 完全版 3", "cover_id": 1764445, "first_chap_id": 81723, "cover_url": "https://i.motiezw.com/cover/997/1764445.jpg"}, {"title_hant": "通靈童子 完全版 4", "title_zh": "通灵童子 完全版 4", "cover_id": 1764674, "first_chap_id": 81735, "cover_url": "https://i.motiezw.com/cover/997/1764674.jpg"}, {"title_hant": "通靈童子 完全版 5", "title_zh": "通灵童子 完全版 5", "cover_id": 1764908, "first_chap_id": 81748, "cover_url": "https://i.motiezw.com/cover/997/1764908.jpg"}, {"title_hant": "通靈童子 完全版 6", "title_zh": "通灵童子 完全版 6", "cover_id": 1765146, "first_chap_id": 81762, "cover_url": "https://i.motiezw.com/cover/997/1765146.jpg"}, {"title_hant": "通靈童子 完全版 7", "title_zh": "通灵童子 完全版 7", "cover_id": 1765384, "first_chap_id": 81775, "cover_url": "https://i.motiezw.com/cover/997/1765384.jpg"}, {"title_hant": "通靈童子 完全版 8", "title_zh": "通灵童子 完全版 8", "cover_id": 1765625, "first_chap_id": 81789, "cover_url": "https://i.motiezw.com/cover/997/1765625.jpg"}, {"title_hant": "通靈童子 完全版 9", "title_zh": "通灵童子 完全版 9", "cover_id": 1765857, "first_chap_id": 81802, "cover_url": "https://i.motiezw.com/cover/997/1765857.jpg"}, {"title_hant": "通靈童子 完全版 10", "title_zh": "通灵童子 完全版 10", "cover_id": 1766101, "first_chap_id": 81816, "cover_url": "https://i.motiezw.com/cover/997/1766101.jpg"}, {"title_hant": "通靈童子 完全版 11", "title_zh": "通灵童子 完全版 11", "cover_id": 1766319, "first_chap_id": 81828, "cover_url": "https://i.motiezw.com/cover/997/1766319.jpg"}, {"title_hant": "通靈童子 完全版 12", "title_zh": "通灵童子 完全版 12", "cover_id": 1766560, "first_chap_id": 81842, "cover_url": "https://i.motiezw.com/cover/997/1766560.jpg"}], "chapters": [{"cid": "81701", "title": "第1迴 與幽靈共舞的男子", "title_zh": "第1回 与幽灵共舞的男子"}, {"cid": "81702", "title": "第2迴 等待的武士", "title_zh": "第2回 等待的武士"}, {"cid": "81703", "title": "第3迴 未完成的招牌", "title_zh": "第3回 未完成的招牌"}, {"cid": "81704", "title": "第4迴 幽靈拳擊手!", "title_zh": "第4回 幽灵拳击手!"}, {"cid": "81705", "title": "第5迴 武士保鑣", "title_zh": "第5回 武士保镳"}, {"cid": "81706", "title": "第6迴 另一個通靈人", "title_zh": "第6回 另一个通灵人"}, {"cid": "81707", "title": "第7迴 SHAMAN X SHAMAN", "title_zh": "第7回 SHAMAN X SHAMAN"}, {"cid": "81708", "title": "第8迴 附身100%", "title_zh": "第8回 附身100%"}, {"cid": "81709", "title": "第9迴 通靈王", "title_zh": "第9回 通灵王"}, {"cid": "81711", "title": "第10迥 少年老成的資深通靈人", "title_zh": "第10迥 少年老成的资深通灵人"}, {"cid": "81712", "title": "第11迴 通靈人的生活!", "title_zh": "第11回 通灵人的生活!"}, {"cid": "81713", "title": "第12迴 功夫大師", "title_zh": "第12回 功夫大师"}, {"cid": "81714", "title": "第13迴 屍傀儡", "title_zh": "第13回 尸傀儡"}, {"cid": "81715", "title": "第14迴 衝啊!萬太!", "title_zh": "第14回 冲啊!万太!"}, {"cid": "81716", "title": "第15迴 白龍憤怒的一擊", "title_zh": "第15回 白龙愤怒的一击"}, {"cid": "81717", "title": "第16迴 降乩", "title_zh": "第16回 降乩"}, {"cid": "81718", "title": "第17迴 白龍的導彈道之路", "title_zh": "第17回 白龙的导弹道之路"}, {"cid": "81719", "title": "第18迴 BEST PLACE TREKKERS", "title_zh": "第18回 BEST PLACE TREKKERS"}, {"cid": "81720", "title": "第19迴 因緣600年", "title_zh": "第19回 因缘600年"}, {"cid": "81721", "title": "第20迴 來勢洶洶的蜥蝪郎", "title_zh": "第20回 来势汹汹的蜥蝪郎"}, {"cid": "81723", "title": "第21迴 降於春天的雨", "title_zh": "第21回 降于春天的雨"}, {"cid": "81725", "title": "第23迴 蜥蜴郎悲歌", "title_zh": "第23回 蜥蜴郎悲歌"}, {"cid": "81726", "title": "第24迴 附身合體蜥蜴郎", "title_zh": "第24回 附身合体蜥蜴郎"}, {"cid": "81727", "title": "第25迴 阿龍的報恩", "title_zh": "第25回 阿龙的报恩"}, {"cid": "81728", "title": "第26迴 預告開幕的星星", "title_zh": "第26回 预告开幕的星星"}, {"cid": "81729", "title": "第27迴 全新的戰鬥", "title_zh": "第27回 全新的战斗"}, {"cid": "81730", "title": "第28迴 席巴式風格", "title_zh": "第28回 席巴式风格"}, {"cid": "81731", "title": "第29迴 OVER SOUL", "title_zh": "第29回 OVER SOUL"}, {"cid": "81732", "title": "第30迴 席巴的圖騰柱", "title_zh": "第30回 席巴的图腾柱"}, {"cid": "81733", "title": "第31迴 GET AN ORACLE BELL", "title_zh": "第31回 GET AN ORACLE BELL"}, {"cid": "81735", "title": "第32迴 帕契的教誨", "title_zh": "第32回 帕契的教诲"}, {"cid": "81736", "title": "第33迴 灄隆轟隆", "title_zh": "第33回 滠隆轰隆"}, {"cid": "81737", "title": "第34迴 可樂樂的力量", "title_zh": "第34回 可乐乐的力量"}, {"cid": "81738", "title": "第35迴 隆轟隆的夢想", "title_zh": "第35回 隆轰隆的梦想"}, {"cid": "81739", "title": "第36迴 強悍的刀、強悍的靈", "title_zh": "第36回 强悍的刀、强悍的灵"}, {"cid": "81740", "title": "第37迴 膦負分嘵", "title_zh": "第37回 膦负分哓"}, {"cid": "81741", "title": "第38迴 澡堂與星空", "title_zh": "第38回 澡堂与星空"}, {"cid": "81742", "title": "第39迴 有「骨」氣的傢伙", "title_zh": "第39回 有「骨」气的家伙"}, {"cid": "81743", "title": "第40迴 打開腹部說亮話", "title_zh": "第40回 打开腹部说亮话"}, {"cid": "81744", "title": "第41迴 NATURAL BONE KILLERS", "title_zh": "第41回 NATURAL BONE KILLERS"}, {"cid": "81745", "title": "第42迴 挑釁醫師", "title_zh": "第42回 挑衅医师"}, {"cid": "81746", "title": "發奮丘之詩", "title_zh": "发奋丘之诗"}, {"cid": "81748", "title": "第43迴「關於葉」", "title_zh": "第43回「关于叶」"}, {"cid": "81750", "title": "第45迴 法斯特之愛", "title_zh": "第45回 法斯特之爱"}, {"cid": "81751", "title": "第46迴 這樣的勇氣", "title_zh": "第46回 这样的勇气"}, {"cid": "81752", "title": "第47迴 6月的離別", "title_zh": "第47回 6月的离别"}, {"cid": "81753", "title": "第48迴 兩個男人的出雲之旅", "title_zh": "第48回 两个男人的出云之旅"}, {"cid": "81754", "title": "第49迴 最佳地點論", "title_zh": "第49回 最佳地点论"}, {"cid": "81755", "title": "第50迴 蛋蛋地獄", "title_zh": "第50回 蛋蛋地狱"}, {"cid": "81756", "title": "第51迴 嗨!", "title_zh": "第51回 嗨!"}, {"cid": "81757", "title": "第52迴 進化", "title_zh": "第52回 进化"}, {"cid": "81758", "title": "第53迴 兩人的超靈體", "title_zh": "第53回 两人的超灵体"}, {"cid": "81759", "title": "發奮丘之詩2000", "title_zh": "发奋丘之诗2000"}, {"cid": "81762", "title": "第54迴 口號", "title_zh": "第54回 口号"}, {"cid": "81763", "title": "第55迴 墓園重逢", "title_zh": "第55回 墓园重逢"}, {"cid": "81764", "title": "第56迴 悠哉的傢伙", "title_zh": "第56回 悠哉的家伙"}, {"cid": "81765", "title": "第57迴 靈魂摩多靈園", "title_zh": "第57回 灵魂摩多灵园"}, {"cid": "81766", "title": "第58迴 巫力與靈力", "title_zh": "第58回 巫力与灵力"}, {"cid": "81767", "title": "第59迴 不勉強", "title_zh": "第59回 不勉强"}, {"cid": "81768", "title": "第60迴 為何", "title_zh": "第60回 为何"}]};
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>