canvas模拟二进制时钟走动效果代码

代码语言:html

所属分类:动画

代码描述:canvas模拟二进制时钟走动效果代码

代码标签: 时钟 走动 效果

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

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

<head>

  <meta charset="UTF-8">

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

body {
  margin: 0;
  position: relative;
}

canvas {
  margin: 0;
  position: absolute;
}
</style>


</head>

<body translate="no" >
  <canvas id="clock-face"></canvas>
<canvas id="clock-hands"></canvas>

  
      <script>
window.onload = function () {
  const cf = document.getElementById("clock-face"),
  cf$ = cf.getContext("2d"),
  ch = document.getElementById("clock-hands"),
  ch$ = ch.getContext("2d"),
  // firstColor = '#f44242',
  // secondColor = '#223235',
  // background = '#0f0f0f',
  // handsColor = '#ffffff', // red blue black theme

  // firstColor = '#ff00a5',
  // secondColor = '#2b103a',
  // background = .........完整代码请登录后点击上方下载按钮下载查看

网友评论0