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

+1 -1
View File
@@ -1,6 +1,6 @@
{ {
"name": "photon-lemmy", "name": "photon-lemmy",
"version": "23.7.17", "version": "23.7.18",
"private": true, "private": true,
"scripts": { "scripts": {
"dev": "vite dev", "dev": "vite dev",
+1 -1
View File
@@ -11,6 +11,6 @@
%sveltekit.head% %sveltekit.head%
</head> </head>
<body data-sveltekit-preload-data="hover"> <body data-sveltekit-preload-data="hover">
<div style="display: contents">%sveltekit.body%</div> <div style="display: contents; height: 100%">%sveltekit.body%</div>
</body> </body>
</html> </html>
+13 -2
View File
@@ -122,11 +122,22 @@
</MenuButton> </MenuButton>
{/if} {/if}
<hr class="dark:opacity-10 w-[90%] my-2 mx-auto" /> <hr class="dark:opacity-10 w-[90%] my-2 mx-auto" />
<!-- svelte-ignore missing-declaration --> <li class="text-xs px-4 py-1 my-1 opacity-80">App</li>
<li class="text-xs px-4 py-1 my-1 opacity-80">v{__VERSION__}</li>
<MenuButton link href="/settings"> <MenuButton link href="/settings">
<Icon src={Cog6Tooth} mini width={16} /> <Icon src={Cog6Tooth} mini width={16} />
Settings Settings
</MenuButton> </MenuButton>
<hr class="dark:opacity-10 w-[90%] my-2 mx-auto" />
<li
class="flex flex-row justify-center gap-2 text-xs px-4 py-1 mx-auto my-1"
>
<!-- svelte-ignore missing-declaration -->
<span class="mr-auto">v{__VERSION__}</span>
<a href="https://github.com/Xyphyn/photon" class="hover:underline">
Code
</a>
<a href="https://xylight.dev" class="hover:underline">Xylo</a>
<a href="https://join-lemmy.org" class="hover:underline">Lemmy</a>
</li>
</Menu> </Menu>
</nav> </nav>
+2 -2
View File
@@ -30,6 +30,6 @@
<Navbar /> <Navbar />
<ToastContainer /> <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 /> <slot />
</div> </main>
+9 -6
View File
@@ -19,8 +19,11 @@
<div class="flex flex-row gap-4 w-full"> <div class="flex flex-row gap-4 w-full">
<div class="flex flex-col gap-4 max-w-full w-full min-w-0"> <div class="flex flex-col gap-4 max-w-full w-full min-w-0">
<h1 class="text-3xl font-bold">Frontpage</h1> <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"> <div
class="flex flex-col sm:flex-row gap-4 max-w-full w-full"
role="radiogroup"
>
<MultiSelect <MultiSelect
options={['Subscribed', 'Local', 'All']} options={['Subscribed', 'Local', 'All']}
disabled={[$authData?.token == undefined]} disabled={[$authData?.token == undefined]}
@@ -48,13 +51,13 @@
}} }}
/> />
</div> </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)} {#each data.posts.posts as post, index (post.post.id)}
<div in:fly={{ y: -8, opacity: 0, delay: index < 4 ? index * 100 : 0 }}> <div in:fly={{ y: -8, opacity: 0, delay: index < 4 ? index * 100 : 0 }}>
<Post {post} /> <Post {post} />
</div> </div>
{/each} {/each}
</div> </section>
<Button <Button
on:click={() => { on:click={() => {
$page.url.searchParams.set( $page.url.searchParams.set(
@@ -70,7 +73,7 @@
Next Next
</Button> </Button>
</div> </div>
<div class="hidden md:block"> <aside class="hidden md:block">
{#await data.streamed.site} {#await data.streamed.site}
<StickyCard> <StickyCard>
<div class="h-64 grid place-items-center"> <div class="h-64 grid place-items-center">
@@ -84,5 +87,5 @@
<h1 class="font-bold text-lg">Failed to load</h1> <h1 class="font-bold text-lg">Failed to load</h1>
</StickyCard> </StickyCard>
{/await} {/await}
</div> </aside>
</div> </div>
+27 -22
View File
@@ -63,10 +63,6 @@
<title>Login</title> <title>Login</title>
</svelte:head> </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"> <Card class="p-6 max-w-lg w-full mx-auto">
<form on:submit|preventDefault={logIn} class="flex flex-col gap-4"> <form on:submit|preventDefault={logIn} class="flex flex-col gap-4">
<h1 class="font-bold text-2xl">Log in</h1> <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}'} pattern={'(?!-)[A-Za-z0-9-]+([-.]{1}[a-z0-9]+)*.[A-Za-z]{2,6}'}
/> />
</div> </div>
<TextInput <div class="flex flex-row gap-2 w-full">
id="password" <TextInput
bind:value={data.password} id="password"
label="Password" bind:value={data.password}
type="password" label="Password"
required type="password"
/> required
<TextInput class="w-full"
id="totp" />
bind:value={data.totp} <TextInput
label="2FA Code" id="totp"
placeholder="123456" bind:value={data.totp}
pattern={'\\d{6}'} label="2FA Code"
minlength={6} placeholder="123456"
maxlength={6} 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 <Button
loading={data.loading} loading={data.loading}
disabled={data.loading} disabled={data.loading}
@@ -119,8 +125,7 @@ translate-y-[-50%] w-full flex flex-col items-center justify-center"
color={Color.accent} color={Color.accent}
submit submit
> >
Submit Log in
</Button> </Button>
</form> </form>
</Card> </Card>
<!-- </div> -->
@@ -28,6 +28,7 @@
import Spinner from '$lib/components/ui/loader/Spinner.svelte' import Spinner from '$lib/components/ui/loader/Spinner.svelte'
import Card from '$lib/components/ui/Card.svelte' import Card from '$lib/components/ui/Card.svelte'
import PostLink from '$lib/components/lemmy/post/PostLink.svelte' import PostLink from '$lib/components/lemmy/post/PostLink.svelte'
import PostMeta from '$lib/components/lemmy/post/PostMeta.svelte'
export let data export let data
@@ -78,6 +79,17 @@
</Card> </Card>
{/if} {/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> <h1 class="font-bold text-lg">{post.name}</h1>
{#if isImage(post.url)} {#if isImage(post.url)}
<img <img