canvas莱卡镜头绘制效果

代码语言:html

所属分类:动画

代码描述:canvas莱卡镜头绘制效果

代码标签: 绘制 效果

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


<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">

<style>
html, body {
  height: 100%;
  margin: 0;
}

.container {
  height: 100%;
  display: flex;
  justify-content: center;
  align-items: center;
}
</style>

</head>
<body translate="no">
<div class="container">
<canvas class="canvas"></canvas>
</div>

<script>
const canvas = document.querySelector('.canvas');
const context = canvas.getContext('2d');

let animation;
let radius = 8;

requestAnimationFrame(() => {
  const ratio = window.devicePixelRatio;
  canvas.style.width = window.innerWidth + "px";
  canvas.st.........完整代码请登录后点击上方下载按钮下载查看

网友评论0