From 85ec71db5082097edf78b9bccac3daa8c363246f Mon Sep 17 00:00:00 2001
From: Alicia Sykes
Copyright (c) 2025 Alicia Sykes [aliciasykes.com]
diff --git a/src/lib/components/page-specific/about/SelfHostingSection.svelte b/src/lib/components/page-specific/about/SelfHostingSection.svelte
index 4ea463b..ba66a91 100644
--- a/src/lib/components/page-specific/about/SelfHostingSection.svelte
+++ b/src/lib/components/page-specific/about/SelfHostingSection.svelte
@@ -17,4 +17,18 @@
lissy93/networking-toolbox image from
DockerHub.
+
+ Not using Docker, or don't have a server?
+ We support other free hosting options, just take a look at our Deployment Docs.
+
+
+
diff --git a/src/lib/composables/useToolSearch.svelte.ts b/src/lib/composables/useToolSearch.svelte.ts
index 31c1479..12e1758 100644
--- a/src/lib/composables/useToolSearch.svelte.ts
+++ b/src/lib/composables/useToolSearch.svelte.ts
@@ -2,17 +2,18 @@ import type { NavItem } from '$lib/constants/nav';
/**
* Composable for searching and filtering tools
- * @param tools Array of tools to search through
+ * @param getTools Function that returns the array of tools to search through
* @returns Object with query and filtered state that can be bound
*/
-export function useToolSearch(tools: NavItem[]) {
+export function useToolSearch(getTools: () => NavItem[]) {
const state = $state({
query: '',
- filtered: tools,
+ filtered: getTools(),
});
// Update filtered whenever query or tools change
$effect(() => {
+ const tools = getTools();
if (!state.query.trim()) {
state.filtered = tools;
} else {
diff --git a/src/lib/stores/homepageLayout.ts b/src/lib/stores/homepageLayout.ts
index 4bd022f..d2b4b7f 100644
--- a/src/lib/stores/homepageLayout.ts
+++ b/src/lib/stores/homepageLayout.ts
@@ -69,23 +69,32 @@ export const homepageLayoutOptions: HomepageLayoutOption[] = [
},
];
+// Get initial value from data attribute or localStorage (runs immediately on import)
+function getInitialLayout(): HomepageLayoutMode {
+ if (typeof window !== 'undefined') {
+ try {
+ const dataAttr = document.documentElement.getAttribute('data-initial-layout');
+ const stored = dataAttr || localStorage.getItem('homepage-layout');
+ const isValidMode = homepageLayoutOptions.some((option) => option.id === stored);
+ return isValidMode ? (stored as HomepageLayoutMode) : 'categories';
+ } catch {
+ return 'categories';
+ }
+ }
+ return 'categories';
+}
+
function createHomepageLayoutStore() {
- const { subscribe, set } = writable('categories');
+ const { subscribe, set } = writable(getInitialLayout());
return {
subscribe,
// Initialize from localStorage or default
+ // Note: Store is already initialized with correct value on creation,
+ // this is kept for backwards compatibility and does nothing
init: () => {
- if (browser) {
- const stored = localStorage.getItem(STORAGE_KEY);
- const isValidMode = homepageLayoutOptions.some((option) => option.id === stored);
- const initialMode = isValidMode ? (stored as HomepageLayoutMode) : 'categories';
-
- set(initialMode);
- return initialMode;
- }
- return 'categories';
+ return getInitialLayout();
},
// Set homepage layout mode and persist to localStorage
diff --git a/src/lib/stores/navbarDisplay.ts b/src/lib/stores/navbarDisplay.ts
index 7d3d60b..9c47535 100644
--- a/src/lib/stores/navbarDisplay.ts
+++ b/src/lib/stores/navbarDisplay.ts
@@ -35,23 +35,32 @@ export const navbarDisplayOptions: NavbarDisplayOption[] = [
},
];
+// Get initial value from data attribute or localStorage (runs immediately on import)
+function getInitialNavbarDisplay(): NavbarDisplayMode {
+ if (typeof window !== 'undefined') {
+ try {
+ const dataAttr = document.documentElement.getAttribute('data-initial-navbar');
+ const stored = dataAttr || localStorage.getItem('navbar-display');
+ const isValidMode = navbarDisplayOptions.some((option) => option.id === stored);
+ return isValidMode ? (stored as NavbarDisplayMode) : 'default';
+ } catch {
+ return 'default';
+ }
+ }
+ return 'default';
+}
+
function createNavbarDisplayStore() {
- const { subscribe, set } = writable('default');
+ const { subscribe, set } = writable(getInitialNavbarDisplay());
return {
subscribe,
// Initialize from localStorage or default
+ // Note: Store is already initialized with correct value on creation,
+ // this is kept for backwards compatibility and does nothing
init: () => {
- if (browser) {
- const stored = localStorage.getItem(STORAGE_KEY);
- const isValidMode = navbarDisplayOptions.some((option) => option.id === stored);
- const initialMode = isValidMode ? (stored as NavbarDisplayMode) : 'default';
-
- set(initialMode);
- return initialMode;
- }
- return 'default';
+ return getInitialNavbarDisplay();
},
// Set navbar display mode and persist to localStorage
diff --git a/src/lib/stores/theme.ts b/src/lib/stores/theme.ts
index bd237e6..9162ec5 100644
--- a/src/lib/stores/theme.ts
+++ b/src/lib/stores/theme.ts
@@ -42,13 +42,27 @@ function loadCustomFont(fontConfig: { name: string; url: string; fallback?: stri
function applyThemeClasses(theme: ThemeOption) {
if (!browser) return;
+ const targetClass = theme !== 'dark' ? `theme-${theme}` : null;
+
+ // Check if the theme is already applied (prevents flash from re-applying)
+ const currentThemeClass = Array.from(document.documentElement.classList).find((cls) => cls.startsWith('theme-'));
+
+ if (currentThemeClass === targetClass) {
+ // Theme already applied, just ensure font is loaded
+ const themeConfig = themes.find((t) => t.id === theme);
+ if (themeConfig?.font) {
+ loadCustomFont(themeConfig.font);
+ }
+ return;
+ }
+
// Remove all existing theme classes
const allThemeClasses = themes.map((t) => `theme-${t.id}`);
document.documentElement.classList.remove(...allThemeClasses);
// Add the current theme class (except for default 'dark' theme)
- if (theme !== 'dark') {
- document.documentElement.classList.add(`theme-${theme}`);
+ if (targetClass) {
+ document.documentElement.classList.add(targetClass);
}
// Load custom font if the theme has one
diff --git a/src/routes/about/(sections)/license/+page.svelte b/src/routes/about/(sections)/license/+page.svelte
index 11b2d14..9a64144 100644
--- a/src/routes/about/(sections)/license/+page.svelte
+++ b/src/routes/about/(sections)/license/+page.svelte
@@ -2,4 +2,4 @@
import LicenseSection from '$lib/components/page-specific/about/LicenseSection.svelte';
-
+
diff --git a/src/routes/about/+layout.svelte b/src/routes/about/+layout.svelte
index 3691b5c..50385ca 100644
--- a/src/routes/about/+layout.svelte
+++ b/src/routes/about/+layout.svelte
@@ -1,14 +1,23 @@
-
-
+
+ {@render children()}
diff --git a/src/routes/about/+page.svelte b/src/routes/about/+page.svelte
index 9fe2e11..44030e2 100644
--- a/src/routes/about/+page.svelte
+++ b/src/routes/about/+page.svelte
@@ -1,8 +1,6 @@