mand-mobile/examples/home.vue

105 lines
2.1 KiB
Vue
Raw Normal View History

2018-03-26 16:04:04 +08:00
<template>
<div class="md-home">
<div class="md-home-logo">
<img src="//manhattan.didistatic.com/static/manhattan/mand/docs/mand-logo-black.svg" alt="">
</div>
2018-12-13 17:07:42 +08:00
<div class="md-home-name" data-in-effect="fadeInLeftBig">Mand Mobile 2</div>
2018-03-26 16:04:04 +08:00
<div class="md-home-time">0%</div>
<h1 class="md-home-copyright">Produced By DiDi - FDC &times; MFE</h1>
</div>
</template>
<script>
export default {
data() {
return {
percent: 0,
}
},
mounted() {
$('.md-home-name')
.textillate()
.on('end.tlt')
this.timeCount(() => {
this.$router.replace('/category')
})
},
methods: {
timeCount(fn) {
const duration = 2000
const tick = 100
const per = 100 / (duration / tick)
let percent = 0
const time = setInterval(() => {
if (percent < 100) {
percent += per
$('.md-home-time').text(`${parseInt(percent)}%`)
} else {
clearInterval(time)
2018-09-28 18:10:57 +08:00
setTimeout(() => {
fn()
}, 300)
2018-03-26 16:04:04 +08:00
}
}, tick)
},
},
}
</script>
<style lang="stylus">
.md-home
position fixed
absolute-pos()
background color-bg-base
.md-home-logo
position absolute
top 30%
left 50%
2018-09-28 18:10:57 +08:00
width 96px
height 96px
margin-left -48px
animation blur-out 2s ease-in-out-quint forwards
img
width 100%
2018-03-26 16:04:04 +08:00
.md-home-name
position absolute
width 100%
top 45%
left 0
font-size font-heading-medium
2018-11-20 11:30:53 +08:00
font-family DINAlternate-Bold
2018-09-28 18:10:57 +08:00
color color-text-base
2018-03-26 16:04:04 +08:00
text-align center
2018-12-13 17:07:42 +08:00
span.word3
2018-09-28 18:10:57 +08:00
color color-primary
2018-12-04 16:41:39 +08:00
font-family DINAlternate-Bold
2018-03-26 16:04:04 +08:00
.md-home-time
position absolute
width 100%
top 50%
left 0
font-size font-minor-normal
2018-12-13 17:07:42 +08:00
font-weight font-weight-light
2018-03-26 16:04:04 +08:00
color color-text-minor
text-align center
.md-home-copyright
position fixed
left 0
bottom 20px
width 100%
text-align center
font-size font-minor-normal
font-weight 300
color color-text-caption
2018-09-28 18:10:57 +08:00
@keyframes blur-out
from
transform scale(2)
filter blur(100px)
to
filter blur(0)
transform scale(1)
2018-03-26 16:04:04 +08:00
</style>