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-119", "mangaid": "119", "zh_title": "迷宫饭", "hant_title": "迷宮飯", "en_title": "迷宫饭 (Bilimanga #119)", "author": "九井谅子", "tags": ["奇幻", "冒险", "魔法", "治愈", "美食", "异世界", "奇幻冒险", "日本漫画"], "zh_desc": "在迷宫中冒险肚子饿了又没带粮食怎么办?\n\r\n很简单,只要把魔物拿来料理就好了!\n\r\n\n\r\n莱欧斯一行人终于进到迷宫深处,却遭到巨龙袭击,失去了金钱与粮食。\n\r\n决心再次挑战的他们若不解决粮食问题,半路便会饿死。\n\r\n此时,莱欧斯提出「吃魔物」的想法。\n\r\n不止史莱姆、宝箱怪,甚至连龙都打算吃下肚!?\n\r\n于是,一行人便展开了一边冒险一边料理魔物的……美食探险!?\n\r\n冒险家们是否能平安抵达终点,还是半路就会吃坏肚子呢?\n\r\n九井谅子首次长篇连载,「冒险×美食」的新奇幻风格,在此开幕!\n\n📚 作品信息:作者 九井谅子 · 评分 10 · 共收录 14 卷 / 106 话章节目录与高清彩页/条漫预览。", "hant_desc": "在迷宮中冒險肚子餓了又沒帶糧食怎麼辦?\n\r\n很簡單,只要把魔物拿來料理就好了!\n\r\n\n\r\n萊歐斯一行人終於進到迷宮深處,卻遭到巨龍襲擊,失去了金錢與糧食。\n\r\n決心再次挑戰的他們若不解決糧食問題,半路便會餓死。\n\r\n此時,萊歐斯提出「吃魔物」的想法。\n\r\n不止史萊姆、寶箱怪,甚至連龍都打算吃下肚!?\n\r\n於是,一行人便展開了一邊冒險一邊料理魔物的……美食探險!?\n\r\n冒險家們是否能平安抵達終點,還是半路就會吃壞肚子呢?\n\r\n九井諒子首次長篇連載,「冒險×美食」的新奇幻風格,在此開幕!\n\n📚 作品資訊:作者 九井諒子 · 評分 10 · 共收錄 14 卷 / 106 話章節目錄與高清彩頁/條漫預覽。", "en_desc": "Popular serialized manga '迷宫饭' (迷宮飯) by 九井谅子. Includes 14 volumes and 106 chapters with full online vertical/page-flip web reader.", "pages": ["https://media.huangguodrama.ai/motion/comics/bilimanga-119/page_01.jpg", "https://media.huangguodrama.ai/motion/comics/bilimanga-119/page_02.jpg", "https://media.huangguodrama.ai/motion/comics/bilimanga-119/page_03.jpg", "https://media.huangguodrama.ai/motion/comics/bilimanga-119/page_04.jpg", "https://media.huangguodrama.ai/motion/comics/bilimanga-119/page_05.jpg", "https://media.huangguodrama.ai/motion/comics/bilimanga-119/page_06.jpg"], "volumes": [{"title_hant": "迷宮飯 1", "title_zh": "迷宫饭 1", "cover_id": 177985, "first_chap_id": 8141, "cover_url": "https://i.motiezw.com/cover/119/177985.jpg"}, {"title_hant": "迷宮飯 2", "title_zh": "迷宫饭 2", "cover_id": 178176, "first_chap_id": 8150, "cover_url": "https://i.motiezw.com/cover/119/178176.jpg"}, {"title_hant": "迷宮飯 3", "title_zh": "迷宫饭 3", "cover_id": 178367, "first_chap_id": 8159, "cover_url": "https://i.motiezw.com/cover/119/178367.jpg"}, {"title_hant": "迷宮飯 4", "title_zh": "迷宫饭 4", "cover_id": 178558, "first_chap_id": 8168, "cover_url": "https://i.motiezw.com/cover/119/178558.jpg"}, {"title_hant": "迷宮飯 5", "title_zh": "迷宫饭 5", "cover_id": 178749, "first_chap_id": 8177, "cover_url": "https://i.motiezw.com/cover/119/178749.jpg"}, {"title_hant": "迷宮飯 6", "title_zh": "迷宫饭 6", "cover_id": 178948, "first_chap_id": 8186, "cover_url": "https://i.motiezw.com/cover/119/178948.jpg"}, {"title_hant": "迷宮飯 7", "title_zh": "迷宫饭 7", "cover_id": 179155, "first_chap_id": 8195, "cover_url": "https://i.motiezw.com/cover/119/179155.jpg"}, {"title_hant": "迷宮飯 8", "title_zh": "迷宫饭 8", "cover_id": 179370, "first_chap_id": 8204, "cover_url": "https://i.motiezw.com/cover/119/179370.jpg"}, {"title_hant": "迷宮飯 9", "title_zh": "迷宫饭 9", "cover_id": 179569, "first_chap_id": 8213, "cover_url": "https://i.motiezw.com/cover/119/179569.jpg"}, {"title_hant": "迷宮飯 10", "title_zh": "迷宫饭 10", "cover_id": 179776, "first_chap_id": 8221, "cover_url": "https://i.motiezw.com/cover/119/179776.jpg"}, {"title_hant": "迷宮飯 11", "title_zh": "迷宫饭 11", "cover_id": 179999, "first_chap_id": 8230, "cover_url": "https://i.motiezw.com/cover/119/179999.jpg"}, {"title_hant": "迷宮飯 12", "title_zh": "迷宫饭 12", "cover_id": 180214, "first_chap_id": 8240, "cover_url": "https://i.motiezw.com/cover/119/180214.jpg"}], "chapters": [{"cid": "8141", "title": "第1話 水煮鍋", "title_zh": "第1话 水煮锅"}, {"cid": "8142", "title": "第2話 派", "title_zh": "第2话 派"}, {"cid": "8143", "title": "第3話 烤蛇怪", "title_zh": "第3话 烤蛇怪"}, {"cid": "8144", "title": "第4話 歐姆蛋", "title_zh": "第4话 欧姆蛋"}, {"cid": "8145", "title": "第5話 炸什錦", "title_zh": "第5话 炸什锦"}, {"cid": "8146", "title": "第6話 會動的鎧甲-1", "title_zh": "第6话 会动的铠甲-1"}, {"cid": "8147", "title": "第7話 會動的鎧甲-2", "title_zh": "第7话 会动的铠甲-2"}, {"cid": "8148", "title": "附錄 怪獸閒聊-1", "title_zh": "附录 怪兽闲聊-1"}, {"cid": "8150", "title": "第8話 水煮高麗菜", "title_zh": "第8话 水煮高丽菜"}, {"cid": "8151", "title": "第9話 半獸人", "title_zh": "第9话 半兽人"}, {"cid": "8152", "title": "第10話 點心", "title_zh": "第10话 点心"}, {"cid": "8153", "title": "第11話 雪酷", "title_zh": "第11话 雪酷"}, {"cid": "8154", "title": "第12話 宮廷料理", "title_zh": "第12话 宫廷料理"}, {"cid": "8155", "title": "第13話 鹽素", "title_zh": "第13话 盐素"}, {"cid": "8156", "title": "第14話 水棲馬", "title_zh": "第14话 水栖马"}, {"cid": "8158", "title": "附錄 怪獸閒聊-2", "title_zh": "附录 怪兽闲聊-2"}, {"cid": "8159", "title": "第15話 雞炊粥", "title_zh": "第15话 鸡炊粥"}, {"cid": "8160", "title": "第16話 蒲燒", "title_zh": "第16话 蒲烧"}, {"cid": "8161", "title": "第17話 木莓", "title_zh": "第17话 木莓"}, {"cid": "8162", "title": "第18話 燒禸", "title_zh": "第18话 烧禸"}, {"cid": "8163", "title": "第19話 鱗手怪", "title_zh": "第19话 鳞手怪"}, {"cid": "8165", "title": "第21話 大青蛙", "title_zh": "第21话 大青蛙"}, {"cid": "8166", "title": "附錄 怪獸閒聊-3", "title_zh": "附录 怪兽闲聊-3"}, {"cid": "8168", "title": "第22話 在地上", "title_zh": "第22话 在地上"}, {"cid": "8169", "title": "第23話 炎龍-1", "title_zh": "第23话 炎龙-1"}, {"cid": "8170", "title": "第24話 炎龍-2", "title_zh": "第24话 炎龙-2"}, {"cid": "8171", "title": "第25話 炎龍-3", "title_zh": "第25话 炎龙-3"}, {"cid": "8172", "title": "第26話 炎龍-4", "title_zh": "第26话 炎龙-4"}, {"cid": "8173", "title": "第27話 炎龍-5", "title_zh": "第27话 炎龙-5"}, {"cid": "8174", "title": "第28話 炎龍-6", "title_zh": "第28话 炎龙-6"}, {"cid": "8175", "title": "附錄 怪獸閒聊-4", "title_zh": "附录 怪兽闲聊-4"}, {"cid": "8177", "title": "第29話 炎龍-7", "title_zh": "第29话 炎龙-7"}, {"cid": "8178", "title": "第30話 良藥", "title_zh": "第30话 良药"}, {"cid": "8179", "title": "第31話 海蛇前篇", "title_zh": "第31话 海蛇前篇"}, {"cid": "8180", "title": "第32話 海蛇後篇", "title_zh": "第32话 海蛇后篇"}, {"cid": "8181", "title": "第33話 樹妖", "title_zh": "第33话 树妖"}, {"cid": "8182", "title": "第34話 雞蛇", "title_zh": "第34话 鸡蛇"}, {"cid": "8183", "title": "第35話 掃除屋", "title_zh": "第35话 扫除屋"}, {"cid": "8184", "title": "附錄 怪獸閒聊-5", "title_zh": "附录 怪兽闲聊-5"}, {"cid": "8186", "title": "第36話 味醂魚乾", "title_zh": "第36话 味醂鱼干"}, {"cid": "8187", "title": "第37話 哈耳庇尼", "title_zh": "第37话 哈耳庇尼"}, {"cid": "8188", "title": "第38話 凱M拉", "title_zh": "第38话 凯M拉"}, {"cid": "8190", "title": "第40話 變形者-2", "title_zh": "第40话 变形者-2"}, {"cid": "8191", "title": "第41話 山姥", "title_zh": "第41话 山姥"}, {"cid": "8192", "title": "第42話 夢魘", "title_zh": "第42话 梦魇"}, {"cid": "8193", "title": "附錄 怪獸閒聊-6", "title_zh": "附录 怪兽闲聊-6"}, {"cid": "8195", "title": "第43話 冰霜哥雷姆", "title_zh": "第43话 冰霜哥雷姆"}, {"cid": "8196", "title": "第44話 植物羊", "title_zh": "第44话 植物羊"}, {"cid": "8197", "title": "第45話 蛋", "title_zh": "第45话 蛋"}, {"cid": "8198", "title": "第46話 黃金鄉", "title_zh": "第46话 黄金乡"}, {"cid": "8199", "title": "第47話 獅鷲獸", "title_zh": "第47话 狮鹫兽"}, {"cid": "8200", "title": "第48話 使魔", "title_zh": "第48话 使魔"}, {"cid": "8201", "title": "第49話 獅鷲獸清湯", "title_zh": "第49话 狮鹫兽清汤"}, {"cid": "8202", "title": "附錄 怪獸閒聊-7", "title_zh": "附录 怪兽闲聊-7"}, {"cid": "8204", "title": "第50話 水飲-1", "title_zh": "第50话 水饮-1"}, {"cid": "8205", "title": "第51話 水飲-2", "title_zh": "第51话 水饮-2"}, {"cid": "8206", "title": "第52話 增根蛋", "title_zh": "第52话 增根蛋"}, {"cid": "8207", "title": "第53話 於地下1樓-1", "title_zh": "第53话 于地下1楼-1"}, {"cid": "8208", "title": "第54話 於地下1樓-2", "title_zh": "第54话 于地下1楼-2"}, {"cid": "8209", "title": "第55話 於地下1樓-3", "title_zh": "第55话 于地下1楼-3"}]};
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>