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-1510", "mangaid": "1510", "zh_title": "快乐人生", "hant_title": "快樂人生", "en_title": "快乐人生 (Bilimanga #1510)", "author": "释英胜", "tags": ["犯罪", "群像", "黑暗", "悬疑", "欢乐", "奇异幻想", "日本漫画", "漫画"], "zh_desc": "该作品分为很多的故事,但是故事的内容却是独立的。\n\r\n作品以摄影以及绘画等方式讲述了很多奇怪的故事,每个故事都有描述了现今社会光怪陆离,步伐急速,无数都市人都于强大的压力环境之下的生活。\n\r\n故事的内容,有的令人压抑、有人令人惊慌、有的令人感到心寒的又或是令人轻松,并且十分搞笑的短篇故事。\n\r\n但是,很多人看完了这个故事,却想起了自己……\n\r\n作品中还有讲述动物和人所发生的故事。\n\n📚 作品信息:作者 释英胜 · 评分 10 · 共收录 10 卷 / 60 话章节目录与高清彩页/条漫预览。", "hant_desc": "該作品分為很多的故事,但是故事的內容卻是獨立的。\n\r\n作品以攝影以及繪畫等方式講述了很多奇怪的故事,每個故事都有描述了現今社會光怪陸離,步伐急速,無數都市人都於強大的壓力環境之下的生活。\n\r\n故事的內容,有的令人壓抑、有人令人驚慌、有的令人感到心寒的又或是令人輕鬆,並且十分搞笑的短篇故事。\n\r\n但是,很多人看完了這個故事,卻想起了自己……\n\r\n作品中還有講述動物和人所發生的故事。\n\n📚 作品資訊:作者 釋英勝 · 評分 10 · 共收錄 10 卷 / 60 話章節目錄與高清彩頁/條漫預覽。", "en_desc": "Popular serialized manga '快乐人生' (快樂人生) by 释英胜. Includes 10 volumes and 60 chapters with full online vertical/page-flip web reader.", "pages": ["https://media.huangguodrama.ai/motion/comics/bilimanga-1510/page_01.jpg", "https://media.huangguodrama.ai/motion/comics/bilimanga-1510/page_02.jpg", "https://media.huangguodrama.ai/motion/comics/bilimanga-1510/page_03.jpg", "https://media.huangguodrama.ai/motion/comics/bilimanga-1510/page_04.jpg", "https://media.huangguodrama.ai/motion/comics/bilimanga-1510/page_05.jpg", "https://media.huangguodrama.ai/motion/comics/bilimanga-1510/page_06.jpg"], "volumes": [{"title_hant": "快樂人生 1", "title_zh": "快乐人生 1", "cover_id": 2729271, "first_chap_id": 125056, "cover_url": "https://i.motiezw.com/cover/1510/2729271.jpg"}, {"title_hant": "快樂人生 2", "title_zh": "快乐人生 2", "cover_id": 2729497, "first_chap_id": 125065, "cover_url": "https://i.motiezw.com/cover/1510/2729497.jpg"}, {"title_hant": "快樂人生 3", "title_zh": "快乐人生 3", "cover_id": 2729732, "first_chap_id": 125074, "cover_url": "https://i.motiezw.com/cover/1510/2729732.jpg"}, {"title_hant": "快樂人生 4", "title_zh": "快乐人生 4", "cover_id": 2729957, "first_chap_id": 125082, "cover_url": "https://i.motiezw.com/cover/1510/2729957.jpg"}, {"title_hant": "快樂人生 5", "title_zh": "快乐人生 5", "cover_id": 2730177, "first_chap_id": 125090, "cover_url": "https://i.motiezw.com/cover/1510/2730177.jpg"}, {"title_hant": "快樂人生 6", "title_zh": "快乐人生 6", "cover_id": 2730411, "first_chap_id": 125097, "cover_url": "https://i.motiezw.com/cover/1510/2730411.jpg"}, {"title_hant": "快樂人生 7", "title_zh": "快乐人生 7", "cover_id": 2730636, "first_chap_id": 125102, "cover_url": "https://i.motiezw.com/cover/1510/2730636.jpg"}, {"title_hant": "快樂人生 8", "title_zh": "快乐人生 8", "cover_id": 2730861, "first_chap_id": 125109, "cover_url": "https://i.motiezw.com/cover/1510/2730861.jpg"}, {"title_hant": "快樂人生 9", "title_zh": "快乐人生 9", "cover_id": 2731076, "first_chap_id": 125115, "cover_url": "https://i.motiezw.com/cover/1510/2731076.jpg"}, {"title_hant": "快樂人生 10", "title_zh": "快乐人生 10", "cover_id": 2731292, "first_chap_id": 125122, "cover_url": "https://i.motiezw.com/cover/1510/2731292.jpg"}], "chapters": [{"cid": "125056", "title": "沒特別意思,大家都來happy地笑吧!!", "title_zh": "没特别意思,大家都来happy地笑吧!!"}, {"cid": "125057", "title": "幸仔,是個討厭鬼!", "title_zh": "幸仔,是个讨厌鬼!"}, {"cid": "125058", "title": "畢業相片", "title_zh": "毕业相片"}, {"cid": "125059", "title": "心癢癢", "title_zh": "心痒痒"}, {"cid": "125060", "title": "善心", "title_zh": "善心"}, {"cid": "125061", "title": "好夥伴", "title_zh": "好伙伴"}, {"cid": "125062", "title": "對不起啊!", "title_zh": "对不起啊!"}, {"cid": "125063", "title": "訪問者", "title_zh": "访问者"}, {"cid": "125065", "title": "泡妞,我才買了車子", "title_zh": "泡妞,我才买了车子"}, {"cid": "125066", "title": "快樂高校的棒球", "title_zh": "快乐高校的棒球"}, {"cid": "125067", "title": "滅鬼器", "title_zh": "灭鬼器"}, {"cid": "125068", "title": "黃金夢", "title_zh": "黄金梦"}, {"cid": "125069", "title": "不快樂青年的冒險", "title_zh": "不快乐青年的冒险"}, {"cid": "125070", "title": "不快樂青年兩個月後的冒險", "title_zh": "不快乐青年两个月后的冒险"}, {"cid": "125071", "title": "夢想的出鏡", "title_zh": "梦想的出镜"}, {"cid": "125072", "title": "醫生,是我啊!", "title_zh": "医生,是我啊!"}, {"cid": "125074", "title": "一列名叫家族的電車", "title_zh": "一列名叫家族的电车"}, {"cid": "125075", "title": "我聽到某些聲音", "title_zh": "我听到某些声音"}, {"cid": "125076", "title": "蜘蛛", "title_zh": "蜘蛛"}, {"cid": "125077", "title": "我變成了一隻松鼠", "title_zh": "我变成了一只松鼠"}, {"cid": "125078", "title": "I LOVE日本(上)", "title_zh": "I LOVE日本(上)"}, {"cid": "125080", "title": "獨家新聞", "title_zh": "独家新闻"}, {"cid": "125082", "title": "處N的興奮", "title_zh": "处N的兴奋"}, {"cid": "125083", "title": "恐怖的戀子", "title_zh": "恐怖的恋子"}, {"cid": "125084", "title": "我愛戀子(上)", "title_zh": "我爱恋子(上)"}, {"cid": "125085", "title": "我愛戀子(下)", "title_zh": "我爱恋子(下)"}, {"cid": "125086", "title": "愛你愛到殺死你", "title_zh": "爱你爱到杀死你"}, {"cid": "125087", "title": "快樂的搖擺", "title_zh": "快乐的摇摆"}, {"cid": "125088", "title": "來自另一個世界的謝禮", "title_zh": "来自另一个世界的谢礼"}, {"cid": "125090", "title": "溫習該在好的環境下", "title_zh": "温习该在好的环境下"}, {"cid": "125091", "title": "SILENT WINDOW①", "title_zh": "SILENT WINDOW①"}, {"cid": "125092", "title": "SILENT WINDOW②", "title_zh": "SILENT WINDOW②"}, {"cid": "125093", "title": "DEAD END(死胡同)", "title_zh": "DEAD END(死胡同)"}, {"cid": "125094", "title": "XX星人的內臟", "title_zh": "XX星人的内脏"}, {"cid": "125095", "title": "往幸福去", "title_zh": "往幸福去"}, {"cid": "125097", "title": "明天,錢會自動送上來", "title_zh": "明天,钱会自动送上来"}, {"cid": "125098", "title": "掘這裡吧!汪汪♡", "title_zh": "掘这里吧!汪汪♡"}, {"cid": "125099", "title": "FEVER", "title_zh": "FEVER"}, {"cid": "125100", "title": "柏林圍牆", "title_zh": "柏林围墙"}, {"cid": "125102", "title": "千秋樂(前篇)", "title_zh": "千秋乐(前篇)"}, {"cid": "125103", "title": "千秋樂(後篇)", "title_zh": "千秋乐(后篇)"}, {"cid": "125105", "title": "最幸福時(前篇)", "title_zh": "最幸福时(前篇)"}, {"cid": "125106", "title": "最幸福時(後篇)", "title_zh": "最幸福时(后篇)"}, {"cid": "125107", "title": "鬼手", "title_zh": "鬼手"}, {"cid": "125109", "title": "我的人生慘兮兮", "title_zh": "我的人生惨兮兮"}, {"cid": "125110", "title": "終有一天", "title_zh": "终有一天"}, {"cid": "125111", "title": "以其人之道還治其人之身", "title_zh": "以其人之道还治其人之身"}, {"cid": "125112", "title": "青蘋果(前篇)", "title_zh": "青苹果(前篇)"}, {"cid": "125113", "title": "青蘋果(後篇)", "title_zh": "青苹果(后篇)"}, {"cid": "125115", "title": "各位,輕輕鬆鬆賺大錢(上)", "title_zh": "各位,轻轻松松赚大钱(上)"}, {"cid": "125116", "title": "各位,輕輕鬆鬆賺大錢(中)", "title_zh": "各位,轻轻松松赚大钱(中)"}, {"cid": "125117", "title": "各位,輕輕鬆鬆賺大錢(下)", "title_zh": "各位,轻轻松松赚大钱(下)"}, {"cid": "125118", "title": "幸運硬幣", "title_zh": "幸运硬币"}, {"cid": "125119", "title": "五十萬分之一的機會", "title_zh": "五十万分之一的机会"}, {"cid": "125120", "title": "這也是愛", "title_zh": "这也是爱"}, {"cid": "125122", "title": "直擊報導水鴨事件", "title_zh": "直击报导水鸭事件"}, {"cid": "125123", "title": "回憶中的小狗", "title_zh": "回忆中的小狗"}, {"cid": "125124", "title": "老大", "title_zh": "老大"}, {"cid": "125125", "title": "兔子的獠牙", "title_zh": "兔子的獠牙"}, {"cid": "125126", "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>