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>海盗战记 VINLAND SAGA - 在线漫画阅读器</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-704", "mangaid": "704", "zh_title": "海盗战记 VINLAND SAGA", "hant_title": "海盜戰記 VINLAND SAGA", "en_title": "海盗战记 VINLAND SAGA (Bilimanga #704)", "author": "幸村诚", "tags": ["战斗", "热血", "战争", "冒险", "历史", "战斗热血", "日本漫画", "漫画"], "zh_desc": "中世纪的维京人号称是地表最强的民族,他们以残暴的手段攻击欧陆,其中一位传说中的战士‧托尔兹的儿子托尔芬,从小在战场上长大,跟著杀父仇人阿谢拉特不断追求梦幻大陆『VINLAND』!\n\n📚 作品信息:作者 幸村诚 · 评分 10 · 共收录 28 卷 / 224 话章节目录与高清彩页/条漫预览。", "hant_desc": "中世紀的維京人號稱是地表最強的民族,他們以殘暴的手段攻擊歐陸,其中一位傳說中的戰士‧托爾茲的兒子托爾芬,從小在戰場上長大,跟著殺父仇人阿謝拉特不斷追求夢幻大陸『VINLAND』!\n\n📚 作品資訊:作者 幸村誠 · 評分 10 · 共收錄 28 卷 / 224 話章節目錄與高清彩頁/條漫預覽。", "en_desc": "Popular serialized manga '海盗战记 VINLAND SAGA' (海盜戰記 VINLAND SAGA) by 幸村诚. Includes 28 volumes and 224 chapters with full online vertical/page-flip web reader.", "pages": ["https://media.huangguodrama.ai/motion/comics/bilimanga-704/page_01.jpg", "https://media.huangguodrama.ai/motion/comics/bilimanga-704/page_02.jpg", "https://media.huangguodrama.ai/motion/comics/bilimanga-704/page_03.jpg", "https://media.huangguodrama.ai/motion/comics/bilimanga-704/page_04.jpg", "https://media.huangguodrama.ai/motion/comics/bilimanga-704/page_05.jpg", "https://media.huangguodrama.ai/motion/comics/bilimanga-704/page_06.jpg"], "volumes": [{"title_hant": "海盜戰記 VINLAND SAGA 1", "title_zh": "海盗战记 VINLAND SAGA 1", "cover_id": 1197008, "first_chap_id": 53893, "cover_url": "https://i.motiezw.com/cover/704/1197008.jpg"}, {"title_hant": "海盜戰記 VINLAND SAGA 2", "title_zh": "海盗战记 VINLAND SAGA 2", "cover_id": 1197101, "first_chap_id": 53898, "cover_url": "https://i.motiezw.com/cover/704/1197101.jpg"}, {"title_hant": "海盜戰記 VINLAND SAGA 3", "title_zh": "海盗战记 VINLAND SAGA 3", "cover_id": 1197671, "first_chap_id": 53929, "cover_url": "https://i.motiezw.com/cover/704/1197671.jpg"}, {"title_hant": "海盜戰記 VINLAND SAGA 4", "title_zh": "海盗战记 VINLAND SAGA 4", "cover_id": 1198090, "first_chap_id": 53949, "cover_url": "https://i.motiezw.com/cover/704/1198090.jpg"}, {"title_hant": "海盜戰記 VINLAND SAGA 5", "title_zh": "海盗战记 VINLAND SAGA 5", "cover_id": 1198294, "first_chap_id": 53958, "cover_url": "https://i.motiezw.com/cover/704/1198294.jpg"}, {"title_hant": "海盜戰記 VINLAND SAGA 6", "title_zh": "海盗战记 VINLAND SAGA 6", "cover_id": 1198504, "first_chap_id": 53966, "cover_url": "https://i.motiezw.com/cover/704/1198504.jpg"}, {"title_hant": "海盜戰記 VINLAND SAGA 7", "title_zh": "海盗战记 VINLAND SAGA 7", "cover_id": 1200907, "first_chap_id": 54088, "cover_url": "https://i.motiezw.com/cover/704/1200907.jpg"}, {"title_hant": "海盜戰記 VINLAND SAGA 8", "title_zh": "海盗战记 VINLAND SAGA 8", "cover_id": 1201118, "first_chap_id": 54097, "cover_url": "https://i.motiezw.com/cover/704/1201118.jpg"}, {"title_hant": "海盜戰記 VINLAND SAGA 9", "title_zh": "海盗战记 VINLAND SAGA 9", "cover_id": 1201332, "first_chap_id": 54106, "cover_url": "https://i.motiezw.com/cover/704/1201332.jpg"}, {"title_hant": "海盜戰記 VINLAND SAGA 10", "title_zh": "海盗战记 VINLAND SAGA 10", "cover_id": 1201544, "first_chap_id": 54116, "cover_url": "https://i.motiezw.com/cover/704/1201544.jpg"}, {"title_hant": "海盜戰記 VINLAND SAGA 11", "title_zh": "海盗战记 VINLAND SAGA 11", "cover_id": 1201771, "first_chap_id": 54125, "cover_url": "https://i.motiezw.com/cover/704/1201771.jpg"}, {"title_hant": "海盜戰記 VINLAND SAGA 12", "title_zh": "海盗战记 VINLAND SAGA 12", "cover_id": 1201966, "first_chap_id": 54134, "cover_url": "https://i.motiezw.com/cover/704/1201966.jpg"}], "chapters": [{"cid": "53893", "title": "第1話 北方之人", "title_zh": "第1话 北方之人"}, {"cid": "53894", "title": "第2話 不是這裡,而在某個地方", "title_zh": "第2话 不是这里,而在某个地方"}, {"cid": "53895", "title": "第3話 在大海的盡頭", "title_zh": "第3话 在大海的尽头"}, {"cid": "53896", "title": "第4話 打不開的鎖", "title_zh": "第4话 打不开的锁"}, {"cid": "53898", "title": "第5話 戰鬼", "title_zh": "第5话 战鬼"}, {"cid": "53899", "title": "第6話 戰場來的使者", "title_zh": "第6话 战场来的使者"}, {"cid": "53900", "title": "第7話 劍", "title_zh": "第7话 剑"}, {"cid": "53901", "title": "第8話 旅程的開始", "title_zh": "第8话 旅程的开始"}, {"cid": "53902", "title": "第9話 絕海的陷阱", "title_zh": "第9话 绝海的陷阱"}, {"cid": "53903", "title": "第10話 夜晚的航路", "title_zh": "第10话 夜晚的航路"}, {"cid": "53904", "title": "第11話 牢籠", "title_zh": "第11话 牢笼"}, {"cid": "53905", "title": "第12話 比怪物還厲害", "title_zh": "第12话 比怪物还厉害"}, {"cid": "53906", "title": "第13話 味道", "title_zh": "第13话 味道"}, {"cid": "53907", "title": "第14話 托爾茲的劍", "title_zh": "第14话 托尔兹的剑"}, {"cid": "53908", "title": "第15話 真正的戰士", "title_zh": "第15话 真正的战士"}, {"cid": "53909", "title": "第16話 托爾茲之死", "title_zh": "第16话 托尔兹之死"}, {"cid": "53929", "title": "第17話 英格蘭 —1008年—", "title_zh": "第17话 英格兰 —1008年—"}, {"cid": "53932", "title": "第18話 英格蘭 —1013年—", "title_zh": "第18话 英格兰 —1013年—"}, {"cid": "53934", "title": "第19話 倫敦橋的殊死戰", "title_zh": "第19话 伦敦桥的殊死战"}, {"cid": "53937", "title": "第20話 世界末日", "title_zh": "第20话 世界末日"}, {"cid": "53939", "title": "第21話 戰士之館", "title_zh": "第21话 战士之馆"}, {"cid": "53949", "title": "第22話 戰鬼之子", "title_zh": "第22话 战鬼之子"}, {"cid": "53950", "title": "第23話 援軍", "title_zh": "第23话 援军"}, {"cid": "53951", "title": "第24話 對岸之國", "title_zh": "第24话 对岸之国"}, {"cid": "53952", "title": "第25話 虛張聲勢", "title_zh": "第25话 虚张声势"}, {"cid": "53953", "title": "第26話 阿托利斯", "title_zh": "第26话 阿托利斯"}, {"cid": "53954", "title": "第27話 戰士與修道士", "title_zh": "第27话 战士与修道士"}, {"cid": "53955", "title": "第28話 夜襲", "title_zh": "第28话 夜袭"}, {"cid": "53956", "title": "附錄", "title_zh": "附录"}, {"cid": "53958", "title": "第29話 父與子", "title_zh": "第29话 父与子"}, {"cid": "53959", "title": "第30話 主僕的餐桌", "title_zh": "第30话 主仆的餐桌"}, {"cid": "53960", "title": "第31話 野獸的歷史", "title_zh": "第31话 野兽的历史"}, {"cid": "53961", "title": "第32話 逃亡兵團", "title_zh": "第32话 逃亡兵团"}, {"cid": "53962", "title": "第33話 背叛", "title_zh": "第33话 背叛"}, {"cid": "53963", "title": "第34話 Avalon", "title_zh": "第34话 Avalon"}, {"cid": "53964", "title": "第35話 兩軍接觸", "title_zh": "第35话 两军接触"}, {"cid": "53966", "title": "第36話 戰場上的兩個人", "title_zh": "第36话 战场上的两个人"}, {"cid": "53967", "title": "第37話 愛的定義", "title_zh": "第37话 爱的定义"}, {"cid": "53968", "title": "第38話 搖盬之外", "title_zh": "第38话 摇盬之外"}, {"cid": "53969", "title": "第39話 國王的覺醒", "title_zh": "第39话 国王的觉醒"}, {"cid": "53970", "title": "第40話 托爾茲傳", "title_zh": "第40话 托尔兹传"}, {"cid": "53971", "title": "第41話 共同戰線", "title_zh": "第41话 共同战线"}, {"cid": "54088", "title": "第43話 王子生還", "title_zh": "第43话 王子生还"}, {"cid": "54089", "title": "第44話 王冠的詛咒", "title_zh": "第44话 王冠的诅咒"}, {"cid": "54090", "title": "第45話 最後的朋友", "title_zh": "第45话 最后的朋友"}, {"cid": "54091", "title": "第46話 兩隻野狼", "title_zh": "第46话 两只野狼"}, {"cid": "54092", "title": "第47話 英雄不在", "title_zh": "第47话 英雄不在"}, {"cid": "54093", "title": "第48話 重逢", "title_zh": "第48话 重逢"}, {"cid": "54094", "title": "第49話 男子漢", "title_zh": "第49话 男子汉"}, {"cid": "54095", "title": "附錄", "title_zh": "附录"}, {"cid": "54097", "title": "第50話 謀略", "title_zh": "第50话 谋略"}, {"cid": "54098", "title": "第51話 誤判", "title_zh": "第51话 误判"}, {"cid": "54099", "title": "第52話 英雄復活", "title_zh": "第52话 英雄复活"}, {"cid": "54100", "title": "第53話 不列塔尼亞王奮起", "title_zh": "第53话 不列塔尼亚王奋起"}, {"cid": "54101", "title": "第54話 END OF THE PROLOGUE", "title_zh": "第54话 END OF THE PROLOGUE"}, {"cid": "54102", "title": "第55話 駑隸", "title_zh": "第55话 驽隶"}, {"cid": "54103", "title": "第56話 克提爾農場", "title_zh": "第56话 克提尔农场"}, {"cid": "54104", "title": "附錄", "title_zh": "附录"}, {"cid": "54106", "title": "第57話 少爺", "title_zh": "第57话 少爷"}, {"cid": "54107", "title": "第58話 殺了也無妨的人", "title_zh": "第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>