gsap实现万圣节输入框动画效果代码
代码语言:html
所属分类:表单美化
代码描述:gsap结合easepack和css代码实现一个万圣节风格的输入框聚焦弹出动画效果代码。
下面为部分代码预览,完整代码请点击下载或在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-input-castle-left .horror-input-castle-left-right-tower {
right: 4px;
}
.horror-input-castle-left .horror-input-castle-left-manor {
background-color: #1f1f1f;
width: 64px;
height: 28px;
position: absolute;
bottom: 24px;
left: 32px;
}
.horror-input-castle-left .horror-input-castle-left-manor-roof {
background-color: #1f1f1f;
width: 56px;
height: 24px;
position: absolute;
bottom: 52px;
left: 36px;
}
.horror-input-castle-left .horror-input-castle-left-manor-roof::before, .horror-input-castle-left .horror-input-castle-left-manor-roof::after {
content: "";
width: 0;
height: 0;
border: 0;
border-bottom: solid 24px #1f1f1f;
position: absolute;
top: 0;
}
.horror-input-castle-left .horror-input-castle-left-manor-roof::before {
border-left: solid 10px transparent;
right: 100%;
}
.horror-input-castle-left .horror-input-castle-left-manor-roof::after {
border-right: solid 10px transparent;
left: 100%;
}
.horror-input-castle-left .horror-input-castle-left-gate-entry {
background-color: #f5f53d;
width: 24px;
height: 20px;
position: absolute;
bottom: 0;
left: 52px;
}
.horror-input-castle-left .horror-input-castle-left-gate-entry::before {
content: "";
background-color: #f5f53d;
width: 24px;
height: 12px;
position: absolute;
bottom: 100%;
left: 0;
border-radius: 50% 50% 0% 0%/100% 100% 0% 0%;
}
.horror-input-castle-left .horror-input-castle-left-gate-entry::after {
content: "";
background-image: linear-gradient(to bottom, transparent 0px 3px, #2c2c2c 3px 5px, transparent 5px 8px), linear-gradient(to right, transparent 0px 3px, #2c2c2c 3px 5px, transparent 5px 8px);
background-repeat: repeat;
background-size: 8px 8px;
width: 24px;
height: 32px;
position: absolute;
bottom: 0;
left: 0;
}
.horror-input-castle-left .horror-input-castle-left-gate-hole {
background-color: #000000;
width: 6px;
height: 6px;
position: absolute;
}
.horror-input-castle-left .horror-input-castle-left-gate-hole::before {
content: "";
background-color: #000000;
width: 6px;
height: 6px;
position: absolute;
bottom: 100%;
border-radius: 50% 50% 0% 0%/100% 100% 0% 0%;
}
.horror-input-castle-left .horror-input-castle-left-tower-window {
background-color: #f5f53d;
width: 6px;
height: 8px;
position: absolute;
bottom: 40px;
}
.horror-input-castle-left .horror-input-castle-left-tower-window::before {
content: "";
background-color: #f5f53d;
width: 6px;
height: 6px;
position: absolute;
bottom: 100%;
border-radius: 50% 50% 0% 0%/100% 100% 0% 0%;
}
.horror-input-castle-left .horror-input-castle-left-main-tower-window {
background-color: #f5f53d;
width: 12px;
height: 4px;
position: absolute;
bottom: 72px;
left: 58px;
}
.horror-input-castle-left .horror-input-castle-left-main-tower-window::before {
content: "";
background-color: #f5f53d;
width: 12px;
height: 8px;
position: absolute;
bottom: 100%;
border-radius: 50% 50% 0% 0%/100% 100% 0% 0%;
}
.horror-input-castle-left .horror-input-castle-left-manor-window {
background-color: #f5f53d;
wi.........完整代码请登录后点击上方下载按钮下载查看
















网友评论0