div+css实现星体天体在宇宙星空中自转动画效果代码
代码语言:html
所属分类:动画
代码描述:div+css实现星体天体在宇宙星空中自转动画效果代码
代码标签: div+css 星体 天体 宇宙 星空 自转 动画效
下面为部分代码预览,完整代码请点击下载或在bfwstudio webide中打开
<!DOCTYPE html> <html lang="en" > <head> <meta charset="UTF-8"> <style> .planet_wraper { position: absolute; top: 0; bottom: 0; left: 0; right: 0; width: 7rem; height: 7rem; margin: auto; border-radius: 50%; } .planet_shadow { background: -webkit-linear-gradient(top left, #24b88b 20%, #21776f); background: -moz-linear-gradient(top left, #24b88b 20%, #21776f); box-shadow: inset 0 -5px 10px rgba(22, 48, 64, 0.5), 0 0 1.5rem rgba(170, 194, 194, 0.3); } .planet { position: relative; width: 100%; height: 100%; border-radius: 50%; animation: rotate 15s linear infinite; overflow: hidden; } .planet_wraper::before, .planet_wraper::after { content: ''; display: block; position: absolute; border-radius: 50%; box-shadow: 0 0.1rem 0.1rem rgba(170, 194, 194, 0.1), inset 0 -0.1rem 0.1rem rgba(170, 194, 194, 0.1); animation: rotate 5s linear infinite; } .planet_wraper::before { top: -1.75rem; left: -1.75rem; width: 11rem; height: 11rem; animation-delay: 1s; } .planet_wraper::after { top: -2.5rem; left: -2.5rem; width: 15rem; height: 15rem; } .planet > * { position: relative; border-radius: 50%; background-color: #209b85; box-shadow: inset 1px 1px 5px #163040, 0 0 7px #63eed2 ; opacity: 0.3; } .crater_1 { top: 2rem; left: 1.5rem; width: 0.75rem; height: 0.75rem; } .crater_2 { top: -0.75rem; left: 5rem; width: 2.5rem; height: 2.5rem; transform: scaleY(0.8) rotateY(-20deg); } .crater_3 { top: 0.5rem; left: 2rem; width: 1.25rem; height: 1.25rem; } .crater_4 { top: -1.5rem; left: 3.5rem; width: 0.5rem; height: 0.5rem; } .crater_5 { top: 1.25rem; left: 3.5rem; width: 2rem; height: 1.5rem; } @keyframes bg { to { background-position: center 20rem; } } @keyframes rotate { to { transform: rotate(360deg)} } body { background-color: #163040;.........完整代码请登录后点击上方下载按钮下载查看
网友评论0