css实现一个三维旗帜迎风飘扬动画效果代码
代码语言:html
所属分类:动画
代码描述:css实现一个三维旗帜迎风飘扬动画效果代码
下面为部分代码预览,完整代码请点击下载或在bfwstudio webide中打开
<!DOCTYPE html>
<html lang="en" >
<head>
<meta charset="UTF-8">
<style>
@import url("https://fonts.googleapis.com/css2?family=Orelega+One&display=swap");
*, *::before, *::after {
padding: 0;
margin: 0 auto;
box-sizing: border-box;
}
body {
font-family: "Orelega One", cursive;
background-image: linear-gradient(#ccc, #999);
color: #fffc;
min-height: 100vh;
display: flex;
justify-content: center;
align-items: center;
font-size: 20px;
perspective: 20em;
}
.flag {
position: relative;
width: 0;
height: 16em;
background-color: #fff;
transform: translateX(-6em) rotateX(-30deg) rotateY(15deg);
transform-style: preserve-3d;
}
.flap {
position: absolute;
top: 0;
left: calc(100% - 1px);
width: calc(1em + 1px);
height: 9em;
box-shadow: 0px 0px 1em #0003 inset;
transform-style: preserve-3d;
transform-origin: left;
-webkit-animation: flap 3s infinite ease-in-out;
animation: flap 3s infinite ease-in-out;
}
.flap {
-webkit-animation-delay: 0s;
animation-delay: 0s;
background-image: linear-gradient(90deg, #2d862d, #2d863c);
--v: 0deg;
}
.flap .content::before {
left: 0em;
}
.flap .content::after {
left: 0em;
}
.flap > .flap {
-webkit-animation-delay: -0.375s;
animation-delay: -0.375s;
background-image: linear-gradient(90deg, #2d863c, #2d864a);
--v: 2.5deg;
}
.flap > .flap .content::before {
left: -0.25em;
}
.flap > .flap .content::after {
left: -0.5em;
}
.flap > .flap > .flap {
-webkit-animation-delay: -0.75s;
animation-delay: -0.75s;
background-image: linear-gradient(90deg, #2d864a, #2d8659);
--v: 5deg;
}
.flap > .flap > .flap .content::before {
left: -0.5em;
}
.flap > .flap > .flap .content::after {
left: -1em;
}
.flap > .flap > .flap > .flap {
-webkit-animation-delay: -1.125s;
animation-delay: -1.125s;
background-image: linear-gradient(90deg, #2d8659, #2d8668);
--v: 7.5deg;
}
.flap > .flap > .flap > .flap .content::before {
left: -0.75em;
}
.flap > .flap > .flap > .flap .content::after {
left: -1.5em;
}
.flap > .flap > .f.........完整代码请登录后点击上方下载按钮下载查看
















网友评论0