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-964", "mangaid": "964", "zh_title": "大叔与猫", "hant_title": "大叔與貓", "en_title": "大叔与猫 (Bilimanga #964)", "author": "樱井海", "tags": ["日常", "治愈", "萌系", "治愈温馨", "日本漫画", "漫画", "日漫", "连载漫画"], "zh_desc": "宠物店里,有一只价格下滑也迟迟卖不出去,逐渐放弃希望的成猫。某天,一位大叔出现在牠面前「我想要这孩子」——从此,他们相遇了。\n\r\n念著与妻子的约定而开始养猫的大叔,因为从未有过养过宠物的经验,起初被猫咪的种种习性给伤透了脑筋,但猫咪真切又温暖的反应总能逗得他会心一笑,心中那寂寞的空洞似乎也被彼此给填满了……\n\n📚 作品信息:作者 樱井海 · 评分 9.3 · 共收录 15 卷 / 136 话章节目录与高清彩页/条漫预览。", "hant_desc": "寵物店裡,有一隻價格下滑也遲遲賣不出去,逐漸放棄希望的成貓。某天,一位大叔出現在牠面前「我想要這孩子」——從此,他們相遇了。\n\r\n念著與妻子的約定而開始養貓的大叔,因為從未有過養過寵物的經驗,起初被貓咪的種種習性給傷透了腦筋,但貓咪真切又溫暖的反應總能逗得他會心一笑,心中那寂寞的空洞似乎也被彼此給填滿了……\n\n📚 作品資訊:作者 櫻井海 · 評分 9.3 · 共收錄 15 卷 / 136 話章節目錄與高清彩頁/條漫預覽。", "en_desc": "Popular serialized manga '大叔与猫' (大叔與貓) by 樱井海. Includes 15 volumes and 136 chapters with full online vertical/page-flip web reader.", "pages": ["https://media.huangguodrama.ai/motion/comics/bilimanga-964/page_01.jpg", "https://media.huangguodrama.ai/motion/comics/bilimanga-964/page_02.jpg", "https://media.huangguodrama.ai/motion/comics/bilimanga-964/page_03.jpg", "https://media.huangguodrama.ai/motion/comics/bilimanga-964/page_04.jpg", "https://media.huangguodrama.ai/motion/comics/bilimanga-964/page_05.jpg", "https://media.huangguodrama.ai/motion/comics/bilimanga-964/page_06.jpg"], "volumes": [{"title_hant": "大叔與貓 1", "title_zh": "大叔与猫 1", "cover_id": 1685082, "first_chap_id": 77831, "cover_url": "https://i.motiezw.com/cover/964/1685082.jpg"}, {"title_hant": "大叔與貓 2", "title_zh": "大叔与猫 2", "cover_id": 1685229, "first_chap_id": 77855, "cover_url": "https://i.motiezw.com/cover/964/1685229.jpg"}, {"title_hant": "大叔與貓 3", "title_zh": "大叔与猫 3", "cover_id": 1685376, "first_chap_id": 77875, "cover_url": "https://i.motiezw.com/cover/964/1685376.jpg"}, {"title_hant": "大叔與貓 4", "title_zh": "大叔与猫 4", "cover_id": 1685524, "first_chap_id": 77887, "cover_url": "https://i.motiezw.com/cover/964/1685524.jpg"}, {"title_hant": "大叔與貓 5", "title_zh": "大叔与猫 5", "cover_id": 1685688, "first_chap_id": 77901, "cover_url": "https://i.motiezw.com/cover/964/1685688.jpg"}, {"title_hant": "大叔與貓 6", "title_zh": "大叔与猫 6", "cover_id": 1685852, "first_chap_id": 77913, "cover_url": "https://i.motiezw.com/cover/964/1685852.jpg"}, {"title_hant": "大叔與貓 7", "title_zh": "大叔与猫 7", "cover_id": 1685990, "first_chap_id": 77923, "cover_url": "https://i.motiezw.com/cover/964/1685990.jpg"}, {"title_hant": "大叔與貓 8", "title_zh": "大叔与猫 8", "cover_id": 1686129, "first_chap_id": 77932, "cover_url": "https://i.motiezw.com/cover/964/1686129.jpg"}, {"title_hant": "大叔與貓 9", "title_zh": "大叔与猫 9", "cover_id": 1686274, "first_chap_id": 77939, "cover_url": "https://i.motiezw.com/cover/964/1686274.jpg"}, {"title_hant": "大叔與貓 10", "title_zh": "大叔与猫 10", "cover_id": 1687581, "first_chap_id": 77978, "cover_url": "https://i.motiezw.com/cover/964/1687581.jpg"}, {"title_hant": "大叔與貓 11", "title_zh": "大叔与猫 11", "cover_id": 1687765, "first_chap_id": 77989, "cover_url": "https://i.motiezw.com/cover/964/1687765.jpg"}, {"title_hant": "大叔與貓 12", "title_zh": "大叔与猫 12", "cover_id": 1687911, "first_chap_id": 77996, "cover_url": "https://i.motiezw.com/cover/964/1687911.jpg"}], "chapters": [{"cid": "77831", "title": "第1話 大叔與貓", "title_zh": "第1话 大叔与猫"}, {"cid": "77832", "title": "第2話 獨身一人", "title_zh": "第2话 独身一人"}, {"cid": "77833", "title": "第3話 貓的名字", "title_zh": "第3话 猫的名字"}, {"cid": "77834", "title": "第4話 大叔購物", "title_zh": "第4话 大叔购物"}, {"cid": "77835", "title": "第5話 超級奇跡牌貓咪酥餅", "title_zh": "第5话 超级奇迹牌猫咪酥饼"}, {"cid": "77836", "title": "第6話 開始養貓", "title_zh": "第6话 开始养猫"}, {"cid": "77837", "title": "第7話 晚安福球", "title_zh": "第7话 晚安福球"}, {"cid": "77838", "title": "第8話 晚安大叔", "title_zh": "第8话 晚安大叔"}, {"cid": "77839", "title": "第9話 福球揉揉", "title_zh": "第9话 福球揉揉"}, {"cid": "77840", "title": "第10話 一覺醒來", "title_zh": "第10话 一觉醒来"}, {"cid": "77841", "title": "第11話 福球看家", "title_zh": "第11话 福球看家"}, {"cid": "77842", "title": "第12話 歡迎回家喵", "title_zh": "第12话 欢迎回家喵"}, {"cid": "77843", "title": "第13話 忠貓福球", "title_zh": "第13话 忠猫福球"}, {"cid": "77844", "title": "第14話 自家孩子最棒", "title_zh": "第14话 自家孩子最棒"}, {"cid": "77845", "title": "第15話 福球和黑乎乎", "title_zh": "第15话 福球和黑乎乎"}, {"cid": "77846", "title": "第安心安全的設計", "title_zh": "第安心安全的设计"}, {"cid": "77847", "title": "第從角落開始進攻喵", "title_zh": "第从角落开始进攻喵"}, {"cid": "77848", "title": "第透過透明牆所見之物", "title_zh": "第透过透明墙所见之物"}, {"cid": "77849", "title": "第你的可愛貓咪", "title_zh": "第你的可爱猫咪"}, {"cid": "77850", "title": "第與你約定", "title_zh": "第与你约定"}, {"cid": "77851", "title": "第相遇與別離", "title_zh": "第相遇与别离"}, {"cid": "77852", "title": "第和福球一起", "title_zh": "第和福球一起"}, {"cid": "77855", "title": "第17話 福球和狗尾草", "title_zh": "第17话 福球和狗尾草"}, {"cid": "77856", "title": "第18話 蹭蹭黨", "title_zh": "第18话 蹭蹭党"}, {"cid": "77857", "title": "第19話 小福球", "title_zh": "第19话 小福球"}, {"cid": "77858", "title": "第20話 在這裡哦", "title_zh": "第20话 在这里哦"}, {"cid": "77859", "title": "第21話 我喜歡的東西", "title_zh": "第21话 我喜欢的东西"}, {"cid": "77860", "title": "第22話 淚如泉湧", "title_zh": "第22话 泪如泉涌"}, {"cid": "77861", "title": "第23話 瞌睡貓", "title_zh": "第23话 瞌睡猫"}, {"cid": "77862", "title": "第24話 一定會喜歡的", "title_zh": "第24话 一定会喜欢的"}, {"cid": "77863", "title": "第25話 緊跟爸爸", "title_zh": "第25话 紧跟爸爸"}, {"cid": "77864", "title": "第26話 邁出一步-", "title_zh": "第26话 迈出一步-"}, {"cid": "77865", "title": "第27話 大家的偶像", "title_zh": "第27话 大家的偶像"}, {"cid": "77866", "title": "第28話 世上只有爸爸好人", "title_zh": "第28话 世上只有爸爸好人"}, {"cid": "77867", "title": "第29話 有失手,貓有失爪", "title_zh": "第29话 有失手,猫有失爪"}, {"cid": "77868", "title": "第30話 神奇的生物", "title_zh": "第30话 神奇的生物"}, {"cid": "77869", "title": "第兄弟", "title_zh": "第兄弟"}, {"cid": "77870", "title": "第我也喜歡貓", "title_zh": "第我也喜欢猫"}, {"cid": "77871", "title": "第守護戰士福球", "title_zh": "第守护战士福球"}, {"cid": "77872", "title": "第爸爸送的禮物珍貴的東西", "title_zh": "第爸爸送的礼物珍贵的东西"}, {"cid": "77873", "title": "第年少時期", "title_zh": "第年少时期"}, {"cid": "77875", "title": "第31話 多虧了大家", "title_zh": "第31话 多亏了大家"}, {"cid": "77876", "title": "第為了爸爸", "title_zh": "第为了爸爸"}, {"cid": "77877", "title": "第32話 摘蛋蛋啦", "title_zh": "第32话 摘蛋蛋啦"}, {"cid": "77878", "title": "第不入虎穴焉得爸爸", "title_zh": "第不入虎穴焉得爸爸"}, {"cid": "77880", "title": "第34話 即便如此,我們也要繼續前行", "title_zh": "第34话 即便如此,我们也要继续前行"}, {"cid": "77881", "title": "第35話 福球有力量", "title_zh": "第35话 福球有力量"}, {"cid": "77882", "title": "第36話 福球的內心", "title_zh": "第36话 福球的内心"}, {"cid": "77883", "title": "最喜歡大家了喵", "title_zh": "最喜欢大家了喵"}, {"cid": "77884", "title": "第37話 另一個故事", "title_zh": "第37话 另一个故事"}, {"cid": "77885", "title": "第38話 與貓結緣", "title_zh": "第38话 与猫结缘"}, {"cid": "77887", "title": "第39話 內心滿滿都是貓", "title_zh": "第39话 内心满满都是猫"}, {"cid": "77888", "title": "第40話 溫柔的聲音", "title_zh": "第40话 温柔的声音"}, {"cid": "77889", "title": "第大叔是養貓前輩", "title_zh": "第大叔是养猫前辈"}, {"cid": "77890", "title": "第因為是你的呼喚", "title_zh": "第因为是你的呼唤"}, {"cid": "77891", "title": "第41話 歡迎貓友", "title_zh": "第41话 欢迎猫友"}, {"cid": "77892", "title": "第42話 你出生的那一天", "title_zh": "第42话 你出生的那一天"}, {"cid": "77893", "title": "第獨佔幸福", "title_zh": "第独占幸福"}, {"cid": "77894", "title": "第福球與大叔 魚魚攻防戰", "title_zh": "第福球与大叔 鱼鱼攻防战"}, {"cid": "77895", "title": "第43話 日光下的夜想曲", "title_zh": "第43话 日光下的夜想曲"}]};
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>