diff --git a/controllers/api.js b/controllers/api.js index dc75156..85eede8 100644 --- a/controllers/api.js +++ b/controllers/api.js @@ -118,9 +118,21 @@ exports.manga = async (req, res)=> { for(let j = 0; j item.completely == true); + filteredArray.sort((a, b) => a.chapterNum - b.chapterNum); + const lastCompletelyRead = filteredArray.pop(); + const sortedChapters = chaptersRead.sort((a, b) => a.chapterNum - b.chapterNum); + const sortedAndFilteredChapters = sortedChapters.filter(item=> item.lastImageRead && !item.completely); + const lastChapterWithReadImages=sortedAndFilteredChapters.shift(); + const chapterNumToContinue = lastCompletelyRead?(lastCompletelyRead.chapterNum < lastChapterWithReadImages.chapterNum ? lastChapterWithReadImages.chapterNum:lastCompletelyRead.chapterNum):lastChapterWithReadImages.chapterNum; + manga.List[chapterNumToContinue-1]['continue'] = true; } catch (error) { diff --git a/public/css/home.css b/public/css/home.css index 3de4cc9..6c84531 100644 --- a/public/css/home.css +++ b/public/css/home.css @@ -444,7 +444,22 @@ button:hover margin-left: 10%; gap:5px; } -.list > .chapterButton +.shortcutWrapper +{ + width: 80%; + display: flex; + flex-direction: row; + flex-wrap: wrap; + justify-content: space-evenly; + border: 3px solid var(--border); + background-color: var(--bg); + border-radius: 15px; + margin-left: 10%; + gap: 5px; + margin-bottom: 1em; + text-align: center; +} +.chapterButton { border: 2px solid var(--border); border-radius: 15px; @@ -458,7 +473,7 @@ button:hover { border-color: var(--border-hover); } -.list > .chapterButton > a +.chapterButton > a { text-align: center; text-decoration: none; @@ -473,8 +488,8 @@ button:hover justify-content: center; height:100% } -.list > .chapterButton > a >.buttonWrapper > div > h4 , -.list > .chapterButton > a >.buttonWrapper > div > h5 +.chapterButton > a >.buttonWrapper > div > h4 , +.chapterButton > a >.buttonWrapper > div > h5 { margin: 0; } @@ -482,10 +497,14 @@ button:hover { height:auto; width:auto; - color:var(--text); + color: var(--purple-heart-400); position: relative; left: 0.7em; } +.readMarkerComplete +{ + color:var(--text); +} .infoCard > .infoText > .tags { display:flex; diff --git a/views/chapterButton.ejs b/views/chapterButton.ejs index 535bb55..e2a988b 100644 --- a/views/chapterButton.ejs +++ b/views/chapterButton.ejs @@ -2,7 +2,7 @@
<% if(chapter.Read){ %> - + beenhere <% } %> diff --git a/views/chapterPage.ejs b/views/chapterPage.ejs index 7f3ed76..30f6f26 100644 --- a/views/chapterPage.ejs +++ b/views/chapterPage.ejs @@ -3,7 +3,7 @@ - + Manga Reader diff --git a/views/chapterShortcutButtonRow.ejs b/views/chapterShortcutButtonRow.ejs new file mode 100644 index 0000000..0344b3c --- /dev/null +++ b/views/chapterShortcutButtonRow.ejs @@ -0,0 +1,17 @@ +
+
+

First:

+ <%- include('chapterButton.ejs', {chapter:List[0], scanlator, title}) %> +
+ + <%for(let i = 0; i +
+

Continue:

+ <%- include('chapterButton.ejs', {chapter:List[i], scanlator, title}) %> +
+ <%}}%> +
+

Last:

+ <%- include('chapterButton.ejs', {chapter:List[List.length-1],}) %> +
+
\ No newline at end of file diff --git a/views/display.ejs b/views/display.ejs index c848beb..bab0fd3 100644 --- a/views/display.ejs +++ b/views/display.ejs @@ -51,6 +51,7 @@