From 6670dfcbd841bd6d6bf54fd1f987c6fcb363936a Mon Sep 17 00:00:00 2001 From: Batorian <53831711+Batorian@users.noreply.github.com> Date: Thu, 23 Jan 2025 09:56:25 +0100 Subject: [PATCH] Improvement: Novel Updates: Arcane Translations CSS Additions (#1451) * novel_updates: added GreenzTL * novel_updates: fix skydemonorder * novel_updates: add styles to arcanetranslations * novel_updates: revert version change * novel_updates: update arcanetranslations * novel_updates: fix white box * novel_updates: revert version --- .../static/src/en/novelupdates/customCSS.css | 19 ++++++++ src/plugins/english/novelupdates.ts | 45 ++++++++++--------- 2 files changed, 44 insertions(+), 20 deletions(-) diff --git a/public/static/src/en/novelupdates/customCSS.css b/public/static/src/en/novelupdates/customCSS.css index b96298b..f9c023c 100644 --- a/public/static/src/en/novelupdates/customCSS.css +++ b/public/static/src/en/novelupdates/customCSS.css @@ -14,6 +14,15 @@ z-index: 1; } +.arcane_box_white { + display: block; + text-align: center; + border: 2px solid white; + padding: 20px; + box-shadow: 0 0 10px white; + background-color: black; +} + .arcane_title_blue { color: white; font-weight: bold; @@ -29,6 +38,16 @@ text-shadow: 0 0 8px blue; } +.arcane_text_lightyellow { + color: white; + text-shadow: 0 0 8px lightyellow; + font-family: 'Amita', cursive; +} + +.arcane_text_pink { + color: #ff00ff; +} + /** * Novel Updates -> Daoist Quest * https://www.novelupdates.com/group/daoist-quest/ diff --git a/src/plugins/english/novelupdates.ts b/src/plugins/english/novelupdates.ts index 1c1180d..ec6b3ab 100644 --- a/src/plugins/english/novelupdates.ts +++ b/src/plugins/english/novelupdates.ts @@ -6,7 +6,7 @@ import { Plugin } from '@typings/plugin'; class NovelUpdates implements Plugin.PluginBase { id = 'novelupdates'; name = 'Novel Updates'; - version = '0.7.13'; + version = '0.7.14'; icon = 'src/en/novelupdates/icon.png'; customCSS = 'src/en/novelupdates/customCSS.css'; site = 'https://www.novelupdates.com/'; @@ -211,32 +211,37 @@ class NovelUpdates implements Plugin.PluginBase { chapterContent = loadedCheerio('#spliced-comic').html()!; chapterText = `

${chapterTitle}



${chapterContent}`; break; - // Last edited in 0.7.13 - 21/01/2025 + // Last edited in 0.7.14 - 22/01/2025 case 'arcanetranslations': bloatElements = ['.bottomnav']; bloatElements.forEach(tag => loadedCheerio(tag).remove()); chapterTitle = loadedCheerio('.epwrapper .cat-series').first().text(); - loadedCheerio('.entry-content div').each((_, element) => { - const el = loadedCheerio(element); - const style = el.attr('style'); + loadedCheerio('.entry-content div, .entry-content span').each( + (_, element) => { + const el = loadedCheerio(element); + const style = el.attr('style'); - if (!style) return; // Skip elements without inline styles + if (!style) return; // Skip elements without inline styles - // Check for specific styles - if (/border:.*#00219b/.test(style)) { - // Check if 'border' contains '#00219b' - el.removeAttr('style').addClass('arcane_box_blue'); - } else if ( - style.includes('text-transform: uppercase') && - /text-shadow:.*blue/.test(style) // Check if 'text-shadow' contains 'blue' - ) { - el.removeAttr('style').addClass('arcane_title_blue'); - } else if (/text-shadow:.*blue/.test(style)) { - // Check if 'text-shadow' contains 'blue' - el.removeAttr('style').addClass('arcane_text_blue'); - } - }); + if (/border:.*#00219b/.test(style)) { + el.removeAttr('style').addClass('arcane_box_blue'); // Blue box + } else if (/border:.*white/.test(style)) { + el.removeAttr('style').addClass('arcane_box_white'); // White box + } else if ( + style.includes('text-transform: uppercase') && + /text-shadow:.*blue/.test(style) + ) { + el.removeAttr('style').addClass('arcane_title_blue'); // Blue title + } else if (/text-shadow:.*blue/.test(style)) { + el.removeAttr('style').addClass('arcane_text_blue'); // Blue text + } else if (/text-shadow:.*lightyellow/.test(style)) { + el.removeAttr('style').addClass('arcane_text_lightyellow'); // Lightyellow text + } else if (/color:.*#ff00ff/.test(style)) { + el.removeAttr('style').addClass('arcane_text_pink'); // Pink text + } + }, + ); chapterContent = loadedCheerio('.entry-content').html()!; chapterText = `

${chapterTitle}



${chapterContent}`;