Settings menu

This commit is contained in:
Alicia Sykes committed 2025-09-21 22:58:00 +01:00
1 parent e1fafbe1e4
commit e58cc3a6df
14 files changed
+1361 -182

No files matched your search

+25 -27
View File
@@ -30,6 +30,8 @@
import Icon from '$lib/components/global/Icon.svelte';
import { type NavItem, type NavGroup, footerLinks } from '$lib/constants/nav';
import { site, author, license } from '$lib/constants/site';
import { tooltip } from '$lib/actions/tooltip';
import { browser } from '$app/environment';
export let isOpen = false;
@@ -37,6 +39,10 @@
let menuContentElement: HTMLElement;
let focusableElements: HTMLElement[] = [];
// Shortcut key detection
const isMac = browser && navigator.platform.toUpperCase().indexOf('MAC') >= 0;
const shortcutKey = isMac ? '⌘' : 'Ctrl';
// Close menu when clicking outside
function handleClickOutside(event: MouseEvent) {
if (isOpen && menuElement && !menuElement.contains(event.target as Node)) {
@@ -57,6 +63,14 @@
}
}
// Handle global keyboard shortcuts
function handleGlobalKeydown(event: KeyboardEvent) {
if ((event.metaKey || event.ctrlKey) && event.key === 'm') {
event.preventDefault();
isOpen = !isOpen;
}
}
// Focus trapping for accessibility
function trapFocus(event: KeyboardEvent) {
if (!menuContentElement) return;
@@ -138,10 +152,12 @@
onMount(() => {
document.addEventListener('click', handleClickOutside);
document.addEventListener('keydown', handleKeydown);
document.addEventListener('keydown', handleGlobalKeydown);
return () => {
document.removeEventListener('click', handleClickOutside);
document.removeEventListener('keydown', handleKeydown);
document.removeEventListener('keydown', handleGlobalKeydown);
};
});
@@ -169,12 +185,13 @@
<div class="burger-menu" bind:this={menuElement}>
<!-- Burger Button -->
<button
class="burger-button"
class="action-button burger-button"
class:active={isOpen}
on:click={toggleMenu}
aria-label={isOpen ? 'Close menu' : 'Open menu'}
aria-expanded={isOpen}
aria-controls="mobile-menu"
use:tooltip={`Menu (${shortcutKey}+M)`}
>
<span class="burger-line"></span>
<span class="burger-line"></span>
@@ -291,49 +308,30 @@
}
.burger-button {
display: flex;
flex-direction: column;
justify-content: center;
align-items: center;
width: 2.5rem;
height: 2.5rem;
background: none;
border: none;
cursor: pointer;
padding: 0.5rem;
border-radius: var(--radius-md);
transition: background-color var(--transition-fast);
&:hover {
background-color: var(--surface-hover);
}
&:focus-visible {
outline: 2px solid var(--color-primary);
outline-offset: 2px;
}
padding: 0.25rem;
}
.burger-line {
width: 1.5rem;
width: 1rem;
height: 2px;
background-color: var(--text-primary);
background-color: var(--text-secondary);
border-radius: 1px;
transition: all var(--transition-fast);
transform-origin: center;
&:nth-child(1) {
margin-bottom: 4px;
margin-bottom: 3px;
}
&:nth-child(2) {
margin-bottom: 4px;
margin-bottom: 3px;
}
}
.burger-button.active {
.burger-line:nth-child(1) {
transform: translateY(6px) rotate(45deg);
transform: translateY(5px) rotate(45deg);
}
.burger-line:nth-child(2) {
@@ -341,7 +339,7 @@
}
.burger-line:nth-child(3) {
transform: translateY(-6px) rotate(-45deg);
transform: translateY(-5px) rotate(-45deg);
}
}
+4 -80
View File
@@ -4,10 +4,9 @@
import GlobalSearch from '$lib/components/global/GlobalSearch.svelte';
import BurgerMenu from '$lib/components/furniture/BurgerMenu.svelte';
import TopNav from '$lib/components/furniture/TopNav.svelte';
import SettingsMenu from '$lib/components/furniture/SettingsMenu.svelte';
// Props from +layout for theme state & toggler
export let darkMode: boolean;
export let toggleTheme: () => void;
let globalSearchRef: GlobalSearch;
</script>
<header class="header">
@@ -29,34 +28,9 @@
<TopNav />
<div class="header-buttons">
<GlobalSearch />
<GlobalSearch bind:this={globalSearchRef} />
<button
class="theme-toggle"
class:dark={darkMode}
onclick={toggleTheme}
aria-label={darkMode ? 'Switch to light mode' : 'Switch to dark mode'}
title={darkMode ? 'Switch to light mode' : 'Switch to dark mode'}
>
<div class="toggle-slider">
{#if darkMode}
<svg fill="currentColor" viewBox="0 0 20 20">
<path
fill-rule="evenodd"
d="M10 2a1 1 0 011 1v1a1 1 0 11-2 0V3a1 1 0 011-1zm4 8a4 4 0 11-8 0 4 4 0 018 0zm-.464 4.95l.707.707a1 1 0 001.414-1.414l-.707-.707a1 1 0 00-1.414 1.414zm2.12-10.607a1 1 0 010 1.414l-.706.707a1 1 0 11-1.414-1.414l.707-.707a1 1 0 011.414 0zM17 11a1 1 0 100-2h-1a1 1 0 100 2h1zm-7 4a1 1 0 011 1v1a1 1 0 11-2 0v-1a1 1 0 011-1zM5.05 6.464A1 1 0 106.465 5.05l-.708-.707a1 1 0 00-1.414 1.414l.707.707zm1.414 8.486l-.707.707a1 1 0 01-1.414-1.414l.707-.707a1 1 0 011.414 1.414zM4 11a1 1 0 100-2H3a1 1 0 000 2h1z"
clip-rule="evenodd"
/>
</svg>
{:else}
<svg fill="currentColor" viewBox="0 0 640 640">
<path
d="M320 64C178.6 64 64 178.6 64 320C64 461.4 178.6 576 320 576C388.8 576 451.3 548.8 497.3 504.6C504.6 497.6 506.7 486.7 502.6 477.5C498.5 468.3 488.9 462.6 478.8 463.4C473.9 463.8 469 464 464 464C362.4 464 280 381.6 280 280C280 207.9 321.5 145.4 382.1 115.2C391.2 110.7 396.4 100.9 395.2 90.8C394 80.7 386.6 72.5 376.7 70.3C358.4 66.2 339.4 64 320 64z"
/>
<path d="M17.293 13.293A8 8 0 716.707 2.707a8.001 8.001 0 1010.586 10.586z" />
</svg>
{/if}
</div>
</button>
<SettingsMenu onSearchTrigger={() => globalSearchRef?.showSearch()} />
<BurgerMenu />
</div>
@@ -77,54 +51,4 @@
align-items: center;
gap: var(--spacing-sm);
}
.theme-toggle {
position: relative;
width: 3rem;
height: 1.5rem;
background: var(--bg-tertiary);
border: 1px solid var(--border-primary);
border-radius: 1rem;
cursor: pointer;
transition: all 0.2s ease;
&:hover {
background: var(--surface-hover);
}
&.dark {
background: var(--color-primary);
border-color: var(--color-primary);
}
}
.toggle-slider {
position: absolute;
top: 1px;
left: 1px;
width: 1.25rem;
height: 1.25rem;
background: var(--bg-primary);
border-radius: 50%;
display: flex;
align-items: center;
justify-content: center;
transition: transform 0.2s ease;
box-shadow: var(--shadow-sm);
svg {
width: 0.75rem;
height: 0.75rem;
color: var(--text-secondary);
}
.dark & {
transform: translateX(1.5rem);
background: var(--bg-primary);
svg {
color: var(--color-primary);
}
}
}
</style>
@@ -0,0 +1,549 @@
<script lang="ts">
import { onMount } from 'svelte';
import { slide } from 'svelte/transition';
import Icon from '$lib/components/global/Icon.svelte';
import { accessibility, type AccessibilityOption } from '$lib/stores/accessibility';
import { tooltip } from '$lib/actions/tooltip';
import { browser } from '$app/environment';
import { theme, themes, type ThemeOption } from '$lib/stores/theme';
import { site } from '$lib/constants/site';
interface Props {
onSearchTrigger?: () => void;
}
let { onSearchTrigger }: Props = $props();
let isOpen = $state(false);
let showMoreA11y = $state(false);
let menuRef = $state<HTMLDivElement>();
let triggerRef = $state<HTMLButtonElement>();
let accessibilitySettings = $state(accessibility);
let currentTheme = $state(theme);
// Shortcut key detection
const isMac = browser && navigator.platform.toUpperCase().indexOf('MAC') >= 0;
const shortcutKey = isMac ? '⌘' : 'Ctrl';
// Language selection
let selectedLanguage = $state('en');
const languages = [
{ code: 'en', name: 'English', available: true, flag: '🇺🇸' },
{ code: 'es', name: 'Español', available: false, flag: '🇪🇸' },
{ code: 'fr', name: 'Français', available: false, flag: '🇫🇷' },
{ code: 'de', name: 'Deutsch', available: false, flag: '🇩🇪' },
];
// Handle theme change
function handleThemeChange(themeId: ThemeOption) {
theme.setTheme(themeId);
}
// Handle accessibility setting toggle
function handleAccessibilityToggle(optionId: string) {
accessibility.toggle(optionId);
}
// Primary accessibility options (always visible)
const primaryA11yOptions = ['reduce-motion'];
// const primaryA11yOptions: string[] = [];
// Get filtered accessibility options
const primaryOptions = $derived($accessibilitySettings.options.filter((opt) => primaryA11yOptions.includes(opt.id)));
const additionalOptions = $derived(
$accessibilitySettings.options.filter((opt) => !primaryA11yOptions.includes(opt.id)),
);
// Handle clicks outside menu
function handleClickOutside(event: MouseEvent) {
if (isOpen && menuRef && !menuRef.contains(event.target as Node) && !triggerRef?.contains(event.target as Node)) {
isOpen = false;
}
}
// Handle escape key
function handleKeydown(event: KeyboardEvent) {
if (event.key === 'Escape' && isOpen) {
isOpen = false;
triggerRef?.focus();
}
}
// Handle search action
function handleSearch() {
isOpen = false;
onSearchTrigger?.();
}
// Handle link clicks to close menu
function handleLinkClick() {
isOpen = false;
}
// Handle global keyboard shortcuts
function handleGlobalKeydown(event: KeyboardEvent) {
if ((event.metaKey || event.ctrlKey) && event.key === ',') {
event.preventDefault();
isOpen = !isOpen;
}
}
onMount(() => {
document.addEventListener('click', handleClickOutside);
document.addEventListener('keydown', handleKeydown);
document.addEventListener('keydown', handleGlobalKeydown);
// Initialize stores
accessibility.init();
theme.init();
return () => {
document.removeEventListener('click', handleClickOutside);
document.removeEventListener('keydown', handleKeydown);
document.removeEventListener('keydown', handleGlobalKeydown);
};
});
</script>
{#snippet accessibilityOption(option: AccessibilityOption)}
<label class="toggle-option">
<input
type="checkbox"
checked={option.enabled}
onchange={() => handleAccessibilityToggle(option.id)}
aria-describedby="a11y-{option.id}-desc"
/>
<span class="toggle-slider"></span>
<div class="toggle-content">
<span>{option.name}</span>
<small id="a11y-{option.id}-desc" class="toggle-description">{option.description}</small>
</div>
</label>
{/snippet}
<div class="settings-menu" bind:this={menuRef}>
<button
bind:this={triggerRef}
class="action-button settings-trigger"
onclick={() => (isOpen = !isOpen)}
aria-label="Open Settings"
aria-expanded={isOpen}
aria-haspopup="menu"
use:tooltip={`Settings (${shortcutKey}+,)`}
>
<Icon name="settings2" size="sm" />
</button>
{#if isOpen}
<div class="settings-panel" role="menu">
<!-- Theme Selection -->
<div class="settings-section">
<h3>Theme</h3>
<div class="theme-options" role="radiogroup" aria-label="Theme selection">
{#each themes 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>
</div>
<!-- Language Selection -->
<div class="settings-section">
<h3>Language</h3>
<div class="language-dropdown">
{#each languages as lang (lang.code)}
<button
class="language-option"
class:active={selectedLanguage === lang.code}
class:disabled={!lang.available}
onclick={() => (selectedLanguage = lang.code)}
disabled={!lang.available}
>
{lang.flag}
{lang.name}
{!lang.available ? ' (Soon)' : ''}
</button>
{/each}
</div>
</div>
<!-- Accessibility Options -->
<div class="settings-section">
<h3>Accessibility</h3>
<div class="accessibility-options">
<!-- Primary options (always visible) -->
{#each primaryOptions as option (option.id)}
{@render accessibilityOption(option)}
{/each}
<!-- Expandable additional options -->
{#if showMoreA11y}
<div class="additional-options" transition:slide={{ duration: 300 }}>
{#each additionalOptions as option (option.id)}
{@render accessibilityOption(option)}
{/each}
</div>
{/if}
<!-- Show more/less button -->
<button class="show-more-btn" onclick={() => (showMoreA11y = !showMoreA11y)} aria-expanded={showMoreA11y}>
<Icon name={showMoreA11y ? 'chevron-up' : 'chevron-down'} size="sm" />
<span>{showMoreA11y ? 'Show less' : 'Show all a11y options'}</span>
</button>
</div>
</div>
<!-- Navigation Links -->
<div class="settings-section settings-links">
<button class="settings-link" onclick={handleSearch}>
<Icon name="search" size="sm" />
<span>Search</span>
</button>
<a href="/bookmarks" class="settings-link" onclick={handleLinkClick}>
<Icon name="bookmarks" size="sm" />
<span>Bookmarks</span>
</a>
<a href="/about" class="settings-link" onclick={handleLinkClick}>
<Icon name="info" size="sm" />
<span>About</span>
</a>
<a href={site.repo} class="settings-link" target="_blank" rel="noopener noreferrer" onclick={handleLinkClick}>
<Icon name="github" size="sm" />
<span>GitHub</span>
</a>
</div>
</div>
{/if}
</div>
<style lang="scss">
.settings-menu {
position: relative;
}
.settings-trigger {
:global(svg) {
transition: transform var(--transition-normal);
}
&:hover {
:global(svg) {
transform: rotate(45deg);
}
}
&[aria-expanded='true'] {
background: var(--surface-active);
color: var(--color-primary);
border-color: var(--color-primary);
:global(svg) {
transform: rotate(45deg);
}
}
}
.settings-panel {
position: absolute;
top: calc(100% + var(--spacing-xs));
right: 0;
width: 16rem;
background: var(--bg-secondary);
border: 1px solid var(--border-primary);
border-radius: var(--radius-md);
box-shadow: var(--shadow-lg);
padding: var(--spacing-md);
z-index: 1000;
animation: slideIn var(--transition-slow);
@media (max-width: 768px) {
position: fixed;
top: auto;
bottom: 0;
left: 0;
right: 0;
width: 100%;
border-radius: var(--radius-lg) var(--radius-lg) 0 0;
animation: slideUp var(--transition-slow);
}
}
.settings-section {
&:not(:last-child) {
margin-bottom: var(--spacing-lg);
padding-bottom: var(--spacing-md);
border-bottom: 1px solid var(--border-primary);
}
h3 {
font-size: var(--font-size-sm);
font-weight: 600;
color: var(--text-primary);
margin: 0 0 var(--spacing-sm) 0;
}
}
.theme-options {
display: flex;
gap: var(--spacing-xs);
}
.theme-option {
flex: 1;
display: flex;
flex-direction: column;
align-items: center;
gap: var(--spacing-xs);
padding: var(--spacing-sm);
background: var(--bg-tertiary);
border: 1px solid var(--border-primary);
border-radius: var(--radius-sm);
cursor: pointer;
transition: all var(--transition-normal);
font-size: var(--font-size-xs);
color: var(--text-secondary);
&:hover:not(.disabled) {
background: var(--surface-hover);
border-color: var(--border-secondary);
}
&.active {
background: color-mix(in srgb, var(--color-primary), transparent 90%);
border-color: var(--color-primary);
color: var(--text-primary);
}
&.disabled {
opacity: 0.6;
cursor: not-allowed;
}
}
.theme-preview {
width: 1.5rem;
height: 1rem;
border-radius: var(--radius-xs);
border: 1px solid var(--border-secondary);
&.theme-light {
background: linear-gradient(135deg, #f4f2fa 50%, #fff 50%);
}
&.theme-dark {
background: linear-gradient(135deg, #0d1117 50%, #161b22 50%);
}
&.theme-ocean {
background: linear-gradient(135deg, #1a4c7a 50%, #2d5f8f 50%);
opacity: 0.6;
}
}
.language-dropdown {
display: flex;
flex-direction: column;
gap: var(--spacing-xs);
}
.language-option {
padding: var(--spacing-sm);
background: var(--bg-tertiary);
border: 1px solid var(--border-primary);
border-radius: var(--radius-sm);
text-align: left;
cursor: pointer;
transition: all var(--transition-normal);
font-size: var(--font-size-sm);
color: var(--text-secondary);
&:hover:not(.disabled) {
background: var(--surface-hover);
color: var(--text-primary);
}
&.active {
background: color-mix(in srgb, var(--color-primary), transparent 90%);
border-color: var(--color-primary);
color: var(--text-primary);
}
&.disabled {
opacity: 0.6;
cursor: not-allowed;
}
}
.accessibility-options {
display: flex;
flex-direction: column;
gap: var(--spacing-sm);
}
.toggle-option {
display: flex;
align-items: flex-start;
gap: var(--spacing-sm);
cursor: pointer;
font-size: var(--font-size-sm);
color: var(--text-primary);
padding: var(--spacing-xs) 0;
input[type='checkbox'] {
position: absolute;
opacity: 0;
width: 0;
height: 0;
&:checked + .toggle-slider {
background: var(--color-primary);
&::before {
transform: translateX(1rem);
}
}
&:focus + .toggle-slider {
outline: 2px solid var(--color-primary);
outline-offset: 2px;
}
}
.toggle-slider {
position: relative;
width: 2rem;
height: 1.125rem;
background: var(--bg-tertiary);
border: 1px solid var(--border-primary);
border-radius: 1rem;
transition: all var(--transition-normal);
flex-shrink: 0;
margin-top: 0.125rem;
&::before {
content: '';
position: absolute;
top: 1px;
left: 1px;
width: 0.875rem;
height: 0.875rem;
background: var(--bg-primary);
border-radius: 50%;
transition: transform var(--transition-normal);
}
}
.toggle-content {
display: flex;
flex-direction: column;
gap: var(--spacing-xs);
min-width: 0;
flex: 1;
.toggle-description {
color: var(--text-secondary);
font-size: var(--font-size-xs);
line-height: 1.3;
}
}
}
.additional-options {
overflow: hidden;
}
.show-more-btn {
display: flex;
align-items: center;
gap: var(--spacing-xs);
width: 100%;
padding: var(--spacing-sm);
background: transparent;
border: 1px solid var(--border-primary);
border-radius: var(--radius-sm);
color: var(--text-secondary);
font-size: var(--font-size-xs);
cursor: pointer;
transition: all var(--transition-normal);
margin-top: var(--spacing-sm);
justify-content: center;
&:hover {
background: var(--surface-hover);
color: var(--text-primary);
border-color: var(--border-secondary);
}
&[aria-expanded='true'] {
color: var(--color-primary);
border-color: var(--color-primary);
}
}
.settings-links {
border-bottom: none;
padding-bottom: 0;
margin-bottom: 0;
.settings-link {
display: flex;
align-items: center;
gap: var(--spacing-sm);
width: 100%;
padding: var(--spacing-xs);
background: transparent;
border: none;
border-radius: var(--radius-sm);
text-align: left;
text-decoration: none;
color: var(--text-secondary);
cursor: pointer;
transition: all var(--transition-normal);
font-size: var(--font-size-sm);
&:hover {
background: var(--surface-hover);
color: var(--text-primary);
}
}
}
@keyframes slideIn {
from {
opacity: 0;
transform: translateY(-0.5rem);
}
to {
opacity: 1;
transform: translateY(0);
}
}
@keyframes slideUp {
from {
opacity: 0;
transform: translateY(100%);
}
to {
opacity: 1;
transform: translateY(0);
}
}
</style>
+10 -37
View File
@@ -7,6 +7,7 @@
import type { NavItem } from '$lib/constants/nav';
import { bookmarks } from '$lib/stores/bookmarks';
import { frequentlyUsedTools, toolUsage } from '$lib/stores/toolUsage';
import { tooltip } from '$lib/actions/tooltip';
let isOpen = $state(false);
let query = $state('');
@@ -61,10 +62,10 @@
.slice(0, 8);
}
function showSearch() {
const showSearch = () => {
isOpen = true;
setTimeout(() => searchInput?.focus(), 0);
}
};
function close() {
isOpen = false;
@@ -123,13 +124,17 @@
return () => document.removeEventListener('keydown', handleGlobalKeydown);
});
// export { showSearch as open };
export { showSearch };
</script>
<!-- Trigger Button -->
<button class="search-trigger" onclick={showSearch} aria-label="Open search">
<button
class="action-button search-trigger"
onclick={showSearch}
aria-label="Open search"
use:tooltip={`Search (${shortcutKey}+K)`}
>
<Icon name="search" size="sm" />
<span class="shortcut">{shortcutKey}K</span>
</button>
<!-- Search Modal -->
@@ -272,38 +277,6 @@
{/if}
<style lang="scss">
button:hover:not(:disabled) {
border-color: var(--border-primary);
}
.search-trigger {
display: flex;
align-items: center;
gap: var(--spacing-sm);
padding: var(--spacing-sm) var(--spacing-md);
background: var(--bg-tertiary);
border: 1px solid var(--border-primary);
border-radius: var(--radius-md);
color: var(--text-secondary);
font-size: var(--font-size-sm);
cursor: pointer;
transition: all var(--transition-fast);
&:hover {
background: var(--surface-hover);
color: var(--text-primary);
}
.shortcut {
padding: var(--spacing-xs) var(--spacing-sm);
background: var(--bg-secondary);
border: 1px solid var(--border-secondary);
border-radius: var(--radius-sm);
font-size: var(--font-size-xs);
font-family: var(--font-mono);
}
}
.search-overlay {
position: fixed;
inset: 0;
@@ -18,7 +18,7 @@
let subnets = $state<SubnetRequirement[]>([]);
let vlsmResult = $state<VLSMResult | null>(null);
let copiedStates = $state<Record<string, boolean>>({});
let expandedSubnets = new SvelteSet<string>();
let expandedSubnets = $state(new SvelteSet<string>());
// Add initial subnet requirement
$effect(() => {
+2
View File
@@ -95,6 +95,7 @@ export const iconMap: Record<string, string> = {
'git-branch': `<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 640 640"><path opacity=".4" d="M144 144C144 161.7 158.3 176 176 176C193.7 176 208 161.7 208 144C208 126.3 193.7 112 176 112C158.3 112 144 126.3 144 144zM144 496C144 513.7 158.3 528 176 528C193.7 528 208 513.7 208 496C208 478.3 193.7 464 176 464C158.3 464 144 478.3 144 496zM432 144C432 161.7 446.3 176 464 176C481.7 176 496 161.7 496 144C496 126.3 481.7 112 464 112C446.3 112 432 126.3 432 144z"/><path d="M176 176C193.7 176 208 161.7 208 144C208 126.3 193.7 112 176 112C158.3 112 144 126.3 144 144C144 161.7 158.3 176 176 176zM256 144C256 179.8 232.5 210.1 200 220.3L200 296L384 296C414.9 296 440 270.9 440 240L440 220.3C407.5 210.1 384 179.8 384 144C384 99.8 419.8 64 464 64C508.2 64 544 99.8 544 144C544 179.8 520.5 210.1 488 220.3L488 240C488 297.4 441.4 344 384 344L200 344L200 419.7C232.5 429.9 256 460.2 256 496C256 540.2 220.2 576 176 576C131.8 576 96 540.2 96 496C96 460.2 119.5 429.9 152 419.7L152 220.4C119.5 210.1 96 179.8 96 144C96 99.8 131.8 64 176 64C220.2 64 256 99.8 256 144zM496 144C496 126.3 481.7 112 464 112C446.3 112 432 126.3 432 144C432 161.7 446.3 176 464 176C481.7 176 496 161.7 496 144zM176 528C193.7 528 208 513.7 208 496C208 478.3 193.7 464 176 464C158.3 464 144 478.3 144 496C144 513.7 158.3 528 176 528z"/></svg>`,
globe: `<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 640 640"><path opacity=".4" d="M113.4 296L192.6 296C195.9 232 212.2 172.4 236.2 129.6C170 158.7 121.9 221.4 113.4 296zM113.4 344C122 418.6 170.1 481.3 236.2 510.4C212.2 467.6 195.9 408 192.6 344L113.4 344zM240.7 296L399.3 296C396.3 244.5 384.1 197.4 367.2 163C345.7 119.3 325.8 112 320 112C314.2 112 294.3 119.3 272.8 163C255.8 197.5 243.6 244.6 240.7 296zM240.7 344C243.7 395.5 255.9 442.6 272.8 477C294.3 520.7 314.2 528 320 528C325.8 528 345.7 520.7 367.2 477C384.2 442.5 396.4 395.4 399.3 344L240.7 344zM403.8 129.6C427.8 172.4 444.1 232 447.4 296L526.6 296C518.1 221.4 470 158.7 403.8 129.6zM403.8 510.4C470 481.3 518.1 418.6 526.6 344L447.4 344C444.1 408 427.8 467.6 403.8 510.4z"/><path d="M367.2 477C345.7 520.7 325.8 528 320 528C314.2 528 294.3 520.7 272.8 477C255.8 442.5 243.6 395.4 240.7 344L399.3 344C396.3 395.5 384.1 442.6 367.2 477zM399.3 296L240.7 296C243.7 244.5 255.9 197.4 272.8 163C294.3 119.3 314.2 112 320 112C325.8 112 345.7 119.3 367.2 163C384.2 197.5 396.4 244.6 399.3 296zM447.4 344L526.6 344C518 418.6 469.9 481.3 403.8 510.4C427.8 467.6 444.1 408 447.4 344zM526.6 296L447.4 296C444.1 232 427.8 172.4 403.8 129.6C469.9 158.8 518 221.4 526.6 296zM192.6 296L113.4 296C122 221.4 170.1 158.7 236.2 129.6C212.2 172.4 195.9 232 192.6 296zM113.4 344L192.6 344C195.9 408 212.2 467.6 236.2 510.4C170.1 481.2 122 418.6 113.4 344zM320 576C461.4 576 576 461.4 576 320C576 178.6 461.4 64 320 64C178.6 64 64 178.6 64 320C64 461.4 178.6 576 320 576z"/></svg>`,
grid: `<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 640 640"><path opacity=".4" d="M144 144L240 144L240 240L144 240L144 144zM144 400L240 400L240 496L144 496L144 400zM400 144L496 144L496 240L400 240L400 144zM400 400L496 400L496 496L400 496L400 400z"/><path d="M144 144L144 240L240 240L240 144L144 144zM96 144C96 117.5 117.5 96 144 96L240 96C266.5 96 288 117.5 288 144L288 240C288 266.5 266.5 288 240 288L144 288C117.5 288 96 266.5 96 240L96 144zM144 400L144 496L240 496L240 400L144 400zM96 400C96 373.5 117.5 352 144 352L240 352C266.5 352 288 373.5 288 400L288 496C288 522.5 266.5 544 240 544L144 544C117.5 544 96 522.5 96 496L96 400zM496 144L400 144L400 240L496 240L496 144zM400 96L496 96C522.5 96 544 117.5 544 144L544 240C544 266.5 522.5 288 496 288L400 288C373.5 288 352 266.5 352 240L352 144C352 117.5 373.5 96 400 96zM400 400L400 496L496 496L496 400L400 400zM352 400C352 373.5 373.5 352 400 352L496 352C522.5 352 544 373.5 544 400L544 496C544 522.5 522.5 544 496 544L400 544C373.5 544 352 522.5 352 496L352 400z"/></svg>`,
github: `<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 640 640"><!--!Font Awesome Free v7.0.1 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license/free Copyright 2025 Fonticons, Inc.--><path d="M266.1 392.7C266.1 413.6 255.2 447.8 229.4 447.8C203.6 447.8 192.7 413.6 192.7 392.7C192.7 371.8 203.6 337.6 229.4 337.6C255.2 337.6 266.1 371.8 266.1 392.7zM560 342.2C560 374.1 556.8 407.9 542.5 437.2C504.6 513.8 400.4 512 325.8 512C250 512 139.6 514.7 100.2 437.2C85.6 408.2 80 374.1 80 342.2C80 300.3 93.9 260.7 121.5 228.6C116.3 212.8 113.8 196.2 113.8 179.8C113.8 158.3 118.7 147.5 128.4 128C173.7 128 202.7 137 237.2 164C266.2 157.1 296 154 325.9 154C352.9 154 380.1 156.9 406.3 163.2C440.3 136.5 469.3 128 514.1 128C523.9 147.5 528.7 158.3 528.7 179.8C528.7 196.2 526.1 212.5 521 228C548.5 260.4 560 300.3 560 342.2zM495.7 392.7C495.7 348.8 469 310.1 422.2 310.1C403.3 310.1 385.2 313.5 366.2 316.1C351.3 318.4 336.4 319.3 321.1 319.3C305.9 319.3 291 318.4 276 316.1C257.3 313.5 239 310.1 220 310.1C173.2 310.1 146.5 348.8 146.5 392.7C146.5 480.5 226.9 494 296.9 494L345.1 494C415.4 494 495.7 480.6 495.7 392.7zM413.1 337.6C387.3 337.6 376.4 371.8 376.4 392.7C376.4 413.6 387.3 447.8 413.1 447.8C438.9 447.8 449.8 413.6 449.8 392.7C449.8 371.8 438.9 337.6 413.1 337.6z"/></svg>`,
hash: `<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 640 640"><path opacity=".4" d=""/><path d="M290.9 93C293.7 80 285.4 67.3 272.5 64.5C259.6 61.7 246.7 70 244 82.9L220.6 192L132.5 192C119.2 192 108.5 202.7 108.5 216C108.5 229.3 119.2 240 132.5 240L210.3 240L176 400L88 400C74.7 400 64 410.7 64 424C64 437.3 74.7 448 88 448L165.7 448L144.5 547C141.7 560 150 572.7 162.9 575.5C175.8 578.3 188.6 570 191.4 557.1L214.8 448.1L370.2 448.1L349 547.1C346.2 560.1 354.5 572.8 367.4 575.6C380.3 578.4 393.1 570.1 395.9 557.2L419.3 448.2L507.3 448.2C520.6 448.2 531.3 437.5 531.3 424.2C531.3 410.9 520.6 400.2 507.3 400.2L429.6 400.2L463.9 240.2L552 240.2C565.3 240.2 576 229.5 576 216.2C576 202.9 565.3 192.2 552 192.2L474.2 192.2L495.4 93.2C498.2 80.2 489.9 67.5 477 64.7C464.1 61.9 451.2 70 448.4 82.9L425 192L269.6 192L290.8 93zM259.4 240L414.8 240L380.5 400L225.1 400L259.4 240z"/></svg>`,
help: `<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 640 640"><path opacity=".4" d="M112 320C112 434.9 205.1 528 320 528C434.9 528 528 434.9 528 320C528 205.1 434.9 112 320 112C205.1 112 112 205.1 112 320zM240 272C240 227.8 275.8 192 320 192C364.2 192 400 227.8 400 272C400 319.2 364 339.2 344 346.5L344 350.3C344 363.6 333.3 374.3 320 374.3C306.7 374.3 296 363.6 296 350.3L296 342.2C296 321.7 310.8 307 326.1 302C332.5 299.9 339.3 296.5 344.3 291.7C348.6 287.5 352 281.7 352 272.1C352 254.4 337.7 240.1 320 240.1C302.3 240.1 288 254.4 288 272.1C288 285.4 277.3 296.1 264 296.1C250.7 296.1 240 285.4 240 272.1zM352 432C352 449.7 337.7 464 320 464C302.3 464 288 449.7 288 432C288 414.3 302.3 400 320 400C337.7 400 352 414.3 352 432z"/><path d="M528 320C528 205.1 434.9 112 320 112C205.1 112 112 205.1 112 320C112 434.9 205.1 528 320 528C434.9 528 528 434.9 528 320zM64 320C64 178.6 178.6 64 320 64C461.4 64 576 178.6 576 320C576 461.4 461.4 576 320 576C178.6 576 64 461.4 64 320zM320 240C302.3 240 288 254.3 288 272C288 285.3 277.3 296 264 296C250.7 296 240 285.3 240 272C240 227.8 275.8 192 320 192C364.2 192 400 227.8 400 272C400 319.2 364 339.2 344 346.5L344 350.3C344 363.6 333.3 374.3 320 374.3C306.7 374.3 296 363.6 296 350.3L296 342.2C296 321.7 310.8 307 326.1 302C332.5 299.9 339.3 296.5 344.3 291.7C348.6 287.5 352 281.7 352 272.1C352 254.4 337.7 240.1 320 240.1zM288 432C288 414.3 302.3 400 320 400C337.7 400 352 414.3 352 432C352 449.7 337.7 464 320 464C302.3 464 288 449.7 288 432z"/></svg>`,
'http-headers': `<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 640 640"><path opacity=".4" d="M112 288C112 190.8 190.8 112 288 112C374.6 112 446.7 174.6 461.3 257.1C462.2 261.9 464.5 266.4 468 269.9L520.2 322.1C525.2 327.1 528.1 334 528.1 341.1C528.1 356 516.1 368 501.2 368L488 368C474.7 368 464 378.7 464 392L464 440C464 462.1 446.1 480 424 480L376 480C362.7 480 352 490.7 352 504L352 552C352 565.3 362.7 576 376 576C188.1 576 113.5 576 152 576C165.3 576 176 565.3 176 552L176 452.1C176 434 168.2 417.9 157.5 406.1C129.2 374.9 112 333.5 112 288zM168.5 242C165.9 248.8 169 256.3 175.3 260L178.2 261.7C187.4 267 191.9 277.5 191.9 288.1C191.9 298.7 187.4 309.2 178.2 314.5L175.2 316.2C168.9 319.8 165.7 327.3 168.4 334.1C170.5 339.6 173 344.8 175.8 349.9L178.2 354C181.3 359.1 184.6 363.9 188.3 368.5C192.9 374.2 201 375.2 207.3 371.5L210.2 369.8C219.4 364.5 230.6 365.8 239.8 371.1C249 376.4 256 385.6 256 396.2L256 399.6C256 406.9 260.9 413.4 268.1 414.5C274.6 415.5 281.2 416 288 416C294.8 416 301.4 415.5 307.9 414.5C315.1 413.4 320 406.9 320 399.6L320 396.2C320 385.6 326.9 376.4 336.1 371.1C345.3 365.8 356.5 364.5 365.7 369.8L368.6 371.5C374.9 375.1 383 374.1 387.6 368.5C391.3 363.9 394.7 359.1 397.7 354L400.1 349.8C402.9 344.7 405.4 339.5 407.5 334C410.1 327.2 407 319.7 400.7 316.1L397.7 314.4C388.5 309.1 384 298.6 384 288C384 277.4 388.5 266.9 397.7 261.6L400.7 259.9C407 256.3 410.2 248.8 407.5 241.9C405.4 236.4 402.9 231.1 400.1 226L397.8 222C394.7 216.9 391.3 212.1 387.6 207.5C383 201.8 374.9 200.8 368.6 204.5L365.7 206.2C356.5 211.5 345.3 210.2 336.1 204.9C326.9 199.6 320 190.4 320 179.8L320 176.4C320 169.1 315.1 162.6 307.9 161.5C301.4 160.5 294.8 160 288 160C281.2 160 274.6 160.5 268.1 161.5C260.9 162.6 256 169.1 256 176.4L256 179.8C256 190.4 249.1 199.6 239.9 204.9C230.7 210.2 219.5 211.5 210.3 206.2L207.4 204.5C201.1 200.9 193 201.9 188.4 207.5C184.7 212.1 181.3 217 178.2 222.1L175.9 226C173.1 231.1 170.6 236.4 168.5 241.9zM328 288C328 310.1 310.1 328 288 328C265.9 328 248 310.1 248 288C248 265.9 265.9 248 288 248C310.1 248 328 265.9 328 288z"/><path d="M288 64C164.3 64 64 164.3 64 288C64 345.8 86 398.6 122 438.3C126.2 443 128 448 128 452.1L128 552C128 565.3 138.7 576 152 576C165.3 576 176 565.3 176 552L176 452.1C176 434 168.2 417.9 157.5 406.1C129.2 374.9 112 333.5 112 288C112 190.8 190.8 112 288 112C374.6 112 446.7 174.6 461.3 257.1C462.2 261.9 464.5 266.4 468 269.9L520.2 322.1C525.2 327.1 528.1 334 528.1 341.1C528.1 356 516.1 368 501.2 368L488 368C474.7 368 464 378.7 464 392L464 440C464 462.1 446.1 480 424 480L376 480C362.7 480 352 490.7 352 504L352 552C352 565.3 362.7 576 376 576C389.3 576 400 565.3 400 552L400 528L424 528C472.6 528 512 488.6 512 440L512 415.2C548.2 409.9 576 378.7 576 341.1C576 321.2 568.1 302.2 554.1 288.1L507.1 241.1C485.5 139.9 395.7 64 288 64zM400.6 259.9C406.9 256.3 410.1 248.8 407.4 241.9C405.3 236.4 402.8 231.1 400 226L397.7 222C394.6 216.9 391.2 212.1 387.5 207.5C382.9 201.8 374.8 200.8 368.5 204.5L365.6 206.2C356.4 211.5 345.2 210.2 336 204.9C326.8 199.6 320 190.4 320 179.8L320 176.4C320 169.1 315.1 162.6 307.9 161.5C301.4 160.5 294.8 160 288 160C281.2 160 274.6 160.5 268.1 161.5C260.9 162.6 256 169.1 256 176.4L256 179.8C256 190.4 249.1 199.6 239.9 204.9C230.7 210.2 219.5 211.5 210.3 206.2L207.4 204.5C201.1 200.9 193 201.9 188.4 207.5C184.7 212.1 181.3 217 178.2 222.1L175.9 226C173.1 231.1 170.6 236.4 168.5 241.9C165.9 248.7 169 256.2 175.3 259.9L178.2 261.6C187.4 266.9 191.9 277.4 191.9 288C191.9 298.6 187.4 309.1 178.2 314.4L175.2 316.1C168.9 319.7 165.7 327.2 168.4 334C170.5 339.5 173 344.7 175.8 349.8L178.2 353.9C181.3 359 184.6 363.8 188.3 368.4C192.9 374.1 201 375.1 207.3 371.4L210.2 369.7C219.4 364.4 230.6 365.7 239.8 371C249 376.3 256 385.6 256 396.2L256 399.6C256 406.9 260.9 413.4 268.1 414.5C274.6 415.5 281.2 416 288 416C294.8 416 301.4 415.5 307.9 414.5C315.1 413.4 320 406.9 320 399.6L320 396.2C320 385.6 326.9 376.4 336.1 371.1C345.3 365.8 356.5 364.5 365.7 369.8L368.6 371.5C374.9 375.1 383 374.1 387.6 368.5C391.3 363.9 394.7 359.1 397.7 354L400.1 349.8C402.9 344.7 405.4 339.5 407.5 334C410.1 327.2 407 319.7 400.7 316.1L397.7 314.4C388.5 309.1 384 298.6 384 288C384 277.4 388.5 266.9 397.7 261.6L400.7 259.9zM248 288C248 265.9 265.9 248 288 248C310.1 248 328 265.9 328 288C328 310.1 310.1 328 288 328C265.9 328 248 310.1 248 288z"/></svg>`,
@@ -187,6 +188,7 @@ export const iconMap: Record<string, string> = {
'security-headers': `<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 640 640"><path opacity=".4" d="M112 288C112 240.6 130.7 197.6 161.2 165.9L164.6 171C169.4 178.2 172 186.7 172 195.4L172 221.4C160 228.3 152 241.2 152 256C152 278.1 169.9 296 192 296C214.1 296 232 278.1 232 256C232 241.2 224 228.3 212 221.4L212 195.4C212 178.8 207.1 162.6 197.9 148.8L192.2 140.3C214.5 125.8 240.2 116.2 268 113.1L268 157.3C256 164.2 248 177.1 248 191.9C248 214 265.9 231.9 288 231.9C310.1 231.9 328 214 328 191.9C328 177.1 320 164.2 308 157.3L308 113.1C335.7 116.2 361.5 125.8 383.8 140.3L378.1 148.8C368.9 162.6 364 178.8 364 195.4L364 221.4C352 228.3 344 241.2 344 256C344 278.1 361.9 296 384 296C406.1 296 424 278.1 424 256C424 241.2 416 228.3 404 221.4L404 195.4C404 186.7 406.6 178.2 411.4 171L414.8 165.9C438.5 190.5 455.1 222 461.3 257.1C462.2 261.9 464.5 266.4 468 269.9L520.2 322.1C525.2 327.1 528.1 334 528.1 341.1C528.1 356 516.1 368 501.2 368L488 368C474.7 368 464 378.7 464 392L464 440C464 462.1 446.1 480 424 480L376 480C362.7 480 352 490.7 352 504L352 552C352 565.3 362.7 576 376 576L152 576C165.3 576 176 565.3 176 552L176 452.1C176 434 168.2 417.9 157.5 406.1C129.2 374.9 112 333.5 112 288zM248 320C248 342.1 265.9 360 288 360C310.1 360 328 342.1 328 320C328 297.9 310.1 280 288 280C265.9 280 248 297.9 248 320z"/><path d="M288 64C164.3 64 64 164.3 64 288C64 345.8 86 398.6 122 438.3C126.2 443 128 448 128 452.1L128 552C128 565.3 138.7 576 152 576C165.3 576 176 565.3 176 552L176 452.1C176 434 168.2 417.9 157.5 406.1C129.2 374.9 112 333.5 112 288C112 240.6 130.7 197.6 161.2 165.9L164.6 171C169.4 178.2 172 186.7 172 195.4L172 221.4C160 228.3 152 241.2 152 256C152 278.1 169.9 296 192 296C214.1 296 232 278.1 232 256C232 241.2 224 228.3 212 221.4L212 195.4C212 178.8 207.1 162.6 197.9 148.8L192.2 140.3C214.5 125.8 240.2 116.2 268 113.1L268 157.3C256 164.2 248 177.1 248 191.9C248 214 265.9 231.9 288 231.9C310.1 231.9 328 214 328 191.9C328 177.1 320 164.2 308 157.3L308 113.1C335.7 116.2 361.5 125.8 383.8 140.3L378.1 148.8C368.9 162.6 364 178.8 364 195.4L364 221.4C352 228.3 344 241.2 344 256C344 278.1 361.9 296 384 296C406.1 296 424 278.1 424 256C424 241.2 416 228.3 404 221.4L404 195.4C404 186.7 406.6 178.2 411.4 171L414.8 165.9C438.5 190.5 455.1 222 461.3 257.1C462.2 261.9 464.5 266.4 468 269.9L520.2 322.1C525.2 327.1 528.1 334 528.1 341.1C528.1 356 516.1 368 501.2 368L488 368C474.7 368 464 378.7 464 392L464 440C464 462.1 446.1 480 424 480L376 480C362.7 480 352 490.7 352 504L352 552C352 565.3 362.7 576 376 576C389.3 576 400 565.3 400 552L400 528L424 528C472.6 528 512 488.6 512 440L512 415.2C548.2 409.9 576 378.7 576 341.1C576 321.2 568.1 302.2 554.1 288.1L507.1 241.1C485.5 139.9 395.7 64 288 64zM328 320C328 297.9 310.1 280 288 280C265.9 280 248 297.9 248 320C248 342.1 265.9 360 288 360C310.1 360 328 342.1 328 320z"/></svg>`,
server: `<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 640 640"><path opacity=".4" d="M144 160L144 224C144 232.8 151.2 240 160 240L480 240C488.8 240 496 232.8 496 224L496 160C496 151.2 488.8 144 480 144L160 144C151.2 144 144 151.2 144 160zM144 416L144 480C144 488.8 151.2 496 160 496L480 496C488.8 496 496 488.8 496 480L496 416C496 407.2 488.8 400 480 400L160 400C151.2 400 144 407.2 144 416zM384 192C384 205.3 373.3 216 360 216C346.7 216 336 205.3 336 192C336 178.7 346.7 168 360 168C373.3 168 384 178.7 384 192zM384 448C384 461.3 373.3 472 360 472C346.7 472 336 461.3 336 448C336 434.7 346.7 424 360 424C373.3 424 384 434.7 384 448zM464 192C464 205.3 453.3 216 440 216C426.7 216 416 205.3 416 192C416 178.7 426.7 168 440 168C453.3 168 464 178.7 464 192zM464 448C464 461.3 453.3 472 440 472C426.7 472 416 461.3 416 448C416 434.7 426.7 424 440 424C453.3 424 464 434.7 464 448z"/><path d="M160 144C151.2 144 144 151.2 144 160L144 224C144 232.8 151.2 240 160 240L480 240C488.8 240 496 232.8 496 224L496 160C496 151.2 488.8 144 480 144L160 144zM96 160C96 124.7 124.7 96 160 96L480 96C515.3 96 544 124.7 544 160L544 224C544 259.3 515.3 288 480 288L160 288C124.7 288 96 259.3 96 224L96 160zM360 168C373.3 168 384 178.7 384 192C384 205.3 373.3 216 360 216C346.7 216 336 205.3 336 192C336 178.7 346.7 168 360 168zM416 192C416 178.7 426.7 168 440 168C453.3 168 464 178.7 464 192C464 205.3 453.3 216 440 216C426.7 216 416 205.3 416 192zM160 400C151.2 400 144 407.2 144 416L144 480C144 488.8 151.2 496 160 496L480 496C488.8 496 496 488.8 496 480L496 416C496 407.2 488.8 400 480 400L160 400zM96 416C96 380.7 124.7 352 160 352L480 352C515.3 352 544 380.7 544 416L544 480C544 515.3 515.3 544 480 544L160 544C124.7 544 96 515.3 96 480L96 416zM336 448C336 434.7 346.7 424 360 424C373.3 424 384 434.7 384 448C384 461.3 373.3 472 360 472C346.7 472 336 461.3 336 448zM440 424C453.3 424 464 434.7 464 448C464 461.3 453.3 472 440 472C426.7 472 416 461.3 416 448C416 434.7 426.7 424 440 424z"/></svg>`,
settings: `<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 640 640"><path opacity=".4" d="M65.5 213L72 237.2L101.8 235.6C109.8 235.2 117.4 238.7 122.3 245.1C127.2 251.5 132.9 257.3 139.4 262.2C145.8 267 149.3 274.7 148.9 282.6L147.3 312.3L171.5 318.8L185 292.2C188.6 285.1 195.5 280.2 203.4 279.2C211.5 278.2 219.3 276.1 226.7 272.9C234.1 269.8 242.5 270.5 249.2 274.9L274.2 291.2L291.9 273.5L275.6 248.5C271.2 241.8 270.5 233.4 273.6 226.1C275.1 222.4 276.5 218.6 277.5 214.6C278.5 210.6 279.3 206.6 279.8 202.7C280.8 194.8 285.7 187.9 292.8 184.3L319.4 170.8L312.9 146.6L283.1 148.2C275.1 148.6 267.5 145.1 262.6 138.7C257.7 132.3 252 126.5 245.5 121.6C239.1 116.8 235.6 109.1 236 101.2L237.6 71.5L213.4 65L199.9 91.6C196.3 98.7 189.4 103.6 181.5 104.6C173.4 105.6 165.6 107.7 158.2 110.9C150.8 114 142.4 113.3 135.7 108.9L110.7 92.6L93 110.3L109.3 135.3C113.7 142 114.4 150.4 111.3 157.7C109.8 161.4 108.4 165.2 107.4 169.2C106.4 173.2 105.6 177.2 105.1 181.1C104.1 189 99.2 195.9 92.1 199.5L65.5 213zM223.3 200.3C220.5 211.5 211.9 220.3 200.7 223.4C189.5 226.4 177.6 223.2 169.5 215C161.4 206.8 158.3 194.8 161.5 183.7C164.3 172.5 172.9 163.7 184.1 160.6C195.3 157.6 207.2 160.8 215.3 169C223.4 177.2 226.5 189.2 223.3 200.3zM321.5 427L348.1 440.5C355.2 444.1 360.1 451 361.1 458.9C361.6 462.9 362.4 466.8 363.4 470.8C364.4 474.8 365.8 478.6 367.3 482.3C370.4 489.6 369.6 498 365.3 504.7L349 529.7L366.7 547.4L391.7 531.1C398.4 526.7 406.8 526 414.2 529.1C421.6 532.2 429.5 534.4 437.5 535.4C445.4 536.4 452.3 541.2 455.9 548.4L469.4 575L493.6 568.5L492 538.8C491.6 530.8 495.1 523.2 501.5 518.4C508 513.5 513.7 507.7 518.6 501.3C523.4 494.9 531.1 491.4 539.1 491.8L568.9 493.4L575.4 469.2L548.8 455.7C541.7 452.1 536.8 445.2 535.8 437.3C535.3 433.3 534.5 429.4 533.5 425.4C532.5 421.4 531.1 417.6 529.6 413.9C526.5 406.6 527.3 398.2 531.6 391.5L547.9 366.5L530.2 348.8L505.2 365.1C498.5 369.5 490.1 370.2 482.7 367.1C475.3 364 467.4 361.8 459.4 360.8C451.5 359.8 444.6 355 441 347.8L427.5 321.2L403.3 327.7L404.9 357.4C405.3 365.4 401.8 373 395.4 377.8C388.9 382.7 383.2 388.5 378.3 394.9C373.5 401.3 365.8 404.8 357.8 404.4L328 402.8L321.5 427zM479.3 439.7C482.5 450.8 479.4 462.8 471.3 471C463.2 479.2 451.3 482.4 440.1 479.4C428.9 476.3 420.3 467.5 417.5 456.3C414.3 445.2 417.4 433.2 425.5 425C433.6 416.8 445.5 413.6 456.7 416.6C467.9 419.7 476.5 428.5 479.3 439.7z"/><path d="M170.6 43.4C180.9 23.2 203.9 12.9 225.8 18.7L250 25.2C271.9 31.1 286.7 51.5 285.5 74.2L284.5 92C287.2 94.5 289.8 97.1 292.3 99.8L310.1 98.8C332.8 97.6 353.2 112.4 359.1 134.3L365.6 158.5C371.5 180.4 361.2 203.5 340.9 213.7L325 221.8C324.2 225.4 323.2 229 322.1 232.5L331.8 247.4C344.2 266.4 341.6 291.5 325.5 307.6L308 325.3C291.9 341.4 266.9 344 247.8 331.6L232.9 321.9C229.4 323 225.8 324 222.2 324.8L214.1 340.7C203.8 360.9 180.8 371.2 158.9 365.4L134.7 358.9C112.8 353 98 332.6 99.2 309.9L100.2 292.1C97.5 289.6 94.9 287 92.4 284.3L74.6 285.3C51.9 286.5 31.5 271.7 25.6 249.8L19.1 225.6C13.2 203.7 23.5 180.6 43.8 170.4L43.8 170.4L59.7 162.3C60.5 158.7 61.5 155.1 62.6 151.6L52.8 136.6C40.4 117.6 43 92.5 59.1 76.4L59.1 76.4L76.8 58.7C92.8 42.6 117.9 40 137 52.4L151.9 62.1C155.4 61 159 60 162.6 59.2L170.7 43.3zM237.6 71.6L213.4 65.1L199.9 91.7C196.3 98.8 189.4 103.7 181.5 104.7C173.4 105.7 165.6 107.8 158.2 111C150.8 114.1 142.4 113.4 135.7 109L110.7 92.7L93 110.4L109.3 135.4C113.7 142.1 114.4 150.5 111.3 157.8C109.8 161.5 108.4 165.3 107.4 169.3C106.4 173.3 105.6 177.3 105.1 181.2C104.1 189.1 99.2 196 92.1 199.6L65.5 213.1L72 237.3L101.8 235.7C109.8 235.3 117.4 238.8 122.3 245.2C127.2 251.6 132.9 257.4 139.4 262.3C145.8 267.1 149.3 274.8 148.9 282.7L147.3 312.4L171.5 318.9L185 292.3C188.6 285.2 195.5 280.3 203.4 279.3C211.5 278.3 219.3 276.2 226.7 273C234.1 269.9 242.5 270.6 249.2 275L274.2 291.3L291.9 273.6L275.6 248.6C271.2 241.9 270.5 233.5 273.6 226.2C275.1 222.5 276.5 218.7 277.5 214.7C278.5 210.7 279.3 206.7 279.8 202.8C280.8 194.9 285.7 188 292.8 184.4L319.4 170.9L312.9 146.7L283.1 148.3C275.1 148.7 267.5 145.2 262.6 138.8C257.7 132.4 252 126.6 245.5 121.7C239.1 116.9 235.6 109.2 236 101.3L237.6 71.6zM161.5 183.7C164.3 172.5 172.9 163.7 184.1 160.6C195.3 157.6 207.2 160.8 215.3 169C223.4 177.2 226.5 189.2 223.3 200.3C220.5 211.5 211.9 220.3 200.7 223.4C189.5 226.4 177.6 223.2 169.5 215C161.4 206.8 158.3 194.8 161.5 183.7zM355.2 330.2C354 307.5 368.8 287.1 390.7 281.2L414.9 274.7C436.8 268.8 459.9 279.1 470.1 299.4L478.2 315.3C481.8 316.1 485.4 317.1 488.9 318.2L503.8 308.5C522.8 296.1 547.9 298.7 564 314.8L581.7 332.5C597.8 348.6 600.4 373.7 588 392.7L578.3 407.6C579.4 411.1 580.4 414.7 581.2 418.3L597.1 426.4C617.3 436.7 627.6 459.7 621.8 481.6L615.3 505.8C609.4 527.7 589 542.5 566.3 541.3L548.5 540.3C546 543 543.4 545.6 540.7 548.1L541.7 565.9C542.9 588.6 528.1 609 506.2 614.9L482 621.4C460.1 627.3 437 617 426.8 596.7L418.7 580.8C415.1 580 411.5 579 408 577.9L393 587.6C374 600 348.9 597.4 332.8 581.3L315.1 563.6C299 547.5 296.4 522.5 308.8 503.4L318.5 488 Line truncated
settings2: `<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 640 640"><!--!Font Awesome Pro v7.0.1 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license (Commercial License) Copyright 2025 Fonticons, Inc.--><path opacity=".4" d="M272.3 320C272.3 346.3 293.7 367.7 320 367.7C346.3 367.7 367.7 346.3 367.7 320C367.7 293.7 346.3 272.3 320 272.3C293.7 272.3 272.3 293.7 272.3 320z"/><path d="M259.1 73.5C262.1 58.7 275.2 48 290.4 48L350.2 48C365.4 48 378.5 58.7 381.5 73.5L396 143.5C410.1 149.5 423.3 157.2 435.3 166.3L503.1 143.8C517.5 139 533.3 145 540.9 158.2L570.8 210C578.4 223.2 575.7 239.8 564.3 249.9L511 297.3C511.9 304.7 512.3 312.3 512.3 320C512.3 327.7 511.8 335.3 511 342.7L564.4 390.2C575.8 400.3 578.4 417 570.9 430.1L541 481.9C533.4 495 517.6 501.1 503.2 496.3L435.4 473.8C423.3 482.9 410.1 490.5 396.1 496.6L381.7 566.5C378.6 581.4 365.5 592 350.4 592L290.6 592C275.4 592 262.3 581.3 259.3 566.5L244.9 496.6C230.8 490.6 217.7 482.9 205.6 473.8L137.5 496.3C123.1 501.1 107.3 495.1 99.7 481.9L69.8 430.1C62.2 416.9 64.9 400.3 76.3 390.2L129.7 342.7C128.8 335.3 128.4 327.7 128.4 320C128.4 312.3 128.9 304.7 129.7 297.3L76.3 249.8C64.9 239.7 62.3 223 69.8 209.9L99.7 158.1C107.3 144.9 123.1 138.9 137.5 143.7L205.3 166.2C217.4 157.1 230.6 149.5 244.6 143.4L259.1 73.5zM320.3 416C373.3 415.8 416.2 372.7 416 319.7C415.8 266.7 372.7 223.8 319.7 224C266.7 224.2 223.8 267.3 224 320.3C224.2 373.3 267.3 416.2 320.3 416z"/></svg>`,
shield: `<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 640 640"><path opacity=".4" d="M128 203.7C128.5 295.1 166.4 453 314.4 523.8C318 525.5 322.2 525.5 325.7 523.8C473.7 453 511.6 295.1 512 203.7C512 198.7 508.9 193.5 503 190.9L320 113.4L137.1 191C131.2 193.5 128 198.8 128.1 203.8z"/><path d="M320 113.4L137.1 191C131.2 193.5 128 198.8 128.1 203.8C128.6 295.2 166.5 453.1 314.5 523.9C318.1 525.6 322.3 525.6 325.8 523.9C473.8 453.1 511.7 295.2 512.1 203.8C512.1 198.8 509 193.6 503.1 191L320 113.4zM333.4 66.9L521.8 146.8C543.8 156.1 560.2 177.8 560.1 204C559.6 303.2 518.8 484.7 346.5 567.2C329.8 575.2 310.4 575.2 293.7 567.2C121.3 484.7 80.5 303.2 80.1 204C80 177.8 96.4 156.1 118.4 146.8L306.7 66.9C310.9 65 315.4 64 320 64C324.6 64 329.2 65 333.4 66.9z"/></svg>`,
'shield-alert': `<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 640 640"><path opacity=".4" d="M128 203.7C128.5 295.1 166.4 453 314.4 523.8C318 525.5 322.2 525.5 325.7 523.8C473.7 453 511.6 295.1 512 203.7C512 198.7 508.9 193.5 503 191L320 113.4L137 191C131.1 193.5 127.9 198.7 128 203.7zM352 400C352 417.7 337.7 432 320 432C302.3 432 288 417.7 288 400C288 382.3 302.3 368 320 368C337.7 368 352 382.3 352 400zM288.7 209.7C287.4 191.5 301.8 176 320.1 176C338.3 176 352.8 191.5 351.5 209.7L344.1 313.7C343.2 326.3 332.7 336 320.2 336C307.6 336 297.2 326.3 296.3 313.7L288.9 209.7z"/><path d="M320.1 64C324.7 64 329.3 65 333.4 66.9L521.8 146.8C543.8 156.1 560.2 177.8 560.1 204C559.6 303.2 518.8 484.7 346.5 567.2C329.8 575.2 310.4 575.2 293.8 567.2C121.4 484.7 80.6 303.3 80.1 204C80 177.8 96.4 156.1 118.4 146.8L306.7 66.9C310.8 65 315.4 64 320.1 64zM137.1 191C131.2 193.5 128 198.7 128.1 203.7C128.6 295.1 166.5 453 314.5 523.8C318.1 525.5 322.3 525.5 325.8 523.8C473.8 453 511.7 295.1 512.1 203.7C512.1 198.7 509 193.5 503.1 191L320.1 113.4L137.1 191zM320 432C302.3 432 288 417.7 288 400C288 382.3 302.3 368 320 368C337.7 368 352 382.3 352 400C352 417.7 337.7 432 320 432zM320 176C338.2 176 352.7 191.5 351.4 209.7L344 313.7C343.1 326.3 332.6 336 320.1 336C307.5 336 297.1 326.3 296.2 313.7L288.8 209.7C287.4 191.5 301.8 176 320 176z"/></svg>`,
'shield-check': `<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 640 640"><path opacity=".4" d="M128 203.7C128.5 295.1 166.4 453 314.4 523.8C318 525.5 322.2 525.5 325.7 523.8C473.7 453 511.6 295.1 512 203.7C512 198.7 508.9 193.5 503 191L320 113.4L137 191C131.1 193.5 127.9 198.7 128 203.7zM230.8 349.5C221.6 340 221.8 324.8 231.4 315.6C240.9 306.4 256.1 306.7 265.3 316.2L291.8 343.6L377.4 225.9C385.2 215.2 400.2 212.8 410.9 220.6C421.6 228.4 424 243.4 416.2 254.1L313.8 394.9C309.6 400.6 303.1 404.2 296 404.7C288.9 405.2 282 402.5 277.1 397.4L230.7 349.4z"/><path d="M320.1 64C324.7 64 329.3 65 333.4 66.9L521.8 146.8C543.8 156.1 560.2 177.8 560.1 204C559.6 303.2 518.8 484.7 346.5 567.2C329.8 575.2 310.4 575.2 293.7 567.2C121.3 484.7 80.5 303.3 80 204C79.9 177.8 96.3 156.1 118.3 146.8L306.7 66.9C310.8 65 315.4 64 320.1 64zM137.1 191C131.2 193.5 128 198.7 128.1 203.7C128.6 295.1 166.5 453 314.5 523.8C318.1 525.5 322.3 525.5 325.8 523.8C473.8 453 511.7 295.1 512.1 203.7C512.1 198.7 509 193.5 503.1 191L320.1 113.4L137.1 191zM377.4 225.9C385.2 215.2 400.2 212.8 410.9 220.6C421.6 228.4 424 243.4 416.2 254.1L313.8 394.9C309.6 400.6 303.1 404.2 296 404.7C288.9 405.2 282 402.5 277.1 397.4L230.7 349.4C221.5 339.9 221.7 324.7 231.3 315.5C240.8 306.3 256 306.6 265.2 316.1L291.7 343.5L377.3 225.8z"/></svg>`,
+1
View File
@@ -1776,6 +1776,7 @@ export const aboutPages: NavItem[] = [
export const footerLinks: NavItem[] = [
{ href: '/about', label: 'About' },
{ href: site.repo, label: 'GitHub' },
{ href: author.sponsor, label: 'Sponsor' },
{ href: author.portfolio, label: 'More Apps →' },
];
+205
View File
@@ -0,0 +1,205 @@
import { writable } from 'svelte/store';
import { browser } from '$app/environment';
export interface AccessibilityOption {
id: string;
name: string;
description: string;
category: 'visual' | 'motion' | 'reading' | 'interaction';
enabled: boolean;
cssClass: string;
systemPreference?: () => boolean; // Function to check system preference
}
export interface AccessibilitySettings {
options: AccessibilityOption[];
}
const STORAGE_KEY = 'accessibility-settings';
// Define all available accessibility options
const DEFAULT_OPTIONS: AccessibilityOption[] = [
{
id: 'reduce-motion',
name: 'Reduce motion',
description: 'Minimize animations and transitions',
category: 'motion',
enabled: false,
cssClass: 'reduce-motion',
systemPreference: () => browser && window.matchMedia('(prefers-reduced-motion: reduce)').matches,
},
{
id: 'high-contrast',
name: 'High contrast',
description: 'Increase visual contrast for better readability',
category: 'visual',
enabled: false,
cssClass: 'contrast-high',
},
{
id: 'large-text',
name: 'Large text',
description: 'Increase font size across the application',
category: 'visual',
enabled: false,
cssClass: 'scale-large',
},
{
id: 'dyslexia-font',
name: 'Dyslexia-friendly font',
description: 'Use OpenDyslexic font for better readability',
category: 'reading',
enabled: false,
cssClass: 'dyslexia-font',
},
{
id: 'always-underline-links',
name: 'Always underline links',
description: 'Show underlines on all links, not just on hover',
category: 'visual',
enabled: false,
cssClass: 'links-always-underline',
},
{
id: 'no-icons',
name: 'Hide decorative icons',
description: 'Hide non-essential icons to reduce visual clutter',
category: 'visual',
enabled: false,
cssClass: 'no-icons',
},
{
id: 'focus-visible',
name: 'Enhanced focus indicators',
description: 'Make keyboard focus more visible',
category: 'interaction',
enabled: false,
cssClass: 'focus-enhanced',
},
{
id: 'dark-mode-high-contrast',
name: 'Dark mode high contrast',
description: 'Extra contrast when using dark theme',
category: 'visual',
enabled: false,
cssClass: 'dark-contrast-high',
},
];
function createAccessibilityStore() {
const { subscribe, set, update } = writable<AccessibilitySettings>({
options: DEFAULT_OPTIONS,
});
return {
subscribe,
init: () => {
if (browser) {
const stored = localStorage.getItem(STORAGE_KEY);
let storedSettings: Partial<AccessibilitySettings> = {};
if (stored) {
try {
storedSettings = JSON.parse(stored);
} catch {
storedSettings = {};
}
}
// Merge stored settings with defaults, checking system preferences
const options = DEFAULT_OPTIONS.map((defaultOption) => {
const storedOption = storedSettings.options?.find((opt) => opt.id === defaultOption.id);
// If no stored preference, check system preference
const enabled = storedOption?.enabled ?? defaultOption.systemPreference?.() ?? defaultOption.enabled;
return {
...defaultOption,
enabled,
};
});
set({ options });
}
},
toggle: (optionId: string) => {
update((settings) => {
const newOptions = settings.options.map((option) =>
option.id === optionId ? { ...option, enabled: !option.enabled } : option,
);
const newSettings = { ...settings, options: newOptions };
if (browser) {
localStorage.setItem(STORAGE_KEY, JSON.stringify(newSettings));
}
return newSettings;
});
},
enable: (optionId: string) => {
update((settings) => {
const newOptions = settings.options.map((option) =>
option.id === optionId ? { ...option, enabled: true } : option,
);
const newSettings = { ...settings, options: newOptions };
if (browser) {
localStorage.setItem(STORAGE_KEY, JSON.stringify(newSettings));
}
return newSettings;
});
},
disable: (optionId: string) => {
update((settings) => {
const newOptions = settings.options.map((option) =>
option.id === optionId ? { ...option, enabled: false } : option,
);
const newSettings = { ...settings, options: newOptions };
if (browser) {
localStorage.setItem(STORAGE_KEY, JSON.stringify(newSettings));
}
return newSettings;
});
},
// Get the CSS classes string for data-a11y attribute
getCSSClasses: (settings: AccessibilitySettings): string => {
return settings.options
.filter((option) => option.enabled)
.map((option) => option.cssClass)
.join(' ');
},
// Get options by category
getOptionsByCategory: (settings: AccessibilitySettings, category: AccessibilityOption['category']) => {
return settings.options.filter((option) => option.category === category);
},
// Check if an option is enabled
isEnabled: (settings: AccessibilitySettings, optionId: string): boolean => {
return settings.options.find((option) => option.id === optionId)?.enabled ?? false;
},
// Reset all settings to defaults
reset: () => {
const defaultSettings = { options: DEFAULT_OPTIONS };
set(defaultSettings);
if (browser) {
localStorage.setItem(STORAGE_KEY, JSON.stringify(defaultSettings));
}
},
};
}
export const accessibility = createAccessibilityStore();
+135
View File
@@ -0,0 +1,135 @@
import { writable } from 'svelte/store';
import { browser } from '$app/environment';
export type ThemeOption = 'light' | 'dark' | 'ocean';
export interface Theme {
id: ThemeOption;
name: string;
available: boolean;
preview?: string;
}
const STORAGE_KEY = 'theme';
// Available themes configuration
export const themes: Theme[] = [
{
id: 'light',
name: 'Light',
available: true,
},
{
id: 'dark',
name: 'Dark',
available: true,
},
{
id: 'ocean',
name: 'Ocean',
available: true,
},
];
function createThemeStore() {
const { subscribe, set, update } = writable<ThemeOption>('dark');
return {
subscribe,
// Initialize theme from localStorage or default
init: () => {
if (browser) {
const saved = localStorage.getItem(STORAGE_KEY);
const initialTheme =
saved === 'light' || saved === 'dark' || saved === 'ocean' ? (saved as ThemeOption) : 'dark';
set(initialTheme);
// Apply theme to document
if (initialTheme === 'light') {
document.documentElement.classList.add('theme-light');
document.documentElement.classList.remove('theme-dark', 'theme-ocean');
} else if (initialTheme === 'ocean') {
document.documentElement.classList.add('theme-ocean');
document.documentElement.classList.remove('theme-light', 'theme-dark');
} else {
document.documentElement.classList.remove('theme-light', 'theme-ocean');
}
return initialTheme;
}
return 'dark';
},
// Set theme and persist to localStorage
setTheme: (theme: ThemeOption) => {
// Only set if theme is available
const themeConfig = themes.find((t) => t.id === theme);
if (!themeConfig?.available) {
console.warn(`Theme "${theme}" is not available`);
return;
}
set(theme);
if (browser) {
localStorage.setItem(STORAGE_KEY, theme);
// Apply theme classes to document
if (theme === 'light') {
document.documentElement.classList.add('theme-light');
document.documentElement.classList.remove('theme-dark', 'theme-ocean');
} else if (theme === 'ocean') {
document.documentElement.classList.add('theme-ocean');
document.documentElement.classList.remove('theme-light', 'theme-dark');
} else {
// Default to dark
document.documentElement.classList.remove('theme-light', 'theme-ocean');
}
}
},
// Toggle between light and dark themes (legacy support)
toggle: () => {
update((currentTheme) => {
const newTheme = currentTheme === 'light' ? 'dark' : 'light';
if (browser) {
localStorage.setItem(STORAGE_KEY, newTheme);
if (newTheme === 'light') {
document.documentElement.classList.add('theme-light');
document.documentElement.classList.remove('theme-dark');
} else {
document.documentElement.classList.remove('theme-light');
}
}
return newTheme;
});
},
// Check if current theme is dark
isDark: (theme: ThemeOption): boolean => {
return theme === 'dark';
},
// Check if current theme is light
isLight: (theme: ThemeOption): boolean => {
return theme === 'light';
},
// Get theme configuration
getThemeConfig: (theme: ThemeOption): Theme | undefined => {
return themes.find((t) => t.id === theme);
},
// Get all available themes
getAvailableThemes: (): Theme[] => {
return themes.filter((t) => t.available);
},
};
}
export const theme = createThemeStore();
+45 -31
View File
@@ -7,12 +7,15 @@
import '../styles/ref-pages.scss';
import '../styles/diagnostics-pages.scss';
import '../styles/pages.scss';
import '../styles/a11y.scss';
import favicon from '$lib/assets/favicon.svg';
import { getPageDetails, getPageDetailsWithIcon } from '$lib/constants/nav';
import { generateFaviconDataUri } from '$lib/utils/favicon';
import { site, author } from '$lib/constants/site';
import { toolUsage } from '$lib/stores/toolUsage';
import { accessibility } from '$lib/stores/accessibility';
import { theme } from '$lib/stores/theme';
import { ALL_PAGES } from '$lib/constants/nav';
import Header from '$lib/components/furniture/Header.svelte';
@@ -20,8 +23,9 @@
import Footer from '$lib/components/furniture/Footer.svelte';
let { data, children } = $props(); // Gets data from the server load function
let darkMode = $state(true); // Stores the theme mode
let faviconTrigger = $state(0); // Trigger to force favicon updates
let accessibilitySettings = $state(accessibility); // Accessibility settings store
let currentTheme = $state(theme); // Theme store
// Get page-specific metadata or fallback to site defaults
const seoData = $derived.by(() => {
@@ -54,8 +58,9 @@
});
onMount(() => {
initializeTheme();
theme.init();
toolUsage.init();
accessibility.init();
});
// Track tool visits when page changes
@@ -69,39 +74,44 @@
}
});
/* Reads and applies user's theme from localstorage on initial load */
function initializeTheme() {
if (typeof window === 'undefined') return;
const saved = localStorage.getItem('theme');
if (saved === 'light') {
darkMode = false;
document.documentElement.classList.add('theme-light');
}
}
// Apply accessibility settings to HTML element
$effect(() => {
if (typeof document === 'undefined') return;
/* Toggles between dark and light themes, saving preference to localstorage */
function toggleTheme() {
darkMode = !darkMode;
if (typeof window !== 'undefined') {
localStorage.setItem('theme', darkMode ? 'dark' : 'light');
if (darkMode) {
document.documentElement.classList.remove('theme-light');
} else {
document.documentElement.classList.add('theme-light');
}
// Trigger favicon update 50ms after theme change
setTimeout(() => {
faviconTrigger++;
}, 50);
const cssClasses = accessibility.getCSSClasses($accessibilitySettings);
if (cssClasses.trim()) {
document.documentElement.setAttribute('data-a11y', cssClasses);
} else {
document.documentElement.removeAttribute('data-a11y');
}
}
});
// Theme change effect - trigger favicon update when theme changes
$effect(() => {
// Subscribe to theme changes
void $currentTheme;
// Trigger favicon update 50ms after theme change
setTimeout(() => {
faviconTrigger++;
}, 50);
});
/* Uses the server-generated breadcrumb data, to build a JSON-LD breadcrumb object */
function jsonLdTag(data: unknown, type = 'application/ld+json', nonce?: string) {
if (!data) return '';
const json = JSON.stringify(data).replace(/</g, '\\u003c').replace(/-->/g, '--\\>');
const nonceAttr = nonce ? ` nonce="${nonce}"` : '';
return `<script type="${type}"${nonceAttr}>${json} <${'/'}>script>`;
try {
const json = JSON.stringify(data)
.replace(/</g, '\\u003c')
.replace(/>/g, '\\u003e')
.replace(/-->/g, '--\\u003e')
.replace(/\//g, '\\/');
const nonceAttr = nonce ? ` nonce="${nonce}"` : '';
return `<script type="${type}"${nonceAttr}>${json}</${'script'}>`;
} catch (error) {
console.error('Error generating JSON-LD tag:', error);
return '';
}
}
</script>
@@ -139,9 +149,13 @@
{@html jsonLdTag(data.breadcrumbJsonLd)}
</svelte:head>
<Header {darkMode} {toggleTheme} />
<!-- Skip Links for Accessibility -->
<a href="#main-content" class="skip-link">Skip to main content</a>
<a href="#navigation" class="skip-link">Skip to navigation</a>
<Header />
<SubHeader />
<main class="main-content">
<main id="main-content" class="main-content">
{@render children?.()}
</main>
<Footer />
+1 -1
View File
@@ -78,7 +78,7 @@
<h1>Site Map</h1>
<p>
Site-wide page listing.<br />
For computer-readable version, see <a class="xml-link" href="/sitemap.xml">sitemap.xml</a>
For machine-readable version, see <a class="xml-link" href="/sitemap.xml">sitemap.xml</a>
</p>
<div class="tree">
+343
View File
@@ -0,0 +1,343 @@
/* Accessibility Styles */
/* Applied via data-a11y attribute on html element */
/* Reduce Motion */
html[data-a11y~='reduce-motion'] {
/* Override CSS variable transitions */
--transition-fast: 0ms;
--transition-normal: 0ms;
--transition-slow: 0ms;
* {
animation-duration: 0.01ms !important;
animation-iteration-count: 1 !important;
transition-duration: 0.01ms !important;
scroll-behavior: auto !important;
}
}
/* High Contrast */
html[data-a11y~='contrast-high'] {
filter: contrast(1.15) brightness(1.05) saturate(1.05);
/* Enhance border visibility */
* {
border-width: max(1px, var(--border-width, 1px));
}
/* Make focus indicators more prominent */
:focus-visible {
outline: 3px solid var(--color-primary) !important;
outline-offset: 2px !important;
}
/* Enhance button contrast */
button,
[role='button'] {
border: 2px solid var(--border-primary) !important;
&:hover {
border-color: var(--color-primary) !important;
}
}
/* Enhance form input contrast */
input,
select,
textarea {
border: 2px solid var(--border-primary) !important;
&:focus {
border-color: var(--color-primary) !important;
}
}
}
/* Dark Mode High Contrast */
html[data-a11y~='dark-contrast-high'] {
--bg-primary: #000000;
--bg-secondary: #0a0a0a;
--bg-tertiary: #141414;
--text-primary: #ffffff;
--text-secondary: #e0e0e0;
--border-primary: #404040;
--border-secondary: #606060;
}
/* Large Text Scale */
html[data-a11y~='scale-large'] {
font-size: 110%; /* Increase base font size by 25% */
/* Scale specific font size variables */
--font-size-2xs: 0.75rem;
--font-size-xs: 0.9375rem;
--font-size-sm: 1.09375rem;
--font-size-md: 1.25rem;
--font-size-lg: 1.40625rem;
--font-size-xl: 1.5625rem;
--font-size-2xl: 1.875rem;
--font-size-3xl: 2.5rem;
/* Scale spacing for better proportion */
--spacing-xs: 0.3125rem;
--spacing-sm: 0.625rem;
--spacing-md: 1.25rem;
--spacing-lg: 1.875rem;
--spacing-xl: 2.5rem;
--spacing-2xl: 3.75rem;
/* Ensure line height remains readable */
* {
line-height: 1.6;
}
/* Scale icon sizes appropriately */
.icon {
&.w-2 {
width: 0.625rem;
height: 0.625rem;
}
&.w-4 {
width: 1.25rem;
height: 1.25rem;
}
&.w-6 {
width: 1.875rem;
height: 1.875rem;
}
&.w-8 {
width: 2.5rem;
height: 2.5rem;
}
}
}
/* Dyslexia-Friendly Font */
html[data-a11y~='dyslexia-font'] {
/* Import OpenDyslexic font when needed */
@import url('https://fonts.cdnfonts.com/css/opendyslexic');
font-family: 'OpenDyslexic', 'Comic Sans MS', 'Trebuchet MS', 'Verdana', sans-serif;
letter-spacing: 0.05em;
line-height: 1.6;
*,
h1,
h2,
h3,
h4,
h5,
h6,
p,
span,
div,
li,
td,
th {
font-family: inherit;
letter-spacing: inherit;
}
code,
pre,
.font-mono,
[class*='mono'] {
font-family: var(--font-mono);
letter-spacing: 0.02em;
}
}
/* Always Underline Links */
html[data-a11y~='links-always-underline'] {
a {
text-decoration: underline !important;
text-underline-offset: 0.2em;
text-decoration-thickness: 1px;
&:hover {
text-decoration-thickness: 2px;
}
}
/* Exception for button-styled links */
a[role='button'],
a.btn,
a.button {
text-decoration: none !important;
}
}
/* Hide Decorative Icons */
html[data-a11y~='no-icons'] {
/* Hide decorative icons but keep essential ones */
.icon:not([aria-label]):not([role]):not([aria-hidden='false']) {
display: none !important;
}
/* Hide background images that are decorative */
.bg-pattern,
.decorative-bg {
background-image: none !important;
}
/* Ensure buttons still work without icons by adding text */
button:not([aria-label]):has(.icon:only-child):after {
content: attr(title);
margin-left: var(--spacing-xs);
}
}
/* Enhanced Focus Indicators */
html[data-a11y~='focus-enhanced'] {
:focus-visible {
outline: 3px solid var(--color-primary) !important;
outline-offset: 3px !important;
border-radius: var(--radius-sm);
box-shadow:
0 0 0 1px var(--bg-primary),
0 0 0 4px var(--color-primary) !important;
}
/* High contrast focus for form elements */
input:focus-visible,
textarea:focus-visible,
select:focus-visible {
box-shadow:
0 0 0 1px var(--bg-primary),
0 0 0 4px var(--color-primary),
inset 0 0 0 2px var(--color-primary) !important;
}
/* Focus for custom controls */
[role='button']:focus-visible,
[role='switch']:focus-visible,
[role='checkbox']:focus-visible,
[role='radio']:focus-visible {
outline: 3px solid var(--color-primary) !important;
outline-offset: 2px !important;
}
/* Skip links become visible on focus */
.skip-link:focus {
position: absolute !important;
top: var(--spacing-md) !important;
left: var(--spacing-md) !important;
z-index: 9999 !important;
padding: var(--spacing-sm) var(--spacing-md) !important;
background: var(--bg-secondary) !important;
border: 2px solid var(--color-primary) !important;
border-radius: var(--radius-sm) !important;
color: var(--text-primary) !important;
text-decoration: none !important;
font-weight: 600;
box-shadow: var(--shadow-lg) !important;
}
}
/* Prefers Reduced Motion - System Preference Override */
@media (prefers-reduced-motion: reduce) {
html:not([data-a11y~='reduce-motion']) {
* {
animation-duration: 0.01ms !important;
animation-iteration-count: 1 !important;
transition-duration: 0.01ms !important;
scroll-behavior: auto !important;
}
}
}
/* Prefers High Contrast - System Preference Support */
@media (prefers-contrast: high) {
html:not([data-a11y~='contrast-high']) {
filter: contrast(1.1) brightness(1.02);
}
}
/* Large Text System Preference */
@media (prefers-reduced-data: reduce) {
/* Reduce background images when user prefers reduced data */
html {
.bg-pattern,
.decorative-bg {
background-image: none !important;
}
}
}
/* Color Scheme Preference Support */
@media (prefers-color-scheme: dark) {
html[data-a11y~='dark-contrast-high'] {
--bg-primary: #000000;
--text-primary: #ffffff;
}
}
/* Print Accessibility */
@media print {
html[data-a11y] {
/* Ensure high contrast for printing */
filter: none !important;
/* Force black text on white background */
* {
background: white !important;
color: black !important;
box-shadow: none !important;
text-shadow: none !important;
}
/* Show link URLs */
a:after {
content: ' (' attr(href) ')';
font-size: 0.8em;
color: #666;
}
/* Hide decorative elements */
.icon:not([aria-label]) {
display: none !important;
}
}
}
/* Focus management for screen readers */
.sr-only {
position: absolute !important;
width: 1px !important;
height: 1px !important;
padding: 0 !important;
margin: -1px !important;
overflow: hidden !important;
clip: rect(0, 0, 0, 0) !important;
white-space: nowrap !important;
border: 0 !important;
}
.sr-only-focusable:focus {
position: static !important;
width: auto !important;
height: auto !important;
padding: inherit !important;
margin: inherit !important;
overflow: visible !important;
clip: auto !important;
white-space: inherit !important;
}
/* Skip links */
.skip-link {
position: absolute;
top: -40px;
left: 6px;
background: var(--bg-primary);
color: var(--text-primary);
padding: 8px;
border: 1px solid var(--border-primary);
border-radius: var(--radius-sm);
text-decoration: none;
z-index: 1000;
transition: top 0.3s;
&:focus {
top: 6px;
}
}
+26
View File
@@ -1,5 +1,31 @@
/* Layout components (.container, .page, .header, .card) already defined in base.scss - removed duplicates */
/* Action Button Styles - Shared across multiple components */
.action-button {
display: flex;
align-items: center;
justify-content: center;
width: 2rem;
height: 2rem;
background: var(--bg-tertiary);
border: 1px solid var(--border-primary);
border-radius: var(--radius-sm);
color: var(--text-secondary);
cursor: pointer;
transition: all var(--transition-normal);
&:hover {
background: var(--bg-primary);
color: var(--text-primary);
border-color: var(--border-secondary);
}
&:focus-visible {
outline: 2px solid var(--color-primary);
outline-offset: 2px;
}
}
hr {
border: none;
border-top: 1px solid var(--border-primary);
+14 -5
View File
@@ -71,10 +71,19 @@
--transition-slow: 0.3s ease;
}
// --color-primary: #70edb7;
// --bg-primary: #131c2b;
// --bg-secondary: #212c3d;
// --bg-tertiary: #151e2f;
.theme-ocean,
html[data-theme='ocean'] {
--color-primary: #70edb7;
--color-primary-hover: #a0ffd0;
--color-primary-dark: #38b48b;
--bg-primary: #131c2b;
--bg-secondary: #212c3d;
--bg-tertiary: #151e2f;
--text-secondary: #a0a7b0;
--surface-hover: #2b384b;
--border-primary: #30405b;
}
/* Light theme */
.theme-light,
@@ -110,7 +119,7 @@ html[data-theme='light'] {
/* Border & surface */
--border-primary: #e5e7eb; /* default hairline */
--border-secondary: #d1d5db; /* dividers on white */
--surface-hover: #f2f5f9; /* interactive hover */
--surface-hover: #f6f2f9; /* interactive hover */
--surface-active: #e9eef5; /* pressed/selected */
/* Shadows (softer for light UI) */