91 lines
3.8 KiB
Vue
91 lines
3.8 KiB
Vue
<template>
|
|
<div
|
|
class="relative grid min-h-screen place-items-center overflow-hidden bg-[#f5f5f5] px-4 py-12 font-sans text-[#0c0a09] md:py-24">
|
|
<div
|
|
class="pointer-events-none absolute left-1/2 top-10 h-[420px] w-[min(92vw,760px)] -translate-x-1/2 rounded-[48px] bg-[radial-gradient(circle_at_20%_30%,rgba(167,229,211,0.62),transparent_28%),radial-gradient(circle_at_72%_24%,rgba(244,197,168,0.56),transparent_30%),radial-gradient(circle_at_52%_78%,rgba(200,184,224,0.5),transparent_34%)] blur-2xl"
|
|
aria-hidden="true"></div>
|
|
|
|
<main
|
|
class="relative grid w-full max-w-[1120px] grid-cols-1 items-center gap-8 md:grid-cols-[minmax(0,1fr)_minmax(340px,420px)] md:gap-16"
|
|
aria-labelledby="create-account-title">
|
|
<section class="relative pt-2 md:py-8">
|
|
<p
|
|
class="m-0 inline-flex rounded-full bg-[#f0efed] px-3 py-1 text-xs font-semibold uppercase leading-[1.4] tracking-[0.96px] text-[#0c0a09]">
|
|
Nova conta
|
|
</p>
|
|
<h1 id="create-account-title"
|
|
class="my-5 max-w-[640px] font-serif text-[40px] font-light leading-[1.05] tracking-[-1.2px] text-[#0c0a09] md:text-[64px] md:tracking-[-1.92px]">
|
|
Crie sua conta
|
|
</h1>
|
|
<p class="m-0 max-w-[520px] text-base font-normal leading-6 tracking-[0.16px] text-[#4e4e4e]">
|
|
Crie sua conta de forma simples e rápida com email e senha.
|
|
</p>
|
|
</section>
|
|
|
|
<section
|
|
class="grid gap-5 rounded-2xl border border-[#e7e5e4] bg-white p-6 shadow-[0_4px_16px_rgba(0,0,0,0.04)] md:p-8"
|
|
aria-label="Formulario de criacao de conta">
|
|
<div class="mb-1">
|
|
<span
|
|
class="inline-flex min-h-6 items-center rounded-full bg-[#f0efed] px-2.5 py-1 text-xs font-semibold uppercase leading-none tracking-[0.96px] text-[#0c0a09]">
|
|
Cadastro
|
|
</span>
|
|
<h2 class="mt-4 font-serif text-3xl font-light leading-[1.13] tracking-[-0.32px] text-[#0c0a09]">
|
|
Dados de entrada
|
|
</h2>
|
|
</div>
|
|
|
|
<div class="grid gap-2">
|
|
<label class="m-0 text-xs font-semibold uppercase leading-[1.4] tracking-[0.96px] text-[#777169]" for="email">
|
|
Email
|
|
</label>
|
|
<input v-model="formData.email"
|
|
class="h-11 w-full rounded-lg border border-[#d6d3d1] bg-white px-4 py-3 text-base leading-6 tracking-[0.16px] text-[#0c0a09] outline-none transition focus:border-2 focus:border-[#0c0a09]"
|
|
type="text" id="email" name="email" />
|
|
</div>
|
|
|
|
<div class="grid gap-2">
|
|
<label class="m-0 text-xs font-semibold uppercase leading-[1.4] tracking-[0.96px] text-[#777169]" for="senha">
|
|
Senha
|
|
</label>
|
|
<input v-model="formData.password"
|
|
class="h-11 w-full rounded-lg border border-[#d6d3d1] bg-white px-4 py-3 text-base leading-6 tracking-[0.16px] text-[#0c0a09] outline-none transition focus:border-2 focus:border-[#0c0a09]"
|
|
type="password" id="senha" name="senha" />
|
|
</div>
|
|
|
|
<button
|
|
class="mt-1 h-10 rounded-full bg-[#292524] px-5 text-[15px] font-medium leading-none text-white transition hover:bg-[#0c0a09] active:bg-[#0c0a09]"
|
|
@click="criarConta">
|
|
Criar Conta
|
|
</button>
|
|
</section>
|
|
</main>
|
|
</div>
|
|
</template>
|
|
|
|
<script setup>
|
|
const formData = reactive({
|
|
email: '',
|
|
password: ''
|
|
})
|
|
|
|
async function criarConta() {
|
|
try {
|
|
; (
|
|
await fetch('/auth/register', {
|
|
method: 'POST',
|
|
headers: {
|
|
'Content-Type': 'application/json'
|
|
},
|
|
body: JSON.stringify({
|
|
email: formData.email,
|
|
password: formData.password
|
|
})
|
|
})
|
|
)()
|
|
} catch (error) {
|
|
window.alert('Ocorreu um erro ao criar a conta. Tente novamente mais tarde.', error.statusText)
|
|
}
|
|
}
|
|
</script>
|