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

vue項(xiàng)目實(shí)戰(zhàn)之圓柱狀水波效果實(shí)現(xiàn)

 更新時(shí)間:2022年12月21日 08:23:36   作者:coderSlow  
最近工作中實(shí)現(xiàn)的一個(gè)效果不錯(cuò),分享給大家,下面這篇文章主要給大家介紹了關(guān)于vue項(xiàng)目實(shí)戰(zhàn)之圓柱狀水波效果實(shí)現(xiàn)的相關(guān)資料,文中通過(guò)示例代碼介紹的非常詳細(xì),需要的朋友可以參考下

1、先在data中定義有關(guān)參數(shù)和引入數(shù)據(jù)請(qǐng)求接口

1、字data中定義需要用到的參數(shù)

specialList: [
    { value: 0, height: 0, markKey: '' },
    { value: 0, height: 0, markKey: '' },
    { value: 0, height: 0, markKey: '' },
    { value: 0, height: 0, markKey: '' }
]

2、引入數(shù)據(jù)請(qǐng)求接口

import { getMarks } from '@/api/businessOpetation'

2、再進(jìn)行真實(shí)數(shù)據(jù)的獲取

created() {
    getMarks(22).then((res) => {
      console.log(res)
      if (res.code === 200) {
        res.data.result.forEach((item, index) => {
          const value = JSON.parse(item.markValue).value || 0
          const height = 126 - 126 * (1 - value * 0.01)
          const obj = {}
          obj.markKey = item.markKey
          obj.value = value
          obj.height = height
          this.$set(this.specialList, index, obj)
        })
      }
    })
  },

3、核心代碼(主要是html和CSS代碼)

HTML代碼:

<div class="box1">
    <div
      class="box1-item"
      v-for="(item, index) in specialList"
      :key="index">
      <div class="img-box">
        <div class="lui-column-bg">
          <img
            :src="require('@/assets/images/business/cylinder_bg.png')"
            alt=""/>
          <span class="item-value" :style="{ opacity: item.value }">{{
            item.value
          }}</span>
          <div
            class="lui-inner"
            :class="['lui-inner' + index]"
            :style="{ height: (item.height || 0) + 'px' }">
            <div
              v-show="item.height > 0 && item.height < 142"
              class="gif-box"
              :class="[`gif-box${index}`]"
            ></div>
          </div>
        </div>
      </div>
      <span class="box1-adderss" :class="[`box1-adderss${index}`]">{{
        item.markKey
      }}</span>
    </div>
</div>

CSS代碼塊:

.box1 {
    width: 100%;
    height: 100%;
    display: flex;
    flex-wrap: wrap;
    padding: 34px 45px 6px 45px;
    justify-content: space-between;
    box-sizing: border-box;
    
    .box1-item {
      width: 140px;
      height: 217px;
      position: relative;
      display: flex;
      justify-content: center;
      .box1-adderss0 {
        background: url('@/assets/images/business/cylinder_b_1.png') no-repeat
          100% 100%;
      }

      .box1-adderss1 {
        background: url('@/assets/images/business/cylinder_b_2.png') no-repeat
          100% 100%;
      }

      .box1-adderss2 {
        background: url('@/assets/images/business/cylinder_b_3.png') no-repeat
          100% 100%;
      }

      .box1-adderss3 {
        background: url('@/assets/images/business/cylinder_b_4.png') no-repeat
          100% 100%;
      }

      .box1-adderss0::before {
        background: url('@/assets/images/business/cylinder_border_1.png')
          no-repeat 100% 100%;
      }

      .box1-adderss1::before {
        background: url('@/assets/images/business/cylinder_border_2.png')
          no-repeat 100% 100%;
      }

      .box1-adderss2::before {
        background: url('@/assets/images/business/cylinder_border_3.png')
          no-repeat 100% 100%;
      }

      .box1-adderss3::before {
        background: url('@/assets/images/business/cylinder_border_4.png')
          no-repeat 100% 100%;
      }

      .box1-adderss::before {
        content: '';
        position: absolute;
        left: 0;
        right: 0;
        top: -2.5px;
        bottom: -1.5px;
        background-size: cover;
      }

      .box1-adderss {
        position: absolute;
        bottom: 0;
        text-align: center;
        font-size: 14px;
        font-weight: 400;
        color: #ffffff;
        line-height: 35px;
        width: 100%;
        background-size: cover;
        height: 35px;
      }

      .img-box {
        width: 110px;
        height: 163px;
        position: relative;
        z-index: 99;

        .lui-column-bg {
          position: relative;
          z-index: 55;
          width: 100%;
          height: 100%;
          width: 110px;
          height: 163px;

          img {
            width: 100%;
            height: 100%;
          }

          .item-value {
            position: absolute;
            left: 50%;
            top: 48px;
            z-index: 100;
            transform: translateX(-50%);
            font-size: 33px;
            color: #fff0d1;
            transition: opacity 2s ease-in;
          }
        }

        .lui-inner0 {
          background: linear-gradient(
            90deg,
            rgba(62, 171, 241, 0.67) 0%,
            rgba(62, 171, 241) 22%,
            rgba(62, 171, 241) 78%,
            rgba(62, 171, 241, 0) 100%
          );
        }

        .lui-inner1 {
          background: linear-gradient(
            90deg,
            rgba(162, 138, 58, 0.8) 0%,
            rgba(162, 138, 58) 25%,
            rgba(162, 138, 58) 78%,
            rgba(162, 138, 58, 0) 100%
          );
        }

        .lui-inner2 {
          background: linear-gradient(
            90deg,
            rgba(77, 181, 120, 0.67) 0%,
            rgba(77, 181, 120) 22%,
            rgba(77, 181, 120) 78%,
            rgba(77, 181, 120, 0) 100%
          );
        }

        .lui-inner3 {
          background: linear-gradient(
            90deg,
            rgb(81,98,154) 0%,
            rgba(93, 79, 139) 25%,
            rgba(93, 79, 139) 78%,
            rgb(52,86,132) 100%
          );
        }

        .lui-inner {
          position: absolute;
          z-index: 15;
          bottom: 14px;
          width: 100%;
          transition: height 2s ease-in;
          text-align: center;

          .gif-box0 {
            background: url('@/assets/images/business/water.gif') no-repeat 100%
              100%;
          }

          .gif-box1 {
            background: url('@/assets/images/business/water_2.gif') no-repeat
              100% 100%;
          }

          .gif-box2 {
            background: url('@/assets/images/business/water2.gif') no-repeat
              100% 100%;
          }

          .gif-box3 {
            background: url('@/assets/images/business/water3.gif') no-repeat
              100% 100%;
          }

          .gif-box {
            position: absolute;
            z-index: 9;
            top: -14.5px;
            width: 100%;
            height: 16.5px;
            background-size: cover;
          }
        }
        .lui-inner:after {
          position: absolute;
          z-index: 5;
          content: '';
          display: block;
          height: 15px;
          width: 100%;
          border-radius: 50%;
          background: #788092;
          background: #204070;
          bottom: -10px;
          opacity: 1;
        }
      }
    }
  }

4、需要的圖片素材

需要用到9張png圖片和4張gif圖

5、最終效果

說(shuō)明:圖片截的是靜態(tài)圖片,現(xiàn)實(shí)柱狀圖是有水波的

總結(jié)

到此這篇關(guān)于vue項(xiàng)目實(shí)戰(zhàn)之圓柱狀水波效果實(shí)現(xiàn)的文章就介紹到這了,更多相關(guān)vue圓柱狀水波效果內(nèi)容請(qǐng)搜索腳本之家以前的文章或繼續(xù)瀏覽下面的相關(guān)文章希望大家以后多多支持腳本之家!

相關(guān)文章

  • Vue路由Hash模式分析

    Vue路由Hash模式分析

    Vue-router是Vue的核心組件,主要是作為Vue的路由管理器,Vue-router默認(rèn)hash模式,本文講給大家詳細(xì)分析Vue路由Hash模式,文中有相關(guān)的代碼示例供大家參考,感興趣的同學(xué)可以借鑒一下
    2023-06-06
  • Vue.js 2.0 移動(dòng)端拍照壓縮圖片上傳預(yù)覽功能

    Vue.js 2.0 移動(dòng)端拍照壓縮圖片上傳預(yù)覽功能

    這篇文章主要介紹了Vue.js 2.0 移動(dòng)端拍照壓縮圖片上傳預(yù)覽功能,非常不錯(cuò),具有參考借鑒價(jià)值,需要的朋友可以參考下
    2017-03-03
  • Vue.js實(shí)現(xiàn)音樂(lè)播放器

    Vue.js實(shí)現(xiàn)音樂(lè)播放器

    這篇文章主要為大家詳細(xì)介紹了Vue.js實(shí)現(xiàn)音樂(lè)播放器,文中示例代碼介紹的非常詳細(xì),具有一定的參考價(jià)值,感興趣的小伙伴們可以參考一下
    2021-06-06
  • vue中jsonp的使用方法

    vue中jsonp的使用方法

    這篇文章主要介紹了vue中jsonp的使用方法,文章從安裝開始展開具體的vue中jsonp的使用詳細(xì)內(nèi)容,需要的朋友可以參考一下,希望對(duì)大家有所幫助
    2021-11-11
  • 使用vue-router beforEach實(shí)現(xiàn)判斷用戶登錄跳轉(zhuǎn)路由篩選功能

    使用vue-router beforEach實(shí)現(xiàn)判斷用戶登錄跳轉(zhuǎn)路由篩選功能

    這篇文章主要介紹了vue使用vue-router beforEach實(shí)現(xiàn)判斷用戶登錄跳轉(zhuǎn)路由篩選,本篇文章默認(rèn)您已經(jīng)會(huì)使用 webpack 或者 vue-cli 來(lái)進(jìn)行環(huán)境的搭建,并且具有一定的vue基礎(chǔ)。需要的朋友可以參考下
    2018-06-06
  • vue-router啟用history模式下的開發(fā)及非根目錄部署方法

    vue-router啟用history模式下的開發(fā)及非根目錄部署方法

    這篇文章主要介紹了vue-router啟用history模式下的開發(fā)及非根目錄部署方法,小編覺得挺不錯(cuò)的,現(xiàn)在分享給大家,也給大家做個(gè)參考。一起跟隨小編過(guò)來(lái)看看吧
    2018-12-12
  • vue-router 中router-view不能渲染的解決方法

    vue-router 中router-view不能渲染的解決方法

    本篇文章主要結(jié)合了vue-router 中router-view不能渲染的解決方法,具有一定的參考價(jià)值,感興趣的小伙伴們可以參考一下
    2017-05-05
  • vue做移動(dòng)端適配最佳解決方案(親測(cè)有效)

    vue做移動(dòng)端適配最佳解決方案(親測(cè)有效)

    這篇文章主要介紹了vue做移動(dòng)端適配最佳解決方案(親測(cè)有效),小編覺得挺不錯(cuò)的,現(xiàn)在分享給大家,也給大家做個(gè)參考。一起跟隨小編過(guò)來(lái)看看吧
    2018-09-09
  • vue3錨點(diǎn)定位兩種實(shí)現(xiàn)方式示例

    vue3錨點(diǎn)定位兩種實(shí)現(xiàn)方式示例

    這篇文章主要給大家介紹了關(guān)于vue3錨點(diǎn)定位兩種實(shí)現(xiàn)的相關(guān)資料,說(shuō)到錨點(diǎn)定位,很多人第一時(shí)間會(huì)想到 a標(biāo)簽,但是a標(biāo)簽實(shí)現(xiàn)的錨點(diǎn)定位并不是那么的完美,需要的朋友可以參考下
    2023-07-07
  • Vue源碼cached解析

    Vue源碼cached解析

    最近在寫閉包的應(yīng)用的時(shí)候,出現(xiàn)了一個(gè)cached函數(shù),來(lái)源于Vue源碼,利用了閉包變量不會(huì)被回收的特點(diǎn),可以緩存變量,cached本質(zhì)上是一個(gè)高階函數(shù),它接受一個(gè)函數(shù)的參數(shù),同時(shí)返回一個(gè)函數(shù)
    2022-08-08

最新評(píng)論

辉南县| 资源县| 双桥区| 正镶白旗| 麦盖提县| 伊宁市| 若尔盖县| 九龙县| 黄冈市| 柳州市| 喀喇沁旗| 景泰县| 镶黄旗| 湖南省| 江川县| 辽阳县| 江北区| 石嘴山市| 南漳县| 和田市| 平顶山市| 乐陵市| 黑山县| 临海市| 灵川县| 嘉鱼县| 铜山县| 保定市| 广河县| 长顺县| 错那县| 南部县| 上饶市| 平陆县| 临武县| 三门县| 洛浦县| 西吉县| 临沂市| 晋中市| 泰州市|