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-1604", "mangaid": "1604", "zh_title": "最强学生会长", "hant_title": "最強學生會長", "en_title": "最强学生会长 (Bilimanga #1604)", "author": "晓月明 / 西尾维新", "tags": ["校园", "异能", "战斗", "斗智", "欢乐", "战斗热血", "日本漫画", "漫画"], "zh_desc": "黑神目高以超高98%的支持率成为箱庭学园的新任学生会长,她决定实现当初的政见,设置一个目标箱,随时接受每一位学生的任何请求。尽管她的青梅竹马人吉善吉并不太想加入学生会,而第一封投书是希望能够把不良少年赶出遭到霸占的剑道场,于是黑神带著人吉前往查看,三两下就把那些不良少年给摆平了,后来那些不良少年甚至都改邪归正。\n\n📚 作品信息:作者 晓月明 / 西尾维新 · 评分 10 · 共收录 22 卷 / 201 话章节目录与高清彩页/条漫预览。", "hant_desc": "黑神目高以超高98%的支持率成為箱庭學園的新任學生會長,她決定實現當初的政見,設置一個目標箱,隨時接受每一位學生的任何請求。儘管她的青梅竹馬人吉善吉並不太想加入學生會,而第一封投書是希望能夠把不良少年趕出遭到霸佔的劍道場,於是黑神帶著人吉前往查看,三兩下就把那些不良少年給擺平了,後來那些不良少年甚至都改邪歸正。\n\n📚 作品資訊:作者 曉月明 / 西尾維新 · 評分 10 · 共收錄 22 卷 / 201 話章節目錄與高清彩頁/條漫預覽。", "en_desc": "Popular serialized manga '最强学生会长' (最強學生會長) by 晓月明 / 西尾维新. Includes 22 volumes and 201 chapters with full online vertical/page-flip web reader.", "pages": ["https://media.huangguodrama.ai/motion/comics/bilimanga-1604/page_01.jpg", "https://media.huangguodrama.ai/motion/comics/bilimanga-1604/page_02.jpg", "https://media.huangguodrama.ai/motion/comics/bilimanga-1604/page_03.jpg", "https://media.huangguodrama.ai/motion/comics/bilimanga-1604/page_04.jpg", "https://media.huangguodrama.ai/motion/comics/bilimanga-1604/page_05.jpg", "https://media.huangguodrama.ai/motion/comics/bilimanga-1604/page_06.jpg"], "volumes": [{"title_hant": "最強學生會長 1 由學生會來執行", "title_zh": "最强学生会长 1 由学生会来执行", "cover_id": 2891091, "first_chap_id": 132105, "cover_url": "https://i.motiezw.com/cover/1604/2891091.jpg"}, {"title_hant": "最強學生會長 2 我並沒想過要別人了解啊", "title_zh": "最强学生会长 2 我并没想过要别人了解啊", "cover_id": 2891287, "first_chap_id": 132113, "cover_url": "https://i.motiezw.com/cover/1604/2891287.jpg"}, {"title_hant": "最強學生會長 3 我可是學生會長耶", "title_zh": "最强学生会长 3 我可是学生会长耶", "cover_id": 2891474, "first_chap_id": 132123, "cover_url": "https://i.motiezw.com/cover/1604/2891474.jpg"}, {"title_hant": "最強學生會長 4 妹妹、妹妹、妹妹!", "title_zh": "最强学生会长 4 妹妹、妹妹、妹妹!", "cover_id": 2891655, "first_chap_id": 132133, "cover_url": "https://i.motiezw.com/cover/1604/2891655.jpg"}, {"title_hant": "最強學生會長 5 普通的帥氣", "title_zh": "最强学生会长 5 普通的帅气", "cover_id": 2891840, "first_chap_id": 132143, "cover_url": "https://i.motiezw.com/cover/1604/2891840.jpg"}, {"title_hant": "最強學生會長 6 妳是為了什麼誕生的?", "title_zh": "最强学生会长 6 妳是为了什么诞生的?", "cover_id": 2892035, "first_chap_id": 132154, "cover_url": "https://i.motiezw.com/cover/1604/2892035.jpg"}, {"title_hant": "最強學生會長 7 這就是燒瓶計劃啊", "title_zh": "最强学生会长 7 这就是烧瓶计划啊", "cover_id": 2892230, "first_chap_id": 132164, "cover_url": "https://i.motiezw.com/cover/1604/2892230.jpg"}, {"title_hant": "最強學生會長 8 我喜歡妳", "title_zh": "最强学生会长 8 我喜欢妳", "cover_id": 2892429, "first_chap_id": 132174, "cover_url": "https://i.motiezw.com/cover/1604/2892429.jpg"}, {"title_hant": "最強學生會長 9 我那名為黑神鯨的姊姊", "title_zh": "最强学生会长 9 我那名为黑神鲸的姊姊", "cover_id": 2892634, "first_chap_id": 132185, "cover_url": "https://i.motiezw.com/cover/1604/2892634.jpg"}, {"title_hant": "最強學生會長 10 初次見面", "title_zh": "最强学生会长 10 初次见面", "cover_id": 2892841, "first_chap_id": 132196, "cover_url": "https://i.motiezw.com/cover/1604/2892841.jpg"}, {"title_hant": "最強學生會長 11 不論現在還是以前", "title_zh": "最强学生会长 11 不论现在还是以前", "cover_id": 2893039, "first_chap_id": 132207, "cover_url": "https://i.motiezw.com/cover/1604/2893039.jpg"}, {"title_hant": "最強學生會長 12 第一關是難度B", "title_zh": "最强学生会长 12 第一关是难度B", "cover_id": 2893225, "first_chap_id": 132218, "cover_url": "https://i.motiezw.com/cover/1604/2893225.jpg"}], "chapters": [{"cid": "132105", "title": "第1箱「由學生會來執行」", "title_zh": "第1箱「由学生会来执行」"}, {"cid": "132106", "title": "第2箱「那樣子就好」", "title_zh": "第2箱「那样子就好」"}, {"cid": "132107", "title": "第3箱「我記得你是」", "title_zh": "第3箱「我记得你是」"}, {"cid": "132108", "title": "第4箱「誰叫你多管閒事」", "title_zh": "第4箱「谁叫你多管闲事」"}, {"cid": "132109", "title": "第5箱「如果要感謝我的話」", "title_zh": "第5箱「如果要感谢我的话」"}, {"cid": "132110", "title": "第6箱「絕對不會說我輸了」", "title_zh": "第6箱「绝对不会说我输了」"}, {"cid": "132111", "title": "第7箱「就算從中途退出好」", "title_zh": "第7箱「就算从中途退出好」"}, {"cid": "132113", "title": "第8箱「鋒頭都被她佔盡了」", "title_zh": "第8箱「锋头都被她占尽了」"}, {"cid": "132114", "title": "第9箱「辛苦才有收穫」", "title_zh": "第9箱「辛苦才有收获」"}, {"cid": "132115", "title": "第10箱「確實會消滅的危險行為」", "title_zh": "第10箱「确实会消灭的危险行为」"}, {"cid": "132116", "title": "第11箱「並沒想過要讓別人了解啊」", "title_zh": "第11箱「并没想过要让别人了解啊」"}, {"cid": "132117", "title": "第12箱「比錢還要喜歡」", "title_zh": "第12箱「比钱还要喜欢」"}, {"cid": "132118", "title": "第13箱「她對每個人都會這麼做嗎?」", "title_zh": "第13箱「她对每个人都会这么做吗?」"}, {"cid": "132119", "title": "第14箱「不過是衣服而已啊」", "title_zh": "第14箱「不过是衣服而已啊」"}, {"cid": "132120", "title": "第15箱「無法相容」", "title_zh": "第15箱「无法相容」"}, {"cid": "132121", "title": "第16箱「瞧不起人的悻惡說」", "title_zh": "第16箱「瞧不起人的悻恶说」"}, {"cid": "132123", "title": "第17箱「我都決定要嘗試」", "title_zh": "第17箱「我都决定要尝试」"}, {"cid": "132124", "title": "第18箱「那樣太不公平了吧」", "title_zh": "第18箱「那样太不公平了吧」"}, {"cid": "132125", "title": "第19箱「黑神目高的精靈④」", "title_zh": "第19箱「黑神目高的精灵④」"}, {"cid": "132126", "title": "第20箱「我可是學生會長耶」", "title_zh": "第20箱「我可是学生会长耶」"}, {"cid": "132127", "title": "第21箱「做得太過頭了」", "title_zh": "第21箱「做得太过头了」"}, {"cid": "132129", "title": "第23箱「4136163735641?」", "title_zh": "第23箱「4136163735641?」"}, {"cid": "132130", "title": "第24箱「大家都是這麼說的」", "title_zh": "第24箱「大家都是这么说的」"}, {"cid": "132131", "title": "第25箱「但是不曾有人對我這麼做過」", "title_zh": "第25箱「但是不曾有人对我这么做过」"}, {"cid": "132133", "title": "第26箱「妹妹、妹妹、妹妹!」", "title_zh": "第26箱「妹妹、妹妹、妹妹!」"}, {"cid": "132134", "title": "第27箱「我就讀的學園所發生的事」", "title_zh": "第27箱「我就读的学园所发生的事」"}, {"cid": "132135", "title": "第28箱「一直都會等著你的」", "title_zh": "第28箱「一直都会等著你的」"}, {"cid": "132136", "title": "第29箱「啊!」", "title_zh": "第29箱「啊!」"}, {"cid": "132137", "title": "第30箱「哎呀,真是傷腦筋」", "title_zh": "第30箱「哎呀,真是伤脑筋」"}, {"cid": "132138", "title": "第31箱「不是——增加」", "title_zh": "第31箱「不是——增加」"}, {"cid": "132139", "title": "第32箱「非常愉快的接觸」", "title_zh": "第32箱「非常愉快的接触」"}, {"cid": "132140", "title": "第33箱「所以我要殺了妳」", "title_zh": "第33箱「所以我要杀了妳」"}, {"cid": "132141", "title": "第34箱「無法要你的命」", "title_zh": "第34箱「无法要你的命」"}, {"cid": "132143", "title": "第35箱「普通的帥氣」", "title_zh": "第35箱「普通的帅气」"}, {"cid": "132144", "title": "第36箱「得小心皮膚狀況」", "title_zh": "第36箱「得小心皮肤状况」"}, {"cid": "132145", "title": "第37箱「很抱歉,我們井水就是得犯你們河水」", "title_zh": "第37箱「很抱歉,我们井水就是得犯你们河水」"}, {"cid": "132146", "title": "第38箱「不良跟破壞」", "title_zh": "第38箱「不良跟破坏」"}, {"cid": "132147", "title": "第39箱「為了守護異常的自由」", "title_zh": "第39箱「为了守护异常的自由」"}, {"cid": "132148", "title": "第40箱「不管在哪我都會出現」", "title_zh": "第40箱「不管在哪我都会出现」"}, {"cid": "132149", "title": "第41箱「唯一勝過我的」", "title_zh": "第41箱「唯一胜过我的」"}, {"cid": "132150", "title": "第42箱「就算找遍全世界」", "title_zh": "第42箱「就算找遍全世界」"}, {"cid": "132151", "title": "第43箱「但是,以前的妳」", "title_zh": "第43箱「但是,以前的妳」"}, {"cid": "132154", "title": "第45箱「反正我們可以抄捷徑」", "title_zh": "第45箱「反正我们可以抄捷径」"}, {"cid": "132155", "title": "第46箱「你是誰啊」", "title_zh": "第46箱「你是谁啊」"}, {"cid": "132156", "title": "第47箱「大家都是笨蛋」", "title_zh": "第47箱「大家都是笨蛋」"}, {"cid": "132157", "title": "第48箱「比「十三人」中的任何人都」", "title_zh": "第48箱「比「十三人」中的任何人都」"}, {"cid": "132158", "title": "第49箱「沒有什麼——就是因為的」", "title_zh": "第49箱「没有什么——就是因为的」"}, {"cid": "132159", "title": "第50箱「目高的敵人」", "title_zh": "第50箱「目高的敌人」"}, {"cid": "132160", "title": "第51箱「既然如此你告訴我啊」", "title_zh": "第51箱「既然如此你告诉我啊」"}, {"cid": "132161", "title": "第52箱「妳是為了什麼誕生的?」", "title_zh": "第52箱「妳是为了什么诞生的?」"}, {"cid": "132162", "title": "附錄", "title_zh": "附录"}, {"cid": "132164", "title": "第53箱「這就是燒瓶計劃啊」", "title_zh": "第53箱「这就是烧瓶计划啊」"}, {"cid": "132165", "title": "第54箱「妳究竟算什麼」", "title_zh": "第54箱「妳究竟算什么」"}, {"cid": "132166", "title": "第55箱「要是做了壞事」", "title_zh": "第55箱「要是做了坏事」"}, {"cid": "132167", "title": "第56箱「是我們國中時代的學長喔」", "title_zh": "第56箱「是我们国中时代的学长喔」"}, {"cid": "132168", "title": "第57箱「非常討厭」", "title_zh": "第57箱「非常讨厌」"}, {"cid": "132169", "title": "第58箱「請大家要跟我做好朋友喔」", "title_zh": "第58箱「请大家要跟我做好朋友喔」"}, {"cid": "132170", "title": "第59箱「比起討厭更易被喜歡」", "title_zh": "第59箱「比起讨厌更易被喜欢」"}, {"cid": "132171", "title": "第60箱「因為N孩子的愛啊」", "title_zh": "第60箱「因为N孩子的爱啊」"}, {"cid": "132172", "title": "第61箱「要說什麼愛啊戀的」", "title_zh": "第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>