css绘制男子带狗狗骑自行车飞驰动画效果
代码语言:html
所属分类:动画
代码描述:css绘制男子带狗狗骑自行车飞驰动画效果
下面为部分代码预览,完整代码请点击下载或在bfwstudio webide中打开
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<style>
*,
*::after,
*::before {
margin: 0;
padding: 0;
box-sizing: border-box;
-webkit-tap-highlight-color: transparent;
}
/* Generic */
body {
display: flex;
justify-content: center;
align-items: center;
width: 100%;
height: 100vh;
background-color: #EFE1DB;
}
.main {
position: relative;
width: 60vw;
height: 45vw;
background-size: contain;
background-repeat: no-repeat;
background-position: center;
overflow: hidden;
}
/* Component */
.lines {
width: 100%;
height: 100%;
transform: rotateZ(10deg);
}
.line-a,
.line-b,
.line-c,
.line-d {
position: absolute;
height: .175vw;
border-radius: 50%;
background-color: #FFF6EF;
}
.line-a {
width: 12vw;
bottom: 20vw;
left: 7vw;
animation: line-a .15s infinite linear;
}
.line-b {
width: 10vw;
bottom: 18vw;
left: 6vw;
animation: line-b .2s infinite linear;
}
.line-c {
width: 6vw;
bottom: 12vw;
left: 12vw;
animation: line-c .1s infinite linear;
}
.line-d {
width: 6vw;
bottom: 26vw;
left: 15vw;
animation: line-d .135s infinite linear;
}
/**/
.shadows {
position: absolute;
top: 13.5vw;
left: 20.3vw;
width: 27vw;
height: 19vw;
transform-origin: top left;
transform: rotateZ(10deg);
z-index: -5;
}
.shadow-a,
.shadow-b,
.shadow-c,
.shadow-d {
position: absolute;
border-radius: 50%;
}
.shadow-a {
bottom: -.5vw;
width: 150%;
left: -25%;
height: 1vw;
background-color: rgba(109, 84, 80, 0.5);
animation: shadow-a .15s infinite linear;
}
.shadow-b {
bottom: -1.5vw;
width: 100%;
right: -25%;
height: .45vw;
background-color: rgba(109, 84, 80, 0.5);
animation: shadow-b .175s infinite linear;
}
.shadow-c {
bottom: -4vw;
left: 100%;
border-top: 2vw solid rgba(109, 84, 80, 0.5);
border-right: 2vw solid rgba(109, 84, 80, 0.5);
border-bottom: 2vw solid transparent;
border-left: 2vw solid transparent;
transform-origin: bottom left;
transform: rotateZ(-45deg);
opacity: 0;
animation: shadow-c .45s infinite linear;
}
.shadow-c::before {
content: '';
position: absolute;
left: 2vw;
top: 2vw;
border-top: 1vw solid rgba(109, 84, 80, 0.75);
border-right: 1vw solid rgba(109, 84, 80, 0.75);
border-bottom: 1vw solid transparent;
border-left: 1vw solid transparent;
border-radius: 50%;
}
.shadow-d {
bottom: -2vw;
left: 100%;
border-top: 1.5vw solid rgba(109, 84, 80, 0.75);
border-right: 1.5vw solid rgba(109, 84, 80, 0.75);
border-bottom: 1.5vw solid transparent;
border-left: 1.5vw solid transparent;
transform-origin: bottom left;
transform: rotateZ(-45deg);
animation: shadow-c 1s infinite linear;
}
/**/
.bicy {
position: absolute;
top: 13.5vw;
left: 17.3vw;
width: 27vw;
height: 19vw;
transform-origin: bottom left;
transform: rotateZ(10deg);
animation: bicy .15s infinite linear;
/**/
/**/
/**/
}
.bicy__wheel-l, .bicy__wheel-r {
display: flex;
justify-content: center;
align-items: center;
position: absolute;
bottom: 0;
width: 10.8vw;
height: 10.8vw;
border: 0.4vw solid #432316;
border-radius: 50%;
box-shadow: inset 0.3vw 0.3vw 0 #E9A589, inset -0.3vw -0.3vw 0 #FFF6EF, inset -0.3vw 0.3vw 0 #E9A589, inset 0.3vw -0.3vw 0 #FFF6EF;
}
.bicy__wheel-l::before, .bicy__wheel-l::after, .bicy__wheel-r::before, .bicy__wheel-r::after {
content: '';
position: absolute;
width: 70%;
height: 70%;
border-radius: 50%;
border-top: 0.115vw solid #FFF6EF;
border-bottom: 0.115vw solid #FFF6EF;
border-left: .115vw solid transparent;
border-right: .115vw solid transparent;
animation: wheel .25s infinite linear;
}
.bicy__wheel-l::after, .bicy__wheel-r::after {
width: 50%;
height: 50%;
border-top: .115vw solid transparent;
animation: wheel .25s infinite linear;
}
.bicy__wheel-l {
left: 0;
z-index: -1;
}
.bicy__wheel-r {
right: 0;
}
.bicy__fender {
position: absolute;
width: 115%;
height: 125%;
border-radius: 50%;
border-top: 0.5vw solid #00665A;
}
.bicy__ac {
position: absolute;
width: 10.7vw;
height: 3vw;
bottom: 4vw;
left: 4vw;
}
.bicy__ac::before {
content: '';
position: absolute;
bottom: 0;
right: 0;
width: 99%;
height: 1.5vw;
border: 0.3vw solid #3F3E3E;
border-top: .3vw solid transparent;
border-bottom-left-radius: 4vw;
border-bottom-right-radius: 4vw;
}
.bicy__ac::after {
content: '';
position: absolute;
bottom: 0;
right: 0;
width: 3vw;
height: 3vw;
border-radius: 50%;
border-left: 0.4vw solid #3F3E3E;
border-bottom:.........完整代码请登录后点击上方下载按钮下载查看
网友评论0