diff --git a/alacarte-novel-website/chapters.html b/alacarte-novel-website/chapters.html index 96dac3f..30dac41 100644 --- a/alacarte-novel-website/chapters.html +++ b/alacarte-novel-website/chapters.html @@ -46,7 +46,7 @@

阿拉德:剑之回响

-

共 39 章 · 连载中

+

39 章 · 连载中

@@ -119,14 +119,32 @@
- + diff --git a/alacarte-novel-website/js/app.js b/alacarte-novel-website/js/app.js index 0b85d77..c314f49 100644 --- a/alacarte-novel-website/js/app.js +++ b/alacarte-novel-website/js/app.js @@ -180,7 +180,10 @@ function renderChaptersList() { const container = document.getElementById('chaptersList'); if (!container) return; - container.innerHTML = chaptersData.map(chapter => ` + // 优先使用从JSON动态加载的数据 + const data = window.chaptersData || chaptersData; + + container.innerHTML = data.map(chapter => `
@@ -211,12 +214,13 @@ function setupFilters() { function filterChapters(filter) { const items = document.querySelectorAll('.timeline-item'); + const data = window.chaptersData || chaptersData; items.forEach((item, index) => { let show = true; if (filter === 'latest') { - show = index >= items.length - 5; + show = index >= data.length - 5; } else if (filter === 'unread') { const chapterId = parseInt(item.dataset.chapter); const readChapters = JSON.parse(localStorage.getItem('readChapters') || '[]'); @@ -259,7 +263,8 @@ function setupSearch() { function updateReadingProgress() { const readChapters = JSON.parse(localStorage.getItem('readChapters') || '[]'); - const progress = Math.round((readChapters.length / chaptersData.length) * 100); + const data = window.chaptersData || chaptersData; + const progress = Math.round((readChapters.length / data.length) * 100); const progressFill = document.getElementById('progressFill'); const progressText = document.getElementById('progressText');