diff --git a/resources/js/main.js b/resources/js/main.js index fb4a83b..3f62ee9 100644 --- a/resources/js/main.js +++ b/resources/js/main.js @@ -7,10 +7,7 @@ let heroText = document.querySelectorAll(".landing-hero h2,.landing-hero p") let registerToggles = document.querySelectorAll(".register-btn, .register-area\ .cancel-button, .services-cards button") let token = getCookie('XSRF-TOKEN') -const app = createApp(RegisterArea) - -// app.component('register-area', {template: RegisterArea}) -app.mount('#app') +const app = createApp(RegisterArea).mount('#app') function importAll(r) { return r.keys().map(r) @@ -31,16 +28,6 @@ function getToken() { }) } -function checkPasswords() { - let passInput = document.getElementById('register-password') - let passInput2 = document.getElementById('confirm-password') - if (passInput.value != passInput2.value) { - passInput2.setCustomValidity('Passwords must be matching') - } else { - passInput2.setCustomValidity(''); - } -} - function login(event) { fetch("/login", { method: 'POST', @@ -78,12 +65,20 @@ if (!token) {getToken()} if (window.location.pathname == '/') { document.getElementById('nav_toggle').addEventListener('click', toggleNav) document.getElementById('login_form').addEventListener('submit', login) + // console.log(app.$data.active) //Triggers for registration menu for (let i = 0; i < registerToggles.length; i++) { registerToggles[i].addEventListener("click", function() { - document.querySelector(".register-area").classList.toggle("active") - }); + document.querySelector(".register-area").classList.add("active") + app.active = 'register' + }) + } + document.getElementById("forgot-password-btn").onclick = event => { + document.querySelector(".register-area").classList.add("active") + app.active = 'forgot' + console.log(app.active) + event.preventDefault() } //FAQ collapsibles @@ -94,8 +89,6 @@ if (window.location.pathname == '/') { this.classList.toggle("active"); }); } - document.getElementById("register-password").oninput = checkPasswords - document.getElementById("confirm-password").oninput = checkPasswords } else if (window.location.pathname == '/verify-email') { document.getElementById('resend_verification').addEventListener("click", resendLink) } diff --git a/resources/js/register-area/register-area.vue b/resources/js/register-area/register-area.vue index e47aedd..7fb1d1f 100644 --- a/resources/js/register-area/register-area.vue +++ b/resources/js/register-area/register-area.vue @@ -8,17 +8,17 @@