Compare commits

..

No commits in common. "efbaaef915675a1555701fa1c5e08b00db02b0ad" and "162158340b28d74bb606b83ecc4e3efcfaf0868f" have entirely different histories.

3 changed files with 8 additions and 44 deletions

View file

@ -12,19 +12,16 @@
%sveltekit.head%
<script>
let theme = null;
if (typeof localStorage !== 'undefined') {
theme = localStorage.getItem('theme');
}
window.AvailableThemes = ["green", "netherrack", "dark", "pink"];
}
const themesArr = ["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]);
console.log("Slecting: " + themesArr[randomNumber]);
document.documentElement.setAttribute('data-theme', themesArr[randomNumber]);
localStorage.setItem('theme', themesArr[randomNumber]);
} else {
console.log("Slecting: " + theme);
document.documentElement.setAttribute('data-theme', theme);

View file

@ -5,10 +5,7 @@
import { fly } from 'svelte/transition';
import MediaQuery from 'svelte-media-queries';
import { Dices } from "@lucide/svelte";
let hideOnPrint: boolean;
let { children } = $props();
export let hideOnPrint: boolean;
import DeprivedLogo from "$lib/images/DeprivedLogo.svelte";
import HamburgerMenuIcon from "$lib/images/HamburgerMenuIcon.svelte";
@ -40,33 +37,8 @@
lock.name = 'darkreader-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>
{#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 -->
<MediaQuery query='(max-width: {footerCollapseThreshold})' bind:matches={footerCollapse} />
@ -86,9 +58,6 @@
<!-- <a href="/">Home</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="/tools" style="width: 7.5rem;">Tools</a>
<a href="https://botalex.itch.io/" target="_blank">Games</a>
@ -102,8 +71,6 @@
<!-- <h3 id="logo-text">The Deprived Devs</h3> -->
</a>
<div class="nav-spacer" />
{@render SwitchThemeButton()}
<div class="px-1"></div>
<button id="toggle-nav" on:click={() => navbarHidden = !navbarHidden}>
<HamburgerMenuIcon Class="fill-base-content"/>
</button>
@ -122,7 +89,7 @@
</header>
<!-- Page content -->
{@render children?.()}
<slot />
<!-- About footer -->
<div class="{hideOnPrint ? 'hide-on-print' : ''} flex flex-col justify-center pt-8 bg-base-300 mt-8">

View file

@ -33,7 +33,7 @@
<div class="developersProfile snorre-overlay relative pl-1 font-mono">
<NameAndTag name="Snorre" tags={tags} isMobile={isMobile}/>
<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://spoodythe.one/" target="_blank" style="color:lightblue;">My website</a></p>
</span>