宇宙银河系星空穿越效果
代码语言:html
所属分类:粒子
下面为部分代码预览,完整代码请点击下载或在bfwstudio webide中打开
<!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <style> body { margin: 0; } .container { background-image: url("http://repo.bfw.wiki/bfwrepo/image/5e59aeabe4541.png"); background-repeat: no-repeat; background-size: cover; background-position: center center; position: relative; height: 100vh; width: 100vw; } .star { background-color: #fff; box-shadow: 0 0 10px rgba(255, 255, 255); border-radius: 50%; position: absolute; opacity: 0; top: 50%; left: 50%; transform: translate(-50%, -50%); height: 4px; width: 4px; } </style> </head> <body translate="no"> <div class="container" id="container"> </div> <script > const container = document.getElementById('container'); const timeToRunAnim = 5000; let starIdx = 0; setInterval(() => createStar.........完整代码请登录后点击上方下载按钮下载查看
网友评论0