mirror of
https://github.com/lissy93/networking-toolbox.git
synced 2026-11-29 00:29:44 +03:00
Improved home layouts, theme performance, and made about page more minimilistic
This commit is contained in:
1 parent
48a36d9be1
commit
85ec71db50
16 files changed
+233
-138
No files matched your search
@@ -3,6 +3,29 @@
|
||||
<head>
|
||||
<meta charset="utf-8" />
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1" />
|
||||
|
||||
<!-- Prevent FOUC by applying theme before page renders -->
|
||||
<script>
|
||||
(function () {
|
||||
try {
|
||||
// Apply theme
|
||||
const theme = localStorage.getItem('theme') || 'dark';
|
||||
if (theme !== 'dark') {
|
||||
document.documentElement.classList.add('theme-' + theme);
|
||||
}
|
||||
|
||||
// Store other preferences as data attributes for initial render
|
||||
const homepageLayout = localStorage.getItem('homepage-layout') || 'categories';
|
||||
const navbarDisplay = localStorage.getItem('navbar-display') || 'default';
|
||||
|
||||
document.documentElement.setAttribute('data-initial-layout', homepageLayout);
|
||||
document.documentElement.setAttribute('data-initial-navbar', navbarDisplay);
|
||||
} catch (e) {
|
||||
// Ignore localStorage errors (private browsing, etc.)
|
||||
}
|
||||
})();
|
||||
</script>
|
||||
|
||||
%sveltekit.head%
|
||||
</head>
|
||||
<body data-sveltekit-preload-data="hover">
|
||||
|
||||
@@ -350,7 +350,7 @@
|
||||
color: var(--text-tertiary);
|
||||
background: var(--bg-tertiary);
|
||||
padding: var(--spacing-xs) var(--spacing-sm);
|
||||
border-radius: var(--radius-full);
|
||||
border-radius: var(--radius-sm);
|
||||
font-weight: 500;
|
||||
}
|
||||
|
||||
|
||||
@@ -12,8 +12,7 @@
|
||||
|
||||
let { toolPages, referencePages }: Props = $props();
|
||||
|
||||
const allPages = $derived([...toolPages, ...referencePages]);
|
||||
const search = useToolSearch(allPages);
|
||||
const search = useToolSearch(() => [...toolPages, ...referencePages]);
|
||||
</script>
|
||||
|
||||
<!-- Minimal Hero Section -->
|
||||
|
||||
@@ -1,6 +1,12 @@
|
||||
<script lang="ts">
|
||||
import { author } from '$lib/constants/site';
|
||||
|
||||
interface Props {
|
||||
longMode?: boolean;
|
||||
}
|
||||
|
||||
let { longMode = false }: Props = $props();
|
||||
|
||||
const moreApps = [
|
||||
{
|
||||
name: 'domain-locker',
|
||||
@@ -49,7 +55,7 @@
|
||||
|
||||
<section id="author">
|
||||
<h2>Author</h2>
|
||||
<h3>About Me</h3>
|
||||
{#if longMode}<h3>About Me</h3>{/if}
|
||||
<div class="author-section">
|
||||
<div class="author-bio">
|
||||
<p>
|
||||
@@ -65,48 +71,50 @@
|
||||
</div>
|
||||
<img class="profile-photo" src={author.avatar} alt={author.name} width="128" />
|
||||
</div>
|
||||
<div class="link-button blue">
|
||||
<a href="https://aliciasykes.com" target="_blank">Website</a>
|
||||
</div>
|
||||
|
||||
<h3>Sponsorship</h3>
|
||||
<p>
|
||||
I have developed, open sourced and maintain 100+ applications and libraries, used by over 1 million people every
|
||||
year. And pretty much everything I build is free to use, open source, and without ads, tracking or paywalls. Because
|
||||
I believe software should be free and accessible to everyone.
|
||||
<br /><br />
|
||||
But running these projects does cost money. And maintaining them takes time. So, if you've found this app useful, please
|
||||
consider <a href={author.sponsor} target="_blank" rel="noopener noreferrer">sponsoring me</a>. My sponsors mean the
|
||||
world to me, and it's because of their generosity that this app can remain free for everyone.
|
||||
</p>
|
||||
<div class="link-button pink">
|
||||
<a href="https://github.com/sponsors/lissy93" target="_blank">Sponsor</a>
|
||||
</div>
|
||||
|
||||
<h3 id="more-apps">More Apps</h3>
|
||||
<p>If you've found this app useful, you might also like some of my other projects:</p>
|
||||
<div class="more-app-list">
|
||||
<div class="links-grid">
|
||||
{#each moreApps as app (app.name)}
|
||||
<a
|
||||
class="link-card"
|
||||
style="--app-color: {app.color}"
|
||||
href="https://github.com/lissy93/{app.name}"
|
||||
target="_blank"
|
||||
rel="noopener noreferrer"
|
||||
>
|
||||
<h4>{app.title}</h4>
|
||||
<div class="right">
|
||||
<img src={app.icon} alt={app.title} width="40" height="40" />
|
||||
<p>{app.description}</p>
|
||||
</div>
|
||||
</a>
|
||||
{/each}
|
||||
{#if longMode}
|
||||
<div class="link-button blue">
|
||||
<a href="https://aliciasykes.com" target="_blank">Website</a>
|
||||
</div>
|
||||
</div>
|
||||
<div class="link-button purple">
|
||||
<a href="https://lissy93.github.io" target="_blank">More Apps</a>
|
||||
</div>
|
||||
{/if}
|
||||
{#if longMode}
|
||||
<h3>Sponsorship</h3>
|
||||
<p>
|
||||
I have developed, open sourced and maintain 100+ applications and libraries, used by over 1 million people every
|
||||
year. And pretty much everything I build is free to use, open source, and without ads, tracking or paywalls.
|
||||
Because I believe software should be free and accessible to everyone.
|
||||
<br /><br />
|
||||
But running these projects does cost money. And maintaining them takes time. So, if you've found this app useful, please
|
||||
consider <a href={author.sponsor} target="_blank" rel="noopener noreferrer">sponsoring me</a>. My sponsors mean
|
||||
the world to me, and it's because of their generosity that this app can remain free for everyone.
|
||||
</p>
|
||||
<div class="link-button pink">
|
||||
<a href="https://github.com/sponsors/lissy93" target="_blank">Sponsor</a>
|
||||
</div>
|
||||
|
||||
<h3 id="more-apps">More Apps</h3>
|
||||
<p>If you've found this app useful, you might also like some of my other projects:</p>
|
||||
<ul class="more-app-list">
|
||||
{#each moreApps as app (app.name)}
|
||||
<li class="app-item">
|
||||
<img src={app.icon} alt={app.title} width="24" height="24" />
|
||||
<div class="app-content">
|
||||
<a
|
||||
href="https://github.com/lissy93/{app.name}"
|
||||
target="_blank"
|
||||
rel="noopener noreferrer"
|
||||
style="--app-color: {app.color}"
|
||||
>
|
||||
{app.title}
|
||||
</a>
|
||||
<span class="app-description">{app.description}</span>
|
||||
</div>
|
||||
</li>
|
||||
{/each}
|
||||
</ul>
|
||||
<div class="link-button purple">
|
||||
<a href="https://lissy93.github.io" target="_blank">More Apps</a>
|
||||
</div>
|
||||
{/if}
|
||||
</section>
|
||||
|
||||
<style lang="scss">
|
||||
@@ -129,36 +137,42 @@
|
||||
}
|
||||
|
||||
.more-app-list {
|
||||
.links-grid {
|
||||
grid-template-columns: repeat(auto-fit, minmax(330px, 1fr));
|
||||
|
||||
.link-card {
|
||||
border-width: 2px;
|
||||
list-style: none;
|
||||
padding: 0;
|
||||
margin: var(--spacing-md) 0 0 0;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
gap: var(--spacing-sm);
|
||||
.app-item {
|
||||
display: flex;
|
||||
align-items: flex-start;
|
||||
gap: var(--spacing-sm);
|
||||
img {
|
||||
flex-shrink: 0;
|
||||
border-radius: var(--radius-sm);
|
||||
}
|
||||
.app-content {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
align-items: flex-start;
|
||||
align-items: center;
|
||||
gap: var(--spacing-sm);
|
||||
padding: var(--spacing-md);
|
||||
|
||||
h4 {
|
||||
font-size: var(--font-size-lg);
|
||||
margin: 0;
|
||||
}
|
||||
a {
|
||||
font-weight: 600;
|
||||
font-size: var(--font-size-md);
|
||||
text-decoration: none;
|
||||
transition: opacity var(--transition-fast);
|
||||
color: var(--app-color);
|
||||
|
||||
.right {
|
||||
display: flex;
|
||||
flex-direction: row;
|
||||
align-items: center;
|
||||
gap: var(--spacing-md);
|
||||
}
|
||||
|
||||
&:hover {
|
||||
border-color: var(--app-color, var(--color-primary));
|
||||
|
||||
h4 {
|
||||
color: var(--app-color, var(--color-primary));
|
||||
&:hover {
|
||||
text-decoration: underline;
|
||||
}
|
||||
}
|
||||
|
||||
.app-description {
|
||||
color: var(--text-secondary);
|
||||
font-size: var(--font-size-sm);
|
||||
line-height: 1.5;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -14,7 +14,6 @@
|
||||
<code>git clone git@github.com:Lissy93/networking-toolbox.git</code>
|
||||
<code>cd networking-toolbox</code>
|
||||
<code>npm install</code>
|
||||
<code>npm start</code>
|
||||
</div>
|
||||
|
||||
<h3>Dev</h3>
|
||||
@@ -24,9 +23,7 @@
|
||||
|
||||
<h3>Check 'n Test</h3>
|
||||
<div class="code">
|
||||
<code>npm run test</code>
|
||||
<code>npm run tsc</code>
|
||||
<code>npm run lint</code>
|
||||
<code>npm run hold-my-beer</code>
|
||||
</div>
|
||||
<!--
|
||||
<h3>Deploying</h3>
|
||||
|
||||
@@ -1,5 +1,11 @@
|
||||
<script lang="ts">
|
||||
import { site, author, license } from '$lib/constants/site';
|
||||
|
||||
interface Props {
|
||||
longMode?: boolean;
|
||||
}
|
||||
|
||||
let { longMode = false }: Props = $props();
|
||||
</script>
|
||||
|
||||
<section id="license">
|
||||
@@ -12,34 +18,37 @@
|
||||
{license.date}
|
||||
</p>
|
||||
|
||||
<h3>Conditions</h3>
|
||||
<ul class="license-tldr">
|
||||
<li class="license-tldr-item can">
|
||||
<div class="item-head">You Can</div>
|
||||
<ul>
|
||||
<li>Use commercially</li>
|
||||
<li>Modify the code</li>
|
||||
<li>Distribute the code</li>
|
||||
<li>Sublicense the app</li>
|
||||
</ul>
|
||||
</li>
|
||||
<li class="license-tldr-item cannot">
|
||||
<div class="item-head">You Cannot</div>
|
||||
<ul>
|
||||
<li>Hold the author liable</li>
|
||||
</ul>
|
||||
</li>
|
||||
<li class="license-tldr-item must">
|
||||
<div class="item-head">You Must</div>
|
||||
<ul>
|
||||
<li>Include the original copyright</li>
|
||||
<li>Include the below license in full</li>
|
||||
</ul>
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
<h3>Full License</h3>
|
||||
{#if longMode}
|
||||
<h3>Conditions</h3>
|
||||
<ul class="license-tldr">
|
||||
<li class="license-tldr-item can">
|
||||
<div class="item-head">You Can</div>
|
||||
<ul>
|
||||
<li>Use commercially</li>
|
||||
<li>Modify the code</li>
|
||||
<li>Distribute the code</li>
|
||||
<li>Sublicense the app</li>
|
||||
</ul>
|
||||
</li>
|
||||
<li class="license-tldr-item cannot">
|
||||
<div class="item-head">You Cannot</div>
|
||||
<ul>
|
||||
<li>Hold the author liable</li>
|
||||
</ul>
|
||||
</li>
|
||||
<li class="license-tldr-item must">
|
||||
<div class="item-head">You Must</div>
|
||||
<ul>
|
||||
<li>Include the original copyright</li>
|
||||
<li>Include the below license in full</li>
|
||||
</ul>
|
||||
</li>
|
||||
</ul>
|
||||
{/if}
|
||||
|
||||
{#if longMode}
|
||||
<h3>Full License</h3>
|
||||
{/if}
|
||||
<pre class="license-content">
|
||||
Copyright (c) 2025 Alicia Sykes [aliciasykes.com]
|
||||
|
||||
|
||||
@@ -17,4 +17,18 @@
|
||||
<a href="https://hub.docker.com/r/lissy93/networking-toolbox"><code>lissy93/networking-toolbox</code></a> image from
|
||||
DockerHub.
|
||||
</p>
|
||||
<blockquote>
|
||||
<b>Not using Docker, or don't have a server?</b>
|
||||
We support other free hosting options, just take a look at our <a href="/about/deploying">Deployment Docs</a>.
|
||||
</blockquote>
|
||||
</section>
|
||||
|
||||
<style>
|
||||
blockquote {
|
||||
border-left: 2px solid var(--color-info);
|
||||
padding: var(--spacing-sm) var(--spacing-sm) var(--spacing-sm) var(--spacing-lg);
|
||||
background: color-mix(in srgb, var(--color-info), transparent 90%);
|
||||
border-radius: var(--radius-sm);
|
||||
margin-top: var(--spacing-md);
|
||||
}
|
||||
</style>
|
||||
@@ -2,17 +2,18 @@ import type { NavItem } from '$lib/constants/nav';
|
||||
|
||||
/**
|
||||
* Composable for searching and filtering tools
|
||||
* @param tools Array of tools to search through
|
||||
* @param getTools Function that returns the array of tools to search through
|
||||
* @returns Object with query and filtered state that can be bound
|
||||
*/
|
||||
export function useToolSearch(tools: NavItem[]) {
|
||||
export function useToolSearch(getTools: () => NavItem[]) {
|
||||
const state = $state({
|
||||
query: '',
|
||||
filtered: tools,
|
||||
filtered: getTools(),
|
||||
});
|
||||
|
||||
// Update filtered whenever query or tools change
|
||||
$effect(() => {
|
||||
const tools = getTools();
|
||||
if (!state.query.trim()) {
|
||||
state.filtered = tools;
|
||||
} else {
|
||||
|
||||
@@ -69,23 +69,32 @@ export const homepageLayoutOptions: HomepageLayoutOption[] = [
|
||||
},
|
||||
];
|
||||
|
||||
// Get initial value from data attribute or localStorage (runs immediately on import)
|
||||
function getInitialLayout(): HomepageLayoutMode {
|
||||
if (typeof window !== 'undefined') {
|
||||
try {
|
||||
const dataAttr = document.documentElement.getAttribute('data-initial-layout');
|
||||
const stored = dataAttr || localStorage.getItem('homepage-layout');
|
||||
const isValidMode = homepageLayoutOptions.some((option) => option.id === stored);
|
||||
return isValidMode ? (stored as HomepageLayoutMode) : 'categories';
|
||||
} catch {
|
||||
return 'categories';
|
||||
}
|
||||
}
|
||||
return 'categories';
|
||||
}
|
||||
|
||||
function createHomepageLayoutStore() {
|
||||
const { subscribe, set } = writable<HomepageLayoutMode>('categories');
|
||||
const { subscribe, set } = writable<HomepageLayoutMode>(getInitialLayout());
|
||||
|
||||
return {
|
||||
subscribe,
|
||||
|
||||
// Initialize from localStorage or default
|
||||
// Note: Store is already initialized with correct value on creation,
|
||||
// this is kept for backwards compatibility and does nothing
|
||||
init: () => {
|
||||
if (browser) {
|
||||
const stored = localStorage.getItem(STORAGE_KEY);
|
||||
const isValidMode = homepageLayoutOptions.some((option) => option.id === stored);
|
||||
const initialMode = isValidMode ? (stored as HomepageLayoutMode) : 'categories';
|
||||
|
||||
set(initialMode);
|
||||
return initialMode;
|
||||
}
|
||||
return 'categories';
|
||||
return getInitialLayout();
|
||||
},
|
||||
|
||||
// Set homepage layout mode and persist to localStorage
|
||||
|
||||
@@ -35,23 +35,32 @@ export const navbarDisplayOptions: NavbarDisplayOption[] = [
|
||||
},
|
||||
];
|
||||
|
||||
// Get initial value from data attribute or localStorage (runs immediately on import)
|
||||
function getInitialNavbarDisplay(): NavbarDisplayMode {
|
||||
if (typeof window !== 'undefined') {
|
||||
try {
|
||||
const dataAttr = document.documentElement.getAttribute('data-initial-navbar');
|
||||
const stored = dataAttr || localStorage.getItem('navbar-display');
|
||||
const isValidMode = navbarDisplayOptions.some((option) => option.id === stored);
|
||||
return isValidMode ? (stored as NavbarDisplayMode) : 'default';
|
||||
} catch {
|
||||
return 'default';
|
||||
}
|
||||
}
|
||||
return 'default';
|
||||
}
|
||||
|
||||
function createNavbarDisplayStore() {
|
||||
const { subscribe, set } = writable<NavbarDisplayMode>('default');
|
||||
const { subscribe, set } = writable<NavbarDisplayMode>(getInitialNavbarDisplay());
|
||||
|
||||
return {
|
||||
subscribe,
|
||||
|
||||
// Initialize from localStorage or default
|
||||
// Note: Store is already initialized with correct value on creation,
|
||||
// this is kept for backwards compatibility and does nothing
|
||||
init: () => {
|
||||
if (browser) {
|
||||
const stored = localStorage.getItem(STORAGE_KEY);
|
||||
const isValidMode = navbarDisplayOptions.some((option) => option.id === stored);
|
||||
const initialMode = isValidMode ? (stored as NavbarDisplayMode) : 'default';
|
||||
|
||||
set(initialMode);
|
||||
return initialMode;
|
||||
}
|
||||
return 'default';
|
||||
return getInitialNavbarDisplay();
|
||||
},
|
||||
|
||||
// Set navbar display mode and persist to localStorage
|
||||
|
||||
+16
-2
@@ -42,13 +42,27 @@ function loadCustomFont(fontConfig: { name: string; url: string; fallback?: stri
|
||||
function applyThemeClasses(theme: ThemeOption) {
|
||||
if (!browser) return;
|
||||
|
||||
const targetClass = theme !== 'dark' ? `theme-${theme}` : null;
|
||||
|
||||
// Check if the theme is already applied (prevents flash from re-applying)
|
||||
const currentThemeClass = Array.from(document.documentElement.classList).find((cls) => cls.startsWith('theme-'));
|
||||
|
||||
if (currentThemeClass === targetClass) {
|
||||
// Theme already applied, just ensure font is loaded
|
||||
const themeConfig = themes.find((t) => t.id === theme);
|
||||
if (themeConfig?.font) {
|
||||
loadCustomFont(themeConfig.font);
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
// Remove all existing theme classes
|
||||
const allThemeClasses = themes.map((t) => `theme-${t.id}`);
|
||||
document.documentElement.classList.remove(...allThemeClasses);
|
||||
|
||||
// Add the current theme class (except for default 'dark' theme)
|
||||
if (theme !== 'dark') {
|
||||
document.documentElement.classList.add(`theme-${theme}`);
|
||||
if (targetClass) {
|
||||
document.documentElement.classList.add(targetClass);
|
||||
}
|
||||
|
||||
// Load custom font if the theme has one
|
||||
|
||||
@@ -2,4 +2,4 @@
|
||||
import LicenseSection from '$lib/components/page-specific/about/LicenseSection.svelte';
|
||||
</script>
|
||||
|
||||
<LicenseSection />
|
||||
<LicenseSection longMode={true} />
|
||||
@@ -1,14 +1,23 @@
|
||||
<script>
|
||||
import { page } from '$app/stores';
|
||||
import '../../styles/page-specific/about-page.scss';
|
||||
|
||||
let { children } = $props();
|
||||
|
||||
const isLicensePage = $derived($page.url.pathname.includes('/license'));
|
||||
</script>
|
||||
|
||||
<main class="card about-content">
|
||||
<slot />
|
||||
<main class="card about-content" class:license-page={isLicensePage}>
|
||||
{@render children()}
|
||||
</main>
|
||||
|
||||
<style lang="scss">
|
||||
.about-content {
|
||||
max-width: 1200px;
|
||||
margin: 0 auto;
|
||||
|
||||
&.license-page {
|
||||
width: fit-content;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
@@ -1,8 +1,6 @@
|
||||
<script lang="ts">
|
||||
import '../../styles/pages.scss';
|
||||
import { author, site } from '$lib/constants/site';
|
||||
import ToolsCarousel from '$lib/components/global/ToolsCarousel.svelte';
|
||||
import { SUB_NAV } from '$lib/constants/nav';
|
||||
|
||||
// Import section components
|
||||
import ApiSection from '$lib/components/page-specific/about/ApiSection.svelte';
|
||||
@@ -30,9 +28,6 @@
|
||||
network-related tasks for system administrators and network engineers.
|
||||
</p>
|
||||
</div>
|
||||
<section>
|
||||
<ToolsCarousel sections={SUB_NAV} speedBase={36} gap="var(--spacing-sm)" pauseOnHover reverseAlternate />
|
||||
</section>
|
||||
<!-- Links #1: GitHub -->
|
||||
<!-- Links #1: Live Demo, DockerHub, CodeBerg Mirror, Sponsor, More Apps -->
|
||||
<section class="contents">
|
||||
@@ -61,8 +56,8 @@
|
||||
<ApiSection />
|
||||
<SelfHostingSection />
|
||||
<BuildingSection />
|
||||
<AuthorSection />
|
||||
<AttributionsSection />
|
||||
<AuthorSection />
|
||||
<LicenseSection />
|
||||
|
||||
<style lang="scss">
|
||||
|
||||
@@ -108,7 +108,7 @@ ul {
|
||||
width: 100%;
|
||||
display: flex;
|
||||
justify-content: end;
|
||||
margin-top: var(--spacing-md);
|
||||
margin-top: var(--spacing-xs);
|
||||
|
||||
a {
|
||||
color: var(--bg-secondary);
|
||||
@@ -123,6 +123,7 @@ ul {
|
||||
box-shadow 0.3s;
|
||||
min-width: 7.5rem;
|
||||
text-align: center;
|
||||
background: var(--bg-tertiary);
|
||||
|
||||
&:hover {
|
||||
filter: brightness(1.1);
|
||||
@@ -132,12 +133,12 @@ ul {
|
||||
}
|
||||
|
||||
&.purple a {
|
||||
background: var(--color-purple);
|
||||
color: var(--color-purple);
|
||||
}
|
||||
&.pink a {
|
||||
background: var(--color-pink);
|
||||
color: var(--color-pink);
|
||||
}
|
||||
&.blue a {
|
||||
background: var(--color-info);
|
||||
color: var(--color-info);
|
||||
}
|
||||
}
|
||||
@@ -44,6 +44,7 @@
|
||||
--radius-sm: 4px;
|
||||
--radius-md: 6px;
|
||||
--radius-lg: 8px;
|
||||
--radius-full: 50%;
|
||||
|
||||
/* Spacing */
|
||||
--spacing-2xs: 0.125rem;
|
||||
|
||||
Reference in new issue
Block a user