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-679", "mangaid": "679", "zh_title": "结缘甘神神社", "hant_title": "結緣甘神神社", "en_title": "结缘甘神神社 (Bilimanga #679)", "author": "内藤Marcey", "tags": ["恋爱", "后宫", "青梅竹马", "日常", "校园", "欢乐", "宅系", "爱情浪漫"], "zh_desc": "在儿童养护设施长大,以考上京都大学医学系为目标的高中生:上终瓜生被甘神神社的宫司收留,来到神社借住。本来只是想要一个能念书的环境,没想到借住的条件竟然是「入赘继承神社」!而结婚的候补对象就是宫司的孙女,神社的美女巫女三姊妹!早熟的朝姬、态度尖锐的夕奈、冒失单纯的夜重,与个性迥异的三姊妹相处,让瓜生的生活变得波澜万丈…\n\n📚 作品信息:作者 内藤Marcey · 评分 10 · 共收录 19 卷 / 157 话章节目录与高清彩页/条漫预览。", "hant_desc": "在兒童養護設施長大,以考上京都大學醫學系為目標的高中生:上終瓜生被甘神神社的宮司收留,來到神社借住。本來只是想要一個能唸書的環境,沒想到借住的條件竟然是「入贅繼承神社」!而結婚的候補對象就是宮司的孫女,神社的美女巫女三姊妹!早熟的朝姬、態度尖銳的夕奈、冒失單純的夜重,與個性迥異的三姊妹相處,讓瓜生的生活變得波瀾萬丈…\n\n📚 作品資訊:作者 内藤Marcey · 評分 10 · 共收錄 19 卷 / 157 話章節目錄與高清彩頁/條漫預覽。", "en_desc": "Popular serialized manga '结缘甘神神社' (結緣甘神神社) by 内藤Marcey. Includes 19 volumes and 157 chapters with full online vertical/page-flip web reader.", "pages": ["https://media.huangguodrama.ai/motion/comics/bilimanga-679/page_01.jpg", "https://media.huangguodrama.ai/motion/comics/bilimanga-679/page_02.jpg", "https://media.huangguodrama.ai/motion/comics/bilimanga-679/page_03.jpg", "https://media.huangguodrama.ai/motion/comics/bilimanga-679/page_04.jpg", "https://media.huangguodrama.ai/motion/comics/bilimanga-679/page_05.jpg", "https://media.huangguodrama.ai/motion/comics/bilimanga-679/page_06.jpg"], "volumes": [{"title_hant": "結緣甘神神社 1", "title_zh": "结缘甘神神社 1", "cover_id": 1132802, "first_chap_id": 51613, "cover_url": "https://i.motiezw.com/cover/679/1132802.jpg"}, {"title_hant": "結緣甘神神社 2", "title_zh": "结缘甘神神社 2", "cover_id": 1132988, "first_chap_id": 51619, "cover_url": "https://i.motiezw.com/cover/679/1132988.jpg"}, {"title_hant": "結緣甘神神社 3", "title_zh": "结缘甘神神社 3", "cover_id": 1133176, "first_chap_id": 51629, "cover_url": "https://i.motiezw.com/cover/679/1133176.jpg"}, {"title_hant": "結緣甘神神社 4", "title_zh": "结缘甘神神社 4", "cover_id": 1133368, "first_chap_id": 51639, "cover_url": "https://i.motiezw.com/cover/679/1133368.jpg"}, {"title_hant": "結緣甘神神社 5", "title_zh": "结缘甘神神社 5", "cover_id": 1133551, "first_chap_id": 51649, "cover_url": "https://i.motiezw.com/cover/679/1133551.jpg"}, {"title_hant": "結緣甘神神社 6", "title_zh": "结缘甘神神社 6", "cover_id": 1193730, "first_chap_id": 51694, "cover_url": "https://i.motiezw.com/cover/679/1193730.jpg"}, {"title_hant": "結緣甘神神社 7", "title_zh": "结缘甘神神社 7", "cover_id": 1193925, "first_chap_id": 51704, "cover_url": "https://i.motiezw.com/cover/679/1193925.jpg"}, {"title_hant": "結緣甘神神社 8", "title_zh": "结缘甘神神社 8", "cover_id": 1134994, "first_chap_id": 51714, "cover_url": "https://i.motiezw.com/cover/679/1134994.jpg"}, {"title_hant": "結緣甘神神社 9", "title_zh": "结缘甘神神社 9", "cover_id": 1135179, "first_chap_id": 51724, "cover_url": "https://i.motiezw.com/cover/679/1135179.jpg"}, {"title_hant": "結緣甘神神社 10", "title_zh": "结缘甘神神社 10", "cover_id": 1135364, "first_chap_id": 51734, "cover_url": "https://i.motiezw.com/cover/679/1135364.jpg"}, {"title_hant": "結緣甘神神社 11", "title_zh": "结缘甘神神社 11", "cover_id": 1135550, "first_chap_id": 51745, "cover_url": "https://i.motiezw.com/cover/679/1135550.jpg"}, {"title_hant": "結緣甘神神社 12", "title_zh": "结缘甘神神社 12", "cover_id": 1135736, "first_chap_id": 51754, "cover_url": "https://i.motiezw.com/cover/679/1135736.jpg"}], "chapters": [{"cid": "51613", "title": "第一話 奇蹟的開始", "title_zh": "第一话 奇迹的开始"}, {"cid": "51614", "title": "第二話 白晝與鶴", "title_zh": "第二话 白昼与鹤"}, {"cid": "51615", "title": "第三話 朝的鞋帶", "title_zh": "第三话 朝的鞋带"}, {"cid": "51616", "title": "第四話 夕陽下的貓", "title_zh": "第四话 夕阳下的猫"}, {"cid": "51617", "title": "第五話 夜與狐狸", "title_zh": "第五话 夜与狐狸"}, {"cid": "51619", "title": "第六話 甘神神社例大祭 其一", "title_zh": "第六话 甘神神社例大祭 其一"}, {"cid": "51620", "title": "第七話 甘神神社例大祭 其二", "title_zh": "第七话 甘神神社例大祭 其二"}, {"cid": "51621", "title": "第八話 甘神神社例大祭 其三", "title_zh": "第八话 甘神神社例大祭 其三"}, {"cid": "51622", "title": "第九話 甘神神社例大祭 其四", "title_zh": "第九话 甘神神社例大祭 其四"}, {"cid": "51623", "title": "第十話 甘神神社例大祭 其五", "title_zh": "第十话 甘神神社例大祭 其五"}, {"cid": "51624", "title": "第十一話 甘神神社例大祭 其終", "title_zh": "第十一话 甘神神社例大祭 其终"}, {"cid": "51625", "title": "第十二話 朝馳向夜", "title_zh": "第十二话 朝驰向夜"}, {"cid": "51626", "title": "第十三話 薄暮的贈禮", "title_zh": "第十三话 薄暮的赠礼"}, {"cid": "51627", "title": "第十四話 白晝至夕陽西下", "title_zh": "第十四话 白昼至夕阳西下"}, {"cid": "51629", "title": "第十五話 夢與月與夢 其一", "title_zh": "第十五话 梦与月与梦 其一"}, {"cid": "51630", "title": "第十六話 夢與月與夢 其二", "title_zh": "第十六话 梦与月与梦 其二"}, {"cid": "51631", "title": "第十七話 夢與月與夢 其三", "title_zh": "第十七话 梦与月与梦 其三"}, {"cid": "51632", "title": "第十八話 夢與月與夢 其四", "title_zh": "第十八话 梦与月与梦 其四"}, {"cid": "51633", "title": "第十九話 夢與月與夢 其五", "title_zh": "第十九话 梦与月与梦 其五"}, {"cid": "51634", "title": "第二十話 夢與月與夢 其六", "title_zh": "第二十话 梦与月与梦 其六"}, {"cid": "51635", "title": "第二十一話 夢與月與夢 其七", "title_zh": "第二十一话 梦与月与梦 其七"}, {"cid": "51637", "title": "第二十三話 夢與月與夢 其九", "title_zh": "第二十三话 梦与月与梦 其九"}, {"cid": "51639", "title": "第二十四話 夢與月與夢 其過往", "title_zh": "第二十四话 梦与月与梦 其过往"}, {"cid": "51640", "title": "第二十五話 夢與月與夢 其未來", "title_zh": "第二十五话 梦与月与梦 其未来"}, {"cid": "51641", "title": "第二十六話 夢與月與夢 其現今", "title_zh": "第二十六话 梦与月与梦 其现今"}, {"cid": "51642", "title": "第二十七話 換上新衣,心態轉換", "title_zh": "第二十七话 换上新衣,心态转换"}, {"cid": "51643", "title": "第二十八話一點綠和便當", "title_zh": "第二十八话一点绿和便当"}, {"cid": "51644", "title": "第二十九話 沉醉於夜", "title_zh": "第二十九话 沉醉于夜"}, {"cid": "51645", "title": "第三十話 朝的守望會", "title_zh": "第三十话 朝的守望会"}, {"cid": "51646", "title": "第三十一話 籤文的惡作劇", "title_zh": "第三十一话 签文的恶作剧"}, {"cid": "51647", "title": "第三十二話 迷路孩子的名字", "title_zh": "第三十二话 迷路孩子的名字"}, {"cid": "51649", "title": "第三十三話 徹夜不眠的真相 序", "title_zh": "第三十三话 彻夜不眠的真相 序"}, {"cid": "51650", "title": "第三十四話 徹夜不眠的真相 憧", "title_zh": "第三十四话 彻夜不眠的真相 憧"}, {"cid": "51651", "title": "第三十五話 徹夜不眠的真相 放", "title_zh": "第三十五话 彻夜不眠的真相 放"}, {"cid": "51652", "title": "第三十六話 徹夜不眠的真相 爭", "title_zh": "第三十六话 彻夜不眠的真相 争"}, {"cid": "51653", "title": "第三十七話 徹夜不眠的真相 轉", "title_zh": "第三十七话 彻夜不眠的真相 转"}, {"cid": "51654", "title": "第三十八話 徹夜不眠的真相 初", "title_zh": "第三十八话 彻夜不眠的真相 初"}, {"cid": "51655", "title": "第三十九話 徹夜不眠的真相 緣", "title_zh": "第三十九话 彻夜不眠的真相 缘"}, {"cid": "51656", "title": "第四十話 徹夜不眠的真相 戀", "title_zh": "第四十话 彻夜不眠的真相 恋"}, {"cid": "51657", "title": "第四十一話 無聲的新喜劇", "title_zh": "第四十一话 无声的新喜剧"}, {"cid": "51694", "title": "第四十二話 放上心願的天秤 序", "title_zh": "第四十二话 放上心愿的天秤 序"}, {"cid": "51695", "title": "第四十三話 放上心願的天秤 迴", "title_zh": "第四十三话 放上心愿的天秤 回"}, {"cid": "51697", "title": "第四十五話 放上心願的天秤 擇", "title_zh": "第四十五话 放上心愿的天秤 择"}, {"cid": "51698", "title": "第四十六話 放上心願的天秤 望", "title_zh": "第四十六话 放上心愿的天秤 望"}, {"cid": "51699", "title": "第四十七話 放上心願的天秤 決", "title_zh": "第四十七话 放上心愿的天秤 决"}, {"cid": "51700", "title": "第四十八話 放上心願的天秤 歸", "title_zh": "第四十八话 放上心愿的天秤 归"}, {"cid": "51701", "title": "第四十九話 放上心願的天秤 訴", "title_zh": "第四十九话 放上心愿的天秤 诉"}, {"cid": "51702", "title": "第五十話 送別之火", "title_zh": "第五十话 送别之火"}, {"cid": "53728", "title": "附錄", "title_zh": "附录"}, {"cid": "51704", "title": "第五十一話 與神的道別", "title_zh": "第五十一话 与神的道别"}, {"cid": "51705", "title": "第五十二話 與神的誓言", "title_zh": "第五十二话 与神的誓言"}, {"cid": "51706", "title": "第五十三話 別過目光", "title_zh": "第五十三话 别过目光"}, {"cid": "51707", "title": "第五十四話 發燒與白日夢", "title_zh": "第五十四话 发烧与白日梦"}, {"cid": "51708", "title": "第五十五話 選擇題", "title_zh": "第五十五话 选择题"}, {"cid": "51709", "title": "第五十六話 撫子之捉迷藏 序", "title_zh": "第五十六话 抚子之捉迷藏 序"}, {"cid": "51710", "title": "第五十七話 撫子之捉迷藏 換", "title_zh": "第五十七话 抚子之捉迷藏 换"}, {"cid": "51711", "title": "第五十八話 撫子之捉迷藏 懊", "title_zh": "第五十八话 抚子之捉迷藏 懊"}, {"cid": "51712", "title": "第五十九話 撫子之捉迷藏 通", "title_zh": "第五十九话 抚子之捉迷藏 通"}, {"cid": "53729", "title": "附錄", "title_zh": "附录"}, {"cid": "51714", "title": "第60話", "title_zh": "第60话"}]};
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>