|
1 | 1 | <template> |
2 | | - <div class="home-blog" :class="recoShow?'reco-show': 'reco-hide'"> |
3 | | - <div class="hero" :style="{background: `url(${$frontmatter.bgImage ? $withBase($frontmatter.bgImage) : require('../images/home-bg.jpg')}) center/cover no-repeat`, ...bgImageStyle}"> |
4 | | - <h1>{{ $frontmatter.heroText || $title || '午后南杂' }}</h1> |
| 2 | + <div class="home-blog"> |
| 3 | + <div |
| 4 | + class="hero" |
| 5 | + :style="{ |
| 6 | + background: `url(${$frontmatter.bgImage ? $withBase($frontmatter.bgImage) : require('../images/home-bg.jpg')}) center/cover no-repeat`, ...bgImageStyle}"> |
| 7 | + <ModuleTransition> |
| 8 | + <h1 v-if="recoShowMoudle">{{ $frontmatter.heroText || $title || '午后南杂' }}</h1> |
| 9 | + </ModuleTransition> |
5 | 10 |
|
6 | | - <p class="description">{{ $description || 'Welcome to your vuePress-theme-reco site' }}</p> |
7 | | - <p class="huawei" v-if="$themeConfig.huawei === true"><i class="iconfont reco-huawei" style="color: #fc2d38"></i> 华为,为中华而为之!</p> |
| 11 | + <ModuleTransition delay="0.08"> |
| 12 | + <p v-if="recoShowMoudle" class="description"> |
| 13 | + {{ $description || 'Welcome to your vuePress-theme-reco site' }} |
| 14 | + </p> |
| 15 | + </ModuleTransition> |
| 16 | + |
| 17 | + <ModuleTransition delay="0.16"> |
| 18 | + <p |
| 19 | + class="huawei" |
| 20 | + v-if="recoShowMoudle && $themeConfig.huawei === true"> |
| 21 | + <i class="iconfont reco-huawei" style="color: #fc2d38"></i> 华为,为中华而为之! |
| 22 | + </p> |
| 23 | + </ModuleTransition> |
8 | 24 | </div> |
9 | 25 |
|
10 | | - <div class="home-blog-wrapper"> |
11 | | - <div class="blog-list"> |
12 | | - <!-- 博客列表 --> |
13 | | - <note-abstract |
14 | | - :data="$recoPosts" |
15 | | - :hideAccessNumber="true" |
16 | | - :currentPage="currentPage"></note-abstract> |
17 | | - <!-- 分页 --> |
18 | | - <pagation |
19 | | - class="pagation" |
20 | | - :total="$recoPosts.length" |
21 | | - :currentPage="currentPage" |
22 | | - @getCurrentPage="getCurrentPage" /> |
23 | | - </div> |
24 | | - <div class="info-wrapper"> |
25 | | - <img class="personal-img" :src="$frontmatter.faceImage ? $withBase($frontmatter.faceImage) : require('../images/home-head.png')" alt="hero"> |
26 | | - <h3 class="name" v-if="$themeConfig.author || $site.title">{{ $themeConfig.author || $site.title }}</h3> |
27 | | - <div class="num"> |
28 | | - <div> |
29 | | - <h3>{{$recoPosts.length}}</h3> |
30 | | - <h6>文章</h6> |
31 | | - </div> |
32 | | - <div> |
33 | | - <h3>{{$tags.list.length}}</h3> |
34 | | - <h6>标签</h6> |
| 26 | + <ModuleTransition delay="0.24"> |
| 27 | + <div v-if="recoShowMoudle" class="home-blog-wrapper"> |
| 28 | + <div class="blog-list"> |
| 29 | + <!-- 博客列表 --> |
| 30 | + <note-abstract |
| 31 | + :data="$recoPosts" |
| 32 | + :hideAccessNumber="true" |
| 33 | + :currentPage="currentPage"></note-abstract> |
| 34 | + <!-- 分页 --> |
| 35 | + <pagation |
| 36 | + class="pagation" |
| 37 | + :total="$recoPosts.length" |
| 38 | + :currentPage="currentPage" |
| 39 | + @getCurrentPage="getCurrentPage" /> |
| 40 | + </div> |
| 41 | + <div class="info-wrapper"> |
| 42 | + <img class="personal-img" :src="$frontmatter.faceImage ? $withBase($frontmatter.faceImage) : require('../images/home-head.png')" alt="hero"> |
| 43 | + <h3 class="name" v-if="$themeConfig.author || $site.title">{{ $themeConfig.author || $site.title }}</h3> |
| 44 | + <div class="num"> |
| 45 | + <div> |
| 46 | + <h3>{{$recoPosts.length}}</h3> |
| 47 | + <h6>文章</h6> |
| 48 | + </div> |
| 49 | + <div> |
| 50 | + <h3>{{$tags.list.length}}</h3> |
| 51 | + <h6>标签</h6> |
| 52 | + </div> |
35 | 53 | </div> |
| 54 | + <hr> |
| 55 | + <h4><i class="iconfont reco-category"></i> 分类</h4> |
| 56 | + <ul class="category-wrapper"> |
| 57 | + <li class="category-item" v-for="(item, index) in this.$categories.list" :key="index"> |
| 58 | + <router-link :to="item.path"> |
| 59 | + <span class="category-name">{{ item.name }}</span> |
| 60 | + <span class="post-num" :style="{ 'backgroundColor': getOneColor() }">{{ item.pages.length }}</span> |
| 61 | + </router-link> |
| 62 | + </li> |
| 63 | + </ul> |
| 64 | + <hr> |
| 65 | + <h4 v-if="$tags.list.length !== 0"><i class="iconfont reco-tag"></i> 标签</h4> |
| 66 | + <TagList @getCurrentTag="getPagesByTags" /> |
| 67 | + <h4 v-if="$themeConfig.friendLink && $themeConfig.friendLink.length !== 0"><i class="iconfont reco-friend"></i> 友链</h4> |
| 68 | + <FriendLink /> |
36 | 69 | </div> |
37 | | - <hr> |
38 | | - <h4><i class="iconfont reco-category"></i> 分类</h4> |
39 | | - <ul class="category-wrapper"> |
40 | | - <li class="category-item" v-for="(item, index) in this.$categories.list" :key="index"> |
41 | | - <router-link :to="item.path"> |
42 | | - <span class="category-name">{{ item.name }}</span> |
43 | | - <span class="post-num" :style="{ 'backgroundColor': getOneColor() }">{{ item.pages.length }}</span> |
44 | | - </router-link> |
45 | | - </li> |
46 | | - </ul> |
47 | | - <hr> |
48 | | - <h4 v-if="$tags.list.length !== 0"><i class="iconfont reco-tag"></i> 标签</h4> |
49 | | - <TagList @getCurrentTag="getPagesByTags" /> |
50 | | - <h4 v-if="$themeConfig.friendLink && $themeConfig.friendLink.length !== 0"><i class="iconfont reco-friend"></i> 友链</h4> |
51 | | - <FriendLink /> |
52 | 70 | </div> |
53 | | - </div> |
| 71 | + </ModuleTransition> |
54 | 72 |
|
55 | | - <Content class="home-center" custom/> |
| 73 | + <ModuleTransition delay="0.36"> |
| 74 | + <Content v-if="recoShowMoudle" class="home-center" custom/> |
| 75 | + </ModuleTransition> |
56 | 76 | </div> |
57 | 77 | </template> |
58 | 78 |
|
59 | 79 | <script> |
60 | | -import TagList from '@theme/components/TagList.vue' |
61 | | -import FriendLink from '@theme/components/FriendLink.vue' |
62 | | -import NoteAbstract from '@theme/components/NoteAbstract.vue' |
| 80 | +import TagList from '@theme/components/TagList' |
| 81 | +import FriendLink from '@theme/components/FriendLink' |
| 82 | +import NoteAbstract from '@theme/components/NoteAbstract' |
63 | 83 | import pagination from '@theme/mixins/pagination' |
| 84 | +import ModuleTransition from '@theme/components/ModuleTransition' |
64 | 85 | import { getOneColor } from '@theme/helpers/other' |
65 | 86 |
|
66 | 87 | export default { |
67 | 88 | mixins: [pagination], |
68 | | - components: { NoteAbstract, TagList, FriendLink }, |
| 89 | + components: { NoteAbstract, TagList, FriendLink, ModuleTransition }, |
69 | 90 | data () { |
70 | 91 | return { |
71 | 92 | recoShow: false, |
@@ -263,60 +284,6 @@ export default { |
263 | 284 | } |
264 | 285 | } |
265 | 286 |
|
266 | | -.reco-hide { |
267 | | - .hero { |
268 | | - img { |
269 | | - load-start() |
270 | | - } |
271 | | - h1 { |
272 | | - load-start() |
273 | | - color red |
274 | | - } |
275 | | - .description { |
276 | | - load-start() |
277 | | - } |
278 | | - .huawei { |
279 | | - load-start() |
280 | | - } |
281 | | - .action-button { |
282 | | - load-start() |
283 | | - } |
284 | | - } |
285 | | - .home-blog-wrapper { |
286 | | - load-start() |
287 | | - } |
288 | | - .home-center { |
289 | | - load-start() |
290 | | - padding 0 |
291 | | - } |
292 | | -} |
293 | | -
|
294 | | -.reco-show { |
295 | | - .hero { |
296 | | - img { |
297 | | - load-end(0.08s) |
298 | | - } |
299 | | - h1 { |
300 | | - load-end(0.16s) |
301 | | - } |
302 | | - .description { |
303 | | - load-end(0.24s) |
304 | | - } |
305 | | - .huawei { |
306 | | - load-end(0.32s) |
307 | | - } |
308 | | - .action-button { |
309 | | - load-end(0.4s) |
310 | | - } |
311 | | - } |
312 | | - .home-blog-wrapper { |
313 | | - load-end(0.48s) |
314 | | - } |
315 | | - .home-center { |
316 | | - load-end(0.56s) |
317 | | - } |
318 | | -} |
319 | | -
|
320 | 287 | @media (max-width: $MQMobile) { |
321 | 288 | .home-blog { |
322 | 289 | padding-left: 1.5rem; |
|
0 commit comments