j+css实现立体圆点碎片组成的小球旋转文字动画效果代码
代码语言:html
所属分类:动画
代码描述:j+css实现立体圆点碎片组成的小球旋转文字动画效果代码,点击可切换明暗。
代码标签: j css 立体 圆点 碎片 组成 球 旋转 文字 动画
下面为部分代码预览,完整代码请点击下载或在bfwstudio webide中打开
<!DOCTYPE html> <html lang="en" > <head> <meta charset="UTF-8"> <style> @import url('https://fonts.googleapis.com/css2?family=Anta&display=swap'); *{ box-sizing: border-box; -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility; scroll-behavior: smooth;} html, body { height: 100%; overflow: hidden;} :root { --sphere-radius: 200px; --sphere-resolution: 20; } body { display: flex; justify-content: center; align-items: center; height: 100vh; background: linear-gradient(45deg, #333, #111); filter: invert(1); overflow: hidden; margin: 0; transition: all 3s ease-in-out; } body.inversion { background-color: #ccc; background: linear-gradient(45deg, #aaa, #eee); filter: invert(0); } h2, p{ position: absolute; font-family: "Anta", sans-serif; color: #474747; padding-left: 0.4em; } h2 { font-size: 4em; font-weight: 400; text-shadow: 1px 1px 0 #000, 1px -1px 0 #6851ff33, 1px -2px 0 #fff; } h2::before { content: ''; display: block; width: 100%; scale: 1.2; height: 0.2em; position: absolute; top: 46vh; left: 4%; right: 0%; margin: auto; background: #0003; filter: blur(16px); border-radius: 100%; } .inversion h2::before { background: #000a; } p { translate: 0.6em 1.8em; font-weight: 1000; font-size: 1.2em; color: #eee; text-shadow: 1px 1px 0px #000, 1px -1px 0 #fff; } .sphere { position: absolute; translate: 50% 40%; width: calc(var(--sphere-radius) * 2); height: calc(var(--sphere-radius) * 2); transform-style: preserve-3d; transform-origin: 0%; transform: rotateX(-30deg) rotateY(-45deg); animation: rotate 42s infinite linear; } @keyframes rotate { from { transform: rotateX(-30deg) rotateY(0deg) rotateZ(4deg); } to { transform: rotateX(-30deg) rotateY(360deg) .........完整代码请登录后点击上方下载按钮下载查看
网友评论0