Skip to content

Commit

Permalink
chore: minor fix (bump version: 1.0.0-alpha.4)
Browse files Browse the repository at this point in the history
  • Loading branch information
dragon-fish committed Oct 28, 2021
1 parent 7ad62ff commit 4665f9e
Show file tree
Hide file tree
Showing 7 changed files with 28 additions and 28 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "blog-now",
"version": "1.0.0-alpha.3",
"version": "1.0.0-alpha.4",
"author": "Dragon-Fish <[email protected]>",
"license": "MIT",
"private": true,
Expand Down
14 changes: 11 additions & 3 deletions src/components/FloatToolbox.vue
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,7 @@ import {
import QuickEdit from './QuickEdit.vue'
import { useRouter } from 'vue-router'
import { userData } from '../utils'
import scrollTo from 'animated-scroll-to'
const router = useRouter()
Expand All @@ -81,12 +82,13 @@ watch(isHide, (val) => {
}
})
function backToTop() {
scrollTo(0, { maxDuration: 800 })
}
onMounted(() => {
isHide.value = localStorage.getItem('BLOGNOW_TOOLBOX_STATE') === 'hide'
})
function backToTop() {
window.scrollTo({ top: 0, behavior: 'smooth' })
}
</script>

<style scoped lang="sass">
Expand Down Expand Up @@ -156,6 +158,12 @@ function backToTop() {
[data-at-top='true']
#back-to-top
display: none !important
@media screen and (max-width: 800px)
#float-toolbox
.fixed-container
right: 50%
transform: translateX(50%)
</style>

<style lang="sass">
Expand Down
10 changes: 1 addition & 9 deletions src/components/GlobalHeader.vue
Original file line number Diff line number Diff line change
Expand Up @@ -14,17 +14,9 @@ nav#global-header.flex.gap-1
</template>

<script setup lang="ts">
import { onMounted, ref } from 'vue'
import { useRouter } from 'vue-router'
import { onMounted } from 'vue'
import GlobalHeaderUserDropdown from './GlobalHeaderUserDropdown.vue'
const userDropdownShow = ref(false)
const router = useRouter()
router.beforeEach(() => {
userDropdownShow.value = false
})
onMounted(() => {
document.addEventListener('scroll', () => {
document.body.setAttribute(
Expand Down
6 changes: 6 additions & 0 deletions src/components/GlobalHeaderUserDropdown.vue
Original file line number Diff line number Diff line change
Expand Up @@ -52,9 +52,15 @@
import { onMounted, ref } from 'vue'
import { getAvatar, userData, isLoggedIn } from '../utils'
import { AngleDown } from '@vicons/fa'
import { useRouter } from 'vue-router'
const router = useRouter()
const userDropdownShow = ref(false)
router.beforeEach(() => {
userDropdownShow.value = false
})
onMounted(() => {
document.body.addEventListener('click', () => {
userDropdownShow.value = false
Expand Down
7 changes: 2 additions & 5 deletions src/router.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,18 +8,15 @@ const router = createRouter({
if (savedPosition) {
return savedPosition
} else {
return {
top: 0,
left: 0,
behavior: 'smooth',
}
scrollTo(0, { maxDuration: 800 })
}
},
})

router.afterEach(({ name }) => {
document.body.setAttribute('data-route', name as string)
document.body.style.overflow = 'visible'
document.documentElement.style.overflow = 'visible'
})

// Home
Expand Down
6 changes: 3 additions & 3 deletions src/styles/elements.sass
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
// Header
@mixin header-shared($shadow-color)
@mixin header-shared($shadow-color, $bg-width)
position: relative
text-shadow: 0px 2px 0 var(--theme-text-shadow-color)
z-index: 1
&::after
width: 50%
height: 0.5em
content: ""
width: $bg-width
height: 0.5em
display: block
position: absolute
background-color: $shadow-color
Expand Down
11 changes: 4 additions & 7 deletions src/styles/post-content.sass
Original file line number Diff line number Diff line change
Expand Up @@ -19,26 +19,23 @@
#edit-post-container .v-md-editor__preview-wrapper,
.site-style
h1
@include header-shared(rgba(var(--theme-accent-color--rgb), 0.5))
@include header-shared(rgba(var(--theme-accent-color--rgb), 0.5), 75%)
margin-top: 1rem
margin-bottom: 1rem
padding: 0 0.4rem
border: none

h2
@include header-shared(rgba(var(--theme-accent-color--rgb), 0.35))
display: inline-block
@include header-shared(rgba(var(--theme-accent-color--rgb), 0.35), 50%)
margin: 0.4rem 0
padding: 0 0.4rem

h3
@include header-shared(rgba(var(--theme-accent-color--rgb), 0.25))
display: inline-block
@include header-shared(rgba(var(--theme-accent-color--rgb), 0.25), 35%)
margin: 0.4rem 0
padding: 0 0.4rem

h4
@include header-shared(rgba(var(--theme-accent-color--rgb), 0.2))
display: inline-block
@include header-shared(rgba(var(--theme-accent-color--rgb), 0.2), 25%)
margin: 0.4rem 0
padding: 0 0.4rem

1 comment on commit 4665f9e

@vercel
Copy link

@vercel vercel bot commented on 4665f9e Oct 28, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.