gsap实现万圣节输入框动画效果代码

代码语言:html

所属分类:表单美化

代码描述:gsap结合easepack和css代码实现一个万圣节风格的输入框聚焦弹出动画效果代码。

代码标签: gsap 万圣节 输入框

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


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

<head>

  <meta charset="UTF-8">


  
  
<style>
@import url("https://fonts.googleapis.com/css2?family=Creepster&display=swap");
body {
  font-size: 16px;
  font-family: "Creepster", cursive;
}

.horror-input-background {
  background-color: #2f2f2f;
  width: 100vw;
  height: 100vh;
  display: flex;
  justify-content: center;
  align-items: center;
  flex-direction: column;
  flex-wrap: nowrap;
  overflow: hidden;
}

.horror-input-title,
.horror-input-sub-title {
  color: #09e639;
  text-align: center;
  padding: 0;
  margin: 0;
}

.horror-input-title {
  font-size: 32px;
  margin-bottom: 40px;
}

.horror-input-sub-title {
  font-size: 24px;
  margin-bottom: 20px;
}

.horror-input-text-container {
  position: relative;
}

.horror-input-text {
  font: inherit;
  background-color: #ffffff;
  width: 250px;
  height: 50px;
  padding: 15px;
  border: 0;
  outline: 0;
  position: relative;
  box-sizing: border-box;
  border-radius: 8px;
}

.horror-input-burrow {
  --size: 64px;
  width: var(--size);
  height: var(--size);
  overflow: hidden;
  position: absolute;
  pointer-events: none;
}
.horror-input-burrow .horror-input-image {
  transform: translateY(100%);
  width: 100%;
  height: 100%;
}

.horror-input-castle-left,
.horror-input-castle-right {
  --size: 128px;
  bottom: 100%;
}

.horror-input-castle-left {
  left: 0;
  transform: translateX(-50%) translateY(15%) rotate(-17.5deg);
}
.horror-input-castle-left .horror-input-image {
  width: 128px;
  height: 128px;
  position: relative;
}
.horror-input-castle-left .horror-input-image div {
  position: absolute;
}
.horror-input-castle-left .horror-input-castle-left-gate {
  background-color: #2c2c2c;
  width: 128px;
  height: 24px;
  position: absolute;
  bottom: 0;
  left: 0px;
}
.horror-input-castle-left .horror-input-castle-left-gate::before {
  content: "";
  background-image: linear-gradient(to right, #2c2c2c 0px 16px, transparent 16px 24px);
  background-position: -4px 0;
  background-repeat: repeat-x;
  background-size: 24px 8px;
  width: 128px;
  height: 8px;
  position: absolute;
  bottom: 100%;
}
.horror-input-castle-left .horror-input-castle-left-gate-door {
  background-color: #2c2c2c;
  width: 48px;
  height: 40px;
  position: absolute;
  bottom: 0;
  left: 40px;
}
.horror-input-castle-left .horror-input-castle-left-gate-roof {
  width: 0;
  height: 0;
  border: 0;
  border-left: solid 24px transparent;
  border-right: solid 24px transparent;
  border-bottom: solid 16px #2c2c2c;
  position: absolute;
  bottom: 40px;
  left: 40px;
}
.horror-input-castle-left .horror-input-castle-left-gate-roof::before, .horror-input-castle-left .horror-input-castle-left-gate-roof::after {
  content: "";
  background-color: #2c2c2c;
  width: 28px;
  height: 7px;
  position: absolute;
  bottom: calc(100% - 1px);
}
.horror-input-castle-left .horror-input-castle-left-gate-roof::before {
  right: 100%;
  transform-origin: bottom right;
  transform: skewY(-33.690067526deg);
}
.horror-input-castle-left .horror-input-castle-left-gate-roof::after {
  left: 100%;
  transform-origin: bottom left;
  transform: skewY(33.690067526deg);
}
.horror-input-castle-left .horror-input-castle-left-main-tower {
  background-color: #1f1f1f;
  width: 32px;
  height: 88px;
  position: absolute;
  bottom: 0;
  left: 48px;
}
.horror-input-castle-left .horror-input-castle-left-main-tower::before {
  content: "";
  width: 0;
  height: 0;
  border: 0;
  border-bottom: solid 40px #1f1f1f;
  border-left: solid 24px transparent;
  border-right: solid 24px transparent;
  position: absolute;
  bottom: 100%;
  left: -8px;
}
.horror-input-castle-left .horror-input-castle-left-left-tower,
.horror-input-castle-left .horror-input-castle-left-right-tower {
  background-color: #1f1f1f;
  width: 20px;
  height: 64px;
  position: absolute;
  bottom: 0;
}
.horror-input-castle-left .horror-input-castle-left-left-tower::before,
.horror-input-castle-left .horror-input-castle-left-right-tower::before {
  content: "";
  background-color: #1f1f1f;
  width: 26px;
  height: 12px;
  position: absolute;
  left: -3px;
  top: -8px;
}
.horror-input-castle-left .horror-input-castle-left-left-tower::after,
.horror-input-castle-left .horror-input-castle-left-right-tower::after {
  content: "";
  width: 0;
  height: 0;
  border: 0;
  border-bottom: solid 28px #1f1f1f;
  border-left: solid 10px transparent;
  border-right: solid 10px transparent;
  position: absolute;
  bottom: 100%;
}
.horror-input-castle-left .horror-input-castle-left-left-tower {
  left: 4px;
}
.horror-inp.........完整代码请登录后点击上方下载按钮下载查看

网友评论0