Compare commits
9 commits
bb5f3a6bd1
...
d7dccca810
Author | SHA1 | Date | |
---|---|---|---|
d7dccca810 | |||
439cfec97b | |||
bd0e3900dd | |||
cefb365f66 | |||
d379475b45 | |||
cce0e075e6 | |||
1fadd74918 | |||
14a5a6607d | |||
64fd713364 |
8 changed files with 130 additions and 6 deletions
|
@ -17,7 +17,7 @@ These highlighted words ARE case senstive. You can make them not case sensitive
|
|||
Highlighted words will automatically highlight adjacent letters. So, for example, `NodeJS-generated` will all be highlighted green, as `NodeJS` is a keyword.
|
||||
|
||||
If a highlighted word finds adjacent paranthesis, then the entire parenthesis will be highlighted.
|
||||
For example `(Godot Engine is super cool)` will all be highlighted blue. So will `(My favorite utoid is Teto)`. But, on the other hand, `(Don't you think Javascript sucks?)` will only have `Javascript` highlighted.
|
||||
For example `(Godot Engine is super cool)` will all be highlighted blue. So will `(My favorite UTAUloid is Teto)`. But, on the other hand, `(Don't you think Javascript sucks?)` will only have `Javascript` highlighted.
|
||||
|
||||
### Dynamic HTML
|
||||
In `pageUpdater.js`, is a dictionary that specifies keywords to look for. Then, if it finds those keywords, and replaces them with HTML.
|
||||
|
|
|
@ -335,6 +335,7 @@
|
|||
{
|
||||
"words": [
|
||||
"CSS",
|
||||
".css",
|
||||
"Neow",
|
||||
"The Defect"
|
||||
],
|
||||
|
|
|
@ -51,6 +51,14 @@ function firstToUpper(str) {
|
|||
return str.charAt(0).toUpperCase() + str.slice(1)
|
||||
}
|
||||
|
||||
function onlyIfExists(string, check) {
|
||||
if (check) {
|
||||
return string
|
||||
} else {
|
||||
return ""
|
||||
}
|
||||
}
|
||||
|
||||
function makeHtmlSafe(str) {
|
||||
return String(str).replace(/&/g, '&').replace(/</g, '<').replace(/>/g, '>').replace(/"/g, '"');
|
||||
}
|
||||
|
@ -299,9 +307,8 @@ function converter(html, dynamic = true) {
|
|||
for (var x = 0; x < sitesTable.length; x++) {
|
||||
var siteName = sitesTable[x]
|
||||
var siteData = sites[siteName]
|
||||
if (siteData.url) {
|
||||
html += `<a class="chip" href="${siteData.url}">${siteName}: ${siteData.name.replaceAll("Violet", "{Violet}")}</a>`
|
||||
}
|
||||
html += `<a class="chip" ${onlyIfExists(`href="${siteData.url}"`, siteData.url)}>${siteName}: ${siteData.name.replaceAll("Violet", "{Violet}")}</a>`
|
||||
|
||||
}
|
||||
html += "</div></div>"
|
||||
}
|
||||
|
|
32
static/ambience/ambient.js
Normal file
32
static/ambience/ambient.js
Normal file
|
@ -0,0 +1,32 @@
|
|||
function loop() {
|
||||
var date = new Date()
|
||||
|
||||
var hour = date.getHours();
|
||||
hour = (hour < 10 ? "0" : "") + hour;
|
||||
|
||||
var min = date.getMinutes();
|
||||
min = (min < 10 ? "0" : "") + min;
|
||||
|
||||
var sec = date.getSeconds();
|
||||
sec = (sec < 10 ? "0" : "") + sec;
|
||||
|
||||
$("#time").text(hour + ":" + min)
|
||||
|
||||
setTimeout(() => {
|
||||
loop()
|
||||
}, 1000)
|
||||
}
|
||||
|
||||
document.addEventListener("DOMContentLoaded", function() {
|
||||
loop()
|
||||
})
|
||||
|
||||
$(document).on('keypress',function(e) {
|
||||
if(e.which == 102) {
|
||||
if ($.fullscreen.isFullScreen()) {
|
||||
$.fullscreen.exit()
|
||||
} else {
|
||||
$("body").fullscreen()
|
||||
}
|
||||
}
|
||||
});
|
28
static/ambience/fullscreen.js
Normal file
28
static/ambience/fullscreen.js
Normal file
File diff suppressed because one or more lines are too long
37
static/ambience/index.html
Normal file
37
static/ambience/index.html
Normal file
|
@ -0,0 +1,37 @@
|
|||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
|
||||
<head>
|
||||
<link rel="stylesheet" type="text/css" href="../style.css">
|
||||
<link rel="stylesheet" type="text/css" href="../subpage.css">
|
||||
<link rel="stylesheet" href="./style.css">
|
||||
|
||||
<script src="../jquery.js"></script>
|
||||
<script src="../main.js"></script>
|
||||
<script src="./fullscreen.js"></script>
|
||||
<script src="./ambient.js"></script>
|
||||
|
||||
<meta charset="UTF-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
|
||||
<title>Violet's Purgatory Ambient Page</title>
|
||||
|
||||
<meta name="darkreader-lock">
|
||||
|
||||
<meta content="Ambient Page - Violet's Purgatory" property="og:title" />
|
||||
<meta content="This page isn't really made for public use. Ignore it!" property="og:description" />
|
||||
<meta content="https://api.violets-purgatory.dev/v1/pfp" property="og:image" />
|
||||
<meta content="#a200ff" data-react-helmet="true" name="theme-color" />
|
||||
</head>
|
||||
|
||||
<body>
|
||||
{WEATHER_MODIFIER}
|
||||
<div class="mainDiv">
|
||||
<h1 id="time">00:00</h1>
|
||||
<div id="activityHtml">
|
||||
{ACTIVITIES}
|
||||
</div>
|
||||
</div>
|
||||
</body>
|
||||
|
||||
</html>
|
19
static/ambience/style.css
Normal file
19
static/ambience/style.css
Normal file
|
@ -0,0 +1,19 @@
|
|||
body {
|
||||
background-image: none;
|
||||
background-color: black;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
margin: auto;
|
||||
|
||||
}
|
||||
|
||||
@media screen and (min-height: 500px) {
|
||||
html,
|
||||
body {
|
||||
height: 100%;
|
||||
}
|
||||
}
|
||||
|
||||
#time {
|
||||
font-size: 5rem;
|
||||
}
|
|
@ -154,7 +154,7 @@ window.onbeforeunload = function () {
|
|||
window.scrollTo(0, 0);
|
||||
}
|
||||
|
||||
window.onload = function () {
|
||||
document.addEventListener("DOMContentLoaded", function() {
|
||||
$("#jsEnabled").text("true")
|
||||
|
||||
pfp = $(".pfp")
|
||||
|
@ -191,7 +191,7 @@ window.onload = function () {
|
|||
}
|
||||
}
|
||||
socketeer()
|
||||
}
|
||||
})
|
||||
|
||||
var lastPong = Date.now()
|
||||
|
||||
|
|
Loading…
Reference in a new issue