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-1591", "mangaid": "1591", "zh_title": "尼古喵喵", "hant_title": "尼古喵喵", "en_title": "尼古喵喵 (Bilimanga #1591)", "author": "にゃんにゃんファクトリー", "tags": ["欢乐", "日常", "人外", "黑暗", "女性视角", "奇异幻想", "日本漫画", "漫画"], "zh_desc": "「这只猫比你还懂人生——」\n\r\n抽烟、懒散的生活,爽到不行!\n\r\n口耳相传的话题漫画——\n\r\n内容虽然只是一只猫在抽烟的日子,\n\r\n但就是这样才格外有趣。\n\n📚 作品信息:作者 にゃんにゃんファクトリー · 评分 9.5 · 共收录 3 卷 / 64 话章节目录与高清彩页/条漫预览。", "hant_desc": "「這隻貓比你還懂人生——」\n\r\n抽菸、懶散的生活,爽到不行!\n\r\n口耳相傳的話題漫畫——\n\r\n內容雖然只是一隻貓在抽菸的日子,\n\r\n但就是這樣才格外有趣。\n\n📚 作品資訊:作者 にゃんにゃんファクトリー · 評分 9.5 · 共收錄 3 卷 / 64 話章節目錄與高清彩頁/條漫預覽。", "en_desc": "Popular serialized manga '尼古喵喵' (尼古喵喵) by にゃんにゃんファクトリー. Includes 3 volumes and 64 chapters with full online vertical/page-flip web reader.", "pages": ["https://media.huangguodrama.ai/motion/comics/bilimanga-1591/page_01.jpg", "https://media.huangguodrama.ai/motion/comics/bilimanga-1591/page_02.jpg", "https://media.huangguodrama.ai/motion/comics/bilimanga-1591/page_03.jpg", "https://media.huangguodrama.ai/motion/comics/bilimanga-1591/page_04.jpg", "https://media.huangguodrama.ai/motion/comics/bilimanga-1591/page_05.jpg", "https://media.huangguodrama.ai/motion/comics/bilimanga-1591/page_06.jpg"], "volumes": [{"title_hant": "尼古喵喵 1", "title_zh": "尼古喵喵 1", "cover_id": 2868646, "first_chap_id": 131064, "cover_url": "https://i.motiezw.com/cover/1591/2868646.jpg"}, {"title_hant": "尼古喵喵 2", "title_zh": "尼古喵喵 2", "cover_id": 2868841, "first_chap_id": 131094, "cover_url": "https://i.motiezw.com/cover/1591/2868841.jpg"}, {"title_hant": "尼古喵喵 3", "title_zh": "尼古喵喵 3", "cover_id": 2869027, "first_chap_id": 131128, "cover_url": "https://i.motiezw.com/cover/1591/2869027.jpg"}], "chapters": [{"cid": "131064", "title": "1mg 下次注意喵", "title_zh": "1mg 下次注意喵"}, {"cid": "131065", "title": "2mg 本喵會整理喵!", "title_zh": "2mg 本喵会整理喵!"}, {"cid": "131066", "title": "3mg 滿出來了喵", "title_zh": "3mg 满出来了喵"}, {"cid": "131067", "title": "4mg 3秒定律喵!", "title_zh": "4mg 3秒定律喵!"}, {"cid": "131068", "title": "5mg 大嬸沒拿於灰缸出來", "title_zh": "5mg 大婶没拿于灰缸出来"}, {"cid": "131069", "title": "6mg 感冒了喵⋯?", "title_zh": "6mg 感冒了喵⋯?"}, {"cid": "131070", "title": "7mg 本喵很會含的喵!", "title_zh": "7mg 本喵很会含的喵!"}, {"cid": "131071", "title": "8mg 姊姊⋯⋯", "title_zh": "8mg 姊姊⋯⋯"}, {"cid": "131072", "title": "9mg 說教煩死了喵~", "title_zh": "9mg 说教烦死了喵~"}, {"cid": "131073", "title": "10mg 啊啊⋯會融化⋯喵", "title_zh": "10mg 啊啊⋯会融化⋯喵"}, {"cid": "131074", "title": "11mg 靈異公寓喵!", "title_zh": "11mg 灵异公寓喵!"}, {"cid": "131075", "title": "12mg 變S了喵⋯!", "title_zh": "12mg 变S了喵⋯!"}, {"cid": "131076", "title": "13mg 想要沙拉醬喵", "title_zh": "13mg 想要沙拉酱喵"}, {"cid": "131077", "title": "14mg 後輩貓喵", "title_zh": "14mg 后辈猫喵"}, {"cid": "131078", "title": "15mg 我什麼壞事都沒幹!", "title_zh": "15mg 我什么坏事都没干!"}, {"cid": "131079", "title": "16mg 動不了喵⋯", "title_zh": "16mg 动不了喵⋯"}, {"cid": "131080", "title": "17mg 打工第一天喵!", "title_zh": "17mg 打工第一天喵!"}, {"cid": "131081", "title": "18mg 明明只是想當好朋友⋯", "title_zh": "18mg 明明只是想当好朋友⋯"}, {"cid": "131082", "title": "19mg 算命好可怕喵!", "title_zh": "19mg 算命好可怕喵!"}, {"cid": "131083", "title": "20mg 別讓我太不爽啊!", "title_zh": "20mg 别让我太不爽啊!"}, {"cid": "131084", "title": "21mg 天才與那個只有一線之間喵!", "title_zh": "21mg 天才与那个只有一线之间喵!"}, {"cid": "131085", "title": "22mg 廁精", "title_zh": "22mg 厕精"}, {"cid": "131086", "title": "23mg 立功了喵!", "title_zh": "23mg 立功了喵!"}, {"cid": "131088", "title": "25mg 本喵做了什麼奇怪的事嗎喵?", "title_zh": "25mg 本喵做了什么奇怪的事吗喵?"}, {"cid": "131089", "title": "26mg 為了保護隱私喵", "title_zh": "26mg 为了保护隐私喵"}, {"cid": "131090", "title": "27mg 姊妹", "title_zh": "27mg 姊妹"}, {"cid": "131091", "title": "全新短篇 姓氏喵!", "title_zh": "全新短篇 姓氏喵!"}, {"cid": "131092", "title": "嘉賓邀稿「我的尼古喵喵」大集合喵——!!!", "title_zh": "嘉宾邀稿「我的尼古喵喵」大集合喵——!!!"}, {"cid": "131094", "title": "28mg 這是啥喵?", "title_zh": "28mg 这是啥喵?"}, {"cid": "131095", "title": "29mg 神叫喵「別工作」喵", "title_zh": "29mg 神叫喵「别工作」喵"}, {"cid": "131096", "title": "30mg 化學反應喵⋯?", "title_zh": "30mg 化学反应喵⋯?"}, {"cid": "131097", "title": "31mg 包皮垢達郎喵!", "title_zh": "31mg 包皮垢达郎喵!"}, {"cid": "131098", "title": "32mg 超火焰術喵!", "title_zh": "32mg 超火焰术喵!"}, {"cid": "131099", "title": "33mg 日常的行為喵", "title_zh": "33mg 日常的行为喵"}, {"cid": "131100", "title": "34mg 永遠在一起喵", "title_zh": "34mg 永远在一起喵"}, {"cid": "131101", "title": "35mg 愉快的夥伴們——", "title_zh": "35mg 愉快的伙伴们——"}, {"cid": "131102", "title": "36mg 於鬼永續發展目標喵⋯!", "title_zh": "36mg 于鬼永续发展目标喵⋯!"}, {"cid": "131103", "title": "37mg 貓有九(數)命", "title_zh": "37mg 猫有九(数)命"}, {"cid": "131104", "title": "38mg 姊姊,不當人了", "title_zh": "38mg 姊姊,不当人了"}, {"cid": "131105", "title": "39mg 就是這個讓人受不了喵!", "title_zh": "39mg 就是这个让人受不了喵!"}, {"cid": "131106", "title": "40mg 王牌就是要留到最後吧?", "title_zh": "40mg 王牌就是要留到最后吧?"}, {"cid": "131107", "title": "41mg 野獸們的午後喵⋯!", "title_zh": "41mg 野兽们的午后喵⋯!"}, {"cid": "131108", "title": "42mg 酒精貓常有的事", "title_zh": "42mg 酒精猫常有的事"}, {"cid": "131109", "title": "43mg 寫文貓喵!", "title_zh": "43mg 写文猫喵!"}, {"cid": "131110", "title": "44mg 值・值得參考⋯", "title_zh": "44mg 值・值得参考⋯"}, {"cid": "131111", "title": "45mg 沒有前科紀錄喵!", "title_zh": "45mg 没有前科纪录喵!"}, {"cid": "131113", "title": "47mg 妳們說我怎麼了嘛!", "title_zh": "47mg 妳们说我怎么了嘛!"}, {"cid": "131114", "title": "48mg 戒快捏旋風6吧", "title_zh": "48mg 戒快捏旋风6吧"}, {"cid": "131115", "title": "49mg 不要在於灰缸裡丟垃圾", "title_zh": "49mg 不要在于灰缸里丢垃圾"}, {"cid": "131116", "title": "50mg 平安夜", "title_zh": "50mg 平安夜"}, {"cid": "131117", "title": "51mg 條件反射喵!", "title_zh": "51mg 条件反射喵!"}, {"cid": "131118", "title": "52mg 獸人生遊戲喵!", "title_zh": "52mg 兽人生游戏喵!"}, {"cid": "131119", "title": "53mg 我沒吃!!", "title_zh": "53mg 我没吃!!"}, {"cid": "131120", "title": "54mg 修毛時期喵!", "title_zh": "54mg 修毛时期喵!"}, {"cid": "131121", "title": "55mg 懷念的旋律喵?", "title_zh": "55mg 怀念的旋律喵?"}, {"cid": "131122", "title": "56mg 感受氣場喵!", "title_zh": "56mg 感受气场喵!"}, {"cid": "131123", "title": "57mg α村 前篇", "title_zh": "57mg α村 前篇"}, {"cid": "131124", "title": "58mg α村 後篇", "title_zh": "58mg α村 后篇"}, {"cid": "131125", "title": "全新短篇 上門幹架!", "title_zh": "全新短篇 上门干架!"}, {"cid": "131126", "title": "嘉賓邀稿「我的尼古喵喵」大集合喵——!!!②", "title_zh": "嘉宾邀稿「我的尼古喵喵」大集合喵——!!!②"}]};
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>