Fixed random themes at first login. (this commit is from a macbook in Bilka)
All checks were successful
Rebuild signaller for deprived.dev to rebuild site / test_service (push) Successful in 21s
All checks were successful
Rebuild signaller for deprived.dev to rebuild site / test_service (push) Successful in 21s
This commit is contained in:
parent
11274585f6
commit
900888ee07
1 changed files with 34 additions and 34 deletions
68
src/app.html
68
src/app.html
|
@ -1,42 +1,42 @@
|
|||
<!doctype html>
|
||||
<html lang="en" data-theme="Deprived" style="overflow-x: hidden;">
|
||||
<head>
|
||||
<meta charset="utf-8" />
|
||||
<meta name="description" content="
|
||||
We are the deprived devs, and we are a team of developers specializing in indie game development, full-stack development, and anything tech-related!">
|
||||
<link rel="icon" href="%sveltekit.assets%/favicon.png" />
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1" />
|
||||
<html lang="en" data-theme="Deprived" style="overflow-x: hidden">
|
||||
<head>
|
||||
<meta charset="utf-8" />
|
||||
<meta
|
||||
name="description"
|
||||
content="
|
||||
We are the deprived devs, and we are a team of developers specializing in indie game development, full-stack development, and anything tech-related!"
|
||||
/>
|
||||
<link rel="icon" href="%sveltekit.assets%/favicon.png" />
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1" />
|
||||
|
||||
<!-- Change theme for site here -->
|
||||
<link rel="stylesheet" href="/stylesheets/global.css" />
|
||||
%sveltekit.head%
|
||||
<!-- Change theme for site here -->
|
||||
<link rel="stylesheet" href="/stylesheets/global.css" />
|
||||
%sveltekit.head%
|
||||
|
||||
<script>
|
||||
let theme = null;
|
||||
<script>
|
||||
let theme = null;
|
||||
|
||||
if (typeof localStorage !== 'undefined') {
|
||||
theme = localStorage.getItem('theme');
|
||||
}
|
||||
if (typeof localStorage !== "undefined") {
|
||||
theme = localStorage.getItem("theme");
|
||||
}
|
||||
|
||||
window.AvailableThemes = ["green", "netherrack", "dark", "pink"];
|
||||
|
||||
if (!theme) {
|
||||
const randomNumber = Math.floor(Math.random() * 4);
|
||||
console.log("Slecting: " + AvailableThemes[randomNumber]);
|
||||
document.documentElement.setAttribute('data-theme', AvailableThemes[randomNumber]);
|
||||
localStorage.setItem('theme', AvailableThemes[randomNumber]);
|
||||
}
|
||||
//else {
|
||||
// console.log("Slecting: " + theme);
|
||||
// document.documentElement.setAttribute('data-theme', theme);
|
||||
//}
|
||||
</script>
|
||||
window.AvailableThemes = ["green", "netherrack", "dark", "pink"];
|
||||
|
||||
</head>
|
||||
if (!theme) {
|
||||
// const randomNumber = Math.floor(Math.random() * 4);
|
||||
// console.log("Slecting: " + AvailableThemes[randomNumber]);
|
||||
// document.documentElement.setAttribute('data-theme', AvailableThemes[randomNumber]);
|
||||
localStorage.setItem("theme", AvailableThemes[0]);
|
||||
}
|
||||
//else {
|
||||
// console.log("Slecting: " + theme);
|
||||
// document.documentElement.setAttribute('data-theme', theme);
|
||||
//}
|
||||
</script>
|
||||
</head>
|
||||
|
||||
<body style="display: contents">
|
||||
<div class="inline relative w-full h-full">
|
||||
%sveltekit.body%
|
||||
</div>
|
||||
</body>
|
||||
<body style="display: contents">
|
||||
<div class="inline relative w-full h-full">%sveltekit.body%</div>
|
||||
</body>
|
||||
</html>
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue