From 5520cba68dfbf19a98a9b5f1bb962f487cc79345 Mon Sep 17 00:00:00 2001 From: bingus_violet Date: Sun, 2 Jun 2024 23:57:53 -0500 Subject: [PATCH] Can now change if words are case sensitive or not --- constants.json | 145 +++- output.json | 2153 ------------------------------------------------ pageUpdater.js | 11 +- 3 files changed, 118 insertions(+), 2191 deletions(-) delete mode 100644 output.json diff --git a/constants.json b/constants.json index 71293a1..9477f92 100644 --- a/constants.json +++ b/constants.json @@ -42,41 +42,114 @@ "https://axiomatic-hair-production.up.railway.app/" ], "highlightedWords": { - "birds": "yellow", - "Pissing": "yellow", - "Starwalker": "yellow", - "word highlighting": "yellow", - "replaceAll": "limegreen", - "Godot Engine": "#64B5F6", - "Javascript": "yellow", - "NodeJS": "limegreen", - "Violet": "rgb(200, 150, 255)", - "Purgatory": "rgb(200, 150, 255)", - "Asahi": "rgb(255, 175, 175)", - "Lunya": "rgb(255, 175, 175)", - "bisexual": "rgb(214, 2, 112)", - "enby": "rgb(252, 244, 52)", - "Youtube": "rgb(255, 0, 0)", - "Fedi": "rgb(175, 125, 200)", - "Matrix": "limegreen", - "Element": "rgb(100, 255, 200)", - "Codeberg": "rgb(0, 255, 255)", - "Code": "rgb(150, 175, 255)", - "Docker": "blue", - "Github": "gray", - "Steam": "lightgray", - "Univerter": "rgb(200, 175, 255)", - "Ko-fi": "rgb(255, 150, 150)", - "Revolt": "rgb(255, 50, 50)", - "Discord": "rgb(150, 150, 255)", - "SearXNG": "rgb(100, 100, 255)", - "Highlighting": "yellow", - "highlighted": "yellow", - "Forgejo": "orange", - "HTML": "orange", - "CSS": "rgb(50, 200, 255)", - "Thumbor": "rgb(225, 225, 255)", - "Spotify": "limegreen", - "Ultrakill": "red" + "birds": { + "color": "yellow" + }, + "Pissing": { + "color": "yellow" + }, + "Starwalker": { + "color": "yellow" + }, + "word highlighting": { + "color": "yellow" + }, + "replaceAll": { + "color": "limegreen" + }, + "Godot Engine": { + "color": "#64B5F6" + }, + "Javascript": { + "color": "yellow" + }, + "NodeJS": { + "color": "limegreen" + }, + "Violet": { + "color": "rgb(200, 150, 255)" + }, + "Purgatory": { + "color": "rgb(200, 150, 255)" + }, + "Asahi": { + "color": "rgb(255, 175, 175)" + }, + "Lunya": { + "color": "rgb(255, 175, 175)" + }, + "bisexual": { + "color": "rgb(214, 2, 112)" + }, + "enby": { + "color": "rgb(252, 244, 52)" + }, + "Youtube": { + "color": "rgb(255, 0, 0)" + }, + "Fedi": { + "color": "rgb(175, 125, 200)" + }, + "Matrix": { + "color": "limegreen" + }, + "Element": { + "color": "rgb(100, 255, 200)" + }, + "Codeberg": { + "color": "rgb(0, 255, 255)" + }, + "Code": { + "color": "rgb(150, 175, 255)" + }, + "Docker": { + "color": "blue" + }, + "Github": { + "color": "gray" + }, + "Steam": { + "color": "lightgray" + }, + "Univerter": { + "color": "rgb(200, 175, 255)" + }, + "Ko-fi": { + "color": "rgb(255, 150, 150)" + }, + "Revolt": { + "color": "rgb(255, 50, 50)" + }, + "Discord": { + "color": "rgb(150, 150, 255)" + }, + "SearXNG": { + "color": "rgb(100, 100, 255)" + }, + "Highlighting": { + "color": "yellow" + }, + "highlighted": { + "color": "yellow" + }, + "Forgejo": { + "color": "orange" + }, + "HTML": { + "color": "orange" + }, + "CSS": { + "color": "rgb(50, 200, 255)" + }, + "Thumbor": { + "color": "rgb(225, 225, 255)" + }, + "Spotify": { + "color": "limegreen" + }, + "Ultrakill": { + "color": "red", + "caseInsensitive": true + } } } \ No newline at end of file diff --git a/output.json b/output.json deleted file mode 100644 index 05ae4e9..0000000 --- a/output.json +++ /dev/null @@ -1,2153 +0,0 @@ -[ - { - "type": "element", - "tagName": "!doctype", - "attributes": [ - { - "key": "html", - "value": null - } - ], - "children": [] - }, - { - "type": "element", - "tagName": "html", - "attributes": [ - { - "key": "lang", - "value": "en" - } - ], - "children": [ - { - "type": "element", - "tagName": "head", - "attributes": [], - "children": [ - { - "type": "element", - "tagName": "link", - "attributes": [ - { - "key": "rel", - "value": "stylesheet" - }, - { - "key": "type", - "value": "text/css" - }, - { - "key": "href", - "value": "./style.css" - } - ], - "children": [] - }, - { - "type": "element", - "tagName": "link", - "attributes": [ - { - "key": "rel", - "value": "stylesheet" - }, - { - "key": "type", - "value": "text/css" - }, - { - "key": "href", - "value": "./root.css" - } - ], - "children": [] - }, - { - "type": "element", - "tagName": "noscript", - "attributes": [], - "children": [ - { - "type": "element", - "tagName": "link", - "attributes": [ - { - "key": "rel", - "value": "stylesheet" - }, - { - "key": "href", - "value": "./noScript.css" - } - ], - "children": [] - } - ] - }, - { - "type": "element", - "tagName": "script", - "attributes": [ - { - "key": "src", - "value": "./main.js" - } - ], - "children": [] - }, - { - "type": "element", - "tagName": "meta", - "attributes": [ - { - "key": "charset", - "value": "UTF-8" - } - ], - "children": [] - }, - { - "type": "element", - "tagName": "meta", - "attributes": [ - { - "key": "name", - "value": "viewport" - }, - { - "key": "content", - "value": "width=device-width, initial-scale=1.0" - } - ], - "children": [] - }, - { - "type": "element", - "tagName": "title", - "attributes": [], - "children": [ - { - "type": "text", - "content": "Violet's Purgatory" - } - ] - }, - { - "type": "element", - "tagName": "meta", - "attributes": [ - { - "key": "name", - "value": "darkreader-lock" - } - ], - "children": [] - }, - { - "type": "element", - "tagName": "meta", - "attributes": [ - { - "key": "content", - "value": "Violet's Purgatory" - }, - { - "key": "property", - "value": "og:title" - } - ], - "children": [] - }, - { - "type": "element", - "tagName": "meta", - "attributes": [ - { - "key": "content", - "value": "Hi, I'm Violet, a 15 year old web & game developer. My site has info about me, so please visit!" - }, - { - "key": "property", - "value": "og:description" - } - ], - "children": [] - }, - { - "type": "element", - "tagName": "meta", - "attributes": [ - { - "key": "content", - "value": "https://api.violets-purgatory.dev/v1/pfp" - }, - { - "key": "property", - "value": "og:image" - } - ], - "children": [] - }, - { - "type": "element", - "tagName": "meta", - "attributes": [ - { - "key": "content", - "value": "#a200ff" - }, - { - "key": "data-react-helmet", - "value": "true" - }, - { - "key": "name", - "value": "theme-color" - } - ], - "children": [] - } - ] - }, - { - "type": "element", - "tagName": "body", - "attributes": [], - "children": [ - { - "type": "element", - "tagName": "h1", - "attributes": [ - { - "key": "class", - "value": "animatedTitle" - } - ], - "children": [ - { - "type": "text", - "content": "Welcome to " - }, - { - "type": "element", - "tagName": "span", - "attributes": [ - { - "key": "class", - "value": "mainTitle" - } - ], - "children": [ - { - "type": "text", - "content": "Violet's Purgatory" - } - ] - }, - { - "type": "element", - "tagName": "span", - "attributes": [ - { - "key": "class", - "value": "note" - } - ], - "children": [ - { - "type": "text", - "content": "Commit 511" - } - ] - } - ] - }, - { - "type": "element", - "tagName": "main", - "attributes": [ - { - "key": "class", - "value": "animatedMain" - } - ], - "children": [ - { - "type": "element", - "tagName": "p", - "attributes": [], - "children": [ - { - "type": "text", - "content": "Make sure to check out this project on " - }, - { - "type": "element", - "tagName": "a", - "attributes": [ - { - "key": "href", - "value": "https://git.violets-purgatory.dev/bingus_violet/violets-purgatory" - } - ], - "children": [ - { - "type": "text", - "content": "Forgejo" - } - ] - }, - { - "type": "text", - "content": "!" - } - ] - }, - { - "type": "element", - "tagName": "hr", - "attributes": [], - "children": [] - }, - { - "type": "element", - "tagName": "div", - "attributes": [ - { - "key": "id", - "value": "card" - } - ], - "children": [ - { - "type": "element", - "tagName": "h2", - "attributes": [], - "children": [ - { - "type": "text", - "content": "{Violet}" - } - ] - }, - { - "type": "element", - "tagName": "div", - "attributes": [ - { - "key": "style", - "value": "display:flex;justify-content:center;align-items:center" - } - ], - "children": [ - { - "type": "element", - "tagName": "div", - "attributes": [ - { - "key": "style", - "value": "width:50%" - } - ], - "children": [ - { - "type": "element", - "tagName": "img", - "attributes": [ - { - "key": "draggable", - "value": "false" - }, - { - "key": "src", - "value": "https://api.violets-purgatory.dev/v1/pfp" - }, - { - "key": "class", - "value": "pfp" - } - ], - "children": [] - } - ] - }, - { - "type": "element", - "tagName": "div", - "attributes": [ - { - "key": "style", - "value": "width:50%" - } - ], - "children": [ - { - "type": "element", - "tagName": "div", - "attributes": [ - { - "key": "style", - "value": "float:left" - } - ], - "children": [ - { - "type": "element", - "tagName": "p", - "attributes": [], - "children": [ - { - "type": "text", - "content": "They/Them" - } - ] - }, - { - "type": "element", - "tagName": "p", - "attributes": [], - "children": [ - { - "type": "text", - "content": "Developer" - } - ] - }, - { - "type": "element", - "tagName": "p", - "attributes": [], - "children": [ - { - "type": "element", - "tagName": "span", - "attributes": [ - { - "key": "style", - "value": "color: rgb(100, 255, 100);" - }, - { - "key": "class", - "value": "statusColor" - } - ], - "children": [ - { - "type": "text", - "content": "Online" - } - ] - }, - { - "type": "element", - "tagName": "style", - "attributes": [], - "children": [ - { - "type": "text", - "content": ".pfp { border-color: rgb(100, 255, 100) }" - } - ] - } - ] - } - ] - } - ] - } - ] - }, - { - "type": "element", - "tagName": "p", - "attributes": [ - { - "key": "class", - "value": "noscript" - } - ], - "children": [ - { - "type": "text", - "content": "Violet has been spun 17 times!" - } - ] - }, - { - "type": "element", - "tagName": "p", - "attributes": [ - { - "key": "class", - "value": "spinnyCount" - }, - { - "key": "style", - "value": "display:none" - } - ], - "children": [ - { - "type": "text", - "content": "You have spun Violet " - }, - { - "type": "element", - "tagName": "span", - "attributes": [ - { - "key": "class", - "value": "localSpins" - } - ], - "children": [ - { - "type": "text", - "content": "4" - } - ] - }, - { - "type": "text", - "content": " times!" - }, - { - "type": "element", - "tagName": "br", - "attributes": [], - "children": [] - }, - { - "type": "text", - "content": "Everyone has spun Violet " - }, - { - "type": "element", - "tagName": "span", - "attributes": [ - { - "key": "class", - "value": "globalSpins" - } - ], - "children": [ - { - "type": "text", - "content": "17" - } - ] - }, - { - "type": "text", - "content": " times!" - } - ] - }, - { - "type": "element", - "tagName": "hr", - "attributes": [], - "children": [] - }, - { - "type": "element", - "tagName": "div", - "attributes": [], - "children": [ - { - "type": "element", - "tagName": "p", - "attributes": [ - { - "key": "style", - "value": "padding:10px" - } - ], - "children": [ - { - "type": "text", - "content": "Hi! I'm Violet, a 15 year old web and game developer. I make server-sided dynamic websites, with no Javascript required! I'm currently making games in the Godot Engine, and my dynamic sites in NodeJS." - } - ] - }, - { - "type": "element", - "tagName": "div", - "attributes": [ - { - "key": "class", - "value": "linkContainer" - } - ], - "children": [ - { - "type": "element", - "tagName": "a", - "attributes": [ - { - "key": "class", - "value": "chip" - }, - { - "key": "href", - "value": "./socials/" - } - ], - "children": [ - { - "type": "text", - "content": "Socials" - } - ] - }, - { - "type": "element", - "tagName": "a", - "attributes": [ - { - "key": "class", - "value": "chip" - }, - { - "key": "href", - "value": "https://blog.violets-purgatory.dev" - } - ], - "children": [ - { - "type": "text", - "content": "Blog" - } - ] - }, - { - "type": "element", - "tagName": "a", - "attributes": [ - { - "key": "class", - "value": "chip" - }, - { - "key": "href", - "value": "./faq" - } - ], - "children": [ - { - "type": "text", - "content": "Nerd FAQ" - } - ] - }, - { - "type": "element", - "tagName": "a", - "attributes": [ - { - "key": "class", - "value": "chip" - }, - { - "key": "href", - "value": "https://{BRANCH_SUB}violets-purgatory.dev" - } - ], - "children": [ - { - "type": "text", - "content": "Beta site" - } - ] - }, - { - "type": "element", - "tagName": "a", - "attributes": [ - { - "key": "class", - "value": "chip" - }, - { - "key": "href", - "value": "https://fs.violets-purgatory.dev" - } - ], - "children": [ - { - "type": "text", - "content": "FileShare" - } - ] - } - ] - }, - { - "type": "element", - "tagName": "div", - "attributes": [ - { - "key": "class", - "value": "customStatus" - } - ], - "children": [] - } - ] - } - ] - }, - { - "type": "element", - "tagName": "p", - "attributes": [], - "children": [ - { - "type": "text", - "content": "World's Worst Developer" - } - ] - }, - { - "type": "element", - "tagName": "div", - "attributes": [ - { - "key": "id", - "value": "activityHtml" - } - ], - "children": [ - { - "type": "element", - "tagName": "h2", - "attributes": [], - "children": [ - { - "type": "element", - "tagName": "hr", - "attributes": [], - "children": [] - }, - { - "type": "text", - "content": "What I'm up to:" - } - ] - }, - { - "type": "element", - "tagName": "div", - "attributes": [ - { - "key": "class", - "value": "activity-container" - } - ], - "children": [ - { - "type": "text", - "content": "\n " - }, - { - "type": "element", - "tagName": "div", - "attributes": [ - { - "key": "class", - "value": "chip activity grid-child" - } - ], - "children": [ - { - "type": "text", - "content": "\n " - }, - { - "type": "element", - "tagName": "img", - "attributes": [ - { - "key": "src", - "value": "/cached/24681403300.png" - }, - { - "key": "title", - "value": "TOHO BOSSA NOVA 2" - } - ], - "children": [] - }, - { - "type": "text", - "content": "\n " - }, - { - "type": "element", - "tagName": "p", - "attributes": [], - "children": [ - { - "type": "text", - "content": "\n Listening to Spotify\n " - }, - { - "type": "element", - "tagName": "br", - "attributes": [], - "children": [] - }, - { - "type": "text", - "content": " Song: タイニーリトル・アジアンタム\n \n " - }, - { - "type": "element", - "tagName": "br", - "attributes": [], - "children": [] - }, - { - "type": "text", - "content": " Album: TOHO BOSSA NOVA 2\n " - }, - { - "type": "element", - "tagName": "br", - "attributes": [], - "children": [] - }, - { - "type": "text", - "content": " Artist: ShibayanRecords\n \n " - }, - { - "type": "element", - "tagName": "br", - "attributes": [], - "children": [] - }, - { - "type": "text", - "content": "\n " - }, - { - "type": "element", - "tagName": "span", - "attributes": [ - { - "key": "class", - "value": "lengthBar lengthBar0" - } - ], - "children": [ - { - "type": "element", - "tagName": "span", - "attributes": [], - "children": [] - } - ] - }, - { - "type": "text", - "content": "\n 5:51\n " - } - ] - }, - { - "type": "text", - "content": "\n " - } - ] - }, - { - "type": "text", - "content": "\n " - }, - { - "type": "element", - "tagName": "style", - "attributes": [], - "children": [ - { - "type": "text", - "content": "\n \n .lengthBar0 > span {\n animation-name: songSlider0;\n animation-duration: 261s;\n animation-timing-function: linear;\n }\n \n @keyframes songSlider0 {\n 0% {\n width: 25.66894586894587%;\n }\n 100% {\n width: 100%;\n }\n }\n " - } - ] - }, - { - "type": "text", - "content": "\n \n " - }, - { - "type": "element", - "tagName": "div", - "attributes": [ - { - "key": "class", - "value": "chip activity grid-child" - } - ], - "children": [ - { - "type": "text", - "content": "\n " - }, - { - "type": "element", - "tagName": "img", - "attributes": [ - { - "key": "src", - "value": "/cached/28034009225.png" - }, - { - "key": "title", - "value": "Editing a JS file" - } - ], - "children": [] - }, - { - "type": "text", - "content": "\n " - }, - { - "type": "element", - "tagName": "img", - "attributes": [ - { - "key": "class", - "value": "smallimg" - }, - { - "key": "src", - "value": "/cached/5034082571.png" - }, - { - "key": "title", - "value": "VSCodium" - } - ], - "children": [] - }, - { - "type": "text", - "content": "\n " - }, - { - "type": "element", - "tagName": "p", - "attributes": [], - "children": [ - { - "type": "text", - "content": "\n Playing " - }, - { - "type": "element", - "tagName": "span", - "attributes": [ - { - "key": "style", - "value": "color: rgb(255, 100, 150);" - } - ], - "children": [ - { - "type": "text", - "content": "Code" - } - ] - }, - { - "type": "text", - "content": " \n " - }, - { - "type": "element", - "tagName": "br", - "attributes": [], - "children": [] - }, - { - "type": "text", - "content": "In Violets-Purgatory - 0 problems found\n " - }, - { - "type": "element", - "tagName": "br", - "attributes": [], - "children": [] - }, - { - "type": "text", - "content": "Working on pageUpdater.js:169:62\n " - }, - { - "type": "element", - "tagName": "br", - "attributes": [], - "children": [] - }, - { - "type": "text", - "content": " 3 hours and 33 minutes\n " - } - ] - }, - { - "type": "text", - "content": "\n " - } - ] - }, - { - "type": "text", - "content": "\n " - } - ] - } - ] - }, - { - "type": "comment", - "content": "


Announcement!

\n

Blah blah blah blah...

" - }, - { - "type": "element", - "tagName": "h2", - "attributes": [], - "children": [ - { - "type": "element", - "tagName": "hr", - "attributes": [], - "children": [] - }, - { - "type": "text", - "content": "Services" - } - ] - }, - { - "type": "element", - "tagName": "p", - "attributes": [], - "children": [ - { - "type": "text", - "content": "List of services for public use hosted on Violet's Purgatory." - } - ] - }, - { - "type": "element", - "tagName": "a", - "attributes": [ - { - "key": "href", - "value": "https://sxng.violets-purgatory.dev" - }, - { - "key": "class", - "value": "chip" - } - ], - "children": [ - { - "type": "text", - "content": "SearXNG: sxng.violets-purgatory.dev" - } - ] - }, - { - "type": "element", - "tagName": "a", - "attributes": [ - { - "key": "class", - "value": "chip" - } - ], - "children": [ - { - "type": "text", - "content": "Matrix: matrix.violets-purgatory.dev" - } - ] - }, - { - "type": "element", - "tagName": "a", - "attributes": [ - { - "key": "href", - "value": "https://element.violets-purgatory.dev" - }, - { - "key": "class", - "value": "chip" - } - ], - "children": [ - { - "type": "text", - "content": "Element: element.violets-purgatory.dev" - } - ] - }, - { - "type": "element", - "tagName": "a", - "attributes": [ - { - "key": "href", - "value": "https://git.violets-purgatory.dev" - }, - { - "key": "class", - "value": "chip" - } - ], - "children": [ - { - "type": "text", - "content": "Forgejo: git.violets-purgatory.dev (contact me for an account)" - } - ] - }, - { - "type": "element", - "tagName": "a", - "attributes": [ - { - "key": "class", - "value": "chip" - } - ], - "children": [ - { - "type": "text", - "content": "Thumbor: thumbor.violets-purgatory.dev" - } - ] - }, - { - "type": "element", - "tagName": "hr", - "attributes": [], - "children": [] - }, - { - "type": "element", - "tagName": "h1", - "attributes": [], - "children": [ - { - "type": "text", - "content": "Socials" - } - ] - }, - { - "type": "text", - "content": "\n " - }, - { - "type": "element", - "tagName": "p", - "attributes": [], - "children": [ - { - "type": "text", - "content": "Here's most of the sites you can find me on-" - }, - { - "type": "element", - "tagName": "br", - "attributes": [], - "children": [] - }, - { - "type": "text", - "content": "if you needed that for some reason?" - } - ] - }, - { - "type": "text", - "content": "\n " - }, - { - "type": "element", - "tagName": "div", - "attributes": [ - { - "key": "class", - "value": "grid-container" - } - ], - "children": [ - { - "type": "text", - "content": "\n " - }, - { - "type": "element", - "tagName": "div", - "attributes": [ - { - "key": "class", - "value": "grid-child" - } - ], - "children": [ - { - "type": "text", - "content": "\n " - }, - { - "type": "element", - "tagName": "div", - "attributes": [], - "children": [ - { - "type": "text", - "content": "\n " - }, - { - "type": "element", - "tagName": "h3", - "attributes": [], - "children": [ - { - "type": "text", - "content": "Social Media" - } - ] - }, - { - "type": "text", - "content": "\n " - }, - { - "type": "element", - "tagName": "a", - "attributes": [ - { - "key": "class", - "value": "chip" - }, - { - "key": "href", - "value": "https://floofy.city/@bingus_violet" - }, - { - "key": "rel", - "value": "me" - } - ], - "children": [ - { - "type": "text", - "content": "Fedi: bingus_violet​@floofy.city" - } - ] - }, - { - "type": "text", - "content": "\n " - }, - { - "type": "element", - "tagName": "a", - "attributes": [ - { - "key": "class", - "value": "chip" - }, - { - "key": "href", - "value": "https://www.youtube.com/channel/UChcrBJNJLZucy3TPyGyAY2g" - } - ], - "children": [ - { - "type": "text", - "content": "Youtube: {Violet}'s Fiasco" - } - ] - }, - { - "type": "text", - "content": "\n " - }, - { - "type": "element", - "tagName": "a", - "attributes": [ - { - "key": "class", - "value": "chip" - }, - { - "key": "href", - "value": "https://ko-fi.com/bingus_violet" - } - ], - "children": [ - { - "type": "text", - "content": "Ko-fi: Bingus_{Violet}" - } - ] - }, - { - "type": "text", - "content": "\n " - } - ] - }, - { - "type": "text", - "content": "\n " - } - ] - }, - { - "type": "text", - "content": "\n " - }, - { - "type": "element", - "tagName": "div", - "attributes": [ - { - "key": "class", - "value": "grid-child" - } - ], - "children": [ - { - "type": "text", - "content": "\n " - }, - { - "type": "element", - "tagName": "div", - "attributes": [], - "children": [ - { - "type": "text", - "content": "\n " - }, - { - "type": "element", - "tagName": "h3", - "attributes": [], - "children": [ - { - "type": "text", - "content": "Chat" - } - ] - }, - { - "type": "text", - "content": "\n " - }, - { - "type": "element", - "tagName": "a", - "attributes": [ - { - "key": "class", - "value": "chip" - }, - { - "key": "href", - "value": "https://matrix.to/#/@bingus_violet:matrix.violets-purgatory.dev" - } - ], - "children": [ - { - "type": "text", - "content": "Matrix: @bingus_violet:​matrix.violets-purgatory.dev" - } - ] - }, - { - "type": "text", - "content": "\n " - }, - { - "type": "element", - "tagName": "a", - "attributes": [ - { - "key": "class", - "value": "chip" - } - ], - "children": [ - { - "type": "text", - "content": "Discord: bingus_violet" - } - ] - }, - { - "type": "text", - "content": "\n " - }, - { - "type": "element", - "tagName": "a", - "attributes": [ - { - "key": "class", - "value": "chip" - } - ], - "children": [ - { - "type": "text", - "content": "Revolt: Bingus{Violet}#5573" - } - ] - }, - { - "type": "text", - "content": "\n " - } - ] - }, - { - "type": "text", - "content": "\n " - } - ] - }, - { - "type": "text", - "content": "\n " - }, - { - "type": "element", - "tagName": "div", - "attributes": [ - { - "key": "class", - "value": "grid-child" - } - ], - "children": [ - { - "type": "text", - "content": "\n " - }, - { - "type": "element", - "tagName": "div", - "attributes": [], - "children": [ - { - "type": "text", - "content": "\n " - }, - { - "type": "element", - "tagName": "h3", - "attributes": [], - "children": [ - { - "type": "text", - "content": "Coding" - } - ] - }, - { - "type": "text", - "content": "\n " - }, - { - "type": "element", - "tagName": "a", - "attributes": [ - { - "key": "class", - "value": "chip" - }, - { - "key": "href", - "value": "https://git.violets-purgatory.dev/bingus_violet/" - } - ], - "children": [ - { - "type": "text", - "content": "Forgejo: bingus_violet (git.violets-purgatory.dev)" - } - ] - }, - { - "type": "text", - "content": "\n " - }, - { - "type": "element", - "tagName": "a", - "attributes": [ - { - "key": "class", - "value": "chip" - }, - { - "key": "href", - "value": "https://codeberg.org/Bingus_violet" - } - ], - "children": [ - { - "type": "text", - "content": "Codeberg: bingus_violet" - } - ] - }, - { - "type": "text", - "content": "\n " - }, - { - "type": "element", - "tagName": "a", - "attributes": [ - { - "key": "class", - "value": "chip" - }, - { - "key": "href", - "value": "https://hub.docker.com/u/bingusviolet" - } - ], - "children": [ - { - "type": "text", - "content": "Docker: bingusviolet" - } - ] - }, - { - "type": "text", - "content": "\n " - }, - { - "type": "element", - "tagName": "a", - "attributes": [ - { - "key": "class", - "value": "chip" - }, - { - "key": "href", - "value": "https://github.com/violets-puragtory" - } - ], - "children": [ - { - "type": "text", - "content": "Github: violets-puragtory" - } - ] - }, - { - "type": "text", - "content": "\n " - } - ] - }, - { - "type": "text", - "content": "\n " - } - ] - }, - { - "type": "text", - "content": "\n " - }, - { - "type": "element", - "tagName": "div", - "attributes": [ - { - "key": "class", - "value": "grid-child" - } - ], - "children": [ - { - "type": "text", - "content": "\n " - }, - { - "type": "element", - "tagName": "div", - "attributes": [], - "children": [ - { - "type": "text", - "content": "\n " - }, - { - "type": "element", - "tagName": "h3", - "attributes": [], - "children": [ - { - "type": "text", - "content": "Games" - } - ] - }, - { - "type": "text", - "content": "\n " - }, - { - "type": "element", - "tagName": "a", - "attributes": [ - { - "key": "class", - "value": "chip" - }, - { - "key": "href", - "value": "https://steamcommunity.com/id/violet-The-Thigh-high-obtainer/" - } - ], - "children": [ - { - "type": "text", - "content": "Steam: {Violet}" - } - ] - }, - { - "type": "text", - "content": "\n " - } - ] - }, - { - "type": "text", - "content": "\n " - } - ] - }, - { - "type": "text", - "content": "\n " - } - ] - }, - { - "type": "text", - "content": "\n " - }, - { - "type": "element", - "tagName": "br", - "attributes": [], - "children": [] - }, - { - "type": "text", - "content": "\n " - }, - { - "type": "element", - "tagName": "br", - "attributes": [], - "children": [] - }, - { - "type": "element", - "tagName": "h1", - "attributes": [], - "children": [ - { - "type": "element", - "tagName": "hr", - "attributes": [], - "children": [] - }, - { - "type": "text", - "content": "FAQ" - } - ] - }, - { - "type": "text", - "content": "\n " - }, - { - "type": "element", - "tagName": "h3", - "attributes": [], - "children": [ - { - "type": "text", - "content": "Why are so many words colored?" - } - ] - }, - { - "type": "text", - "content": "\n " - }, - { - "type": "element", - "tagName": "p", - "attributes": [], - "children": [ - { - "type": "text", - "content": "I like the way it looks to have certain words be highlighted, makes it look fancier and easier to read (imo). So, when I remade this site, I went ahead and added an " - }, - { - "type": "element", - "tagName": "em", - "attributes": [], - "children": [ - { - "type": "text", - "content": "Automatic Word Highlighting System!" - } - ] - }, - { - "type": "text", - "content": " This allows me have words automatically highlighted, on the server side, without having to do it in the code manually. Here's the current list of highlighted words:" - } - ] - }, - { - "type": "text", - "content": "\n " - }, - { - "type": "element", - "tagName": "p", - "attributes": [ - { - "key": "class", - "value": "textBlock" - } - ], - "children": [ - { - "type": "text", - "content": "birds, Pissing, Starwalker, word highlighting, replaceAll, Godot Engine, Javascript, NodeJS, Violet's, Violet, Asahi, Lunya, bisexual, enby, Purgatory, Youtube, Fedi, Matrix, Element, Codeberg, Docker, Github, Steam, Univerter, Ko-fi, Revolt, Discord, SearXNG, Highlighting, highlighted, Forgejo, HTML, CSS, Thumbor" - } - ] - }, - { - "type": "text", - "content": "\n " - }, - { - "type": "element", - "tagName": "br", - "attributes": [], - "children": [] - }, - { - "type": "text", - "content": "\n " - }, - { - "type": "element", - "tagName": "h3", - "attributes": [], - "children": [ - { - "type": "text", - "content": "I thought the site doesn't use Javascript? So why is it there?" - } - ] - }, - { - "type": "text", - "content": "\n " - }, - { - "type": "element", - "tagName": "p", - "attributes": [], - "children": [ - { - "type": "text", - "content": "Originally, all my sites were completely Javascript free. As of late, though, I decided to add Javascript to this one. Javascript will " - }, - { - "type": "element", - "tagName": "b", - "attributes": [], - "children": [ - { - "type": "element", - "tagName": "em", - "attributes": [], - "children": [ - { - "type": "text", - "content": "NEVER" - } - ] - } - ] - }, - { - "type": "text", - "content": " be a requirement on this site. Javascript will ONLY be used where nessacary, and I will do everything possible to make the experience indistinguishable." - } - ] - }, - { - "type": "text", - "content": "\n " - }, - { - "type": "element", - "tagName": "h2", - "attributes": [], - "children": [ - { - "type": "element", - "tagName": "hr", - "attributes": [], - "children": [] - }, - { - "type": "text", - "content": "Random video!" - } - ] - }, - { - "type": "element", - "tagName": "p", - "attributes": [], - "children": [ - { - "type": "text", - "content": "I would call it random " - }, - { - "type": "element", - "tagName": "em", - "attributes": [], - "children": [ - { - "type": "text", - "content": "daily" - } - ] - }, - { - "type": "text", - "content": " video but its not at all daily..." - } - ] - }, - { - "type": "text", - "content": "\n " - }, - { - "type": "element", - "tagName": "br", - "attributes": [], - "children": [] - }, - { - "type": "text", - "content": " \n " - }, - { - "type": "element", - "tagName": "video", - "attributes": [ - { - "key": "controls", - "value": "true" - }, - { - "key": "src", - "value": "https://fs.violets-purgatory.dev/Clips/Deep%20Rock%20Galactic/Teamwork.mp4" - } - ], - "children": [] - }, - { - "type": "text", - "content": "\n " - }, - { - "type": "element", - "tagName": "h1", - "attributes": [], - "children": [ - { - "type": "element", - "tagName": "hr", - "attributes": [], - "children": [] - }, - { - "type": "text", - "content": "Stats" - } - ] - }, - { - "type": "text", - "content": "\n " - }, - { - "type": "element", - "tagName": "br", - "attributes": [], - "children": [] - }, - { - "type": "text", - "content": "\n " - }, - { - "type": "element", - "tagName": "ul", - "attributes": [], - "children": [ - { - "type": "text", - "content": "\n " - }, - { - "type": "element", - "tagName": "li", - "attributes": [], - "children": [ - { - "type": "text", - "content": "Page generation time: {LOAD_TIME}" - } - ] - }, - { - "type": "text", - "content": "\n " - }, - { - "type": "element", - "tagName": "li", - "attributes": [], - "children": [ - { - "type": "text", - "content": "Uptime: about 1 seconds" - } - ] - }, - { - "type": "text", - "content": "\n " - }, - { - "type": "element", - "tagName": "li", - "attributes": [], - "children": [ - { - "type": "text", - "content": "Total reloads: 1 " - }, - { - "type": "element", - "tagName": "sup", - "attributes": [], - "children": [ - { - "type": "text", - "content": "*1" - } - ] - } - ] - }, - { - "type": "text", - "content": "\n " - }, - { - "type": "element", - "tagName": "li", - "attributes": [], - "children": [ - { - "type": "text", - "content": "Cached Images: 3 " - }, - { - "type": "element", - "tagName": "sup", - "attributes": [], - "children": [ - { - "type": "text", - "content": "*2" - } - ] - } - ] - }, - { - "type": "text", - "content": "\n " - } - ] - }, - { - "type": "text", - "content": "\n " - }, - { - "type": "element", - "tagName": "br", - "attributes": [], - "children": [] - }, - { - "type": "element", - "tagName": "br", - "attributes": [], - "children": [] - }, - { - "type": "element", - "tagName": "br", - "attributes": [], - "children": [] - }, - { - "type": "text", - "content": "\n " - }, - { - "type": "element", - "tagName": "ol", - "attributes": [ - { - "key": "class", - "value": "noteList" - } - ], - "children": [ - { - "type": "text", - "content": "\n " - }, - { - "type": "element", - "tagName": "li", - "attributes": [], - "children": [ - { - "type": "text", - "content": "Increments by 1 " - }, - { - "type": "element", - "tagName": "em", - "attributes": [], - "children": [ - { - "type": "text", - "content": "EVERY" - } - ] - }, - { - "type": "text", - "content": " time " - }, - { - "type": "element", - "tagName": "em", - "attributes": [], - "children": [ - { - "type": "text", - "content": "ANY" - } - ] - }, - { - "type": "text", - "content": " page is loaded." - } - ] - }, - { - "type": "text", - "content": "\n " - }, - { - "type": "element", - "tagName": "li", - "attributes": [], - "children": [ - { - "type": "text", - "content": "Cached Images are cleared on server restart." - } - ] - }, - { - "type": "text", - "content": "\n " - }, - { - "type": "text", - "content": "\n " - }, - { - "type": "element", - "tagName": "p", - "attributes": [], - "children": [] - }, - { - "type": "element", - "tagName": "br", - "attributes": [], - "children": [] - } - ] - } - ] - } - ] - } - ] - } -] \ No newline at end of file diff --git a/pageUpdater.js b/pageUpdater.js index f79f98a..fbdf822 100644 --- a/pageUpdater.js +++ b/pageUpdater.js @@ -142,14 +142,21 @@ function converter(html) { for (let index = 0; index < highTable.length; index++) { var term = highTable[index]; + var termProps = highlightedWords[term] + + var reg = term + if (termProps.caseInsensitive) { + reg = new RegExp(`(${term})`, "gi") + } element.content = element.content.replaceAll(`{${term}}`, "TEMPORARY_REPLACE") - element.content = element.content.replaceAll(term, "{TERM" + index + "}") + element.content = element.content.replaceAll(reg, "{TERM" + index + "}") element.content = element.content.replaceAll("TEMPORARY_REPLACE", `${term}`) } for (let index = 0; index < highTable.length; index++) { var termKey = "{TERM" + index + "}" + var termProps = highlightedWords[highTable[index]] while (element.content.includes(termKey)) { var termIndex = element.content.indexOf(termKey) @@ -164,7 +171,7 @@ function converter(html) { var spanStart = element.content.substring(0, termIndex).lastIndexOf(" ") var startContent = element.content.substring(spanStart, termIndex) - var replacement = `${startContent + highTable[index] + endContent}` + var replacement = `${startContent + highTable[index] + endContent}` element.content = element.content.substring(0, spanStart) + replacement + element.content.substring(spanEnd) }