div+css实现三维小球重力滑动动画效果代码

代码语言:html

所属分类:动画

代码描述:div+css实现三维小球重力滑动动画效果代码

代码标签: div css 三维 小球 重力 滑动 动画

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

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

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

  
  
<style>
:root {
  --lightColor: #d09b69;
  --darkColor: #7d4f38;

  --lightColor: #ef4e98;
  --darkColor: #d0016e;
}

.groundDiv {
  position: absolute;
  bottom: -35%;
  left: -12.5%;
  width: 125%;
  height: 75%;
  background: linear-gradient(0deg, var(--lightColor), var(--darkColor) 100%);
  -webkit-animation: groundAnim 6000ms ease-in-out infinite;
          animation: groundAnim 6000ms ease-in-out infinite;
  box-shadow: 0 1vw 4vw #00000022 inset;
}
.ballDiv {
  position: absolute;
  bottom: 99.8%;
  left: 17.5vw;
  width: 20vw;
  height: 20vw;
  border-radius: 50%;
  background-color: var(--darkColor);
  box-shadow: 0.5vw -0.5vw 1vw var(--lightColor) inset,
    4vw -4vw 10vw #00000088 inset;
  -webkit-animation: ballAnim 6000ms ease-in-out infinite 500ms;
          animation: ballAnim 6000ms ease-in-out infinite 500ms;
}
.ballDiv::after {
  content: "";
  position: absolute;
  background-color: #ffffff66;
  width: 4vw;
  height: 4vw;
  top: 15%;
  right: 15%;
  border-radius: 50%;
  filter: blur(1vw);
}
.ballDiv::before {
  content: "";
  position: absolute;
  background: linear-gradient(
    0deg,
    rgba(0, 0, 0, 0) 70%,
    rgba(0, 0, 0, 0.3) 100%
  );
  width: 20vw;
  height: 80vw;
  top: 100%;
  left: 0;
  border-radius: 50%;
  transform-origin: top center;
  transform: skewX(25deg);
  -webkit-animation: shadowAnim 6000ms ease-in-out infinite 500ms;
          animation: shadowAnim 6000ms ease-in-out infinite 500ms;
}
body {
  overflow: hidden;
  background: linear-gradient(
    90deg,
    var(--darkColor) 15%,
    var(--lightCo.........完整代码请登录后点击上方下载按钮下载查看

网友评论0