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>家庭教师HITMAN REBORN!爱藏版 - 在线漫画阅读器</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-897", "mangaid": "897", "zh_title": "家庭教师HITMAN REBORN!爱藏版", "hant_title": "家庭教師HITMAN REBORN!愛藏版", "en_title": "家庭教师HITMAN REBORN!爱藏版 (Bilimanga #897)", "author": "天野明", "tags": ["战斗", "冒险", "欢乐", "犯罪", "异能", "校园", "战斗热血", "日本漫画"], "zh_desc": "既不会念书又没有运动天分,做任何事总是半途而废的废柴阿纲(本名泽田纲吉),上学最大的目的是为了能够看见心上人笹川京子。\n\r\n某天,阿纲的家里来了一位有著婴儿外表的家庭教师──里包恩,他自称是一名杀手,受到彭哥列家族第9代首领的委托,要将阿纲培养成下一任黑手党老大……\n\r\n只要抱著必死的决心就什么都办得到!\n\r\n阿纲伴随生命危险的家教课程就此展开!\n\n📚 作品信息:作者 天野明 · 评分 10 · 共收录 21 卷 / 435 话章节目录与高清彩页/条漫预览。", "hant_desc": "既不會唸書又沒有運動天分,做任何事總是半途而廢的廢柴阿綱(本名澤田綱吉),上學最大的目的是為了能夠看見心上人笹川京子。\n\r\n某天,阿綱的家裡來了一位有著嬰兒外表的家庭教師──里包恩,他自稱是一名殺手,受到彭哥列家族第9代首領的委託,要將阿綱培養成下一任黑手黨老大……\n\r\n只要抱著必死的決心就什麼都辦得到!\n\r\n阿綱伴隨生命危險的家教課程就此展開!\n\n📚 作品資訊:作者 天野明 · 評分 10 · 共收錄 21 卷 / 435 話章節目錄與高清彩頁/條漫預覽。", "en_desc": "Popular serialized manga '家庭教师HITMAN REBORN!爱藏版' (家庭教師HITMAN REBORN!愛藏版) by 天野明. Includes 21 volumes and 435 chapters with full online vertical/page-flip web reader.", "pages": ["https://media.huangguodrama.ai/motion/comics/bilimanga-897/page_01.jpg", "https://media.huangguodrama.ai/motion/comics/bilimanga-897/page_02.jpg", "https://media.huangguodrama.ai/motion/comics/bilimanga-897/page_03.jpg", "https://media.huangguodrama.ai/motion/comics/bilimanga-897/page_04.jpg", "https://media.huangguodrama.ai/motion/comics/bilimanga-897/page_05.jpg", "https://media.huangguodrama.ai/motion/comics/bilimanga-897/page_06.jpg"], "volumes": [{"title_hant": "家庭教師HITMAN REBORN!愛藏版 1", "title_zh": "家庭教师HITMAN REBORN!爱藏版 1", "cover_id": 1547130, "first_chap_id": 71178, "cover_url": "https://i.motiezw.com/cover/897/1547130.jpg"}, {"title_hant": "家庭教師HITMAN REBORN!愛藏版 2", "title_zh": "家庭教师HITMAN REBORN!爱藏版 2", "cover_id": 1547522, "first_chap_id": 71196, "cover_url": "https://i.motiezw.com/cover/897/1547522.jpg"}, {"title_hant": "家庭教師HITMAN REBORN!愛藏版 3", "title_zh": "家庭教师HITMAN REBORN!爱藏版 3", "cover_id": 1550432, "first_chap_id": 71323, "cover_url": "https://i.motiezw.com/cover/897/1550432.jpg"}, {"title_hant": "家庭教師HITMAN REBORN!愛藏版 4", "title_zh": "家庭教师HITMAN REBORN!爱藏版 4", "cover_id": 1550837, "first_chap_id": 71344, "cover_url": "https://i.motiezw.com/cover/897/1550837.jpg"}, {"title_hant": "家庭教師HITMAN REBORN!愛藏版 5", "title_zh": "家庭教师HITMAN REBORN!爱藏版 5", "cover_id": 1551257, "first_chap_id": 71365, "cover_url": "https://i.motiezw.com/cover/897/1551257.jpg"}, {"title_hant": "家庭教師HITMAN REBORN!愛藏版 6", "title_zh": "家庭教师HITMAN REBORN!爱藏版 6", "cover_id": 1551690, "first_chap_id": 71386, "cover_url": "https://i.motiezw.com/cover/897/1551690.jpg"}, {"title_hant": "家庭教師HITMAN REBORN!愛藏版 7", "title_zh": "家庭教师HITMAN REBORN!爱藏版 7", "cover_id": 1558384, "first_chap_id": 71735, "cover_url": "https://i.motiezw.com/cover/897/1558384.jpg"}, {"title_hant": "家庭教師HITMAN REBORN!愛藏版 8", "title_zh": "家庭教师HITMAN REBORN!爱藏版 8", "cover_id": 1558796, "first_chap_id": 71756, "cover_url": "https://i.motiezw.com/cover/897/1558796.jpg"}, {"title_hant": "家庭教師HITMAN REBORN!愛藏版 9", "title_zh": "家庭教师HITMAN REBORN!爱藏版 9", "cover_id": 1559198, "first_chap_id": 71777, "cover_url": "https://i.motiezw.com/cover/897/1559198.jpg"}, {"title_hant": "家庭教師HITMAN REBORN!愛藏版 10", "title_zh": "家庭教师HITMAN REBORN!爱藏版 10", "cover_id": 1559631, "first_chap_id": 71801, "cover_url": "https://i.motiezw.com/cover/897/1559631.jpg"}, {"title_hant": "家庭教師HITMAN REBORN!愛藏版 11", "title_zh": "家庭教师HITMAN REBORN!爱藏版 11", "cover_id": 1560045, "first_chap_id": 71825, "cover_url": "https://i.motiezw.com/cover/897/1560045.jpg"}, {"title_hant": "家庭教師HITMAN REBORN!愛藏版 12", "title_zh": "家庭教师HITMAN REBORN!爱藏版 12", "cover_id": 1560441, "first_chap_id": 71848, "cover_url": "https://i.motiezw.com/cover/897/1560441.jpg"}], "chapters": [{"cid": "71178", "title": "目標1 從義大利來的那傢伙", "title_zh": "目标1 从义大利来的那家伙"}, {"cid": "71179", "title": "目標2 無法使用死氣彈", "title_zh": "目标2 无法使用死气弹"}, {"cid": "71180", "title": "目標3 獄寺隼人", "title_zh": "目标3 狱寺隼人"}, {"cid": "71181", "title": "目標4 退學危機", "title_zh": "目标4 退学危机"}, {"cid": "71182", "title": "目標5 山本武", "title_zh": "目标5 山本武"}, {"cid": "71183", "title": "目標6 俄羅斯輪盤", "title_zh": "目标6 俄罗斯轮盘"}, {"cid": "71184", "title": "目標7 愛哭鬼藍波", "title_zh": "目标7 爱哭鬼蓝波"}, {"cid": "71185", "title": "目標8 加入家族測驗", "title_zh": "目标8 加入家族测验"}, {"cid": "71186", "title": "目標9 碧洋琪", "title_zh": "目标9 碧洋琪"}, {"cid": "71187", "title": "目標10 有毒料理Ⅱ", "title_zh": "目标10 有毒料理Ⅱ"}, {"cid": "71188", "title": "目標11 三浦春", "title_zh": "目标11 三浦春"}, {"cid": "71189", "title": "目標12 問題7", "title_zh": "目标12 问题7"}, {"cid": "71190", "title": "目標13 入江正一", "title_zh": "目标13 入江正一"}, {"cid": "71191", "title": "目標14 笹川了平", "title_zh": "目标14 笹川了平"}, {"cid": "71192", "title": "目標15 Dr.夏馬爾", "title_zh": "目标15 Dr.夏马尔"}, {"cid": "71193", "title": "目標16 雲雀恭彌", "title_zh": "目标16 云雀恭弥"}, {"cid": "71194", "title": "附錄", "title_zh": "附录"}, {"cid": "71196", "title": "目標17 推倒天柱(前篇)", "title_zh": "目标17 推倒天柱(前篇)"}, {"cid": "71197", "title": "目標18 推倒天柱(後篇)", "title_zh": "目标18 推倒天柱(后篇)"}, {"cid": "71198", "title": "目標19 第一次殺人", "title_zh": "目标19 第一次杀人"}, {"cid": "71199", "title": "目標20 吃霸王餐", "title_zh": "目标20 吃霸王餐"}, {"cid": "71200", "title": "目標21 保母", "title_zh": "目标21 保母"}, {"cid": "71202", "title": "目標23 一平", "title_zh": "目标23 一平"}, {"cid": "71203", "title": "目標24 一平vs.藍波", "title_zh": "目标24 一平vs.蓝波"}, {"cid": "71204", "title": "目標25 京子vs.小春", "title_zh": "目标25 京子vs.小春"}, {"cid": "71205", "title": "附錄1", "title_zh": "附录1"}, {"cid": "71206", "title": "目標26 犯罪3兄弟", "title_zh": "目标26 犯罪3兄弟"}, {"cid": "71207", "title": "目標27 跳馬迪諾", "title_zh": "目标27 跳马迪诺"}, {"cid": "71208", "title": "目標28 迪諾再現", "title_zh": "目标28 迪诺再现"}, {"cid": "71209", "title": "目標29 住院", "title_zh": "目标29 住院"}, {"cid": "71210", "title": "目標30 遇難", "title_zh": "目标30 遇难"}, {"cid": "71211", "title": "目標31 新年", "title_zh": "目标31 新年"}, {"cid": "71212", "title": "目標32 獄寺的強化課程", "title_zh": "目标32 狱寺的强化课程"}, {"cid": "71213", "title": "目標33 教學觀摩", "title_zh": "目标33 教学观摩"}, {"cid": "71214", "title": "附錄2", "title_zh": "附录2"}, {"cid": "71323", "title": "目標34 星星王子風太", "title_zh": "目标34 星星王子风太"}, {"cid": "71324", "title": "目標35 又是風太", "title_zh": "目标35 又是风太"}, {"cid": "71325", "title": "目標36 西洋Q人節", "title_zh": "目标36 西洋Q人节"}, {"cid": "71326", "title": "目標37 打雪仗開始", "title_zh": "目标37 打雪仗开始"}, {"cid": "71327", "title": "目標38 打雪仗第2回合", "title_zh": "目标38 打雪仗第2回合"}, {"cid": "71328", "title": "目標39 山本特訓", "title_zh": "目标39 山本特训"}, {"cid": "71329", "title": "目標40 踢館", "title_zh": "目标40 踢馆"}, {"cid": "71330", "title": "目標41 故障", "title_zh": "目标41 故障"}, {"cid": "71331", "title": "目標42 動物園", "title_zh": "目标42 动物园"}, {"cid": "71332", "title": "附錄1", "title_zh": "附录1"}, {"cid": "71334", "title": "目標44 內藤龍祥", "title_zh": "目标44 内藤龙祥"}, {"cid": "71335", "title": "目標45 嘆息彈", "title_zh": "目标45 叹息弹"}, {"cid": "71336", "title": "目標46 龍祥家", "title_zh": "目标46 龙祥家"}, {"cid": "71337", "title": "目標47 保齡球", "title_zh": "目标47 保龄球"}, {"cid": "71338", "title": "目標48 度假中心", "title_zh": "目标48 度假中心"}, {"cid": "71339", "title": "目標49 乃嘴戰士", "title_zh": "目标49 乃嘴战士"}, {"cid": "71340", "title": "目標50 精采表現!!", "title_zh": "目标50 精采表现!!"}, {"cid": "71341", "title": "目標51 6月新娘", "title_zh": "目标51 6月新娘"}, {"cid": "71342", "title": "附錄2", "title_zh": "附录2"}, {"cid": "71344", "title": "目標52 武器調校師", "title_zh": "目标52 武器调校师"}, {"cid": "71345", "title": "目標53 阿綱暗殺計畫", "title_zh": "目标53 阿纲暗杀计划"}, {"cid": "71346", "title": "目標54 游泳池開關", "title_zh": "目标54 游泳池开关"}, {"cid": "71347", "title": "目標55 七夕大賽", "title_zh": "目标55 七夕大赛"}, {"cid": "71348", "title": "目標56 藍波失蹤事件", "title_zh": "目标56 蓝波失踪事件"}, {"cid": "71349", "title": "目標57 海水浴場", "title_zh": "目标57 海水浴场"}]};
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>