js+css实现页面滚动驱动齿轮转动动画效果代码

代码语言:html

所属分类:加载滚动

代码描述:js+css实现页面滚动驱动齿轮转动动画效果代码

代码标签: js css 页面 滚动 驱动 齿轮 转动 动画

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

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

<head>
  <meta charset="UTF-8">
  
  
  
<style>
@import url('https://fonts.googleapis.com/css2?family=Gloria+Hallelujah&display=swap');


@layer normalize, base, demo;

@layer demo {
  body {
    height: 500vh;
  }

  html {
    color-scheme: light dark;
  }

  [data-theme='light'] {
    color-scheme: light only;
  }

  [data-theme='dark'] {
    color-scheme: dark only;
  }

  .arrow {
    position: fixed;
    left: 9rem;
    top: 12rem;
    width: 70px;
    z-index: 9999;
  }

  .arrow svg {
    width: 70px;
    scale: -1 1;
  }

  .arrow label {
    font-family: 'Gloria Hallelujah', cursive;
    position: absolute;
    left: 110%;
    top: 50%;
  }

  h1 {
    --font-level: 5;
    position: fixed;
    top: 50%;
    left: 50%;
    translate: -50% -50%;
    margin: 0;
    white-space: nowrap;
  }

  .gears {
    width: 100px;
    aspect-ratio: 1 / 2;
    position: fixed;
    top: 5.5rem;
    left: 1.5rem;
    container-type: inline-size;
  }

  .gears__box {
    position: absolute;
    inset: 0;
    overflow: hidden;
    background: light-dark(hsl(0 0% 15%), hsl(0 0% 0%));
  }

  .gears::before {
    content: '';
    position: absolute;
    inset: -10px;
    z-index: -1;
    background: radial-gradient(
          circle at center,
          light-dark(hsl(0 0% 75%), hsl(0 0% 50.........完整代码请登录后点击上方下载按钮下载查看

网友评论0