UI improvements
This commit is contained in:
19
src/app.html
19
src/app.html
@ -1,12 +1,13 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="utf-8" />
|
||||
<link rel="icon" href="%sveltekit.assets%/favicon.png" />
|
||||
<meta name="viewport" content="width=device-width" />
|
||||
%sveltekit.head%
|
||||
</head>
|
||||
<body data-sveltekit-preload-data="hover">
|
||||
<div style="display: contents">%sveltekit.body%</div>
|
||||
</body>
|
||||
<head>
|
||||
<meta charset="utf-8" />
|
||||
<link rel="icon" href="%sveltekit.assets%/favicon.png" />
|
||||
<link rel="stylesheet" href="%sveltekit.assets%/style.css" />
|
||||
<meta name="viewport" content="width=device-width" />
|
||||
%sveltekit.head%
|
||||
</head>
|
||||
<body data-sveltekit-preload-data="hover">
|
||||
<div style="display: contents">%sveltekit.body%</div>
|
||||
</body>
|
||||
</html>
|
||||
|
@ -8,12 +8,15 @@
|
||||
$: dateCreated = new Date(post.created_at).toLocaleString();
|
||||
</script>
|
||||
|
||||
|
||||
<div class="wrapper">
|
||||
<div class="avatar"><AvatarComponent account={post.account} /></div>
|
||||
<div class="post">
|
||||
<AccountComponent account={post.account} />
|
||||
<small><a href={post.url} target="_blank">{dateCreated}</a></small>
|
||||
{@html post.content}
|
||||
<div class="meta">
|
||||
<AccountComponent account={post.account} />
|
||||
<small><a href={post.url} target="_blank">{dateCreated}</a></small>
|
||||
</div>
|
||||
<div class="content">{@html post.content}</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@ -24,8 +27,17 @@
|
||||
.post {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
flex-grow: 2;
|
||||
}
|
||||
.meta {
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
}
|
||||
.avatar {
|
||||
margin-right: 1em;
|
||||
}
|
||||
.content {
|
||||
max-width: calc(600px - 1em - 50px);
|
||||
overflow-x: auto;
|
||||
}
|
||||
</style>
|
@ -35,7 +35,37 @@ onMount(async () => {
|
||||
}
|
||||
})
|
||||
</script>
|
||||
<h2>Metalhead.club music list</h2>
|
||||
<div class="wrapper">
|
||||
<div></div>
|
||||
<div class="posts">
|
||||
{#if data.posts.length === 0}
|
||||
Sorry, no posts recommending music aave been found yet
|
||||
{/if}
|
||||
{#each data.posts as post (post.id)}
|
||||
<div class="post"><PostComponent {post} /></div>
|
||||
{/each}
|
||||
</div>
|
||||
<div></div>
|
||||
</div>
|
||||
<style>
|
||||
.posts {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
}
|
||||
.post {
|
||||
width: 100%;
|
||||
max-width: 600px;
|
||||
margin-bottom: 1em;
|
||||
border-bottom: 1px solid var(--color-border);
|
||||
padding: 1em;
|
||||
}
|
||||
.wrapper {
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
}
|
||||
|
||||
{#each data.posts as post (post.id)}
|
||||
<PostComponent {post}></PostComponent>
|
||||
{/each}
|
||||
h2 {
|
||||
text-align: center;
|
||||
}
|
||||
</style>
|
Reference in New Issue
Block a user