이게 무슨 일이야!

옆으로 흐르는 무한 스크롤 배너 만들기 본문

프론트엔드 개발/퍼블리싱

옆으로 흐르는 무한 스크롤 배너 만들기

명동섞어찌개 2023. 7. 5. 19:05

 

원리는 이곳에서..!!!

 

https://www.damiisdandy.com/articles/create-infinite-auto-scroll-animation-with-pure-css/

 

Create infinite auto-scroll animation with pure CSS

This guide is to help you understand the concept of how Infinite auto-scroll animations you see on websites like JamStack work, and how to implement them with just CSS!.

www.damiisdandy.com

 

전체소스

 

.scroll-parent {
  position: relative;
  width: 100vw;
  height: 20rem;
  overflow-x: hidden;
}

.scroll-element {
  width: inherit;
  height: inherit;
  position: absolute;
  left: 0%;
  top: 0%;
  animation: primary 3s linear infinite;
}
.primary {
  animation: primary 3s linear infinite;
}

.secondary {
  animation: secondary 3s linear infinite;
}

@keyframes primary {
  from {
    left: 0%;
  }
  to {
    left: -100%;
  }
}

@keyframes secondary {
  from {
    left: 100%;
  }
  to {
    left: 0%;
  }
}





<div class="scroll-parent">
  <div class="scroll-element primary">...</div>
  <div class="scroll-element secondary">...</div>
</div>
Comments