Word highlighting
This commit is contained in:
parent
0b2f1d6d82
commit
9c8af629fe
3 changed files with 40 additions and 5 deletions
10
config.json
10
config.json
|
@ -53,7 +53,8 @@
|
||||||
"You know... I was a Roblox Developer Once...",
|
"You know... I was a Roblox Developer Once...",
|
||||||
"I used to love Star Glitcher games",
|
"I used to love Star Glitcher games",
|
||||||
"Git rebase my beloved...",
|
"Git rebase my beloved...",
|
||||||
"I'm gonna buy univerter.dev someday!"
|
"I'm gonna buy univerter.dev someday!",
|
||||||
|
"These birds are Pissing me off... I'm the original Starwalker"
|
||||||
],
|
],
|
||||||
|
|
||||||
"thumborInstances": [
|
"thumborInstances": [
|
||||||
|
@ -61,5 +62,10 @@
|
||||||
"https://enormous-book-production.up.railway.app/",
|
"https://enormous-book-production.up.railway.app/",
|
||||||
"https://unusual-back-production.up.railway.app/",
|
"https://unusual-back-production.up.railway.app/",
|
||||||
"https://axiomatic-hair-production.up.railway.app/"
|
"https://axiomatic-hair-production.up.railway.app/"
|
||||||
]
|
],
|
||||||
|
"highlightedWords": {
|
||||||
|
"birds": "yellow",
|
||||||
|
"Pissing": "yellow",
|
||||||
|
"Starwalker": "yellow"
|
||||||
|
}
|
||||||
}
|
}
|
33
index.js
33
index.js
|
@ -19,6 +19,8 @@ var thumborInstances = config.thumborInstances
|
||||||
|
|
||||||
var activityImages = config.activityImages
|
var activityImages = config.activityImages
|
||||||
|
|
||||||
|
var highlight = config.highlightedWords
|
||||||
|
|
||||||
var thumbCount = 0
|
var thumbCount = 0
|
||||||
|
|
||||||
function getThumbor() {
|
function getThumbor() {
|
||||||
|
@ -106,8 +108,19 @@ function pageUpdate() {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (status.state) {
|
if (status.state) {
|
||||||
addedHTML += `<em><span style="color: lightgray">"`
|
addedHTML += `<em><span style="color: lightgray; white-space: pre-wrap">"`
|
||||||
addedHTML += (status.state || "")
|
// addedHTML += (status.state || "")
|
||||||
|
var splitStatus = status.state.split(' ')
|
||||||
|
|
||||||
|
for (let index = 0; index < splitStatus.length; index++) {
|
||||||
|
const text = splitStatus[index];
|
||||||
|
if (highlight[text]) {
|
||||||
|
addedHTML += `<span style="color: ${highlight[text]}">${text}</span>`
|
||||||
|
} else {
|
||||||
|
addedHTML += text
|
||||||
|
}
|
||||||
|
addedHTML += ' '
|
||||||
|
}
|
||||||
addedHTML += `"</span>`
|
addedHTML += `"</span>`
|
||||||
}
|
}
|
||||||
addedHTML += ` - ${lanyardData.discord_user.display_name} ${new Date(Date.now()).getFullYear()}</em></p>`
|
addedHTML += ` - ${lanyardData.discord_user.display_name} ${new Date(Date.now()).getFullYear()}</em></p>`
|
||||||
|
@ -300,6 +313,22 @@ function pageUpdate() {
|
||||||
|
|
||||||
var quote = randomQuotes[Math.floor(Math.random() * randomQuotes.length)]
|
var quote = randomQuotes[Math.floor(Math.random() * randomQuotes.length)]
|
||||||
|
|
||||||
|
var splitQuote = quote.split(' ')
|
||||||
|
|
||||||
|
var finalQuote = ''
|
||||||
|
|
||||||
|
for (let index = 0; index < splitQuote.length; index++) {
|
||||||
|
const text = splitQuote[index];
|
||||||
|
if (highlight[text]) {
|
||||||
|
finalQuote += `<span style="color: ${highlight[text]}">${text}</span>`
|
||||||
|
} else {
|
||||||
|
finalQuote += text
|
||||||
|
}
|
||||||
|
finalQuote += ' '
|
||||||
|
}
|
||||||
|
|
||||||
|
quote = finalQuote.trim()
|
||||||
|
|
||||||
quote = quote.replace("{QUOTE_COUNT}", randomQuotes.length)
|
quote = quote.replace("{QUOTE_COUNT}", randomQuotes.length)
|
||||||
|
|
||||||
html = html.replace("{RANDOM_QUOTE}", quote)
|
html = html.replace("{RANDOM_QUOTE}", quote)
|
||||||
|
|
|
@ -23,7 +23,7 @@
|
||||||
|
|
||||||
<body>
|
<body>
|
||||||
<h1>Welcome to Violet's Purgatory</h1>
|
<h1>Welcome to Violet's Purgatory</h1>
|
||||||
<p>{RANDOM_QUOTE}</p>
|
<p style="white-space: pre-wrap;">{RANDOM_QUOTE}</p>
|
||||||
<div class="fadediv">
|
<div class="fadediv">
|
||||||
<div class="container-fluid row" id="card">
|
<div class="container-fluid row" id="card">
|
||||||
<h2>Violet</h2>
|
<h2>Violet</h2>
|
||||||
|
|
Loading…
Reference in a new issue