當前位置:首頁 > IT技術(shù) > Web編程 > 正文

HTML+CSS+JS實現(xiàn) ??3D網(wǎng)狀球體動畫特效??
2021-09-17 11:53:22

??????效果演示:

HTML+CSS+JS實現(xiàn) ??3D網(wǎng)狀球體動畫特效??_3D網(wǎng)狀球體動畫特效

???代碼目錄:

HTML+CSS+JS實現(xiàn) ??3D網(wǎng)狀球體動畫特效??_3D網(wǎng)狀球體動畫特效_02

?

主要代碼實現(xiàn):

CSS樣式:

@property --color-position {
    syntax: '<length-percentage>';
    inherits: false;
    initial-value: 30%;
}

body {
    margin: 0;
    overflow: hidden;
    --color-position: 30%;
    background: radial-gradient(circle at center, #F9F871, #FFD45A var(--color-position));
    animation: beat 3s infinite ease-in-out;
}

@keyframes beat {
    33%,
    66% {
        --color-position: 160%;
    }
}

部分HTML代碼 :

<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <title>Three.js + CSS Gradient background animated with Houdini</title>

    <link rel="stylesheet" href="css/style.css">

</head>

<body>

    <script src='js/three.min.js'></script>
    <script src="js/script.js"></script>

</body>

</html>

上面的 script.js和three.min.js需要引入即可運行

源碼獲取

?

?

本文摘自 :https://blog.51cto.com/u

開通會員,享受整站包年服務(wù)立即開通 >