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-16", "mangaid": "16", "zh_title": "龙王的工作!", "hant_title": "龍王的工作!", "en_title": "龙王的工作! (Bilimanga #16)", "author": "こげたおこげ / 白鸟士郎", "tags": ["校园", "日常", "青梅竹马", "妹妹", "恋爱", "竞技", "校园青春", "日本漫画"], "zh_desc": "打开玄关门,有个JS在――「依照约定,来当弟子了!」\n\r\n小学三年生雏鹤爱。9歳。不请自来,到了16歳成为将棋界的最强头衔保持者『竜王』的九头龙八一的家里,\n\r\n「呃?……弟子?呃?」\n\r\n「……不记得了?」\n\r\n虽然不记得却开始了与JS的同居生活。因直率的爱的热情,八一也在逐渐取回失去的炽热之物――\n\n📚 作品信息:作者 こげたおこげ / 白鸟士郎 · 评分 9.9 · 共收录 10 卷 / 71 话章节目录与高清彩页/条漫预览。", "hant_desc": "打開玄關門,有個JS在――「依照約定,來當弟子了!」\n\r\n小學三年生雛鶴愛。9歳。不請自來,到了16歳成為將棋界的最強頭銜保持者『竜王』的九頭龍八一的家裡,\n\r\n「呃?……弟子?呃?」\n\r\n「……不記得了?」\n\r\n雖然不記得卻開始了與JS的同居生活。因直率的愛的熱情,八一也在逐漸取回失去的熾熱之物――\n\n📚 作品資訊:作者 こげたおこげ / 白鳥士郎 · 評分 9.9 · 共收錄 10 卷 / 71 話章節目錄與高清彩頁/條漫預覽。", "en_desc": "Popular serialized manga '龙王的工作!' (龍王的工作!) by こげたおこげ / 白鸟士郎. Includes 10 volumes and 71 chapters with full online vertical/page-flip web reader.", "pages": ["https://media.huangguodrama.ai/motion/comics/bilimanga-16/page_01.jpg", "https://media.huangguodrama.ai/motion/comics/bilimanga-16/page_02.jpg", "https://media.huangguodrama.ai/motion/comics/bilimanga-16/page_03.jpg", "https://media.huangguodrama.ai/motion/comics/bilimanga-16/page_04.jpg", "https://media.huangguodrama.ai/motion/comics/bilimanga-16/page_05.jpg", "https://media.huangguodrama.ai/motion/comics/bilimanga-16/page_06.jpg"], "volumes": [{"title_hant": "龍王的工作! 1", "title_zh": "龙王的工作! 1", "cover_id": 18039, "first_chap_id": 992, "cover_url": "https://i.motiezw.com/cover/16/18039.jpg"}, {"title_hant": "龍王的工作! 2", "title_zh": "龙王的工作! 2", "cover_id": 18196, "first_chap_id": 999, "cover_url": "https://i.motiezw.com/cover/16/18196.jpg"}, {"title_hant": "龍王的工作! 3", "title_zh": "龙王的工作! 3", "cover_id": 18377, "first_chap_id": 1007, "cover_url": "https://i.motiezw.com/cover/16/18377.jpg"}, {"title_hant": "龍王的工作! 4", "title_zh": "龙王的工作! 4", "cover_id": 18533, "first_chap_id": 1014, "cover_url": "https://i.motiezw.com/cover/16/18533.jpg"}, {"title_hant": "龍王的工作! 5", "title_zh": "龙王的工作! 5", "cover_id": 18686, "first_chap_id": 1021, "cover_url": "https://i.motiezw.com/cover/16/18686.jpg"}, {"title_hant": "龍王的工作! 6", "title_zh": "龙王的工作! 6", "cover_id": 18864, "first_chap_id": 1029, "cover_url": "https://i.motiezw.com/cover/16/18864.jpg"}, {"title_hant": "龍王的工作! 7", "title_zh": "龙王的工作! 7", "cover_id": 19088, "first_chap_id": 1037, "cover_url": "https://i.motiezw.com/cover/16/19088.jpg"}, {"title_hant": "龍王的工作! 8", "title_zh": "龙王的工作! 8", "cover_id": 19300, "first_chap_id": 1046, "cover_url": "https://i.motiezw.com/cover/16/19300.jpg"}, {"title_hant": "龍王的工作! 9", "title_zh": "龙王的工作! 9", "cover_id": 19477, "first_chap_id": 1054, "cover_url": "https://i.motiezw.com/cover/16/19477.jpg"}, {"title_hant": "龍王的工作! 10", "title_zh": "龙王的工作! 10", "cover_id": 19694, "first_chap_id": 1064, "cover_url": "https://i.motiezw.com/cover/16/19694.jpg"}], "chapters": [{"cid": "992", "title": "第〇谱 序章", "title_zh": "第〇谱 序章"}, {"cid": "993", "title": "第一谱 废物的报恩", "title_zh": "第一谱 废物的报恩"}, {"cid": "994", "title": "第二谱 上门弟子", "title_zh": "第二谱 上门弟子"}, {"cid": "995", "title": "第三谱 起始的早晨", "title_zh": "第三谱 起始的早晨"}, {"cid": "996", "title": "第四谱 将棋之家", "title_zh": "第四谱 将棋之家"}, {"cid": "997", "title": "第五谱 登场!白银的圣骑士", "title_zh": "第五谱 登场!白银的圣骑士"}, {"cid": "999", "title": "第六谱 对局开始", "title_zh": "第六谱 对局开始"}, {"cid": "1000", "title": "第七谱 误算", "title_zh": "第七谱 误算"}, {"cid": "1001", "title": "第八谱 了断", "title_zh": "第八谱 了断"}, {"cid": "1002", "title": "第九谱 咖喱名人", "title_zh": "第九谱 咖喱名人"}, {"cid": "1003", "title": "第十谱 JS研", "title_zh": "第十谱 JS研"}, {"cid": "1004", "title": "第十一谱 爱的父母", "title_zh": "第十一谱 爱的父母"}, {"cid": "1005", "title": "第十二谱 研修会试验", "title_zh": "第十二谱 研修会试验"}, {"cid": "1007", "title": "第十三谱 奖励会员", "title_zh": "第十三谱 奖励会员"}, {"cid": "1008", "title": "第十四谱 人生的名人", "title_zh": "第十四谱 人生的名人"}, {"cid": "1009", "title": "第十五谱 弟子", "title_zh": "第十五谱 弟子"}, {"cid": "1010", "title": "第十六谱 对手", "title_zh": "第十六谱 对手"}, {"cid": "1011", "title": "第十七谱 约见", "title_zh": "第十七谱 约见"}, {"cid": "1012", "title": "第十八谱 另一个爱", "title_zh": "第十八谱 另一个爱"}, {"cid": "1014", "title": "第十九谱 新世界", "title_zh": "第十九谱 新世界"}, {"cid": "1016", "title": "第二十一谱 今天的四年二班", "title_zh": "第二十一谱 今天的四年二班"}, {"cid": "1017", "title": "第二十二谱 修罗场", "title_zh": "第二十二谱 修罗场"}, {"cid": "1018", "title": "第二十三谱 弟子的育成法", "title_zh": "第二十三谱 弟子的育成法"}, {"cid": "1019", "title": "第二十四谱 完成", "title_zh": "第二十四谱 完成"}, {"cid": "1021", "title": "第二十五谱 恶童见参", "title_zh": "第二十五谱 恶童见参"}, {"cid": "1022", "title": "第二十六谱 天衣无缝!", "title_zh": "第二十六谱 天衣无缝!"}, {"cid": "1023", "title": "第二十七谱 胜负的走向", "title_zh": "第二十七谱 胜负的走向"}, {"cid": "1024", "title": "第二十八谱 不曾察觉的光", "title_zh": "第二十八谱 不曾察觉的光"}, {"cid": "1025", "title": "第二十九谱 龙王与名人", "title_zh": "第二十九谱 龙王与名人"}, {"cid": "1026", "title": "第三十谱 光芒", "title_zh": "第三十谱 光芒"}, {"cid": "1027", "title": "第三十一谱 师弟", "title_zh": "第三十一谱 师弟"}, {"cid": "1029", "title": "第三十二谱 天敌", "title_zh": "第三十二谱 天敌"}, {"cid": "1030", "title": "第三十三谱 清泷桂香", "title_zh": "第三十三谱 清泷桂香"}, {"cid": "1031", "title": "第三十四谱 装扮人偶的决心", "title_zh": "第三十四谱 装扮人偶的决心"}, {"cid": "1032", "title": "第三十五谱 运子的巨匠", "title_zh": "第三十五谱 运子的巨匠"}, {"cid": "1033", "title": "第三十六谱 将棋星人", "title_zh": "第三十六谱 将棋星人"}, {"cid": "1034", "title": "第三十七谱 告白", "title_zh": "第三十七谱 告白"}, {"cid": "1035", "title": "第三十八谱 桂香的记忆", "title_zh": "第三十八谱 桂香的记忆"}, {"cid": "1037", "title": "第三十九谱 胜利的痛楚", "title_zh": "第三十九谱 胜利的痛楚"}, {"cid": "1039", "title": "第四十譜 百億挑戰與千兆之死的", "title_zh": "第四十谱 百亿挑战与千兆之死的"}, {"cid": "1040", "title": "第四十一譜 積澱", "title_zh": "第四十一谱 积淀"}, {"cid": "1041", "title": "第四十三譜 棋盤外戰術", "title_zh": "第四十三谱 棋盘外战术"}, {"cid": "1042", "title": "第四十四譜 相振飛車", "title_zh": "第四十四谱 相振飞车"}, {"cid": "1043", "title": "第四十五譜 小小魔法師", "title_zh": "第四十五谱 小小魔法师"}, {"cid": "1044", "title": "第四十六譜 致十歲的我", "title_zh": "第四十六谱 致十岁的我"}, {"cid": "1046", "title": "第四十七譜 起跑線", "title_zh": "第四十七谱 起跑线"}, {"cid": "1047", "title": "第四十八譜 祭神雷", "title_zh": "第四十八谱 祭神雷"}, {"cid": "1048", "title": "第四十九譜 初陣", "title_zh": "第四十九谱 初阵"}, {"cid": "1049", "title": "第五十譜 千馱谷", "title_zh": "第五十谱 千驮谷"}, {"cid": "1050", "title": "第五十一譜 網絡直播", "title_zh": "第五十一谱 网络直播"}, {"cid": "1051", "title": "第五十二譜 師姐(好可愛)", "title_zh": "第五十二谱 师姐(好可爱)"}, {"cid": "1052", "title": "第五十三譜 集體預選", "title_zh": "第五十三谱 集体预选"}, {"cid": "1054", "title": "第五十四譜 N悻的戰鬥", "title_zh": "第五十四谱 N悻的战斗"}, {"cid": "1055", "title": "第五十五譜 預選決賽", "title_zh": "第五十五谱 预选决赛"}, {"cid": "1056", "title": "第五十六譜 敵人", "title_zh": "第五十六谱 敌人"}, {"cid": "1057", "title": "第五十七譜 怒槌", "title_zh": "第五十七谱 怒槌"}, {"cid": "1058", "title": "第五十八譜 終演", "title_zh": "第五十八谱 终演"}, {"cid": "1059", "title": "第五十九譜 8月1日", "title_zh": "第五十九谱 8月1日"}, {"cid": "1060", "title": "第六十譜 春天與修羅", "title_zh": "第六十谱 春天与修罗"}, {"cid": "1061", "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>