Skip to content

Commit f5c65ec

Browse files
committed
fix: animation
1 parent d476d6f commit f5c65ec

File tree

7 files changed

+116
-125
lines changed

7 files changed

+116
-125
lines changed

components/Home.vue

Lines changed: 24 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -180,9 +180,8 @@ export default {
180180
}
181181
}
182182
}
183-
}
184183
185-
&.reco-hide {
184+
&.reco-hide {
186185
.hero {
187186
img {
188187
load-start()
@@ -212,33 +211,34 @@ export default {
212211
}
213212
}
214213
215-
&.reco-show {
216-
.hero {
217-
img {
218-
load-end(0.08s)
219-
}
220-
.h1 {
221-
load-end(0.16s)
214+
&.reco-show {
215+
.hero {
216+
img {
217+
load-end(0.08s)
218+
}
219+
.h1 {
220+
load-end(0.16s)
221+
}
222+
.description {
223+
load-end(0.24s)
224+
}
225+
.huawei {
226+
load-end(0.32s)
227+
}
228+
.action-button {
229+
load-end(0.4s)
230+
}
222231
}
223-
.description {
224-
load-end(0.24s)
232+
.features {
233+
load-end(0.40s)
225234
}
226-
.huawei {
227-
load-end(0.32s)
235+
.home-center {
236+
load-end(0.48s)
228237
}
229-
.action-button {
230-
load-end(0.4s)
238+
.footer {
239+
load-end(0.56s)
231240
}
232241
}
233-
.features {
234-
load-end(0.40s)
235-
}
236-
.home-center {
237-
load-end(0.48s)
238-
}
239-
.footer {
240-
load-end(0.56s)
241-
}
242242
}
243243
244244
@media (max-width: $MQMobile) {

components/HomeBlog.vue

Lines changed: 10 additions & 68 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@
1010
<div class="home-blog-wrapper">
1111
<!-- 博客列表 -->
1212
<note-abstract
13-
v-if="showList"
1413
class="blog-list"
1514
:data="posts"
1615
:isHome="true"
@@ -89,7 +88,6 @@ export default {
8988
return {
9089
recoShow: false,
9190
tags: [],
92-
showList: false
9391
}
9492
},
9593
computed: {
@@ -157,7 +155,6 @@ export default {
157155
},
158156
mounted () {
159157
this.recoShow = true
160-
this.showList = true
161158
},
162159
methods: {
163160
// 根据分类获取页面数据
@@ -217,10 +214,6 @@ export default {
217214
color: lighten($textColor, 20%);
218215
}
219216
}
220-
.home-blog-title {
221-
margin 0 auto 10px
222-
max-width 960px
223-
}
224217
.home-blog-wrapper {
225218
display flex
226219
align-items: flex-start;
@@ -325,49 +318,11 @@ export default {
325318
}
326319
}
327320
328-
.features {
329-
max-width 1126px
330-
padding: 1.2rem 0;
331-
margin: 2.5rem auto 0;
332-
display: flex;
333-
flex-wrap: wrap;
334-
align-items: flex-start;
335-
align-content: stretch;
336-
justify-content: space-between;
337-
}
338-
339-
.feature {
340-
flex-grow: 1;
341-
flex-basis: 30%;
342-
max-width: 32%;
343-
transition: all .5s
344-
box-sizing border-box
345-
margin-bottom 10px
346-
padding 0 15px
347-
box-shadow 0 2px 10px rgba(0,0,0,0.2)
348-
h2 {
349-
font-size: 1.6rem;
350-
font-weight: 500;
351-
border-bottom: none;
352-
padding-bottom: 0;
353-
color: lighten($textColor, 10%);
354-
}
355-
356-
p {
357-
color: lighten($textColor, 20%);
358-
}
359-
360-
&:hover {
361-
transform scale(1.05)
362-
}
363-
}
364-
365321
.footer {
366322
padding: 2.5rem;
367323
border-top: 1px solid $borderColor;
368324
text-align: center;
369325
color: lighten($textColor, 25%);
370-
load-start()
371326
> span {
372327
margin-left 1rem
373328
> i {
@@ -377,13 +332,14 @@ export default {
377332
}
378333
}
379334
380-
&.reco-hide {
335+
.reco-hide {
381336
.hero {
382337
img {
383338
load-start()
384339
}
385-
.h1 {
340+
h1 {
386341
load-start()
342+
color red
387343
}
388344
.description {
389345
load-start()
@@ -395,7 +351,7 @@ export default {
395351
load-start()
396352
}
397353
}
398-
.features {
354+
.home-blog-wrapper {
399355
load-start()
400356
}
401357
.home-center {
@@ -407,12 +363,12 @@ export default {
407363
}
408364
}
409365
410-
&.reco-show {
366+
.reco-show {
411367
.hero {
412368
img {
413369
load-end(0.08s)
414370
}
415-
.h1 {
371+
h1 {
416372
load-end(0.16s)
417373
}
418374
.description {
@@ -425,14 +381,14 @@ export default {
425381
load-end(0.4s)
426382
}
427383
}
428-
.features {
429-
load-end(0.40s)
384+
.home-blog-wrapper {
385+
load-end(0.48s)
430386
}
431387
.home-center {
432-
load-end(0.48s)
388+
load-end(0.56s)
433389
}
434390
.footer {
435-
load-end(0.56s)
391+
load-end(0.64s)
436392
}
437393
}
438394
@@ -466,14 +422,6 @@ export default {
466422
padding: 0.6rem 1.2rem;
467423
}
468424
}
469-
.features {
470-
flex-direction: column;
471-
}
472-
473-
.feature {
474-
max-width: 100%;
475-
padding: 0 2.5rem;
476-
}
477425
.home-blog-wrapper {
478426
.info-wrapper {
479427
display none!important
@@ -522,12 +470,6 @@ export default {
522470
}
523471
}
524472
525-
.feature {
526-
h2 {
527-
font-size: 1.25rem;
528-
}
529-
}
530-
531473
.home-blog-wrapper {
532474
.info-wrapper {
533475
display none!important

components/Page.vue

Lines changed: 29 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -233,30 +233,39 @@ function flatten (items, res) {
233233
padding-top 6rem
234234
padding-bottom 2rem
235235
display block
236+
#time-line {
237+
margin-top 0
238+
padding-top 0
239+
}
236240
.page-title
237241
max-width: 740px;
238242
margin: 0 auto;
239243
padding: 0rem 2.5rem;
240-
241-
.page-edit
242-
@extend $wrapper
243-
padding-top 1rem
244-
padding-bottom 1rem
245-
overflow auto
246-
.edit-link
247-
display inline-block
248-
a
249-
color lighten($textColor, 25%)
250-
margin-right 0.25rem
251-
.last-updated
252-
float right
253-
font-size 0.9em
254-
.prefix
255-
font-weight 500
256-
color lighten($textColor, 25%)
257-
.time
258-
font-weight 400
259-
color #aaa
244+
.page-edit
245+
@extend $wrapper
246+
padding-top 1rem
247+
padding-bottom 1rem
248+
overflow auto
249+
.edit-link
250+
display inline-block
251+
a
252+
color lighten($textColor, 25%)
253+
margin-right 0.25rem
254+
.last-updated
255+
float right
256+
font-size 0.9em
257+
.prefix
258+
font-weight 500
259+
color lighten($textColor, 25%)
260+
.time
261+
font-weight 400
262+
color #aaa
263+
&.reco-hide.page {
264+
load-start()
265+
}
266+
&.reco-show.page {
267+
load-end(0.08s)
268+
}
260269
261270
.page-nav
262271
@extend $wrapper
@@ -271,12 +280,6 @@ function flatten (items, res) {
271280
.next
272281
float right
273282
274-
.reco-hide.page {
275-
load-start()
276-
}
277-
.reco-show.page {
278-
load-end(0.08s)
279-
}
280283
281284
@media (max-width: $MQMobile)
282285
.page-title

layouts/Category.vue

Lines changed: 24 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,20 @@
11
<template>
2-
<div class="categories-wrapper">
2+
<div class="categories-wrapper" :class="recoShow ?'reco-show' : 'reco-hide'">
33
<!-- 公共布局 -->
44
<Common :sidebar="false" :isComment="false">
55
<!-- 页面标题 -->
66
<h2 class="title">{{ title }}</h2>
77

88
<!-- 博客列表 -->
99
<note-abstract
10+
class="list"
1011
:data="posts"
1112
:currentPage="currentPage"
1213
@currentTag="getCurrentTag"></note-abstract>
1314

1415
<!-- 分页 -->
1516
<pagation
17+
class="pagation"
1618
:data="posts"
1719
:currentPage="currentPage"
1820
@getCurrentPage="getCurrentPage"></pagation>
@@ -31,7 +33,8 @@ export default {
3133
data () {
3234
return {
3335
// 当前页码
34-
currentPage: 1
36+
currentPage: 1,
37+
recoShow: false
3538
}
3639
},
3740
@@ -51,6 +54,10 @@ export default {
5154
}
5255
},
5356
57+
mounted () {
58+
this.recoShow = true
59+
},
60+
5461
methods: {
5562
// 获取当前tag
5663
getCurrentTag (tag) {
@@ -72,12 +79,27 @@ export default {
7279
<style src="../styles/theme.styl" lang="stylus"></style>
7380

7481
<style lang="stylus" scoped>
82+
@require '../styles/loadMixin.styl'
7583
.categories-wrapper
7684
max-width: 740px;
7785
margin: 0 auto;
7886
padding: 4.6rem 2.5rem 0;
7987
.title
8088
margin-bottom 3rem
89+
&.reco-hide
90+
.title, .list, .pagation
91+
load-start()
92+
&.reco-show {
93+
.title {
94+
load-end(0.08s)
95+
}
96+
.list {
97+
load-end(0.16s)
98+
}
99+
.pagation {
100+
load-end(0.24s)
101+
}
102+
}
81103
82104
@media (max-width: $MQMobile)
83105
.categories-wrapper

0 commit comments

Comments
 (0)