2023西安数博会CIM演示-【前端】-Web
AdaKing88
2023-08-21 bc03b832caa49bbcd2674fe4cae3701b5059bf95
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
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
<template>
<div class="highMonthContainer">
  <div class="red" ref="red">
    <div class="value">
      <p class="count tc">9</p>
      <p class="month tc">2月</p>
    </div>
  </div>
  <div class="yellow" ref="yellow">
    <div class="value">
      <p class="count tc">3</p>
      <p class="month tc">6月</p>
    </div>
  </div>
  <div class="blue" ref="blue">
    <div class="value">
      <p class="count tc">7</p>
      <p class="month tc">5月</p>
    </div>
  </div>
</div>
</template>
 
<script>
export default {
  name: 'highMonth',
  components: {},
  data() {
    return {
      timer: null
    }
  },
  mounted() {
    this.$nextTick(() => {
      this.initAnimate()
    })
  },
  destroyed() {
    clearTimeout(this.timer)
  },
  methods: {
    initAnimate() {
      clearTimeout(this.timer)
      // this.timer = setTimeout(() => {
      //   this.$refs.red.style.transform = 'translateY(' + (Math.floor(Math.random() * (20 - (-20) + 1)) + (-20)) + 'px)'
      //   this.$refs.yellow.style.transform = 'translateY(' + (Math.floor(Math.random() * (20 - (-20) + 1)) + (-20)) + 'px)'
      //   this.$refs.blue.style.transform = 'translateY(' + (Math.floor(Math.random() * (20 - (-20) + 1)) + (-20)) + 'px)'
      //   setTimeout(() => {
      //     // console.log(this.$refs.red)
      //     // console.log(this.$refs.yellow)
      //     // console.log(this.$refs.blue)
      //     if (this.$refs.red && this.$refs.yellow && this.$refs.yellow) {
      //       this.$refs.red.style.transform = 'translateY(0)'
      //       this.$refs.yellow.style.transform = 'translateY(0)'
      //       this.$refs.blue.style.transform = 'translateY(0)'
      //       this.initAnimate()
      //     }
      //   }, 2000)
      // }, 2000)
    }
  }
}
</script>
 
<style lang="scss" scoped>
.highMonthContainer {
  height: 40%;
  position: relative;
  .red {
    position: absolute;
    width: 110px;
    height: 110px;
    background-size: 100% 100%;
    top: 5px;
    left: 10px;
    background: no-repeat url('~@/assets/img/lifeline/riskMonitoring/month.png');
    background-size: 100% 100%;
  }
 
  .yellow {
    position: absolute;
    width: 90px;
    height: 90px;
    top: 10px;
    left: 140px;
    background: no-repeat url('~@/assets/img/lifeline/riskMonitoring/month.png');
    background-size: 100% 100%;
  }
 
  .blue {
    position: absolute;
    width: 100px;
    height: 100px;
    top: 0px;
    right: 10px;
    background: no-repeat url('~@/assets/img/lifeline/riskMonitoring/month.png');
    background-size: 100% 100%;
  }
  .value {
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: center;
    .count{
      font-size: 28px;
      font-family: YouSheBiaoTiHei, YouSheBiaoTiHei-Regular;
      font-weight: 400;
      text-align: center;
      color: #fefefe;
      letter-spacing: 1.5px;
      text-shadow: 0px 1.5px 12px 0px rgba(0,29,45,0.53);
      background: linear-gradient(0deg,rgba(62,242,255,1) 0%, rgba(222,222,222,1) 100%);
      -webkit-text-fill-color: transparent;
      -webkit-background-clip: text;
    }
    .month {
      font-size: 16px;
      font-family: Source Han Sans CN, Source Han Sans CN-Regular;
      font-weight: 400;
      text-align: center;
      color: #cbcbcb;
      letter-spacing: 1.8px;
      text-shadow: 0px 1.5px 0.98px 0.03px rgba(0,14,17,0.19);
    }
  }
}
</style>