vue扫描指纹动画

 

<script lang="ts" setup>
  import { onMounted } from 'vue'

  onMounted(() => {
     const  getsize = () => {
      var scanner = document.getElementById('scanner1')
      console.log(scanner)
      var liang = document.getElementById('liang')
      var fingarprint = document.getElementById('fingarprint1')
      var scanner_width = scanner.offsetWidth
      var scanner_height = scanner.offsetHeight
      fingarprint.style.backgroundSize = scanner_width + 'px' + ' ' + scanner_height + 'px'
      liang.style.backgroundSize = scanner_width + 'px' + ' ' + scanner_height + 'px'
    }
  getsize()
  })




</script>

<template>
    <div class="scanner">
            <div id="scanner1" style="position: relative;display: flex;justify-content: center;width: 100%;height: 100%;margin-top: 0.4rem;">
              <div id="fingarprint1" class="fingarprint" />
              <div id="liang" class="liang" />
            </div>
          </div>
</template>

<style scoped>
.scanner{
  width: 100%;
          height: 100%;
          position: relative;
          display: flex;
          flex-direction: column;
          align-items: center;
}
.fingarprint{
           position: relative;
           width:100%;
           height:100%;
           background-image: url(image/hte443_hui.png);
           background-repeat: no-repeat;
           background-size: 100% 100%;
            }
            .liang{
             content: '';
             position: absolute;
             top: 0;
             left: 0;
             width: 100%;
             height: 100%;
             background-image: url(image/hte443_Artboard.png) ;
             background-repeat: no-repeat;
             background-size: 200px 320px;
             animation: animate 10s ease-in-out infinite;
              }

   @keyframes animate{
  0%,
  100%{
    height: 0%;
  }
  50%{
    height: 100%;
  }      
}   
.fingarprint:after{
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 8px;
  background: #3fefef;
  border-radius: 8px;
  filter: drop-shadow(0 0 20px #3fefef) drop-shadow(0 0 60px #3fefef);
  animation: animate_line 10s ease-in-out infinite;
}
@keyframes animate_line{
  0%,
  100%{
    top: 0%;
  }
  50%{
    top: 100%;
  }
}

</style>

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值