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-44", "mangaid": "44", "zh_title": "转生成为魔剑", "hant_title": "轉生成為魔劍", "en_title": "转生成为魔剑 (Bilimanga #44)", "author": "丸山朝ヲ / 棚架ユウ / LLO", "tags": ["转生", "战斗", "冒险", "旅行", "人外", "女儿", "奇幻冒险", "日本漫画"], "zh_desc": "异世界转生,那是少年少女们的浪漫,能让人带著作弊般的特权或特殊能力在异世界开始超爽的第二人生…\n\r\n我们这次的主角在不幸发生交通意外后也同样进行了异世界转生,等著他的是心想事成、大开后宫的赢家生活…才怪!\n\r\n转生之后他发现自己居然变成了一把剑!一把有自我意识的魔剑!而在命运的安排下,魔剑与某个少女奴隶相遇了…\n\n📚 作品信息:作者 丸山朝ヲ / 棚架ユウ / LLO · 评分 10 · 共收录 18 卷 / 93 话章节目录与高清彩页/条漫预览。", "hant_desc": "異世界轉生,那是少年少女們的浪漫,能讓人帶著作弊般的特權或特殊能力在異世界開始超爽的第二人生…\n\r\n我們這次的主角在不幸發生交通意外後也同樣進行了異世界轉生,等著他的是心想事成、大開後宮的贏家生活…才怪!\n\r\n轉生之後他發現自己居然變成了一把劍!一把有自我意識的魔劍!而在命運的安排下,魔劍與某個少女奴隸相遇了…\n\n📚 作品資訊:作者 丸山朝ヲ / 棚架ユウ / LLO · 評分 10 · 共收錄 18 卷 / 93 話章節目錄與高清彩頁/條漫預覽。", "en_desc": "Popular serialized manga '转生成为魔剑' (轉生成為魔劍) by 丸山朝ヲ / 棚架ユウ / LLO. Includes 18 volumes and 93 chapters with full online vertical/page-flip web reader.", "pages": ["https://media.huangguodrama.ai/motion/comics/bilimanga-44/page_01.jpg", "https://media.huangguodrama.ai/motion/comics/bilimanga-44/page_02.jpg", "https://media.huangguodrama.ai/motion/comics/bilimanga-44/page_03.jpg", "https://media.huangguodrama.ai/motion/comics/bilimanga-44/page_04.jpg", "https://media.huangguodrama.ai/motion/comics/bilimanga-44/page_05.jpg", "https://media.huangguodrama.ai/motion/comics/bilimanga-44/page_06.jpg"], "volumes": [{"title_hant": "轉生成為魔劍 1", "title_zh": "转生成为魔剑 1", "cover_id": 58086, "first_chap_id": 2663, "cover_url": "https://i.motiezw.com/cover/44/58086.jpg"}, {"title_hant": "轉生成為魔劍 2", "title_zh": "转生成为魔剑 2", "cover_id": 58256, "first_chap_id": 2671, "cover_url": "https://i.motiezw.com/cover/44/58256.jpg"}, {"title_hant": "轉生成為魔劍 3", "title_zh": "转生成为魔剑 3", "cover_id": 58428, "first_chap_id": 2678, "cover_url": "https://i.motiezw.com/cover/44/58428.jpg"}, {"title_hant": "轉生成為魔劍 4", "title_zh": "转生成为魔剑 4", "cover_id": 58573, "first_chap_id": 2684, "cover_url": "https://i.motiezw.com/cover/44/58573.jpg"}, {"title_hant": "轉生成為魔劍 5", "title_zh": "转生成为魔剑 5", "cover_id": 58706, "first_chap_id": 2690, "cover_url": "https://i.motiezw.com/cover/44/58706.jpg"}, {"title_hant": "轉生成為魔劍 6", "title_zh": "转生成为魔剑 6", "cover_id": 58858, "first_chap_id": 2697, "cover_url": "https://i.motiezw.com/cover/44/58858.jpg"}, {"title_hant": "轉生成為魔劍 7", "title_zh": "转生成为魔剑 7", "cover_id": 58993, "first_chap_id": 2703, "cover_url": "https://i.motiezw.com/cover/44/58993.jpg"}, {"title_hant": "轉生成為魔劍 8", "title_zh": "转生成为魔剑 8", "cover_id": 59128, "first_chap_id": 2708, "cover_url": "https://i.motiezw.com/cover/44/59128.jpg"}, {"title_hant": "轉生成為魔劍 9", "title_zh": "转生成为魔剑 9", "cover_id": 59284, "first_chap_id": 2714, "cover_url": "https://i.motiezw.com/cover/44/59284.jpg"}, {"title_hant": "轉生成為魔劍 10", "title_zh": "转生成为魔剑 10", "cover_id": 59416, "first_chap_id": 2719, "cover_url": "https://i.motiezw.com/cover/44/59416.jpg"}, {"title_hant": "轉生成為魔劍 11", "title_zh": "转生成为魔剑 11", "cover_id": 59559, "first_chap_id": 2725, "cover_url": "https://i.motiezw.com/cover/44/59559.jpg"}, {"title_hant": "轉生成為魔劍 12", "title_zh": "转生成为魔剑 12", "cover_id": 59690, "first_chap_id": 2731, "cover_url": "https://i.motiezw.com/cover/44/59690.jpg"}], "chapters": [{"cid": "2663", "title": "第1話 無名的黑貓", "title_zh": "第1话 无名的黑猫"}, {"cid": "2664", "title": "第2話 結果是劍", "title_zh": "第2话 结果是剑"}, {"cid": "2665", "title": "第3話 前往城鎮", "title_zh": "第3话 前往城镇"}, {"cid": "2666", "title": "第4話 芙蘭成為冒險者", "title_zh": "第4话 芙兰成为冒险者"}, {"cid": "2667", "title": "第5話 公會會長", "title_zh": "第5话 公会会长"}, {"cid": "2668", "title": "第6話 芙蘭生氣了", "title_zh": "第6话 芙兰生气了"}, {"cid": "2669", "title": "特別加筆小說 芙蘭與鬆餅", "title_zh": "特别加笔小说 芙兰与松饼"}, {"cid": "2671", "title": "第7話 卡魯斯爺爺", "title_zh": "第7话 卡鲁斯爷爷"}, {"cid": "2672", "title": "第8話 百頭斬", "title_zh": "第8话 百头斩"}, {"cid": "2673", "title": "第9話 神與迷宮", "title_zh": "第9话 神与迷宫"}, {"cid": "2674", "title": "第10話 哥布林迷宮攻略戰", "title_zh": "第10话 哥布林迷宫攻略战"}, {"cid": "2675", "title": "第11話 上級惡魔", "title_zh": "第11话 上级恶魔"}, {"cid": "2676", "title": "特別加筆小說 絕景溫泉與芙蘭", "title_zh": "特别加笔小说 绝景温泉与芙兰"}, {"cid": "2678", "title": "第12話 奥の手", "title_zh": "第12话 奥の手"}, {"cid": "2679", "title": "第13話 悪魔殺し", "title_zh": "第13话 悪魔杀し"}, {"cid": "2680", "title": "第14話 虚言の理", "title_zh": "第14话 虚言の理"}, {"cid": "2681", "title": "第15話 青猫族は……敵!", "title_zh": "第15话 青猫族は……敌!"}, {"cid": "2682", "title": "第16話 ランクAの帰還", "title_zh": "第16话 ランクAの帰还"}, {"cid": "2684", "title": "第17話 迷宮「蜘蛛の巣」へ", "title_zh": "第17话 迷宫「蜘蛛の巣」へ"}, {"cid": "2685", "title": "第18話 模擬戦", "title_zh": "第18话 模拟戦"}, {"cid": "2687", "title": "第20話 調查開始", "title_zh": "第20话 调查开始"}, {"cid": "2688", "title": "第21話 おおっと", "title_zh": "第21话 おおっと"}, {"cid": "2690", "title": "第22話 魔狼召喚", "title_zh": "第22话 魔狼召唤"}, {"cid": "2691", "title": "第23話 床を舐む", "title_zh": "第23话 床を舐む"}, {"cid": "2692", "title": "第24話 掃討", "title_zh": "第24话 扫讨"}, {"cid": "2693", "title": "第25話 踏破", "title_zh": "第25话 踏破"}, {"cid": "2694", "title": "第26話 冠名武具", "title_zh": "第26话 冠名武具"}, {"cid": "2695", "title": "第27話 行ってらっしゃい", "title_zh": "第27话 行ってらっしゃい"}, {"cid": "2697", "title": "第28話 空を征く", "title_zh": "第28话 空を征く"}, {"cid": "2698", "title": "第29話 不死との遭遇", "title_zh": "第29话 不死との遭遇"}, {"cid": "2699", "title": "第30話「普殺」の死霊術師", "title_zh": "第30话「普杀」の死霊术师"}, {"cid": "2700", "title": "第31話「名無し」の日記と空中防衛線", "title_zh": "第31话「名无し」の日记と空中防卫线"}, {"cid": "2701", "title": "第32話 死霊魔獣の巣窟", "title_zh": "第32话 死霊魔獣の巣窟"}, {"cid": "2703", "title": "第33話 死霊喰らい", "title_zh": "第33话 死霊喰らい"}, {"cid": "2704", "title": "第34話 DARK KNIGHT", "title_zh": "第34话 DARK KNIGHT"}, {"cid": "2705", "title": "第35話 死霊の王", "title_zh": "第35话 死霊の王"}, {"cid": "2706", "title": "第36話 死の舞踏", "title_zh": "第36话 死の舞踏"}, {"cid": "2708", "title": "第37話 Nameless", "title_zh": "第37话 Nameless"}, {"cid": "2709", "title": "第38話 怨念の濁流", "title_zh": "第38话 怨念の浊流"}, {"cid": "2710", "title": "第39話 ハローグッバイ", "title_zh": "第39话 ハローグッバイ"}, {"cid": "2712", "title": "第41話 港町ダーズ", "title_zh": "第41话 港町ダーズ"}, {"cid": "2714", "title": "第42話 フランと双子", "title_zh": "第42话 フランと双子"}, {"cid": "2715", "title": "第43話 海路を往く", "title_zh": "第43话 海路を往く"}, {"cid": "2716", "title": "第44話 海の厄介者", "title_zh": "第44话 海の厄介者"}, {"cid": "2717", "title": "第45話 一難去って…", "title_zh": "第45话 一难去って…"}, {"cid": "2719", "title": "第46話 牛獄より", "title_zh": "第46话 牛狱より"}, {"cid": "2720", "title": "第47話 プリズン・ブレイク", "title_zh": "第47话 プリズン・ブレイク"}, {"cid": "2721", "title": "第48話 救出作戦", "title_zh": "第48话 救出作戦"}, {"cid": "2722", "title": "第49話 黒獣VS黒牙", "title_zh": "第49话 黒獣VS黒牙"}, {"cid": "2723", "title": "第50話 脱出", "title_zh": "第50话 脱出"}, {"cid": "2725", "title": "第51話 フランの食卓", "title_zh": "第51话 フランの食卓"}, {"cid": "2726", "title": "第52話 蜂起", "title_zh": "第52话 蜂起"}, {"cid": "2727", "title": "第53話 もっかい救出作戦", "title_zh": "第53话 もっかい救出作戦"}, {"cid": "2728", "title": "第54話 郗剡の恋蘼", "title_zh": "第54话 郗剡の恋蘼"}, {"cid": "2729", "title": "第55話 地獄の饗宴", "title_zh": "第55话 地狱の飨宴"}, {"cid": "2731", "title": "第56話 王宮潜人", "title_zh": "第56话 王宫潜人"}, {"cid": "2732", "title": "第57話 それぞれの戦い", "title_zh": "第57话 それぞれの戦い"}, {"cid": "2733", "title": "第58話 決着", "title_zh": "第58话 决着"}, {"cid": "2734", "title": "第59話 シードラン革命", "title_zh": "第59话 シードラン革命"}, {"cid": "2735", "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>