• 数字翻牌器


    效果入下:
    效果

    // 翻牌器组件 countFlop.vue

    <template>
      <div class="count-flop" :key="compKey">
        <div :class="item!='.'?'count-flop-box':'count-flop-point'" v-for="(item, index) in value" :key="index">
          <div v-if="item!='.'" class="count-flop-content" :class="['rolling_' + item]">
            <div v-for="(item2,index2) in numberList" :key="index2" class="count-flop-num">{{item2}}div>
          div>
          <div v-else class="count-flop-content">.div>
        div>
        <div v-if="suffix" class="count-flop-box">{{suffix}}div>
      div>
    template>
    <script>
      export default {
        data() {
          return {
            value: [],
            numberList: [0, 1, 2, 3, 4, 5, 6, 7, 8, 9],
            compKey: 0
          };
        },
        props: ["val","suffix"],
        watch: {
          val() {
            this.value = this.val.toString().split("");
            this.compKey += 1;
          }
        },
        created() {
          this.value = this.val.toString().split("");
        },
      };
    script>
    <style scoped>
      @font-face {
        font-family: "UnidreamLED";
        src: url("../../static/fonts/UnidreamLED.ttf") format("truetype");
      }
      .count-flop {
        display: inline-block;
        font-size: 0;
        height: 80px;
        line-height: 80px;
        font-size: 36px;
        color: #4898f1;
        font-size: 0;
      }
      .count-flop > div {
        position: relative;
        display: inline-block;
        overflow: hidden;
        height: 100%;
      }
      .count-flop-box {
        margin-right: 7px;
        width: 40px;
        line-height: 80px;
        color: #60EAFF;
        position: relative;
        font-size: 36px;
      }
      .count-flop-box:last-child {
        margin: 0;
      }
      .count-flop-box::after, .count-flop-box::before {
        display: inline-block;
        content: "";
        width: 40px;
        height: 38px;
        background: rgba(56,160,214,0.5);
        position: absolute;
        left: 0;
      }
      .count-flop-box::after {
        top: 0;
      }
      .count-flop-box::before {
        bottom: 0;
      }
      .count-flop-point {
        margin-right: 5px;
        width: 10px;
      }
      .count-flop-content {
        font-family: "UnidreamLED", "Helvetica Neue", Helvetica, Arial, sans-serif;
        text-align: center;
        position: absolute;
        left: 0;
        top: 0;
        width: 100%;
        animation-fill-mode: forwards !important;
        font-size: 46px;
      }
      .rolling_0 {
        animation: rolling_0 2.1s ease;
      }
      @keyframes rolling_0 {
        from {
          transform: translateY(-90%);
        }
        to {
          transform: translateY(0);
        }
      }
      .rolling_1 {
        animation: rolling_1 3s ease;
      }
      @keyframes rolling_1 {
        from {
          transform: translateY(0);
        }
        to {
          transform: translateY(-10%);
        }
      }
      .rolling_2 {
        animation: rolling_2 2.1s ease;
      }
      @keyframes rolling_2 {
        from {
          transform: translateY(0);
        }
        to {
          transform: translateY(-20%);
        }
      }
      .rolling_3 {
        animation: rolling_3 3s ease;
      }
      @keyframes rolling_3 {
        from {
          transform: translateY(0);
        }
        to {
          transform: translateY(-30%);
        }
      }
      .rolling_4 {
        animation: rolling_4 2.1s ease;
      }
      @keyframes rolling_4 {
        from {
          transform: translateY(0);
        }
        to {
          transform: translateY(-40%);
        }
      }
      .rolling_5 {
        animation: rolling_5 3s ease;
      }
      @keyframes rolling_5 {
        from {
          transform: translateY(0);
        }
        to {
          transform: translateY(-50%);
        }
      }
      .rolling_6 {
        animation: rolling_6 2.1s ease;
      }
      @keyframes rolling_6 {
        from {
          transform: translateY(0);
        }
        to {
          transform: translateY(-60%);
        }
      }
      .rolling_7 {
        animation: rolling_7 3.1s ease;
      }
      @keyframes rolling_7 {
        from {
          transform: translateY(0);
        }
        to {
          transform: translateY(-70%);
        }
      }
      .rolling_8 {
        animation: rolling_8 2.1s ease;
      }
      @keyframes rolling_8 {
        from {
          transform: translateY(0);
        }
        to {
          transform: translateY(-80%);
        }
      }
      .rolling_9 {
        animation: rolling_9 3.6s ease;
      }
      @keyframes rolling_9 {
        from {
          transform: translateY(0);
        }
        to {
          transform: translateY(-90%);
        }
      }
    style>
    
    • 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
    • 128
    • 129
    • 130
    • 131
    • 132
    • 133
    • 134
    • 135
    • 136
    • 137
    • 138
    • 139
    • 140
    • 141
    • 142
    • 143
    • 144
    • 145
    • 146
    • 147
    • 148
    • 149
    • 150
    • 151
    • 152
    • 153
    • 154
    • 155
    • 156
    • 157
    • 158
    • 159
    • 160
    • 161
    • 162
    • 163
    • 164
    • 165
    • 166
    • 167
    • 168
    • 169
    • 170
    • 171
    • 172
    • 173
    • 174
    • 175
    • 176
    • 177
    • 178
    • 179
    • 180
    • 181
    • 182
    • 183
    • 184
    • 185
    • 186
    • 187
    • 188
    • 189
    • 190
    • 191
    • 192
    • 193
    • 194
    • 195
    • 196
    • 197
    • 198
    • 199
    • 200
    • 201
    • 202
    • 203

    引用:

    <countFlop :val="total" suffix=""/>
    
    • 1
  • 相关阅读:
    展开说说:Android Fragment完全解析-卷一
    基本的 Linux 命令以及 Linux 目录结构
    ChatGPT在机器人护理和老年人支持中的潜在角色如何?
    配置多仓库根目录(阁瑞钛伦特软件-九耶实训)
    前端html+css面试题
    配置iTerm2打开自动执行命令
    如何实现两个电脑之间通过以太网(网线)实现文件互传
    第二十八章 车道线检测中的论文梳理(车道线感知)
    苹果macOS无法给App麦克风授权解决办法
    jupyter 切换虚拟环境
  • 原文地址:https://blog.csdn.net/qq_41604686/article/details/127637514