Skip to content

Commit

Permalink
Merge pull request #6 from ChangJun2019/dev
Browse files Browse the repository at this point in the history
  • Loading branch information
ChangJun2019 authored Oct 15, 2023
2 parents 6f66889 + 5246ee1 commit 5fd69ae
Show file tree
Hide file tree
Showing 3 changed files with 27 additions and 0 deletions.
1 change: 1 addition & 0 deletions app.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ export default defineAppConfig({
variant: {
solid: 'focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:pointer-events-none disabled:opacity-50 c-bg-primary c-text-primary shadow hover:c-bg-primary/90',
ghost: 'focus:outline-nones hover:bg-zinc-100 dark:hover:bg-zinc-800',
outline: 'border-1 c-border-base c-text-base ring-0',
},
},

Expand Down
21 changes: 21 additions & 0 deletions components/Post/PostBackTop.client.vue
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
<script setup lang="ts">
import { useWindowScroll } from '@vueuse/core'
const show = computed(() => {
const { y } = useWindowScroll()
return y.value >= 300
})
function goTop() {
window.scrollTo({
top: 0,
behavior: 'smooth',
})
}
</script>

<template>
<div :class="show ? 'opacity-90' : 'opacity-0'" class="fixed right-6 bottom-4 transition-all duration-400 ease-in-out" @click.top="goTop()">
<UButton icon="i-heroicons-arrow-up-circle" variant="ghost" />
</div>
</template>
5 changes: 5 additions & 0 deletions layouts/content.vue
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,13 @@
<PostHeader />
<main class="prose prose-slate dark:prose-invert tracking-wide">
<slot />

<UButton to="/blog" variant="outline" class="mt-6 not-prose">
Go Back
</UButton>
</main>
<Footer />
<PostBackTop />
</main>
</AppLayout>
</template>
Expand Down

0 comments on commit 5fd69ae

Please sign in to comment.