gsap+svg+MorphSVGPlugin3实现输入字符串移除重复字符串动画效果代码

代码语言:html

所属分类:动画

代码描述:gsap+svg+MorphSVGPlugin3实现输入字符串移除重复字符串动画效果代码

代码标签: gsap svg MorphSVGPlugin3 移除 重复 字符串 动画

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

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

<head>

  <meta charset="UTF-8">
  

  <link rel='stylesheet' href='https://fonts.googleapis.com/css2?family=Sniglet:wght@400;800&amp;display=swap'>
  
<style>
*,
*::before,
*::after {
  box-sizing: border-box;
}

body {
  font-family: "Sniglet", cursive;
  width: 100vw;
  height: 100vh;
  display: grid;
  place-items: center;
  overflow: hidden;
  background: radial-gradient(circle, #af4a4c, #a44547);
}

svg {
  width: 3rem;
  position: absolute;
  transform-origin: center 75%;
  transform: scale(0);
}

input {
  position: absolute;
  width: 100vw;
  height: 100vh;
  z-index: 10;
  opacity: 0;
}

label {
  color: white;
  font-size: 2rem;
  position: absolute;
}
label span {
  color: transparent;
  position: relative;
}
label span:before {
  content: ".";
  position: absolute;
  bottom: 0;
  color: white;
  margin-left: 1px;
  -webkit-animation: load 2s linear infinite;
          animation: load 2s linear infinite;
  display: inline-block;
}

output {
  position: relative;
  width: 100vw;
  height: auto;
  top: 0;
  left: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  padding: 0 4rem;
}
output > span {
  position: relative;
  font-size: 4rem;
  color: transparent;
  font-weight: 800;
  min-width: 1rem;
  margin: 1px;
  text-align: center;
  line-height: 1.3;
  -webkit-animation: enter 0.3s cubic-bezier(0.175, 0.885, 0.3, 1.2);
          animation: enter 0.3s cubic-bezier(0.175, 0.885, 0.3, 1.2);
}
output > span .ani-wrap {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  display: flex;
  justify-content: center;
}
output > span .ani-char {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  color: var(--color);
  transform-origin: center;
  -webkit-text-fill-color: var(--color);
  -webkit-text-stroke-width: 2px;
  -webkit-text-stroke-color: #672b2d;
}
output > span.dupe {
  z-index: 2;
}
output > span svg {
  position: absolute;
  bottom: 0;
}

button {
  position: fixed;
  bottom: 4rem;
  padding: 1rem 2rem;
  background-color: #99c26e;
  border: 2px solid black;
  border-radius: 4px;
  color: black;
  box-shadow: 2px 2px 0 2px black;
  font-size: 1.25rem;
  cursor: pointer;
  margin: 0;
  z-index: 10;
  opacity: 0;
  transform: translate(0, 100%);
  visibility: hidden;
  transition: opacity 0.25s ease-out, transform 0.25s ease-out, visibility 0s 0.25s;
}
button.show {
  transform: translate(0);
  opacity: 1;
  visibility: visible;
  transition: opacity 0.25s ease-out, transform 0.25s ease-out;
}
button:hover {
  background-color: #8cba5c;
}
button:active {
  box-shadow: none;
  transform: translate(2px, 2px);
  background-color: #80b24b;
  transition: background 0.1s, box-shadow 0.1s, transform 0..........完整代码请登录后点击上方下载按钮下载查看

网友评论0