Vue精美簡(jiǎn)潔登錄頁完整代碼實(shí)例
LoginBox.vue
<template> <div class="main-box"> <div :class="['container', 'container-register', { 'is-txl': isLogin }]"> <form> <h2 class="title">Create Account</h2> <span class="text">or use email for registration</span> <input class="form__input" type="text" placeholder="Name" /> <input class="form__input" type="text" placeholder="Email" /> <input class="form__input" type="password" placeholder="Password" /> <div class="primary-btn">立即注冊(cè)</div> </form> </div> <div :class="['container', 'container-login', { 'is-txl is-z200': isLogin }]" > <form> <h2 class="title">Sign in to Website</h2> <span class="text">or use email for registration</span> <input class="form__input" type="text" placeholder="Email" /> <input class="form__input" type="password" placeholder="Password" /> <div class="primary-btn">立即登錄</div> </form> </div> <div :class="['switch', { login: isLogin }]"> <div class="switch__circle"></div> <div class="switch__circle switch__circle_top"></div> <div class="switch__container"> <h2>{{ isLogin ? 'Hello Friend !' : 'Welcome Back !' }}</h2> <p> {{ isLogin ? 'Enter your personal details and start journey with us' : 'To keep connected with us please login with your personal info' }} </p> <div class="primary-btn" @click="isLogin = !isLogin"> {{ isLogin ? '立即注冊(cè)' : '立即登錄' }} </div> </div> </div> </div> </template> <script> export default { name: 'LoginBox', data() { return { isLogin: false, loginForm: { email: '', password: '', }, registerForm: { name: '', email: '', password: '', }, } }, methods: { login() {}, register() {}, }, } </script> <style lang="scss" scoped> .main-box { position: relative; width: 1000px; min-width: 1000px; min-height: 600px; height: 600px; padding: 25px; background-color: #ecf0f3; box-shadow: 10px 10px 10px #d1d9e6, -10px -10px 10px #f9f9f9; border-radius: 12px; overflow: hidden; .container { display: flex; justify-content: center; align-items: center; position: absolute; top: 0; width: 600px; height: 100%; padding: 25px; background-color: #ecf0f3; transition: all 1.25s; form { display: flex; justify-content: center; align-items: center; flex-direction: column; width: 100%; height: 100%; color: #a0a5a8; .title { font-size: 34px; font-weight: 700; line-height: 3; color: #181818; } .text { margin-top: 30px; margin-bottom: 12px; } .form__input { width: 350px; height: 40px; margin: 4px 0; padding-left: 25px; font-size: 13px; letter-spacing: 0.15px; border: none; outline: none; // font-family: 'Montserrat', sans-serif; background-color: #ecf0f3; transition: 0.25s ease; border-radius: 8px; box-shadow: inset 2px 2px 4px #d1d9e6, inset -2px -2px 4px #f9f9f9; &::placeholder { color: #a0a5a8; } } } } .container-register { z-index: 100; left: calc(100% - 600px); } .container-login { left: calc(100% - 600px); z-index: 0; } .is-txl { left: 0; transition: 1.25s; transform-origin: right; } .is-z200 { z-index: 200; transition: 1.25s; } .switch { display: flex; justify-content: center; align-items: center; position: absolute; top: 0; left: 0; height: 100%; width: 400px; padding: 50px; z-index: 200; transition: 1.25s; background-color: #ecf0f3; overflow: hidden; box-shadow: 4px 4px 10px #d1d9e6, -4px -4px 10px #f9f9f9; color: #a0a5a8; .switch__circle { position: absolute; width: 500px; height: 500px; border-radius: 50%; background-color: #ecf0f3; box-shadow: inset 8px 8px 12px #d1d9e6, inset -8px -8px 12px #f9f9f9; bottom: -60%; left: -60%; transition: 1.25s; } .switch__circle_top { top: -30%; left: 60%; width: 300px; height: 300px; } .switch__container { display: flex; justify-content: center; align-items: center; flex-direction: column; position: absolute; width: 400px; padding: 50px 55px; transition: 1.25s; h2 { font-size: 34px; font-weight: 700; line-height: 3; color: #181818; } p { font-size: 14px; letter-spacing: 0.25px; text-align: center; line-height: 1.6; } } } .login { left: calc(100% - 400px); .switch__circle { left: 0; } } .primary-btn { width: 180px; height: 50px; border-radius: 25px; margin-top: 50px; text-align: center; line-height: 50px; font-size: 14px; letter-spacing: 2px; background-color: #4b70e2; color: #f9f9f9; cursor: pointer; box-shadow: 8px 8px 16px #d1d9e6, -8px -8px 16px #f9f9f9; &:hover { box-shadow: 4px 4px 6px 0 rgb(255 255 255 / 50%), -4px -4px 6px 0 rgb(116 125 136 / 50%), inset -4px -4px 6px 0 rgb(255 255 255 / 20%), inset 4px 4px 6px 0 rgb(0 0 0 / 40%); } } } </style>
總結(jié)
到此這篇關(guān)于Vue精美簡(jiǎn)潔登錄頁的文章就介紹到這了,更多相關(guān)Vue簡(jiǎn)潔登錄頁內(nèi)容請(qǐng)搜索腳本之家以前的文章或繼續(xù)瀏覽下面的相關(guān)文章希望大家以后多多支持腳本之家!
- vue?+elementui?項(xiàng)目登錄通過不同賬號(hào)切換側(cè)邊欄菜單的顏色
- 登錄頁面的實(shí)現(xiàn)及跳轉(zhuǎn)代碼實(shí)例(vue-router)
- VUE登錄注冊(cè)頁面完整代碼(直接復(fù)制)
- vue前端實(shí)現(xiàn)驗(yàn)證碼登錄功能
- vue實(shí)現(xiàn)登錄數(shù)據(jù)的持久化的使用示例
- Vue實(shí)現(xiàn)驗(yàn)證碼登錄的超詳細(xì)步驟
- 通用vue組件化登錄頁面實(shí)例代碼
- Vue登錄后添加動(dòng)態(tài)路由并跳轉(zhuǎn)的實(shí)踐分享
- vue實(shí)現(xiàn)未登錄訪問其他頁面自動(dòng)跳轉(zhuǎn)登錄頁功能(實(shí)現(xiàn)步驟)
- vue限制實(shí)現(xiàn)不登錄無法進(jìn)入其他頁面
相關(guān)文章
vue中datepicker的使用教程實(shí)例代碼詳解
這篇文章主要介紹了vue-datepicker的使用,本文通過實(shí)例代碼大家介紹的非常詳細(xì),具有一定的參考借鑒價(jià)值,需要的朋友可以參考下2019-07-07vue開發(fā)樹形結(jié)構(gòu)組件(組件遞歸)
這篇文章主要為大家詳細(xì)介紹了vue開發(fā)樹形結(jié)構(gòu)組件的方法,文中示例代碼介紹的非常詳細(xì),具有一定的參考價(jià)值,感興趣的小伙伴們可以參考一下2021-08-08vue中提示$index is not defined錯(cuò)誤的解決方式
這篇文章主要介紹了vue中提示$index is not defined錯(cuò)誤的解決方式,具有很好的參考價(jià)值,希望對(duì)大家有所幫助。一起跟隨小編過來看看吧2020-09-09vue中的計(jì)算屬性的使用和vue實(shí)例的方法示例
本篇文章主要介紹了vue計(jì)算屬性的使用和vue實(shí)例的方法示例,小編覺得挺不錯(cuò)的,現(xiàn)在分享給大家,也給大家做個(gè)參考。一起跟隨小編過來看看吧2017-12-12vue實(shí)現(xiàn)導(dǎo)出excel的多種方式總結(jié)
在Vue中實(shí)現(xiàn)導(dǎo)出Excel有多種方式,可以通過前端實(shí)現(xiàn),也可以通過前后端配合實(shí)現(xiàn),這篇文章將為大家詳細(xì)介紹幾種常用的實(shí)現(xiàn)方式,需要的可以參考下2023-08-08使用Vue實(shí)現(xiàn)帶拖動(dòng)和播放功能的時(shí)間軸
這篇文章主要為大家詳細(xì)介紹了如何使用Vue實(shí)現(xiàn)帶拖動(dòng)和播放功能的時(shí)間軸,文中的示例代碼講解詳細(xì),感興趣的小伙伴可以跟隨小編一起學(xué)習(xí)一下2024-03-03