2024-06-29 14:48:34 +01:00
|
|
|
<script>
|
|
|
|
import '$lib/app.css';
|
|
|
|
import Post from '$lib/ui/post/Post.svelte';
|
|
|
|
|
|
|
|
export let data;
|
2024-06-29 16:19:34 +01:00
|
|
|
$: main_post = data.posts[0];
|
|
|
|
$: replies = data.posts.slice(1);
|
2024-06-29 14:48:34 +01:00
|
|
|
</script>
|
|
|
|
|
|
|
|
<div id="feed" role="feed">
|
|
|
|
{#if data.posts.length <= 0}
|
|
|
|
<div class="throb">
|
|
|
|
<span>just a moment...</span>
|
|
|
|
</div>
|
|
|
|
{:else}
|
2024-06-29 16:19:34 +01:00
|
|
|
{#key data}
|
2024-06-29 14:48:34 +01:00
|
|
|
<Post post_data={main_post} focused />
|
|
|
|
<br>
|
|
|
|
{#each replies as post}
|
|
|
|
<Post post_data={post} />
|
|
|
|
{/each}
|
2024-06-29 16:19:34 +01:00
|
|
|
{/key}
|
2024-06-29 14:48:34 +01:00
|
|
|
{/if}
|
|
|
|
</div>
|
|
|
|
|
|
|
|
<style>
|
|
|
|
#feed {
|
|
|
|
margin-bottom: 20vh;
|
|
|
|
}
|
|
|
|
|
|
|
|
.throb {
|
|
|
|
width: 100%;
|
|
|
|
height: 80vh;
|
|
|
|
display: flex;
|
|
|
|
justify-content: center;
|
|
|
|
align-items: center;
|
|
|
|
font-size: 2em;
|
|
|
|
font-weight: bold;
|
|
|
|
}
|
|
|
|
</style>
|