纯css文字闪动效果

代码语言:html

所属分类:视觉差异

代码描述:纯css文字闪动效果

代码标签: 闪动 效果

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


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

<style>
body {
  height: 100vh;
  margin: 0;
  overflow: hidden;
  display: grid;
  grid-template-columns: 1fr;
  grid-template-rows: 1fr;
  font-family: 'Teko', sans-serif;
  background-color: white;
  color: #111;
}
body .glitch {
  grid-column: 1;
  grid-row: 1;
  align-self: center;
  justify-self: center;
  text-shadow: 0px -5px 10px #b51d1d, 0px 0px 5px rgba(181, 29, 29, 0), 0px 0px 10px rgba(181, 29, 29, 0), 0px 0px 15px rgba(181, 29, 29, 0), 0px 0px 20px rgba(181, 29, 29, 0);
  animation: shift 1.5s ease-in-out infinite alternate, blur 8s ease-in-out infinite alternate;
  -moz-transform: skewX(0deg);
  -ms-transform: skewX(0deg);
  -webkit-transform: skewX(0deg);
  transform: skewX(0deg);
}
body .glitch p {
  margin: 0;
  font-size: 8rem;
  line-height: 5rem;
  text-align: center;
  text-transform: uppercase;
  opacity: .8;
}

@-moz-keyframes shift {
  8%, 11%, 53%, 76%, 77%, 82%, 87%, 98% {
    -moz-transform: skew(0deg);
    transform: skew(0deg);
  }
  8% {
    -moz-transform: skew(39deg);
    transform: skew(39deg);
  }
  11% {
    -moz-transform: skew(30deg);
    transform: skew(30deg);
  }
  53% {
    -moz-transform: skew(6deg);
    transform: skew(6deg);
  }
  76% {
    -moz-transform: skew(-33deg);
    transform: skew(-33deg);
  }
  77% {
    -moz-transform: skew(8deg);
    transform: skew(8deg);
  }
  82% {
    -moz-transform: skew(-36deg);
    transform: skew(-36deg);
  }
  87% {
    -moz-transform: skew(10deg);
    transform: skew(10deg);
  }
  98% {
    -moz-transform: skew(14deg);
    transform: skew(14deg);
  }
}
@-webkit-keyframes shift {
  8%, 11%, 53%, 76%, 77%, 82%, 87%, 98% {
    -webkit-transform: skew(0deg);
    transform: skew(0deg);
  }
  8% {
    -webkit-transform: skew(39deg);
    transform: skew(39deg);
  }
  11% {
    -webkit-transform: skew(30deg);
    transform: skew(30deg);
  }
  53% {
    -webkit-transform: skew(6deg);
    transform: skew(6deg);
  }
  76% {
    -webkit-transform: skew(-33deg);
    transform: skew(-33deg);
  }
  77% {
    -webkit-transform: skew(8deg);
    transform: skew(8deg);
  }
  82% {
    -webkit-transform: skew(-36deg);
    transform: skew(-36deg);
  }
  87% {
    -webkit-transform: skew(10deg);
    transform: skew(10deg);
  }
  98% {
    -webkit-transform: skew(14deg);
    transform: skew(14deg);
  }
}
@keyframes shift {
  8%, 11%, 53%, 76%, 77%, 82%, 87%, 98% {
    -moz-transform: skew(0deg);
    -ms-transform: skew(0deg);
    -webkit-transform: skew(0deg);
    transform: skew(0deg);
  }
  8% {
    -moz-transform: skew(39deg);
    -ms-transform: skew(39deg);
    -webkit-transform: skew(39deg);
    transform: skew(39deg);
  }
  11% {
    -moz-transform: skew(30deg);
    -ms-transform: skew(30.........完整代码请登录后点击上方下载按钮下载查看

网友评论0