4 changed files with 152 additions and 20 deletions
After Width: | Height: | Size: 10 KiB |
@ -0,0 +1,131 @@ |
|||||
|
<template> |
||||
|
<div style="height: 36px" class="screen-title-w"> |
||||
|
<div class="box"> |
||||
|
<div class="guang" v-if="ifTime"> |
||||
|
<img |
||||
|
class="guang-img" |
||||
|
:src="require('@/assets/images/common/guang-zd.png')" |
||||
|
/> |
||||
|
</div> |
||||
|
<div class="guang1" v-if="ifTime"> |
||||
|
<img |
||||
|
class="guang-img1" |
||||
|
:src="require('@/assets/images/common/guang-zd.png')" |
||||
|
/> |
||||
|
</div> |
||||
|
</div> |
||||
|
<div class="screen-title"> |
||||
|
<div class="left"> |
||||
|
<slot name="left"></slot> |
||||
|
</div> |
||||
|
<div class="right"> |
||||
|
<slot name="right"></slot> |
||||
|
</div> |
||||
|
</div> |
||||
|
</div> |
||||
|
</template> |
||||
|
|
||||
|
<script> |
||||
|
export default { |
||||
|
name: "screen-title", |
||||
|
// mounted() { |
||||
|
// console.log("Math.random()", Math.random()); |
||||
|
// // JavaScript Math.random() |
||||
|
// }, |
||||
|
data() { |
||||
|
return { |
||||
|
ifTime: false, |
||||
|
}; |
||||
|
}, |
||||
|
// created() { |
||||
|
// }, |
||||
|
mounted() { |
||||
|
let times = (Math.random() * 2000).toFixed(0); |
||||
|
setTimeout(() => { |
||||
|
this.ifTime = true; |
||||
|
}, times); |
||||
|
}, |
||||
|
}; |
||||
|
</script> |
||||
|
|
||||
|
<style lang="scss" scoped> |
||||
|
@keyframes run { |
||||
|
0% { |
||||
|
left: 0%; |
||||
|
} |
||||
|
100% { |
||||
|
left: calc(100% + 536px); |
||||
|
} |
||||
|
} |
||||
|
@keyframes run1 { |
||||
|
0% { |
||||
|
left: calc(0% - 268px); |
||||
|
} |
||||
|
100% { |
||||
|
left: calc(100% + 268px); |
||||
|
} |
||||
|
} |
||||
|
.screen-title-w { |
||||
|
width: 100%; |
||||
|
height: 36px; |
||||
|
background-size: 100% 100%; |
||||
|
background: url("~@/assets/images/common/card_title_sz.png") no-repeat; |
||||
|
} |
||||
|
.screen-title { |
||||
|
position: relative; |
||||
|
top: -36px; |
||||
|
width: 100%; |
||||
|
height: 36px; |
||||
|
background-position: 0 0; |
||||
|
@include flex(); |
||||
|
align-items: center; |
||||
|
justify-content: space-between; |
||||
|
font-family: "zaozigongfang"; |
||||
|
font-style: italic; |
||||
|
font-size: 16px; |
||||
|
// background-size: 100% 100%; |
||||
|
// background: url("~@/assets/images/common/card_title_red.png") no-repeat; |
||||
|
padding-right: 16px; |
||||
|
box-sizing: border-box; |
||||
|
.left { |
||||
|
margin-left: 44px; |
||||
|
height: 50px; |
||||
|
line-height: 64px; |
||||
|
} |
||||
|
.right { |
||||
|
font-style: normal; |
||||
|
} |
||||
|
} |
||||
|
.box { |
||||
|
position: relative; |
||||
|
height: 36px; |
||||
|
overflow: hidden; |
||||
|
.guang { |
||||
|
position: relative; |
||||
|
.guang-img { |
||||
|
width: 268px; |
||||
|
height: 26px; |
||||
|
animation: run 4s linear infinite; |
||||
|
position: relative; |
||||
|
top: -10px; |
||||
|
} |
||||
|
} |
||||
|
.guang1 { |
||||
|
position: relative; |
||||
|
.guang-img1 { |
||||
|
width: 268px; |
||||
|
height: 26px; |
||||
|
animation: run1 4s linear infinite; |
||||
|
position: relative; |
||||
|
bottom: 10px; |
||||
|
} |
||||
|
} |
||||
|
} |
||||
|
</style> |
||||
|
|
||||
|
<style scoped> |
||||
|
/* .screen-title-right > span { |
||||
|
border: 1px solid #e7743b !important; |
||||
|
color: #fbe9c5 !important; |
||||
|
} */ |
||||
|
</style> |
Loading…
Reference in new issue