main #8
5 changed files with 52 additions and 44 deletions
|
@ -1,19 +0,0 @@
|
||||||
function redirect() {
|
|
||||||
const chromium = /Chrome|Chromium|OPR|Opera|Edge|UC|QQ/.test(
|
|
||||||
navigator.userAgent
|
|
||||||
);
|
|
||||||
|
|
||||||
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");
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
|
@ -1,8 +0,0 @@
|
||||||
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"]}`;
|
|
||||||
});
|
|
|
@ -1,14 +1,54 @@
|
||||||
|
// loads all the functions to be loaded on load, pretty simple, it loads shit on load.
|
||||||
|
function onLoad() {
|
||||||
|
jsEnabled();
|
||||||
|
getSGAState();
|
||||||
|
redirect();
|
||||||
|
checkBoxes();
|
||||||
|
getPlaceholder();
|
||||||
|
}
|
||||||
|
|
||||||
// if javascript is enabled, this script will load, enabling all site elements that use javascript, by default these are all hidden.
|
// if javascript is enabled, this script will load, enabling all site elements that use javascript, by default these are all hidden.
|
||||||
function jsEnabled() {
|
function jsEnabled() {
|
||||||
// Get JS required element ids
|
// Get JS required element ids
|
||||||
const lastFmWidget = document.getElementById("lastfm-widget");
|
const lastFmWidget = document.getElementById("lastfm-widget");
|
||||||
const ntfyWidgetContainer = document.getElementById("ntfyWidgetContainer");
|
const ntfyWidgetContainer = document.getElementById("ntfyWidgetContainer");
|
||||||
const sgaButton = document.getElementById("sgaButton");
|
const sgaButton = document.getElementById("sgaButton");
|
||||||
const incrementButton = document.getElementById("incrementButton");
|
const incrementButton = document.getElementById("incrementButton");
|
||||||
|
|
||||||
// enable js required element ids
|
// enable js required element ids
|
||||||
lastFmWidget.style.display = "initial";
|
lastFmWidget.style.display = "initial";
|
||||||
ntfyWidgetContainer.style.display = "initial";
|
ntfyWidgetContainer.style.display = "initial";
|
||||||
sgaButton.style.display = "initial";
|
sgaButton.style.display = "initial";
|
||||||
incrementButton.style.display = "initial";
|
incrementButton.style.display = "initial";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// 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(
|
||||||
|
navigator.userAgent
|
||||||
|
);
|
||||||
|
|
||||||
|
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");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
|
@ -2,10 +2,7 @@
|
||||||
<!-- optimized -->
|
<!-- optimized -->
|
||||||
|
|
||||||
<!-- unoptimized -->
|
<!-- unoptimized -->
|
||||||
<!-- <script is:inline src="/scripts/ntfy.js"></script>-->
|
|
||||||
<script is:inline src="/scripts/lastfm.js"></script>
|
|
||||||
<script is:inline src="/scripts/sound.js"></script>
|
<script is:inline src="/scripts/sound.js"></script>
|
||||||
<script is:inline src="/scripts/fuckchrome.js"></script>
|
|
||||||
<script is:inline src="/scripts/sga.js"></script>
|
<script is:inline src="/scripts/sga.js"></script>
|
||||||
<script is:inline src="/scripts/ntfy.js"></script>
|
<script is:inline src="/scripts/ntfy.js"></script>
|
||||||
<script is:inline src="/scripts/main.js"></script>
|
<script is:inline src="/scripts/main.js"></script>
|
|
@ -16,7 +16,7 @@ const { title } = Astro.props;
|
||||||
<head>
|
<head>
|
||||||
<Head title={title} />
|
<Head title={title} />
|
||||||
</head>
|
</head>
|
||||||
<body onload="jsEnabled(), getSGAState(), redirect(), checkBoxes(), getPlaceholder()" id="body">
|
<body onload="onLoad()" id="body">
|
||||||
<Header />
|
<Header />
|
||||||
<section class="content center">
|
<section class="content center">
|
||||||
<h1 class="title">{title}</h1>
|
<h1 class="title">{title}</h1>
|
||||||
|
@ -24,8 +24,6 @@ const { title } = Astro.props;
|
||||||
<slot />
|
<slot />
|
||||||
<Footer />
|
<Footer />
|
||||||
<NormalScripts />
|
<NormalScripts />
|
||||||
|
|
||||||
<!-- <script is:inline src="/scripts/sn.js"></script>-->
|
|
||||||
<audio
|
<audio
|
||||||
id="clickSound"
|
id="clickSound"
|
||||||
src="/assets/sounds/ui/zapsplat_multimedia_button_click_004_68776.mp3">
|
src="/assets/sounds/ui/zapsplat_multimedia_button_click_004_68776.mp3">
|
||||||
|
|
Loading…
Reference in a new issue