纯css3彩色loading动态文字加载特效

2020年3月24日21:01:07 发表评论 9 次浏览

纯css3彩色缩放loading动态文字打字效果加载动画特效

效果非常好看。

css代码如下:

:root {
  --tf: linear;
  --effect: hover 1s var(--tf) infinite;
}
*{
   margin:0;
}

body {
  display: flex;
  width: 100vw;
  height: 100vh;
  background: black;
  align-items: center;
  justify-content: center;
}

div {
  text-align: center;
}

p {
  display: inline-block;
  text-transform: uppercase;
  text-align: center;
  font-size: 4em;
  font-family: arial;
  font-weight: 600;
  transform: scale(.5);
  color: #121212;
  -webkit-text-stroke: 2px gray;
}

p:nth-child(1) {
  animation: var(--effect);
}

p:nth-child(2) {
  animation: var(--effect) .125s;
}

p:nth-child(3) {
  animation: var(--effect) .25s;
}

p:nth-child(4) {
  animation: var(--effect) .375s;
}

p:nth-child(5) {
  animation: var(--effect) .5s;
}

p:nth-child(6) {
  animation: var(--effect) .675s;
}

p:nth-child(7) {
  animation: var(--effect) .75s;
}

@keyframes hover {
  0% {
    transform: scale(.5);
    color: #121212;
    -webkit-text-stroke: 2px gray;
  }

  20% {
    transform: scale(1);
    color: pink;
    -webkit-text-stroke: 3px red;
    filter: drop-shadow(0 0 1px black)drop-shadow(0 0 1px black)drop-shadow(0 0 3px red)drop-shadow(0 0 5px red)hue-rotate(10turn);
  }

  50% {
    transform: scale(.5);
    color: #121212;
    -webkit-text-stroke: 2px gray;
  }


}

然后在网页中加入以下代码:

<div>
  <p>l</p>
  <p>o</p>
  <p>a</p>
  <p>d</p>
  <p>i</p>
  <p>n</p>
  <p>g</p>
</div>

保存即可欣赏精美的loading加载特效

avatar

发表评论

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen: