Skip to content

Commit

Permalink
fix(sidebar): change mobile sidebar animation
Browse files Browse the repository at this point in the history
  • Loading branch information
xcyeye committed Oct 24, 2021
1 parent 1cfa12d commit 342797f
Show file tree
Hide file tree
Showing 3 changed files with 41 additions and 52 deletions.
Expand Up @@ -2,10 +2,10 @@
<template>
<!--这是页面右侧的侧边栏,和默认主题的侧边栏不同-->
<div ref="sidebar-top" class="sidebar-cqy"></div>
<div :style="$store.state.borderRadiusStyle + $store.state.opacityStyle" id="stickSidebar"
<div :style="getHomeSidebarStyle" id="stickSidebar"
:class="{'sidebar-single-enter-animate': showEnterAnimate}">
<!---->
<div :class="{sidebarScroll: isShowCatalog}" class="home-sidebar" id="home-sidebar">
<div :class="{sidebarScroll: isShowCatalog}" :style="setHomeSidebarStyle" class="home-sidebar" id="home-sidebar">

<!--头像信息-->
<div :id="customId" v-if="showPersonInfo" class="sidebar-single-common">
Expand Down Expand Up @@ -338,6 +338,17 @@ export default {
}
},
computed: {
setHomeSidebarStyle() {
if (this.isMobileSidebar) {
return "border-radius: 0px;"
}
},
getHomeSidebarStyle() {
if (!this.isMobileSidebar) {
return this.$store.state.borderRadiusStyle + this.$store.state.opacityStyle
}
return this.$store.state.opacityStyle
},
getShowSidebarLink() {
if (!this.showSidebarLink) {
return false
Expand Down
16 changes: 14 additions & 2 deletions docs/.vuepress/theme/lib/client/components/child/tag/TagPage.vue
Expand Up @@ -21,6 +21,8 @@
</template>

<script>
import {useThemeLocaleData} from "../../../composables";
export default {
name: "TagPage",
data() {
Expand All @@ -35,8 +37,18 @@ export default {
},
computed: {
setBackgroundImg() {
let random = (+new Date()) / this.getRandomInt(0,10000)
return "background-image: url(https://api.iro.tw/webp_pc.php?time=" + random + ");"
let num1 = this.getRandomInt(-9999,999)
let num2 = this.getRandomInt(0,300)
let num3 = this.getRandomInt(0,30)
let num = num2 / num3 * num1 + num2
let homePageImgApi = this.themeProperty.homePageImgApi
if (homePageImgApi === undefined) {
homePageImgApi = "https://api.ixiaowai.cn/api/api.php"
}
let path = homePageImgApi + "?time=" + num
return "background-image: url(" + path + ");"
},
getRandomIntValue() {
return (min, max) => {
Expand Down
62 changes: 14 additions & 48 deletions docs/.vuepress/theme/lib/client/styles/theme.style.css

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 342797f

Please sign in to comment.