gsap实现时分秒向上滚动数字跳动显示时间动画效果代码

代码语言:html

所属分类:动画

代码描述:gsap实现时分秒向上滚动数字跳动显示时间动画效果代码

代码标签: gsap 时分秒 向上 滚动 数字 跳动 显示 时间 动画

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

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

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

  
  
  
<style>
@import url("https://fonts.googleapis.com/css2?family=Red+Hat+Mono:wght@400;500;600;700&display=swap");

body {
  height: 100vh;
  margin: 0;
  padding: 0;
  background: #c5c5c5;
  display: flex;
  align-items: center;
  overflow: hidden;
}

.main-container {
  width: 100%;
  height: 75px;
  display: grid;
  gap: 30px;
  grid-template-columns: auto 200px 200px 200px auto;
  position: relative;
}

.slider-main-container,
.slider-magnifier-container {
  display: flex;
  align-items: flex-start;
  font-family: "Red Hat Mono", monospace;
  font-size: 35px;
  color: #525252;
  width: 200px;
  height: 75px;
  position: relative;
  top: 0;
  position: absolute;
}
.slider-magnifier-container {
  font-weight: 800;
  font-size: 45px;
  overflow: hidden;
  height: 75px;
}

.hr {
  grid-column: 2;
}

.mn {
  grid-column: 3;
}

.sc {
  grid-column: 4;
}

.slider-container {
  width: 100%;
  display: flex;
  justify-content: center;
}

.slider {
  width: 75px;
  text-align: center;
  position: absolute;
}

.slider-magnifier-container .slider {
  z-index: 1;
  background: #979797;
  color: #000;
}

p {
  margin: 0;
  line-height: 75px;
}
</style>


  
  
</head>

<body >
  <div class="main-container">

        <div class="slider-main-container hr">
            <div class="slider-container">
                <div class="slider">
                    <p class="nbr">0</p>
                    <p class="nbr">1</p>
                    <p class="nbr">2</p>
                </div>
            </div>
                
            <div class="slider-container">
                <div class="slider">
                    <p class="nbr">0</p>
                    <p class="nbr">1</p>
                    <p class="nbr">2</p>
                    <p class="nbr">3</p>
                    <p class="nbr">4</p>
                    <p class="nbr">5</p>
                    <p class="nbr">6</p>
                    <p class="nbr">7</p>
                    <p class="nbr">8</p>
                    <p class="nbr">8</p>
                </div>
            </div>
        </div>

        <div class="slider-magnifier-container hr">
            <div class="slider-container">
                <div class="slider">
                    <p class="nbr">0</p>
                    <p class="nbr">1</p>
                    <p class="nbr">2</p>
                </div>
            </div>
                
            <div class="slider-container">
                <div class="slider">
                    <p class="nbr">0</p>
                    <p class="nbr">1</p>
                    <p class="nbr">2</p>
                    <p class="nbr">3</p>
                    <p class="nbr">4</p>
                    <p class="nbr">5</p>
                    <p class="nbr">6</p>
                    <p class="nbr">7</p>
                    <p class="nbr">8</p>
                    <p class="nbr">9</p>
                </div>
            </div>
        </div>

        <div class="slider-main-container mn">
            <div class="slider-container">
                <div class="slider">
                    <p class="nbr">0</p>
                    <p class="nbr">1</p>
                    <p class="nbr">2</p>
                    <p class="nbr">3</p>
                    <p class="nbr">5</p>
                    <p class="nbr">5</p>
                </div>
            </div>
            <div class="slider-container">
                <div class="slider">
                    <p class="nbr">0</p>
                    <p class="nbr">1</p>
                    <p class="nbr">2</p>
                    <p class="nbr">3</p>
                    <p class="nbr">4</p>
                    <p class="nbr">5</p>
                    <p class="nbr">6</p>
                    <p class="nbr">7</p>
                    <p class="nbr">8</p>
                    <p class="nbr">9</p>
                </div>
            </div>
        </div>

        <div class="slider-magnifier-container mn">
            <div class="slider-container">
                <d.........完整代码请登录后点击上方下载按钮下载查看

网友评论0