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-1618", "mangaid": "1618", "zh_title": "勇者斗恶龙 幻之大地", "hant_title": "勇者鬥惡龍 幻之大地", "en_title": "勇者斗恶龙 幻之大地 (Bilimanga #1618)", "author": "神崎まさおみ / 堀井雄二 / とまとあき", "tags": ["奇幻", "冒险", "战斗", "魔法", "穿越", "奇幻冒险", "日本漫画", "漫画"], "zh_desc": "自出生以来便身负重任的波兹,为了实现成为勇者的梦想而离开了自己的村庄莱夫可德,踏上寻找幻之大地的旅程。离乡背井的他,将展开什么样的大冒险呢?\n\n📚 作品信息:作者 神崎まさおみ / 堀井雄二 / とまとあき · 评分 10 · 共收录 10 卷 / 51 话章节目录与高清彩页/条漫预览。", "hant_desc": "自出生以來便身負重任的波茲,為了實現成為勇者的夢想而離開了自己的村莊萊夫可德,踏上尋找幻之大地的旅程。離鄉背井的他,將展開什麼樣的大冒險呢?\n\n📚 作品資訊:作者 神崎まさおみ / 堀井雄二 / とまとあき · 評分 10 · 共收錄 10 卷 / 51 話章節目錄與高清彩頁/條漫預覽。", "en_desc": "Popular serialized manga '勇者斗恶龙 幻之大地' (勇者鬥惡龍 幻之大地) by 神崎まさおみ / 堀井雄二 / とまとあき. Includes 10 volumes and 51 chapters with full online vertical/page-flip web reader.", "pages": ["https://media.huangguodrama.ai/motion/comics/bilimanga-1618/page_01.jpg", "https://media.huangguodrama.ai/motion/comics/bilimanga-1618/page_02.jpg", "https://media.huangguodrama.ai/motion/comics/bilimanga-1618/page_03.jpg", "https://media.huangguodrama.ai/motion/comics/bilimanga-1618/page_04.jpg", "https://media.huangguodrama.ai/motion/comics/bilimanga-1618/page_05.jpg", "https://media.huangguodrama.ai/motion/comics/bilimanga-1618/page_06.jpg"], "volumes": [{"title_hant": "勇者鬥惡龍 幻之大地 1", "title_zh": "勇者斗恶龙 幻之大地 1", "cover_id": 2923801, "first_chap_id": 133713, "cover_url": "https://i.motiezw.com/cover/1618/2923801.jpg"}, {"title_hant": "勇者鬥惡龍 幻之大地 2", "title_zh": "勇者斗恶龙 幻之大地 2", "cover_id": 2925424, "first_chap_id": 133806, "cover_url": "https://i.motiezw.com/cover/1618/2925424.jpg"}, {"title_hant": "勇者鬥惡龍 幻之大地 3", "title_zh": "勇者斗恶龙 幻之大地 3", "cover_id": 2925600, "first_chap_id": 133813, "cover_url": "https://i.motiezw.com/cover/1618/2925600.jpg"}, {"title_hant": "勇者鬥惡龍 幻之大地 4", "title_zh": "勇者斗恶龙 幻之大地 4", "cover_id": 2925777, "first_chap_id": 133820, "cover_url": "https://i.motiezw.com/cover/1618/2925777.jpg"}, {"title_hant": "勇者鬥惡龍 幻之大地 5", "title_zh": "勇者斗恶龙 幻之大地 5", "cover_id": 2925955, "first_chap_id": 133826, "cover_url": "https://i.motiezw.com/cover/1618/2925955.jpg"}, {"title_hant": "勇者鬥惡龍 幻之大地 6", "title_zh": "勇者斗恶龙 幻之大地 6", "cover_id": 2926118, "first_chap_id": 133833, "cover_url": "https://i.motiezw.com/cover/1618/2926118.jpg"}, {"title_hant": "勇者鬥惡龍 幻之大地 7", "title_zh": "勇者斗恶龙 幻之大地 7", "cover_id": 2926294, "first_chap_id": 133840, "cover_url": "https://i.motiezw.com/cover/1618/2926294.jpg"}, {"title_hant": "勇者鬥惡龍 幻之大地 8", "title_zh": "勇者斗恶龙 幻之大地 8", "cover_id": 2926473, "first_chap_id": 133846, "cover_url": "https://i.motiezw.com/cover/1618/2926473.jpg"}, {"title_hant": "勇者鬥惡龍 幻之大地 9", "title_zh": "勇者斗恶龙 幻之大地 9", "cover_id": 2926655, "first_chap_id": 133852, "cover_url": "https://i.motiezw.com/cover/1618/2926655.jpg"}, {"title_hant": "勇者鬥惡龍 幻之大地 10", "title_zh": "勇者斗恶龙 幻之大地 10", "cover_id": 2926835, "first_chap_id": 133857, "cover_url": "https://i.motiezw.com/cover/1618/2926835.jpg"}], "chapters": [{"cid": "133713", "title": "QUEST.1 波茲", "title_zh": "QUEST.1 波兹"}, {"cid": "133714", "title": "QUEST.2 精靈祭", "title_zh": "QUEST.2 精灵祭"}, {"cid": "133715", "title": "QUEST.3 雷德克", "title_zh": "QUEST.3 雷德克"}, {"cid": "133716", "title": "QUEST.4 試練之塔①", "title_zh": "QUEST.4 试练之塔①"}, {"cid": "133717", "title": "QUEST.5 試練之塔②", "title_zh": "QUEST.5 试练之塔②"}, {"cid": "133806", "title": "QUEST.6 不睡覺之王", "title_zh": "QUEST.6 不睡觉之王"}, {"cid": "133807", "title": "QUEST.7 米雷尤", "title_zh": "QUEST.7 米雷尤"}, {"cid": "133808", "title": "QUEST.8 夢占水滴", "title_zh": "QUEST.8 梦占水滴"}, {"cid": "133809", "title": "QUEST.9 聖馬利諾", "title_zh": "QUEST.9 圣马利诺"}, {"cid": "133810", "title": "QUEST.10 泰利外傳(前傳)", "title_zh": "QUEST.10 泰利外传(前传)"}, {"cid": "133811", "title": "QUEST.11 泰利外傳(後傳)", "title_zh": "QUEST.11 泰利外传(后传)"}, {"cid": "133813", "title": "QUEST.12 阿摩魯", "title_zh": "QUEST.12 阿摩鲁"}, {"cid": "133814", "title": "QUEST.13 北之洞窟①", "title_zh": "QUEST.13 北之洞窟①"}, {"cid": "133815", "title": "QUEST.14 北之洞窟②", "title_zh": "QUEST.14 北之洞窟②"}, {"cid": "133816", "title": "QUEST.15 月鏡之塔", "title_zh": "QUEST.15 月镜之塔"}, {"cid": "133817", "title": "QUEST.16 查莫羅外傳(前篇)", "title_zh": "QUEST.16 查莫罗外传(前篇)"}, {"cid": "133818", "title": "QUEST.17 查莫羅外傳(後篇)", "title_zh": "QUEST.17 查莫罗外传(后篇)"}, {"cid": "133820", "title": "QUEST.18 兩個世界", "title_zh": "QUEST.18 两个世界"}, {"cid": "133821", "title": "QUEST.19 拉之鏡", "title_zh": "QUEST.19 拉之镜"}, {"cid": "133822", "title": "QUEST.20 穆德", "title_zh": "QUEST.20 穆德"}, {"cid": "133824", "title": "QUEST.22 泰利.外傳", "title_zh": "QUEST.22 泰利.外传"}, {"cid": "133826", "title": "QUEST.23 神船", "title_zh": "QUEST.23 神船"}, {"cid": "133827", "title": "QUEST.24 領導者 其之 1", "title_zh": "QUEST.24 领导者 其之 1"}, {"cid": "133828", "title": "QUEST.25 領導者 其之 2", "title_zh": "QUEST.25 领导者 其之 2"}, {"cid": "133829", "title": "QUEST.26 龍", "title_zh": "QUEST.26 龙"}, {"cid": "133830", "title": "QUEST.27 魔王", "title_zh": "QUEST.27 魔王"}, {"cid": "133831", "title": "QUEST.28 決戰 其之 1", "title_zh": "QUEST.28 决战 其之 1"}, {"cid": "133833", "title": "QUEST.29 決戰 其之 2", "title_zh": "QUEST.29 决战 其之 2"}, {"cid": "133834", "title": "QUEST.30 新力量", "title_zh": "QUEST.30 新力量"}, {"cid": "133835", "title": "QUEST.31 鏡中公主", "title_zh": "QUEST.31 镜中公主"}, {"cid": "133836", "title": "QUEST.32 阿摩士 其之 1", "title_zh": "QUEST.32 阿摩士 其之 1"}, {"cid": "133837", "title": "QUEST.33 阿摩士 其之 2", "title_zh": "QUEST.33 阿摩士 其之 2"}, {"cid": "133838", "title": "QUEST.34 妹妹", "title_zh": "QUEST.34 妹妹"}, {"cid": "133840", "title": "QUEST.35 記憶", "title_zh": "QUEST.35 记忆"}, {"cid": "133841", "title": "QUEST.36 勇者的頭盔", "title_zh": "QUEST.36 勇者的头盔"}, {"cid": "133842", "title": "QUEST.37 藍S閃光", "title_zh": "QUEST.37 蓝S闪光"}, {"cid": "133843", "title": "QUEST.38 幸福的國度", "title_zh": "QUEST.38 幸福的国度"}, {"cid": "133844", "title": "QUEST.39 加米拉斯", "title_zh": "QUEST.39 加米拉斯"}, {"cid": "133846", "title": "QUEST.40 生鏽的寶劍", "title_zh": "QUEST.40 生锈的宝剑"}, {"cid": "133847", "title": "QUEST.41 海魔神", "title_zh": "QUEST.41 海魔神"}, {"cid": "133849", "title": "QUEST.43 勇者的武器", "title_zh": "QUEST.43 勇者的武器"}, {"cid": "133850", "title": "QUEST.44 泰利.外傳", "title_zh": "QUEST.44 泰利.外传"}, {"cid": "133852", "title": "QUEST.45 赫克拉烏特", "title_zh": "QUEST.45 赫克拉乌特"}, {"cid": "133853", "title": "QUEST.46 血門", "title_zh": "QUEST.46 血门"}, {"cid": "133854", "title": "QUEST.47 都郎", "title_zh": "QUEST.47 都郎"}, {"cid": "133855", "title": "QUEST.48 貝卡薩斯", "title_zh": "QUEST.48 贝卡萨斯"}, {"cid": "133857", "title": "QUEST.49 夾縫中的世界", "title_zh": "QUEST.49 夹缝中的世界"}, {"cid": "133858", "title": "QUEST.50 魔王城", "title_zh": "QUEST.50 魔王城"}, {"cid": "133859", "title": "QUEST.51 迪斯塔摩爾", "title_zh": "QUEST.51 迪斯塔摩尔"}, {"cid": "133860", "title": "INFINITY QUEST 凱歌", "title_zh": "INFINITY QUEST 凯歌"}, {"cid": "133861", "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>