Minor theme tweaking

This commit is contained in:
bingus_violet 2024-09-30 17:34:22 -05:00
parent 25287795d8
commit e3cfd9142f
6 changed files with 16 additions and 214 deletions

View file

@ -1,7 +1,8 @@
function rain() {
var html = ""
html += `<link rel="stylesheet" type="text/css" href="/themes/rain/style.css"> <script src="/themes/rain/script.js"></script>`
html += `<link rel="stylesheet" type="text/css" href="/themes/rain/style.css">`
html += `<div class="rainStuff"><div class="rainContainer">`
var amount = 7
@ -57,77 +58,29 @@ function rain() {
return html
}
function purpleMagic() {
function halloween() {
var html = ""
html += `<link rel="stylesheet" type="text/css" href="/themes/magic/style.css"> <script src="/themes/magic/script.js"></script>`
html += `<div class="magicStuff"><div class="magicContainer">`
var amount = 15
for (let index = 0; index < amount; index++) {
html += `<div class="particle"></div>`
}
html += "<style>"
for (let index = 0; index < amount; index++) {
html += `
.particle:nth-of-type(${index + 1}) {
animation: magic${index} ${((Math.round(Math.random() * 10) / 10) * 0.3) + 20}s linear, sway 4s cubic-bezier(0.445, 0.05, 0.55, 0.95) alternate;
animation-delay: ${Math.round(Math.random() * 100) / 100 * 20}s;
animation-iteration-count: infinite;
}
`
if (index % 2 == 0) {
html.replace("alternate", "alternate-reverse")
}
var pos = Math.round(Math.random() * 100)
html += `@keyframes magic${index} { `
html += `
0% {
top: 110vh;
right: ${pos}%;
visibility: visible;
}
90% {
top: -10vh;
right: ${pos}%;
visibility: visible;
}
90.1% {
visibility: hidden;
}
`
html += `}`
}
html += "</style>"
html += "</div></div>"
html += `<link rel="stylesheet" type="text/css" href="/themes/halloween/style.css">`
return html
}
function code() {
return '<link rel="stylesheet" type="text/css" href="/themes/code/style.css">' // <script src="/themes/code/script.js"></script>'
}
var events = []
events = events.concat(Array(10).fill(""))
events.push(rain())
events = events.concat(Array(10).fill(""))
events.push(purpleMagic())
module.exports = {
returnTheme: function() {
var time = new Date()
return events[time.getDate() % events.length]
// return halloween()
if (time.getMonth() + 1 == 10) {
return halloween()
}
else if (time.getDate() % 10 == 0) {
return rain()
}
return ""
},
}