feat: improve layout (#19)

Co-authored-by: Anthony Fu <anthonyfu117@hotmail.com>
This commit is contained in:
patak 2022-11-20 22:30:21 +01:00 committed by GitHub
parent 70daeeaed5
commit 2442c80bfb
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
5 changed files with 60 additions and 25 deletions

View file

@ -1,5 +1,6 @@
<template> <template>
<div flex flex-col> <div relative>
<div sticky top-0 bg="#222" z10>
<div flex justify-between> <div flex justify-between>
<div p3 flex gap-1> <div p3 flex gap-1>
<slot name="title" /> <slot name="title" />
@ -8,6 +9,9 @@
<slot name="actions" /> <slot name="actions" />
</div> </div>
</div> </div>
</div>
<div>
<slot /> <slot />
</div> </div>
</div>
</template> </template>

View file

@ -17,7 +17,7 @@ async function publish() {
</script> </script>
<template> <template>
<div flex flex-col gap-4 :class="isSending ? ' pointer-events-none' : ''"> <div xl:w-70 flex flex-col gap-4 :class="isSending ? ' pointer-events-none' : ''">
<textarea <textarea
v-model="draftPost" v-model="draftPost"
placeholder="What's on your mind?" placeholder="What's on your mind?"

View file

@ -1,15 +1,19 @@
<template> <template>
<div h-full of-hidden> <div h-full>
<main grid="~ lg:cols-[1fr_40rem_1fr]" max-w-80rem mxa h-full> <main flex w-full mxa h-full lg:max-w-80rem>
<div> <div class="w-1/4" hidden lg:flex flex-col items-end>
<div fixed>
<slot name="left"> <slot name="left">
<AccountMe /> <AccountMe />
</slot> </slot>
</div> </div>
<div h-full of-auto border="l r border"> </div>
<div class="lg:w-3/4" flex>
<div h-full border="l r border" class="w-full md:w-2/3">
<slot /> <slot />
</div> </div>
<div flex="~ col"> <div hidden md:flex="~ col" class="w-1/3">
<div fixed>
<slot name="right"> <slot name="right">
<NavTitle p5 /> <NavTitle p5 />
<NavSide border="y border" py8 /> <NavSide border="y border" py8 />
@ -17,6 +21,8 @@
<NavFooter /> <NavFooter />
</slot> </slot>
</div> </div>
</div>
</div>
</main> </main>
</div> </div>
</template> </template>

20
pages/tags/[tag].vue Normal file
View file

@ -0,0 +1,20 @@
<script setup lang="ts">
const params = useRoute().params
const tag = $computed(() => params.tag as string)
const masto = await useMasto()
const paginator = masto.timelines.getHashtagIterable(tag)
</script>
<template>
<MainContent>
<template #title>
<div i-ri:hashtag h-6 mr-1 /><span>{{ tag }}</span>
</template>
<template #actions>
<div color-gray i-ri:equalizer-fill mr-1 h-6 />
</template>
<slot>
<TimelinePaginator :paginator="paginator" />
</slot>
</MainContent>
</template>

View file

@ -23,3 +23,8 @@
::-webkit-scrollbar-thumb:hover { ::-webkit-scrollbar-thumb:hover {
background: #666; background: #666;
} }
/* Force vertical scrollbar to be always visible to avoid layout shift while loading the content */
html {
overflow-y: scroll;
}