代码:
<canvas class="fire"></canvas>
<style>
*,
*::before,
*::after {
padding: 0;
margin: 0 auto;
box-sizing: border-box;
}
body {
background-color: #000;
min-height: 100vh;
display: flex;
justify-content: center;
align-items: center;
}
.fire {
width: 100%;
}
</style>
<script>
const cWidth = 120;
const cHeight = 30;
const c = document.querySelector('.fire');
c.width = cWidth;
c.height = cHeight;
const ctx = c.getContext("2d");
const grd = ctx.cr