div+css实现三维锥子旋转交互动画效果代码
代码语言:html
所属分类:动画
代码描述:div+css实现三维锥子旋转交互动画效果代码
下面为部分代码预览,完整代码请点击下载或在bfwstudio webide中打开
<!DOCTYPE html> <html lang="en" > <head> <meta charset="UTF-8"> <style> @import url("https://fonts.googleapis.com/css2?family=Rubik+Moonrocks&display=swap"); *, *::before, *::after { padding: 0; margin: 0 auto; box-sizing: border-box; } body { font-family: "Rubik Moonrocks", sans-serif; background-color: skyblue; min-height: 100vh; display: grid; place-items: center; perspective: 800px; font-size: 10px; } body *:not(:empty) { transform-style: preserve-3d; } .scene { position: relative; transform: translateY(15em) rotateY(calc(60deg * var(--x, 0) - 30deg)) rotateX(calc(40deg * var(--y, 0) - 30deg)); } .floor { position: absolute; inset: -100em; transform: rotateX(90deg); background-color: #fff; transform-style: preserve-3d; background-image: radial-gradient(closest-side, transparent, skyblue), repeating-linear-gradient(0deg, #0001 0 2px, transparent 4px calc(3em - 4px), #0001 calc(3em - 2px) 1em), repeating-linear-gradient(60deg, #0001 0 2px, transparent 4px calc(3em - 4px), #0001 calc(3e.........完整代码请登录后点击上方下载按钮下载查看
网友评论0