canvas绘制波浪形彩色曲线效果代码

代码语言:html

所属分类:其他

代码描述:canvas绘制波浪形彩色曲线效果代码

代码标签: canvas 绘制 波浪 彩色 曲线

下面为部分代码预览,完整代码请点击下载或在bfwstudio webide中打开

<!DOCTYPE html>
<html lang="en" >

<head>
  <meta charset="UTF-8">
  

  
  
<style>
@import url('https://fonts.googleapis.com/css2?family=Anton&display=swap');
* {
  box-sizing: border-box;
  margin: 0;
}
body {
  background-color: #3d3d59;
  display: grid;
  padding: 1em;
  place-content: center;
}
canvas {
  border: 1em ridge #f6c6a4;
  max-width: 100%;
}
h1 {
  color: rgba(246, 198, 164, .25);
  font-family: "Anton", sans-serif;
  font-weight: 400;
  font-style: normal;
  justify-self: end;
  line-height: 1.1;
  margin-top: .25ch;
}
</style>

  
  
</head>

<body >
  <canvas id="canvas" width="800" height="800"></canvas>
<h1>REFRESH TO GENERATE ANOTHER</h1>
  
      <script >
const canvas = document.getElementById('canvas');
const ctx = canvas.getContext('2d');

const width = canvas.width;
const height = canvas.height;
const lineCount = 450;
const baseAmplitude .........完整代码请登录后点击上方下载按钮下载查看

网友评论0