11<template >
22 <div
33 class =" theme-container"
4- :class =" [{ 'doc-mode': !isHomepage }, ...pageClasses]"
4+ :class =" [
5+ { 'doc-mode': !isHomepage },
6+ { 'start-mode': isInitializing },
7+ ...pageClasses
8+ ]"
59 @touchstart =" onTouchStart"
610 @touchend =" onTouchEnd"
711 >
3943 <component :is =" $page.frontmatter.layout" />
4044 </div >
4145
42- <Page
43- v-else
44- :sidebar-items =" sidebarItems"
45- >
46- <slot
47- name =" page-top"
48- slot =" top"
49- />
50- <slot
51- name =" page-bottom"
52- slot =" bottom"
53- />
54- </Page >
46+ <template v-else-if =" $page .frontmatter .home " />
47+
48+ <transition name =" content-fade" appear v-else >
49+ <Page :sidebar-items =" sidebarItems" >
50+ <slot
51+ name =" page-top"
52+ slot =" top"
53+ />
54+ <slot
55+ name =" page-bottom"
56+ slot =" bottom"
57+ />
58+ </Page >
59+ </transition >
5560
5661 <Previewer />
5762 <Intro />
5863
59- <SWUpdatePopup :updateEvent =" swUpdateEvent" />
6064 <footer class =" footer" >
6165 <p >Released under the MIT License</p >
6266 <p >© ; 2016-present Made with ♥ under Vuepress by PeachScript</p >
6670
6771<script >
6872import ' focus-visible' ;
69- import OfficialLayout from ' vuepress/lib/default- theme/Layout' ;
70- import Intro from ' ./components/Intro' ;
71- import Previewer from ' ./components/Previewer' ;
73+ import OfficialLayout from ' @ vuepress/theme-default/layouts /Layout' ;
74+ import Intro from ' .. /components/Intro' ;
75+ import Previewer from ' .. /components/Previewer' ;
7276
7377export default {
7478 extends: OfficialLayout,
79+ data () {
80+ return {
81+ isInitializing: true ,
82+ };
83+ },
7584 computed: {
7685 isHomepage () {
7786 return this .$page .frontmatter .home ;
7887 },
7988 },
89+ mounted () {
90+ setTimeout (() => {
91+ this .isInitializing = false ;
92+ }, 10 );
93+ },
8094 components: {
8195 Intro,
8296 Previewer,
@@ -85,8 +99,8 @@ export default {
8599 </script >
86100
87101<style lang="stylus">
88- @require './styles/button'
89- @require './styles/config'
102+ @require '.. /styles/button'
103+ @require '.. /styles/config'
90104
91105body
92106 font 16px / 1.42857 PingFang SC , Lantinghei SC , Microsoft Yahei , Hiragino Sans GB , Microsoft Sans Serif , WenQuanYi Micro Hei , sans-serif
102116 pointer-events none
103117 visibility hidden
104118
105- .links
119+ .links ,
120+ .sidebar-button
106121 transition all 0.3s
107122
108123.sidebar
135150 margin-left 216px + $s-home-middle-gap
136151 width 200px
137152 height 200px
138- background url ('./assets/images/logo.png' ) no-repeat center / 100%
153+ background url ('.. /assets/images/logo.png' ) no-repeat center / 100%
139154
140155 @media (max-width 1080px )
141156 margin-left 191px + ($s-home-middle-gap / 4 )
186201 transition-delay 0.3s
187202
188203 .footer
189- margin-top 700 px
204+ margin-top 800 px
190205 padding 15px 0
191206 text-align center
192207 background-color #f f f
@@ -205,19 +220,21 @@ body
205220 .navbar
206221 background transparent
207222
208- .links
223+ .links ,
224+ .sidebar-button
209225 opacity 0
210226 visibility hidden
211227 transform translateY (10px )
212228
213- .page ,
214229 .sidebar
215230 visibility hidden
216231 opacity 0
232+ transform translateX (- 30px )
217233
218234 & .doc-mode
219235 .navbar ,
220236 .navbar .links ,
237+ .navbar .sidebar-button ,
221238 #logo ,
222239 #logo + h1 ,
223240 .previewer
228245 #logo + h1
229246 transition-delay 0s
230247
231- .sidebar ,
232- .page
248+ .sidebar
233249 transition all 0.3s
234250 transition-delay 0.6s
235251
@@ -293,4 +309,20 @@ body
293309 display block
294310 visibility hidden
295311 pointer-events none
312+
313+ // content transition
314+ .content-fade-enter-active ,
315+ .content-fade-leave-active
316+ transition : all 0.3s
317+
318+ .content-fade-enter ,
319+ .content-fade-leave-to
320+ opacity 0
321+ visibility hidden
322+
323+ .content-fade-enter
324+ transform : translateY (20px )
325+
326+ .doc-mode :not (.start-mode ) .content-fade-enter-active
327+ transition-delay 0.6s
296328 </style >
0 commit comments