说明: 希望给页面上某个元素添加雪花飘洒的效果
xui.snowFlake({
id: string,
direction: string
})
id
表示雪花容器,必传direction
表示雪花的飘洒方向, 默认向右, 可以设置为left
- 需要注意的是, 建议给你容器一个宽高
_ - 没有你想要的功能? 快联系我:
xumeng0611@gmail.com
添加吧
1.人生当如冬之纯洁.
人生当如冬之纯洁
Pure As Snow
<style type="text/css">
#snow{
width: 100%;
height: 200px;
color: #fff;
display: flex;
flex-direction: column;
justify-content: center;
align-items: center;
z-index: 9;
background: linear-gradient(to bottom, #7dbacc, #fafcfd);
}
</style>
<script type="text/javascript">
xui.snowFlake({
id: 'snow',
})
</script>
xui.snowFlake({
id: 'snow',
})
2.未若柳絮因风起
未若柳絮因风起
<style type="text/css">
#snow1{
width: 100%;
height: 200px;
color: #fff;
display: flex;
flex-direction: column;
justify-content: center;
align-items: center;
z-index: 9;
filter: brightness(1.1);
background: linear-gradient(to bottom, #000, #fafcfd);
}
</style>
<script type="text/javascript">
xui.snowFlake({
id: 'snow1',
direction: 'left',
})
</script>
xui.snowFlake({
id: 'snow1',
direction: 'left',
})