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-1343", "mangaid": "1343", "zh_title": "圣同学想清纯地生活", "hant_title": "聖同學想清純地生活", "en_title": "圣同学想清纯地生活 (Bilimanga #1343)", "author": "朝贺庵", "tags": ["校园", "欢乐", "后宫", "日常", "萌系", "恋爱", "校园青春", "日本漫画"], "zh_desc": "成绩优秀、容貌俊秀,完美无暇的学生会长・土御门圣。\n\r\n他在放学后赫然见到的,竟是平日里文静的佐渡同学对著学校的老师抖S地谩骂的模样──!\n\r\n与佐渡的相遇颠覆了他的校园生活。\n\r\n进一步地,隐藏的变态们陆续聚集到圣的身边!\n\r\n被形形色色性癖所包围的圣,能清清白白正直地生活下去吗!?\n\n📚 作品信息:作者 朝贺庵 · 评分 10 · 共收录 8 卷 / 70 话章节目录与高清彩页/条漫预览。", "hant_desc": "成績優秀、容貌俊秀,完美無暇的學生會長・土御門聖。\n\r\n他在放學後赫然見到的,竟是平日裡文靜的佐渡同學對著學校的老師抖S地謾罵的模樣──!\n\r\n與佐渡的相遇顛覆了他的校園生活。\n\r\n進一步地,隱藏的變態們陸續聚集到聖的身邊!\n\r\n被形形色色性癖所包圍的聖,能清清白白正直地生活下去嗎!?\n\n📚 作品資訊:作者 朝賀庵 · 評分 10 · 共收錄 8 卷 / 70 話章節目錄與高清彩頁/條漫預覽。", "en_desc": "Popular serialized manga '圣同学想清纯地生活' (聖同學想清純地生活) by 朝贺庵. Includes 8 volumes and 70 chapters with full online vertical/page-flip web reader.", "pages": ["https://media.huangguodrama.ai/motion/comics/bilimanga-1343/page_01.jpg", "https://media.huangguodrama.ai/motion/comics/bilimanga-1343/page_02.jpg", "https://media.huangguodrama.ai/motion/comics/bilimanga-1343/page_03.jpg", "https://media.huangguodrama.ai/motion/comics/bilimanga-1343/page_04.jpg", "https://media.huangguodrama.ai/motion/comics/bilimanga-1343/page_05.jpg", "https://media.huangguodrama.ai/motion/comics/bilimanga-1343/page_06.jpg"], "volumes": [{"title_hant": "聖同學想清純地生活 1", "title_zh": "圣同学想清纯地生活 1", "cover_id": 2413236, "first_chap_id": 111729, "cover_url": "https://i.motiezw.com/cover/1343/2413236.jpg"}, {"title_hant": "聖同學想清純地生活 2", "title_zh": "圣同学想清纯地生活 2", "cover_id": 2413423, "first_chap_id": 111738, "cover_url": "https://i.motiezw.com/cover/1343/2413423.jpg"}, {"title_hant": "聖同學想清純地生活 3", "title_zh": "圣同学想清纯地生活 3", "cover_id": 2413598, "first_chap_id": 111750, "cover_url": "https://i.motiezw.com/cover/1343/2413598.jpg"}, {"title_hant": "聖同學想清純地生活 4", "title_zh": "圣同学想清纯地生活 4", "cover_id": 2413774, "first_chap_id": 111762, "cover_url": "https://i.motiezw.com/cover/1343/2413774.jpg"}, {"title_hant": "聖同學想清純地生活 5", "title_zh": "圣同学想清纯地生活 5", "cover_id": 2413950, "first_chap_id": 111774, "cover_url": "https://i.motiezw.com/cover/1343/2413950.jpg"}, {"title_hant": "聖同學想清純地生活 6", "title_zh": "圣同学想清纯地生活 6", "cover_id": 3061446, "first_chap_id": 139151, "cover_url": "https://i.motiezw.com/cover/1343/3061446.jpg"}, {"title_hant": "聖同學想清純地生活 7", "title_zh": "圣同学想清纯地生活 7", "cover_id": 3061621, "first_chap_id": 139163, "cover_url": "https://i.motiezw.com/cover/1343/3061621.jpg"}, {"title_hant": "聖同學想清純地生活 8", "title_zh": "圣同学想清纯地生活 8", "cover_id": 3061781, "first_chap_id": 139174, "cover_url": "https://i.motiezw.com/cover/1343/3061781.jpg"}], "chapters": [{"cid": "111729", "title": "第1話 她對於組副無法忍受", "title_zh": "第1话 她对于组副无法忍受"}, {"cid": "111730", "title": "第2話 踏出的第一步", "title_zh": "第2话 踏出的第一步"}, {"cid": "111731", "title": "第3話 私密的告白", "title_zh": "第3话 私密的告白"}, {"cid": "111732", "title": "第4話 潘多拉的盒子打開了", "title_zh": "第4话 潘多拉的盒子打开了"}, {"cid": "111733", "title": "第5話 主人大人與母豬", "title_zh": "第5话 主人大人与母猪"}, {"cid": "111734", "title": "第6話 秘密的禮物", "title_zh": "第6话 秘密的礼物"}, {"cid": "111735", "title": "第7話 我和她之間的關係", "title_zh": "第7话 我和她之间的关系"}, {"cid": "111736", "title": "附錄", "title_zh": "附录"}, {"cid": "111738", "title": "第8話 第一次的緊縛", "title_zh": "第8话 第一次的紧缚"}, {"cid": "111739", "title": "第9話 S與M", "title_zh": "第9话 S与M"}, {"cid": "111740", "title": "第10話 逛街約會", "title_zh": "第10话 逛街约会"}, {"cid": "111741", "title": "第11話 五彩繽紛的●●●之山", "title_zh": "第11话 五彩缤纷的●●●之山"}, {"cid": "111742", "title": "第12話 紫S的假●之人", "title_zh": "第12话 紫S的假●之人"}, {"cid": "111743", "title": "第13話 危機四伏的讀書會", "title_zh": "第13话 危机四伏的读书会"}, {"cid": "111744", "title": "第14話 微醺地散步", "title_zh": "第14话 微醺地散步"}, {"cid": "111745", "title": "第15話 乃子與藝術", "title_zh": "第15话 乃子与艺术"}, {"cid": "111746", "title": "第16話 他們的狀況", "title_zh": "第16话 他们的状况"}, {"cid": "111747", "title": "第17話 如出一轍的同類", "title_zh": "第17话 如出一辙的同类"}, {"cid": "111748", "title": "附錄", "title_zh": "附录"}, {"cid": "111750", "title": "第18話 三角形的那個", "title_zh": "第18话 三角形的那个"}, {"cid": "111751", "title": "第19話 新的主人大人!", "title_zh": "第19话 新的主人大人!"}, {"cid": "111753", "title": "第21話 不可以的攝影會", "title_zh": "第21话 不可以的摄影会"}, {"cid": "111754", "title": "第22話 學長與戀愛話題", "title_zh": "第22话 学长与恋爱话题"}, {"cid": "111755", "title": "第23話 門的另一邊", "title_zh": "第23话 门的另一边"}, {"cid": "111756", "title": "第24話 我的真心", "title_zh": "第24话 我的真心"}, {"cid": "111757", "title": "第25話 察覺到的心意", "title_zh": "第25话 察觉到的心意"}, {"cid": "111758", "title": "第26話 怦然心跳的文化祭♡", "title_zh": "第26话 怦然心跳的文化祭♡"}, {"cid": "111759", "title": "第27話 紅心皇后降臨", "title_zh": "第27话 红心皇后降临"}, {"cid": "111760", "title": "附錄", "title_zh": "附录"}, {"cid": "111762", "title": "第28話 N王大人的嘉獎", "title_zh": "第28话 N王大人的嘉奖"}, {"cid": "111763", "title": "第29話 危險的散步", "title_zh": "第29话 危险的散步"}, {"cid": "111764", "title": "第30話 初次的反抗!", "title_zh": "第30话 初次的反抗!"}, {"cid": "111765", "title": "第31話 偽裝男友大作戰", "title_zh": "第31话 伪装男友大作战"}, {"cid": "111766", "title": "第32話 偽裝N友大作戰", "title_zh": "第32话 伪装N友大作战"}, {"cid": "111767", "title": "第33話 漂亮的玫瑰總是帶刺", "title_zh": "第33话 漂亮的玫瑰总是带刺"}, {"cid": "111768", "title": "第34話 我所知道的世界規則", "title_zh": "第34话 我所知道的世界规则"}, {"cid": "111769", "title": "第35話 不變的光芒", "title_zh": "第35话 不变的光芒"}, {"cid": "111770", "title": "第36話 唐突的來訪者", "title_zh": "第36话 唐突的来访者"}, {"cid": "111771", "title": "第37話 文學少N與SQ小說", "title_zh": "第37话 文学少N与SQ小说"}, {"cid": "111772", "title": "附錄", "title_zh": "附录"}, {"cid": "111774", "title": "第38話 SQ小說朗讀會", "title_zh": "第38话 SQ小说朗读会"}, {"cid": "111775", "title": "第39話 N主角們與理想形象", "title_zh": "第39话 N主角们与理想形象"}, {"cid": "111776", "title": "第40話 浴衣好可愛呀", "title_zh": "第40话 浴衣好可爱呀"}, {"cid": "111778", "title": "第42話 禁忌的共犯", "title_zh": "第42话 禁忌的共犯"}, {"cid": "111779", "title": "第43話 深夜的悻教育", "title_zh": "第43话 深夜的悻教育"}, {"cid": "111780", "title": "第44話 男N們的戀愛花S", "title_zh": "第44话 男N们的恋爱花S"}, {"cid": "111781", "title": "第45話 煩惱的青少年們", "title_zh": "第45话 烦恼的青少年们"}, {"cid": "111782", "title": "特別單篇 薔薇S的模特兒", "title_zh": "特别单篇 蔷薇S的模特儿"}, {"cid": "111783", "title": "附錄", "title_zh": "附录"}, {"cid": "139151", "title": "第46話 輕鬆一下♡家庭旅行", "title_zh": "第46话 轻松一下♡家庭旅行"}, {"cid": "139152", "title": "第47話 完M的自己", "title_zh": "第47话 完M的自己"}, {"cid": "139153", "title": "第48話 狂風驟雨的愛Q賓館", "title_zh": "第48话 狂风骤雨的爱Q宾馆"}, {"cid": "139154", "title": "第49話 凌晨2點那個無法實現的心願", "title_zh": "第49话 凌晨2点那个无法实现的心愿"}, {"cid": "139155", "title": "第50話 主人大人 vs. 未婚夫", "title_zh": "第50话 主人大人 vs. 未婚夫"}, {"cid": "139156", "title": "第51話 我的主人大人♡", "title_zh": "第51话 我的主人大人♡"}, {"cid": "139157", "title": "第52話 灼熱的視線", "title_zh": "第52话 灼热的视线"}, {"cid": "139158", "title": "第53話 放學後的憋尿時刻", "title_zh": "第53话 放学后的憋尿时刻"}, {"cid": "139159", "title": "第54話 我們喜歡的那個人", "title_zh": "第54话 我们喜欢的那个人"}, {"cid": "139160", "title": "第55話 怦然心跳的校外教學", "title_zh": "第55话 怦然心跳的校外教学"}, {"cid": "139161", "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>