bubbly-bg.js插件与html5 canvas实现的气泡背景动画特效,点击图片来切换展示各种动态气泡背景效果。
js代码
<script type="text/javascript" src="js/bubbly-bg.js"></script>
<script type="text/javascript">
bubbly();
let configs = [
{},
{
colorStart: "#111",
colorStop: "#422",
bubbleFunc: () => `hsla(0, 100%, 50%, ${Math.random() * 0.25})`
},
{
colorStart: "#4c004c",
colorStop: "#1a001a",
bubbleFunc: () => `hsla(${Math.random() * 360}, 100%, 50%, ${Math.random() * 0.25})`
},
{
colorStart: "#fff4e6",
colorStop: "#ffe9e4",
blur: 1,
compose: "source-over",
bubbleFunc: () => `hsla(${Math.random() * 50}, 100%, 50%, .3)`
}
];
document.addEventListener("click", function (e) {
if (e.target.hasAttribute("data-config-nr")) {
document.body.removeChild(document.querySelector("canvas"));
bubbly(configs[e.target.getAttribute("data-config-nr")]);
}
});
</script>
系统已开启自动识别垃圾评论机制,识别到的自动封号,下载出错或者资源有问题请联系全栈客服QQ 1915635791