shape-shifter是独立的库,不依赖其他任务三方库,所以使用起来也很方便,步骤如下:
1.引入脚本
<script src="shape-shifter.js"></script>
2.核心网页代码(样式和canvas标签)
<style>
canvas {
background:#56bc8a;
display:block;
width:calc(100%);
height:calc(100vh);
}
</style>
<canvas id="myShape"></canvas>
3、脚本初始化
<script>
let shapeShifter = S;
window.onload=function(){
//shapeShifter.init(document.getElementById('myShape'),'任意内容');
shapeShifter.init(document.getElementById('myShape'),'Shape|Shifter|Timer|will start|#countdown 6||');
setTimeout(() => {
shapeShifter.UI.reset()
}, 20000);
}
</script>
the end