New themes

This commit is contained in:
Alicia Sykes committed 2025-09-23 02:13:00 +01:00
1 parent 30d50fa40f
commit 43a599073d
8 files changed
+319 -24

No files matched your search

@@ -17,6 +17,7 @@
let isOpen = $state(false);
let showMoreA11y = $state(false);
let showMoreThemes = $state(false);
let menuRef = $state<HTMLDivElement>();
let triggerRef = $state<HTMLButtonElement>();
let accessibilitySettings = $state(accessibility);
@@ -150,7 +151,8 @@
<div class="settings-section">
<h3>Theme</h3>
<div class="theme-options" role="radiogroup" aria-label="Theme selection">
{#each themes as themeOption (themeOption.id)}
<!-- Primary themes (always visible - first 6) -->
{#each themes.slice(0, 6) as themeOption (themeOption.id)}
<button
class="theme-option"
class:active={$currentTheme === themeOption.id}
@@ -167,7 +169,38 @@
</span>
</button>
{/each}
<!-- Additional themes (expandable if more than 6) -->
{#if showMoreThemes && themes.length > 6}
<div class="additional-themes" transition:slide={{ duration: 300 }}>
{#each themes.slice(6) as themeOption (themeOption.id)}
<button
class="theme-option"
class:active={$currentTheme === themeOption.id}
class:disabled={!themeOption.available}
onclick={() => handleThemeChange(themeOption.id)}
role="radio"
aria-checked={$currentTheme === themeOption.id}
disabled={!themeOption.available}
>
<div class="theme-preview theme-{themeOption.id}"></div>
<span>
{themeOption.name}
{!themeOption.available ? ' (Soon)' : ''}
</span>
</button>
{/each}
</div>
{/if}
</div>
<!-- Show more/less button (only if there are more than 6 themes) -->
{#if themes.length > 6}
<button class="show-more-btn" onclick={() => (showMoreThemes = !showMoreThemes)} aria-expanded={showMoreThemes}>
<Icon name={showMoreThemes ? 'chevron-up' : 'chevron-down'} size="sm" />
<span>{showMoreThemes ? 'Show less' : 'Show more themes'}</span>
</button>
{/if}
</div>
<!-- Language Selection -->
@@ -307,6 +340,8 @@
left: 0;
right: 0;
width: 100%;
max-height: 85vh;
overflow-y: auto;
border-radius: var(--radius-lg) var(--radius-lg) 0 0;
animation: slideUp var(--transition-slow);
}
@@ -327,13 +362,15 @@
}
}
.theme-options {
display: flex;
.theme-options, .additional-themes {
display: grid;
grid-template-columns: repeat(auto-fit, minmax(64px, 1fr));
gap: var(--spacing-xs);
.additional-themes {
grid-column: 1 / -1;
}
}
.theme-option {
flex: 1;
display: flex;
flex-direction: column;
align-items: center;
@@ -376,12 +413,22 @@
background: linear-gradient(135deg, #0d1117 50%, #161b22 50%);
}
&.theme-ocean {
background: linear-gradient(135deg, #1a4c7a 50%, #2d5f8f 50%);
opacity: 0.6;
background: linear-gradient(135deg, #131c2b 50%, #70edb7 50%);
}
&.theme-purple {
background: linear-gradient(135deg, #473180 50%, #9052d3 50%);
opacity: 0.6;
background: linear-gradient(135deg, #13182b 50%, #cca6ff 50%);
}
&.theme-cyberpunk {
background: linear-gradient(135deg, #0a0614 50%, #ff00ff 50%);
}
&.theme-midnight {
background: linear-gradient(135deg, #0a0e27 50%, #5e72e4 50%);
}
&.theme-arctic {
background: linear-gradient(135deg, #f0f4f8 50%, #00acc1 50%);
}
&.theme-terminal {
background: linear-gradient(135deg, #000000 50%, #00ff00 50%);
}
}
+8 -10
View File
@@ -87,7 +87,8 @@
icon: bookmark.icon,
description: bookmark.description,
}));
break;
// Show most recent bookmarks first
return items.reverse();
case 'frequent':
items = $frequentlyUsedTools.slice(0, 8).map((tool) => ({
@@ -96,20 +97,17 @@
icon: tool.icon,
description: tool.description,
}));
break;
// Already sorted by frequency, no need to reverse
return items;
case 'none':
items = [];
break;
return [];
case 'default':
default:
items = TOP_NAV;
break;
// Keep default navigation items in their original order
return TOP_NAV;
}
// Reverse array so items overflow from left but appear in correct visual order
return items.reverse();
})();
onMount(() => {
@@ -119,7 +117,7 @@
});
</script>
<nav class="top-nav" class:has-dropdowns={hasDropdowns} aria-label="Primary navigation">
<nav id="navigation" class="top-nav" class:has-dropdowns={hasDropdowns} aria-label="Primary navigation">
{#each navigationItems as item (item.href)}
<div
class="nav-item"
@@ -83,7 +83,7 @@
<a href="https://github.com/sponsors/lissy93" target="_blank">Sponsor</a>
</div>
<h3>More Apps</h3>
<h3 id="more-apps">More Apps</h3>
<p>If you've found this app useful, you might also like some of my other projects:</p>
<div class="more-app-list">
<div class="links-grid">
@@ -68,6 +68,6 @@
rel="noopener noreferrer">here</a
>
and I'll look into getting it fixed for you.<br />
For security issues, please see our <a href="/security.txt"><code>security.txt</code></a>
For security issues, please see our <a href="https://networking-toolbox.as93.net/security.txt"><code>security.txt</code></a>
</p>
</section>
+43 -3
View File
@@ -60,16 +60,36 @@ function applyThemeClasses(theme: ThemeOption) {
// Available themes configuration
export const themes: Theme[] = [
{
id: 'light',
name: 'Light',
{
id: 'midnight',
name: 'Midnight',
available: true,
font: {
name: 'Montserrat',
url: 'https://fonts.googleapis.com/css2?family=Montserrat:wght@300;400;500;600;700;800;900&family=IBM+Plex+Mono:wght@400;500;600;700&display=swap',
fallback: 'sans-serif',
},
},
{
id: 'arctic',
name: 'Arctic',
available: true,
font: {
name: 'Raleway',
url: 'https://fonts.googleapis.com/css2?family=Raleway:wght@300;400;500;600;700;800&family=Source+Code+Pro:wght@400;500;600;700&display=swap',
fallback: 'sans-serif',
},
},
{
id: 'dark',
name: 'Dark',
available: true,
},
{
id: 'light',
name: 'Light',
available: true,
},
{
id: 'ocean',
name: 'Ocean',
@@ -90,6 +110,26 @@ export const themes: Theme[] = [
fallback: 'sans',
},
},
{
id: 'cyberpunk',
name: 'Cyberpunk',
available: true,
font: {
name: 'Orbitron',
url: 'https://fonts.googleapis.com/css2?family=Orbitron:wght@400;500;600;700;800;900&family=Share+Tech+Mono&display=swap',
fallback: 'monospace',
},
},
{
id: 'terminal',
name: 'Terminal',
available: true,
font: {
name: 'JetBrains Mono',
url: 'https://fonts.googleapis.com/css2?family=JetBrains+Mono:wght@300;400;500;600;700;800&display=swap',
fallback: 'monospace',
},
},
];
function createThemeStore() {
+2
View File
@@ -2,6 +2,8 @@ import { site } from '$lib/constants/site';
import type { LayoutServerLoad } from './$types';
import { TOP_NAV, SUB_NAV, type NavItem } from '$lib/constants/nav';
export const prerender = true; // Enable prerendering for all pages using this layout
function findNavItem(href: string): NavItem | null {
const top = TOP_NAV.find((i) => i.href === href);
if (top) return top;
+2
View File
@@ -1,6 +1,8 @@
import { ALL_PAGES, TOP_NAV, footerLinks, aboutPages } from '$lib/constants/nav';
import { site } from '$lib/constants/site';
export const prerender = true;
/**
* Dynamic sitemap.xml endpoint
*
+206
View File
@@ -145,3 +145,209 @@ html[data-theme='light'] {
--shadow-md: 0 4px 10px rgba(0, 0, 0, 0.1);
--shadow-lg: 0 12px 24px rgba(0, 0, 0, 0.16);
}
/* Cyberpunk Theme - Neon tech aesthetic with glowing effects */
.theme-cyberpunk,
html[data-theme='cyberpunk'] {
/* Backgrounds - Dark with subtle purple undertones */
--bg-primary: #0a0614;
--bg-secondary: #110a1f;
--bg-tertiary: #1a0f2e;
/* Text - High contrast with slight glow */
--text-primary: #f0e6ff;
--text-secondary: #b8a6d9;
--text-tertiary: #8b7ba3;
/* Primary - Hot pink neon */
--color-primary: #ff00ff;
--color-primary-hover: #ff66ff;
--color-primary-dark: #cc00cc;
/* Action colors - Neon palette */
--color-success: #00ff88;
--color-success-light: #66ffaa;
--color-warning: #ffaa00;
--color-warning-light: #ffcc66;
--color-error: #ff0055;
--color-error-light: #ff6688;
--color-info: #00ddff;
--color-info-light: #66eeff;
--color-purple: #bf40ff;
--color-pink: #ff0099;
/* Borders & surfaces - Subtle neon glow */
--border-primary: #3d1f5c;
--border-secondary: #2a1540;
--surface-hover: #1f1033;
--surface-active: #2a1540;
/* Shadows with neon glow effect */
--shadow-sm: 0 0 4px rgba(255, 0, 255, 0.2);
--shadow-md: 0 0 12px rgba(255, 0, 255, 0.3);
--shadow-lg: 0 0 24px rgba(255, 0, 255, 0.4);
/* Fonts */
--font-heading: 'Orbitron', monospace;
--font-body: 'Share Tech Mono', monospace;
--font-mono: 'Share Tech Mono', monospace;
}
/* Midnight Theme - Sophisticated deep blues and purples */
.theme-midnight,
html[data-theme='midnight'] {
/* Backgrounds - Deep midnight blues */
--bg-primary: #0a0e27;
--bg-secondary: #0f1538;
--bg-tertiary: #141c4c;
/* Text - Cool silver tones */
--text-primary: #e8eaf6;
--text-secondary: #9fa8da;
--text-tertiary: #7986cb;
/* Primary - Royal blue */
--color-primary: #5e72e4;
--color-primary-hover: #7e8fff;
--color-primary-dark: #3f51b5;
/* Action colors - Sophisticated palette */
--color-success: #56f1c7;
--color-success-light: #7fffd4;
--color-warning: #ffd93d;
--color-warning-light: #ffe566;
--color-error: #ff5252;
--color-error-light: #ff7979;
--color-info: #82b1ff;
--color-info-light: #a3c3ff;
--color-purple: #9c88ff;
--color-pink: #f8b5ce;
/* Borders & surfaces - Deep space */
--border-primary: #2a3f7d;
--border-secondary: #1e2c5f;
--surface-hover: #1a2555;
--surface-active: #243270;
/* Shadows - Deep and mysterious */
--shadow-sm: 0 2px 8px rgba(94, 114, 228, 0.1);
--shadow-md: 0 8px 20px rgba(94, 114, 228, 0.15);
--shadow-lg: 0 16px 40px rgba(94, 114, 228, 0.2);
/* Fonts */
--font-heading: 'Montserrat', sans-serif;
--font-body: 'IBM Plex Mono', monospace;
--font-mono: 'IBM Plex Mono', monospace;
}
/* Arctic Theme - Cool, crisp, and minimal */
.theme-arctic,
html[data-theme='arctic'] {
/* Backgrounds - Cool whites and light blues */
--bg-primary: #f0f4f8;
--bg-secondary: #ffffff;
--bg-tertiary: #e3f2fd;
/* Text - Deep slate for contrast */
--text-primary: #263238;
--text-secondary: #546e7a;
--text-tertiary: #78909c;
/* Primary - Ice blue */
--color-primary: #00acc1;
--color-primary-hover: #26c6da;
--color-primary-dark: #0097a7;
/* Action colors - Cool and crisp */
--color-success: #00897b;
--color-success-light: #26a69a;
--color-warning: #ffb300;
--color-warning-light: #ffc947;
--color-error: #e53935;
--color-error-light: #ef5350;
--color-info: #039be5;
--color-info-light: #29b6f6;
--color-purple: #7e57c2;
--color-pink: #ec407a;
/* Borders & surfaces - Clean and minimal */
--border-primary: #cfd8dc;
--border-secondary: #b0bec5;
--surface-hover: #eceff1;
--surface-active: #cfd8dc;
/* Shadows - Light and airy */
--shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.06);
--shadow-md: 0 4px 12px rgba(0, 0, 0, 0.08);
--shadow-lg: 0 12px 28px rgba(0, 0, 0, 0.12);
/* Fonts */
--font-heading: 'Raleway', sans-serif;
--font-body: 'Raleway', sans-serif;
--font-mono: 'Source Code Pro', monospace;
}
/* Terminal Theme - Classic green-on-black terminal aesthetic */
.theme-terminal,
html[data-theme='terminal'] {
/* Backgrounds - Pure blacks */
--bg-primary: #000000;
--bg-secondary: #0a0a0a;
--bg-tertiary: #1a1a1a;
/* Text - Classic terminal green */
--text-primary: #00ff00;
--text-secondary: #00cc00;
--text-tertiary: #009900;
/* Primary - Bright green */
--color-primary: #00ff00;
--color-primary-hover: #66ff66;
--color-primary-dark: #00cc00;
/* Action colors - Retro terminal colors */
--color-success: #00ff00;
--color-success-light: #66ff66;
--color-warning: #ffff00;
--color-warning-light: #ffff66;
--color-error: #ff0000;
--color-error-light: #ff6666;
--color-info: #00ffff;
--color-info-light: #66ffff;
--color-purple: #ff00ff;
--color-pink: #ff00aa;
/* Borders & surfaces - Subtle terminal feel */
--border-primary: #00ff00;
--border-secondary: #009900;
--surface-hover: #001100;
--surface-active: #002200;
--radius-sm: 0;
--radius-md: 0;
--radius-lg: 2px;
--spacing-2xs: 0.125rem;
--spacing-xs: 0.125rem;
--spacing-sm: 0.25rem;
--spacing-md: 0.5rem;
--spacing-lg: 0.75rem;
--spacing-xl: 1rem;
--spacing-2xl: 1.5rem;
/* Shadows - CRT monitor glow */
--shadow-sm: 0 0 2px rgba(0, 255, 0, 0.5);
--shadow-md: 0 0 8px rgba(0, 255, 0, 0.3);
--shadow-lg: 0 0 20px rgba(0, 255, 0, 0.2);
/* Fonts */
--font-heading: 'JetBrains Mono', monospace;
--font-body: 'JetBrains Mono', monospace;
--font-mono: 'JetBrains Mono', monospace;
}