whyczyk
2021-07-31 04c2eb1db65b16f8d1b5c6a3b1eda6bb843f2bc3
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
<template>
  <div class="axis"
    :style="{'left':+position[0][0]+'px','top':+(position[0][1] - 5)+'px','width':+(position[1][0]-position[0][0]>0?position[1][0]-position[0][0]:position[0][0]-position[1][0])+'px'}">
    <div class="inner"></div>
  </div>
</template>
 
<script>
  export default {
    props: {
      position: {
        type: Array,
        default () {
          return [
            [0, 0],
            [100, 0]
          ]
        }
      },
    },
    data() {
      return {
 
      }
    },
    mounted() {}
  }
</script>
 
<style scoped>
  .axis {
    position: absolute;
    height: 14px;
    background-color: #f1f1f1;
    top: 400px;
    z-index: 11;
    overflow: hidden;
    border-radius: 4px;
  }
 
  .axis .inner {
    width: 100%;
    height: 18px;
    background-image: linear-gradient(#f1f1f1 0%, #535353 95%, #535353 100%);
    position: absolute;
    left: 0;
    top: -18px;
    animation: axis 0.3s infinite;
    -webkit-animation: axis 0.3s infinite;
  }
 
  @keyframes axis {
    0% {
      top: -18px;
    }
 
    100% {
      top: 0;
    }
  }
</style>