generated from dwd/boilarplate-astro-tailwind
46 lines
2.0 KiB
Plaintext
46 lines
2.0 KiB
Plaintext
|
|
<main>
|
|
<div class="absolute top-1/2 left-1/2 transform -translate-x-1/2 -translate-y-1/2">
|
|
<section class="container mx-auto max-w-lg bg-[url(/img/hps_logo.png)] rounded-2xl">
|
|
<div class="flex flex-col w-full justify-center place-items-center border-[1px] border-[#0e0f0420] rounded-[20px] shadow-2xl py-10">
|
|
<img class="max-w-[150px] shadow-lg p-2 py-6 border-[1px] rounded-full" src="/img/hps_logo.png" alt="">
|
|
<form action="" class="p-6">
|
|
<input id="email" name="email" type="text" placeholder="User ID" class="border-2 focus:border-[#47ae6a] border-[#3084b5] focus:outline-none rounded-lg w-full p-2" required/>
|
|
<input id="password" name="password" type="password" placeholder="Passsord" class="border-2 focus:border-[#47ae6a] border-[#3084b5] focus:outline-none rounded-lg w-full p-2 mt-6" required/>
|
|
<button onclick="myFunction(event)" class="border-2 border-[#3084b5] text-white bg-[#3084b5] focus:outline-none rounded-lg w-full p-2 mt-4">Login</button>
|
|
</form>
|
|
<p class="">Not Registerd? <a href="/sign-up" class="text-[#FFFFFF] font-bold">Register Now</a></p>
|
|
</div>
|
|
</section>
|
|
</div>
|
|
</main>
|
|
<script is:inline>
|
|
function myFunction(event){
|
|
event.preventDefault();
|
|
let emailId = document.getElementById('email').value;
|
|
let password = document.getElementById('password').value;
|
|
let userData = {
|
|
email : emailId,
|
|
password : password
|
|
}
|
|
fetch(`https://game-du.teachertrainingkolkata.in/auth/login`, {
|
|
method: 'POST',
|
|
headers: {
|
|
'Content-Type' : 'application/json'
|
|
},
|
|
body: JSON.stringify(userData)
|
|
})
|
|
.then(res => res.json())
|
|
.then(data => {
|
|
console.log(data)
|
|
})
|
|
}
|
|
</script>
|
|
<style>
|
|
.content {
|
|
position: absolute;
|
|
top: 50%;
|
|
left: 50%;
|
|
transform: translate(-50%, -50%);
|
|
}
|
|
</style> |