2024-12-30 12:59:03 -07:00
const badgeGray = document . getElementById ( "badgeGray" ) ;
const badgeGreen = document . getElementById ( "badgeGreen" ) ;
const badgeOrange = document . getElementById ( "badgeOrange" ) ;
2024-12-30 14:19:31 -07:00
const colorBool = Math . random ( ) < 0.5 ;
const is _root = location . pathname === "/" ;
2024-09-15 18:11:38 -06:00
2025-01-03 20:04:19 -07:00
const badgeAmount = 16
2024-09-08 14:14:28 -06:00
// loads all the functions to be loaded on load, pretty simple, it loads shit on load.
function onLoad ( ) {
jsEnabled ( ) ;
2024-10-30 15:45:39 -06:00
checkThemeStorage ( ) ;
2024-09-08 14:14:28 -06:00
getSGAState ( ) ;
redirect ( ) ;
checkBoxes ( ) ;
getPlaceholder ( ) ;
}
2024-09-08 14:00:09 -06:00
// if javascript is enabled, this script will load, enabling all site elements that use javascript, by default these are all hidden.
function jsEnabled ( ) {
2024-10-30 21:06:25 -06:00
// if on main page, activate widgets
if ( is _root ) {
const lastFmWidget = document . getElementById ( "lastfm-widget" ) ;
const ntfyWidgetContainer = document . getElementById ( "ntfyWidgetContainer" ) ;
lastFmWidget . style . display = "initial" ;
ntfyWidgetContainer . style . display = "initial" ;
}
2024-09-08 14:14:28 -06:00
// Get JS required element ids
const sgaButton = document . getElementById ( "sgaButton" ) ;
2024-12-30 12:59:03 -07:00
const sgaButtonText = document . getElementById ( "sgaButtonText" ) ;
2024-12-19 16:11:01 -07:00
const incrementButton = document . getElementById ( "incrementButton" ) ;
2024-09-08 14:14:28 -06:00
// enable js required element ids
sgaButton . style . display = "initial" ;
2024-12-30 12:59:03 -07:00
sgaButtonText . style . visibility = "initial" ;
2024-12-19 16:11:01 -07:00
incrementButton . style . display = "initial" ;
2024-12-30 14:59:09 -07:00
// badge
2025-01-03 20:04:19 -07:00
for ( var badgeNum = 0 ; badgeNum < badgeAmount ; badgeNum ++ ) {
2024-12-30 14:59:09 -07:00
document . getElementById ( 'badge' + ( badgeNum + 1 ) ) . style . display = "initial" ;
}
2025-01-03 20:04:19 -07:00
for ( var badgeDefaultNum = 0 ; badgeDefaultNum < badgeAmount ; badgeDefaultNum ++ ) {
2024-12-30 14:59:09 -07:00
document . getElementById ( 'badgeDefault' + ( badgeDefaultNum + 1 ) ) . style . display = "none" ;
}
getbadges ( )
2024-09-08 14:14:28 -06:00
}
// LastFM stuff
const user = "limepotato" ;
const url = ` https://lastfm-last-played.biancarosa.com.br/ ${ user } /latest-song ` ;
const song = document . querySelector ( "#song" ) ;
fetch ( url )
. then ( ( response ) => response . json ( ) )
. then ( ( json ) => {
song . innerHTML = ` ${ json . track . name } - ${ json . track . artist [ "#text" ] } ` ;
} ) ;
// Chrome Redirect
function redirect ( ) {
const chromium = /Chrome|Chromium|OPR|Opera|Edge|UC|QQ/ . test (
2024-10-30 19:59:07 -06:00
navigator . userAgent ,
2024-09-08 14:14:28 -06:00
) ;
if ( navigator . brave ) {
window . location . replace ( "https://www.youtube.com/watch?v=dQw4w9WgXcQ" ) ;
}
if ( ! navigator . brave ) {
if ( ! localStorage . getItem ( "disclaimerAccepted" ) ) {
if ( chromium && screen . width >= 699 ) {
window . location . replace ( "/bsod" ) ;
}
if ( chromium && screen . width <= 699 ) {
window . location . replace ( "/mobile-warn" ) ;
}
}
}
}
2024-09-15 18:11:38 -06:00
2024-09-17 21:29:15 -06:00
// Show/Hide Info Boxes
const posterInfoButton = document . getElementById ( "poster-info-button" ) ;
const posterInfo = document . getElementById ( "poster-info" ) ;
2024-10-30 19:59:07 -06:00
let isPosterInfoHidden = true ;
2024-09-17 21:29:15 -06:00
const ntfyInfoButton = document . getElementById ( "ntfy-info-button" ) ;
const ntfyInfo = document . getElementById ( "ntfy-info" ) ;
2024-10-30 19:59:07 -06:00
let isNtfyInfoHidden = true ;
2024-09-17 21:29:15 -06:00
function showPosterInfo ( ) {
if ( isPosterInfoHidden ) {
posterInfo . style . display = "initial" ;
2024-10-30 19:59:07 -06:00
posterInfoButton . innerHTML = "[hide more info]" ;
2024-09-17 21:29:15 -06:00
isPosterInfoHidden = false ;
2024-10-30 19:59:07 -06:00
} else {
2024-09-17 21:29:15 -06:00
posterInfo . style . display = "none" ;
2024-10-30 19:59:07 -06:00
posterInfoButton . innerHTML = "[show more info]" ;
2024-09-17 21:29:15 -06:00
isPosterInfoHidden = true ;
}
}
function showNtfyInfo ( ) {
if ( isNtfyInfoHidden ) {
ntfyInfo . style . display = "initial" ;
2024-10-30 19:59:07 -06:00
ntfyInfoButton . innerHTML = "[hide more info]" ;
2024-09-17 21:29:15 -06:00
isNtfyInfoHidden = false ;
2024-10-30 19:59:07 -06:00
} else {
2024-09-17 21:29:15 -06:00
ntfyInfo . style . display = "none" ;
2024-10-30 19:59:07 -06:00
ntfyInfoButton . innerHTML = "[show more info]" ;
2024-09-17 21:29:15 -06:00
isNtfyInfoHidden = true ;
}
2024-10-30 15:45:39 -06:00
}
2024-12-30 14:59:09 -07:00
//// badges
const elke = '<a href="https://elke.cafe/"><img class="badge" src="/assets/images/badges/friends/elke.cafe.gif" alt="dark static background, on the left side, a triquetra, in yellow/orange text \'elke.cafe\'" loading="lazy"></a>'
2025-01-03 20:04:19 -07:00
const tomo = '<a href="https://azumanga.gay/"><img class="badge" src="/assets/images/badges/friends/kaitbutton.png" alt="kait" loading="lazy"></a>'
const lily = '<a href="https://lilysthings.org/"><img class="badge" src="/assets/images/badges/friends/lilysthings.png" alt="the word \'lily!!\' next to a microwave" loading="lazy"></a>'
const eris = '<a href="https://eris.meows.gay/"><img class="badge" src="/assets/images/badges/friends/eris.png" alt="purple background, with pink text that reads \'eris\' and a cat" loading="lazy"></a>'
const zvava = '<a href="https://zvava.org/"><img class="badge" src="/assets/images/badges/friends/zvava.org.png" alt="black background, with a slanted dark purple grid, and a purple outline, pink text saying \'zvava.org\'" loading="lazy"></a>'
const mira = '<a href="https://csillagpor.net"><img class="badge" src="/assets/images/badges/friends/mira-button.png" alt="miras button\'" loading="lazy"></a>'
const tempest = '<a href="https://tempest.dev/"><img class="badge" src="/assets/images/badges/friends/tempest.dev.png" alt="badge for tempest.dev\'" loading="lazy"></a>'
const disarray = '<a href="https://disarray.sh/"><img class="badge" src="/assets/images/badges/friends/disarray.sh.png" alt="jade disarray site" loading="lazy"></a>'
const astrid = '<a href="https://astrid.tech/"><img class="badge" src="/assets/images/badges/friends/astrid.tech.png" alt="astrid dot tech" loading="lazy"></a>'
const nbsp = '<a href="https://enby.space/"><img class="badge" src="/assets/images/badges/friends/nbsp.gif" alt="ralsei clapping next to the text \'nbsp\'" loading="lazy"></a>'
const loveshock = '<a href="https://loveshock.xyz/"><img class="badge" src="/assets/images/badges/friends/loveshock.gif" alt="dark background, with a curved grid/web, with the text \'vist the jukebox at loveshock.xyz\'" loading="lazy"></a>'
const pancakes = '<a href="https://trypancakes.com/"><img class="badge" src="/assets/images/badges/friends/pancakes.png" alt="purple background, with a drawing of a cat, to the left of the cat is the underlined word \'pancakes\'" loading="lazy"></a>'
const sophari = '<a href="https://sophari.org/"><img class="badge" src="https://sophari.org/img/sophari.gif" alt="black background, with white borders and text, colorful snow-like substance falling down, text says \'Sophari.org\' " loading="lazy"></a>'
const constellatory = '<a href="https://constellatory.net/"><img class="badge" src="/assets/images/badges/friends/constellatory.net.png" alt="constellatory" loading="lazy"></a>'
const micro = ' <a id="badgeDefault12" href="https://micro.pages.gay/"><img class="badge" src="/assets/images/badges/friends/niko.png" alt="prototype from oneshot giviing a :3c expression with a darker background and Micro in purple 500 from tailwindcss on the right with dithering between the two sections" loading="lazy"></a>'
const lykrast = ' <a id="badgeDefault16" href="https://lykrast.com/"><img class="badge" src="https://lykrast.com/8831.png" alt="hand holding a black hole, with the text \'Lykrast\'" loading="lazy"></a>'
const starshines = ' <a id="badgeDefault17" href="https://starshines.gay/"><img class="badge" src="/assets/images/badges/friends/foxfoxfox.png" alt="image of a neofox in a box, next to it is some text reading off the screen \'fox fox fox fox fox\'" loading="lazy"></a>'
2024-12-30 14:59:09 -07:00
const badges = [
2025-01-03 20:04:19 -07:00
elke ,
tomo ,
lily ,
eris ,
zvava ,
mira ,
tempest ,
disarray ,
astrid ,
constellatory ,
nbsp ,
micro ,
loveshock ,
pancakes ,
sophari ,
lykrast ,
starshines
2024-12-30 14:59:09 -07:00
] ;
function shuffle ( array ) {
var currentIndex = array . length ;
var temporaryValue ;
var randomIndex ;
while ( 0 !== currentIndex ) {
randomIndex = Math . floor ( Math . random ( ) * currentIndex ) ;
currentIndex -= 1 ;
temporaryValue = array [ currentIndex ] ;
array [ currentIndex ] = array [ randomIndex ] ;
array [ randomIndex ] = temporaryValue ;
}
return array ;
}
function getbadges ( ) {
var shuffledBadges = shuffle ( badges ) ;
2025-01-03 20:04:19 -07:00
for ( var badgeNum = 0 ; badgeNum < badgeAmount ; badgeNum ++ ) {
2024-12-30 14:59:09 -07:00
document . getElementById ( 'badge' + ( badgeNum + 1 ) ) . innerHTML = shuffledBadges [ badgeNum ] ;
}
}
2024-10-30 15:45:39 -06:00
2024-10-30 16:07:04 -06:00
//// color scheme change
2024-10-30 19:59:07 -06:00
const headTag = document . getElementsByTagName ( "head" ) [ 0 ] ;
2024-10-30 15:45:39 -06:00
const styleTag = document . createElement ( "style" ) ;
function checkThemeStorage ( ) {
if ( sessionStorage . getItem ( "themeGreen" ) ) {
2024-10-30 19:59:07 -06:00
setGreen ( ) ;
2024-10-30 15:45:39 -06:00
}
if ( sessionStorage . getItem ( "themeOrange" ) ) {
2024-10-30 19:59:07 -06:00
setOrange ( ) ;
2024-10-30 15:45:39 -06:00
}
2024-10-30 19:59:07 -06:00
if (
! sessionStorage . getItem ( "themeOrange" ) &&
! sessionStorage . getItem ( "themeGreen" )
) {
getTheme ( ) ;
2024-10-30 15:45:39 -06:00
}
}
function setGreen ( ) {
2024-12-30 12:59:03 -07:00
badgeGreen . style . display = "initial" ;
badgeOrange . style . display = "none" ;
badgeGray . style . display = "none" ;
2024-10-30 15:45:39 -06:00
styleTag . innerHTML = `
: root {
-- text : # e7eeea ;
-- background : # 060 d09 ;
-- primary : # 9 ae2b9 ;
-- secondary : # 14904 a ;
-- accent : # 47e48 a ;
-- content - gradient : linear - gradient ( to bottom right , var ( -- secondary - 800 ) , var ( -- primary - 900 ) ) ;
-- accent - gradient : linear - gradient ( to bottom right , var ( -- accent ) , var ( -- accent - 200 ) 30 % , var ( -- text ) 60 % ) ;
-- link : var ( -- accent - 300 ) ;
-- visited : var ( -- accent - 400 ) ;
-- hover : var ( -- accent - 500 ) ;
-- text - 50 : # f0f4f2 ;
-- text - 100 : # e1eae5 ;
-- text - 200 : # c3d5cb ;
-- text - 300 : # a5c0b1 ;
-- text - 400 : # 88 aa97 ;
-- text - 500 : # 6 a957d ;
-- text - 600 : # 557764 ;
-- text - 700 : # 3 f5a4b ;
-- text - 800 : # 2 a3c32 ;
-- text - 900 : # 151e19 ;
-- text - 950 : # 0b0 f0c ;
-- background - 50 : # eef7f2 ;
-- background - 100 : # dcefe4 ;
-- background - 200 : # b9dfc9 ;
-- background - 300 : # 96 cfaf ;
-- background - 400 : # 73 bf94 ;
-- background - 500 : # 50 af79 ;
-- background - 600 : # 408 c61 ;
-- background - 700 : # 306949 ;
-- background - 800 : # 204630 ;
-- background - 900 : # 102318 ;
-- background - 950 : # 08110 c ;
-- primary - 50 : # ebf9f1 ;
-- primary - 100 : # d7f4e4 ;
-- primary - 200 : # b0e8c8 ;
-- primary - 300 : # 88 ddad ;
-- primary - 400 : # 61 d192 ;
-- primary - 500 : # 39 c676 ;
-- primary - 600 : # 2e9 e5f ;
-- primary - 700 : # 227747 ;
-- primary - 800 : # 174 f2f ;
-- primary - 900 : # 0 b2818 ;
-- primary - 950 : # 06140 c ;
-- secondary - 50 : # e9fcf1 ;
-- secondary - 100 : # d2f9e3 ;
-- secondary - 200 : # a5f3c7 ;
-- secondary - 300 : # 78 edab ;
-- secondary - 400 : # 4 be78f ;
-- secondary - 500 : # 1 fe073 ;
-- secondary - 600 : # 18 b45c ;
-- secondary - 700 : # 128745 ;
-- secondary - 800 : # 0 c5a2e ;
-- secondary - 900 : # 062 d17 ;
-- secondary - 950 : # 03160 b ;
-- accent - 50 : # e9fcf1 ;
-- accent - 100 : # d3f8e3 ;
-- accent - 200 : # a6f2c7 ;
-- accent - 300 : # 7 aebab ;
-- accent - 400 : # 4 ee48f ;
-- accent - 500 : # 21 de73 ;
-- accent - 600 : # 1 bb15c ;
-- accent - 700 : # 148545 ;
-- accent - 800 : # 0 d592e ;
-- accent - 900 : # 072 c17 ;
-- accent - 950 : # 03160 b ;
-- alt - accent : # fbb055 ;
/* TODO: Alter This */
-- glitch - 1 : var ( -- alt - accent - 400 ) ;
-- glitch - 2 : var ( -- alt - accent - 500 ) ;
-- glitch - 3 : var ( -- alt - accent - 600 ) ;
-- alt - accent - 50 : # fef3e7 ;
-- alt - accent - 100 : # fce8cf ;
-- alt - accent - 200 : # fad19e ;
-- alt - accent - 300 : # f7b96e ;
-- alt - accent - 400 : # f5a23d ;
-- alt - accent - 500 : # f28b0d ;
-- alt - accent - 600 : # c26f0a ;
-- alt - accent - 700 : # 915308 ;
-- alt - accent - 800 : # 613805 ;
-- alt - accent - 900 : # 301 c03 ;
-- alt - accent - 950 : # 180e01 ;
}
` ;
headTag . appendChild ( styleTag ) ;
sessionStorage . setItem ( "themeGreen" , 1 ) ;
}
function setOrange ( ) {
2024-12-30 12:59:03 -07:00
badgeOrange . style . display = "initial" ;
badgeGreen . style . display = "none" ;
badgeGray . style . display = "none" ;
2024-10-30 15:45:39 -06:00
styleTag . innerHTML = `
: root {
-- text : # f2ede7 ;
-- background : var ( -- background - 950 ) ;
-- primary : # d7bfa2 ;
-- secondary : # 76552 e ;
-- accent : # ffa941 ;
-- content - gradient : linear - gradient ( to bottom right , var ( -- secondary - 800 ) , var ( -- primary - 900 ) ) ;
-- accent - gradient : linear - gradient ( to bottom right , var ( -- accent ) , var ( -- accent - 200 ) 30 % , var ( -- text ) 60 % ) ;
-- link : var ( -- accent - 300 ) ;
-- visited : var ( -- accent - 400 ) ;
-- hover : var ( -- accent - 500 ) ;
-- text - 50 : # f6f3ee ;
-- text - 100 : # ede6de ;
-- text - 200 : # dbcebd ;
-- text - 300 : # c9b59c ;
-- text - 400 : # b89c7a ;
-- text - 500 : # a68359 ;
-- text - 600 : # 856947 ;
-- text - 700 : # 634 f36 ;
-- text - 800 : # 423524 ;
-- text - 900 : # 211 a12 ;
-- text - 950 : # 110 d09 ;
-- background - 50 : # f7f3ee ;
-- background - 100 : # efe7dc ;
-- background - 200 : # dfcfb9 ;
-- background - 300 : # cfb696 ;
-- background - 400 : # bf9e73 ;
-- background - 500 : # af8650 ;
-- background - 600 : # 8 c6b40 ;
-- background - 700 : # 695030 ;
-- background - 800 : # 463620 ;
-- background - 900 : # 231 b10 ;
-- background - 950 : # 110 d08 ;
-- primary - 50 : # f7f3ed ;
-- primary - 100 : # f0e7db ;
-- primary - 200 : # e0ceb8 ;
-- primary - 300 : # d1b694 ;
-- primary - 400 : # c29d70 ;
-- primary - 500 : # b3854d ;
-- primary - 600 : # 8 f6a3d ;
-- primary - 700 : # 6 b502e ;
-- primary - 800 : # 47351 f ;
-- primary - 900 : # 241 b0f ;
-- primary - 950 : # 120 d08 ;
-- secondary - 50 : # f8f3ed ;
-- secondary - 100 : # f1e7da ;
-- secondary - 200 : # e2ceb6 ;
-- secondary - 300 : # d4b691 ;
-- secondary - 400 : # c69d6c ;
-- secondary - 500 : # b88547 ;
-- secondary - 600 : # 936 a39 ;
-- secondary - 700 : # 6e502 b ;
-- secondary - 800 : # 49351 d ;
-- secondary - 900 : # 251 b0e ;
-- secondary - 950 : # 120 d07 ;
-- accent - 50 : # fff4e5 ;
-- accent - 100 : # ffe8cc ;
-- accent - 200 : # ffd199 ;
-- accent - 300 : # ffba66 ;
-- accent - 400 : # ffa333 ;
-- accent - 500 : # ff8c00 ;
-- accent - 600 : # cc7000 ;
-- accent - 700 : # 995400 ;
-- accent - 800 : # 663800 ;
-- accent - 900 : # 331 c00 ;
-- accent - 950 : # 1 a0e00 ;
-- alt - accent : # 60 fe35 ;
-- glitch - 1 : var ( -- alt - accent - 600 ) ;
-- glitch - 2 : var ( -- alt - accent - 700 ) ;
-- glitch - 3 : var ( -- alt - accent - 800 ) ;
-- alt - accent - 50 : # ebffe6 ;
-- alt - accent - 100 : # d7ffcc ;
-- alt - accent - 200 : # affe9a ;
-- alt - accent - 300 : # 88 fe67 ;
-- alt - accent - 400 : # 60 fe34 ;
-- alt - accent - 500 : # 38 fe01 ;
-- alt - accent - 600 : # 2 dcb01 ;
-- alt - accent - 700 : # 229801 ;
-- alt - accent - 800 : # 166501 ;
-- alt - accent - 900 : # 0 b3300 ;
-- alt - accent - 950 : # 061900 ;
}
` ;
headTag . appendChild ( styleTag ) ;
sessionStorage . setItem ( "themeOrange" , 1 ) ;
}
function getTheme ( ) {
if ( colorBool ) {
// if true: green
2024-10-30 19:59:07 -06:00
setGreen ( ) ;
} else {
2024-10-30 15:45:39 -06:00
// if false: orange
2024-10-30 19:59:07 -06:00
setOrange ( ) ;
2024-10-30 15:45:39 -06:00
}
2024-10-30 19:59:07 -06:00
}