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-726", "mangaid": "726", "zh_title": "我的英雄学院", "hant_title": "我的英雄學院", "en_title": "我的英雄学院 (Bilimanga #726)", "author": "堀越耕平", "tags": ["战斗", "热血", "异能", "校园", "奇幻", "冒险", "战斗热血", "日本漫画"], "zh_desc": "大部分的人类,在这个时代里都拥有名为“个性”的力量,但有力量之人却不一定都属于正义的一方。只要邪恶出现的地方,必定会有英雄挺身而出拯救众人。\n\r\n一名天生没有力量的少年——绿谷出久从小就憧憬一位顶尖英雄,而他的梦想就是成为伟大的英雄,可是,没有力量的他能实现自己的梦想吗?\n\r\n虽然困难重重,少年却依旧不放弃,朝著自己的目标勇往前进!\n\n📚 作品信息:作者 堀越耕平 · 评分 2.9 · 共收录 42 卷 / 435 话章节目录与高清彩页/条漫预览。", "hant_desc": "大部分的人類,在這個時代裡都擁有名為“個性”的力量,但有力量之人卻不一定都屬於正義的一方。只要邪惡出現的地方,必定會有英雄挺身而出拯救眾人。\n\r\n一名天生沒有力量的少年——綠谷出久從小就憧憬一位頂尖英雄,而他的夢想就是成為偉大的英雄,可是,沒有力量的他能實現自己的夢想嗎?\n\r\n雖然困難重重,少年卻依舊不放棄,朝著自己的目標勇往前進!\n\n📚 作品資訊:作者 堀越耕平 · 評分 2.9 · 共收錄 42 卷 / 435 話章節目錄與高清彩頁/條漫預覽。", "en_desc": "Popular serialized manga '我的英雄学院' (我的英雄學院) by 堀越耕平. Includes 42 volumes and 435 chapters with full online vertical/page-flip web reader.", "pages": ["https://media.huangguodrama.ai/motion/comics/bilimanga-726/page_01.jpg", "https://media.huangguodrama.ai/motion/comics/bilimanga-726/page_02.jpg", "https://media.huangguodrama.ai/motion/comics/bilimanga-726/page_03.jpg", "https://media.huangguodrama.ai/motion/comics/bilimanga-726/page_04.jpg", "https://media.huangguodrama.ai/motion/comics/bilimanga-726/page_05.jpg", "https://media.huangguodrama.ai/motion/comics/bilimanga-726/page_06.jpg"], "volumes": [{"title_hant": "我的英雄學院 1", "title_zh": "我的英雄学院 1", "cover_id": 1242543, "first_chap_id": 56239, "cover_url": "https://i.motiezw.com/cover/726/1242543.jpg"}, {"title_hant": "我的英雄學院 2", "title_zh": "我的英雄学院 2", "cover_id": 1242735, "first_chap_id": 56247, "cover_url": "https://i.motiezw.com/cover/726/1242735.jpg"}, {"title_hant": "我的英雄學院 3", "title_zh": "我的英雄学院 3", "cover_id": 1242943, "first_chap_id": 56258, "cover_url": "https://i.motiezw.com/cover/726/1242943.jpg"}, {"title_hant": "我的英雄學院 4", "title_zh": "我的英雄学院 4", "cover_id": 1243129, "first_chap_id": 56268, "cover_url": "https://i.motiezw.com/cover/726/1243129.jpg"}, {"title_hant": "我的英雄學院 5", "title_zh": "我的英雄学院 5", "cover_id": 1243319, "first_chap_id": 56278, "cover_url": "https://i.motiezw.com/cover/726/1243319.jpg"}, {"title_hant": "我的英雄學院 6", "title_zh": "我的英雄学院 6", "cover_id": 1243506, "first_chap_id": 56288, "cover_url": "https://i.motiezw.com/cover/726/1243506.jpg"}, {"title_hant": "我的英雄學院 7", "title_zh": "我的英雄学院 7", "cover_id": 1243698, "first_chap_id": 56298, "cover_url": "https://i.motiezw.com/cover/726/1243698.jpg"}, {"title_hant": "我的英雄學院 8", "title_zh": "我的英雄学院 8", "cover_id": 1243889, "first_chap_id": 56308, "cover_url": "https://i.motiezw.com/cover/726/1243889.jpg"}, {"title_hant": "我的英雄學院 9", "title_zh": "我的英雄学院 9", "cover_id": 1244079, "first_chap_id": 56319, "cover_url": "https://i.motiezw.com/cover/726/1244079.jpg"}, {"title_hant": "我的英雄學院 10", "title_zh": "我的英雄学院 10", "cover_id": 1244266, "first_chap_id": 56329, "cover_url": "https://i.motiezw.com/cover/726/1244266.jpg"}, {"title_hant": "我的英雄學院 11", "title_zh": "我的英雄学院 11", "cover_id": 1244453, "first_chap_id": 56340, "cover_url": "https://i.motiezw.com/cover/726/1244453.jpg"}, {"title_hant": "我的英雄學院 12", "title_zh": "我的英雄学院 12", "cover_id": 1244660, "first_chap_id": 56351, "cover_url": "https://i.motiezw.com/cover/726/1244660.jpg"}], "chapters": [{"cid": "56239", "title": "No.1 綠谷出久:開端", "title_zh": "No.1 绿谷出久:开端"}, {"cid": "56240", "title": "No.2 肌禸,動起來吧!", "title_zh": "No.2 肌禸,动起来吧!"}, {"cid": "56241", "title": "No.3 入學測驗", "title_zh": "No.3 入学测验"}, {"cid": "56242", "title": "No.4 起跑點", "title_zh": "No.4 起跑点"}, {"cid": "56243", "title": "No.5 入學,爆發吧!", "title_zh": "No.5 入学,爆发吧!"}, {"cid": "56244", "title": "No.6 做我現在辦得到的事", "title_zh": "No.6 做我现在办得到的事"}, {"cid": "56245", "title": "No.7 穿上衣服吧?", "title_zh": "No.7 穿上衣服吧?"}, {"cid": "56247", "title": "No.8 書呆子奮起吧", "title_zh": "No.8 书呆子奋起吧"}, {"cid": "56248", "title": "No.9 笨久vs阿勝", "title_zh": "No.9 笨久vs阿胜"}, {"cid": "56249", "title": "No.10 爆豪,屈服吧。", "title_zh": "No.10 爆豪,屈服吧。"}, {"cid": "56250", "title": "No.11 爆豪的起跑點。", "title_zh": "No.11 爆豪的起跑点。"}, {"cid": "56251", "title": "No.12 飯田同學很棒喔,加油!", "title_zh": "No.12 饭田同学很棒喔,加油!"}, {"cid": "56252", "title": "No.13 救助訓…", "title_zh": "No.13 救助训…"}, {"cid": "56253", "title": "No.14 遭遇未知", "title_zh": "No.14 遭遇未知"}, {"cid": "56254", "title": "No.15 VS", "title_zh": "No.15 VS"}, {"cid": "56255", "title": "No.16 認清敵Q", "title_zh": "No.16 认清敌Q"}, {"cid": "56256", "title": "No.17 GAME OVER", "title_zh": "No.17 GAME OVER"}, {"cid": "56258", "title": "No.18 英雄們反擊", "title_zh": "No.18 英雄们反击"}, {"cid": "56259", "title": "No.19 歐爾麥特", "title_zh": "No.19 欧尔麦特"}, {"cid": "56260", "title": "No.20 職業英雄的世界", "title_zh": "No.20 职业英雄的世界"}, {"cid": "56261", "title": "No.21 各自的心中", "title_zh": "No.21 各自的心中"}, {"cid": "56263", "title": "No.23 運動會,動起來吧", "title_zh": "No.23 运动会,动起来吧"}, {"cid": "56264", "title": "No.24 龍爭、虎鬥", "title_zh": "No.24 龙争、虎斗"}, {"cid": "56265", "title": "No.25 大家都很有個悻,真不錯", "title_zh": "No.25 大家都很有个悻,真不错"}, {"cid": "56266", "title": "No.26 頭號獵物", "title_zh": "No.26 头号猎物"}, {"cid": "56268", "title": "No.27 一決勝負的交涉時間", "title_zh": "No.27 一决胜负的交涉时间"}, {"cid": "56269", "title": "No.28 計策、計策、計策", "title_zh": "No.28 计策、计策、计策"}, {"cid": "56270", "title": "No.29 無人知曉", "title_zh": "No.29 无人知晓"}, {"cid": "56271", "title": "No.30 騎馬打仗勝負分曉", "title_zh": "No.30 骑马打仗胜负分晓"}, {"cid": "56272", "title": "No.31 誕生時就擁有一切的男孩", "title_zh": "No.31 诞生时就拥有一切的男孩"}, {"cid": "56273", "title": "No.32 愚蠢界的王子,笑吧!", "title_zh": "No.32 愚蠢界的王子,笑吧!"}, {"cid": "56274", "title": "No.33 心操同學的內心", "title_zh": "No.33 心操同学的内心"}, {"cid": "56275", "title": "No.34 勝負", "title_zh": "No.34 胜负"}, {"cid": "56276", "title": "No.35 挑戰者,奮鬥吧!", "title_zh": "No.35 挑战者,奋斗吧!"}, {"cid": "56278", "title": "No.36 爆豪VS麗日", "title_zh": "No.36 爆豪VS丽日"}, {"cid": "56279", "title": "No.37 綠谷與奮進人", "title_zh": "No.37 绿谷与奋进人"}, {"cid": "56280", "title": "No.38 轟VS綠谷", "title_zh": "No.38 轰VS绿谷"}, {"cid": "56281", "title": "No.39 轟焦凍:開端", "title_zh": "No.39 轰焦冻:开端"}, {"cid": "56282", "title": "No.40 離巢", "title_zh": "No.40 离巢"}, {"cid": "56283", "title": "No.41 飯田同學,加油", "title_zh": "No.41 饭田同学,加油"}, {"cid": "56284", "title": "No.42 決賽的時刻", "title_zh": "No.42 决赛的时刻"}, {"cid": "56285", "title": "No.43 轟VS爆豪", "title_zh": "No.43 轰VS爆豪"}, {"cid": "56286", "title": "No.44 補假日,休息吧!", "title_zh": "No.44 补假日,休息吧!"}, {"cid": "56288", "title": "No.45 試著命名的會議", "title_zh": "No.45 试著命名的会议"}, {"cid": "56289", "title": "No.46 怪奇!經典老爺車現身", "title_zh": "No.46 怪奇!经典老爷车现身"}, {"cid": "56290", "title": "No.47 蠢蠢愉動", "title_zh": "No.47 蠢蠢愉动"}, {"cid": "56291", "title": "No.48 掌握訣竅", "title_zh": "No.48 掌握诀窍"}, {"cid": "56292", "title": "No.49 綠谷與死柄木", "title_zh": "No.49 绿谷与死柄木"}, {"cid": "56293", "title": "No.50 我要殺了你", "title_zh": "No.50 我要杀了你"}, {"cid": "56294", "title": "No.51 飯田同學!不行啊,住手", "title_zh": "No.51 饭田同学!不行啊,住手"}, {"cid": "56295", "title": "No.52 英雄殺手汙點VS雄英學生", "title_zh": "No.52 英雄杀手污点VS雄英学生"}, {"cid": "56296", "title": "No.53 由轟傳給飯田", "title_zh": "No.53 由轰传给饭田"}, {"cid": "56298", "title": "No.54 :Re天賦引擎", "title_zh": "No.54 :Re天赋引擎"}, {"cid": "56299", "title": "No.55 分出勝負?", "title_zh": "No.55 分出胜负?"}, {"cid": "56300", "title": "No.56 分出勝負", "title_zh": "No.56 分出胜负"}, {"cid": "56301", "title": "No.57「英雄殺手汙點」之餘波", "title_zh": "No.57「英雄杀手污点」之余波"}, {"cid": "56302", "title": "No.58 職場體驗結束", "title_zh": "No.58 职场体验结束"}, {"cid": "56303", "title": "No.59 了解往事!", "title_zh": "No.59 了解往事!"}, {"cid": "56304", "title": "No.60 準備期末考", "title_zh": "No.60 准备期末考"}, {"cid": "56305", "title": "No.61 最糟糕的兩人", "title_zh": "No.61 最糟糕的两人"}]};
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>