乐于分享
好东西不私藏

css3立体感登录和注册表单页面!!附源码!!

css3立体感登录和注册表单页面!!附源码!!

  效果展示  

  完整源码  

HTML
<!DOCTYPE html><htmllang="en"><head>    <metacharset="UTF-8">    <title>css3立体感登录和注册表单页面</title>    <linkrel="stylesheet"href="./style.css"></head><body>    <!-- partial:index.partial.html -->    <divclass="wrapper">        <divclass="container">            <divclass="sign-up-container">                <form>                    <h1>创建账号</h1>                    <divclass="social-links">                        <div>                            <ahref="#"><iclass="fa fa-facebook"aria-hidden="true"></i></a>                        </div>                        <div>                            <ahref="#"><iclass="fa fa-twitter"aria-hidden="true"></i></a>                        </div>                        <div>                            <ahref="#"><iclass="fa fa-linkedin"aria-hidden="true"></i></a>                        </div>                    </div>                    <span>或者使用您的邮箱</span>                    <inputtype="text"placeholder="登录名">                    <inputtype="email"placeholder="Email">                    <inputtype="password"placeholder="密码">                    <buttonclass="form_btn">注册</button>                </form>            </div>            <divclass="sign-in-container">                <form>                    <h1>登录</h1>                    <divclass="social-links">                        <div>                            <ahref="#"><iclass="fa fa-facebook"aria-hidden="true"></i></a>                        </div>                        <div>                            <ahref="#"><iclass="fa fa-twitter"aria-hidden="true"></i></a>                        </div>                        <div>                            <ahref="#"><iclass="fa fa-linkedin"aria-hidden="true"></i></a>                        </div>                    </div>                    <span>或者使用你的账号</span>                    <inputtype="email"placeholder="Email">                    <inputtype="password"placeholder="密码">                    <buttonclass="form_btn">登录</button>                </form>            </div>            <divclass="overlay-container">                <divclass="overlay-left">                    <h1>欢迎回来</h1>                    <p>To keep connected with us please login with your personal info</p>                    <buttonid="signIn"class="overlay_btn">登录</button>                </div>                <divclass="overlay-right">                    <h1>Hello, 朋友</h1>                    <p>Enter your personal details and start journey with us</p>                    <buttonid="signUp"class="overlay_btn">注册</button>                </div>            </div>        </div>    </div>    <!-- partial -->    <scriptsrc="./script.js"></script></body></html>
CSS
@import url("https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/css/font-awesome.css");* {  box-sizing: border-box;}body {  font-family"Montserrat", sans-serif;  margin0;  padding0;}.wrapper {  width100%;  height100vh;  display: flex;  justify-content: center;  align-items: center;  background#ebecf0;  overflow: hidden;}.container {  border-radius10px;  box-shadow: -5px -5px 10px #fff5px 5px 10px #babebc;  position: absolute;  width768px;  min-height480px;  overflow: hidden;}form {  background#ebecf0;  display: flex;  flex-direction: column;  padding0 50px;  height100%;  justify-content: center;  align-items: center;}form input {  background#eee;  padding16px;  margin8px 0;  width85%;  border0;  outline: none;  border-radius20px;  box-shadow: inset 7px 2px 10px #babebc, inset -5px -5px 12px #fff;}button {  border-radius20px;  border: none;  outline: none;  font-size12px;  font-weight: bold;  padding15px 45px;  margin14px;  letter-spacing1px;  text-transform: uppercase;  cursor: pointer;  transition: transform 80ms ease-in;}.form_btn {  box-shadow: -5px -5px 10px #fff5px 5px 8px #babebc;}.form_btn:active {  box-shadow: inset 1px 1px 2px #babebc, inset -1px -1px 2px #fff;}.overlay_btn {  background-color#ff4b2b;  color#fff;  box-shadow: -5px -5px 10px #ff6b3f5px 5px 8px #bf4b2b;}.sign-in-container {  position: absolute;  left0;  width50%;  height100%;  transition: all 0.5s;}.sign-up-container {  position: absolute;  left0;  width50%;  height100%;  opacity0;  transition: all 0.5s;}.overlay-left {  display: flex;  flex-direction: column;  padding0 50px;  justify-content: center;  align-items: center;  position: absolute;  right0;  width50%;  height100%;  opacity0;  background-color#ff4b2b;  color#fff;  transition: all 0.5s;}.overlay-right {  display: flex;  flex-direction: column;  padding0 50px;  justify-content: center;  align-items: center;  position: absolute;  right0;  width50%;  height100%;  background-color#ff4b2b;  color#fff;  transition: all 0.5s;}.container.right-panel-active .sign-in-container {  transformtranslateX(100%);  opacity0;}.container.right-panel-active .sign-up-container {  transformtranslateX(100%);  opacity1;  z-index2;}.container.right-panel-active .overlay-right {  transformtranslateX(-100%);  opacity0;}.container.right-panel-active .overlay-left {  transformtranslateX(-100%);  opacity1;  z-index2;}.social-links {  margin20px 0;}form h1 {  font-weight: bold;  margin0;  color#000;}p {  font-size16px;  font-weight: bold;  letter-spacing0.5px;  margin20px 0 30px;}span {  font-size12px;  color#000;  letter-spacing0.5px;  margin-bottom10px;}.social-links div {  width40px;  height40px;  display: inline-flex;  justify-content: center;  align-items: center;  margin0 5px;  border-radius50%;  box-shadow: -5px -5px 10px #fff5px 5px 8px #babebc;  cursor: pointer;}.social-links a {  color#000;}.social-links div:active {  box-shadow: inset 1px 1px 2px #babebc, inset -1px -1px 2px #fff;}
JS
const signUpBtn = document.getElementById("signUp");const signInBtn = document.getElementById("signIn");const container = document.querySelector(".container");signUpBtn.addEventListener("click"() => {  container.classList.add("right-panel-active");});signInBtn.addEventListener("click"() => {  container.classList.remove("right-panel-active");});
本站文章均为手工撰写未经允许谢绝转载:夜雨聆风 » css3立体感登录和注册表单页面!!附源码!!

评论 抢沙发

9 + 2 =
  • 昵称 (必填)
  • 邮箱 (必填)
  • 网址
×
订阅图标按钮