gsap实现颜色随机变化方块动画代码

代码语言:html

所属分类:动画

代码描述:gsap实现颜色随机变化方块动画代码

代码标签: gsap 颜色 随机 变化 方块 动画 代码

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

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

<head>
  <meta charset="UTF-8">
  
 <meta charset="UTF-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>Color & Geometry Visualizer</title>
    <link
      href="https://fonts.googleapis.com/css2?family=Roboto+Mono&display=swap"
      rel="stylesheet"
    />
    <style>
      body {
        font-family: "Roboto Mono", monospace;
        display: flex;
        flex-direction: column;
        justify-content: center;
        align-items: center;
        height: 100vh;
        margin: 0;
        background-color: #000;
        overflow: hidden;
        user-select: none;
      }

      #grid-container {
        display: grid;
        gap: 0px;
        width: 100vw;
        height: 100vh;
        padding: 0px;
        box-sizing: border-box;
      }
      #colorButton, #pixel-art {
        display:none;
        
      }
      .color-box {
        display: flex;
        justify-content: center;
        align-items: center;
        text-align: center;
        border: 1px solid #333;
        font-size: calc(0.5vw + 0.5vh);
        transition: background-color 0.3s, color 0.3s, transform 0.3s;
        min-width: 50px;
        border-radius:4px; 
        min-height: 50px;
        transform:scale(.75);
      }

      .symbol {
        transition: transform 0.3s ease;
      }

      #buttons-container {
        position: absolute;
        bottom: 20px;
        display: flex;
        gap: 10px;
      }

      .button {
        width: 150px;
        height: 50px;
        background-color: #fff;
        color: #000;
        padding:.........完整代码请登录后点击上方下载按钮下载查看

网友评论0