日韩性视频-久久久蜜桃-www中文字幕-在线中文字幕av-亚洲欧美一区二区三区四区-撸久久-香蕉视频一区-久久无码精品丰满人妻-国产高潮av-激情福利社-日韩av网址大全-国产精品久久999-日本五十路在线-性欧美在线-久久99精品波多结衣一区-男女午夜免费视频-黑人极品ⅴideos精品欧美棵-人人妻人人澡人人爽精品欧美一区-日韩一区在线看-欧美a级在线免费观看

歡迎訪問 生活随笔!

生活随笔

當前位置: 首頁 > 编程资源 > 编程问答 >内容正文

编程问答

纯css实现科技感十足的方格闪烁背景

發布時間:2024/1/1 编程问答 24 豆豆
生活随笔 收集整理的這篇文章主要介紹了 纯css实现科技感十足的方格闪烁背景 小編覺得挺不錯的,現在分享給大家,幫大家做個參考.

? ? ? 依然是Vue項目中的效果,GIF圖看起來有點卡頓?,但實際效果很流暢。代碼如下:

<div class="main-body"><span :class="Math.random()<0.3?'animate1':Math.random()>0.6?'animate2':'animate3'":style="{opacity:Math.random()}"v-for="i in 100"></span> </div> .main-body{background-image: url('bg.jpg');background-position: center;width: 540px;height: 540px; } .main-body span{float: left;width: 50px;height: 50px;margin: 2px; } .animate1{animation: shineSquare1 8s linear infinite; } .animate2{animation: shineSquare2 8s linear infinite; } .animate3{animation: shineSquare3 8s linear infinite; } @keyframes shineSquare1 {from{background: #0990cb}20%{background: #123496}40%{background: #003366}60%{background: #2345d7}80%{background: #044d9b}to{background: #003366} } @keyframes shineSquare2 {from{background: #003366}20%{background: #6666ff}40%{background: #003366}60%{background: #0990cb}80%{background: #044d9b}to{background: #003366} } @keyframes shineSquare3 {from{background: #003366}20%{background: #0990cb}40%{background: #003366}60%{background: #044d9b}80%{background: #2277dd}to{background: #003366} }

? ? ? 我一共定義了三組動畫,使用隨機值給不同的方塊加入不同的動畫和透明度。使用時可根據自己的需求調整動畫數量和顏色。

總結

以上是生活随笔為你收集整理的纯css实现科技感十足的方格闪烁背景的全部內容,希望文章能夠幫你解決所遇到的問題。

如果覺得生活随笔網站內容還不錯,歡迎將生活随笔推薦給好友。