js+css实现联系我们自适应表单反馈交互效果代码
代码语言:html
所属分类:表单美化
代码描述:js+css实现联系我们自适应表单反馈交互效果代码,简洁大方。
代码标签: js+css 联系 我们 自适应 表单 反馈 交互
下面为部分代码预览,完整代码请点击下载或在bfwstudio webide中打开
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<style>
* {
margin: 0;
padding: 0;
box-sizing: border-box;
}
body {
display: flex;
justify-content: center;
align-items: center;
height: 100vh;
font-family: "Poppins", sans-serif;
background: linear-gradient(90deg, #6190e8, #a7bfe8);
}
form {
min-height: 40vh;
width: min(90%, 1190px);
background: white;
color: #777474;
border-radius: 2rem;
padding: 3rem 5rem;
display: flex;
position: relative;
}
.title {
color: #6391e8;
}
.contact-right,
.contact-left {
flex: 1;
}
.contact-right {
display: flex;
flex-direction: column;
justify-content: space-between;
}
.input {
width: 100%;
height: 100%;
position: absolute;
top: 0;
border: none;
outline: none;
color: #777474;
font-size: 1rem
}
.input-container {
position: relative;
margin-bottom: 3rem;
}
.placeholder {
position: relative;
z-index: 1;
pointer-events: none;
padding: 0.3rem 0rem;
font-size: 0.6rem;
opacity: 0.6;
transform-origin: left;
font-size: .8rem
}
.line-svg {
position: absolute;
left: 0;
bottom: 0;
overflow: visible;
opacity: 0.8;
}
.checkbox-label {
font-size: 1rem
}
.promo-container {
position: relative;
display: flex;
}
.checkbox {
opacity: 0;
cursor: pointer;
z-index: 3;
}
.checkbox-label {
padding-left: 0.5rem;
}
.checkbox-container {
position: relative;
height: 1rem;
width: 1rem;
border-radius: 3px;
overflow: hidden;
}
.checkmark,
.checkbox {
position: absolute;
bottom: 0;
left: 0;
width: 100%;
height: 100%;
border: 2px solid #c5c5c5;
}
.checkbox-fill {
position: absolute;
background: #6190e8;
width: 100%;
height: 100%;
top: 100%;
}
.tick-mark {
position: absolute;
top: 50%;
left: 50%;
transform: translate(-50%, -50%) scale(0.6);
z-index: 2;
}
button {
font-family: "Poppins" sans-serif;
font-weight: 500;
font-size: 1rem ;
background: #6190e8;
color: white;
border-radius: 0.2rem;
border-style: none;
padding: 0.5rem 2.5rem;
cursor: pointer;
margin-top: 1rem;
align-self: flex-start;
}
#character {
position: absolute;
transform: scale(0.6) translate(0%, 30%);
bottom: 0;
left: 0;
transform-origin: bottom;
}
.submitted {
position: absolute;
left: 50%;
top: 50%;
color: #777474;
font-size: 1rem;
pointer-events: none;
text-align: center;
transform: translate(-50%, -50%);
opacity: 0;
}
@media screen and (max-width: 812px) {
form {
width: 90vw;
min-height: 80vh;
flex-direction: column;
padding: 8rem 3rem;
}
.line-svg {
width: 100%;
}
#character {
transform: scale(0.4) translate(0%, 30%);
}
}
</style>
</head>
<body>
<form>
<!-- Left Side of the form-->
<div class="contact-left">
<h1 class="title">Contact Us</h1>
<p class="description">Let's stay in touch.</br> For more information, </br> sign up. </p>
</div>
<!--Right side of the form-->
<div class="contact-right">
<div class="input-container">
<p class="placeholder">Your Name</p>
<input type="text" name="name" autocomplete="off" class="input-name input">
<svg class="line-svg" width="300" height="2" viewBox="0 0 300 2" fill="none" xmlns="http://www.w3.org/2000/svg">
<path class="elastic-line" d="M0 0.999512C0 0.999512 60.5 0.999512 150 0.999512C239.5 0.999512 300 0.999512 300 0.999512" stroke="#D1D4DA" stroke-width="2"/>
</svg>
</div>
<div class="input-container">
<p class="placeholder">Your Email</p>
<input type="email" name="email" autocomplete="off" class="input-email input">
<svg class="line-svg" width="300" height="2" viewBox="0 0 300 2" fill="none" xmlns="http://www.w3.org/2000/svg">
<path class="elastic-line" d="M0 0.999512C0 0.999512 60.5 0.999512 150 0.999512C239.5 0.999512 300 0.999512 300 0.999512" stroke="#D1D4DA" stroke-width="2"/>
</svg>
</div>
&.........完整代码请登录后点击上方下载按钮下载查看
















网友评论0