본문 바로가기
CSS/애니메이션

CSS 애니메이션 : 통통 튀는 글씨

by 코딩 척척학사 2022. 9. 22.
728x90

애니메이션 만들기

css 애니메이션을 만들어 봅니다!

애니메이션 : 통통 튀는 글씨

글씨가 통통 튀는 애니메이션 입니다.

html 코드 보기

<h1>
  <span>코</span>
  <span>딩</span>
  <span>척</span>
  <span>척</span>
  <span>학</span>
  <span>사</span>
</h1>

css 코드 보기

html, body {
  width: 100%;
  height: 100%;
  
  background: linear-gradient(140deg, skyblue 0%, pink 100%);
  display: flex;
  justify-content: center;
  align-items: center;
}

h1 {
  height: 100px;
}
h1 span {
  font-family: '궁서체';
  font-size: 80px;
  color: #fff;
  position: relative;
  top: 20px;
  display: inline-block;
  -webkit-font-smoothing: antialiased;
  text-shadow:
    0 1px 0 #ccc,
    0 2px 0 #ccc,
    0 3px 0 #ccc,
    0 4px 0 #ccc,
    0 5px 0 #ccc,
    0 6px 0 transparent,
    0 7px 0 transparent,
    0 8px 0 transparent,
    0 9px 0 transparent,
    0 10px 10px rgba(0,0,0,0.4)
    ;
  animation: bounce 0.3s ease infinite alternate;
}
h1 span:nth-child(2){animation-delay:0.1s;}
h1 span:nth-child(3){animation-delay:0.2s;}
h1 span:nth-child(4){animation-delay:0.3s;}
h1 span:nth-child(5){animation-delay:0.4s;}
h1 span:nth-child(6){animation-delay:0.5s;}
@keyframes bounce {
  100%{
    top: -20px;
    text-shadow:
      0 1px 0 #ccc,
      0 2px 0 #ccc,
      0 3px 0 #ccc,
      0 4px 0 #ccc,
      0 5px 0 #ccc,
      0 6px 0 transparent,
      0 7px 0 transparent,
      0 8px 0 transparent,
      0 9px 0 transparent,
      0 50px 25px rgba(0,0,0,0.4)
    ;
  }
}

See the Pen Untitled by hjkang306 (@hjkang306) on CodePen.

728x90

댓글


HTML이 적힌 썸네일 이미지
CSS가 적힌 썸네일 이미지
JAVASCRIPT가 적힌 썸네일 이미지

JAVASCRIPT

자세히 보기