1
1
<template >
2
2
<div
3
3
class =" theme-container"
4
- :class =" [{ 'doc-mode': !isHomepage }, ...pageClasses]"
4
+ :class =" [
5
+ { 'doc-mode': !isHomepage },
6
+ { 'start-mode': isInitializing },
7
+ ...pageClasses
8
+ ]"
5
9
@touchstart =" onTouchStart"
6
10
@touchend =" onTouchEnd"
7
11
>
39
43
<component :is =" $page.frontmatter.layout" />
40
44
</div >
41
45
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 >
55
60
56
61
<Previewer />
57
62
<Intro />
58
63
59
- <SWUpdatePopup :updateEvent =" swUpdateEvent" />
60
64
<footer class =" footer" >
61
65
<p >Released under the MIT License</p >
62
66
<p >© ; 2016-present Made with ♥ under Vuepress by PeachScript</p >
66
70
67
71
<script >
68
72
import ' 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' ;
72
76
73
77
export default {
74
78
extends: OfficialLayout,
79
+ data () {
80
+ return {
81
+ isInitializing: true ,
82
+ };
83
+ },
75
84
computed: {
76
85
isHomepage () {
77
86
return this .$page .frontmatter .home ;
78
87
},
79
88
},
89
+ mounted () {
90
+ setTimeout (() => {
91
+ this .isInitializing = false ;
92
+ }, 10 );
93
+ },
80
94
components: {
81
95
Intro,
82
96
Previewer,
@@ -85,8 +99,8 @@ export default {
85
99
</script >
86
100
87
101
<style lang="stylus">
88
- @require './styles/button'
89
- @require './styles/config'
102
+ @require '.. /styles/button'
103
+ @require '.. /styles/config'
90
104
91
105
body
92
106
font 16px / 1.42857 PingFang SC , Lantinghei SC , Microsoft Yahei , Hiragino Sans GB , Microsoft Sans Serif , WenQuanYi Micro Hei , sans-serif
102
116
pointer-events none
103
117
visibility hidden
104
118
105
- .links
119
+ .links ,
120
+ .sidebar-button
106
121
transition all 0.3s
107
122
108
123
.sidebar
135
150
margin-left 216px + $s-home-middle-gap
136
151
width 200px
137
152
height 200px
138
- background url ('./assets/images/logo.png' ) no-repeat center / 100%
153
+ background url ('.. /assets/images/logo.png' ) no-repeat center / 100%
139
154
140
155
@media (max-width 1080px )
141
156
margin-left 191px + ($s-home-middle-gap / 4 )
186
201
transition-delay 0.3s
187
202
188
203
.footer
189
- margin-top 700 px
204
+ margin-top 800 px
190
205
padding 15px 0
191
206
text-align center
192
207
background-color #f f f
@@ -205,19 +220,21 @@ body
205
220
.navbar
206
221
background transparent
207
222
208
- .links
223
+ .links ,
224
+ .sidebar-button
209
225
opacity 0
210
226
visibility hidden
211
227
transform translateY (10px )
212
228
213
- .page ,
214
229
.sidebar
215
230
visibility hidden
216
231
opacity 0
232
+ transform translateX (- 30px )
217
233
218
234
& .doc-mode
219
235
.navbar ,
220
236
.navbar .links ,
237
+ .navbar .sidebar-button ,
221
238
#logo ,
222
239
#logo + h1 ,
223
240
.previewer
228
245
#logo + h1
229
246
transition-delay 0s
230
247
231
- .sidebar ,
232
- .page
248
+ .sidebar
233
249
transition all 0.3s
234
250
transition-delay 0.6s
235
251
@@ -293,4 +309,20 @@ body
293
309
display block
294
310
visibility hidden
295
311
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
296
328
</style >
0 commit comments