最新国产好看的视频,伊人天堂AV在线,国产Aaaaaa视频,蜜臀视频在线观看一区,人妻av色图,密臀久久久精品影片,青青视频免费观看毛片,久草在线观看视,国产三级精品色情在线

vue引用CSS樣式實(shí)現(xiàn)手機(jī)充電效果

 更新時(shí)間:2024年01月05日 11:26:26   作者:范特西是只貓  
這篇文章主要介紹了vue引用CSS樣式實(shí)現(xiàn)手機(jī)充電效果,本文通過(guò)示例代碼給大家介紹的非常詳細(xì),對(duì)大家的學(xué)習(xí)或工作具有一定的參考借鑒價(jià)值,需要的朋友可以參考下

1. 實(shí)現(xiàn)效果

2. index.vue 頁(yè)面

<template>
  <div class="home">
    <div class="body">
      <vab-charge :end-val="endVal" :start-val="startVal" />
    </div>
  </div>
</template>
<script>
  import VabCharge from '@/components/VabCharge'
export default {
  name: 'Demo',
  components: { VabCharge },
  data() {
    return {
      startVal: 0,
      endVal: 20,
      timeInterval: null,
    }
  },
  mounted() {
    this.timeInterval = setInterval(() => {
      if (this.endVal < 100) {
        this.startVal = this.endVal
        this.endVal++
      }
    }, 5000)
  },
  beforeDestroy() {
    if (this.clearInterval) {
      clearInterval(this.timeInterval)
    }
  },
  methods: {
  },
}
</script>
<style scoped lang="scss">
.home {
  .body {
    width: 890px;
    height: 500px;
    border: #00ffa2 solid 10px;
    box-sizing: border-box;
    // padding: 20px;
    box-sizing: border-box;
    display: flex;
    justify-content: center;
    align-items: center;
    flex-direction: column;
    .qrcode2 {
    }
  }
}
</style>

3. VabCharge.vue 組件代碼

<template>
  <div class="content">
    <div class="g-container" :style="styleObj">
      <div class="g-number">
        {{ endVal }}
      </div>
      <div class="g-contrast">
        <div class="g-circle"></div>
        <ul class="g-bubbles">
          <li v-for="(item, index) in 15" :key="index"></li>
        </ul>
      </div>
    </div>
  </div>
</template>
<script>
  export default {
    name: 'VabCharge',
    props: {
      styleObj: {
        type: Object,
        default: () => {
          return {}
        },
      },
      startVal: {
        type: Number,
        default: 0,
      },
      endVal: {
        type: Number,
        default: 100,
      },
    },
    data() {
      return {
        decimals: 2,
        prefix: '',
        suffix: '%',
        separator: ',',
        duration: 3000,
      }
    },
    created() {},
    mounted() {},
    methods: {},
  }
</script>
<style lang="scss" scoped>
  .content {
    position: relative;
    display: flex;
    align-items: center; /* 垂直居中 */
    justify-content: center; /* 水平居中 */
    width: 100%;
    height: 100%;
    background: #000;
    .g-number {
      position: absolute;
      top: 27%;
      z-index: 99;
      width: 300px;
      font-size: 32px;
      color: #fff;
      text-align: center;
    }
    .g-container {
      position: relative;
      width: 300px;
      height: 400px;
      margin: auto;
    }
    .g-contrast {
      width: 300px;
      height: 400px;
      overflow: hidden;
      background-color: #000;
      filter: contrast(15) hue-rotate(0);
      animation: hueRotate 10s infinite linear;
    }
    .g-circle {
      position: relative;
      box-sizing: border-box;
      width: 300px;
      height: 300px;
      filter: blur(8px);
      &::after {
        position: absolute;
        top: 40%;
        left: 50%;
        width: 200px;
        height: 200px;
        content: '';
        background-color: #00ff6f;
        border-radius: 42% 38% 62% 49% / 45%;
        transform: translate(-50%, -50%) rotate(0);
        animation: rotate 10s infinite linear;
      }
      &::before {
        position: absolute;
        top: 40%;
        left: 50%;
        z-index: 99;
        width: 176px;
        height: 176px;
        content: '';
        background-color: #000;
        border-radius: 50%;
        transform: translate(-50%, -50%);
      }
    }
    .g-bubbles {
      position: absolute;
      bottom: 0;
      left: 50%;
      width: 100px;
      height: 40px;
      background-color: #00ff6f;
      filter: blur(5px);
      border-radius: 100px 100px 0 0;
      transform: translate(-50%, 0);
    }
    li {
      position: absolute;
      background: #00ff6f;
      border-radius: 50%;
    }
    @for $i from 0 through 15 {
      li:nth-child(#{$i}) {
        $width: 15 + random(15) + px;
        top: 50%;
        left: 15 + random(70) + px;
        width: $width;
        height: $width;
        transform: translate(-50%, -50%);
        animation: moveToTop #{random(6) + 3}s ease-in-out -#{random(5000) / 1000}s infinite;
      }
    }
    @keyframes rotate {
      50% {
        border-radius: 45% / 42% 38% 58% 49%;
      }
      100% {
        transform: translate(-50%, -50%) rotate(720deg);
      }
    }
    @keyframes moveToTop {
      90% {
        opacity: 1;
      }
      100% {
        opacity: 0.1;
        transform: translate(-50%, -180px);
      }
    }
    @keyframes hueRotate {
      100% {
        filter: contrast(15) hue-rotate(360deg);
      }
    }
  }
</style>

到此這篇關(guān)于vue通過(guò)CSS實(shí)現(xiàn)手機(jī)充電效果的文章就介紹到這了,更多相關(guān)vue手機(jī)充電內(nèi)容請(qǐng)搜索腳本之家以前的文章或繼續(xù)瀏覽下面的相關(guān)文章希望大家以后多多支持腳本之家!

相關(guān)文章

  • mini-vue渲染的簡(jiǎn)易實(shí)現(xiàn)

    mini-vue渲染的簡(jiǎn)易實(shí)現(xiàn)

    本文主要介紹了mini-vue渲染的簡(jiǎn)易實(shí)現(xiàn),主要簡(jiǎn)單來(lái)實(shí)現(xiàn)一個(gè)虛擬dom渲染真實(shí)dom,以及更新的方法。具有一定的參考價(jià)值,感興趣的小伙伴們可以參考一下
    2021-08-08
  • Vue?Router解決多路由復(fù)用同一組件頁(yè)面不刷新問(wèn)題(場(chǎng)景分析)

    Vue?Router解決多路由復(fù)用同一組件頁(yè)面不刷新問(wèn)題(場(chǎng)景分析)

    這篇文章主要介紹了Vue?Router解決多路由復(fù)用同一組件頁(yè)面不刷新問(wèn)題,多路由復(fù)用同一組件的場(chǎng)景分析,本文給大家介紹的非常詳細(xì),對(duì)大家的學(xué)習(xí)或工作具有一定的參考借鑒價(jià)值,需要的朋友可以參考下
    2022-08-08
  • Element-UI使用el-row高度設(shè)置方式

    Element-UI使用el-row高度設(shè)置方式

    這篇文章主要介紹了Element-UI使用el-row高度設(shè)置方式,具有很好的參考價(jià)值,希望對(duì)大家有所幫助,如有錯(cuò)誤或未考慮完全的地方,望不吝賜教
    2024-08-08
  • 關(guān)于vue3使用particles粒子特效的問(wèn)題

    關(guān)于vue3使用particles粒子特效的問(wèn)題

    這篇文章主要介紹了關(guān)于vue3使用particles粒子特效的問(wèn)題,具有很好的參考價(jià)值,希望對(duì)大家有所幫助。如有錯(cuò)誤或未考慮完全的地方,望不吝賜教
    2022-06-06
  • Element InputNumber 計(jì)數(shù)器的實(shí)現(xiàn)示例

    Element InputNumber 計(jì)數(shù)器的實(shí)現(xiàn)示例

    這篇文章主要介紹了Element InputNumber 計(jì)數(shù)器的實(shí)現(xiàn)示例,文中通過(guò)示例代碼介紹的非常詳細(xì),對(duì)大家的學(xué)習(xí)或者工作具有一定的參考學(xué)習(xí)價(jià)值,需要的朋友們下面隨著小編來(lái)一起學(xué)習(xí)學(xué)習(xí)吧
    2020-08-08
  • 為Vue3?組件標(biāo)注?TS?類(lèi)型實(shí)例詳解

    為Vue3?組件標(biāo)注?TS?類(lèi)型實(shí)例詳解

    這篇文章主要為大家介紹了為Vue3?組件標(biāo)注?TS?類(lèi)型實(shí)例詳解,有需要的朋友可以借鑒參考下,希望能夠有所幫助,祝大家多多進(jìn)步,早日升職加薪
    2022-08-08
  • vue 項(xiàng)目地址去掉 #的方法

    vue 項(xiàng)目地址去掉 #的方法

    vue 項(xiàng)目往往會(huì)搭配 vue-router 官方路由管理器,它和 vue.js 的核心深度集成,讓構(gòu)建單頁(yè)面應(yīng)用變得易如反掌。這篇文章主要介紹了vue 項(xiàng)目地址去掉 #的方法,需要的朋友可以參考下
    2018-10-10
  • vue Router常用屬性詳解

    vue Router常用屬性詳解

    這篇文章主要介紹了vueRouter常用屬性,本文通過(guò)實(shí)例代碼給大家介紹的非常詳細(xì),需要的朋友可以參考下
    2023-12-12
  • 基于Vue3+WebSocket實(shí)現(xiàn)實(shí)時(shí)文件傳輸監(jiān)控系統(tǒng)

    基于Vue3+WebSocket實(shí)現(xiàn)實(shí)時(shí)文件傳輸監(jiān)控系統(tǒng)

    WebSocket是一種在客戶(hù)端和服務(wù)器之間進(jìn)行雙向通信的網(wǎng)絡(luò)協(xié)議,它通過(guò)建立持久性的、全雙工的連接,允許服務(wù)器主動(dòng)向客戶(hù)端發(fā)送數(shù)據(jù),本文小編給大家介紹了基于Vue3+WebSocket實(shí)現(xiàn)實(shí)時(shí)文件傳輸監(jiān)控系統(tǒng),需要的朋友可以參考下
    2025-03-03
  • VUE?html5-qrcode實(shí)現(xiàn)H5掃一掃功能實(shí)例

    VUE?html5-qrcode實(shí)現(xiàn)H5掃一掃功能實(shí)例

    這篇文章主要給大家介紹了關(guān)于VUE?html5-qrcode實(shí)現(xiàn)H5掃一掃功能的相關(guān)資料,html5-qrcode是輕量級(jí)和跨平臺(tái)的QR碼和條形碼掃碼的JS庫(kù),集成二維碼、條形碼和其他一些類(lèi)型的代碼掃描功能,需要的朋友可以參考下
    2023-08-08

最新評(píng)論

宁德市| 广宗县| 锦屏县| 淳化县| 云浮市| 大同市| 柯坪县| 洛隆县| 涞水县| 宁晋县| 庆城县| 新营市| 武鸣县| 东阳市| 奎屯市| 宜章县| 榆树市| 云和县| 保德县| 黎平县| 永济市| 杂多县| 宜城市| 车险| 南投县| 时尚| 安宁市| 长葛市| 绥江县| 上杭县| 通江县| 锦州市| 海盐县| 德江县| 申扎县| 沂源县| 井陉县| 乌审旗| 杭锦旗| 清徐县| 临漳县|