Animated Rainbow Nyan Cat
본문 바로가기
CSS/애니메이션

애니메이션 06

by 이유나1 2022. 9. 22.
728x90
반응형

애니메이션 06

움직이는 글자를 만들어보자....

HTML

<h1>
  <span>w</span>
  <span>e</span>  
  <span>b</span>  
  <span>s</span>  
  <span>t</span>  
  <span>o</span>  
  <span>r</span>  
  <span>y</span>  
  <span>a</span>
</h1>

CSS

@font-face {
    font-family: 'LeeSeoyun';
    font-weight: normal;
    font-style: normal;
    src: url('https://cdn.jsdelivr.net/gh/webfontworld/heungkuk/LeeSeoyun.eot');
    src: url('https://cdn.jsdelivr.net/gh/webfontworld/heungkuk/LeeSeoyun.eot?#iefix') format('embedded-opentype'),
         url('https://cdn.jsdelivr.net/gh/webfontworld/heungkuk/LeeSeoyun.woff2') format('woff2'),
         url('https://cdn.jsdelivr.net/gh/webfontworld/heungkuk/LeeSeoyun.woff') format('woff'),
         url('https://cdn.jsdelivr.net/gh/webfontworld/heungkuk/LeeSeoyun.ttf') format("truetype");
    font-display: swap;
}  
html,body {
  width: 100%;
  height: 100%;
  
  background: linear-gradient(140deg, skyblue 0%, plum 100%);
  display:flex;
  justify-content:center;
  align-items: center;
}
h1 {
  height: 100px;
}
h1 span {
 font-family: 'LeeSeoyun';
  font-size: 80px;
  color: #fff;
  position: relative;
  top:20px;
  display: inline-block;
  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(1){
  animation-delay:0.1s;
}
h1 span:nth-child(2){
  animation-delay:0.2s;
}
h1 span:nth-child(3){
  animation-delay:0.3s;
}
h1 span:nth-child(4){
  animation-delay:0.4s;
}
h1 span:nth-child(5){
  animation-delay:0.5s;
}
h1 span:nth-child(6){
  animation-delay:0.6s;
}
h1 span:nth-child(7){
  animation-delay:0.7s;
}
h1 span:nth-child(8){
  animation-delay:0.8s;
}
h1 span:nth-child(9){
  animation-delay:0.9s;
}
@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);
  }
}
728x90

'CSS > 애니메이션' 카테고리의 다른 글

애니메이션 08  (2) 2022.09.29
애니메이션 07  (3) 2022.09.22
애니메이션 05  (2) 2022.09.20
애니메이션 04  (2) 2022.09.20
SVG 텍스트 애니메이션  (5) 2022.09.08

댓글


/
/
/

CSS
광고준비중입니다.