Compare commits

..

No commits in common. "753863585d23b2e6ffce9cf4e3fe9564ef60d6cf" and "3d4d56f616cb26075ff691b42f5ad6173b43126e" have entirely different histories.

2 changed files with 23 additions and 16 deletions

View File

@ -46,7 +46,7 @@ onMounted(async () => {
</script> </script>
<template> <template>
<main class="form-signin w-100 m-auto position-absolute top-50 start-50 translate-middle"> <main class="form-signin w-100 m-auto">
<form onsubmit="event.preventDefault();"> <form onsubmit="event.preventDefault();">
<IconLogo /> <IconLogo />
<h1 class="h3 mb-3 fw-normal">Please sign in</h1> <h1 class="h3 mb-3 fw-normal">Please sign in</h1>
@ -65,7 +65,7 @@ onMounted(async () => {
<button type="submit" @click="login" class="btn btn-primary w-100 py-2">Sign in</button> <button type="submit" @click="login" class="btn btn-primary w-100 py-2">Sign in</button>
<p class="mt-5 mb-3 text-body-secondary">&copy; 2023 Lucas Schumacher</p> <p class="mt-5 mb-3 text-body-secondary">&copy; 2023</p>
</form> </form>
</main> </main>
</template> </template>

View File

@ -10,7 +10,6 @@ const err = ref('')
async function signup(ev) { async function signup(ev) {
ev.preventDefault() ev.preventDefault()
console.log(ev)
const api_url = '/api/user' const api_url = '/api/user'
const payload = { username: user.value, password: pass.value, referral: refe.value } const payload = { username: user.value, password: pass.value, referral: refe.value }
const fetch_options = { const fetch_options = {
@ -30,7 +29,6 @@ async function signup(ev) {
let resp = await fetch(api_url, fetch_options) let resp = await fetch(api_url, fetch_options)
console.log(resp) console.log(resp)
if (resp.ok) { if (resp.ok) {
err.value = ''
let ans = await resp.json() let ans = await resp.json()
console.log(ans) console.log(ans)
@ -43,7 +41,7 @@ async function signup(ev) {
</script> </script>
<template> <template>
<main class="form-signin w-100 m-auto my-auto position-absolute top-50 start-50 translate-middle"> <main class="form-signin w-100 m-auto my-auto">
<form onsubmit="event.preventDefault();"> <form onsubmit="event.preventDefault();">
<IconLogo /> <IconLogo />
<h1 class="h3 mb-3 fw-normal">Sign up</h1> <h1 class="h3 mb-3 fw-normal">Sign up</h1>
@ -56,29 +54,30 @@ async function signup(ev) {
<input type="password" v-model="pass" class="form-control" id="floatingPassword" placeholder="Password"> <input type="password" v-model="pass" class="form-control" id="floatingPassword" placeholder="Password">
<label for="floatingPassword">Password</label> <label for="floatingPassword">Password</label>
</div> </div>
<div class="form-floating mb-3"> <div class="form-floating">
<input type="text" v-model="refe" class="form-control" id="floatingCode" placeholder=""> <input type="text" v-model="refe" class="form-control" id="floatingCode" placeholder="">
<label for="floatingCode">Referral Code</label> <label for="floatingCode">Referral Code</label>
</div> </div>
<div class="form-floating">
<div v-if="err != ''" class="form-floating alert alert-danger" role="alert"> <p> {{ err }} </p>
<div class="me-3">{{ err }}</div>
<button @click="err = ''" type="button" class="btn-close me-2 position-absolute top-50 end-0 translate-middle-y"
aria-label="close"></button>
</div> </div>
<div class="form-floating mb-3">
<button type="submit" @click="signup" class="btn btn-primary w-100 py-2">Sign up</button>
<div class="form-floating m-2">
Already have an account? Already have an account?
<a href="#/login">Log in</a> <a href="#/login">Log in</a>
</div> </div>
<p class="mt-5 mb-3 text-body-secondary">&copy; 2023 Lucas Schumacher</p>
<button type="submit" @click="signup" class="btn btn-primary w-100 py-2">Sign up</button>
<p class="mt-5 mb-3 text-body-secondary">&copy; 2023</p>
</form> </form>
</main> </main>
</template> </template>
<style scoped> <style scoped>
/* html,
body {
height: 100%;
} */
.form-signin { .form-signin {
max-width: 330px; max-width: 330px;
padding: 1rem; padding: 1rem;
@ -88,7 +87,15 @@ async function signup(ev) {
z-index: 2; z-index: 2;
} }
.form-signin input[type="email"] {
margin-bottom: -1px;
border-bottom-right-radius: 0;
border-bottom-left-radius: 0;
}
.form-signin input[type="password"] { .form-signin input[type="password"] {
margin-bottom: 10px; margin-bottom: 10px;
border-top-left-radius: 0;
border-top-right-radius: 0;
} }
</style> </style>