diff --git a/pageUpdater.js b/pageUpdater.js
index 37e6a48..db51641 100644
--- a/pageUpdater.js
+++ b/pageUpdater.js
@@ -183,7 +183,6 @@ function highlighter(json, full = true, linkParent = false) {
spanEnd -= 1
endContent = endContent.substring(0, endContent.length - 1)
} else {
- console.log(newStartContent)
spanStart = newSpanStart
startContent = newStartContent
}
@@ -317,7 +316,7 @@ function converter(html, dynamic = true) {
"WEATHER_MODIFIER": randomThemer.returnTheme(),
"WEATHER_TEXT": "",
"ANNOUNCEMENT": fs.readFileSync(path.join(__dirname, "config/announcement.html")),
- "SOCIALS": () => {
+ "SOCIALS": (full) => {
if (api.lanyard && api.lanyard.socials) {
var socials = api.lanyard.socials
var html = `
`
@@ -330,8 +329,9 @@ function converter(html, dynamic = true) {
for (var x = 0; x < sitesTable.length; x++) {
var siteName = sitesTable[x]
var siteData = sites[siteName]
- html += `
${siteName}: ${siteData.name}`
-
+ if (siteData.main || full) {
+ html += `
${siteName}: ${siteData.name}`
+ }
}
html += "
"
}
@@ -371,6 +371,9 @@ function converter(html, dynamic = true) {
`
+ },
+ "TEST_KEYWORD": (arg1, arg2, arg3) => {
+ return `The arguements you inputted are "${arg1}" and "${arg2}". Wow!
`
}
}
@@ -397,10 +400,34 @@ function converter(html, dynamic = true) {
for (let index = 0; index < rpTable.length; index++) {
const text = rpTable[index];
- if (dynamic) {
- replacers[text] = himalaya.stringify(highlighter(himalaya.parse(replacers[text])))
+ const braceText = `{${text}}`
+
+ if (typeof replacers[text] == "function" && replacers[text].length == 0) {
+ replacers[text] = replacers[text]()
+ }
+
+ while (html.includes(braceText)) {
+ var posOfKeyword = html.indexOf(braceText)
+ var keywordLength = braceText.length
+ var args = undefined
+ if (html.charAt(posOfKeyword + keywordLength) == "(") {
+ args = html.substring(posOfKeyword + keywordLength + 1)
+ keywordLength = args.substring(0, args.indexOf(")")).length + keywordLength + 2
+ args = args.substring(0, args.indexOf(")"))
+ args = args.split(",").map(item => item.trim())
+ }
+ var fnString = replacers[text]
+ if (typeof fnString == "function") {
+ fnString = fnString.apply(null, args)
+ }
+
+ if (dynamic) {
+ fnString = himalaya.stringify(highlighter(himalaya.parse(fnString)))
+ }
+
+ html = html.substring(0, posOfKeyword) + fnString + html.substring(posOfKeyword + keywordLength)
+ // break
}
- html = html.replaceAll(`{${text}}`, replacers[text])
}
if (!dynamic) {
diff --git a/static/index.html b/static/index.html
index 47f9eed..002ca87 100644
--- a/static/index.html
+++ b/static/index.html
@@ -78,17 +78,26 @@
{ANNOUNCEMENT}
- List of services for public use hosted on Violet's Purgatory.
+ Feel free to DM me anywhere (Discord & Fedi are best) for an invite! Do understand though, my instances are not stable!
+ By using my services, you are confirming you understand that there are risks of data loss, downtime, and bugs!!!
- Here's most of the sites you can find me on-
if you needed that for some reason?
- {SOCIALS}
+ Here's most of the sites you can find me on!
+ {SOCIALS}(Full)
+ Gray border = preferred, Yellow = neutral, Red = not preferred.
+ Interacting via any site is perfectly fine! E.G. if you use both Fedi and Bluesky, Bluesky is yellow, so you should contact me through Fedi instead! But if you don't have Fedi, then just contact me through Bluesky!
diff --git a/static/subpage.css b/static/subpage.css
index cd84030..4041708 100644
--- a/static/subpage.css
+++ b/static/subpage.css
@@ -15,4 +15,20 @@ h1:nth-of-type(1) {
.mainDiv {
margin: auto;
+}
+
+.notpref {
+ border-color: rgb(150, 25, 25);
+}
+
+.notpref:hover {
+ border-color: red;
+}
+
+.neutralpref {
+ border-color: rgb(150, 150, 75);
+}
+
+.neutralpref:hover {
+ border-color: yellow;
}
\ No newline at end of file