비전공자 개발일기

Switch Text Effect 본문

HTML _CSS

Switch Text Effect

HiroDaegu 2022. 6. 23. 00:33
728x90
SMALL

 

<!DOCTYPE html>
<html lang="ko">
<head>
  <meta charset="UTF-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>TEXT SWITCH EFFECT</title>
  <link rel="stylesheet" href="style.css">
</head>
<body>
  <div class="container">
    <div class="word">You</div>
    <div class="word">Are</div>
    <div class="word">So</div>
    <div class="word">Amazing....</div>
  </div>
</body>
</html>
body {
  background-color: #000;
}

.container {
  width: 100%;
  height: 80vh;
  position: relative;
  font-family: monospace;
  color: #FFF;
  font-size: 4em;
  filter: contrast(15);
}

.word {
  position: absolute;
  top: 58%;
  left: 96%;
  transform: translate(-50%, -50%);
  animation: switch 8s infinite ease-in-out;
  min-width: 100%;
  margin: auto;
}

.word:nth-child(1) {
  animation-delay: -7s;
}

.word:nth-child(2) {
  animation-delay: -5s;
}

.word:nth-child(3) {
  animation-delay: -3s;
}

.word:nth-child(4) {
  animation-delay: -1s;
}

@keyframes switch {
  0%, 5%, 100% {
    filter: blur(0);
    opacity: 1;
  }
  50%, 80% {
    filter: blur(100px);
    opacity: 0;
  }
}
728x90
LIST

'HTML _CSS' 카테고리의 다른 글

Dark Card Hover Effect  (0) 2022.06.25
Animated Magic Menu Indicator  (0) 2022.06.24
Project Management Dashboard  (0) 2022.06.22
Sliding Card UI Design  (0) 2022.06.19
Scroll Animation  (0) 2022.06.17