div+css实现荡秋千的小女孩动画效果代码
代码语言:html
所属分类:动画
代码描述:div+css实现荡秋千的小女孩动画效果代码
下面为部分代码预览,完整代码请点击下载或在bfwstudio webide中打开
<!DOCTYPE html>
<html lang="en" >
<head>
<meta charset="UTF-8">
<style>
.wrapper {
position: absolute;
top: 50%;
left: 50%;
width: 200px;
height: 200px;
transform: translate(-50%, -50%) scale(1.2);
}
.wrapper .pole {
position: absolute;
width: 5px;
height: 250px;
left: 50%;
transform-origin: center top;
transform: translateX(-50%) rotate(-25deg);
color: silver;
background: currentColor;
}
.wrapper .pole.two {
transform: translateX(-50%) rotateY(-180deg) rotate(-25deg);
}
.wrapper .pole:before {
content: "";
position: absolute;
top: -10px;
left: -7px;
width: 20px;
height: 20px;
border-radius: 100%;
background: currentColor;
}
.wrapper .pole:after {
content: "";
position: absolute;
left: 0;
bottom: 0;
width: 20px;
height: 5px;
transform: translateX(-50%) rotate(25deg);
background: currentColor;
}
.wrapper .swing {
position: absolute;
width: 40px;
height: 100%;
left: calc(50% - 20px);
transform-origin: center top;
-webkit-animation-duration: 0.8s;
animation-duration: 0.8s;
-webkit-animation-iteration-count: infinite;
animation-iteration-count: infinite;
-webkit-animation-timing-function: ease-in-out;
animation-timing-function:.........完整代码请登录后点击上方下载按钮下载查看
















网友评论0