misc: minor design tweaks

This commit is contained in:
Xyphyn committed 2023-07-18 17:08:08 -07:00
1 parent b0f3e01f5a
commit 5d0e09f2e3
7 files changed
+65 -34

No files matched your search

+2 -2
View File
@@ -30,6 +30,6 @@
<Navbar />
<ToastContainer />
<div class="mx-auto max-w-5xl p-2 md:p-4 h-full">
<main class="mx-auto max-w-5xl p-2 md:p-4 flex-1 w-full">
<slot />
</div>
</main>
+9 -6
View File
@@ -19,8 +19,11 @@
<div class="flex flex-row gap-4 w-full">
<div class="flex flex-col gap-4 max-w-full w-full min-w-0">
<h1 class="text-3xl font-bold">Frontpage</h1>
<div class="flex flex-col sm:flex-row gap-4 max-w-full w-full">
<header><h1 class="text-3xl font-bold">Frontpage</h1></header>
<div
class="flex flex-col sm:flex-row gap-4 max-w-full w-full"
role="radiogroup"
>
<MultiSelect
options={['Subscribed', 'Local', 'All']}
disabled={[$authData?.token == undefined]}
@@ -48,13 +51,13 @@
}}
/>
</div>
<div class="flex flex-col gap-4">
<section class="flex flex-col gap-4">
{#each data.posts.posts as post, index (post.post.id)}
<div in:fly={{ y: -8, opacity: 0, delay: index < 4 ? index * 100 : 0 }}>
<Post {post} />
</div>
{/each}
</div>
</section>
<Button
on:click={() => {
$page.url.searchParams.set(
@@ -70,7 +73,7 @@
Next
</Button>
</div>
<div class="hidden md:block">
<aside class="hidden md:block">
{#await data.streamed.site}
<StickyCard>
<div class="h-64 grid place-items-center">
@@ -84,5 +87,5 @@
<h1 class="font-bold text-lg">Failed to load</h1>
</StickyCard>
{/await}
</div>
</aside>
</div>
+27 -22
View File
@@ -63,10 +63,6 @@
<title>Login</title>
</svelte:head>
<!-- <div
class="p-4 absolute top-[50%] left-[50%] translate-x-[-50%]
translate-y-[-50%] w-full flex flex-col items-center justify-center"
> -->
<Card class="p-6 max-w-lg w-full mx-auto">
<form on:submit|preventDefault={logIn} class="flex flex-col gap-4">
<h1 class="font-bold text-2xl">Log in</h1>
@@ -96,22 +92,32 @@ translate-y-[-50%] w-full flex flex-col items-center justify-center"
pattern={'(?!-)[A-Za-z0-9-]+([-.]{1}[a-z0-9]+)*.[A-Za-z]{2,6}'}
/>
</div>
<TextInput
id="password"
bind:value={data.password}
label="Password"
type="password"
required
/>
<TextInput
id="totp"
bind:value={data.totp}
label="2FA Code"
placeholder="123456"
pattern={'\\d{6}'}
minlength={6}
maxlength={6}
/>
<div class="flex flex-row gap-2 w-full">
<TextInput
id="password"
bind:value={data.password}
label="Password"
type="password"
required
class="w-full"
/>
<TextInput
id="totp"
bind:value={data.totp}
label="2FA Code"
placeholder="123456"
pattern={'\\d{6}'}
minlength={6}
maxlength={6}
class="w-20"
on:input={(e) => {
if (!Number(e.detail.data)) {
e.preventDefault()
data.totp = data.totp.replace(e.detail.data, '')
}
}}
/>
</div>
<Button
loading={data.loading}
disabled={data.loading}
@@ -119,8 +125,7 @@ translate-y-[-50%] w-full flex flex-col items-center justify-center"
color={Color.accent}
submit
>
Submit
Log in
</Button>
</form>
</Card>
<!-- </div> -->
@@ -28,6 +28,7 @@
import Spinner from '$lib/components/ui/loader/Spinner.svelte'
import Card from '$lib/components/ui/Card.svelte'
import PostLink from '$lib/components/lemmy/post/PostLink.svelte'
import PostMeta from '$lib/components/lemmy/post/PostMeta.svelte'
export let data
@@ -78,6 +79,17 @@
</Card>
{/if}
<PostMeta
community={postData.community}
user={postData.creator}
upvotes={postData.counts.upvotes}
downvotes={postData.counts.downvotes}
deleted={postData.post.deleted}
featured={postData.post.featured_community || postData.post.featured_local}
nsfw={postData.post.nsfw}
published={new Date(postData.post.published)}
saved={postData.saved}
/>
<h1 class="font-bold text-lg">{post.name}</h1>
{#if isImage(post.url)}
<img