diff --git a/output.json b/output.json new file mode 100644 index 0000000..05ae4e9 --- /dev/null +++ b/output.json @@ -0,0 +1,2153 @@ +[ + { + "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/package-lock.json b/package-lock.json index 0531c66..4a561cc 100644 --- a/package-lock.json +++ b/package-lock.json @@ -12,6 +12,7 @@ "@node-minify/core": "^8.0.6", "@node-minify/uglify-js": "^8.0.6", "express": "^4.18.2", + "himalaya": "^1.1.0", "minify-html": "^0.0.2", "ws": "^8.16.0", "youtubei.js": "^9.0.2" @@ -486,6 +487,12 @@ "node": ">= 0.4" } }, + "node_modules/himalaya": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/himalaya/-/himalaya-1.1.0.tgz", + "integrity": "sha512-LLase1dHCRMel68/HZTFft0N0wti0epHr3nNY7ynpLbyZpmrKMQ8YIpiOV77TM97cNpC8Wb2n6f66IRggwdWPw==", + "license": "ISC" + }, "node_modules/http-errors": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/http-errors/-/http-errors-2.0.0.tgz", @@ -1341,6 +1348,11 @@ "function-bind": "^1.1.2" } }, + "himalaya": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/himalaya/-/himalaya-1.1.0.tgz", + "integrity": "sha512-LLase1dHCRMel68/HZTFft0N0wti0epHr3nNY7ynpLbyZpmrKMQ8YIpiOV77TM97cNpC8Wb2n6f66IRggwdWPw==" + }, "http-errors": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/http-errors/-/http-errors-2.0.0.tgz", diff --git a/package.json b/package.json index baf3eec..a1003e7 100644 --- a/package.json +++ b/package.json @@ -20,6 +20,7 @@ "@node-minify/core": "^8.0.6", "@node-minify/uglify-js": "^8.0.6", "express": "^4.18.2", + "himalaya": "^1.1.0", "minify-html": "^0.0.2", "ws": "^8.16.0", "youtubei.js": "^9.0.2" diff --git a/pageUpdater.js b/pageUpdater.js index 307175f..cac4d52 100644 --- a/pageUpdater.js +++ b/pageUpdater.js @@ -5,7 +5,8 @@ const path = require('path'), uglifyJs = require("@node-minify/uglify-js"), htmlMinifier = require("minify-html"), activityToHTML = require("./overcomplicatedStatuses.js"), - randomThemer = require("./randomThemer.js") + randomThemer = require("./randomThemer.js"), + himalaya = require("himalaya") var constants = JSON.parse(fs.readFileSync(path.join(__dirname, 'constants.json'))) @@ -44,31 +45,22 @@ function timeFormatter(seconds) { } -function converter(html, query) { +function converter(html) { var startTime = Date.now() - + + html = htmlMinifier.minify(html) + var config = JSON.parse(fs.readFileSync(path.join(__dirname, 'config/config.json'))) reloads += 1 - while (html.includes("{PATH_")) { - var pagePath = html.substring(html.indexOf("{PATH_")) - pagePath = pagePath.substring(6, pagePath.indexOf('}')) - - var stringIndex = `{PATH_${pagePath}}` - pagePath = pagePath.toLowerCase() - - var pageHTML = fs.readFileSync(path.join(__dirname, 'static', pagePath, 'index.html')).toString() - pageHTML = pageHTML.substring(pageHTML.indexOf('
') + 6, pageHTML.indexOf('
')) - html = html.replace(stringIndex, pageHTML) - } var statusText = "" - + if (lanyardData) { var statusData = constants.discStatuses[lanyardData.discord_status] var username = lanyardData.discord_user.username if (lanyardData.activities[0] && lanyardData.activities[0].type == 4) { - var statusText = `

${lanyardData.activities[0].state}

` + var statusText = `

${lanyardData.activities[0].state}

` } } else { var statusData = constants.discStatuses.offline @@ -92,18 +84,18 @@ function converter(html, query) { "COMMIT_COUNT": commitCount, "QUOTE_COUNT": quotes.length, "RANDOM_TITLE": titles[Math.floor(Math.random() * titles.length)], - "DISCORD_STATUS": - `${statusData.text}` + - ``, + "DISCORD_STATUS": + `${statusData.text}` + + ``, "UPTIME": uptime, "TOPBAR": `

Socials

`, "DISCORD_USER": username, "CUSTOM_STATUS": statusText, "SELECTED_VIDEO": () => { if (config.dailyVideoURL) { - return `


Random video!

I would call it random daily video but its not at all daily...

-
- ` + return `


Random video!

I would call it random daily video but its not at all daily...

+
+ ` } return `` }, @@ -113,33 +105,95 @@ function converter(html, query) { "WEATHER_MODIFIER": randomThemer.returnTheme(), "WEATHER_TEXT": "", "ANNOUNCEMENT": fs.readFileSync(path.join(__dirname, "config/announcement.html")), - "CACHED_IMAGES": fs.readdirSync(path.join(__dirname, "cached")).length.toString() + "CACHED_IMAGES": fs.readdirSync(path.join(__dirname, "cached")).length.toString(), + "ACTIVITIES": activityToHTML.activitiesToHTML(lanyardData, cachedImages) } - + replacers.ALL_KEYWORDS = "{" + Object.keys(replacers).join("}{") + "} " - var rpTable = Object.keys(replacers) + var parsedHTML = himalaya.parse(html) - for (let index = 0; index < rpTable.length; index++) { - const text = rpTable[index]; - html = html.replaceAll(`{${text}}`, replacers[text]) + function scanParsedHTML(json) { + for (var i = 0; i < json.length; i++) { + var element = json[i] + if (element.type == "element") { + if (element.children.length > 0) { + element.children = scanParsedHTML(element.children) + } + } else if (element.type == "text") { + + while (element.content.includes("{PATH_")) { + var pagePath = element.content.substring(element.content.indexOf("{PATH_")) + pagePath = pagePath.substring(6, pagePath.indexOf('}')) + + var stringIndex = `{PATH_${pagePath}}` + pagePath = pagePath.toLowerCase() + + var pageHTML = fs.readFileSync(path.join(__dirname, 'static', pagePath, 'index.html')).toString() + pageHTML = pageHTML.substring(pageHTML.indexOf('
') + 6, pageHTML.indexOf('
')) + element.content = element.content.replaceAll(stringIndex, pageHTML) + } + + var rpTable = Object.keys(replacers) + + for (let index = 0; index < rpTable.length; index++) { + const text = rpTable[index]; + element.content = element.content.replaceAll(`{${text}}`, replacers[text]) + } + + // console.log(element.content, himalaya.parse(element.content)) + + json[i] = element + } + } + + return json } - var bodyHTML = html.substring(html.indexOf("") + 6, html.lastIndexOf("")) - var highTable = Object.keys(highlightedWords) + // var highTable = Object.keys(highlightedWords) - for (let index = 0; index < highTable.length; index++) { - var term = highTable[index]; - var replacement = `${term}` - - bodyHTML = bodyHTML.replaceAll(`{${term}}`, "TEMPORARY_REPLACE") - bodyHTML = bodyHTML.replaceAll(term, replacement) - bodyHTML = bodyHTML.replaceAll("TEMPORARY_REPLACE", `${term}`) + // for (let index = 0; index < highTable.length; index++) { + // var term = highTable[index]; + // var replacement = `${term}` + + + // element.content = element.content.replaceAll(`{${term}}`, "TEMPORARY_REPLACE") + // element.content = element.content.replaceAll(term, replacement) + // element.content = element.content.replaceAll("TEMPORARY_REPLACE", `${term}`) + // } + + parsedHTML = scanParsedHTML(parsedHTML) + + parsedHTML = himalaya.parse(himalaya.stringify(parsedHTML)) + + function highlighter(json) { + for (var i = 0; i < json.length; i++) { + var element = json[i] + if (element.type == "element") { + if (element.children.length > 0) { + element.children = highlighter(element.children) + } + } else if (element.type == "text") { + var highTable = Object.keys(highlightedWords) + + for (let index = 0; index < highTable.length; index++) { + var term = highTable[index]; + var replacement = `${term}` + + + element.content = element.content.replaceAll(`{${term}}`, "TEMPORARY_REPLACE") + element.content = element.content.replaceAll(term, replacement) + element.content = element.content.replaceAll("TEMPORARY_REPLACE", `${term}`) + } + } + } + + return json } - bodyHTML = bodyHTML.replaceAll("{ACTIVITIES}", activityToHTML.activitiesToHTML(lanyardData, cachedImages)) + parsedHTML = highlighter(parsedHTML) - html = html.substring(0, html.indexOf("")) + bodyHTML + html.substring(html.indexOf("") + 7) + html = himalaya.stringify(parsedHTML) html = html.replaceAll("{LOAD_TIME}", (Date.now() - startTime).toString() + "ms") @@ -166,7 +220,7 @@ module.exports = { filePath = path.join(__dirname, 'static', filePath || 'index.html') if (fs.existsSync(filePath)) { var data = fs.readFileSync(filePath).toString() - + res.contentType(path.basename(filePath)) // if (req.path.includes(".css")) { @@ -177,7 +231,7 @@ module.exports = { if (filePath.includes(".html")) { data = converter(data, req.query) - + } if (!filePath.includes(".js")) { @@ -206,7 +260,7 @@ async function updateCommits() { commits = commits.substring(commits.lastIndexOf("") + 3, commits.lastIndexOf("")) // ^ this works for Forgejo (basically everything i use that isnt Github E.G. Codeberg) - + // commits = commits.substring(commits.lastIndexOf(">") + 1) // ^ This works for Github (fuck you Github) @@ -253,7 +307,7 @@ function get_img_url(activity, size = "large_image") { function socketeer() { var lanyard = new WebSocket('https://api.violets-purgatory.dev') - lanyard.on("error", (error) =>{ + lanyard.on("error", (error) => { console.log(error) })