Skip to content
This repository was archived by the owner on Jul 28, 2026. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

7 changes: 5 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,10 @@
"trailingComma": "es5",
"tabWidth": 4,
"semi": false,
"singleQuote": true
"singleQuote": true,
"plugins": [
"prettier-plugin-svelte"
]
},
"lint-staged": {
"*.{js,ts,svelte}": [
Expand All @@ -67,7 +70,7 @@
},
"dependencies": {
"@deltablot/dropzone": "^7.4.3",
"@e4a/pg-js": "^1.3.0",
"@e4a/pg-js": "^1.4.0",
"@iconify/svelte": "^5.2.1",
"@privacybydesign/yivi-css": "^1.0.0-beta.4",
"country-flag-icons": "^1.6.17",
Expand Down
22 changes: 13 additions & 9 deletions src/lib/components/Chip.svelte
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
<script lang="ts">
interface props {
text: string;
onclick?: () => void;
size?: 'sm' | 'md' | 'lg';
variant?: 'default' | 'filled' | 'dark';
icon?: '+' | '×' | null;
disabled?: boolean;
text: string
onclick?: () => void
size?: 'sm' | 'md' | 'lg'
variant?: 'default' | 'filled' | 'dark'
icon?: '+' | '×' | null
disabled?: boolean
}

let {
Expand All @@ -14,7 +14,7 @@
size = 'md',
variant = 'default',
icon = null,
disabled = false
disabled = false,
}: props = $props()

let isInteractive = $derived(onclick !== undefined)
Expand All @@ -33,7 +33,9 @@
{disabled}
type="button"
>
{#if icon}<span class="chip-icon">{icon}</span>{/if}<span class="chip-text">{text}</span>
{#if icon}<span class="chip-icon">{icon}</span>{/if}<span
class="chip-text">{text}</span
>
</button>
{:else}
<span
Expand All @@ -45,7 +47,9 @@
class:chip-filled={variant === 'filled'}
class:chip-dark={variant === 'dark'}
>
{#if icon}<span class="chip-icon">{icon}</span>{/if}<span class="chip-text">{text}</span>
{#if icon}<span class="chip-icon">{icon}</span>{/if}<span
class="chip-text">{text}</span
>
</span>
{/if}

Expand Down
215 changes: 115 additions & 100 deletions src/lib/components/Header.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -19,17 +19,31 @@
{ name: 'docs', route: 'https://docs.postguard.eu' },
]

let items = FF_BUSINESS ? allItems : allItems.filter(i => i.name !== 'business')
let items = FF_BUSINESS
? allItems
: allItems.filter((i) => i.name !== 'business')

function isSelected(route: string) {
return page.url.pathname === route;
return page.url.pathname === route
}
</script>

<div class="pg-topbar">
<a href={resolve('/')}>
<img src={logo} alt="postguard logo" width="128" height="70" class="logo-light" />
<img src={logoDark} alt="postguard logo" width="128" height="70" class="logo-dark" />
<img
src={logo}
alt="postguard logo"
width="128"
height="70"
class="logo-light"
/>
<img
src={logoDark}
alt="postguard logo"
width="128"
height="70"
class="logo-dark"
/>
</a>
<div class="pg-desktop-menu">
<ul>
Expand All @@ -44,117 +58,118 @@
</ul>
<LocaleSwitcher />
<ThemeSwitcher />
<a href={resolve('/decrypt')} class="inbox-btn" class:selected={isSelected('/decrypt')}>
<a
href={resolve('/decrypt')}
class="inbox-btn"
class:selected={isSelected('/decrypt')}
>
{$_('header.inbox')}
</a>
</div>
<Hamburger
items={[...items, { name: 'inbox', route: '/decrypt' }]}
/>
<Hamburger items={[...items, { name: 'inbox', route: '/decrypt' }]} />
</div>

<style lang="scss">
.logo-light {
display: block;
}

.logo-dark {
display: none;
}

:global(.dark) .logo-light {
display: none;
}

:global(.dark) .logo-dark {
display: block;
}

.pg-topbar {
width: auto;
margin: 0.5rem 1rem 1rem 1rem;

display: flex;
flex-direction: row;
align-items: center;
justify-content: space-between;
}

.pg-desktop-menu {
display: none;
margin-left: auto;
flex-direction: row;
align-items: center;
gap: 1rem;
}


@media only screen and (min-width: 768px) {
.pg-desktop-menu {
display: flex;
.logo-light {
display: block;
}
}

.inbox-btn {
padding: 0.25rem 1rem;
background: var(--pg-primary);
color: white;
border-radius: var(--pg-border-radius-sm);
text-decoration: none;
font-weight: var(--pg-font-weight-semibold);
font-size: var(--pg-font-size-sm);
transition: opacity 0.2s ease;
white-space: nowrap;

&:hover {
opacity: 0.9;

.logo-dark {
display: none;
}

&.selected {
opacity: 0.85;
box-shadow: 0 0 0 2px var(--pg-primary);
background: transparent;
color: var(--pg-primary);
:global(.dark) .logo-light {
display: none;
}
}

.pg-desktop-menu ul li {
display: inline-block;
position: relative;
list-style-type: none;
margin-left: 15px;
padding-right: 15px;
:global(.dark) .logo-dark {
display: block;
}

.pg-topbar {
width: auto;
margin: 0.5rem 1rem 1rem 1rem;

display: flex;
flex-direction: row;
align-items: center;
justify-content: space-between;
}

.pg-desktop-menu {
display: none;
margin-left: auto;
flex-direction: row;
align-items: center;
gap: 1rem;
}

&:not(:last-child) {
border-right: 1px solid var(--pg-text);
@media only screen and (min-width: 768px) {
.pg-desktop-menu {
display: flex;
}
}

&.selected a {
text-decoration: 2px underline;
text-decoration-color: var(--pg-text);
text-underline-offset: 4px;
.inbox-btn {
padding: 0.25rem 1rem;
background: var(--pg-primary);
color: white;
border-radius: var(--pg-border-radius-sm);
text-decoration: none;
font-weight: var(--pg-font-weight-semibold);
font-size: var(--pg-font-size-sm);
transition: opacity 0.2s ease;
white-space: nowrap;

&:hover {
opacity: 0.9;
}

&.selected {
opacity: 0.85;
box-shadow: 0 0 0 2px var(--pg-primary);
background: transparent;
color: var(--pg-primary);
}
}

&:not(.selected) a {
text-decoration: none;

&:after {
content: '';
position: absolute;
width: calc(100% - 15px);
transform: scaleX(0);
height: 2px;
bottom: 0;
left: 0;
background-color: var(--pg-text);
transform-origin: bottom right;
transition: transform 0.25s ease-out;
}

&:hover:after {
transform: scaleX(1);
transform-origin: bottom left;
}
.pg-desktop-menu ul li {
display: inline-block;
position: relative;
list-style-type: none;
margin-left: 15px;
padding-right: 15px;

&:not(:last-child) {
border-right: 1px solid var(--pg-text);
}

&.selected a {
text-decoration: 2px underline;
text-decoration-color: var(--pg-text);
text-underline-offset: 4px;
}

&:not(.selected) a {
text-decoration: none;

&:after {
content: '';
position: absolute;
width: calc(100% - 15px);
transform: scaleX(0);
height: 2px;
bottom: 0;
left: 0;
background-color: var(--pg-text);
transform-origin: bottom right;
transition: transform 0.25s ease-out;
}

&:hover:after {
transform: scaleX(1);
transform-origin: bottom left;
}
}
}
}
</style>
28 changes: 20 additions & 8 deletions src/lib/components/HelpToggle.svelte
Original file line number Diff line number Diff line change
@@ -1,13 +1,19 @@
<script lang="ts">
interface props {
title: string;
content: string;
bordered?: boolean;
linkText?: string;
linkUrl?: string;
title: string
content: string
bordered?: boolean
linkText?: string
linkUrl?: string
}

let { title, content, bordered = false, linkText, linkUrl }: props = $props()
let {
title,
content,
bordered = false,
linkText,
linkUrl,
}: props = $props()
</script>

<details class="help-section" class:bordered>
Expand All @@ -18,10 +24,16 @@
<div class="help-content">
<p class="help-text">{content}</p>
{#if linkText && linkUrl}
<!-- eslint-disable-next-line svelte/no-navigation-without-resolve -->
<a href={linkUrl} target="_blank" rel="noopener noreferrer" class="help-link">
<!-- eslint-disable svelte/no-navigation-without-resolve -->
<a
href={linkUrl}
target="_blank"
rel="noopener noreferrer"
class="help-link"
>
{linkText} →
</a>
<!-- eslint-enable svelte/no-navigation-without-resolve -->
{/if}
</div>
</details>
Expand Down
Loading
Loading