tui-notice-board.vue 1.44 KB
<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>