css布局绘制蜂鸟展翅飞翔360度旋转动画效果代码
代码语言:html
所属分类:动画
代码描述:css布局绘制蜂鸟展翅飞翔360度旋转动画效果代码
下面为部分代码预览,完整代码请点击下载或在bfwstudio webide中打开
<!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <meta name="viewport" content="width=device-width, initial-scale=1"> <style> @import url("//fonts.googleapis.com/css?family=Lora:700"); *,*:after,*:before { box-sizing:border-box; -webkit-backface-visibility:visible; backface-visibility:visible; } .wrapper { min-width:100vw; min-height:100vh; display:flex; align-items:center; justify-content:center; background:linear-gradient(-45deg,#111,#355); font-family:Lora,serif; overflow:hidden; } .hummingbird { margin-top:50px; width:200px; height:200px; -webkit-perspective:60rem; perspective:60rem; -webkit-transform-style:preserve-3d; transform-style:preserve-3d; transition:-webkit-transform 0.2s ease-out; transition:transform 0.2s ease-out; transition:transform 0.2s ease-out,-webkit-transform 0.2s ease-out; -webkit-transform-origin:center; transform-origin:center; pointer-events:none; } @media (max-width:768px) { .hummingbird { -webkit-transform:scale(0.8); transform:scale(0.8); } }.hummingbird .body { height:100%; -webkit-transform-style:preserve-3d; transform-style:preserve-3d; -webkit-transform:rotateY(0deg); transform:rotateY(0deg); -webkit-animation:rotate 15s linear infinite; animation:rotate 15s linear infinite; } @-webkit-keyframes rotate { 100% { -webkit-transform:rotateY(360deg); transform:rotateY(360deg); } }@keyframes rotate { 100% { -webkit-transform:rotateY(360deg); transform:rotateY(360deg); } }.hummingbird .body:before,.hummingbird .body:after { content:''; display:block; width:70px; height:100%; position:absolute; left:50%; -webkit-transform-origin:top right; transform-origin:top right; background:linear-gradient(to bottom,rgba(119,238,180,0.8),rgba(83,169,197,0.8),transparent); } .hummingbird .body:before { -webkit-transform:rotateZ(30deg) rotateY(30deg); transform:rotateZ(30deg) rotateY(30deg); -webkit-clip-path:polygon(0 0,100% 10%,100% 100%); clip-path:polygon(0 0,100% 10%,100% 100%); } .hummingbird .body:after { -webkit-transform:rotateZ(30deg) rotateY(-30deg); transform:rotateZ(30deg) rotateY(-30deg); -webkit-clip-path:polygon(0 0,100% 10%,100% 100%); clip-path:polygon(0 0,100% 10%,100% 100%); } .hummingbird .body .back { width:60px; height:100%; position:absolute; background:linear-gradient(to bottom,rgba(119,238,180,0.8),rgba(83,169,197,0.8),transparent); -webkit-transform-style:preserve-3d; transform-style:preserve-3d; -webkit-clip-path:polygon(0 0,100% 0,50% 100%); clip-path:polygon(0 0,100% 0,50% 100%); -webkit-transform:rotateY(90deg) rotateX(-13deg) translateZ(55px) translateY(-45px); transform:rotateY(90deg) rotateX(-13deg) translateZ(55px) translateY(-45px); } .hummingbird .body .wings { position:absolute; left:35%; top:40px; height:100%; -webkit-transform-style:preserve-3d; transform-style:preserve-3d; } .hummingbird .body .wings:before,.hummingbird .body .wings:after { content:''; display:block; width:70px; height:100%; position:absolute; left:50%; top:-25px; -webkit-transform-origin:top center; transform-origin:top center; background:linear-gradient(to top,#d46f30,transparent); } .hummingbird .body .wings:before { -webkit-clip-path:polygon(100% 0,100% 100%,0 0); clip-path:polygon(100% 0,100% 100%,0 0); -webkit-animation:beating-left 2s ease-in-out infinite; animation:beating-left 2s ease-in-out infinite; } @-webkit-keyframes beating-left { 0% { -webkit-transform:rotateZ(-75deg) rotateY(-10deg) translateZ(30px) rotateX(0deg); transform:rotateZ(-75deg) rotateY(-10deg) translateZ(30px) rotateX(0deg); } 50% { -webkit-transform:rotateZ(-75deg) rotateY(-10deg) translateZ(30px) rotateX(180deg); transform:rotateZ(-75deg) rotateY(-10deg) translateZ(30px) rotateX(180deg); } 100% { -webkit-transform:rotateZ(-75deg) rotateY(-10deg) translateZ(30px) rotateX(0deg); transform:rotateZ(-75deg) rotateY(-10deg) translateZ(30px) rotateX(0deg); } }@keyframes beating-left { 0% { -webkit-transform:rotateZ(-75deg) rotateY(-10deg) translateZ(30px) rotateX(0deg); transform:rotateZ(-75deg) rotateY(-10deg) translateZ(30px) rotateX(0deg); } 50% { -webkit-transform:rotateZ(-75deg) rotateY(-10deg) translateZ(30px) rotateX(180deg); transform:rotateZ(-75deg) rotateY(-10deg) translateZ(30px) rotateX(180deg); } 100% { -webkit-transform:rotateZ(-75deg) rotateY(-10deg) translateZ(30px) rotateX(0deg); transform:rotateZ(-75deg) rotateY(-1.........完整代码请登录后点击上方下载按钮下载查看
网友评论0