Skip to content

Commit 7bf3894

Browse files
lollipopkitCopilot
andcommitted
opt.
Co-authored-by: Copilot <copilot@github.com>
1 parent 3c22a46 commit 7bf3894

8 files changed

Lines changed: 49 additions & 303 deletions

File tree

website/index.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
<html lang="en">
33
<head>
44
<meta charset="UTF-8" />
5-
<link rel="icon" type="image/svg+xml" href="/favicon.svg" />
5+
<link rel="icon" type="image/png" href="/app_icon.png" />
66
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
77
<meta
88
name="description"

website/public/app_icon.png

15 KB
Loading

website/public/favicon.svg

Lines changed: 0 additions & 13 deletions
This file was deleted.

website/src/App.svelte

Lines changed: 35 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,6 @@
11
<script>
22
import {
3-
Apple,
4-
Archive,
5-
Download,
63
ExternalLink,
7-
Package,
8-
Store,
94
} from '@lucide/svelte'
105
import { spring } from 'svelte/motion'
116
import { onMount } from 'svelte'
@@ -38,32 +33,36 @@
3833
const downloadGroups = [
3934
{
4035
key: 'iosMacos',
36+
label: 'iOS / macOS',
4137
sources: [
42-
{ key: 'appStore', href: 'https://apps.apple.com/app/id1586449703', Icon: Apple },
43-
{ key: 'homebrew', command: 'brew install --cask server-box', Icon: Package },
38+
{ label: 'App Store', href: 'https://apps.apple.com/app/id1586449703' },
39+
{ label: 'Homebrew Cask', command: 'brew install --cask server-box' },
4440
],
4541
},
4642
{
4743
key: 'android',
44+
label: 'Android',
4845
sources: [
49-
{ key: 'github', href: 'https://github.com/lollipopkit/flutter_server_box/releases', Icon: Download },
50-
{ key: 'cdn', href: 'https://cdn.lpkt.cn/serverbox/pkg/?sort=time&order=desc&layout=grid', Icon: Archive },
51-
{ key: 'fdroid', href: 'https://f-droid.org/packages/tech.lolli.toolbox', Icon: Store },
52-
{ key: 'openapk', href: 'https://www.openapk.net/serverbox/tech.lolli.toolbox/', Icon: Package },
46+
{ label: 'GitHub Releases', href: 'https://github.com/lollipopkit/flutter_server_box/releases' },
47+
{ label: 'CDN', href: 'https://cdn.lpkt.cn/serverbox/pkg/?sort=time&order=desc&layout=grid' },
48+
{ label: 'F-Droid', href: 'https://f-droid.org/packages/tech.lolli.toolbox' },
49+
{ label: 'OpenAPK', href: 'https://www.openapk.net/serverbox/tech.lolli.toolbox/' },
5350
],
5451
},
5552
{
5653
key: 'linux',
54+
label: 'Linux',
5755
sources: [
58-
{ key: 'github', href: 'https://github.com/lollipopkit/flutter_server_box/releases', Icon: Download },
59-
{ key: 'cdn', href: 'https://cdn.lpkt.cn/serverbox/pkg/?sort=time&order=desc&layout=grid', Icon: Archive },
56+
{ label: 'GitHub Releases', href: 'https://github.com/lollipopkit/flutter_server_box/releases' },
57+
{ label: 'CDN', href: 'https://cdn.lpkt.cn/serverbox/pkg/?sort=time&order=desc&layout=grid' },
6058
],
6159
},
6260
{
6361
key: 'windows',
62+
label: 'Windows',
6463
sources: [
65-
{ key: 'github', href: 'https://github.com/lollipopkit/flutter_server_box/releases', Icon: Download },
66-
{ key: 'cdn', href: 'https://cdn.lpkt.cn/serverbox/pkg/?sort=time&order=desc&layout=grid', Icon: Archive },
64+
{ label: 'GitHub Releases', href: 'https://github.com/lollipopkit/flutter_server_box/releases' },
65+
{ label: 'CDN', href: 'https://cdn.lpkt.cn/serverbox/pkg/?sort=time&order=desc&layout=grid' },
6766
],
6867
},
6968
]
@@ -136,6 +135,14 @@
136135
stackMotion.set({ x: 0, y: 0 })
137136
}
138137
138+
function scrollToSection(event, id) {
139+
event.preventDefault()
140+
document.getElementById(id)?.scrollIntoView({
141+
behavior: 'smooth',
142+
block: 'start',
143+
})
144+
}
145+
139146
async function copyCommand(command) {
140147
try {
141148
await navigator.clipboard.writeText(command)
@@ -152,10 +159,11 @@
152159
{#if locale && isMounted}
153160
<main class="site">
154161
<header class="site-nav" id="top">
155-
<a class="brand" href="#top">ServerBox</a>
162+
<a class="brand" href="#top" onclick={(event) => scrollToSection(event, 'top')}>ServerBox</a>
156163
<nav>
157-
<a href="#features">{$LL.nav.features()}</a>
158-
<a href="#capabilities">{$LL.nav.capabilities()}</a>
164+
<a href="#features" onclick={(event) => scrollToSection(event, 'features')}>{$LL.nav.features()}</a>
165+
<a href="#capabilities" onclick={(event) => scrollToSection(event, 'capabilities')}>{$LL.nav.capabilities()}</a>
166+
<a href="#download" onclick={(event) => scrollToSection(event, 'download')}>{$LL.nav.download()}</a>
159167
</nav>
160168
<div class="nav-actions">
161169
<label class="language-switcher">
@@ -181,8 +189,8 @@
181189
{$LL.hero.subtitle()}
182190
</p>
183191
<div class="hero-actions">
184-
<a class="btn btn-primary" href="#download">{$LL.hero.primaryAction()}</a>
185-
<a class="btn btn-secondary" href="#features">{$LL.hero.secondaryAction()}</a>
192+
<a class="btn btn-primary" href="#download" onclick={(event) => scrollToSection(event, 'download')}>{$LL.hero.primaryAction()}</a>
193+
<a class="btn btn-secondary" href="#features" onclick={(event) => scrollToSection(event, 'features')}>{$LL.hero.secondaryAction()}</a>
186194
</div>
187195
188196
<div
@@ -251,25 +259,22 @@
251259
{#each downloadGroups as group}
252260
<article class="download-platform">
253261
<div class="download-platform-copy">
254-
<h3>{$LL.download.platforms[group.key].title()}</h3>
255-
<p>{$LL.download.platforms[group.key].description()}</p>
262+
<h3>{group.label}</h3>
256263
</div>
257264
<div class="download-actions">
258265
{#each group.sources as source}
259266
{#if source.command}
260267
<button
261268
class="download-icon-btn"
262269
type="button"
263-
aria-label={`${$LL.download.platforms[group.key].title()} ${$LL.download.sources[source.key].name()}`}
270+
aria-label={`${group.label} ${source.label}`}
264271
onclick={() => copyCommand(source.command)}
265272
>
266-
<source.Icon size={17} strokeWidth={1.8} aria-hidden="true" />
267-
<span>{copiedCommand === source.command ? $LL.download.copied() : $LL.download.sources[source.key].name()}</span>
273+
<span>{copiedCommand === source.command ? $LL.download.copied() : source.label}</span>
268274
</button>
269275
{:else}
270-
<a class="download-icon-btn" href={source.href} aria-label={`${$LL.download.platforms[group.key].title()} ${$LL.download.sources[source.key].name()}`}>
271-
<source.Icon size={17} strokeWidth={1.8} aria-hidden="true" />
272-
<span>{$LL.download.sources[source.key].name()}</span>
276+
<a class="download-icon-btn" href={source.href} aria-label={`${group.label} ${source.label}`}>
277+
<span>{source.label}</span>
273278
<ExternalLink size={14} strokeWidth={1.8} aria-hidden="true" />
274279
</a>
275280
{/if}
@@ -298,8 +303,8 @@
298303
<footer class="site-footer">
299304
<span>© 2026 ServerBox</span>
300305
<div class="footer-links">
301-
<a href="#features">{$LL.footer.features()}</a>
302-
<a href="#capabilities">{$LL.footer.capabilities()}</a>
306+
<a href="#features" onclick={(event) => scrollToSection(event, 'features')}>{$LL.footer.features()}</a>
307+
<a href="#capabilities" onclick={(event) => scrollToSection(event, 'capabilities')}>{$LL.footer.capabilities()}</a>
303308
<a href="https://github.com/lollipopkit/flutter_server_box">GitHub</a>
304309
<a href="https://github.com/lollipopkit/flutter_server_box/releases">{$LL.footer.releases()}</a>
305310
</div>

website/src/app.css

Lines changed: 8 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,10 @@ body {
6969
max-width: 100%;
7070
}
7171

72+
[id] {
73+
scroll-margin-top: 6rem;
74+
}
75+
7276
.site-nav {
7377
position: sticky;
7478
top: 1.5rem;
@@ -496,9 +500,10 @@ body {
496500

497501
.download-platform {
498502
display: grid;
499-
grid-template-columns: minmax(190px, 0.8fr) minmax(0, 1.4fr);
500-
gap: 1.5rem;
501-
padding: 1.35rem 0;
503+
grid-template-columns: minmax(130px, 0.45fr) minmax(0, 1.55fr);
504+
align-items: center;
505+
gap: 1rem;
506+
padding: 1rem 0;
502507
border-bottom: 1px solid var(--light-gray);
503508
}
504509

@@ -509,13 +514,6 @@ body {
509514
color: var(--black);
510515
}
511516

512-
.download-platform-copy p {
513-
margin-top: 0.45rem;
514-
color: var(--stone);
515-
font-size: 0.9rem;
516-
line-height: 1.55;
517-
}
518-
519517
.download-actions {
520518
display: flex;
521519
align-items: center;

website/src/i18n/en/index.ts

Lines changed: 1 addition & 43 deletions
Original file line numberDiff line numberDiff line change
@@ -70,50 +70,8 @@ const en: BaseTranslation = {
7070
subtitle:
7171
'Choose the channel that matches your device and trust model. iOS and macOS use the App Store; Android, Linux, and Windows also have direct package downloads.',
7272
copied: 'Install command copied',
73-
platforms: {
74-
iosMacos: {
75-
title: 'iOS / macOS',
76-
description:
77-
'Use the App Store build for Apple platforms, or install the macOS-only Homebrew cask.',
78-
},
79-
android: {
80-
title: 'Android',
81-
description:
82-
'Install from GitHub Releases, the project CDN, F-Droid, or OpenAPK depending on how you manage Android packages.',
83-
},
84-
linux: {
85-
title: 'Linux',
86-
description:
87-
'Download desktop packages from GitHub Releases or the project CDN.',
88-
},
89-
windows: {
90-
title: 'Windows',
91-
description:
92-
'Download Windows packages from GitHub Releases or the project CDN.',
93-
},
94-
},
95-
sources: {
96-
appStore: {
97-
name: 'App Store',
98-
},
99-
homebrew: {
100-
name: 'Homebrew Cask',
101-
},
102-
github: {
103-
name: 'GitHub Releases',
104-
},
105-
cdn: {
106-
name: 'Project CDN',
107-
},
108-
fdroid: {
109-
name: 'F-Droid',
110-
},
111-
openapk: {
112-
name: 'OpenAPK',
113-
},
114-
},
11573
note:
116-
'Homebrew supports macOS only: brew install --cask server-box. Only download packages from a source you trust. For server-side push, widgets, and companion monitoring, install ServerBoxMonitor separately on your servers.',
74+
'Only download packages from a source you trust. For server-side push, widgets, and companion monitoring, install ServerBoxMonitor separately on your servers.',
11775
},
11876
cta: {
11977
title: 'ServerBox is free and open source under AGPLv3.',

0 commit comments

Comments
 (0)