div+css实现文字字母扭曲旋转动画效果代码

代码语言:html

所属分类:动画

代码描述:div+css实现文字字母扭曲旋转动画效果代码

代码标签: div css 文字 字母 扭曲 旋转 动画

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

<!DOCTYPE html>
<html lang="en" >

<head>
  <meta charset="UTF-8">

  
<style>
@import url("https://fonts.googleapis.com/css2?family=Lobster&display=swap");
*, *::before, *::after {
  padding: 0;
  margin: 0 auto;
  box-sizing: border-box;
}

body {
  font-family: "Lobster", cursive;
  background-color: #000;
  color: #fff;
  min-height: 100vh;
  display: grid;
  place-items: center;
}

.twist {
  position: relative;
  color: aquamarine;
  font-size: 118px;
  filter: blur(2px) contrast(4);
}
.twist > div {
  position: absolute;
  width: var(--size);
  height: var(--size);
  background-color: #000;
  transform: translate(-50%, -50%);
  border-radius: 50%;
  overflow: hidden;
  -webkit-animation: twist 4s var(--delay) infinite ease-in-out;
          animation: twist 4s var(--delay) infinite ease-in-out;
}
.twist > div::after {
  content: "Rotate";
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
}
@-webkit-keyframes twist {
  0% {
    transform: translate(-50%, -50%) rotateZ(0deg);
  }
  50%, 100% {
    transform: translate(-50%, -50%) rotateZ(360deg);
  }
}
@keyframes twist {
  0% {
    transform: translate(-50%, -50%) rotateZ(0deg);
  }
  50%, 100% {
    transform: translate(-50%, -50%) rotateZ(360deg);
  }
}
.twist > div:nth-child(1) {
  --size: 294px;
  --delay: 2s;
}
.twist > div:nth-child(2) {
  --size: 287px;
  --delay: 1.9523809524s;
}
.twist > div:nth-child(3) {
  --size: 280px;
  --delay: 1.9047619048s;
}
.twist > div:nth-child(4) {
  --size: 273px;
  --delay: 1.8571428571s;
}
.twist > div:nth-child(5) {
  --size: 266px;
  --delay: 1.8095238095s;
}
.twist > div:nth-child(6) {
  --size: 259px;
  --delay: 1.7619047619s;
}
.twist > div:nth-child(7) {
  --size: 252px;
  --delay: 1.7142857143s;
}
.twist > div:nth-child(8) {
  --size: 245px;
  --delay: 1.6666666667s;
}
.twist > div:nth-child(9) {
  --size: 238px;
  --delay: 1.619047619s;
}
.twist > div:nth-child(10) {
  --size: 231px;
  --delay: 1.5714285714s;
}
.twist > div:nth-child(11) {
  --size: 224px;
  --delay: 1.5238095238s;
}
.twist > div:nth-child(12) {
  --size: 217px;
  --delay: 1.4761904762s;
}
.twist > div:nth-child(13) {
  --size: 210px;
  --delay: 1.4285714286s;
}
.twist > div:nth-child(14) {
  --size: 203px;
  --delay: 1.380952381s;
}
.twist > div:nth-child(15) {
  --size: 196px;
  --delay: 1.3333333333s;
}
.twist > div:nth-child(16) {
  --size: 189px;
  --delay: 1.2857142857s;
}
.twist > div:nth-child(17) {
  --size: 182px;
  --delay: 1.2380952381s;
}
.twist > div:nth-child(18) {
  --size: 175px;
  --delay: 1.1904761905s;
}
.twist > div:nth-child(19) {
  --size: 168px;
  --delay: 1.1428571429s;
}
.twist > div:nth-child(20) {
  --size: 161px;
  --delay: 1.0952380952s;
}
.twist >.........完整代码请登录后点击上方下载按钮下载查看

网友评论0