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-1273", "mangaid": "1273", "zh_title": "百千家的妖怪王子", "hant_title": "百千家的妖怪王子", "en_title": "百千家的妖怪王子 (Bilimanga #1273)", "author": "硝音あや", "tags": ["神鬼", "东方", "人外", "恋爱", "悬疑", "奇异幻想", "日本漫画", "漫画"], "zh_desc": "孤单无依的百千绯鞠因为十六岁生日那天收到的遗书而继承了「百千家」。\n\r\n然而那里却有著自称葵的少年,以及紫、伊势这些先住民(?)!\n\r\n看样子这个「百千家」似乎是盖在这个世界和那个世界的狭窄间隙有点诡异的家……\n\r\n而百千家的中心人物葵似乎也有著什么秘密──\n\n📚 作品信息:作者 硝音あや · 评分 10 · 共收录 16 卷 / 69 话章节目录与高清彩页/条漫预览。", "hant_desc": "孤單無依的百千緋鞠因為十六歲生日那天收到的遺書而繼承了「百千家」。\n\r\n然而那裡卻有著自稱葵的少年,以及紫、伊勢這些先住民(?)!\n\r\n看樣子這個「百千家」似乎是蓋在這個世界和那個世界的狹窄間隙有點詭異的家……\n\r\n而百千家的中心人物葵似乎也有著什麼祕密──\n\n📚 作品資訊:作者 硝音あや · 評分 10 · 共收錄 16 卷 / 69 話章節目錄與高清彩頁/條漫預覽。", "en_desc": "Popular serialized manga '百千家的妖怪王子' (百千家的妖怪王子) by 硝音あや. Includes 16 volumes and 69 chapters with full online vertical/page-flip web reader.", "pages": ["https://media.huangguodrama.ai/motion/comics/bilimanga-1273/page_01.jpg", "https://media.huangguodrama.ai/motion/comics/bilimanga-1273/page_02.jpg", "https://media.huangguodrama.ai/motion/comics/bilimanga-1273/page_03.jpg", "https://media.huangguodrama.ai/motion/comics/bilimanga-1273/page_04.jpg", "https://media.huangguodrama.ai/motion/comics/bilimanga-1273/page_05.jpg", "https://media.huangguodrama.ai/motion/comics/bilimanga-1273/page_06.jpg"], "volumes": [{"title_hant": "百千家的妖怪王子 1", "title_zh": "百千家的妖怪王子 1", "cover_id": 2284433, "first_chap_id": 105633, "cover_url": "https://i.motiezw.com/cover/1273/2284433.jpg"}, {"title_hant": "百千家的妖怪王子 2", "title_zh": "百千家的妖怪王子 2", "cover_id": 2284595, "first_chap_id": 105637, "cover_url": "https://i.motiezw.com/cover/1273/2284595.jpg"}, {"title_hant": "百千家的妖怪王子 3", "title_zh": "百千家的妖怪王子 3", "cover_id": 2284759, "first_chap_id": 105643, "cover_url": "https://i.motiezw.com/cover/1273/2284759.jpg"}, {"title_hant": "百千家的妖怪王子 4", "title_zh": "百千家的妖怪王子 4", "cover_id": 2284921, "first_chap_id": 105648, "cover_url": "https://i.motiezw.com/cover/1273/2284921.jpg"}, {"title_hant": "百千家的妖怪王子 5", "title_zh": "百千家的妖怪王子 5", "cover_id": 2285083, "first_chap_id": 105653, "cover_url": "https://i.motiezw.com/cover/1273/2285083.jpg"}, {"title_hant": "百千家的妖怪王子 6", "title_zh": "百千家的妖怪王子 6", "cover_id": 2285243, "first_chap_id": 105658, "cover_url": "https://i.motiezw.com/cover/1273/2285243.jpg"}, {"title_hant": "百千家的妖怪王子 7", "title_zh": "百千家的妖怪王子 7", "cover_id": 2285405, "first_chap_id": 105664, "cover_url": "https://i.motiezw.com/cover/1273/2285405.jpg"}, {"title_hant": "百千家的妖怪王子 8", "title_zh": "百千家的妖怪王子 8", "cover_id": 2285562, "first_chap_id": 105670, "cover_url": "https://i.motiezw.com/cover/1273/2285562.jpg"}, {"title_hant": "百千家的妖怪王子 9", "title_zh": "百千家的妖怪王子 9", "cover_id": 2285726, "first_chap_id": 105676, "cover_url": "https://i.motiezw.com/cover/1273/2285726.jpg"}, {"title_hant": "百千家的妖怪王子 10", "title_zh": "百千家的妖怪王子 10", "cover_id": 2285884, "first_chap_id": 105682, "cover_url": "https://i.motiezw.com/cover/1273/2285884.jpg"}, {"title_hant": "百千家的妖怪王子 11", "title_zh": "百千家的妖怪王子 11", "cover_id": 2286042, "first_chap_id": 105687, "cover_url": "https://i.motiezw.com/cover/1273/2286042.jpg"}, {"title_hant": "百千家的妖怪王子 12", "title_zh": "百千家的妖怪王子 12", "cover_id": 2286201, "first_chap_id": 105693, "cover_url": "https://i.motiezw.com/cover/1273/2286201.jpg"}], "chapters": [{"cid": "105633", "title": "其一 百千家的奇妙成員們", "title_zh": "其一 百千家的奇妙成员们"}, {"cid": "105634", "title": "其二 緋鞠成為家主。", "title_zh": "其二 绯鞠成为家主。"}, {"cid": "105635", "title": "其三 櫻吹雪是戀愛風暴!?", "title_zh": "其三 樱吹雪是恋爱风暴!?"}, {"cid": "105637", "title": "其四 迷途之家", "title_zh": "其四 迷途之家"}, {"cid": "105638", "title": "其五 那傢伙是難對付的新式神?", "title_zh": "其五 那家伙是难对付的新式神?"}, {"cid": "105639", "title": "其六 水底的百千家", "title_zh": "其六 水底的百千家"}, {"cid": "105640", "title": "其七 第四位朋友 -上-", "title_zh": "其七 第四位朋友 -上-"}, {"cid": "105641", "title": "小話壹 通過吧", "title_zh": "小话壹 通过吧"}, {"cid": "105643", "title": "其八 第四位朋友 -下-", "title_zh": "其八 第四位朋友 -下-"}, {"cid": "105644", "title": "其九 黑暗中燃燒的猩紅", "title_zh": "其九 黑暗中燃烧的猩红"}, {"cid": "105645", "title": "其十 是夢是幻!? 百千家的賀宴", "title_zh": "其十 是梦是幻!? 百千家的贺宴"}, {"cid": "105646", "title": "其十一 千縫洞的鵺", "title_zh": "其十一 千缝洞的鵺"}, {"cid": "105648", "title": "其十二 四葉草與勾小指", "title_zh": "其十二 四叶草与勾小指"}, {"cid": "105649", "title": "其十三 晚霞下的狐妖 -上-", "title_zh": "其十三 晚霞下的狐妖 -上-"}, {"cid": "105650", "title": "其十四 晚霞下的狐妖 -下-", "title_zh": "其十四 晚霞下的狐妖 -下-"}, {"cid": "105651", "title": "其十五 開了嚇一跳的寶盒!?", "title_zh": "其十五 开了吓一跳的宝盒!?"}, {"cid": "105653", "title": "其十六 泡沫今昔 -上-", "title_zh": "其十六 泡沫今昔 -上-"}, {"cid": "105654", "title": "其十七 泡沫今昔 -下-", "title_zh": "其十七 泡沫今昔 -下-"}, {"cid": "105655", "title": "其十八 納涼!? 試膽大會要提高警覺", "title_zh": "其十八 纳凉!? 试胆大会要提高警觉"}, {"cid": "105658", "title": "其二十 少N之心飄搖消散再滿盈", "title_zh": "其二十 少N之心飘摇消散再满盈"}, {"cid": "105659", "title": "其二十一 可疑的來客", "title_zh": "其二十一 可疑的来客"}, {"cid": "105660", "title": "其二十二 新娘修行步步艱難喵!", "title_zh": "其二十二 新娘修行步步艰难喵!"}, {"cid": "105661", "title": "其二十三 黑漆漆喜歡熱呼呼?", "title_zh": "其二十三 黑漆漆喜欢热呼呼?"}, {"cid": "105662", "title": "小話貳 花一", "title_zh": "小话贰 花一"}, {"cid": "105664", "title": "其二十四 籠中鳥", "title_zh": "其二十四 笼中鸟"}, {"cid": "105665", "title": "其二十五 籠中小鳥何時要⋯", "title_zh": "其二十五 笼中小鸟何时要⋯"}, {"cid": "105666", "title": "其二十六 在後面的人是誰", "title_zh": "其二十六 在后面的人是谁"}, {"cid": "105667", "title": "其二十七 黎明前的夜晚", "title_zh": "其二十七 黎明前的夜晚"}, {"cid": "105668", "title": "附錄", "title_zh": "附录"}, {"cid": "105670", "title": "其二十八 陌生的歸途", "title_zh": "其二十八 陌生的归途"}, {"cid": "105671", "title": "其二十九 妖之國的緋鞠", "title_zh": "其二十九 妖之国的绯鞠"}, {"cid": "105672", "title": "其三十 葵的往事", "title_zh": "其三十 葵的往事"}, {"cid": "105673", "title": "其三十一 不露臉的來訪者", "title_zh": "其三十一 不露脸的来访者"}, {"cid": "105674", "title": "番外篇", "title_zh": "番外篇"}, {"cid": "105676", "title": "其三十二 心願", "title_zh": "其三十二 心愿"}, {"cid": "105677", "title": "其三十三 七歲孩童", "title_zh": "其三十三 七岁孩童"}, {"cid": "105678", "title": "其三十四 歡迎回到百千家!", "title_zh": "其三十四 欢迎回到百千家!"}, {"cid": "105679", "title": "其三十五 灯", "title_zh": "其三十五 灯"}, {"cid": "105682", "title": "其三十七 抓鬼遊戲", "title_zh": "其三十七 抓鬼游戏"}, {"cid": "105683", "title": "其三十八 食客也該懂得分寸!?", "title_zh": "其三十八 食客也该懂得分寸!?"}, {"cid": "105684", "title": "外傳壹 狂言釣猩猩", "title_zh": "外传壹 狂言钓猩猩"}, {"cid": "105685", "title": "附錄", "title_zh": "附录"}, {"cid": "105687", "title": "其三十九 漆黑祭典", "title_zh": "其三十九 漆黑祭典"}, {"cid": "105688", "title": "其四十 不共戴天", "title_zh": "其四十 不共戴天"}, {"cid": "105689", "title": "其四十一 面具的坦白", "title_zh": "其四十一 面具的坦白"}, {"cid": "105690", "title": "其四十二 原罪的嵌合體", "title_zh": "其四十二 原罪的嵌合体"}, {"cid": "105691", "title": "附錄", "title_zh": "附录"}, {"cid": "105693", "title": "其四十三 爱别离苦 -送行之火-", "title_zh": "其四十三 爱别离苦 -送行之火-"}, {"cid": "105694", "title": "其四十四 盛夏之箱庭", "title_zh": "其四十四 盛夏之箱庭"}, {"cid": "105695", "title": "其四十五 墜落的夏天", "title_zh": "其四十五 坠落的夏天"}, {"cid": "105696", "title": "其四十六 繫起再解開", "title_zh": "其四十六 系起再解开"}, {"cid": "105698", "title": "其四十七 暑期體驗學習★緋鞠成為幽靈", "title_zh": "其四十七 暑期体验学习★绯鞠成为幽灵"}, {"cid": "105699", "title": "其四十八 我的歸屬", "title_zh": "其四十八 我的归属"}, {"cid": "105700", "title": "其四十九 夜遊老師", "title_zh": "其四十九 夜游老师"}, {"cid": "105701", "title": "其五十 沉睡森林的茶壺歌", "title_zh": "其五十 沉睡森林的茶壶歌"}, {"cid": "105702", "title": "其五十一 Q敵是火車!? 緋鞠的求婚大N作N戰!!", "title_zh": "其五十一 Q敌是火车!? 绯鞠的求婚大N作N战!!"}, {"cid": "105704", "title": "其五十二 十四的搖籃曲", "title_zh": "其五十二 十四的摇篮曲"}, {"cid": "105705", "title": "其五十三 妖怪之夜不合常理", "title_zh": "其五十三 妖怪之夜不合常理"}, {"cid": "105707", "title": "其五十五 妖怪無聊男", "title_zh": "其五十五 妖怪无聊男"}, {"cid": "105708", "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>