tui-notice-board.vue
1.44 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
<template>
<view class="tui-notice-board">
<view class="tui-icon-bg">
<zui-icon name="notice" size="36rpx"></zui-icon>
</view>
<view class="tui-scorll-view">
<view class="tui-notice" :class="[animation ? 'tui-animation' : '']">{{ text }}</view>
</view>
</view>
</template>
<script>
export default {
props: {
animation: {
type: Boolean,
default: true
},
text: String,
},
}
</script>
<style scoped>
.tui-notice-board {
width: 100%;
padding-right: 30rpx;
box-sizing: border-box;
font-size: 28rpx;
height: 60rpx;
background: #f0f9ff;
color: #3296FA;
display: flex;
align-items: center;
position: fixed;
top: 0;
/* #ifdef H5 */
top: 44px;
/* #endif */
z-index: 999;
}
.tui-icon-bg {
padding-left: 30rpx;
padding-right: 20rpx;
position: relative;
z-index: 10;
}
.tui-scorll-view {
flex: 1;
line-height: 1;
white-space: nowrap;
overflow: hidden;
}
.tui-notice {
-webkit-backface-visibility: hidden;
-webkit-perspective: 1000;
transform: translate3d(100%, 0, 0);
}
.tui-animation {
-webkit-animation: tui-rolling 12s linear infinite;
animation: tui-rolling 12s linear infinite;
}
@-webkit-keyframes tui-rolling {
0% {
transform: translate3d(100%, 0, 0);
}
100% {
transform: translate3d(-170%, 0, 0);
}
}
@keyframes tui-rolling {
0% {
transform: translate3d(100%, 0, 0);
}
100% {
transform: translate3d(-170%, 0, 0);
}
}
</style>