css+div实现立体图标环境光变换动画效果代码
代码语言:html
所属分类:动画
代码描述:css+div实现立体图标环境光变换动画效果代码
下面为部分代码预览,完整代码请点击下载或在bfwstudio webide中打开
<!DOCTYPE html> <html lang="en" > <head> <meta charset="UTF-8"> <link type="text/css" rel="stylesheet" href="//repo.bfw.wiki/bfwrepo/css/all.6.5.1.css"> <style> *{ margin: 0; padding: 0; box-sizing: border-box; } body { display: flex; justify-content: center; align-items: center; min-height: 100vh; background: #050505; animation: colorChange 4s linear infinite; } @keyframes colorChange{ 0%,100%{ filter: hue-rotate(270deg); } 50%{ filter: hue-rotate(360deg); } } .cube{ position: relative; width: 400px; height: 100px; transform-style: preserve-3d; animation: animate 4s linear infinite; } @keyframes animate { 0%{ transform: rotateX(-30deg) rotateY(0deg); } 100%{ transform: rotateX(-30deg) rotateY(360deg); } } .cube .box { position: absolute; top: 0; left: 0; width: 100%; height: 100%; transform-style: preserve-3d; } .cube .box span { position: absolute; top: 0; left: 0; width: 100%; height: 100%; background: linear-gradient(rgba(21,21,25,1), rgba(255,6,6,1)); transform-style: preserve-3d; transform: rotateY(calc(90deg * var(--i))) translateZ(200px); } .top{ position: absolute; top: 0; left: 0; width: 400px.........完整代码请登录后点击上方下载按钮下载查看
网友评论0