simplex-noise实现canvas多触脚不明生物跟随鼠标运动动画效果代码

代码语言:html

所属分类:动画

代码描述:simplex-noise实现canvas多触脚不明生物跟随鼠标运动动画效果代码

代码标签: simplex-noise canvas 触脚 生物 跟随 鼠标 运动

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

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

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

    <style>
        html, body {
      overflow: hidden;
      background: black;
      cursor: crosshair;
    }
    
    .controls {
      bottom: 0;
      display: flex;
      opacity: 0.8;
      padding: 16px;
      position: fixed;
      right: 0;
      z-index: 2;
    }
    .controls__label {
      border: 1px solid #6a1b9a;
      cursor: pointer;
      display: block;
      height: 36px;
      margin-left: 16px;
      padding: 0 16px;
      border-radius: 17px;
    }
    .controls__rdo {
      display: none;
    }
    .controls__rdo:checked + .controls__label {
      background-color: #6a1b9a;
    }
    .controls__icon {
      align-items: center;
      display: block;
    }
    .controls__icon--line, .controls__icon--dot-line {
      position: relative;
      top: calc(50% - 1px);
    }
    .controls__icon--dot {
      position: relative;
      transform: translateY(calc(50% + 1px));
    }
    .controls__icon--line, .controls__icon--dot-line {
      background-color: white;
      height: 1px;
      width: 16px;
    }
    .controls__icon--dot-line {
      position: relative;
    }
    .controls__icon--dot-line:after {
      content: "";
      display: block;
      position: absolute;
      transform: translateY(calc(-50% + 1px));
    }
    .controls__icon--dot, .controls__icon--dot-line:after {
      border: 1px solid white;
      border-radius: 50%;
      height: 14px;
      width: 14px;
    }
    </style>
</head>

<body>
    <!-- partial:index.partial.html -->
    <div class="controls">
        <input type="radio" class="controls__rdo" name="style" id="rdo-dot-line" value="dot-line" checked />
        <label class="controls__label" for="rdo-dot-line">
		<span class="controls__icon controls__icon--dot-line"></span>
	</label>
        <input type="radio" class="controls__rdo" name="style" id="rdo-dot" value="dot" />
        <label class="controls__label" for="rdo-dot">
		<span class="controls__icon controls__icon--dot"></span>
	</label>
        <input type="radio" class="controls__rdo" name="style" id="rdo-line" value="line" />
        <label class=&q.........完整代码请登录后点击上方下载按钮下载查看

网友评论0