Compare commits
No commits in common. "efbaaef915675a1555701fa1c5e08b00db02b0ad" and "162158340b28d74bb606b83ecc4e3efcfaf0868f" have entirely different histories.
efbaaef915
...
162158340b
11
src/app.html
11
src/app.html
|
@ -12,19 +12,16 @@
|
||||||
%sveltekit.head%
|
%sveltekit.head%
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
let theme = null;
|
|
||||||
|
|
||||||
if (typeof localStorage !== 'undefined') {
|
if (typeof localStorage !== 'undefined') {
|
||||||
theme = localStorage.getItem('theme');
|
theme = localStorage.getItem('theme');
|
||||||
}
|
}
|
||||||
|
const themesArr = ["green", "netherrack", "dark", "pink"];
|
||||||
window.AvailableThemes = ["green", "netherrack", "dark", "pink"];
|
|
||||||
|
|
||||||
if (!theme) {
|
if (!theme) {
|
||||||
const randomNumber = Math.floor(Math.random() * 4);
|
const randomNumber = Math.floor(Math.random() * 4);
|
||||||
console.log("Slecting: " + AvailableThemes[randomNumber]);
|
console.log("Slecting: " + themesArr[randomNumber]);
|
||||||
document.documentElement.setAttribute('data-theme', AvailableThemes[randomNumber]);
|
document.documentElement.setAttribute('data-theme', themesArr[randomNumber]);
|
||||||
localStorage.setItem('theme', AvailableThemes[randomNumber]);
|
localStorage.setItem('theme', themesArr[randomNumber]);
|
||||||
} else {
|
} else {
|
||||||
console.log("Slecting: " + theme);
|
console.log("Slecting: " + theme);
|
||||||
document.documentElement.setAttribute('data-theme', theme);
|
document.documentElement.setAttribute('data-theme', theme);
|
||||||
|
|
|
@ -5,10 +5,7 @@
|
||||||
|
|
||||||
import { fly } from 'svelte/transition';
|
import { fly } from 'svelte/transition';
|
||||||
import MediaQuery from 'svelte-media-queries';
|
import MediaQuery from 'svelte-media-queries';
|
||||||
import { Dices } from "@lucide/svelte";
|
export let hideOnPrint: boolean;
|
||||||
let hideOnPrint: boolean;
|
|
||||||
|
|
||||||
let { children } = $props();
|
|
||||||
|
|
||||||
import DeprivedLogo from "$lib/images/DeprivedLogo.svelte";
|
import DeprivedLogo from "$lib/images/DeprivedLogo.svelte";
|
||||||
import HamburgerMenuIcon from "$lib/images/HamburgerMenuIcon.svelte";
|
import HamburgerMenuIcon from "$lib/images/HamburgerMenuIcon.svelte";
|
||||||
|
@ -40,33 +37,8 @@
|
||||||
lock.name = 'darkreader-lock';
|
lock.name = 'darkreader-lock';
|
||||||
document.head.appendChild(lock);
|
document.head.appendChild(lock);
|
||||||
});
|
});
|
||||||
|
|
||||||
function nextTheme(){
|
|
||||||
let theme: string | null = null;
|
|
||||||
|
|
||||||
if (typeof localStorage !== 'undefined') {
|
|
||||||
theme = localStorage.getItem('theme');
|
|
||||||
}
|
|
||||||
|
|
||||||
const themesArr = (window as any).AvailableThemes;
|
|
||||||
let nextTheme = "dark";
|
|
||||||
if (theme == "null" || theme == "undefined" || theme == undefined || theme == null){
|
|
||||||
|
|
||||||
} else {
|
|
||||||
nextTheme = themesArr[(1 - -themesArr.indexOf(theme)) % themesArr.length];
|
|
||||||
}
|
|
||||||
|
|
||||||
console.log("Slecting: " + nextTheme);
|
|
||||||
document.documentElement.setAttribute('data-theme', nextTheme);
|
|
||||||
localStorage.setItem('theme', nextTheme);
|
|
||||||
}
|
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
{#snippet SwitchThemeButton()}
|
|
||||||
<div class="tooltip tooltip-bottom grid place-content-center" data-tip="Switch theme">
|
|
||||||
<button class="cursor-pointer" on:click={nextTheme}> <Dices/></button>
|
|
||||||
</div>
|
|
||||||
{/snippet}
|
|
||||||
|
|
||||||
<!-- Detect mobile -->
|
<!-- Detect mobile -->
|
||||||
<MediaQuery query='(max-width: {footerCollapseThreshold})' bind:matches={footerCollapse} />
|
<MediaQuery query='(max-width: {footerCollapseThreshold})' bind:matches={footerCollapse} />
|
||||||
|
@ -86,9 +58,6 @@
|
||||||
|
|
||||||
<!-- <a href="/">Home</a> -->
|
<!-- <a href="/">Home</a> -->
|
||||||
<!-- <a href="/zhen/notes/physics/1?hideOnPrint=1" target="_blank" style="width: 7.5rem;">Notes</a> -->
|
<!-- <a href="/zhen/notes/physics/1?hideOnPrint=1" target="_blank" style="width: 7.5rem;">Notes</a> -->
|
||||||
|
|
||||||
{@render SwitchThemeButton()}
|
|
||||||
|
|
||||||
<a href="/zhen/cv/rev2?hideOnPrint=1" target="_blank" style="width: 7.5rem;">Zhen CV</a>
|
<a href="/zhen/cv/rev2?hideOnPrint=1" target="_blank" style="width: 7.5rem;">Zhen CV</a>
|
||||||
<a href="/tools" style="width: 7.5rem;">Tools</a>
|
<a href="/tools" style="width: 7.5rem;">Tools</a>
|
||||||
<a href="https://botalex.itch.io/" target="_blank">Games</a>
|
<a href="https://botalex.itch.io/" target="_blank">Games</a>
|
||||||
|
@ -102,8 +71,6 @@
|
||||||
<!-- <h3 id="logo-text">The Deprived Devs</h3> -->
|
<!-- <h3 id="logo-text">The Deprived Devs</h3> -->
|
||||||
</a>
|
</a>
|
||||||
<div class="nav-spacer" />
|
<div class="nav-spacer" />
|
||||||
{@render SwitchThemeButton()}
|
|
||||||
<div class="px-1"></div>
|
|
||||||
<button id="toggle-nav" on:click={() => navbarHidden = !navbarHidden}>
|
<button id="toggle-nav" on:click={() => navbarHidden = !navbarHidden}>
|
||||||
<HamburgerMenuIcon Class="fill-base-content"/>
|
<HamburgerMenuIcon Class="fill-base-content"/>
|
||||||
</button>
|
</button>
|
||||||
|
@ -122,7 +89,7 @@
|
||||||
</header>
|
</header>
|
||||||
|
|
||||||
<!-- Page content -->
|
<!-- Page content -->
|
||||||
{@render children?.()}
|
<slot />
|
||||||
|
|
||||||
<!-- About footer -->
|
<!-- About footer -->
|
||||||
<div class="{hideOnPrint ? 'hide-on-print' : ''} flex flex-col justify-center pt-8 bg-base-300 mt-8">
|
<div class="{hideOnPrint ? 'hide-on-print' : ''} flex flex-col justify-center pt-8 bg-base-300 mt-8">
|
||||||
|
|
|
@ -33,7 +33,7 @@
|
||||||
<div class="developersProfile snorre-overlay relative pl-1 font-mono">
|
<div class="developersProfile snorre-overlay relative pl-1 font-mono">
|
||||||
<NameAndTag name="Snorre" tags={tags} isMobile={isMobile}/>
|
<NameAndTag name="Snorre" tags={tags} isMobile={isMobile}/>
|
||||||
<span>
|
<span>
|
||||||
<p>I'm the diversity hire. <span class="border-b" style="border-image: linear-gradient(to right, red, orange, yellow, green, blue, indigo, violet); border-image-slice: 1;">(Gay)</span></p>
|
<p>I'm the diversity hire. (Gay)</p>
|
||||||
<!-- <p><a href="https://www.linkedin.com/in/snorrealtschul/" target="_blank" style="color:lightblue;">My website</a></p> -->
|
<!-- <p><a href="https://www.linkedin.com/in/snorrealtschul/" target="_blank" style="color:lightblue;">My website</a></p> -->
|
||||||
<p><a href="https://spoodythe.one/" target="_blank" style="color:lightblue;">My website</a></p>
|
<p><a href="https://spoodythe.one/" target="_blank" style="color:lightblue;">My website</a></p>
|
||||||
</span>
|
</span>
|
||||||
|
|
Loading…
Reference in a new issue