Css

scroll guide

minsun309 2024. 8. 27. 08:38

가끔 브랜드 웹페이지 랜딩페이지에 스크롤을 유도하는 가이드선을 볼 때가 있어 간력하게 구현해 보았다.

scroll guide 구현

HTML

<section>
  <div class="scroll_guide"></div>
</section>

 

CSS

⭐ 스크롤할 수 있게 유도하는 것이 중요함으로 적절한 애니메이션 효과를 사용하면 좋다.

*{
  margin: 0;
  padding: 0;
}
section {
  width:100%;
  height:100vh;
  position:relative;
  background-color: #1c1c1b;
}
.scroll_guide {
  opacity: 1;
  position: absolute;
  bottom: 0;
  left: 50%;
  width: 1px;
  height: 160px;
  background: rgba(255, 255, 255, 0.3);
  transform: translateX(-50%);
  transition: all 0.5s;
}

.scroll_guide:before {
  display: block;
  content: "";
  width: 1px;
  height: 8px;
  position: absolute;
  top: 0;
  left: 0;
  background: #ffdb0c;
  animation: scrollGuide 1s ease-out   infinite;
}

@keyframes scrollGuide {
  0% {
    height: 8px;
  }

  100% {
    height: 100%;
  }
}

 

 

 

결과

See the Pen scrollguide by pminsun (@pminsun) on CodePen.