css布局实现全月和流星效果
代码语言:html
所属分类:布局界面
代码描述:css布局实现全月和流星效果
下面为部分代码预览,完整代码请点击下载或在bfwstudio webide中打开
<!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Roboto:400,400i,700"> <style> /* Utils */ /* Style */ body { padding: 0; margin: 0; width: 100vw; height: 100vh; display: flex; align-items: center; justify-content: center; font-family: Roboto, sans-serif; } .container { width: 500px; height: 500px; position: relative; border-radius: 50%; background-color: #251f31; overflow: hidden; z-index: -100; border: 20px solid white; box-shadow: 0 8px 20px rgba(74, 40, 126, 0.2); } .container *, .container *:before, .container *:after { position: absolute; box-sizing: border-box; } .moon { width: 250px; height: 250px; z-index: 4; box-shadow: 0 0 10px rgba(255, 255, 255, 0.5); background-color: #fff; border-radius: 50%; top: 50%; left: 50%; transform: translate(-50%, -50%); } .moon .carter { width: 70px; height: 70px; background-color: #f0f0e3; border-radius: 50%; left: 60%; top: 50%; transform: translate(-50%, -50%); z-index: 3; } .moon .carter.second { width: 27px; height: 27px; left: 84%; top: 55%; z-index: 2; } .moon .carter.third { width: 40px; height: 40px; left: 65%; top: 75%; z-index: 1; } .moon .moon-halo:after, .moon .moon-halo:before { content: ''; display: inline-block; } .moon .moon-halo, .moon .moon-halo:after, .moon .moon-halo:before { top: 50%; left: 50%; transform: translate(-50%, -50%); background-color: #fff; opacity: 0.2; width: 300px; height: 300px; border-radius: 50%; transform-origin: 0 0; animation: shine 1s ease-in-out infinite alternate; } .moon .moon-halo:before { width: 350px; height: 350px; animation-delay: 200ms; } .moon .moon-halo:after { width: 400px; height: 400px; animation-delay: 400ms; } .meteors { z-index: -10; width: 100%; height: 100%; } .meteors .meteor { width: 0; height: 0; border-top: 1px solid transparent; border-bottom: 1px solid transparent; border-right: 90px solid #fff; border-image: linear-gradient(to left, #fff, transparent) 1 100%; border-radius: 0 2px 2px 0; transform: rotate(30deg); position: absolute; top: 23%; left: 70%; opacity: 0; animation: shooting 4s linear infinite; animation-delay: 1s; } .meteors .meteor:nth-child(2.........完整代码请登录后点击上方下载按钮下载查看
网友评论0