svg+js实现立体雪花下雪飘动动画效果代码
代码语言:html
所属分类:动画
代码描述:svg+js实现立体雪花下雪飘动动画效果代码
下面为部分代码预览,完整代码请点击下载或在bfwstudio webide中打开
<!DOCTYPE html> <html lang="en" > <head> <meta charset="UTF-8"> <style> body { margin: 0; background: linear-gradient(darkblue, #111122); overflow: hidden; height: 100vh; } path:hover { } </style> </head> <body translate="no"> <script> function snowfetti(el = document.body, opt_properties) { if (!el) { console.error("Must have element to populate the confetti!"); return; } const defaultProperties = { addBlur: true, angle: 0, beginStart: false, drop: 400, fadeout: true, fixedSize: false, flakes: 100, scale: 1, speed: 5000, spread: 400, spin: true, zSpin: true }; const c = {...defaultProperties, ...opt_properties}; const randInt = (min, max) => { return Math.floor(Math.random() * (max - min + 1)) + min; }; const baseEncode = (vall = document.querySelector("#usrInput").value) => { let usrVal = vall.replace(/\s\s+/g, ` `); let btoa = window.btoa(usrVal); let res = encodeURI(vall); if (res.indexOf("xmlns=") == -1) res = res.replace(`%3Csvg`, `%3Csvg.........完整代码请登录后点击上方下载按钮下载查看
网友评论0