捐款弹出输入金额动画效果

代码语言:html

所属分类:表单美化

代码描述:捐款弹出输入金额动画效果

代码标签: 金额 动画 效果

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


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

<link rel='stylesheet' href='https://fonts.googleapis.com/css2?family=Roboto+Mono:wght@400;500&amp;display=swap'>
<style>
.donate {
  --input-background: #4171FE;
  --input-color: #FFFFFF;
  --input-line: #FFFFFF;
  --button-background: #FFFFFF;
  --button-background-hover: #ECEFFC;
  --button-color: #275EFE;
  --button-icon-color: #275EFE;
  --thanks-color: #FFFFFF;
  --letter-inner: #CEDAFF;
  --letter-inner-top: #E0E8FF;
  --letter-border: #E5E9F3;
  font-family: 'Roboto Mono', monospace;
  font-weight: 500;
  font-size: 14px;
  line-height: 20px;
  position: relative;
  text-align: center;
  width: 132px;
}
.donate:not(.open):hover {
  --background: var(--button-background-hover);
}
.donate:not(.open) form {
  pointer-events: none;
}
.donate.open {
  --span-opacity: 0;
  --span-opacity-delay: 0s;
  --letter-opacity: 1;
  --letter-opacity-delay: .2s;
  --letter-inside-opacity: 1;
  --letter-inside-opacity-delay: .4s;
  --border-radius: 2px;
  --border-radius-delay: 0s;
}
.donate.open:not(.submit) {
  --input-y: -92px;
  --input-y-delay: .9s;
  --letter-top-y: 1px;
  --letter-top-rotate: 180deg;
  --letter-top-rotate-delay: .5s;
  --letter-top-index: 0;
  --letter-top-index-delay: .9s;
  --letter-background: var(--letter-inner-top);
  --letter-background-delay: .65s;
  --input-scale-background: 1;
  --input-scale-background-delay: 1.1s;
  --input-scale-line: 1;
  --input-scale-line-delay: 1.1s;
}
.donate.open.submit button {
  -webkit-animation: move .4s linear 1.1s forwards;
          animation: move .4s linear 1.1s forwards;
}
.donate .thanks {
  position: absolute;
  left: 0;
  right: 0;
  top: 12px;
  color: var(--thanks-color);
  font-size: 16px;
  font-weight: 500;
}
.donate button {
  display: block;
  cursor: pointer;
  font: inherit;
  position: relative;
  outline: none;
  border: none;
  width: 100%;
  margin: 0;
  padding: 12px 0;
  -webkit-appearance: none;
  -webkit-transform-style: preserve-3d;
          transform-style: preserve-3d;
  border-radius: var(--border-radius, 6px);
  color: var(--button-color);
  background: var(--background, var(--button-background));
  -webkit-transform-origin: 0 50%;
          transform-origin: 0 50%;
  -webkit-transition: background 0.2s linear, border-radius 0.2s linear var(--border-radius-delay, 1.15s);
  transition: background 0.2s linear, border-radius 0.2s linear var(--border-radius-delay, 1.15s);
}
.donate button:before {
  content: '';
  border-width: 0 64px 32px 64px;
  width: 0;
  height: 0;
  position: absolute;
  left: 2px;
  bottom: 0;
  border-style: solid;
  border-color: transparent transparent var(--button-background) transparent;
  -webkit-filter: drop-shadow(0 -1px 0 var(--letter-border));
          filter: drop-shadow(0 -1px 0 var(--letter-border));
  opacity: var(--letter-opacity, 0);
  -webkit-transition: opacity 0.2s linear var(--letter-opacity-delay, 1.15s);
  transition: opacity 0.2s linear var(--letter-opacity-delay, 1.15s);
}
.donate button .inside {
  position: absolute;
  left: -40px;
  bottom: 16px;
  right: -40px;
  height: 120px;
  -webkit-clip-path: polygon(0 0, 100% 0, 100% 72px, 50% 100%, 0 72px);
          clip-path: polygon(0 0, 100% 0, 100% 72px, 50% 100%, 0 72px);
  opacity: var(--letter-inside-opacity, 0);
  -webkit-transition: opacity 0s linear var(--letter-inside-opacity-delay, 1.15s);
  transition: opacity 0s linear var(--letter-inside-opacity-delay, 1.15s);
}
.donate button .inside:before {
  content: '';
  height: 28px;
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  background: var(--letter-inner);
}
.donate button .inside form {
  width: 200px;
  position: absolute;
  bottom: -12px;
  left: 50%;
  margin: 0;
  -webkit-transform-style: preserve-3d;
          transform-style: preserve-3d;
  -webkit-transform: translate(-50%, var(--input-y, 0)) translateZ(0);
          transform: translate(-50%, var(--input-y, 0)) translateZ(0);
  -webkit-transition: -webkit-transform 0.3s ease-out var(--input-y-delay, 0.25s);
  transition: -webkit-transform 0.3s ease-out var(--input-y-delay, 0.25s);
  transition: transform 0.3s ease-out var(--input-y-delay, 0.25s);
  transition: transform 0.3s ease-out var(--input-y-delay, 0.25s), -webkit-transform 0.3s ease-out var(--input-y-delay, 0.25s);
}
.donate button .inside form:before, .donate button .inside form:after {
  content: '';
  display: block;
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  -webkit-backface-visibility: hidden;
          backface-visibility: hidden;
  background: var(--b, var(--input-background));
  -webkit-transform: scaleX(var(--scale, var(--input-scale-background, 0.6))) translateZ(0);
          transform: scaleX(var(--scale, var(--input-scale-background, 0.6))) translateZ(0);
  -webkit-transition: opacity 0.25s linear, -webkit-transform 0.25s linear var(--delay, var(--input-scale-background-delay, 0s));
  transition: opacity 0.25s linear, -webkit-transform 0.25s linear var(--delay, var(--input-scale-background-delay, 0s));
  transition: opacity 0.25s linear, transform 0.25s linear var(--delay, var(--input-scale-background-delay, 0s));
  transition: opacity 0.25s linear, transform 0.25s linear var(--delay, var(--input-scale-background-delay, 0s)), -webkit-transform 0.25s linear var(--delay, var(--input-scale-background-delay, 0s));
}
.donate button .inside form:before {
  top: 0;
}
.donate button .inside form:after {
  --b: var(--input-line);
  --scale: var(--input-scale-line, 0);
  --delay: var(--input-scale-line-delay, 0s);
  height: 1px;
  opacity: var(--line-opacity, 0.5);
}
.donate button .inside form input {
  display: block;
  position: relative;
  z-index: 1;
  font: inherit;
  text-align: center;
  outline: none;
  border: none;
  background: n.........完整代码请登录后点击上方下载按钮下载查看

网友评论0