mirror of
https://github.com/lissy93/networking-toolbox.git
synced 2026-11-22 14:01:44 +03:00
Search route, homepage featured
This commit is contained in:
1 parent
089385f9cd
commit
1e1b87f918
7 files changed
+343
-22
No files matched your search
@@ -455,7 +455,7 @@
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
align-items: center;
|
||||
gap: var(--spacing-xs);
|
||||
gap: var(--spacing-sm);
|
||||
width: 100%;
|
||||
position: relative;
|
||||
z-index: 1;
|
||||
|
||||
@@ -1,38 +1,293 @@
|
||||
<script lang="ts">
|
||||
import { onMount } from 'svelte';
|
||||
import ToolsGrid from '$lib/components/global/ToolsGrid.svelte';
|
||||
import BookmarksGrid from '$lib/components/global/BookmarksGrid.svelte';
|
||||
import Icon from '$lib/components/global/Icon.svelte';
|
||||
import { bookmarks } from '$lib/stores/bookmarks';
|
||||
import { frequentlyUsedTools, recentlyUsedTools } from '$lib/stores/toolUsage';
|
||||
|
||||
onMount(() => {
|
||||
bookmarks.init();
|
||||
});
|
||||
|
||||
type ViewMode = 'bookmarks' | 'most-used' | 'recent';
|
||||
let activeView = $state<ViewMode>('bookmarks');
|
||||
|
||||
const bookmarkCount = $derived($bookmarks.length);
|
||||
const mostUsedCount = $derived($frequentlyUsedTools.length);
|
||||
const recentCount = $derived($recentlyUsedTools.length);
|
||||
|
||||
let showAll = $state(false);
|
||||
|
||||
// Reset showAll when switching views
|
||||
$effect(() => {
|
||||
// Track activeView to reset showAll when it changes
|
||||
void activeView;
|
||||
showAll = false;
|
||||
});
|
||||
|
||||
// Determine if current view has items
|
||||
const hasItems = $derived(() => {
|
||||
if (activeView === 'bookmarks') return bookmarkCount > 0;
|
||||
if (activeView === 'most-used') return mostUsedCount > 0;
|
||||
if (activeView === 'recent') return recentCount > 0;
|
||||
return false;
|
||||
});
|
||||
|
||||
// Convert tool usage to NavItem format
|
||||
const mostUsedItems = $derived(
|
||||
$frequentlyUsedTools.map((tool) => ({
|
||||
href: tool.href,
|
||||
label: tool.label || 'Tool',
|
||||
icon: tool.icon,
|
||||
description: tool.description,
|
||||
keywords: [],
|
||||
})),
|
||||
);
|
||||
|
||||
const recentItems = $derived(
|
||||
$recentlyUsedTools.map((tool) => ({
|
||||
href: tool.href,
|
||||
label: tool.label || 'Tool',
|
||||
icon: tool.icon,
|
||||
description: tool.description,
|
||||
keywords: [],
|
||||
})),
|
||||
);
|
||||
|
||||
const bookmarkItems = $derived(
|
||||
$bookmarks.map((bookmark) => ({
|
||||
href: bookmark.href,
|
||||
label: bookmark.label,
|
||||
icon: bookmark.icon,
|
||||
description: bookmark.description,
|
||||
keywords: [],
|
||||
})),
|
||||
);
|
||||
</script>
|
||||
|
||||
<BookmarksGrid />
|
||||
<div class="bookmarks-page">
|
||||
<div class="bookmarks-container" aria-live="polite">
|
||||
<div class="bookmarks-header">
|
||||
<div class="tools-grid-sub-header">
|
||||
{#if activeView === 'bookmarks'}
|
||||
<Icon name="bookmarks" size="sm" />
|
||||
<h2>Bookmarked Tools</h2>
|
||||
<span class="count">{bookmarkCount}</span>
|
||||
{:else if activeView === 'most-used'}
|
||||
<Icon name="frequently-used" size="sm" />
|
||||
<h2>Most Used</h2>
|
||||
<span class="count">{mostUsedCount}</span>
|
||||
{:else if activeView === 'recent'}
|
||||
<Icon name="clock" size="sm" />
|
||||
<h2>Recent</h2>
|
||||
<span class="count">{recentCount}</span>
|
||||
{/if}
|
||||
</div>
|
||||
|
||||
<!-- Button for showing all tools, so user can find some to bookmark -->
|
||||
{#if bookmarkCount > 0}
|
||||
<div class="toggle-container">
|
||||
<button onclick={() => (showAll = !showAll)} class="toggle-button">
|
||||
{showAll ? 'Hide All' : 'Show All'}
|
||||
</button>
|
||||
<div class="view-toggle">
|
||||
<button
|
||||
class="toggle-btn"
|
||||
class:active={activeView === 'bookmarks'}
|
||||
onclick={() => (activeView = 'bookmarks')}
|
||||
aria-pressed={activeView === 'bookmarks'}
|
||||
>
|
||||
<Icon name="bookmarks" size="sm" />
|
||||
<span>Bookmarks</span>
|
||||
</button>
|
||||
<button
|
||||
class="toggle-btn"
|
||||
class:active={activeView === 'most-used'}
|
||||
onclick={() => (activeView = 'most-used')}
|
||||
aria-pressed={activeView === 'most-used'}
|
||||
>
|
||||
<Icon name="frequently-used" size="sm" />
|
||||
<span>Most Used</span>
|
||||
</button>
|
||||
<button
|
||||
class="toggle-btn"
|
||||
class:active={activeView === 'recent'}
|
||||
onclick={() => (activeView = 'recent')}
|
||||
aria-pressed={activeView === 'recent'}
|
||||
>
|
||||
<Icon name="clock" size="sm" />
|
||||
<span>Recent</span>
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="bookmarks-grid">
|
||||
{#if activeView === 'bookmarks'}
|
||||
{#if bookmarkCount > 0}
|
||||
<ToolsGrid tools={bookmarkItems} idPrefix="bookmarks" />
|
||||
{:else}
|
||||
<div class="empty-state">
|
||||
<div class="empty-icon">
|
||||
<Icon name="bookmarks" size="lg" />
|
||||
</div>
|
||||
<h3>No bookmarks yet</h3>
|
||||
<p>Hover over any tool card and click the bookmark icon to save your favorites</p>
|
||||
</div>
|
||||
{/if}
|
||||
{:else if activeView === 'most-used'}
|
||||
{#if mostUsedCount > 0}
|
||||
<ToolsGrid tools={mostUsedItems} idPrefix="most-used" />
|
||||
{:else}
|
||||
<div class="empty-state">
|
||||
<div class="empty-icon">
|
||||
<Icon name="frequently-used" size="lg" />
|
||||
</div>
|
||||
<h3>No usage data yet</h3>
|
||||
<p>Start using tools to see your most frequently used ones here</p>
|
||||
</div>
|
||||
{/if}
|
||||
{:else if activeView === 'recent'}
|
||||
{#if recentCount > 0}
|
||||
<ToolsGrid tools={recentItems} idPrefix="recent" />
|
||||
{:else}
|
||||
<div class="empty-state">
|
||||
<div class="empty-icon">
|
||||
<Icon name="clock" size="lg" />
|
||||
</div>
|
||||
<h3>No recent tools</h3>
|
||||
<p>Recently visited tools will appear here</p>
|
||||
</div>
|
||||
{/if}
|
||||
{/if}
|
||||
</div>
|
||||
</div>
|
||||
{/if}
|
||||
|
||||
<!-- Show all tools -->
|
||||
{#if bookmarkCount === 0 || showAll}
|
||||
<ToolsGrid />
|
||||
{/if}
|
||||
<!-- Button for showing all tools when current view has items -->
|
||||
{#if hasItems()}
|
||||
<div class="toggle-container">
|
||||
<button onclick={() => (showAll = !showAll)} class="toggle-button">
|
||||
{showAll ? 'Hide All Tools' : 'Show All Tools'}
|
||||
</button>
|
||||
</div>
|
||||
{/if}
|
||||
|
||||
<!-- Show all tools when view is empty OR when Show All is toggled -->
|
||||
{#if !hasItems() || showAll}
|
||||
<div class="all-tools-section">
|
||||
<ToolsGrid />
|
||||
</div>
|
||||
{/if}
|
||||
</div>
|
||||
|
||||
<style lang="scss">
|
||||
.bookmarks-page {
|
||||
animation: fadeIn 0.3s ease-out;
|
||||
}
|
||||
|
||||
.bookmarks-container {
|
||||
animation: slideIn 0.3s ease-out;
|
||||
}
|
||||
|
||||
.bookmarks-header {
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
align-items: center;
|
||||
gap: var(--spacing-md);
|
||||
margin-bottom: var(--spacing-lg);
|
||||
flex-wrap: wrap;
|
||||
|
||||
@media (max-width: 768px) {
|
||||
flex-direction: column;
|
||||
align-items: flex-start;
|
||||
}
|
||||
}
|
||||
|
||||
.view-toggle {
|
||||
display: flex;
|
||||
gap: var(--spacing-xs);
|
||||
background: var(--bg-secondary);
|
||||
padding: var(--spacing-xs);
|
||||
border-radius: var(--radius-md);
|
||||
border: 1px solid var(--border-primary);
|
||||
|
||||
.toggle-btn {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: var(--spacing-xs);
|
||||
padding: var(--spacing-xs) var(--spacing-sm);
|
||||
background: transparent;
|
||||
color: var(--text-secondary);
|
||||
font-size: var(--font-size-sm);
|
||||
border: none;
|
||||
border-radius: var(--radius-sm);
|
||||
cursor: pointer;
|
||||
transition: all var(--transition-fast);
|
||||
white-space: nowrap;
|
||||
|
||||
:global(svg) {
|
||||
color: var(--text-secondary);
|
||||
transition: color var(--transition-fast);
|
||||
}
|
||||
|
||||
&:hover {
|
||||
background: var(--bg-tertiary);
|
||||
color: var(--text-primary);
|
||||
|
||||
:global(svg) {
|
||||
color: var(--text-primary);
|
||||
}
|
||||
}
|
||||
|
||||
&.active {
|
||||
background: var(--color-primary);
|
||||
color: var(--bg-primary);
|
||||
|
||||
:global(svg) {
|
||||
color: var(--bg-primary);
|
||||
}
|
||||
}
|
||||
|
||||
@media (max-width: 640px) {
|
||||
span {
|
||||
display: none;
|
||||
}
|
||||
padding: var(--spacing-xs);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.bookmarks-grid {
|
||||
animation: subtleFadeIn 0.2s ease-out;
|
||||
}
|
||||
|
||||
.empty-state {
|
||||
background: var(--bg-secondary);
|
||||
margin: var(--spacing-xl) auto;
|
||||
padding: var(--spacing-xl) var(--spacing-lg);
|
||||
border-radius: var(--radius-lg);
|
||||
text-align: center;
|
||||
opacity: 0.85;
|
||||
animation: fadeIn 0.2s ease;
|
||||
|
||||
.empty-icon {
|
||||
:global(svg) {
|
||||
color: var(--text-secondary);
|
||||
opacity: 0.5;
|
||||
}
|
||||
}
|
||||
|
||||
h3 {
|
||||
font-size: var(--font-size-lg);
|
||||
color: var(--text-primary);
|
||||
margin: var(--spacing-md) 0 var(--spacing-sm) 0;
|
||||
}
|
||||
|
||||
p {
|
||||
color: var(--text-secondary);
|
||||
max-width: 24rem;
|
||||
margin: 0 auto;
|
||||
line-height: 1.5;
|
||||
}
|
||||
}
|
||||
|
||||
.toggle-container {
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
margin: var(--spacing-lg) 0;
|
||||
margin: var(--spacing-xl) 0 var(--spacing-lg) 0;
|
||||
|
||||
.toggle-button {
|
||||
padding: var(--spacing-sm) var(--spacing-md);
|
||||
@@ -42,11 +297,45 @@
|
||||
border-radius: var(--radius-sm);
|
||||
cursor: pointer;
|
||||
border: none;
|
||||
transition: background 0.3s ease;
|
||||
transition: background var(--transition-fast);
|
||||
|
||||
&:hover {
|
||||
background: var(--color-primary-hover);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.all-tools-section {
|
||||
margin-top: var(--spacing-xl);
|
||||
animation: fadeIn 0.3s ease-out;
|
||||
}
|
||||
|
||||
@keyframes fadeIn {
|
||||
from {
|
||||
opacity: 0;
|
||||
}
|
||||
to {
|
||||
opacity: 1;
|
||||
}
|
||||
}
|
||||
|
||||
@keyframes slideIn {
|
||||
from {
|
||||
opacity: 0;
|
||||
transform: translateY(-10px);
|
||||
}
|
||||
to {
|
||||
opacity: 1;
|
||||
transform: translateY(0);
|
||||
}
|
||||
}
|
||||
|
||||
@keyframes subtleFadeIn {
|
||||
from {
|
||||
opacity: 0;
|
||||
}
|
||||
to {
|
||||
opacity: 1;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
@@ -15,6 +15,14 @@
|
||||
|
||||
let { toolPages, referencePages }: Props = $props();
|
||||
|
||||
// Get featured tools (up to 12)
|
||||
const featuredTools = $derived(
|
||||
toolPages
|
||||
.filter((tool) => tool.featured === true)
|
||||
// .sort(() => Math.random() - 0.5)
|
||||
.slice(0, 6),
|
||||
);
|
||||
|
||||
// Category configuration - easily extensible for future customization
|
||||
interface CategorySection {
|
||||
id: string;
|
||||
@@ -109,7 +117,7 @@
|
||||
|
||||
{#if searchQuery.trim() === ''}
|
||||
<div class="categories-layout">
|
||||
<!-- Bookmarks Section -->
|
||||
<!-- Bookmarks or Featured Section -->
|
||||
{#if $bookmarks.length > 0}
|
||||
<section class="category-section bookmarks-section">
|
||||
<div class="section-header">
|
||||
@@ -128,6 +136,15 @@
|
||||
searchQuery=""
|
||||
/>
|
||||
</section>
|
||||
{:else if featuredTools.length > 0}
|
||||
<section class="category-section bookmarks-section">
|
||||
<div class="section-header">
|
||||
<Icon name="star" size="md" />
|
||||
<h2>Featured</h2>
|
||||
<span class="count">{featuredTools.length}</span>
|
||||
</div>
|
||||
<ToolsGrid idPrefix="featured" tools={featuredTools} searchQuery="" />
|
||||
</section>
|
||||
{/if}
|
||||
|
||||
<!-- Usage Row: Most Used (2/3) and Recently Used (1/3) -->
|
||||
@@ -286,10 +303,10 @@
|
||||
flex-direction: column;
|
||||
gap: var(--spacing-md);
|
||||
background: var(--bg-tertiary);
|
||||
background: radial-gradient(
|
||||
color-mix(in srgb, var(--bg-tertiary), transparent 30%),
|
||||
color-mix(in srgb, var(--bg-tertiary), var(--bg-primary) 60%)
|
||||
);
|
||||
// background: radial-gradient(
|
||||
// color-mix(in srgb, var(--bg-tertiary), transparent 30%),
|
||||
// color-mix(in srgb, var(--bg-tertiary), var(--bg-primary) 60%)
|
||||
// );
|
||||
padding: var(--spacing-md);
|
||||
border-radius: var(--radius-md);
|
||||
border: 1px solid var(--border-primary);
|
||||
@@ -370,6 +387,7 @@
|
||||
border: none;
|
||||
box-shadow: none;
|
||||
grid-column: 1 / -1;
|
||||
max-height: none;
|
||||
}
|
||||
|
||||
// Usage row: 2/3 and 1/3 split
|
||||
|
||||
@@ -285,6 +285,7 @@ export const iconMap: Record<string, string> = {
|
||||
mailbox: `<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 640 640"><!--!Font Awesome Pro v7.1.0 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license (Commercial License) Copyright 2025 Fonticons, Inc.--><path opacity=".4" d="M283.3 176L448 176C509.9 176 560 226.1 560 288L560 480C560 488.8 552.8 496 544 496L318 496C319.3 490.9 320 485.5 320 480L320 272C320 235.1 306.1 201.5 283.3 176zM368 296C368 309.3 378.7 320 392 320L416 320L416 360C416 373.3 426.7 384 440 384L488 384C501.3 384 512 373.3 512 360L512 296C512 282.7 501.3 272 488 272L392 272C378.7 272 368 282.7 368 296z"/><path d="M283.3 176C306.1 201.5 320 235.1 320 272L320 480C320 485.5 319.3 490.9 318 496L544 496C552.8 496 560 488.8 560 480L560 288C560 226.1 509.9 176 448 176L283.3 176zM176 176C123 176 80 219 80 272L80 480C80 488.8 87.2 496 96 496L256 496C264.8 496 272 488.8 272 480L272 272C272 219 229 176 176 176zM176 128L448 128C536.4 128 608 199.6 608 288L608 480C608 515.3 579.3 544 544 544L96 544C60.7 544 32 515.3 32 480L32 272C32 192.5 96.5 128 176 128zM136 272L216 272C229.3 272 240 282.7 240 296C240 309.3 229.3 320 216 320L136 320C122.7 320 112 309.3 112 296C112 282.7 122.7 272 136 272zM368 296C368 282.7 378.7 272 392 272L488 272C501.3 272 512 282.7 512 296L512 360C512 373.3 501.3 384 488 384L440 384C426.7 384 416 373.3 416 360L416 320L392 320C378.7 320 368 309.3 368 296z"/></svg>`,
|
||||
mustache: `<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 640 640"><!--!Font Awesome Pro v7.1.0 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license (Commercial License) Copyright 2025 Fonticons, Inc.--><path opacity=".4" d="M48.2 274.7C52.7 353.5 118 416 198 416C230.5 416 262 405.5 288 386L305.6 372.8C314.1 366.4 325.9 366.4 334.4 372.8L352 386C378 405.5 409.5 416 442 416C521.9 416 587.3 353.5 591.8 274.7C547.5 291.4 495.8 281.7 460.4 246.3C446.1 232 426.8 224 406.6 224L405.4 224C386.9 224 369 230.5 354.8 242.3L335.5 258.4C326.6 265.8 313.7 265.8 304.8 258.4L285.5 242.3C271.3 230.5 253.4 224 234.9 224L233.7 224C213.5 224 194.2 232 179.9 246.3C144.5 281.7 92.8 291.4 48.5 274.7z"/><path d="M233.4 176C200.5 176 169 189.1 145.7 212.3C117.2 240.8 71.5 242.1 41.4 215.4L39.9 214.1C37.2 211.7 34.1 210 30.9 209.1C28.1 208.3 25.5 208 23.5 208.1C19.9 208.2 16.5 209 13.4 210.5C11.2 211.5 9.2 212.9 7.4 214.7C2.8 219.1-.1 225.3-.1 232.1L-.1 266.1C-.1 375.5 88.5 464.1 197.9 464.1C240.7 464.1 282.4 450.2 316.7 424.5L319.9 422.1L323.1 424.5C357.4 450.2 399.1 464.1 441.9 464.1C551.3 464.1 639.9 375.5 639.9 266.1L639.9 232.1C639.9 225.2 637 219 632.4 214.7C628.2 210.7 622.6 208.2 616.3 208.1C615.9 208.1 615.4 208.1 615 208.1C612.6 208.2 610.2 208.6 607.9 209.4C605 210.4 602.3 212 599.9 214.1L598.4 215.4C568.3 242.1 522.6 240.8 494.1 212.3C470.8 189 439.3 176 406.4 176L405.2 176C375.5 176 346.7 186.4 323.9 205.5L319.9 208.8L315.9 205.5C293.1 186.5 264.3 176 234.6 176L233.4 176zM591.7 274.7C587.2 353.5 521.9 416 441.9 416C409.4 416 377.9 405.5 351.9 386L334.3 372.8C325.8 366.4 314 366.4 305.5 372.8L288 386C262 405.5 230.5 416 198 416C118.1 416 52.7 353.5 48.2 274.7C92.5 291.4 144.2 281.7 179.6 246.3C193.9 232 213.2 224 233.4 224L234.6 224C253.1 224 271 230.5 285.2 242.3L304.5 258.4C313.4 265.8 326.3 265.8 335.2 258.4L354.5 242.3C368.7 230.5 386.6 224 405.1 224L406.3 224C426.5 224 445.8 232 460.1 246.3C495.5 281.7 547.2 291.4 591.5 274.7z"/></svg>`,
|
||||
'frequently-used': `<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 640 640"><!--!Font Awesome Pro v7.1.0 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license (Commercial License) Copyright 2025 Fonticons, Inc.--><path opacity=".4" d=""/><path d="M152.5 96C139.2 96 128.5 106.7 128.5 120C128.5 133.3 139.2 144 152.5 144L206.6 144L71.6 279C62.2 288.4 62.2 303.6 71.6 312.9C81 322.2 96.2 322.3 105.5 312.9L240.5 177.9L240.5 232C240.5 245.3 251.2 256 264.5 256C277.8 256 288.5 245.3 288.5 232L288.5 120C288.5 106.7 277.8 96 264.5 96L152.5 96zM468.3 134.1C468.3 155.1 485.4 172.2 506.4 172.2C527.4 172.2 544.5 155.1 544.5 134.1C544.5 113.1 527.4 96 506.4 96C485.4 96 468.3 113.1 468.3 134.1zM344.2 258.2C344.2 279.2 361.3 296.3 382.3 296.3C403.3 296.3 420.4 279.2 420.4 258.2C420.4 237.2 403.3 220.1 382.3 220.1C361.3 220.1 344.2 237.2 344.2 258.2zM506.4 220.1C485.4 220.1 468.3 237.2 468.3 258.2C468.3 279.2 485.4 296.3 506.4 296.3C527.4 296.3 544.5 279.2 544.5 258.2C544.5 237.2 527.4 220.1 506.4 220.1zM220.7 381.8C220.7 402.8 237.8 419.9 258.8 419.9C279.8 419.9 296.9 402.8 296.9 381.8C296.9 360.8 279.8 343.7 258.8 343.7C237.8 343.7 220.7 360.8 220.7 381.8zM382.3 343.7C361.3 343.7 344.2 360.8 344.2 381.8C344.2 402.8 361.3 419.9 382.3 419.9C403.3 419.9 420.4 402.8 420.4 381.8C420.4 360.8 403.3 343.7 382.3 343.7zM468.4 381.8C468.4 402.8 485.5 419.9 506.5 419.9C527.5 419.9 544.6 402.8 544.6 381.8C544.6 360.8 527.5 343.7 506.5 343.7C485.5 343.7 468.4 360.8 468.4 381.8zM134.6 467.8C113.6 467.8 96.5 484.9 96.5 505.9C96.5 526.9 113.6 544 134.6 544C155.6 544 172.7 526.9 172.7 505.9C172.7 484.9 155.6 467.8 134.6 467.8zM220.7 505.9C220.7 526.9 237.8 544 258.8 544C279.8 544 296.9 526.9 296.9 505.9C296.9 484.9 279.8 467.8 258.8 467.8C237.8 467.8 220.7 484.9 220.7 505.9zM382.3 467.8C361.3 467.8 344.2 484.9 344.2 505.9C344.2 526.9 361.3 544 382.3 544C403.3 544 420.4 526.9 420.4 505.9C420.4 484.9 403.3 467.8 382.3 467.8zM468.4 505.9C468.4 526.9 485.5 544 506.5 544C527.5 544 544.6 526.9 544.6 505.9C544.6 484.9 527.5 467.8 506.5 467.8C485.5 467.8 468.4 484.9 468.4 505.9z"/></svg>`,
|
||||
star: `<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 640 640"><!--!Font Awesome Pro v7.1.0 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license (Commercial License) Copyright 2025 Fonticons, Inc.--><path opacity=".4" d="M139.5 371L179.7 410.2C191 421.2 196.1 437.1 193.5 452.6L184 508L233.6 481.9C247.6 474.5 264.3 474.5 278.3 481.9L327.8 508L318.3 452.6C315.6 437 320.8 421.2 332.1 410.2L372.3 371L316.8 362.9C301.2 360.6 287.6 350.8 280.7 336.6L255.9 286.3L231.1 336.6C224.1 350.8 210.6 360.6 195 362.9L139.5 371z"/><path d="M389.8 216.3C391.1 220.9 395.3 224 400 224C404.7 224 408.9 220.9 410.2 216.3L424 168L472.3 154.2C476.9 152.9 480 148.7 480 144C480 139.3 476.9 135.1 472.3 133.8L424 120L410.2 71.7C408.9 67.1 404.8 64 400 64C395.2 64 391.1 67.1 389.8 71.7L376 120L327.7 133.8C323.1 135.1 320 139.3 320 144C320 148.7 323.1 152.9 327.7 154.2L376 168L389.8 216.3zM179.7 410.2L139.5 371L195 362.9C210.6 360.6 224.2 350.8 231.1 336.6L255.9 286.3L280.7 336.6C287.7 350.8 301.2 360.6 316.8 362.9L372.3 371L332.1 410.2C320.8 421.2 315.7 437.1 318.3 452.6L327.8 508L278.3 481.9C264.3 474.5 247.6 474.5 233.6 481.9L184 508L193.5 452.7C196.2 437.1 191 421.3 179.7 410.3zM234.4 221.4L188.1 315.4L84.6 330.5C64.9 333.3 57 357.5 71.3 371.4L146.2 444.6L128.5 547.9C125.1 567.5 145.7 582.5 163.3 573.2L255.9 524.4L348.5 573.2C366.1 582.5 386.7 567.5 383.3 547.9L365.6 444.6L440.5 371.4C454.7 357.5 446.9 333.3 427.2 330.5L323.7 315.4L277.4 221.4C268.6 203.5 243.1 203.5 234.3 221.4zM492.8 307.2L503.8 345.8C504.8 349.4 508.2 352 512 352C515.8 352 519.1 349.5 520.2 345.8L531.2 307.2L569.8 296.2C573.4 295.2 576 291.8 576 288C576 284.2 573.5 280.9 569.8 279.8L531.2 268.8L520.2 230.2C519.2 226.6 515.8 224 512 224C508.2 224 504.9 226.5 503.8 230.2L492.8 268.8L454.2 279.8C450.6 280.8 448 284.2 448 288C448 291.8 450.5 295.1 454.2 296.2L492.8 307.2z"/></svg>`,
|
||||
// 'template': ``,
|
||||
// 'list-check': ``,
|
||||
share: `<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 640 640"><!--!Font Awesome Pro v7.1.0 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license (Commercial License) Copyright 2025 Fonticons, Inc.--><path opacity=".4" d="M112 320C112 346.5 133.5 368 160 368C186.5 368 208 346.5 208 320C208 293.5 186.5 272 160 272C133.5 272 112 293.5 112 320zM400 160C400 186.5 421.5 208 448 208C474.5 208 496 186.5 496 160C496 133.5 474.5 112 448 112C421.5 112 400 133.5 400 160zM400 480C400 506.5 421.5 528 448 528C474.5 528 496 506.5 496 480C496 453.5 474.5 432 448 432C421.5 432 400 453.5 400 480z"/><path d="M496 160C496 133.5 474.5 112 448 112C421.5 112 400 133.5 400 160C400 186.5 421.5 208 448 208C474.5 208 496 186.5 496 160zM544 160C544 213 501 256 448 256C420.6 256 395.9 244.5 378.4 226.1L252.9 295.8C254.9 303.5 256 311.6 256 320C256 328.4 254.9 336.5 252.9 344.2L378.4 413.9C395.9 395.5 420.6 384 448 384C501 384 544 427 544 480C544 533 501 576 448 576C395 576 352 533 352 480C352 471.7 353.1 463.5 355.1 455.8L229.6 386.1C212.1 404.5 187.4 416 160 416C107 416 64 373 64 320C64 267 107 224 160 224C187.4 224 212.1 235.5 229.6 253.9L355.1 184.2C353.1 176.5 352 168.4 352 160C352 107 395 64 448 64C501 64 544 107 544 160zM208 320C208 293.5 186.5 272 160 272C133.5 272 112 293.5 112 320C112 346.5 133.5 368 160 368C186.5 368 208 346.5 208 320zM448 528C474.5 528 496 506.5 496 480C496 453.5 474.5 432 448 432C421.5 432 400 453.5 400 480C400 506.5 421.5 528 448 528z"/></svg>`,
|
||||
|
||||
@@ -12,6 +12,7 @@ export type NavItem = {
|
||||
description?: string;
|
||||
icon?: string;
|
||||
keywords?: string[];
|
||||
featured?: boolean;
|
||||
};
|
||||
|
||||
export type NavGroup = {
|
||||
@@ -199,6 +200,7 @@ export const SUB_NAV: Record<string, (NavItem | NavGroup)[]> = {
|
||||
label: 'IPv4 Subnet Calculator',
|
||||
description: 'Calculate subnet masks, network addresses, broadcast addresses, and host ranges',
|
||||
icon: 'subnet-calculator',
|
||||
featured: true,
|
||||
keywords: [
|
||||
'subnet',
|
||||
'calculator',
|
||||
@@ -263,6 +265,7 @@ export const SUB_NAV: Record<string, (NavItem | NavGroup)[]> = {
|
||||
label: 'CIDR → Mask',
|
||||
description: 'Convert CIDR notation (e.g. /24) to subnet mask format (255.255.255.0)',
|
||||
icon: 'cidr-convertor',
|
||||
featured: true,
|
||||
keywords: ['cidr', 'convert', 'converter', 'mask', 'subnet', 'notation', '/24', '255.255.255.0'],
|
||||
},
|
||||
{
|
||||
@@ -425,6 +428,7 @@ export const SUB_NAV: Record<string, (NavItem | NavGroup)[]> = {
|
||||
label: 'Contains (A ⊆ B)',
|
||||
description: 'Check if one IP set contains another',
|
||||
icon: 'containment',
|
||||
featured: true,
|
||||
keywords: [
|
||||
'set',
|
||||
'operations',
|
||||
@@ -733,6 +737,7 @@ export const SUB_NAV: Record<string, (NavItem | NavGroup)[]> = {
|
||||
label: 'MAC Address Converter',
|
||||
description: 'Convert MAC addresses between formats and identify manufacturer from OUI database',
|
||||
icon: 'mac-lookup',
|
||||
featured: true,
|
||||
keywords: [
|
||||
'mac',
|
||||
'address',
|
||||
@@ -1242,6 +1247,7 @@ export const SUB_NAV: Record<string, (NavItem | NavGroup)[]> = {
|
||||
label: 'DNS Query Performance',
|
||||
description: 'Compare DNS resolver speeds across multiple providers to find the fastest for your location',
|
||||
icon: 'zap',
|
||||
featured: true,
|
||||
keywords: [
|
||||
'dns',
|
||||
'performance',
|
||||
@@ -1421,6 +1427,7 @@ export const SUB_NAV: Record<string, (NavItem | NavGroup)[]> = {
|
||||
description:
|
||||
'Analyze TLS/SSL handshake timing breakdown with detailed phase information and certificate exchange',
|
||||
icon: 'handshake',
|
||||
featured: true,
|
||||
keywords: [
|
||||
'tls',
|
||||
'handshake',
|
||||
@@ -1439,6 +1446,7 @@ export const SUB_NAV: Record<string, (NavItem | NavGroup)[]> = {
|
||||
label: 'CT Log Search',
|
||||
description: 'Search Certificate Transparency logs to discover all certificates issued for a domain',
|
||||
icon: 'certificate',
|
||||
featured: true,
|
||||
keywords: [
|
||||
'ct',
|
||||
'certificate',
|
||||
|
||||
@@ -14,7 +14,7 @@ export interface ToolUsage {
|
||||
const STORAGE_KEY = 'networking-toolbox-tool-usage';
|
||||
|
||||
const thresholdVisits = 4;
|
||||
const maxItems = 6;
|
||||
const maxItems = 12;
|
||||
|
||||
function createToolUsageStore() {
|
||||
const { subscribe, set, update } = writable<ToolUsage>({});
|
||||
|
||||
@@ -0,0 +1,5 @@
|
||||
<script lang="ts">
|
||||
import HomepageSearch from '$lib/components/home/HomepageSearch.svelte';
|
||||
</script>
|
||||
|
||||
<HomepageSearch />
|
||||
Reference in new issue
Block a user