DemuMesDataV/components/decoration4/index.vue

87 lines
1.6 KiB
Vue
Raw Normal View History

2018-12-08 19:05:03 +08:00
<template>
2019-06-25 19:57:04 +08:00
<div class="dv-decoration-4" :ref="ref">
<div
:class="`container ${reverse ? 'reverse' : 'normal'}`"
:style="reverse ? `width:${width}px;height:5px` : `width:5px;height:${height}px;`"
>
<svg :width="reverse ? width : 5" :height="reverse ? 5 : height">
<polyline
stroke="rgba(255, 255, 255, 0.3)"
:points="reverse ? `0, 2.5 ${width}, 2.5` : `2.5, 0 2.5, ${height}`"
/>
<polyline
class="bold-line"
stroke="rgba(255, 255, 255, 0.3)"
stroke-width="3"
stroke-dasharray="20, 80"
stroke-dashoffset="-30"
:points="reverse ? `0, 2.5 ${width}, 2.5` : `2.5, 0 2.5, ${height}`"
/>
</svg>
</div>
2018-12-08 19:05:03 +08:00
</div>
</template>
<script>
2019-06-25 19:57:04 +08:00
import autoResize from '../../mixins/autoResize.js'
2018-12-08 19:05:03 +08:00
export default {
name: 'Decoration4',
2019-06-25 19:57:04 +08:00
mixins: [autoResize],
props: ['reverse'],
2018-12-08 19:05:03 +08:00
data () {
return {
2019-06-25 19:57:04 +08:00
ref: 'decoration-4'
2018-12-08 19:05:03 +08:00
}
}
}
</script>
2019-01-16 16:56:11 +08:00
<style lang="less">
2019-06-25 19:57:04 +08:00
.dv-decoration-4 {
2019-01-16 16:56:11 +08:00
position: relative;
2019-06-25 19:57:04 +08:00
width: 100%;
height: 100%;
2018-12-08 19:05:03 +08:00
2019-06-25 19:57:04 +08:00
.container {
display: flex;
overflow: hidden;
2019-01-16 16:56:11 +08:00
position: absolute;
2018-12-08 19:05:03 +08:00
}
2019-06-25 19:57:04 +08:00
.normal {
height: 0% !important;
animation: ani-height 3s ease-in-out infinite;
left: 50%;
margin-left: -2px;
2018-12-08 19:05:03 +08:00
}
2019-06-25 19:57:04 +08:00
.reverse {
width: 0% !important;
animation: ani-width 3s ease-in-out infinite;
top: 50%;
margin-top: -2px;
2018-12-08 19:05:03 +08:00
}
@keyframes ani-height {
70% {
height: 100%;
}
100% {
height: 100%;
}
}
@keyframes ani-width {
70% {
width: 100%;
}
100% {
width: 100%;
}
}
}
</style>