TweenMax实现夜空中萤火虫飞舞点亮星空动画效果代码
代码语言:html
所属分类:动画
代码描述:TweenMax实现夜空中萤火虫飞舞点亮星空动画效果代码
下面为部分代码预览,完整代码请点击下载或在bfwstudio webide中打开
<!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <style> body { margin: 0 auto; background: #000; overflow: hidden; } .particle_star { width:4px; height:4px; position:absolute; background-color: #ffffff; box-shadow:0px 0px 17px 4px wheat; border-radius: 50%; } .container { height: 100vh; position: relative; overflow: hidden; width:100%; background: url('//repo.bfw.wiki/bfwrepo/image/611da9b999795.png') center center no-repeat; background-size: cover; } </style> </head> <body> <div class="container"></div> <script type="text/javascript" src="//repo.bfw.wiki/bfwrepo/js/jquery-3.2.1.min.js"></script> <script type="text/javascript" src="//repo.bfw.wiki/bfwrepo/js/TweenMax.min.js"></script> <script> var star_num = 75; var $container = $(".container"); var $containerWidth = $container.width(); var $containerHeight = $container.height(); for (var i = 0; i < .........完整代码请登录后点击上方下载按钮下载查看
网友评论0