圣诞节快乐文字描边绘画动画效果代码

代码语言:html

所属分类:动画

代码描述:圣诞节快乐文字描边绘画动画效果代码

代码标签: 圣诞快乐 文字 动画

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

<!DOCTYPE html>
<html lang="en" >
<head>
  <meta charset="UTF-8">
<style>
    @import url(https://fonts.googleapis.com/css?family=Calligraffitti);
@-webkit-keyframes s {
  0% {
    stroke-dasharray: 0 300;
  }
  100% {
    stroke-dasharray: 300 0;
  }
}
@keyframes s {
  0% {
    stroke-dasharray: 0 300;
  }
  100% {
    stroke-dasharray: 300 0;
  }
}
@-webkit-keyframes f {
  0% {
    transform: translateY(-40px);
    opacity: 0.5;
  }
  50% {
    transform: scale(1.5);
    opacity: 0.1;
  }
  100% {
    transform: translateY(50vh);
    opacity: 0;
  }
}
@keyframes f {
  0% {
    transform: translateY(-40px);
    opacity: 0.5;
  }
  50% {
    transform: scale(1.5);
    opacity: 0.1;
  }
  100% {
    transform: translateY(50vh);
    opacity: 0;
  }
}
html {
  height: 100%;
}

body {
  background: #a32300;
  font-family: "Calligraffitti";
  height: 100%;
  text-align: center;
}

svg {
  margin-top: calc(50vh - 75px);
  width: 300px;
}

.Merry, .Christmas {
  fill: none;
  stroke: #fff;
  text-shadow: 0 0 14px #a32300;
  stroke-width: 4;
  stroke-dasharray: 0 100;
  text-anchor: middle;
}

.Merry {
  font-size: 44px;
}
.Merry tspan:nth-child(1) {
  -webkit-animation: s 2s 1s linear forwards;
          animation: s 2s 1s linear forwards;
}
.Merry tspan:nth-child(2) {
  -webkit-animation: s 2s 2s linear forwards;
          animation: s 2s 2s linear forwards;
}
.Merry tspan:nth-child(3) {
  -webkit-animation: s 2s 3s linear forwards;
          animation: s 2s 3s linear forwards;
}
.Merry tspan:nth-child(4) {
  -webkit-animation: s 2s 4s linear forwards;
          animation: s 2s 4s linear forwards;
}
.Merry tspan:nth-child(5) {
  -webkit-animation: s 2s 5s linear forwards;
          animation: s 2s 5s linear forwards;
}

.Christmas {
  font-size: 64px;
  stroke-width: 6;
}
.Christmas tspan:nth-child(1) {
  -webkit-animation: s 2s 6s linear forwards;
          animation: s 2s 6s linear forwards;
}
.Christmas tspan:nth-child(2) {
  -webkit-animation: s 2s 7s linear forwards;
          animation: s 2s 7s linear forwards;
}
.Christmas tspan:nth-child(3) {
  -webkit-animation: s 2s 8s linear forwards;
          animation: s 2s 8s linear forwards;
}
.Christmas tspan:nth-child(4) {
  -webkit-animation: s 2s 9s linear forwards;
          animation: s 2s 9s linear forwards;
}
.Christmas tspan:nth-child(5) {
  -webkit-animation: s 2s 10s linear forwards;
          animation: s 2s 10s linear forwards;
}
.Christmas tspan:nth-child(6) {
  -webkit-animation: s 2s 11s linear forwards;
          animation: s 2s 11s linear forwards;
}
.Christmas tspan:nth-child(7) {
  -webkit-animation: s 2s 12s linear forwards;
          animation: s 2s 12s linear forwards;
}
.Christmas tspan:nth-child(8) {
  -webkit-animation: s 2s 13s linear forwards;
          animation: s 2s 13s linear forwards;
}
.Christmas tspan:nth-child(9) {
  -webkit-animation: s 2s 14s linear forwards;
          animation: s 2s 14s linear forwards;
}

.Snow {
  position: absolute;
  filter: blur(1px);
  top: 0;
  left: 0;
  width: 100%;
  font-size: 0;
  height: 100%;
  overflow: hidden;
}
.Snow-flake {
  -webkit-animation: f 4s linear infinite;
          animation: f 4s linear infinite;
  display: inline-block;
  border-radius: 50%;
  background: #fff;
  margin: 0 10px 0;
  width: 10px;
  height: 10px;
  transform: translateY(-40px);
  opacity: 0.5;
}
.Snow-flake:nth-child(1) {
  -webkit-animation-delay: -3.6793681361s;
          animation-delay: -3.6793681361s;
}
.Snow-flake:nth-child(2) {
  -webkit-animation-delay: -0.4661163393s;
          animation-delay: -0.4661163393s;
}
.Snow-flake:nth-child(3) {
  -webkit-animation-delay: -3.4905253225s;
          animation-delay: -3.4905253225s;
}
.Snow-flake:nth-child(4) {
  -webkit-animation-delay: -2.7553831417s;
          animation-delay: -2.7553831417s;
}
.Snow-flake:nth-child(5) {
  -webkit-animation-delay: -0.7750134007s;
          animation-delay: -0.7750134007s;
}
.Snow-flake:nth-child(6) {
  -webkit-animation-delay: -2.5446368156s;
          animation-delay: -2.5446368156s;
}
.Snow-flake:nth-child(7) {
  -webkit-animation-delay: -1.5677614822s;
          animation-delay: -1.5677614822s;
}
.Snow-flake:nth-child(8) {
  -webkit-animation-delay: -2.3025289221s;
          animation-delay: -2.3025289221s;
}
.Snow-flake:nth-child(9) {
  -webkit-animation-delay: -2.2273608114s;
          animation-delay: -2.2273608114s;
}
.Snow-flake:nth-child(10) {
  -webkit-animation-delay: -2.8704051936s;
          animation-delay: -2.8704051936s;
}
.Snow-flake:nth-child(11) {
  -webkit-animation-delay: -3.1400586948s;
          animation-delay: -3.1400586948s;
}
.Snow-flake:nth-child(12) {
  -webkit-animation-delay: -0.3667266026s;
          animation-delay: -0.3667266026s;
}
.Snow-flake:nth-child(13) {
  -webkit-animation-delay: -1.7854983938s;
          animation-delay: -1.7854983938s;
}
.Snow-flake:nth-child(14) {
  -webkit-animation-delay: -0.3196037779s;
          animation-delay: -0.3196037779s;
}
.Snow-flake:nth-child(15) {
  -webkit-animation-delay: -1.964419289s;
          animation-delay: -1.964419289s;
}
.Snow-flake:nth-child(16) {
  -webkit-animation-delay: -2.791841093s;
          animation-delay: -2.791841093s;
}
.Snow-flake:nth-child(17) {
  -webkit-animation-delay: -2.0680800485s;
          animation-delay: -2.0680800485s;
}
.Snow-flake:nth-child(18) {
  -webkit-animation-delay: -1.3058220809s;
          animation-delay: -1.3058220809s;
}
.Snow-flake:nth-child(19) {
  -webkit-animation-delay: -3.4707126316s;
          animation-delay: -3.4707126316s;
}
.Snow-flake:nth-child(20) {
  -webkit-animation-delay: -0.6200169916s;
          animation-delay: -0.6200169916s;
}
.Snow-flake:nth-child(21) {
  -webkit-animation-delay: -1.3589008464s;
          animation-delay: -1.3589008464s;
}
.Snow-flake:nth-child(22) {
  -webkit-animation-delay: -3.2398063322s;
          animation-delay: -3.2398063322s;
}
.Snow-flake:nth-child(23) {
  -webkit-animation-delay: -2.6176651192s;
          animation-delay: -2.6176651192s;
}
.Snow-flake:nth-child(24) {
  -webkit-animation-delay: -3.8524291697s;
          animation-delay: -3.8524291697s;
}
.Snow-flake:nth-child(25) {
  -webkit-animation-delay: -0.4768476793s;
          animation-delay: -0.4768476793s;
}
.Snow-flake:nth-child(26) {
  -webkit-animation-delay: -3.4299640078s;
          animation-delay: -3.4299640078s;
}
.Snow-flake:nth-child(27) {
  -webkit-animation-delay: -2.3016890045s;
          animation-delay: -2.3016890045s;
}
.Snow-flake:nth-child(28) {
  -webkit-animation-delay: -0.5442387221s;
          animation-delay: -0.5442387221s;
}
.Snow-flake:nth-child(29) {
  -webkit-animation-delay: -0.0972386453s;
          animation-delay: -0.0972386453s;
}
.Snow-flake:nth-child(30) {
  -webkit-animation-delay: -3.7545507289s;
          animation-delay: -3.7545507289s;
}
.Snow-flake:nth-child(31) {
  -webkit-animation-delay: -2.6359017.........完整代码请登录后点击上方下载按钮下载查看

网友评论0