2 lines
2.5 KiB
JavaScript
2 lines
2.5 KiB
JavaScript
import{_ as g,g as w,a3 as _,r as h,o as i,c as r,a as u,b as e,q as d,v as l,w as v,F as f,e as y,h as k,p as P,j as b}from"./index-9a3ecfe5.js";import{t as x}from"./style-1561178c.js";import{N as S}from"./Navbar-fcee2b9c.js";import{_ as T,a as B}from"./315220_eye_icon-30328a0f.js";const U={name:"SignupPage",data(){return{email:"",password:"",toastMessage:"",toastBackground:"",showPassword:!1,toast:()=>{x(this.toastMessage,{hideProgressBar:!0,timeout:4e3,toastBackgroundColor:this.toastBackground})}}},components:{Navbar:S},methods:{showToast(t,s){this.toastMessage=t,this.toastBackground=s,this.toast()},signup(){if(!this.email||!this.password){this.showToast("Missing credentials","red");return}if(this.password.length<6){this.showToast("Password must be 6 or more characters","red");return}const t=w(y);_(t,this.email,this.password).then(()=>{this.showToast("Signed up successfully","green"),this.$router.push({path:"/"})}).catch(s=>{s.message.includes("already")?this.showToast("Email already in use","red"):s.message.includes("email")?this.showToast("Invalid email","red"):this.showToast(s.message,"red")})}}},n=t=>(P("data-v-0ac92d6f"),t=t(),b(),t),E={id:"background"},I={class:"loginbox"},N=n(()=>e("img",{src:"https://cdn.discordapp.com/attachments/1017419092447207436/1063092138029625394/pixil-frame-0.png",class:"avatar"},null,-1)),C=n(()=>e("h1",null,"Sign Up",-1)),V=n(()=>e("p",null,"Email Address",-1)),M=n(()=>e("p",null,"Password (6+ characters)",-1)),A={id:"imgDiv"};function D(t,s,F,j,a,p){const c=h("Navbar"),m=h("router-link");return i(),r(f,null,[u(c),e("div",E,[e("div",I,[N,C,V,d(e("input",{type:"email","onUpdate:modelValue":s[0]||(s[0]=o=>a.email=o),"aria-describedby":"emailHelp",placeholder:"Enter email"},null,512),[[l,a.email]]),M,e("div",A,[a.showPassword?(i(),r("img",{key:0,id:"eyeImg",src:T,onClick:s[1]||(s[1]=o=>this.showPassword=!this.showPassword),alt:"show"})):(i(),r("img",{key:1,id:"eyeImg",src:B,onClick:s[2]||(s[2]=o=>this.showPassword=!this.showPassword)}))]),a.showPassword?d((i(),r("input",{key:0,type:"text","onUpdate:modelValue":s[3]||(s[3]=o=>a.password=o),placeholder:"Enter password"},null,512)),[[l,a.password]]):d((i(),r("input",{key:1,type:"password","onUpdate:modelValue":s[4]||(s[4]=o=>a.password=o),placeholder:"Enter password"},null,512)),[[l,a.password]]),e("input",{onClick:s[5]||(s[5]=(...o)=>p.signup&&p.signup(...o)),type:"submit",name:"",value:"Sign Up"}),e("a",null,[u(m,{to:"/login"},{default:v(()=>[k("Already have an account?")]),_:1})])])])],64)}const G=g(U,[["render",D],["__scopeId","data-v-0ac92d6f"]]);export{G as default};
|