css 애니메이션 질문입니다...

css 애니메이션 질문입니다...

QA

css 애니메이션 질문입니다...

본문

css 애니메이션 초보입니다.

인터넷상에서 네모를 그리는 css애니메이션을 찾아

응용을 하려 하는데요, 


 첫번째 네모(draw)를 다 그린 뒤에, 두번째 네모(draw2)를 그리기 시작하고 두번째 네모가 그려지면, 세번째 네모(draw3)를 그리기 시작하는 방법에 대해 문의하고 싶습니다. 

animation-delay: 10s;

 이런 걸 찾아 draw2 스타일에 넣어봤는데 잘못 넣었는지 적용이 되지 않았습니다. 

도움 부탁드릴게요 !!




<style> 
.qmanse {
width:200px;
height:200px;
  background: none;
  border: 0;
  box-sizing: border-box;
  box-shadow: inset 0 0 0 5px #fff;
  color: #fff;
  font-size: inherit;
  font-weight: 700;
  text-align: center;
  text-transform: capitalize;
  vertical-align: middle;
  animation-delay:10s;
}
.draw {
  overflow: hidden;
  position: relative;
}
.draw::before, .draw::after {
  content: '';
  box-sizing: border-box;
  position: absolute;
  border: 5px solid transparent;
  width: 0;
  height: 0;
}
.draw::before {
  top: 0;
  left: 0;
  border-top-color: #000;
  border-right-color: #000;
  animation: border 10s ;
}
.draw::after {
  bottom: 0;
  right: 0;
  animation: border 10s 5s , borderColor 10s 5s ;
}

@keyframes border {
  0% {
    width: 0;
    height: 0;
  }
  25% {
    width: 100%;
    height: 0;
  }
  50% {
    width: 100%;
    height: 100%;
  }
  100% {
    width: 100%;
    height: 100%;
  }
}
@keyframes borderColor {
  0% {
    border-bottom-color: #2d2d2d;
    border-left-color: #2d2d2d;
  }
  50% {
  }
  51% {
    border-bottom-color: transparent;
    border-left-color: transparent;
  }
  100% {
    border-bottom-color: transparent;
    border-left-color: transparent;
  }
}



.draw2 {
  overflow: hidden;
  position: relative;
}
.draw2::before, .draw2::after {
  content: '';
  box-sizing: border-box;
  position: absolute;
  border: 5px solid transparent;
  width: 0;
  height: 0;
}
.draw2::before {
  top: 0;
  left: 0;
  border-top-color: #000;
  border-right-color: #000;
  animation: border 10s ;
}
.draw2::after {
  bottom: 0;
  right: 0;
  animation: border2 10s 5s , borderColor2 10s 5s ;
}

@keyframes border2 {
  0% {
    width: 0;
    height: 0;
  }
  25% {
    width: 100%;
    height: 0;
  }
  50% {
    width: 100%;
    height: 100%;
  }
  100% {
    width: 100%;
    height: 100%;
  }
}
@keyframes borderColor2 {
  0% {
    border-bottom-color: #2d2d2d;
    border-left-color: #2d2d2d;
  }
  50% {
  }
  51% {
    border-bottom-color: transparent;
    border-left-color: transparent;
  }
  100% {
    border-bottom-color: transparent;
    border-left-color: transparent;
  }
}



.draw3 {
  overflow: hidden;
  position: relative;
}
.draw3::before, .draw2::after {
  content: '';
  box-sizing: border-box;
  position: absolute;
  border: 5px solid transparent;
  width: 0;
  height: 0;
}
.draw3::before {
  top: 0;
  left: 0;
  border-top-color: #000;
  border-right-color: #000;
  animation: border 10s ;
}
.draw3::after {
  bottom: 0;
  right: 0;
  animation: border3 10s 5s , borderColor3 10s 5s ;
}

@keyframes border3 {
  0% {
    width: 0;
    height: 0;
  }
  25% {
    width: 100%;
    height: 0;
  }
  50% {
    width: 100%;
    height: 100%;
  }
  100% {
    width: 100%;
    height: 100%;
  }
}
@keyframes borderColor3 {
  0% {
    border-bottom-color: #2d2d2d;
    border-left-color: #2d2d2d;
  }
  50% {
  }
  51% {
    border-bottom-color: transparent;
    border-left-color: transparent;
  }
  100% {
    border-bottom-color: transparent;
    border-left-color: transparent;
  }
}

</style>

이 질문에 댓글 쓰기 :

답변 1

https://www.w3schools.com/css/css3_animations.asp


이곳을 참고하셔서 공부하시면 좋겠네요^^ 

댓글 감사합니다.

링크 걸어주신 페이지처럼 가장 상위 클래스에 animation-delay 설정해주면 되는거 같은데
뭐가 문제인지 잘 안되네요 ㅠㅠ

열심히 공부해보겠습니다, 감사합니다!

답변을 작성하시기 전에 로그인 해주세요.
전체 27
QA 내용 검색

회원로그인

(주)에스아이알소프트 / 대표:홍석명 / (06211) 서울특별시 강남구 역삼동 707-34 한신인터밸리24 서관 1402호 / E-Mail: admin@sir.kr
사업자등록번호: 217-81-36347 / 통신판매업신고번호:2014-서울강남-02098호 / 개인정보보호책임자:김민섭(minsup@sir.kr)
© SIRSOFT