div+css实现小球切割动画效果代码

代码语言:html

所属分类:动画

代码描述:div+css实现小球切割动画效果代码

代码标签: div css 小球 切割 动画

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

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

<head>
  <meta charset="UTF-8">
  

  
  
  
<style>
:root {
    --background-color: black;
}
body {
    padding: 0;
    margin: 0;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    background: var(--background-color);
    perspective: 80rem;
    transform-style: preserve-3d;
}

@property --c1 {
    syntax: "<percentage>";
    inherits: false;
    initial-value: 0%;
}
@property --c2 {
    syntax: "<percentage>";
    inherits: false;
    initial-value: 0%;
}
@property --scale1 {
    syntax: "<number>";
    inherits: false;
    initial-value: 1;
}
@property --O {
    syntax: "<number>";
    inherits: false;
    initial-value: 1;
}
.parent {
    width: 30rem;
    aspect-ratio: 1;
    display: flex;
    align-items: center;
    justify-content: center;
}
.circle {
    position: absolute;
    width: 30rem;
    aspect-ratio: 1;
    opacity: var(--0);
    background: radial-gradient(circle at 40% 40%, rgba(255, 255, 255, 0.9), rgba(173, 216, 230, 0.5) 20%, rgba(0, 0, 0, 0.2) 60%, rgba(0, 0, 0, 0.8) 100%),
            radial-gradient(circle at 60% 60%, rgba(255, 255, 255, 0.6), rgba(0, 0, 0, 0.4) 50%),
            radial-gradient(circle at 50% 50%, rgba(173, 216, 230, 0.8), rgba(0, 0, 0, 0.3) 50%, rgba(0, 0, 0, 0.9) 100%);
    background-color: #000;
    box-shadow: inset 0 0 15px rgba(0, 0, 0, 0.7), inset 20px 20px 50px rgba(255, 255, 255, 0.1);
    border-radius: 50%;
    mask: radial-gradient(circle at 50% 0%, transparent var(--c1), black 0);
    transform: .........完整代码请登录后点击上方下载按钮下载查看

网友评论0