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-118", "mangaid": "118", "zh_title": "入间同学入魔了!", "hant_title": "入間同學入魔了!", "en_title": "入间同学入魔了! (Bilimanga #118)", "author": "西修", "tags": ["奇幻", "冒险", "异世界", "校园", "战斗", "奇幻冒险", "日本漫画", "漫画"], "zh_desc": "入间是一名可怜的少年,善良、不懂得拒绝人,又因为父母的关系从小就受尽磨难,最后更因为父母的私欲而被卖给恶魔!但没想到,到了魔界,竟受到一个人生活、没有孙子的恶魔百般溺爱,甚至还被送往恶魔的学校就读!在校内,身处恶魔环绕的环境中,身为人类的入间能平安无事吗?学校生活中又会发生什么有趣的事呢?\n\n📚 作品信息:作者 西修 · 评分 10 · 共收录 41 卷 / 355 话章节目录与高清彩页/条漫预览。", "hant_desc": "入間是一名可憐的少年,善良、不懂得拒絕人,又因為父母的關係從小就受盡磨難,最後更因為父母的私慾而被賣給惡魔!但沒想到,到了魔界,竟受到一個人生活、沒有孫子的惡魔百般溺愛,甚至還被送往惡魔的學校就讀!在校內,身處惡魔環繞的環境中,身為人類的入間能平安無事嗎?學校生活中又會發生什麼有趣的事呢?\n\n📚 作品資訊:作者 西修 · 評分 10 · 共收錄 41 卷 / 355 話章節目錄與高清彩頁/條漫預覽。", "en_desc": "Popular serialized manga '入间同学入魔了!' (入間同學入魔了!) by 西修. Includes 41 volumes and 355 chapters with full online vertical/page-flip web reader.", "pages": ["https://media.huangguodrama.ai/motion/comics/bilimanga-118/page_01.jpg", "https://media.huangguodrama.ai/motion/comics/bilimanga-118/page_02.jpg", "https://media.huangguodrama.ai/motion/comics/bilimanga-118/page_03.jpg", "https://media.huangguodrama.ai/motion/comics/bilimanga-118/page_04.jpg", "https://media.huangguodrama.ai/motion/comics/bilimanga-118/page_05.jpg", "https://media.huangguodrama.ai/motion/comics/bilimanga-118/page_06.jpg"], "volumes": [{"title_hant": "入間同學入魔了! 1", "title_zh": "入间同学入魔了! 1", "cover_id": 165904, "first_chap_id": 7399, "cover_url": "https://i.motiezw.com/cover/118/165904.jpg"}, {"title_hant": "入間同學入魔了! 2", "title_zh": "入间同学入魔了! 2", "cover_id": 170279, "first_chap_id": 7730, "cover_url": "https://i.motiezw.com/cover/118/170279.jpg"}, {"title_hant": "入間同學入魔了! 3", "title_zh": "入间同学入魔了! 3", "cover_id": 170471, "first_chap_id": 7740, "cover_url": "https://i.motiezw.com/cover/118/170471.jpg"}, {"title_hant": "入間同學入魔了! 4", "title_zh": "入间同学入魔了! 4", "cover_id": 170663, "first_chap_id": 7750, "cover_url": "https://i.motiezw.com/cover/118/170663.jpg"}, {"title_hant": "入間同學入魔了! 5", "title_zh": "入间同学入魔了! 5", "cover_id": 170857, "first_chap_id": 7760, "cover_url": "https://i.motiezw.com/cover/118/170857.jpg"}, {"title_hant": "入間同學入魔了! 6", "title_zh": "入间同学入魔了! 6", "cover_id": 171049, "first_chap_id": 7770, "cover_url": "https://i.motiezw.com/cover/118/171049.jpg"}, {"title_hant": "入間同學入魔了! 7", "title_zh": "入间同学入魔了! 7", "cover_id": 171241, "first_chap_id": 7780, "cover_url": "https://i.motiezw.com/cover/118/171241.jpg"}, {"title_hant": "入間同學入魔了! 8", "title_zh": "入间同学入魔了! 8", "cover_id": 171433, "first_chap_id": 7790, "cover_url": "https://i.motiezw.com/cover/118/171433.jpg"}, {"title_hant": "入間同學入魔了! 9", "title_zh": "入间同学入魔了! 9", "cover_id": 171625, "first_chap_id": 7800, "cover_url": "https://i.motiezw.com/cover/118/171625.jpg"}, {"title_hant": "入間同學入魔了! 10", "title_zh": "入间同学入魔了! 10", "cover_id": 171817, "first_chap_id": 7810, "cover_url": "https://i.motiezw.com/cover/118/171817.jpg"}, {"title_hant": "入間同學入魔了! 11", "title_zh": "入间同学入魔了! 11", "cover_id": 172017, "first_chap_id": 7820, "cover_url": "https://i.motiezw.com/cover/118/172017.jpg"}, {"title_hant": "入間同學入魔了! 12", "title_zh": "入间同学入魔了! 12", "cover_id": 172209, "first_chap_id": 7830, "cover_url": "https://i.motiezw.com/cover/118/172209.jpg"}], "chapters": [{"cid": "7399", "title": "第1話 惡魔學校的入間同學", "title_zh": "第1话 恶魔学校的入间同学"}, {"cid": "7400", "title": "第2話「使魔」召喚!", "title_zh": "第2话「使魔」召唤!"}, {"cid": "7401", "title": "第3話 入間和庫菈菈", "title_zh": "第3话 入间和库菈菈"}, {"cid": "7402", "title": "第4話 惡魔的朋友", "title_zh": "第4话 恶魔的朋友"}, {"cid": "7403", "title": "第5話 問題兒童班 (阿布諾瑪)", "title_zh": "第5话 问题儿童班 (阿布诺玛)"}, {"cid": "7404", "title": "第6話 飛行測驗開始!", "title_zh": "第6话 飞行测验开始!"}, {"cid": "7405", "title": "第7話 立志成為魔王的人", "title_zh": "第7话 立志成为魔王的人"}, {"cid": "7406", "title": "第各話的過場", "title_zh": "第各话的过场"}, {"cid": "7730", "title": "第8話 恶食之戒", "title_zh": "第8话 恶食之戒"}, {"cid": "7731", "title": "第9話 大家一起上魔術課!", "title_zh": "第9话 大家一起上魔术课!"}, {"cid": "7732", "title": "第10話 艾梅莉的假設", "title_zh": "第10话 艾梅莉的假设"}, {"cid": "7733", "title": "第11話 初戀回憶", "title_zh": "第11话 初恋回忆"}, {"cid": "7734", "title": "第12話 入間的「夢想」", "title_zh": "第12话 入间的「梦想」"}, {"cid": "7735", "title": "第13話 入間的決心", "title_zh": "第13话 入间的决心"}, {"cid": "7736", "title": "第14話 熱血沸騰的努力", "title_zh": "第14话 热血沸腾的努力"}, {"cid": "7737", "title": "第15話 激鬥,處刑砲彈!!", "title_zh": "第15话 激斗,处刑砲弹!!"}, {"cid": "7738", "title": "第16話 向前踏出一步!", "title_zh": "第16话 向前踏出一步!"}, {"cid": "7740", "title": "第17話 被庫菈菈迷得神魂顛倒", "title_zh": "第17话 被库菈菈迷得神魂颠倒"}, {"cid": "7741", "title": "第18話 師團的挑戰", "title_zh": "第18话 师团的挑战"}, {"cid": "7742", "title": "第19話 一年級爭奪戰♡", "title_zh": "第19话 一年级争夺战♡"}, {"cid": "7743", "title": "第20話 沒有魔力的惡魔", "title_zh": "第20话 没有魔力的恶魔"}, {"cid": "7745", "title": "第22話 和使魔一起♪", "title_zh": "第22话 和使魔一起♪"}, {"cid": "7746", "title": "第23話 十三冠會議", "title_zh": "第23话 十三冠会议"}, {"cid": "7747", "title": "第24話 師團的表演", "title_zh": "第24话 师团的表演"}, {"cid": "7748", "title": "第25話 做準備的人們", "title_zh": "第25话 做准备的人们"}, {"cid": "7750", "title": "第26話 奇里歐的密室", "title_zh": "第26话 奇里欧的密室"}, {"cid": "7751", "title": "第27話 相似的兩人", "title_zh": "第27话 相似的两人"}, {"cid": "7752", "title": "第28話 前夜祭開始", "title_zh": "第28话 前夜祭开始"}, {"cid": "7753", "title": "第29話 積存的野心", "title_zh": "第29话 积存的野心"}, {"cid": "7754", "title": "第30話 奇里歐的迷宮", "title_zh": "第30话 奇里欧的迷宫"}, {"cid": "7755", "title": "第31話 庫菈菈軍隊長與阿斯指揮官", "title_zh": "第31话 库菈菈军队长与阿斯指挥官"}, {"cid": "7756", "title": "第32話 哀心盼望之物", "title_zh": "第32话 哀心盼望之物"}, {"cid": "7757", "title": "第33話 絕望的表Q", "title_zh": "第33话 绝望的表Q"}, {"cid": "7758", "title": "第34話 魔力的解放", "title_zh": "第34话 魔力的解放"}, {"cid": "7760", "title": "第35話 全都想達成", "title_zh": "第35话 全都想达成"}, {"cid": "7761", "title": "第36話 與家人GD的時光", "title_zh": "第36话 与家人GD的时光"}, {"cid": "7762", "title": "第37話 光榮的表彰", "title_zh": "第37话 光荣的表彰"}, {"cid": "7763", "title": "第38話 人類的待遇", "title_zh": "第38话 人类的待遇"}, {"cid": "7764", "title": "第39話 真心料理對決!!", "title_zh": "第39话 真心料理对决!!"}, {"cid": "7765", "title": "第40話 魔偶像克蘿姆!", "title_zh": "第40话 魔偶像克萝姆!"}, {"cid": "7766", "title": "第41話 不小心的", "title_zh": "第41话 不小心的"}, {"cid": "7767", "title": "第42話 閃閃發光的衝擊", "title_zh": "第42话 闪闪发光的冲击"}, {"cid": "7768", "title": "第43話 捨身為人", "title_zh": "第43话 舍身为人"}, {"cid": "7770", "title": "第44話 魔術的用法", "title_zh": "第44话 魔术的用法"}, {"cid": "7771", "title": "第45話 戒指的秘密", "title_zh": "第45话 戒指的秘密"}, {"cid": "7772", "title": "第46話 艾梅莉的決斷", "title_zh": "第46话 艾梅莉的决断"}, {"cid": "7773", "title": "第47話 魔鬼學生會", "title_zh": "第47话 魔鬼学生会"}, {"cid": "7774", "title": "第48話 崩潰的N傑", "title_zh": "第48话 崩溃的N杰"}, {"cid": "7775", "title": "第49話 少N的惡魔", "title_zh": "第49话 少N的恶魔"}, {"cid": "7776", "title": "第50話 魅力領袖羅諾威", "title_zh": "第50话 魅力领袖罗诺威"}, {"cid": "7777", "title": "第51話 宣洩而出的心意", "title_zh": "第51话 宣泄而出的心意"}, {"cid": "7778", "title": "第52話 學生會長的風景", "title_zh": "第52话 学生会长的风景"}, {"cid": "7780", "title": "第53話 新的野心", "title_zh": "第53话 新的野心"}, {"cid": "7781", "title": "第54話 對立面的入間", "title_zh": "第54话 对立面的入间"}, {"cid": "7782", "title": "第55話 王者的教室", "title_zh": "第55话 王者的教室"}, {"cid": "7783", "title": "第56話 問題兒童同學", "title_zh": "第56话 问题儿童同学"}, {"cid": "7784", "title": "第57話 惡魔學校的教師們", "title_zh": "第57话 恶魔学校的教师们"}, {"cid": "7785", "title": "第58話 優秀的惡魔", "title_zh": "第58话 优秀的恶魔"}, {"cid": "7786", "title": "第59話 小丑的奇蹟", "title_zh": "第59话 小丑的奇迹"}, {"cid": "7787", "title": "第60話 迪爾奇拉的遺物", "title_zh": "第60话 迪尔奇拉的遗物"}]};
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>