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-596", "mangaid": "596", "zh_title": "放学后失眠的你", "hant_title": "放學後失眠的你", "en_title": "放学后失眠的你 (Bilimanga #596)", "author": "绪城真", "tags": ["校园", "日常", "恋爱", "治愈", "校园青春", "日本漫画", "漫画", "日漫"], "zh_desc": "青春漫画代表作家献上的无法入眠的青春夜晚物语。\n\r\n在《富士山同学正在青春期》《猫寺的知恩小姐》中描绘过如闪光般的青春时光后,小白真琴的全新力作,以能登为舞台,讲述了「失眠」的高中生们的青春之夜。\n\r\n因失眠而烦恼的高中生雁田,偶然与同样受失眠困扰的伊佐树相遇。两人开始在放学后秘密聚集在如今成为储物间的学校天文台,共享短暂的安眠与秘密,由此展开了一段奇妙的关系……\n\r\n这部作品能让你会心一笑,同时也会在阅读中与他们一同感受到心灵的安慰与舒适的眠意。它以真挚的笔触描绘了少男少女从友情向初恋转变的青涩美好。\n\r\n「你无法入眠的夜晚,一定有它的意义」\n\r\n在现代社会,据说每四个日本人中就有一个患有睡眠障碍,而青少年的失眠症也在急剧增加。对于那些疲惫却无法入眠、感到漫长孤独的夜晚,这部作品温柔地告诉你——「你不再是一个人了。」\n\r\n※「Insomnia」即为失眠症的意思。\n\n📚 作品信息:作者 绪城真 · 评分 9.2 · 共收录 14 卷 / 121 话章节目录与高清彩页/条漫预览。", "hant_desc": "青春漫畫代表作家獻上的無法入眠的青春夜晚物語。\n\r\n在《富士山同學正在青春期》《貓寺的知恩小姐》中描繪過如閃光般的青春時光後,小白真琴的全新力作,以能登為舞台,講述了「失眠」的高中生們的青春之夜。\n\r\n因失眠而煩惱的高中生雁田,偶然與同樣受失眠困擾的伊佐樹相遇。兩人開始在放學後秘密聚集在如今成為儲物間的學校天文台,共享短暫的安眠與秘密,由此展開了一段奇妙的關係……\n\r\n這部作品能讓你會心一笑,同時也會在閱讀中與他們一同感受到心靈的安慰與舒適的眠意。它以真摯的筆觸描繪了少男少女從友情向初戀轉變的青澀美好。\n\r\n「你無法入眠的夜晚,一定有它的意義」\n\r\n在現代社會,據說每四個日本人中就有一個患有睡眠障礙,而青少年的失眠症也在急劇增加。對於那些疲憊卻無法入眠、感到漫長孤獨的夜晚,這部作品溫柔地告訴你——「你不再是一個人了。」\n\r\n※「Insomnia」即為失眠症的意思。\n\n📚 作品資訊:作者 緒城真 · 評分 9.2 · 共收錄 14 卷 / 121 話章節目錄與高清彩頁/條漫預覽。", "en_desc": "Popular serialized manga '放学后失眠的你' (放學後失眠的你) by 绪城真. Includes 14 volumes and 121 chapters with full online vertical/page-flip web reader.", "pages": ["https://media.huangguodrama.ai/motion/comics/bilimanga-596/page_01.jpg", "https://media.huangguodrama.ai/motion/comics/bilimanga-596/page_02.jpg", "https://media.huangguodrama.ai/motion/comics/bilimanga-596/page_03.jpg", "https://media.huangguodrama.ai/motion/comics/bilimanga-596/page_04.jpg", "https://media.huangguodrama.ai/motion/comics/bilimanga-596/page_05.jpg", "https://media.huangguodrama.ai/motion/comics/bilimanga-596/page_06.jpg"], "volumes": [{"title_hant": "放學後失眠的你 1", "title_zh": "放学后失眠的你 1", "cover_id": 2486314, "first_chap_id": 46503, "cover_url": "https://i.motiezw.com/cover/596/2486314.jpg"}, {"title_hant": "放學後失眠的你 2", "title_zh": "放学后失眠的你 2", "cover_id": 2486504, "first_chap_id": 46512, "cover_url": "https://i.motiezw.com/cover/596/2486504.jpg"}, {"title_hant": "放學後失眠的你 3", "title_zh": "放学后失眠的你 3", "cover_id": 2486697, "first_chap_id": 46523, "cover_url": "https://i.motiezw.com/cover/596/2486697.jpg"}, {"title_hant": "放學後失眠的你 4", "title_zh": "放学后失眠的你 4", "cover_id": 2486876, "first_chap_id": 46533, "cover_url": "https://i.motiezw.com/cover/596/2486876.jpg"}, {"title_hant": "放學後失眠的你 5", "title_zh": "放学后失眠的你 5", "cover_id": 2487066, "first_chap_id": 46544, "cover_url": "https://i.motiezw.com/cover/596/2487066.jpg"}, {"title_hant": "放學後失眠的你 6", "title_zh": "放学后失眠的你 6", "cover_id": 2487257, "first_chap_id": 46555, "cover_url": "https://i.motiezw.com/cover/596/2487257.jpg"}, {"title_hant": "放學後失眠的你 7", "title_zh": "放学后失眠的你 7", "cover_id": 2487434, "first_chap_id": 46564, "cover_url": "https://i.motiezw.com/cover/596/2487434.jpg"}, {"title_hant": "放學後失眠的你 8", "title_zh": "放学后失眠的你 8", "cover_id": 2487626, "first_chap_id": 46574, "cover_url": "https://i.motiezw.com/cover/596/2487626.jpg"}, {"title_hant": "放學後失眠的你 9", "title_zh": "放学后失眠的你 9", "cover_id": 2487801, "first_chap_id": 46583, "cover_url": "https://i.motiezw.com/cover/596/2487801.jpg"}, {"title_hant": "放學後失眠的你 10", "title_zh": "放学后失眠的你 10", "cover_id": 2487978, "first_chap_id": 46592, "cover_url": "https://i.motiezw.com/cover/596/2487978.jpg"}, {"title_hant": "放學後失眠的你 11", "title_zh": "放学后失眠的你 11", "cover_id": 2488169, "first_chap_id": 46602, "cover_url": "https://i.motiezw.com/cover/596/2488169.jpg"}, {"title_hant": "放學後失眠的你 12", "title_zh": "放学后失眠的你 12", "cover_id": 2488359, "first_chap_id": 46612, "cover_url": "https://i.motiezw.com/cover/596/2488359.jpg"}], "chapters": [{"cid": "46503", "title": "第1話 能登星", "title_zh": "第1话 能登星"}, {"cid": "46504", "title": "第2話 雙子星", "title_zh": "第2话 双子星"}, {"cid": "46505", "title": "第3話 啓明星", "title_zh": "第3话 启明星"}, {"cid": "46506", "title": "第4話 曉星", "title_zh": "第4话 晓星"}, {"cid": "46507", "title": "第5話 貓眼星", "title_zh": "第5话 猫眼星"}, {"cid": "46508", "title": "第6話 能登窺視星", "title_zh": "第6话 能登窥视星"}, {"cid": "46509", "title": "第7話 兩脅星", "title_zh": "第7话 两胁星"}, {"cid": "46510", "title": "第8話 降雨星", "title_zh": "第8话 降雨星"}, {"cid": "46512", "title": "第9話 日落星", "title_zh": "第9话 日落星"}, {"cid": "46513", "title": "第10話 長庚星", "title_zh": "第10话 长庚星"}, {"cid": "46514", "title": "第11話 討論星", "title_zh": "第11话 讨论星"}, {"cid": "46515", "title": "第12話 一等星", "title_zh": "第12话 一等星"}, {"cid": "46516", "title": "第13話 鑿渠星", "title_zh": "第13话 凿渠星"}, {"cid": "46517", "title": "第14話 慌張星", "title_zh": "第14话 慌张星"}, {"cid": "46518", "title": "第15話 天津甕星", "title_zh": "第15话 天津瓮星"}, {"cid": "46519", "title": "第16話 炊飯星", "title_zh": "第16话 炊饭星"}, {"cid": "46520", "title": "第17話 飛升星", "title_zh": "第17话 飞升星"}, {"cid": "46521", "title": "第18話 會合星", "title_zh": "第18话 会合星"}, {"cid": "46523", "title": "第19話 收網星", "title_zh": "第19话 收网星"}, {"cid": "46524", "title": "第20話 奔跑星", "title_zh": "第20话 奔跑星"}, {"cid": "46525", "title": "第21話 顏料星", "title_zh": "第21话 颜料星"}, {"cid": "46527", "title": "第23話 白星", "title_zh": "第23话 白星"}, {"cid": "46528", "title": "第24話 洗腳星", "title_zh": "第24话 洗脚星"}, {"cid": "46529", "title": "第25話 煙花星(前篇)", "title_zh": "第25话 烟花星(前篇)"}, {"cid": "46530", "title": "第26話 煙花星(後篇)", "title_zh": "第26话 烟花星(后篇)"}, {"cid": "46531", "title": "第27話 星之誓", "title_zh": "第27话 星之誓"}, {"cid": "46533", "title": "第28話 電波星", "title_zh": "第28话 电波星"}, {"cid": "46534", "title": "第29話 時不知", "title_zh": "第29话 时不知"}, {"cid": "46535", "title": "第30話 姐姐星", "title_zh": "第30话 姐姐星"}, {"cid": "46536", "title": "第31話 工作星", "title_zh": "第31话 工作星"}, {"cid": "46537", "title": "第32話 集會星", "title_zh": "第32话 集会星"}, {"cid": "46538", "title": "第33話 風車星", "title_zh": "第33话 风车星"}, {"cid": "46539", "title": "第34話 雨夜之星", "title_zh": "第34话 雨夜之星"}, {"cid": "46540", "title": "第35話 凳子星", "title_zh": "第35话 凳子星"}, {"cid": "46541", "title": "第36話 銀灣", "title_zh": "第36话 银湾"}, {"cid": "46542", "title": "第37話 星合", "title_zh": "第37话 星合"}, {"cid": "46544", "title": "第38話 十字架", "title_zh": "第38话 十字架"}, {"cid": "46545", "title": "第39話 貓眼", "title_zh": "第39话 猫眼"}, {"cid": "46546", "title": "第40話 輔星", "title_zh": "第40话 辅星"}, {"cid": "46547", "title": "第41話 船星", "title_zh": "第41话 船星"}, {"cid": "46548", "title": "第42話 阿姐星", "title_zh": "第42话 阿姐星"}, {"cid": "46549", "title": "第43話 草履星", "title_zh": "第43话 草履星"}, {"cid": "46550", "title": "第44話 破曉的明星", "title_zh": "第44话 破晓的明星"}, {"cid": "46552", "title": "第46話 星宿", "title_zh": "第46话 星宿"}, {"cid": "46553", "title": "第47話 星命", "title_zh": "第47话 星命"}, {"cid": "46555", "title": "第48話 纏腰布爭奪星", "title_zh": "第48话 缠腰布争夺星"}, {"cid": "46556", "title": "第49話 早飯星", "title_zh": "第49话 早饭星"}, {"cid": "46557", "title": "第50話 十六夜", "title_zh": "第50话 十六夜"}, {"cid": "46558", "title": "第51話 迷途星", "title_zh": "第51话 迷途星"}, {"cid": "46559", "title": "第52話 子星", "title_zh": "第52话 子星"}, {"cid": "46560", "title": "第53話 至古之星", "title_zh": "第53话 至古之星"}, {"cid": "46561", "title": "第54話 七夕", "title_zh": "第54话 七夕"}, {"cid": "46562", "title": "第55話 七夕的後星", "title_zh": "第55话 七夕的后星"}, {"cid": "46564", "title": "第56話 夏日星", "title_zh": "第56话 夏日星"}, {"cid": "46565", "title": "第57話 星船", "title_zh": "第57话 星船"}, {"cid": "46566", "title": "第58話 星團", "title_zh": "第58话 星团"}, {"cid": "46567", "title": "第59話 泡茶星", "title_zh": "第59话 泡茶星"}, {"cid": "46568", "title": "第60話 舞娘星", "title_zh": "第60话 舞娘星"}, {"cid": "46569", "title": "第61話 飛星", "title_zh": "第61话 飞星"}, {"cid": "46570", "title": "第62話 竿星", "title_zh": "第62话 竿星"}]};
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>