random quote fix

This commit is contained in:
sky 2024-08-13 05:06:24 -04:00
parent f18f4a0f0b
commit 6cb7f8d20a
2 changed files with 73 additions and 79 deletions

View File

@ -1,70 +1,80 @@
<!doctype html> <!DOCTYPE html>
<html class="sl-theme-dark" lang="en"> <html class="sl-theme-dark" lang="en">
<head> <head>
<!-- initialize theme vars <!-- initialize theme vars
https://coolors.co/10002b-240046-3c096c-5a189a-7b2cbf-9d4edd-c77dff-e0aaff --> https://coolors.co/10002b-240046-3c096c-5a189a-7b2cbf-9d4edd-c77dff-e0aaff -->
<!-- initialize externals --> <!-- initialize externals -->
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.7.0/jquery.min.js"></script> <script src="https://ajax.googleapis.com/ajax/libs/jquery/3.7.0/jquery.min.js"></script>
<script src=" https://cdn.jsdelivr.net/npm/js-cookie@3.0.5/dist/js.cookie.min.js "></script> <script src=" https://cdn.jsdelivr.net/npm/js-cookie@3.0.5/dist/js.cookie.min.js "></script>
<!-- initialize my stuff --> <!-- initialize my stuff -->
<script src="/js/all.min.js"></script> <script src="/js/all.min.js"></script>
<script src="/js/main.js"></script> <script src="/js/main.js"></script>
<script src="/js/widget.js"></script> <script src="/js/widget.js"></script>
<script src="/js/themes.js"></script> <script src="/js/themes.js"></script>
<script src="/js/randomquote.js"></script> <script>
document.addEventListener("DOMContentLoaded", () => {
fetch("/data/quotes.json")
.then((response) => response.json())
.then((data) => {
const randomQuote = data[Math.floor(Math.random() * data.length)];
<link rel="stylesheet" href="/style.css" /> if (randomQuote.includes("OGNUM1") && randomQuote.includes("SQRTNUM1")) {
<link rel="manifest" href="/manifest.json"> const ognum = Math.floor(Math.random() * 3000);
randomQuote = `the square root of ${ognum} is ${Math.sqrt(ognum)}`;
} else if (randomQuote.includes("CURRENTURL")) {
randomQuote = window.location.hostname;
}
<!-- seo + other things --> document.getElementById("randomquote").innerHTML = randomQuote;
<title>Selenite</title> })
<link rel="icon" href="/favicon.ico" /> .catch((error) => console.error("Error loading quotes:", error));
<script async src="https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js?client=ca-pub-3415518411898563" });
crossorigin="anonymous"></script> </script>
</head>
<alerts> </alerts> <link rel="stylesheet" href="/style.css" />
<body id="noscroll"> <link rel="manifest" href="/manifest.json" />
<header>
<a href="/index.html">Home</a> <!-- seo + other things -->
<a href="/bookmarklets.html">Bookmarklets</a> <title>Selenite</title>
<a href="/projects.html">Games</a> <link rel="icon" href="/favicon.ico" />
<a href="/apps.html">Apps</a> <script async src="https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js?client=ca-pub-3415518411898563" crossorigin="anonymous"></script>
<a href="/settings.html">Settings</a> </head>
<a id="blank" href="#">Open Blank</a> <alerts> </alerts>
<a href="/u/" class="usericon"><img src="/img/user.svg" /></a> <body id="noscroll">
</header> <header>
<main id="main" class="noscroll"> <a href="/index.html">Home</a>
<b style="font-weight: 1000px"><h1 class="chan">selenite.</h1></b> <a href="/bookmarklets.html">Bookmarklets</a>
<noscript <a href="/projects.html">Games</a>
>enable javascript if you want the games to actually <a href="/apps.html">Apps</a>
load</noscript <a href="/settings.html">Settings</a>
> <a id="blank" href="#">Open Blank</a>
<p id="randomquote">better thank me for this unblocked website</p> <a href="/u/" class="usericon"><img src="/img/user.svg" /></a>
<div class="samerow"> </header>
<div class="img-container"> <main id="main" class="noscroll">
<a href="/users" <b style="font-weight: 1000px"><h1 class="chan">selenite.</h1></b>
><img src="img/user_index.svg" <noscript>enable javascript if you want the games to actually load</noscript>
/></a> <p id="randomquote">better thank me for this unblocked website</p>
</div> <div class="samerow">
<div class="img-container"> <div class="img-container">
<a href="projects.html"><img src="img/games.svg" /></a> <a href="/users"><img src="img/user_index.svg" /></a>
</div> </div>
<div class="img-container"> <div class="img-container">
<a href="https://discord.gg/7jyufnwJNf" <a href="projects.html"><img src="img/games.svg" /></a>
><img src="img/discord.svg" </div>
/></a> <div class="img-container">
</div> <a href="https://discord.gg/7jyufnwJNf"><img src="img/discord.svg" /></a>
</div> </div>
</main> </div>
<footer class="noscroll"> </main>
<a href="gitlab.com/skysthelimit.dev/selenite">Source</a> <footer class="noscroll">
<a href="https://discord.gg/7jyufnwJNf">Discord</a> <a href="gitlab.com/skysthelimit.dev/selenite">Source</a>
<a href="/suggest.html">Suggestions & Bugs</a> <a href="https://discord.gg/7jyufnwJNf">Discord</a>
<a href="/contact.html">Contact</a> <a href="/suggest.html">Suggestions & Bugs</a>
<a href="/support.html">Donate</a> <a href="/contact.html">Contact</a>
<a href="/about.html">About</a> <a href="/support.html">Donate</a>
</footer> <a href="/about.html">About</a>
</body> </footer>
</body>
</html> </html>

View File

@ -1,16 +0,0 @@
$.getJSON("/data/quotes.json", function (data) {
let index = data[Math.floor(Math.random() * data.length)];
if (index.includes("OGNUM1") && index.includes("SQRTNUM1")) {
let ognum = Math.floor(Math.random() * 3000);
index = "the square root of " + ognum + " is " + Math.sqrt(ognum);
} else if (index.includes("CURRENTURL")) {
index = window.location.hostname;
}
if (document.readyState === "complete") {
document.getElementById("randomquote").innerHTML = index;
} else {
document.addEventListener("DOMContentLoaded", () => {
document.getElementById("randomquote").innerHTML = index;
});
}
});