css实现三维线球在圆板上来回运动动画效果代码
代码语言:html
所属分类:动画
代码描述:css实现三维线球在圆板上来回运动动画效果代码
下面为部分代码预览,完整代码请点击下载或在bfwstudio webide中打开
<!DOCTYPE html>
<html lang="en" >
<head>
<meta charset="UTF-8">
<style>
:root {
--speed: 3.5s;
}
* {
transform-style: preserve-3d;
box-sizing: border-box;
}
body {
margin: 0;
padding: 0;
width: 100vw;
height: 100vh;
overflow: hidden;
display: flex;
align-items: center;
justify-content: center;
perspective: 100vmin;
background: radial-gradient(circle at 50% -50%, #607d8b 15%, #000000 100%);
}
.content {
width: 90vmin;
height: 90vmin;
/*background: #99000040;*/
transform: rotateX(45deg) translateY(-10vmin);
}
.content * {
position: absolute;
}
.base {
width: 90vmin;
height: 90vmin;
background: radial-gradient(circle at 49% 48%, #795548 34%, #422d25 60%, #0009 62% 63%, #422d25 66%, #000 73%);
border-radius: 100%;
}
.base:before, .base:after {
content: "";
background: radial-gradient(#503930 0 55%, #cf927d);
width: calc(100% - 4vmin);
height: calc(100% - 4vmin);
position: absolute;
border-radius: 100%;
transform: translateZ(3vmin);
left: 2vmin;
top: 2vmin;
box-shadow: 0 0 5vmin 0vmin #0008 inset;
border: 1px solid #795548;
box-sizing: border-box;
}
.base:after {
--lines: #fff0 49.75%, #795548 50%, #fff0 50.25%;
background:
radial-gradient(#795548 60%, #fff0 calc(60% + 1px)),
linear-gradient(0deg, var(--lines)),
linear-gradient(10deg, var(--lines)),
linear-gradient(20deg, var(--lines)),
linear-gradient(30deg, var(--lines)),
linear-gradient(40deg, var(.........完整代码请登录后点击上方下载按钮下载查看
















网友评论0