css布局实现折叠纸扇动画效果

代码语言:html

所属分类:动画

代码描述:css布局实现折叠纸扇动画效果

代码标签: 折叠 纸扇 动画 效果

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


<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">

<style>
html, body {
  height: 100%;
}

body {
  display: -webkit-box;
  display: flex;
  -webkit-box-orient: vertical;
  -webkit-box-direction: normal;
          flex-direction: column;
  -webkit-box-align: center;
          align-items: center;
  -webkit-box-pack: center;
          justify-content: center;
  width: 100%;
  background: #261632;
}

svg {
  height: auto;
  max-width: 100%;
  width: 100px;
}

#fan polygon:nth-child(odd) {
  fill: #002E58;
}
#fan polygon:nth-child(even) {
  fill: #004A8B;
}
</style>

</head>
<body translate="no">
<svg version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" viewBox="0 0 92 92.1">
<defs>
<filter id="polycleaner">
<feComponentTransfer>
<feFuncA type="table" tableValues="0 0.5 1 1" />
</feComponentTransfer>
</filter>
<polyline id="fan-clipShape" points="12.5,79.5 89.2,86.6 89.2,2.5 12.5,2.5		" />
<clipPath id="fan-clipPath">
<use xlink:href="#fan-clipShape" />
</clipPath>
</defs>
<g id="fan" clip-path="url(#fan-clipPath)" filter="url(#polycleaner)">
<polygon fill="#002E58" points="53.1,14 44.5,15.4 44.5,15.4 12.5,79.5" />
<polygon fill="#004A8B" points="65.5,31.3 64.5,22.6 64.4,22.6 12.5,79.5" />
<polygon fill="#002E58" points="64.4,22.6 55.7,22.4 55.7,22.4 12.5,79.5" />
<polygon fill="#004A8B" points="32.1,10.7 26.7,3.8 26.7,3.8 12.5,79.5" />
<polygon fill="#002E58" points="40.4,7.7 32.1,10.7 32.1,10.7 12.5,79.5" />
<polygon fill="#004A8B" points="44.5,15.4 40.4,7.7 40.4,7.7 12.5,79.5" />
<polygon fill="#002E58" points="89.2,72.4 82.9,66.4 82.9,66.3 12.5,79.5" />
<polygon fill="#004A8B" points="55.7,22.4 53.1,14 53.1,14 12.5,79..........完整代码请登录后点击上方下载按钮下载查看

网友评论0