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>WITCH WATCH 魔女守护者 - 在线漫画阅读器</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-1188", "mangaid": "1188", "zh_title": "WITCH WATCH 魔女守护者", "hant_title": "WITCH WATCH 魔女守護者", "en_title": "WITCH WATCH 魔女守护者 (Bilimanga #1188)", "author": "筿原健太", "tags": ["魔法", "校园", "欢乐", "恋爱", "青梅竹马", "校园青春", "日本漫画", "漫画"], "zh_desc": "高中生乙木守仁是鬼族的后裔,拥有强大的力量,有一天守仁的父亲告诉他,因为鬼族有使魔的血统,所以守仁必须担任魔女若月妮可的使魔。妮可是守仁的儿时玩伴,后来到魔女的圣地修行,在数年后妮可回到了镇上,她要求守仁当她的使魔,其实妮可喜欢著守仁…不过根据魔女的预言,有黑魔女盯上了妮可,而守仁就想尽办法要保护她…\n\n📚 作品信息:作者 筿原健太 · 评分 10 · 共收录 25 卷 / 217 话章节目录与高清彩页/条漫预览。", "hant_desc": "高中生乙木守仁是鬼族的後裔,擁有強大的力量,有一天守仁的父親告訴他,因為鬼族有使魔的血統,所以守仁必須擔任魔女若月妮可的使魔。妮可是守仁的兒時玩伴,後來到魔女的聖地修行,在數年後妮可回到了鎮上,她要求守仁當她的使魔,其實妮可喜歡著守仁…不過根據魔女的預言,有黑魔女盯上了妮可,而守仁就想盡辦法要保護她…\n\n📚 作品資訊:作者 篠原健太 · 評分 10 · 共收錄 25 卷 / 217 話章節目錄與高清彩頁/條漫預覽。", "en_desc": "Popular serialized manga 'WITCH WATCH 魔女守护者' (WITCH WATCH 魔女守護者) by 筿原健太. Includes 25 volumes and 217 chapters with full online vertical/page-flip web reader.", "pages": ["https://media.huangguodrama.ai/motion/comics/bilimanga-1188/page_01.jpg", "https://media.huangguodrama.ai/motion/comics/bilimanga-1188/page_02.jpg", "https://media.huangguodrama.ai/motion/comics/bilimanga-1188/page_03.jpg", "https://media.huangguodrama.ai/motion/comics/bilimanga-1188/page_04.jpg", "https://media.huangguodrama.ai/motion/comics/bilimanga-1188/page_05.jpg", "https://media.huangguodrama.ai/motion/comics/bilimanga-1188/page_06.jpg"], "volumes": [{"title_hant": "WITCH WATCH 魔女守護者 1", "title_zh": "WITCH WATCH 魔女守护者 1", "cover_id": 2150008, "first_chap_id": 99745, "cover_url": "https://i.motiezw.com/cover/1188/2150008.jpg"}, {"title_hant": "WITCH WATCH 魔女守護者 2", "title_zh": "WITCH WATCH 魔女守护者 2", "cover_id": 2150197, "first_chap_id": 99753, "cover_url": "https://i.motiezw.com/cover/1188/2150197.jpg"}, {"title_hant": "WITCH WATCH 魔女守護者 3", "title_zh": "WITCH WATCH 魔女守护者 3", "cover_id": 2150403, "first_chap_id": 99764, "cover_url": "https://i.motiezw.com/cover/1188/2150403.jpg"}, {"title_hant": "WITCH WATCH 魔女守護者 4", "title_zh": "WITCH WATCH 魔女守护者 4", "cover_id": 2150590, "first_chap_id": 99774, "cover_url": "https://i.motiezw.com/cover/1188/2150590.jpg"}, {"title_hant": "WITCH WATCH 魔女守護者 5", "title_zh": "WITCH WATCH 魔女守护者 5", "cover_id": 2150780, "first_chap_id": 99784, "cover_url": "https://i.motiezw.com/cover/1188/2150780.jpg"}, {"title_hant": "WITCH WATCH 魔女守護者 6", "title_zh": "WITCH WATCH 魔女守护者 6", "cover_id": 2150967, "first_chap_id": 99794, "cover_url": "https://i.motiezw.com/cover/1188/2150967.jpg"}, {"title_hant": "WITCH WATCH 魔女守護者 7", "title_zh": "WITCH WATCH 魔女守护者 7", "cover_id": 2151154, "first_chap_id": 99804, "cover_url": "https://i.motiezw.com/cover/1188/2151154.jpg"}, {"title_hant": "WITCH WATCH 魔女守護者 8", "title_zh": "WITCH WATCH 魔女守护者 8", "cover_id": 2151347, "first_chap_id": 99814, "cover_url": "https://i.motiezw.com/cover/1188/2151347.jpg"}, {"title_hant": "WITCH WATCH 魔女守護者 9", "title_zh": "WITCH WATCH 魔女守护者 9", "cover_id": 2151533, "first_chap_id": 99824, "cover_url": "https://i.motiezw.com/cover/1188/2151533.jpg"}, {"title_hant": "WITCH WATCH 魔女守護者 10", "title_zh": "WITCH WATCH 魔女守护者 10", "cover_id": 2151726, "first_chap_id": 99834, "cover_url": "https://i.motiezw.com/cover/1188/2151726.jpg"}, {"title_hant": "WITCH WATCH 魔女守護者 11", "title_zh": "WITCH WATCH 魔女守护者 11", "cover_id": 2151917, "first_chap_id": 99844, "cover_url": "https://i.motiezw.com/cover/1188/2151917.jpg"}, {"title_hant": "WITCH WATCH 魔女守護者 12", "title_zh": "WITCH WATCH 魔女守护者 12", "cover_id": 2152708, "first_chap_id": 99876, "cover_url": "https://i.motiezw.com/cover/1188/2152708.jpg"}], "chapters": [{"cid": "99745", "title": "1 魔N歸來", "title_zh": "1 魔N归来"}, {"cid": "99746", "title": "2 奇妙的兩人", "title_zh": "2 奇妙的两人"}, {"cid": "99747", "title": "3 大型菜鳥", "title_zh": "3 大型菜鸟"}, {"cid": "99748", "title": "4 去家庭餐廳吧!", "title_zh": "4 去家庭餐厅吧!"}, {"cid": "99749", "title": "5 飛行教室", "title_zh": "5 飞行教室"}, {"cid": "99750", "title": "6 春天的半透明搭配", "title_zh": "6 春天的半透明搭配"}, {"cid": "99751", "title": "7 給魔N的宅急便", "title_zh": "7 给魔N的宅急便"}, {"cid": "99753", "title": "8 迷路小狗與雨的節奏", "title_zh": "8 迷路小狗与雨的节奏"}, {"cid": "99754", "title": "9 天狗一風祭監志", "title_zh": "9 天狗一风祭监志"}, {"cid": "99755", "title": "10 飛天玄魔", "title_zh": "10 飞天玄魔"}, {"cid": "99756", "title": "11 友Q的勾肩搭背", "title_zh": "11 友Q的勾肩搭背"}, {"cid": "99757", "title": "12 在走廊讓長髮隨風飄舞", "title_zh": "12 在走廊让长发随风飘舞"}, {"cid": "99758", "title": "13 我的學生就是我喜歡的繪師", "title_zh": "13 我的学生就是我喜欢的绘师"}, {"cid": "99759", "title": "14 今天肚子很沉重", "title_zh": "14 今天肚子很沉重"}, {"cid": "99760", "title": "15 貓咪來挖角", "title_zh": "15 猫咪来挖角"}, {"cid": "99761", "title": "16 在結緣樹下 前篇", "title_zh": "16 在结缘树下 前篇"}, {"cid": "99762", "title": "17 在結縁櫢下 後篇", "title_zh": "17 在结縁櫢下 后篇"}, {"cid": "99764", "title": "18 監志的打工日記 ~英雄秀~", "title_zh": "18 监志的打工日记 ~英雄秀~"}, {"cid": "99765", "title": "19 給伽羅", "title_zh": "19 给伽罗"}, {"cid": "99766", "title": "20 Kan & Nico CHANNEL", "title_zh": "20 Kan & Nico CHANNEL"}, {"cid": "99767", "title": "21 路過小貓的泡泡浴時刻", "title_zh": "21 路过小猫的泡泡浴时刻"}, {"cid": "99769", "title": "23 狗與雨滴-②", "title_zh": "23 狗与雨滴-②"}, {"cid": "99770", "title": "24 狗與雨滴-③", "title_zh": "24 狗与雨滴-③"}, {"cid": "99771", "title": "25 狗與雨滴-④", "title_zh": "25 狗与雨滴-④"}, {"cid": "99772", "title": "26 狗與雨滴-⑤", "title_zh": "26 狗与雨滴-⑤"}, {"cid": "99774", "title": "27 狗與雨滴-⑥", "title_zh": "27 狗与雨滴-⑥"}, {"cid": "99775", "title": "28 狗與雨滴-⑦", "title_zh": "28 狗与雨滴-⑦"}, {"cid": "99776", "title": "29 狗與雨滴-⑧", "title_zh": "29 狗与雨滴-⑧"}, {"cid": "99777", "title": "30 狼人-真神圭護", "title_zh": "30 狼人-真神圭护"}, {"cid": "99778", "title": "31 解放怦然心動", "title_zh": "31 解放怦然心动"}, {"cid": "99779", "title": "32 茶之心是 輕而易舉", "title_zh": "32 茶之心是 轻而易举"}, {"cid": "99780", "title": "33 善人之虎、傲慢之狼", "title_zh": "33 善人之虎、傲慢之狼"}, {"cid": "99781", "title": "34 喜歡的繪師的日誌", "title_zh": "34 喜欢的绘师的日志"}, {"cid": "99782", "title": "35 新朋友", "title_zh": "35 新朋友"}, {"cid": "99784", "title": "36 DATE WITH THE KNIGHT", "title_zh": "36 DATE WITH THE KNIGHT"}, {"cid": "99785", "title": "37 監志的打工日記 ~家庭代工~", "title_zh": "37 监志的打工日记 ~家庭代工~"}, {"cid": "99786", "title": "38 老套學生會", "title_zh": "38 老套学生会"}, {"cid": "99787", "title": "39 學生會執行部的介紹影片", "title_zh": "39 学生会执行部的介绍影片"}, {"cid": "99788", "title": "40 守仁老師,拜託你", "title_zh": "40 守仁老师,拜托你"}, {"cid": "99789", "title": "41 見到妳很開心", "title_zh": "41 见到妳很开心"}, {"cid": "99790", "title": "42 夏之魔物-①", "title_zh": "42 夏之魔物-①"}, {"cid": "99791", "title": "43 夏之魔物-②", "title_zh": "43 夏之魔物-②"}, {"cid": "99792", "title": "44 夏之魔物-③", "title_zh": "44 夏之魔物-③"}, {"cid": "99794", "title": "45 吸血鬼一霧生見晴", "title_zh": "45 吸血鬼一雾生见晴"}, {"cid": "99795", "title": "46 Box Body Boys", "title_zh": "46 Box Body Boys"}, {"cid": "99796", "title": "47 創作之火", "title_zh": "47 创作之火"}, {"cid": "99797", "title": "49 沒有傘", "title_zh": "49 没有伞"}, {"cid": "99798", "title": "50 MOI的牛仔褲之道", "title_zh": "50 MOI的牛仔裤之道"}, {"cid": "99799", "title": "51 和初出茅廬的魔N", "title_zh": "51 和初出茅庐的魔N"}, {"cid": "99800", "title": "52 使魔們", "title_zh": "52 使魔们"}, {"cid": "99801", "title": "53 宇宙深淵的黑暗", "title_zh": "53 宇宙深渊的黑暗"}, {"cid": "99802", "title": "48 混亂的海市蜃樓 第119話 討伐FUZZY-4", "title_zh": "48 混乱的海市蜃楼 第119话 讨伐FUZZY-4"}, {"cid": "99804", "title": "54 輕鬆魅惑你", "title_zh": "54 轻松魅惑你"}, {"cid": "99805", "title": "55 被迫挑戰死亡遊戲,卻是一個爛遊戲", "title_zh": "55 被迫挑战死亡游戏,却是一个烂游戏"}, {"cid": "99806", "title": "56 一日學生會長", "title_zh": "56 一日学生会长"}, {"cid": "99807", "title": "57 監志的打工日記~咖啡廳~", "title_zh": "57 监志的打工日记~咖啡厅~"}, {"cid": "99808", "title": "58 迷惘之狼與路過小貓 前篇", "title_zh": "58 迷惘之狼与路过小猫 前篇"}, {"cid": "99809", "title": "59 迷惘之狼與路過小貓 後篇", "title_zh": "59 迷惘之狼与路过小猫 后篇"}, {"cid": "99810", "title": "60 Scramble", "title_zh": "60 Scramble"}, {"cid": "99811", "title": "61 朋友的信 前篇", "title_zh": "61 朋友的信 前篇"}]};
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>