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-219", "mangaid": "219", "zh_title": "伪恋", "hant_title": "偽戀", "en_title": "伪恋 (Bilimanga #219)", "author": "古味直志", "tags": ["校园", "日常", "恋爱", "欢乐", "校园青春", "日本漫画", "漫画", "日漫"], "zh_desc": "虽然看起来平凡无奇,但其实是流氓第二代的高中生.一条乐,遇上了转学到班上的美国黑帮大小姐.桐崎千棘。个性合不来的两人,总是天天吵架。但此时,双方的父亲,却要他们为了使双方家族能和平相处,假装成一对恋人?虽然乐其实喜欢同班同学.小野寺,但迫于现实无奈的两人,还是心不甘情不愿地开始了咬牙切齿、动手动脚的「甜蜜」生活…\n\n📚 作品信息:作者 古味直志 · 评分 9.6 · 共收录 26 卷 / 228 话章节目录与高清彩页/条漫预览。", "hant_desc": "雖然看起來平凡無奇,但其實是流氓第二代的高中生.一条樂,遇上了轉學到班上的美國黑幫大小姐.桐崎千棘。個性合不來的兩人,總是天天吵架。但此時,雙方的父親,卻要他們為了使雙方家族能和平相處,假裝成一對戀人?雖然樂其實喜歡同班同學.小野寺,但迫於現實無奈的兩人,還是心不甘情不願地開始了咬牙切齒、動手動腳的「甜蜜」生活…\n\n📚 作品資訊:作者 古味直志 · 評分 9.6 · 共收錄 26 卷 / 228 話章節目錄與高清彩頁/條漫預覽。", "en_desc": "Popular serialized manga '伪恋' (偽戀) by 古味直志. Includes 26 volumes and 228 chapters with full online vertical/page-flip web reader.", "pages": ["https://media.huangguodrama.ai/motion/comics/bilimanga-219/page_01.jpg", "https://media.huangguodrama.ai/motion/comics/bilimanga-219/page_02.jpg", "https://media.huangguodrama.ai/motion/comics/bilimanga-219/page_03.jpg", "https://media.huangguodrama.ai/motion/comics/bilimanga-219/page_04.jpg", "https://media.huangguodrama.ai/motion/comics/bilimanga-219/page_05.jpg", "https://media.huangguodrama.ai/motion/comics/bilimanga-219/page_06.jpg"], "volumes": [{"title_hant": "偽戀 1", "title_zh": "伪恋 1", "cover_id": 409300, "first_chap_id": 18946, "cover_url": "https://i.motiezw.com/cover/219/409300.jpg"}, {"title_hant": "偽戀 2", "title_zh": "伪恋 2", "cover_id": 409494, "first_chap_id": 18954, "cover_url": "https://i.motiezw.com/cover/219/409494.jpg"}, {"title_hant": "偽戀 3", "title_zh": "伪恋 3", "cover_id": 409687, "first_chap_id": 18964, "cover_url": "https://i.motiezw.com/cover/219/409687.jpg"}, {"title_hant": "偽戀 4", "title_zh": "伪恋 4", "cover_id": 409882, "first_chap_id": 18974, "cover_url": "https://i.motiezw.com/cover/219/409882.jpg"}, {"title_hant": "偽戀 5", "title_zh": "伪恋 5", "cover_id": 410077, "first_chap_id": 18984, "cover_url": "https://i.motiezw.com/cover/219/410077.jpg"}, {"title_hant": "偽戀 6", "title_zh": "伪恋 6", "cover_id": 410288, "first_chap_id": 18996, "cover_url": "https://i.motiezw.com/cover/219/410288.jpg"}, {"title_hant": "偽戀 7", "title_zh": "伪恋 7", "cover_id": 410481, "first_chap_id": 19006, "cover_url": "https://i.motiezw.com/cover/219/410481.jpg"}, {"title_hant": "偽戀 8", "title_zh": "伪恋 8", "cover_id": 410676, "first_chap_id": 19016, "cover_url": "https://i.motiezw.com/cover/219/410676.jpg"}, {"title_hant": "偽戀 9", "title_zh": "伪恋 9", "cover_id": 410871, "first_chap_id": 19026, "cover_url": "https://i.motiezw.com/cover/219/410871.jpg"}, {"title_hant": "偽戀 10", "title_zh": "伪恋 10", "cover_id": 411067, "first_chap_id": 19036, "cover_url": "https://i.motiezw.com/cover/219/411067.jpg"}, {"title_hant": "偽戀 11", "title_zh": "伪恋 11", "cover_id": 411536, "first_chap_id": 19060, "cover_url": "https://i.motiezw.com/cover/219/411536.jpg"}, {"title_hant": "偽戀 12", "title_zh": "伪恋 12", "cover_id": 411729, "first_chap_id": 19070, "cover_url": "https://i.motiezw.com/cover/219/411729.jpg"}], "chapters": [{"cid": "18946", "title": "第1話 約定", "title_zh": "第1话 约定"}, {"cid": "18947", "title": "第2話 發問", "title_zh": "第2话 发问"}, {"cid": "18948", "title": "第3話 第一次", "title_zh": "第3话 第一次"}, {"cid": "18949", "title": "第4話 不期而遇", "title_zh": "第4话 不期而遇"}, {"cid": "18950", "title": "第5話 一波多折", "title_zh": "第5话 一波多折"}, {"cid": "18951", "title": "第6話 相似的兩人", "title_zh": "第6话 相似的两人"}, {"cid": "18952", "title": "第7話 親手烹飪", "title_zh": "第7话 亲手烹饪"}, {"cid": "18954", "title": "第8話 訪問", "title_zh": "第8话 访问"}, {"cid": "18955", "title": "第9話 接近", "title_zh": "第9话 接近"}, {"cid": "18956", "title": "第10話 游泳", "title_zh": "第10话 游泳"}, {"cid": "18957", "title": "第11話 鎖洞", "title_zh": "第11话 锁洞"}, {"cid": "18958", "title": "第12話 爆料", "title_zh": "第12话 爆料"}, {"cid": "18959", "title": "第13話 Zyiacya in love", "title_zh": "第13话 Zyiacya in love"}, {"cid": "18960", "title": "第14話 借與還", "title_zh": "第14话 借与还"}, {"cid": "18961", "title": "第15話 對手", "title_zh": "第15话 对手"}, {"cid": "18962", "title": "第16話 決鬥", "title_zh": "第16话 决斗"}, {"cid": "18964", "title": "第17話 可愛", "title_zh": "第17话 可爱"}, {"cid": "18965", "title": "第18話 幸福", "title_zh": "第18话 幸福"}, {"cid": "18966", "title": "第19話 探病", "title_zh": "第19话 探病"}, {"cid": "18967", "title": "第20話 遲鈍", "title_zh": "第20话 迟钝"}, {"cid": "18968", "title": "第21話 疤痕", "title_zh": "第21话 疤痕"}, {"cid": "18970", "title": "第23話 N湯", "title_zh": "第23话 N汤"}, {"cid": "18971", "title": "第24話 抽籤", "title_zh": "第24话 抽签"}, {"cid": "18972", "title": "第25話 稱呼", "title_zh": "第25话 称呼"}, {"cid": "18974", "title": "第26話 Q書", "title_zh": "第26话 Q书"}, {"cid": "18975", "title": "第27話 順道經過", "title_zh": "第27话 顺道经过"}, {"cid": "18976", "title": "第28話 慶祝", "title_zh": "第28话 庆祝"}, {"cid": "18977", "title": "第29話 確認", "title_zh": "第29话 确认"}, {"cid": "18978", "title": "第30話 像片", "title_zh": "第30话 像片"}, {"cid": "18979", "title": "第31話 放學後", "title_zh": "第31话 放学后"}, {"cid": "18980", "title": "第32話 一起撐傘", "title_zh": "第32话 一起撑伞"}, {"cid": "18981", "title": "第33話 爭風吃醋", "title_zh": "第33话 争风吃醋"}, {"cid": "18982", "title": "第34話 跟蹤", "title_zh": "第34话 跟踪"}, {"cid": "18984", "title": "第35話 爆發", "title_zh": "第35话 爆发"}, {"cid": "18985", "title": "第36話 三支鑰匙", "title_zh": "第36话 三支钥匙"}, {"cid": "18986", "title": "第37話 拜會致意", "title_zh": "第37话 拜会致意"}, {"cid": "18987", "title": "第38話 工作", "title_zh": "第38话 工作"}, {"cid": "18988", "title": "第39話 台風", "title_zh": "第39话 台风"}, {"cid": "18989", "title": "第40話 說謊", "title_zh": "第40话 说谎"}, {"cid": "18990", "title": "第41話 流浪狗", "title_zh": "第41话 流浪狗"}, {"cid": "18991", "title": "第42話 廟會", "title_zh": "第42话 庙会"}, {"cid": "18992", "title": "第43話 神明保佑", "title_zh": "第43话 神明保佑"}, {"cid": "18993", "title": "第44話 在海邊", "title_zh": "第44话 在海边"}, {"cid": "18996", "title": "第45話 悶悶不樂", "title_zh": "第45话 闷闷不乐"}, {"cid": "18997", "title": "第46話 話劇", "title_zh": "第46话 话剧"}, {"cid": "18998", "title": "第47話 一起", "title_zh": "第47话 一起"}, {"cid": "18999", "title": "第48話 開演", "title_zh": "第48话 开演"}, {"cid": "19000", "title": "第49話 正式演出", "title_zh": "第49话 正式演出"}, {"cid": "19001", "title": "第50話 主角", "title_zh": "第50话 主角"}, {"cid": "19002", "title": "第51話 從此以後", "title_zh": "第51话 从此以后"}, {"cid": "19003", "title": "第52話 測量", "title_zh": "第52话 测量"}, {"cid": "19004", "title": "第53話 占卜", "title_zh": "第53话 占卜"}, {"cid": "19006", "title": "第54話 因緣", "title_zh": "第54话 因缘"}, {"cid": "19007", "title": "第55話 比賽", "title_zh": "第55话 比赛"}, {"cid": "19008", "title": "第56話 教教我", "title_zh": "第56话 教教我"}, {"cid": "19009", "title": "第57話 快點發現", "title_zh": "第57话 快点发现"}, {"cid": "19010", "title": "第58話 遺失", "title_zh": "第58话 遗失"}, {"cid": "19011", "title": "第59話 久違", "title_zh": "第59话 久违"}, {"cid": "19012", "title": "第60話 需要", "title_zh": "第60话 需要"}, {"cid": "19013", "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>