废话不多说,先看下效果:
image
直接上代码:
<style type="text/css">
.fireworks {
position: absolute;
top: 0;
left: 0;
widows: 100%;
height: 100%;
}
</style>
<canvas class="fireworks"></canvas>
<script src="./anime.min.js"></script>
<script src="./fireworks.js"></script>
<script type="text/javascript">
fireworks.setCanvasSize();
</script>
{% raw %}
<style type="text/css">
.fireworks {
position: fixed;
top: 0;
left: 0;
widows: 100%;
height: 100%;
}
</style>
<canvas class="fireworks"></canvas>
<script src="/js/anime.min.js"></script>
<script src="/js/fireworks.js"></script>
<script type="text/javascript">
fireworks.setCanvasSize();
</script>
{% endraw %}
anime.min.js和fireworks.js都可以去anime官网上找到。或者关注公众号回复demo007获取@(献黄瓜)
网友评论