https://github.com/ahmetilhan24/snow-fall-effect
降雪效应
它为您的网站提供了现实的降雪效果,以使您的网站在冬季看起来更美观。
伪造
HTML文件
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<!--import inside head tag-->
<script src="../dist/index.js" type="module"></script>
</head>
<body>
<!--Call it snowfall here too.-->
<script type="module" defer>
import SnowFall from "../dist/index.js";
new SnowFall();
</script>
</body>
</html>
Vue
import SnowFall from "snow-fall"
export default {
data() {
return {
msg: 'foo'
}
}
mounted() {
new SnowFall();
}
}
配置
类型
{
sizeRange: [number, number],
color: string,
speed: number,
}
new SnowFall({
sizeRange: [10, 20], // default (min 0)
color: "#fff", // default
speed: 10, // default (second)
});
由Ahmetilhan编码