div+css实现立体苹果Apple Pro Display XDR显示器旋转动画效果代码
代码语言:html
所属分类:布局界面
代码描述:div+css实现立体苹果Apple Pro Display XDR显示器旋转动画效果代码
代码标签: div css 立体 苹果 Apple Pro Display XDR 显示器 旋转 动画
下面为部分代码预览,完整代码请点击下载或在bfwstudio webide中打开
<!DOCTYPE html> <html lang="en" > <head> <meta name="viewport" content="width=device-width, initial-scale=1, viewport-fit=cover"> <style> * { border: 0; box-sizing: border-box; margin: 0; padding: 0; } :root { --hue: 223; --bg: hsl(var(--hue),10%,50%); --fg: hsl(var(--hue),10%,10%); font-size: calc(16px + (32 - 16) * (100vw - 320px) / (2560 - 320)); } body { background-color: var(--bg); color: var(--fg); display: flex; font: 1em/1.5 sans-serif; height: 100vh; min-height: 375px; perspective: 1200px; perspective-origin: 50% calc(50% + 6.5em); transition: background-color var(--trans-dur), color var(--trans-dur); } .xdr, .xdr__monitor, .xdr__upper-stand, .xdr__lower-stand { transform-style: preserve-3d; } .xdr { animation: xdrRotate 5s ease-in-out infinite; margin: auto; width: 16em; height: 13em; } .xdr__monitor { position: relative; width: 16em; height: 9em; } .xdr__monitor-back, .xdr__monitor-left, .xdr__monitor-right, .xdr__monitor-front, .xdr__upper-stand-back, .xdr__upper-stand-front, .xdr__lower-stand-back, .xdr__lower-stand-front { position: absolute; width: 100%; height: 100%; } .xdr__monitor-back { background-image: linear-gradient( hsl(var(--hue),10%,65%), hsl(var(--hue),10%,80%) 95%, hsl(var(--hue),10%,60%) ); border-radius: 0.2em; bottom: 0; transform: translateZ(2em); } .xdr__monitor-left, .xdr__monitor-right { background-image: linear-gradient( hsl(var(--hue),10%,90%), hsla(var(--hue),10%,90%,0) ); top: 0; width: 1em; height: 5%; } .xdr__monitor-left { left: 0; transform-origin: 0 50%; transform: translateZ(2em) translateY(0.125em) rotateY(-90deg); } .xdr__monitor-right { right: 0; transform-origin: 100% 50%; transform: translateZ(2em) translateY(0.125em) rotateY(90deg); } .xdr__monitor-front { background-color: hsl(248,78%,27%); background-image: radial-gradient( 4em 4em at 85% 45%, hsl(280,27%,2%), hsla(280,27%,2%,0) ), radial-gradient( 5em 5em at 90% 100%, hsl(280,27%,2%), hsla(280,27%,2%,0) ), radial-gradient( 22em 16em at 0 100%, hsl(50,90%,56%), hsl(16,92%,56%) 30%, hsla(16,92%,56%,0) 50% ), radial-gradient( 14em 18em at 25% 60%, hsl(320,78%,51%) 15%, hsla(320,78%,51%,0) 50% ); border-radius: 0.2em; box-sha.........完整代码请登录后点击上方下载按钮下载查看
网友评论0