css实现文字绕三维地球旋转动画效果代码
代码语言:html
所属分类:三维
代码描述:css实现文字绕三维地球旋转动画效果代码,类似于新闻联播及环球影视片头地球动画效果。
下面为部分代码预览,完整代码请点击下载或在bfwstudio webide中打开
<!DOCTYPE html> <html lang="en" > <head> <meta charset="UTF-8"> <style> *, *::before, *::after { padding: 0; margin: 0 auto; box-sizing: border-box; } body { background-color: #111; color: #fff; min-height: 100vh; display: grid; place-items: center; } @import url("https://fonts.googleapis.com/css2?family=Josefin+Sans:wght@300;700&display=swap"); *:not(:empty) { transform-style: preserve-3d; } body { font-family: "Josefin Sans", sans-serif; color: gold; background-image: radial-gradient(circle, #300, #000 320px); perspective: 500px; overflow: hidden; } .scene { position: fixed; top: 50%; left: 50%; transform: rotateY(-90deg); -webkit-animation: rotateScene 36s infinite linear; animation: rotateScene 36s infinite linear; } @-webkit-keyframes rotateScene { from { transform: rotateY(0deg); } to { transform: rotateY(-360deg); } } @keyframes rotateScene { from { transform: rotateY(0deg); } to { transform: rotateY(-360deg); } } .globe { -webkit-animation: rotateGlobe 36s infinite linear; animation: rotateGlobe 36s infinite linear; } @-webkit-keyframes rotateGlobe { from { transform: translateY(20px) rotateZ(30deg) rotateY(0deg); } to { transform: translateY(20px) rotateZ(30deg) rotateY(1440deg); } } @keyframes rotateGlobe { from { transform: translateY(20px) rotateZ(30deg) rotateY(0deg); } to { transform: translateY(20px) rotateZ(30deg) rotateY(1440deg); } } .ring > div { position: absolute; width: 50px; height: 25px; transform: translate(-50%, -50%) rotateY(var(--ry, 0deg)) rotateX(var(--rx, 0deg)) translateZ(120px); -webkit-clip-path: var(--cp); clip-path: var(--cp); background-image: url("//repo.bfw.wiki/bfwrepo/image/6143c005b4755.png"); background-position: var(--bpx, 0) var(--bpy, 0); } .ring > div:nth-child(1) { --ry: 0deg; -webkit-animation-delay: -2.25s; animation-delay: -2.25s; --bpx: 0%; } .ring > div:nth-child(2) { --ry: 22.5deg; -webkit-animation-delay: -2.8125s; animation-delay: -2.8125s; --bpx: 6.25%; } .ring > div:nth-child(3) { --ry: 45deg; -webkit-animation-delay: -3.375s; animation-delay: -3.375s; --bpx: 12.5%; } .ring > div:nth-child(4) { --ry: 67.5deg; -webkit-animation-delay: -3.9375s; animation-delay: -3.9375s; --bpx: 18.75%; } .ring > div:nth-child(5) { --ry: 90deg; -webkit-animation-delay: -4.5s; animation-delay: -4.5s; --bpx: 25%; } .ring > div:nth-child(6) { --ry: 112.5deg; -webkit-animation-delay: -5.0625s; animation-delay: -5.0625s; --bpx: 31.25%; } .ring > div:nth-child(7) { --ry: 135deg; -webkit-animation-delay: -5.625s; animation-delay: -5.625s; --bpx: 37.5%; } .ring > div:nth-child(8) { --ry: 157.5deg; -webkit-animation-delay: -6.1875s; animation-delay: -6.1875s; --bpx: 43.75%; } .ring > div:nth-child(9) { --ry: 180deg; -webkit-animation-delay: -6.75s; animation-delay: -6.75s; --bpx: 50%; } .ring > div:nth-child(10) { --ry: 202.5deg; -webkit-animation-delay: -7.3125s; animation-delay: -7.3125s; --bpx: 56.25%; } .ring > div:nth-chi.........完整代码请登录后点击上方下载按钮下载查看
网友评论0