design: make signup page look slightly less awful (#717)

* design: make signup page look slightly less awful (allow commonlist in virtualizer)

* misc: make buttons and menus unselectable

* feat: add recommended instances

* fix: broken piefed notifications count
This commit is contained in:
xylight authored and GitHub committed 2026-02-17 05:03:13 +00:00
1 parent ee7c097f80
commit ec7fd81304
14 files changed
+222 -166

No files matched your search

+20 -17
View File
@@ -1,3 +1,4 @@
import { PiefedClient } from '$lib/api/piefed/adapter'
import type { Profile } from './profile.svelte'
interface Notifications {
@@ -56,24 +57,26 @@ export class InboxService {
.then((res) => res.mentions + res.private_messages + res.replies)
.catch(() => 0)
const reportsPromise = this.#profile.isMod()
? this.#profile.client
.getReportCount({})
.then(
(res) =>
res.comment_reports +
res.post_reports +
(res.private_message_reports ?? 0),
)
.catch(() => 0)
: Promise.resolve(0)
const reportsPromise =
!(this.#profile.client instanceof PiefedClient) && this.#profile.isMod()
? this.#profile.client
.getReportCount({})
.then(
(res) =>
res.comment_reports +
res.post_reports +
(res.private_message_reports ?? 0),
)
.catch(() => 0)
: Promise.resolve(0)
const applicationsPromise = this.#profile.isAdmin
? this.#profile.client
.getUnreadRegistrationApplicationCount()
.then((res) => res.registration_applications)
.catch(() => 0)
: Promise.resolve(0)
const applicationsPromise =
!(this.#profile.client instanceof PiefedClient) && this.#profile.isAdmin
? this.#profile.client
.getUnreadRegistrationApplicationCount()
.then((res) => res.registration_applications)
.catch(() => 0)
: Promise.resolve(0)
const [unreads, reports, applications] = await Promise.all([
unreadsPromise,
+5 -3
View File
@@ -194,9 +194,10 @@
"setup": "Setup",
"signup": {
"title": "Sign Up",
"description": "Choose a server that interests you, or type the URL manually.",
"info": "The server you choose is where your account will live. However, every server is connected, and you can still access almost all linked content.",
"description": "Choose the server your account's information will be hosted on.",
"info": "You can access all content across the Fediverse regardless of your account's server, it is generally okay to pick any of the following.",
"chooseInstance": "Choose a server",
"recommended": "Recommended",
"application": {
"label": "Application",
"info": "To join this server, you must fill out this application, and wait to be accepted. You will receive an email if your application is accepted.",
@@ -696,7 +697,8 @@
"remove": "Remove",
"download": "Download",
"attach": "Attach file",
"info": "Info"
"info": "Info",
"continue": "Continue"
},
"message": {
"success": "Success",
+5 -2
View File
@@ -19,6 +19,7 @@
debounceResize?: number
useWindow?: boolean
height?: number
itemContainer?: string
}
let {
@@ -31,6 +32,7 @@
debounceResize = 100,
useWindow = true,
height = 0,
itemContainer = 'div',
...rest
}: Props = $props()
@@ -235,13 +237,14 @@
0}px; border: 0 !important;"
></div>
{#each visibleItems as item (item.index)}
<div
<svelte:element
this={itemContainer}
data-index={item.index}
class="post-container fix-divide group/virtual"
use:resizeObserver
>
{@render itemSnippet(item.index)}
</div>
</svelte:element>
{/each}
</div>
{#if settings.debugInfo}
+1 -1
View File
@@ -22,7 +22,7 @@
nameDetail?: import('svelte').Snippet
actions?: import('svelte').Snippet
children?: import('svelte').Snippet
compact?: 'always' | 'lg'
compact?: 'always' | 'lg' | 'never'
avatarCircle?: boolean
}
+53 -51
View File
@@ -53,13 +53,13 @@
@reference '../../../app.css';
ul {
:global {
:where(& > :not(:last-child)) {
li:not(:last-child) {
margin-block-start: calc(calc(var(--spacing) * 1));
margin-block-end: calc(calc(var(--spacing) * 1));
}
}
}
ul > :global(li) {
ul :global(li:not(ul li li)) {
transition: background-color 0.1s;
background-color: var(--color-white);
container-type: inline-size;
@@ -68,11 +68,11 @@
border-radius: var(--radius-lg) var(--radius-lg);
&:first-child {
&:first-of-type {
border-top-left-radius: var(--radius-2xl);
border-top-right-radius: var(--radius-2xl);
}
&:last-child {
&:last-of-type {
border-bottom-left-radius: var(--radius-2xl);
border-bottom-right-radius: var(--radius-2xl);
}
@@ -80,57 +80,59 @@
&:hover {
background-color: var(--color-slate-25);
}
}
ul > :global(li:not(.xs) > *) {
padding-block: calc(var(--spacing) * 3);
padding-inline: calc(var(--spacing) * 3.5);
@media screen and (min-width: 40rem) {
padding-block: calc(var(--spacing) * 3);
padding-inline: calc(var(--spacing) * 4);
}
}
ul > :global(li.xs > *) {
padding-block: calc(var(--spacing) * 0.5);
padding-block: calc(var(--spacing) * 1);
}
ul > :global(li.selected) {
background-color: color-mix(
in oklab,
var(--color-white),
var(--color-slate-50)
);
}
:global(.dark) ul > :global(li.selected) {
background-color: color-mix(
in oklab,
var(--color-zinc-900) 90%,
var(--color-zinc-800)
);
}
:global(.dark) ul > :global(li) {
border: 1px solid var(--color-zinc-900);
background-color: color-mix(
in oklab,
var(--color-zinc-925),
var(--color-zinc-900)
);
&:hover {
background-color: var(--color-zinc-900);
}
&:active {
@variant dark {
border: 1px solid var(--color-zinc-900);
background-color: color-mix(
in oklab,
var(--color-zinc-900) 80%,
var(--color-zinc-925)
var(--color-zinc-925),
var(--color-zinc-900)
);
&:hover {
background-color: var(--color-zinc-900);
}
&:active {
background-color: color-mix(
in oklab,
var(--color-zinc-900) 80%,
var(--color-zinc-925)
);
}
}
:global {
&:not(.xs) > * {
padding-block: calc(var(--spacing) * 3);
padding-inline: calc(var(--spacing) * 3.5);
@media screen and (min-width: 40rem) {
padding-block: calc(var(--spacing) * 3);
padding-inline: calc(var(--spacing) * 4);
}
}
&.xs > * {
padding-block: calc(var(--spacing) * 0.5);
padding-block: calc(var(--spacing) * 1);
}
&.selected {
background-color: color-mix(
in oklab,
var(--color-white),
var(--color-slate-50)
);
@variant dark {
background-color: color-mix(
in oklab,
var(--color-zinc-900) 90%,
var(--color-zinc-800)
);
}
}
}
}
+2
View File
@@ -178,6 +178,8 @@
flex-direction: row;
align-items: center;
font-size: var(--text-sm);
user-select: none;
-webkit-user-select: none;
transition: 75ms cubic-bezier(0.075, 0.82, 0.165, 1);
@@ -32,7 +32,7 @@
'dark:hover:text-primary-100 transition-colors z-0 group relative cursor-pointer',
]}
>
<div class="flex flex-row gap-1 items-center w-full">
<div class="flex flex-row gap-1 items-center w-full select-none">
{@render title?.(open)}
</div>
{#if icon}
+15 -8
View File
@@ -1,5 +1,6 @@
<script module lang="ts">
import { Label } from 'mono-svelte'
import { Icon, type IconSource } from 'svelte-hero-icons/dist'
import type { HTMLInputAttributes } from 'svelte/elements'
import { generateID } from './helper'
@@ -28,6 +29,7 @@
shadow?: Shadow
element?: HTMLInputElement | undefined
class?: string
icon?: IconSource
customLabel?: import('svelte').Snippet
prefix?: import('svelte').Snippet
suffix?: import('svelte').Snippet
@@ -41,14 +43,15 @@
const borderClass = `border border-slate-200 border-b-slate-300 dark:border-zinc-800`
let {
label = undefined,
label,
value = $bindable(),
placeholder = '',
disabled = false,
required = false,
size = 'md',
id = generateID(),
inlineAffixes = false,
icon,
inlineAffixes = !!icon,
shadow = 'sm',
element = $bindable(),
class: clazz = '',
@@ -84,15 +87,19 @@
clazz,
]}
>
{#if prefix}
{#if prefix || icon}
<div
class={[
'rounded-xl rounded-r-none text-slate-600 dark:text-zinc-400',
inlineAffixes && 'bg-white dark:bg-zinc-900 pr-0 w-8',
sizeClass[size],
inlineAffixes &&
'bg-white dark:bg-zinc-900 pr-0 px-3 h-full flex items-center',
]}
>
{@render prefix?.()}
{#if prefix}
{@render prefix?.()}
{:else if icon}
<Icon src={icon} size="20" mini />
{/if}
</div>
{/if}
<input
@@ -110,8 +117,8 @@
focus:outline-hidden rounded-xl text-sm w-full disabled:bg-slate-100
disabled:cursor-not-allowed dark:disabled:bg-zinc-800 invalid:border-red-500!
peer invalid:text-red-500 z-10`,
prefix && 'rounded-l-none',
prefix && inlineAffixes && 'border-l-0',
(prefix || icon) && 'rounded-l-none',
(prefix || icon) && inlineAffixes && 'border-l-0',
suffix && 'rounded-r-none',
suffix && inlineAffixes && 'border-r-0',
clazz,
+8 -2
View File
@@ -220,8 +220,8 @@
.material-info {
background: linear-gradient(
to bottom,
--alpha(var(--color-slate-300) / 10%),
--alpha(var(--color-slate-500) / 15%)
--alpha(var(--color-slate-200) / 10%),
--alpha(var(--color-slate-300) / 15%)
);
color: var(--color-slate-900);
@@ -229,6 +229,12 @@
@variant dark {
color: var(--color-slate-300);
background: linear-gradient(
to bottom,
--alpha(var(--color-slate-300) / 10%),
--alpha(var(--color-slate-500) / 15%)
);
}
}
}
+1 -1
View File
@@ -46,7 +46,7 @@
>
{#snippet popover()}
<div
class="w-full max-w-sm max-h-128 overflow-auto list-none shadow-lg rounded-xl"
class="w-full max-w-sm max-h-128 overflow-auto list-none shadow-lg rounded-xl select-none"
>
<div
class="flex flex-col p-1 list-none bg-white/80 dark:bg-zinc-900/90 rounded-xl