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-1074", "mangaid": "1074", "zh_title": "小镇有你", "hant_title": "小鎮有你", "en_title": "小镇有你 (Bilimanga #1074)", "author": "濑尾公治", "tags": ["校园", "日常", "恋爱", "欢乐", "后宫", "校园青春", "日本漫画", "漫画"], "zh_desc": "枝叶柚希为了就读高中,特地从东京搬到乡下生活。而且她寄住的并不是亲戚的家,而是素昧平生的桐岛青大的家!怕生的青大非常排斥让不认识的人住进家里,但是柚希一来到家里就融入青大的家中。可是因为柚希不会骑脚踏车的关系,必须由青大骑脚踏车载柚希一起去上学。青大非常害怕大家误会他与柚希的关系,而且去学校还会碰到他的心上人.七海…\n\n📚 作品信息:作者 濑尾公治 · 评分 10 · 共收录 28 卷 / 286 话章节目录与高清彩页/条漫预览。", "hant_desc": "枝葉柚希為了就讀高中,特地從東京搬到鄉下生活。而且她寄住的並不是親戚的家,而是素昧平生的桐島青大的家!怕生的青大非常排斥讓不認識的人住進家裡,但是柚希一來到家裡就融入青大的家中。可是因為柚希不會騎腳踏車的關係,必須由青大騎腳踏車載柚希一起去上學。青大非常害怕大家誤會他與柚希的關係,而且去學校還會碰到他的心上人.七海…\n\n📚 作品資訊:作者 瀨尾公治 · 評分 10 · 共收錄 28 卷 / 286 話章節目錄與高清彩頁/條漫預覽。", "en_desc": "Popular serialized manga '小镇有你' (小鎮有你) by 濑尾公治. Includes 28 volumes and 286 chapters with full online vertical/page-flip web reader.", "pages": ["https://media.huangguodrama.ai/motion/comics/bilimanga-1074/page_01.jpg", "https://media.huangguodrama.ai/motion/comics/bilimanga-1074/page_02.jpg", "https://media.huangguodrama.ai/motion/comics/bilimanga-1074/page_03.jpg", "https://media.huangguodrama.ai/motion/comics/bilimanga-1074/page_04.jpg", "https://media.huangguodrama.ai/motion/comics/bilimanga-1074/page_05.jpg", "https://media.huangguodrama.ai/motion/comics/bilimanga-1074/page_06.jpg"], "volumes": [{"title_hant": "小鎮有你 1", "title_zh": "小镇有你 1", "cover_id": 1911561, "first_chap_id": 88911, "cover_url": "https://i.motiezw.com/cover/1074/1911561.jpg"}, {"title_hant": "小鎮有你 2", "title_zh": "小镇有你 2", "cover_id": 1911763, "first_chap_id": 88921, "cover_url": "https://i.motiezw.com/cover/1074/1911763.jpg"}, {"title_hant": "小鎮有你 3", "title_zh": "小镇有你 3", "cover_id": 1913508, "first_chap_id": 89017, "cover_url": "https://i.motiezw.com/cover/1074/1913508.jpg"}, {"title_hant": "小鎮有你 4", "title_zh": "小镇有你 4", "cover_id": 1913709, "first_chap_id": 89030, "cover_url": "https://i.motiezw.com/cover/1074/1913709.jpg"}, {"title_hant": "小鎮有你 5", "title_zh": "小镇有你 5", "cover_id": 1914602, "first_chap_id": 89084, "cover_url": "https://i.motiezw.com/cover/1074/1914602.jpg"}, {"title_hant": "小鎮有你 6", "title_zh": "小镇有你 6", "cover_id": 1914796, "first_chap_id": 89096, "cover_url": "https://i.motiezw.com/cover/1074/1914796.jpg"}, {"title_hant": "小鎮有你 7", "title_zh": "小镇有你 7", "cover_id": 1914999, "first_chap_id": 89107, "cover_url": "https://i.motiezw.com/cover/1074/1914999.jpg"}, {"title_hant": "小鎮有你 8", "title_zh": "小镇有你 8", "cover_id": 1915194, "first_chap_id": 89118, "cover_url": "https://i.motiezw.com/cover/1074/1915194.jpg"}, {"title_hant": "小鎮有你 9", "title_zh": "小镇有你 9", "cover_id": 1915387, "first_chap_id": 89130, "cover_url": "https://i.motiezw.com/cover/1074/1915387.jpg"}, {"title_hant": "小鎮有你 10", "title_zh": "小镇有你 10", "cover_id": 1915586, "first_chap_id": 89142, "cover_url": "https://i.motiezw.com/cover/1074/1915586.jpg"}, {"title_hant": "小鎮有你 11", "title_zh": "小镇有你 11", "cover_id": 1915781, "first_chap_id": 89154, "cover_url": "https://i.motiezw.com/cover/1074/1915781.jpg"}, {"title_hant": "小鎮有你 12", "title_zh": "小镇有你 12", "cover_id": 1915977, "first_chap_id": 89166, "cover_url": "https://i.motiezw.com/cover/1074/1915977.jpg"}], "chapters": [{"cid": "88911", "title": "#1 櫻花綻放時", "title_zh": "#1 樱花绽放时"}, {"cid": "88912", "title": "#2 真的沒穿", "title_zh": "#2 真的没穿"}, {"cid": "88913", "title": "#3 在便利商店等我", "title_zh": "#3 在便利商店等我"}, {"cid": "88914", "title": "#4 喜歡上我就好啦", "title_zh": "#4 喜欢上我就好啦"}, {"cid": "88915", "title": "#5 混浴是開玩笑的", "title_zh": "#5 混浴是开玩笑的"}, {"cid": "88916", "title": "#6 突然昏倒", "title_zh": "#6 突然昏倒"}, {"cid": "88917", "title": "#7 青大不在身邊的話", "title_zh": "#7 青大不在身边的话"}, {"cid": "88918", "title": "#8 兩人的關係", "title_zh": "#8 两人的关系"}, {"cid": "88919", "title": "附錄", "title_zh": "附录"}, {"cid": "88921", "title": "#9 天大的誤會", "title_zh": "#9 天大的误会"}, {"cid": "88922", "title": "#10 宣戰", "title_zh": "#10 宣战"}, {"cid": "88923", "title": "#11 小月的戀Q", "title_zh": "#11 小月的恋Q"}, {"cid": "88924", "title": "#12 雙重約會開始", "title_zh": "#12 双重约会开始"}, {"cid": "88925", "title": "#13 放學時間", "title_zh": "#13 放学时间"}, {"cid": "88926", "title": "#14 跟誰獨處?", "title_zh": "#14 跟谁独处?"}, {"cid": "88927", "title": "#15 停不下來", "title_zh": "#15 停不下来"}, {"cid": "88928", "title": "#16 逃避是不對的", "title_zh": "#16 逃避是不对的"}, {"cid": "88929", "title": "#17 真正的想法", "title_zh": "#17 真正的想法"}, {"cid": "88930", "title": "#18 不打算跟你交往", "title_zh": "#18 不打算跟你交往"}, {"cid": "88931", "title": "附錄", "title_zh": "附录"}, {"cid": "89017", "title": "#19 曾經有你的小鎮", "title_zh": "#19 曾经有你的小镇"}, {"cid": "89019", "title": "#21 簡訊的回答", "title_zh": "#21 简讯的回答"}, {"cid": "89020", "title": "#22 個悻灰暗的柚希", "title_zh": "#22 个悻灰暗的柚希"}, {"cid": "89021", "title": "#23 夏季祭典", "title_zh": "#23 夏季祭典"}, {"cid": "89022", "title": "#24 希望你能來", "title_zh": "#24 希望你能来"}, {"cid": "89023", "title": "#25 獨自一人默默的等待", "title_zh": "#25 独自一人默默的等待"}, {"cid": "89024", "title": "#26 在姊姊的房間裡", "title_zh": "#26 在姊姊的房间里"}, {"cid": "89025", "title": "#27 小懍的真面目", "title_zh": "#27 小懔的真面目"}, {"cid": "89026", "title": "#28 冷笑與激昂", "title_zh": "#28 冷笑与激昂"}, {"cid": "89027", "title": "特別篇 池中有水神", "title_zh": "特别篇 池中有水神"}, {"cid": "89028", "title": "附錄", "title_zh": "附录"}, {"cid": "89030", "title": "#29 所謂的家人", "title_zh": "#29 所谓的家人"}, {"cid": "89031", "title": "#30 我要回家", "title_zh": "#30 我要回家"}, {"cid": "89032", "title": "#31 枝葉姊妹", "title_zh": "#31 枝叶姊妹"}, {"cid": "89033", "title": "#32 每個人的結業典禮", "title_zh": "#32 每个人的结业典礼"}, {"cid": "89034", "title": "#33 夏天、海邊、兩人獨處。", "title_zh": "#33 夏天、海边、两人独处。"}, {"cid": "89035", "title": "#34 小懍、再次出現。", "title_zh": "#34 小懔、再次出现。"}, {"cid": "89036", "title": "#35 我會聲援你", "title_zh": "#35 我会声援你"}, {"cid": "89037", "title": "#36 驚喜×2", "title_zh": "#36 惊喜×2"}, {"cid": "89038", "title": "#37 當做祕密的事Q", "title_zh": "#37 当做秘密的事Q"}, {"cid": "89039", "title": "#38 直接說出來。", "title_zh": "#38 直接说出来。"}, {"cid": "89040", "title": "附錄", "title_zh": "附录"}, {"cid": "89084", "title": "#39 因為是最後一次", "title_zh": "#39 因为是最后一次"}, {"cid": "89086", "title": "#41 哭泣的夜晚已過", "title_zh": "#41 哭泣的夜晚已过"}, {"cid": "89087", "title": "#42 Bitter&Sweet", "title_zh": "#42 Bitter&Sweet"}, {"cid": "89088", "title": "#43 小鎮有鰻魚", "title_zh": "#43 小镇有鳗鱼"}, {"cid": "89089", "title": "#44 志願等等的事Q", "title_zh": "#44 志愿等等的事Q"}, {"cid": "89090", "title": "#45 文化祭即將來臨", "title_zh": "#45 文化祭即将来临"}, {"cid": "89091", "title": "#46 我喜歡枝葉同學", "title_zh": "#46 我喜欢枝叶同学"}, {"cid": "89092", "title": "#47 尋找蘋果農家", "title_zh": "#47 寻找苹果农家"}, {"cid": "89093", "title": "#48 史上最大的確認", "title_zh": "#48 史上最大的确认"}, {"cid": "89094", "title": "附錄", "title_zh": "附录"}, {"cid": "89096", "title": "#49 說不出口的話", "title_zh": "#49 说不出口的话"}, {"cid": "89097", "title": "#50 為了誰", "title_zh": "#50 为了谁"}, {"cid": "89098", "title": "#51 久違的回家之路", "title_zh": "#51 久违的回家之路"}, {"cid": "89099", "title": "#52 菊川的眼鏡", "title_zh": "#52 菊川的眼镜"}, {"cid": "89100", "title": "#53 點燃", "title_zh": "#53 点燃"}, {"cid": "89101", "title": "#54 起火燃燒", "title_zh": "#54 起火燃烧"}, {"cid": "89102", "title": "#55 後夜祭的邀約", "title_zh": "#55 后夜祭的邀约"}, {"cid": "89103", "title": "#56 後夜祭", "title_zh": "#56 后夜祭"}]};
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>