misc: I haven't eaten in 16 hours brb gonna get some food

This commit is contained in:
Xyphyn committed 2023-07-16 13:24:32 -07:00
1 parent a363fe3baf
commit eb006ed982
21 files changed
+157 -89

No files matched your search

+5 -2
View File
@@ -6,6 +6,7 @@
import MultiSelect from '$lib/components/input/MultiSelect.svelte'
import Post from '$lib/components/lemmy/Post.svelte'
import SiteCard from '$lib/components/lemmy/SiteCard.svelte'
import { fly, scale } from 'svelte/transition'
export let data
</script>
@@ -44,8 +45,10 @@
/>
</div>
<div class="flex flex-col gap-4">
{#each data.posts.posts as post}
<Post {post} />
{#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>
<Button
+1 -1
View File
@@ -2,7 +2,7 @@ import { authData, getClient } from '$lib/lemmy.js'
import type { ListingType, SortType } from 'lemmy-js-client'
import { get } from 'svelte/store'
export async function load({ url, params }) {
export async function load({ url }) {
const page = Number(url.searchParams.get('page') || 1) || 1
const sort: SortType = (url.searchParams.get('sort') as SortType) || 'Active'
+5 -2
View File
@@ -8,6 +8,7 @@
import CommunityCard from '$lib/components/community/CommunityCard.svelte'
import Button from '$lib/components/input/Button.svelte'
import { Color } from '$lib/ui/colors'
import { fly } from 'svelte/transition'
export let data
</script>
@@ -57,8 +58,10 @@
}}
/>
</div>
{#each data.posts.posts as post}
<Post {post} />
{#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}
<Button
on:click={() => {
+1 -1
View File
@@ -6,7 +6,7 @@
import TextArea from '$lib/components/input/TextArea.svelte'
import TextInput from '$lib/components/input/TextInput.svelte'
import Card from '$lib/components/ui/Card.svelte'
import Loading from '$lib/components/ui/Loading.svelte'
import Loading from '$lib/components/ui/loader/Loading.svelte'
import { ToastType, addToast } from '$lib/components/ui/toasts/toasts.js'
import { authData, buildBaseUrl, getClient } from '$lib/lemmy.js'
import { Color } from '$lib/ui/colors.js'
+2 -17
View File
@@ -20,6 +20,7 @@
import Button from '$lib/components/input/Button.svelte'
import { page } from '$app/stores'
import PostActions from '$lib/components/lemmy/PostActions.svelte'
import Loading from '$lib/components/ui/loader/Loading.svelte'
export let data
@@ -119,18 +120,7 @@
</span>
</div>
{#await data.streamed.comments}
<div class="flex flex-col gap-8">
{#each new Array(10) as comment}
<div class="flex flex-col gap-2">
<div
class="dark:bg-zinc-700 bg-slate-200 animate-pulse w-64 h-3 rounded-md"
/>
<div
class="dark:bg-zinc-700 bg-slate-200 animate-pulse w-128 h-4 rounded-md"
/>
</div>
{/each}
</div>
<Loading />
{:then comments}
{#if $user}
<CommentForm
@@ -142,11 +132,6 @@
])}
/>
{/if}
<MultiSelect
options={['hot', 'new', 'top']}
optionNames={['Hot', 'New', 'Top']}
selected="hot"
/>
<Comments
{post}
nodes={buildCommentsTree(comments.comments, false)}
+29 -26
View File
@@ -6,6 +6,7 @@
import CommunityLink from '$lib/components/community/CommunityLink.svelte'
import Link from '$lib/components/input/Link.svelte'
import Comment from '$lib/components/lemmy/comment/Comment.svelte'
import { fly } from 'svelte/transition'
export let data
@@ -27,33 +28,35 @@
Wow, it's quite empty in here.
</p>
{:else}
{#each data.data as item}
{#if isComment(item)}
<Card class="flex flex-col bg-white rounded-md p-4 flex-1">
<div class="flex flex-row justify-between items-center">
<div class="flex flex-col gap-1">
<span class="text-xs dark:text-slate-400 text-zinc-600">
<CommunityLink avatar community={item.community} />
</span>
<span class="flex flex-row items-center text-sm font-bold">
{item.post.name}
</span>
{#each data.data as item, index}
<div in:fly={{ opacity: 0, y: -4, delay: index * 50 }}>
{#if isComment(item)}
<Card class="flex flex-col bg-white rounded-md p-4 flex-1">
<div class="flex flex-row justify-between items-center">
<div class="flex flex-col gap-1">
<span class="text-xs dark:text-slate-400 text-zinc-600">
<CommunityLink avatar community={item.community} />
</span>
<span class="flex flex-row items-center text-sm font-bold">
{item.post.name}
</span>
</div>
<Link href="/post/{item.post.id}#{asComment(item).comment.id}">
Jump
</Link>
</div>
<Link href="/post/{item.post.id}#{asComment(item).comment.id}">
Jump
</Link>
</div>
<div class="list-none">
<Comment
postId={item.post.id}
node={{ children: [], comment_view: asComment(item), depth: 1 }}
replying={false}
/>
</div>
</Card>
{:else}
<Post post={asPost(item)} />
{/if}
<div class="list-none">
<Comment
postId={item.post.id}
node={{ children: [], comment_view: asComment(item), depth: 1 }}
replying={false}
/>
</div>
</Card>
{:else}
<Post post={asPost(item)} />
{/if}
</div>
{/each}
{/if}
</div>