乐于分享
好东西不私藏

创意动画效果登录注册UI页面!附源码!!

创意动画效果登录注册UI页面!附源码!!

  效果展示  

  完整源码  

HTML
<!DOCTYPE html><htmllang="en"><head>    <metacharset="UTF-8">    <title>创意动画效果登录注册UI页面 </title>    <metaname="viewport"content="width=device-width, initial-scale=1.0">    <metahttp-equiv="X-UA-Compatible"content="ie=edge">    <linkrel="stylesheet"href="./style.css"></head><body>    <!-- partial:index.partial.html -->    <!-- svg -->    <svgxmlns="http://www.w3.org/2000/svg"xmlns:xlink="http://www.w3.org/1999/xlink"class="svg-leafs">        <defs>            <filterid="a"x="0"y="11.42"width="141.121"height="116.457"filterUnits="userSpaceOnUse">                <feOffsetinput="SourceAlpha" />                <feGaussianBlurstdDeviation="2"result="b" />                <feFloodflood-opacity="0.102" />                <feCompositeoperator="in"in2="b" />                <feCompositein="SourceGraphic" />            </filter>            <filterid="c"x="21.622"y="0"width="133.642"height="128.93"filterUnits="userSpaceOnUse">                <feOffsetinput="SourceAlpha" />                <feGaussianBlurstdDeviation="5"result="d" />                <feFloodflood-opacity="0.102" />                <feCompositeoperator="in"in2="d" />                <feCompositein="SourceGraphic" />            </filter>        </defs>        <gtransform="translate(-744.034 -593.436)"id="leafs">            <pathd="M863.5,421.5s8.259,5.707,15.234,25.935"transform="translate(156.156 66.187) rotate(16)"fill="none"stroke="#2f811e"stroke-linecap="round"stroke-width="0.4" />            <gtransform="matrix(1, 0, 0, 1, 744.03, 593.44)"filter="url(#a)">                <pathd="M902.99,490.315s-43.333-18.667-50.49-50.667,10.49-31.667,10.49-31.667A314.915,314.915,0,0,1,895.5,411c16.5,2.5,69.5,37.5,81,70.5,3.829,10.989,7.49,22.815-7.176,29.815S902.99,490.315,902.99,490.315Z"transform="translate(-844.79 -390.56)"fill="var(--green-3)" />            </g>            <pathd="M863.5,421.5s12.557,3.337,25.522,21.57"transform="translate(355.423 -110.67) rotate(32)"fill="none"stroke="#2c7f1c"stroke-linecap="round"stroke-width="0.4" />            <gtransform="matrix(1, 0, 0, 1, 744.03, 593.44)"filter="url(#c)">                <pathd="M906.186,482.446A113.239,113.239,0,0,1,885.911,470c-5.977-4.556-11.973-10.782-16.832-16.173-12.146-13.478-10.038-42.395-5.407-45.119s27.019,5.924,27.019,5.924,30.8,14.016,39.021,25.114c16.177,21.847,23.864,43.4,14.867,49.079S908.19,483.261,906.186,482.446Z"transform="translate(-701.6 -564.26) rotate(12.09)"fill="var(--green-4)" />            </g>        </g>    </svg>    <!-- /svg -->    <!-- app -->    <divclass="app">        <!-- leafs -->        <divclass="leafs">            <divclass="leaf leaf--1">                <svgxmlns="http://www.w3.org/2000/svg"xmlns:xlink="http://www.w3.org/1999/xlink"width="155.264"height="145.312"viewBox="0 0 155.264 145.312">                    <usexlink:href="#leafs" />                </svg>            </div>            <divclass="leaf leaf--2">                <svgxmlns="http://www.w3.org/2000/svg"xmlns:xlink="http://www.w3.org/1999/xlink"width="155.264"height="145.312"viewBox="0 0 155.264 145.312">                    <usexlink:href="#leafs" />                </svg>            </div>            <divclass="leaf leaf--3">                <svgxmlns="http://www.w3.org/2000/svg"xmlns:xlink="http://www.w3.org/1999/xlink"width="155.264"height="145.312"viewBox="0 0 155.264 145.312">                    <usexlink:href="#leafs" />                </svg>            </div>        </div>        <!-- /leafs -->        <!-- first-screen -->        <divclass="screen first-screen">            <pclass="number">#12</p>            <h1class="heading">bootstrapMB.</h1>            <pclass="description">创意的登录注册UI页面,带树叶动画效果,前置页面、登录页面、登录成功页面。</p>            <buttonclass="btn-circle btn-pTSecond">&rarr;</button>        </div>        <!-- /first-screen -->        <!-- second-screen -->        <divclass="screen second-screen">            <buttonclass="btn-circle btn-pTFirst">&larr;</button>            <h1class="heading">注册</h1>            <formclass="form">                <divclass="form__field">                    <inputtype="email"class="form__input"placeholder="email"data-info="noor@beautifulnature.com"required>                </div>                <divclass="form__field">                    <!-- Yup! the password is hidden even here... hehe -->                    <inputtype="password"class="form__input"placeholder="password"data-info="********"required>                </div>                <buttonclass="btn-words btn-form">创建账号</button>                <divclass="form__success">成功</div>            </form>            <buttonclass="btn-words btn-sign-in">登录</button>        </div>        <!-- /second-screen -->        <!-- third-screen -->        <divclass="screen third-screen">            <h1class="heading">欢迎</h1>            <pclass="description">账号注册成功,谢谢!</p>        </div>        <!-- /third-screen -->    </div>    <!-- /app -->    <!-- cursor -->    <divclass="custom-cursor"></div>    <!-- /cursor -->    <ahref="http://www.bootstrapmb.com"class="abs-site-link"rel="nofollow noreferrer"target="_blank">abs/designs/d11-plant-app-sign-up-ui</a>    <!-- partial -->    <scriptsrc="./script.js"></script></body></html>
style.CSS
/*    ================================        Best Viewed In Full Page    ================================更多下载:http://www.bootstrapmb.com*//* Steps:  #1: Click/Enter on the button that contains -> and it will take you to second screen  #2: Click/Focus on input fields and fields are going to be filled themselve with the data that I set up -- just for ease -- and submit the form  #3: And done it'll take you to the third screenMy focus was on the animations, and I love them, hope you love the leafs animations as well, don't hesitate to tell me what you think :)In case you want to see how the animations look you can visit the link thats on the left bottom side (inside the frame) and it'll take you to my site where I've shared the video of how this works...*/@import url('https://fonts.googleapis.com/css?family=Merriweather&display=swap');/* default *//* =============================================================================================== */*,*::before,*::after {  margin0;  padding0;  box-sizing: border-box;}html {  font-size62.5%;}body {  display: flex;  flex-direction: column;  justify-content: center;  align-items: center;  min-height100vh;  padding2rem;  font-family'Merriweather';  backgroundurl('bg.jpg');  background-size: cover;}button {  border: none;  color: inherit;  background: transparent;  cursor: pointer;}button::-moz-focus-inner {  border0;}/* app *//* =============================================================================================== */.app {  --light-1hsl(11431%93%);  --light-2hsl(11431%96%);  --green-1hsl(13046%38%);  --green-2hsl(13050%50%);  --green-3hsl(13142%42%);  --green-4hsl(13045%45%);  --gray-1hsl(00%50%);  --gray-2hsl(00%90%);  --dark-1hsl(00%8%);  --dark-2hsl(00%20%);  --gradient-1linear-gradient(to right bottom, var(--green-2), var(--green-1));  --gradient-2linear-gradient(to right bottom, var(--light-2), var(--light-1));  width22rem;  height46rem;  border-radius2rem;  box-shadow0 3rem 4rem .4rem hsla(00%0%, .1),    0 1.5rem 2.4rem -1rem hsla(00%0%, .06),    0 0 2.4rem hsla(00%0%, .06);  position: relative;  overflow: hidden;}/* leafs *//* =============================================================================================== */.svg-leafs {  position: absolute;  top: -100%;  left: -100%;  visibility: hidden;}.leaf {  position: absolute;  right0;  bottom0;  z-index4;  width20rem;  pointer-events: none;  transition: .3s;}.leaf--1 {  right: -3rem;  bottom: -11.5rem;  transformrotate(90deg);}.leaf--2 {  right: -2rem;  bottom: -8rem;  transformrotate(55deg);}.leaf--3 {  right: -.5rem;  bottom: -10.5rem;  transformrotate(15deg);}/* Other *//* =============================================================================================== */.number {  width100%;  margin-bottom2rem;  text-align: right;}.heading {  font-size2.6rem;  letter-spacing: .2rem;  transition: .4s;}.description {  margin-top2rem;  line-height2;}/* screen *//* =============================================================================================== */.screen {  position: absolute;  top0;  left0;  display: flex;  flex-direction: column;  justify-content: center;  width100%;  height100%;  border-radius: inherit;  padding2rem;  colorvar(--light-1);  background: transparent;}/* first-screen *//* =============================================================================================== */.first-screen {  align-items: flex-start;  backgroundvar(--gradient-1);}/* second-screen *//* =============================================================================================== */.second-screen {  colorvar(--green-1);  left100%;  z-index2;}.second-screen .heading {  opacity0;  transformtranslate(30px);}/* third-screen *//* =============================================================================================== */.third-screen {  left100%;  z-index3;}.third-screen .heading {  opacity0;  transformtranslateY(30px);}/* buttons *//* =============================================================================================== *//* btn-circle *//* ---------------------------------------- */.btn-circle {  width4rem;  height4rem;  border-radius100rem;  display: flex;  justify-content: center;  align-items: center;}/* btn-pTSecond *//* ---------------------------------------- */.btn-pTSecond {  margin-top2rem;  border1px solid var(--light-1);  transformscale(.8);  transform-origin: left center;  transition: .3s;}.btn-pTSecond:hover,.btn-pTSecond:focus {  transformscale(1);}.btn-pTSecond::before {  content'';  width100%;  height100%;  border-radius: inherit;  position: absolute;  backgroundvar(--gradient-2);  transformscale(0);  transition: .6s;}/* btn-pTFirst *//* ---------------------------------------- */.btn-pTFirst {  colorvar(--light-1);  backgroundvar(--gradient-1);  position: absolute;  top2rem;  left2rem;}/* btn-words *//* ---------------------------------------- */.btn-words {  width100%;  font-size1.2rem;  transition: all .4s, transform 1s .5s;}/* btn-form *//* ---------------------------------------- */.btn-form {  border-radius100rem;  margin-top: .4rem;  padding1rem 0;  colorvar(--gray-1);  backgroundvar(--gray-2);  font-weight: bold;  z-index1;}.btn-form::before {  content'✓';  position: absolute;  transformscale(0translateX(-3px);  transition: .5s .4ms cubic-bezier(.17, .09, .771.8);}.btn-form::after {  content'';  width100%;  height100%;  border-radius: inherit;  position: absolute;  top0;  left0;  backgroundvar(--gradient-1);  transformscale(0);  transition: .6s;}/* btn-sign-in *//* ---------------------------------------- */.btn-sign-in {  colorvar(--dark-2);}/* form *//* =============================================================================================== */.form {  width100%;  margin4rem 0 2rem;  text-align: center;  opacity0;  transformtranslateY(2rem);}.form__field {  width100%;  height: auto;  margin-bottom2.2rem;  position: relative;}.form__field::before,.form__field::after {  content'';  width0;  position: absolute;  bottom0;  left0;  transition: .5s;}.form__field::before {  border-bottom1px solid var(--gray-1);  opacity: .3;}.form__field::after {  width0;  border-bottom1px solid var(--green-1);}.form__field:focus-within::after {  width100%;}.form__input {  width100%;  border: none;  padding-bottom: .8rem;  colorvar(--dark-1);  background: transparent;  font-size1.2rem;}.form__success {  position: absolute;  left50%;  bottom: .9rem;  font-size1.2rem;  pointer-events: none;  opacity0;  transformtranslateX(-.4rem);  transition1s .5s;}/* Styles that will be added via JavaScript *//* =============================================================================================== *//* second-screen-opened *//* ---------------------------------------- */.second-screen-opened .leaf {  transition1s;}.second-screen-opened .leaf--1 {  right: -8.8rem;  bottom78%;  transformrotate(5deg);}.second-screen-opened .leaf--2 {  right: -8.6rem;  bottom: -5rem;  transformrotate(80deg);}.second-screen-opened .leaf--3 {  right11rem;  bottom: -4.2rem;  transformrotate(180deg);}.second-screen-opened .first-screen .heading {  opacity0;  transformtranslateX(30px);}.second-screen-opened .btn-pTSecond::before {  border-radius0;  transformscale(22);}.second-screen-opened .second-screen {  left0;}.second-screen-opened .second-screen .heading {  opacity1;  transformtranslate(0);  transition1s .4s;}.second-screen-opened .second-screen .form {  opacity1;  transformtranslateY(0);  transition: .7s .1s;}.second-screen-opened .form__field::before {  width100%;  transition: .8s .3s;}/* third-screen-opened  *//* ---------------------------------------- */.third-screen-opened .leaf--1 {  right10rem;  bottom: -8rem;  transformrotate(-10deg);}.third-screen-opened .leaf--2 {  right10rem;  bottom74%;  transformrotate(90deg);}.third-screen-opened .leaf--3 {  right: -10.2rem;  bottom26%;  transformrotate(40deg);}.third-screen-opened .second-screen .heading {  opacity0;  transformtranslateX(30px);}.third-screen-opened .btn-form::after {  border-radius0;  transformscale(22);}.third-screen-opened .third-screen {  left0;}.third-screen-opened .third-screen .heading {  opacity1;  transformtranslate(0);  transition1s .4s;}/* on-btn-pTSecond *//* ---------------------------------------- */.on-btn-pTSecond .leaf--1 {  right: -3rem;  bottom: -8.5rem;  transformrotate(97deg);}.on-btn-pTSecond .leaf--2 {  bottom: -5rem;  transformrotate(52deg);}.on-btn-pTSecond .leaf--3 {  right3rem;  bottom: -7.5rem;  transformrotate(5deg);}/* .form-ready *//* ---------------------------------------- */.form-ready .btn-form {  colorvar(--light-1);  backgroundvar(--green-2);}/* .form-submitted *//* ---------------------------------------- */.form-submitted .btn-form {  width3.6rem;  transformtranslateX(-2rem);}.form-submitted .btn-form::before {  transformscale(1translateX(-3px);}.form-submitted .form__success {  opacity1;  transformtranslateX(.4rem);}.form-submitted .btn-sign-in {  opacity0;}/* custom-cursor *//* =============================================================================================== */.custom-cursor {  width3rem;  height3rem;  border1px solid hsla(00%100%, .7);  border-radius100%;  backgroundhsla(00%80%, .2);  position: absolute;  z-index5;  transformtranslate(-50%, -50%);  pointer-events: none;}.abs-site-link {  position: fixed;  bottom20px;  left20px;  colorhsla(00%100%, .6);  font-size1.6rem;  font-family'Segoe UI', -apple-system, BlinkMacSystemFont, sans-serif;}
script.JS
// by// abubakersaeed.netlify.com | @AbubakerSaeed96// ============================================// Leafs SVG quickly drawn by me// �������أ�http://www.bootstrapmb.com// Background image:// From Unsplash - link is in CSS panel// Thank You for Viewing// Helpers/* =============================================================================================== */const $ = e => document.querySelector(e);const $$ = e => document.querySelectorAll(e);// Variablesconst app = $(".app");const pTSecondButton = $(".btn-pTSecond");const form = $(".form");const formInputs = $$(".form__input");const formButton = $(".btn-form");const cursor = $(".custom-cursor");// pTSecondButton Events/* =============================================================================================== */pTSecondButton.addEventListener("mouseenter"() => {  app.classList.add("on-btn-pTSecond");})pTSecondButton.addEventListener("focus"() => {  app.classList.add("on-btn-pTSecond");})pTSecondButton.addEventListener("mouseleave"() => {  app.classList.remove("on-btn-pTSecond");})pTSecondButton.addEventListener("blur"() => {  app.classList.remove("on-btn-pTSecond");})pTSecondButton.addEventListener("click"() => {  app.classList.add("second-screen-opened");  app.classList.remove("on-btn-pTSecond");})// Cursor Event/* =============================================================================================== */window.addEventListener("mousemove"({pageY: Y, pageX: X}) => {  cursor.style.top = `${Y}px`;  cursor.style.left = `${X}px`;})// Form Stuff/* =============================================================================================== */function checkForm() {  let f = 0;  for (let i = 0; i < formInputs.length; i++) {    (formInputs[i].value !== '') ? f++ : f--;  }  (f === 2) ? app.classList.add("form-ready") : app.classList.remove("form-ready");  return f;}form.addEventListener("submit"e => {  // preventing form from submitting  e.preventDefault();  // and opening third screen  setTimeout(() => {    app.classList.add("third-screen-opened");  }, 1600);})// form-ready - check if form is ready or not and if ready add .form-ready class on .app else remove if .app hasfor (let i = 0; i < formInputs.length; i++) {  // auto-filling form (don't try or do... this in real application, i know... your welcome)  // via mouse click  formInputs[i].addEventListener("click"e => {    if (e.target.value === '') e.target.value = e.target.dataset.info;    checkForm();  })  // via focus through keyboard  formInputs[i].addEventListener("focus"e => {    if (e.target.value === '') e.target.value = e.target.dataset.info;    checkForm();  })  formInputs[i].addEventListener("input", checkForm);}// form-submitted animation - when btn-form clicked/pressed add .form-submitted class on .app (if form is ready)formButton.addEventListener("click"() => {  if (checkForm() === 2) {    formButton.innerHTML = "&nbsp;";    app.classList.add("form-submitted");  }})