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-963", "mangaid": "963", "zh_title": "笑傲江湖", "hant_title": "笑傲江湖", "en_title": "笑傲江湖 (Bilimanga #963)", "author": "李志清 / 金庸", "tags": ["武侠", "历史", "东方", "群像", "历史文化", "港台漫画", "漫画", "日漫"], "zh_desc": "「从来不信梅花谱,信手拈来自有神。不信试看千万树,东风吹著便成春。」\n\r\n这是金庸先生选为《笑傲》小说版封面上徐渭的题字,小说前的说明是:「梅花谱」自来是画梅的典范,徐渭不理经典的规范,信手挥写,充分表现他性格清高狂傲,是极具「笑傲江湖」性格的人物。\n\r\n\n\r\n金庸先生以此点出《笑傲江湖》一书的题旨,意在为人应重风骨节操,重自由发挥,而看破放下名、利、权的枷锁。\n\n📚 作品信息:作者 李志清 / 金庸 · 评分 9.3 · 共收录 26 卷 / 101 话章节目录与高清彩页/条漫预览。", "hant_desc": "「從來不信梅花譜,信手拈來自有神。不信試看千萬樹,東風吹著便成春。」\n\r\n這是金庸先生選為《笑傲》小說版封面上徐渭的題字,小說前的說明是:「梅花譜」自來是畫梅的典範,徐渭不理經典的規範,信手揮寫,充分表現他性格清高狂傲,是極具「笑傲江湖」性格的人物。\n\r\n\n\r\n金庸先生以此點出《笑傲江湖》一書的題旨,意在為人應重風骨節操,重自由發揮,而看破放下名、利、權的枷鎖。\n\n📚 作品資訊:作者 李志清 / 金庸 · 評分 9.3 · 共收錄 26 卷 / 101 話章節目錄與高清彩頁/條漫預覽。", "en_desc": "Popular serialized manga '笑傲江湖' (笑傲江湖) by 李志清 / 金庸. Includes 26 volumes and 101 chapters with full online vertical/page-flip web reader.", "pages": ["https://media.huangguodrama.ai/motion/comics/bilimanga-963/page_01.jpg", "https://media.huangguodrama.ai/motion/comics/bilimanga-963/page_02.jpg", "https://media.huangguodrama.ai/motion/comics/bilimanga-963/page_03.jpg", "https://media.huangguodrama.ai/motion/comics/bilimanga-963/page_04.jpg", "https://media.huangguodrama.ai/motion/comics/bilimanga-963/page_05.jpg", "https://media.huangguodrama.ai/motion/comics/bilimanga-963/page_06.jpg"], "volumes": [{"title_hant": "笑傲江湖 1", "title_zh": "笑傲江湖 1", "cover_id": 1684575, "first_chap_id": 77815, "cover_url": "https://i.motiezw.com/cover/963/1684575.jpg"}, {"title_hant": "笑傲江湖 2", "title_zh": "笑傲江湖 2", "cover_id": 1684742, "first_chap_id": 77821, "cover_url": "https://i.motiezw.com/cover/963/1684742.jpg"}, {"title_hant": "笑傲江湖 3", "title_zh": "笑傲江湖 3", "cover_id": 1684910, "first_chap_id": 77826, "cover_url": "https://i.motiezw.com/cover/963/1684910.jpg"}, {"title_hant": "笑傲江湖 4", "title_zh": "笑傲江湖 4", "cover_id": 1686434, "first_chap_id": 77946, "cover_url": "https://i.motiezw.com/cover/963/1686434.jpg"}, {"title_hant": "笑傲江湖 5", "title_zh": "笑傲江湖 5", "cover_id": 1686603, "first_chap_id": 77951, "cover_url": "https://i.motiezw.com/cover/963/1686603.jpg"}, {"title_hant": "笑傲江湖 6", "title_zh": "笑傲江湖 6", "cover_id": 1686779, "first_chap_id": 77956, "cover_url": "https://i.motiezw.com/cover/963/1686779.jpg"}, {"title_hant": "笑傲江湖 7", "title_zh": "笑傲江湖 7", "cover_id": 1686950, "first_chap_id": 77961, "cover_url": "https://i.motiezw.com/cover/963/1686950.jpg"}, {"title_hant": "笑傲江湖 8", "title_zh": "笑傲江湖 8", "cover_id": 1687104, "first_chap_id": 77967, "cover_url": "https://i.motiezw.com/cover/963/1687104.jpg"}, {"title_hant": "笑傲江湖 9", "title_zh": "笑傲江湖 9", "cover_id": 1687268, "first_chap_id": 77972, "cover_url": "https://i.motiezw.com/cover/963/1687268.jpg"}, {"title_hant": "笑傲江湖 10", "title_zh": "笑傲江湖 10", "cover_id": 1687609, "first_chap_id": 77984, "cover_url": "https://i.motiezw.com/cover/963/1687609.jpg"}, {"title_hant": "笑傲江湖 11", "title_zh": "笑傲江湖 11", "cover_id": 1688507, "first_chap_id": 78024, "cover_url": "https://i.motiezw.com/cover/963/1688507.jpg"}, {"title_hant": "笑傲江湖 12", "title_zh": "笑傲江湖 12", "cover_id": 1688680, "first_chap_id": 78029, "cover_url": "https://i.motiezw.com/cover/963/1688680.jpg"}], "chapters": [{"cid": "77815", "title": "第引子", "title_zh": "第引子"}, {"cid": "77819", "title": "第一話 酒", "title_zh": "第一话 酒"}, {"cid": "77816", "title": "第二話 洞戰", "title_zh": "第二话 洞战"}, {"cid": "77817", "title": "第三話 喪家之犬", "title_zh": "第三话 丧家之犬"}, {"cid": "77818", "title": "第四話 錯殺", "title_zh": "第四话 错杀"}, {"cid": "77821", "title": "第五話 辟邪劍法", "title_zh": "第五话 辟邪剑法"}, {"cid": "77822", "title": "第六話 滅門", "title_zh": "第六话 灭门"}, {"cid": "77823", "title": "第七話 摧心掌", "title_zh": "第七话 摧心掌"}, {"cid": "77824", "title": "第八話 天下第二", "title_zh": "第八话 天下第二"}, {"cid": "77826", "title": "第九話 坐鬥", "title_zh": "第九话 坐斗"}, {"cid": "77827", "title": "第十話 瀟湘夜雨", "title_zh": "第十话 潇湘夜雨"}, {"cid": "77828", "title": "第十一話 聆秘", "title_zh": "第十一话 聆秘"}, {"cid": "77829", "title": "第十二話 噩耗", "title_zh": "第十二话 噩耗"}, {"cid": "77946", "title": "第十三話 同生共死", "title_zh": "第十三话 同生共死"}, {"cid": "77947", "title": "第十四話 塞北明駝", "title_zh": "第十四话 塞北明驼"}, {"cid": "77948", "title": "第十五話 治傷", "title_zh": "第十五话 治伤"}, {"cid": "77949", "title": "第十六話 復生", "title_zh": "第十六话 复生"}, {"cid": "77951", "title": "第十七話 以大欺小", "title_zh": "第十七话 以大欺小"}, {"cid": "77952", "title": "第十八話 君子劍", "title_zh": "第十八话 君子剑"}, {"cid": "77954", "title": "第二十話 正邪不兩立", "title_zh": "第二十话 正邪不两立"}, {"cid": "77956", "title": "第二十一話 屠殺", "title_zh": "第二十一话 屠杀"}, {"cid": "77957", "title": "第二十二話 絕響", "title_zh": "第二十二话 绝响"}, {"cid": "77958", "title": "第二十三話 授譜", "title_zh": "第二十三话 授谱"}, {"cid": "77959", "title": "第二十四話 遺囑", "title_zh": "第二十四话 遗嘱"}, {"cid": "77961", "title": "第引子", "title_zh": "第引子"}, {"cid": "77962", "title": "第二十五話 寧N俠", "title_zh": "第二十五话 宁N侠"}, {"cid": "77963", "title": "第二十六話 面壁", "title_zh": "第二十六话 面壁"}, {"cid": "77964", "title": "第二十七話 雪夜", "title_zh": "第二十七话 雪夜"}, {"cid": "77965", "title": "第二十八話 玉N劍十九式", "title_zh": "第二十八话 玉N剑十九式"}, {"cid": "77967", "title": "第二十九話 不戒和尚", "title_zh": "第二十九话 不戒和尚"}, {"cid": "77968", "title": "第三十話 不速之客", "title_zh": "第三十话 不速之客"}, {"cid": "77969", "title": "第三十一話 洞秘", "title_zh": "第三十一话 洞秘"}, {"cid": "77970", "title": "第三十二話 劍宗傳人", "title_zh": "第三十二话 剑宗传人"}, {"cid": "77972", "title": "第三十三話 氣劍之争", "title_zh": "第三十三话 气剑之争"}, {"cid": "77973", "title": "第三十四話 對戰", "title_zh": "第三十四话 对战"}, {"cid": "77974", "title": "第三十五話 傳劍", "title_zh": "第三十五话 传剑"}, {"cid": "77975", "title": "第三十六話 破刀", "title_zh": "第三十六话 破刀"}, {"cid": "77984", "title": "第三十七話 桃谷六仙", "title_zh": "第三十七话 桃谷六仙"}, {"cid": "77986", "title": "第三十九話 紫霞秘笈", "title_zh": "第三十九话 紫霞秘笈"}, {"cid": "77987", "title": "第四十話 結交", "title_zh": "第四十话 结交"}, {"cid": "78024", "title": "第四十一話 誤殺", "title_zh": "第四十一话 误杀"}, {"cid": "78025", "title": "第四十二話 夜襲", "title_zh": "第四十二话 夜袭"}, {"cid": "78026", "title": "第四十三話 死戰", "title_zh": "第四十三话 死战"}, {"cid": "78027", "title": "第四十四話 圍攻", "title_zh": "第四十四话 围攻"}, {"cid": "78029", "title": "第四十五話 疑忌", "title_zh": "第四十五话 疑忌"}, {"cid": "78030", "title": "第四十六話 琴緣", "title_zh": "第四十六话 琴缘"}, {"cid": "78031", "title": "第四十七話 殺人名醫", "title_zh": "第四十七话 杀人名医"}, {"cid": "78032", "title": "第四十八話 藍鳳凰", "title_zh": "第四十八话 蓝凤凰"}, {"cid": "78034", "title": "第四十九話 五霸岡", "title_zh": "第四十九话 五霸冈"}, {"cid": "78035", "title": "第五十話 護送", "title_zh": "第五十话 护送"}, {"cid": "78036", "title": "第五十一話 方生大師", "title_zh": "第五十一话 方生大师"}, {"cid": "78037", "title": "第五十二話 魔教聖姑", "title_zh": "第五十二话 魔教圣姑"}, {"cid": "78039", "title": "第五十三話 向問天", "title_zh": "第五十三话 向问天"}, {"cid": "78040", "title": "第五十四話 結義", "title_zh": "第五十四话 结义"}, {"cid": "78041", "title": "第五十五話 梅莊四友", "title_zh": "第五十五话 梅庄四友"}, {"cid": "78042", "title": "第五十六話 任我行", "title_zh": "第五十六话 任我行"}, {"cid": "78086", "title": "第五十七話 囚居", "title_zh": "第五十七话 囚居"}, {"cid": "78088", "title": "第五十九話 威逼", "title_zh": "第五十九话 威逼"}, {"cid": "78089", "title": "第六十話 伏擊", "title_zh": "第六十话 伏击"}, {"cid": "78091", "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>