繁体   English   中英

Animation 到首页过渡

[英]Animation to Home Page Transition

我在个人项目上有一个开放的 animation,然后我试图将 animation 转换到我的主页。 animation 在 CSS 完成,但想在 JavaScript 完成。

.wrapper {
    height: 100vh;
    display: grid;
    place-items: center;
  }
  
  .typing-demo {
    width: 22ch;
    animation: typing 2s steps(22), blink .5s step-end infinite alternate;
    white-space: nowrap;
    overflow: hidden;
    border-right: 3px solid;
    font-family: monospace;
    font-size: 2em;
  }
  
  @keyframes typing {
    from {
      width: 0
    }
  }
      
  @keyframes blink {
    50% {
      border-color: transparent
    }
  }

这是 animation 的代码

let typingDemo = document.querySelectorAll(".typing-demo");
    
typingDemo.style.animation = "typing 2s steps(22), blink .5s step-end infinite alternate";

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM