文字阴影走光动画效果

代码语言:html

所属分类:动画

代码描述:文字阴影走光动画效果

代码标签: 动画 效果

下面为部分代码预览,完整代码请点击下载或在bfwstudio webide中打开


<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">

<link rel='stylesheet' href='https://fonts.googleapis.com/css2?family=Open+Sans:wght@700&amp;family=Roboto:wght@700&amp;display=swap'>
<style>
body {
  font-family: "Roboto", sans-serif;
  background: #22222a;
}
.xbox {
  font-size: 400px;
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -51%);
  text-shadow: 0px 0px 4px #009432;
  color: #22222a;
}
.xbox .inside {
  font-size: 200px;
  background-image: linear-gradient(180deg, white 10%, #171717 100%);
  background-clip: text;
  -webkit-background-clip: text;
  text-fill-color: transparent;
  -webkit-text-fill-color: transparent;
  color: transparent;
  text-shadow: none;
  top: 50%;
  left: 50%;
  position: absolute;
  transform: translate(-50%, -50%);
  z-index: 99;
}
.xbox:before {
  content: attr(data-char);
  font-size: 400px;
  position: absolute;
  text-shadow: 0px 0px 5px #00ff56;
  clip-path: polygon(
    0% 100%,
    0% 0%,
    100% 0%,
    100% 50%,
    50% 50%,
    100% 50%,
    100% 100%
  );
  animation-name: loading;
  animation-duration: 10s;
  animation-delay: -1s;
  animation-timing-function: cubic-bezier(0, 0.1, 0.9, 0.81);
  animation-direction: reverse;
  mix-blend-mode: color;
}
.xbox:after {
  content: attr(data-char);
  font-size: 400px;
  position: absolute;
  text-shadow: 0px 0px 5px black;
  clip-path: polygon(
    0% 100%,
    0% 0%,
    100% 0%,
    100% 50%,
    50% 50%,
    100% 50%,
    100% 100%
  );
  animation-name: loading;
  animation-duration: 10s;
  animation-timing-function: cubic-bezier(0, 0.1, 0.9, 0.81);
  animation-direction: reverse;
  mix-blend-mode: color;
  left: 0;
  top: 0;
}
@keyframes loading {
  0% {
    clip-path: polygon(
      0% 100%,
      0% 0%,
      100% 0%,
      100% 50%,
      50% 50%,
      100% 50%,
      100% 100%
    );
  }
  12.5% {
    clip-path: polygon(
      0% 100%,
      0% 0%,
      100% 0%,
      100% 50%,
      50% 50%,
      100% 100%,
      100% 100%
    );
  }
  25% {
    clip-path: polygon(
      0% 100%,
      0% 0%,
      100% 0%,
      100% 50%,
      50% 50%,
      50% 100%,
      50% 100%
    );
  }
  37.5% {
    clip-path: polygon(
      0% 100%,
      0% 0%,
      10.........完整代码请登录后点击上方下载按钮下载查看

网友评论0