js+css实现鼠标悬浮莲花旋转动画效果代码

代码语言:html

所属分类:动画

代码描述:js+css实现鼠标悬浮莲花旋转动画效果代码

代码标签: 悬浮 莲花 旋转 动画 效果

下面为部分代码预览,完整代码请点击下载或在bfwstudio webide中打开

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

<head>

    <meta charset="UTF-8">



    <style>
        body {
            background: black;
            height: 100vh;
            width: 100vw;
        }

        .petal {
            position: absolute;
            top: 50%;
            left: 50%;
            margin: -50px 0 0 -50px;
            width: 100px;
            height: 100px;
            border-radius: 100% 0 100% 50%;
            --color: hsl(0, 60%, 50%);
            background: linear-gradient(-45deg, black, var(--color));
            transition: transform 0.4s ease-out;
            mix-blend-mode: screen;
        }
    </style>


</head>

<body>


    <div class="petal"></div>
    <div class="petal"></div>
    <div class="petal"></div>
    <div class="petal"></div>
    <div class="petal"></div>
    <div class="petal"></div>
    <div class="petal"></div>
    <div class="petal"></div>

    <script>
        const $petals = document.querySelectorAll('.petal');
        let color = 0;
        const mouse = {
            x: 1,
            y: 1
 .........完整代码请登录后点击上方下载按钮下载查看

网友评论0