Dragonball Online Goku Hand
본문 바로가기
CSS

[CSS] "⭐️뽀짝귀염⭐️ 🤪산만정신🤪 텍스트" 를 만들어봅시다!

by 별의 코비 2022. 9. 22.
728x90

🧷 codepen을 이용해서 ⭐️뽀짝귀염⭐️ 🤪산만정신🤪 텍스트를 만들어봅시다!


글자 하나하나 통통튀는 효과를 만들어보도록 하겠습니다.


코드 소스를 알아봅시다.💻

✔️HTML

글자 하나하나 효과를 주어야 하기 때문에 span태그로 글자 하나하나 적어줍니다.
<h1>
  <span>n</span>
  <span>o</span>
  <span>e</span>
  <span>y</span>
  <span>h</span>
  <span>e</span>
  <span>y</span>
  <span>h</span>
  <span>K</span>
</h1>

✔️CSS

글자가 하나하나 통통 튀는 효과를 넣어줍니다.
html,body {
    width: 100%;
    height: 100%;
    background: linear-gradient(140deg, skyblue 0%, beige 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;
    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;}
h1 span:nth-child(7){animation-delay:0.6s;}
h1 span:nth-child(8){animation-delay:0.7s;}
h1 span:nth-child(9){animation-delay:0.8s;}
@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);
    }
}

댓글