Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
35 changes: 29 additions & 6 deletions apps/web/src/lib/components/general/AppHeader.svelte
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
<script lang="ts">
import { goto } from "$app/navigation";
import { modalStore } from "$lib/stores/modal";
import { panelStore } from "$lib/stores/panel";
import { darkTheme, getStyles, isMobile } from "$lib/stores/styles";
import type { SupabaseClient } from "@supabase/supabase-js";
import { getContext } from "svelte";
Expand All @@ -13,6 +14,17 @@
};

$: cssVarStyles = getStyles("0");

// Spinning animation state for theme toggle
let spinning = false;

const toggleTheme = () => {
spinning = true;
darkTheme.set(!$darkTheme);
setTimeout(() => {
spinning = false;
}, 500);
};
</script>

<nav
Expand All @@ -31,17 +43,15 @@ dark:border-zinc-700 border-zinc-200"
</div>

<div id="right" class="sm:space-x-6 space-x-4 flex items-center">
<button
on:click={() => ($darkTheme = !$darkTheme)}
class="btn-circ">
<button on:click={toggleTheme} class="btn-circ">
{#if $darkTheme}
<svg
xmlns="http://www.w3.org/2000/svg"
fill="none"
viewBox="0 0 24 24"
stroke-width="1.5"
stroke="currentColor"
class="btn-icon">
class="btn-icon {spinning ? 'spin' : ''}">
<path
stroke-linecap="round"
stroke-linejoin="round"
Expand All @@ -54,7 +64,7 @@ dark:border-zinc-700 border-zinc-200"
viewBox="0 0 24 24"
stroke-width="1.5"
stroke="currentColor"
class="btn-icon">
class="btn-icon {spinning ? 'spin' : ''}">
<path
stroke-linecap="round"
stroke-linejoin="round"
Expand All @@ -63,7 +73,7 @@ dark:border-zinc-700 border-zinc-200"
{/if}
</button>

<button class="btn-circ" on:click={() => modalStore.push("theme")}>
<button class="btn-circ" on:click={() => panelStore.open("theme")}>
<svg
xmlns="http://www.w3.org/2000/svg"
fill="none"
Expand Down Expand Up @@ -135,4 +145,17 @@ dark:border-zinc-700 border-zinc-200"
.btn-icon {
@apply w-5 h-5;
}

.spin {
animation: spin 0.5s ease-in-out;
}

@keyframes spin {
from {
transform: rotate(0deg);
}
to {
transform: rotate(360deg);
}
}
</style>
6 changes: 0 additions & 6 deletions apps/web/src/lib/components/general/ModalLib.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,6 @@
import Feedback from "./Feedback.svelte";
import FeedbackPop from "./FeedbackPop.svelte";

// Style Modals
import Theme from "./style/Theme.svelte";
import Palettes from "./style/Palettes.svelte";

// Event Modals
import ManageEvents from "../recal/modals/events/ManageEvents.svelte";
import EditEvent from "../recal/modals/events/EditEvent.svelte";
Expand All @@ -28,8 +24,6 @@
rstats: RecalStats,
feedback: Feedback,
feedbackpop: FeedbackPop,
theme: Theme,
palettes: Palettes,
manageEvents: ManageEvents,
editEvent: EditEvent,
deleteEvent: DeleteEvent
Expand Down
24 changes: 0 additions & 24 deletions apps/web/src/lib/components/general/style/Palettes.svelte

This file was deleted.

101 changes: 0 additions & 101 deletions apps/web/src/lib/components/general/style/Theme.svelte

This file was deleted.

Loading