some design improvments
This commit is contained in:
@ -0,0 +1,5 @@
|
||||
<h1>DeguApp</h1>
|
||||
<center>
|
||||
<img src="/img/tabornici_logo.png" alt="tabornici logo" width="60%">
|
||||
</center>
|
||||
|
||||
|
51
frontend/pages/login/login.php
Normal file
51
frontend/pages/login/login.php
Normal file
@ -0,0 +1,51 @@
|
||||
<?php
|
||||
$API_URL = "http://localhost:6060"
|
||||
?>
|
||||
|
||||
<link rel="stylesheet" href="/css/add.css">
|
||||
|
||||
<form class="form_add">
|
||||
<label for="email">E-mail:</label>
|
||||
<input type="email" name="email" id="email">
|
||||
|
||||
<label for="password">Heslo:</label>
|
||||
<input type="password" name="password" id="password">
|
||||
|
||||
<button id="submit" class="btn-send">Přihlásit se</button>
|
||||
</form>
|
||||
|
||||
<script>
|
||||
const btn = document.querySelector('.btn-send')
|
||||
console.log(btn)
|
||||
btn.addEventListener('click', (e) => {
|
||||
e.preventDefault()
|
||||
send()
|
||||
})
|
||||
|
||||
function send() {
|
||||
let form = new FormData(document.querySelector("form"));
|
||||
|
||||
let body = JSON.stringify(Object.fromEntries(form))
|
||||
|
||||
//fetch('<?php echo $API_URL;?>/api/v1/user/add', {
|
||||
// credentials: 'include',
|
||||
// headers: {
|
||||
// 'Content-Type': 'application/json',
|
||||
// },
|
||||
// method: 'POST',
|
||||
// body: body,
|
||||
//})
|
||||
.then(res => {
|
||||
console.log(res)
|
||||
console.log(res.json())
|
||||
|
||||
})
|
||||
.then(data => {
|
||||
console.log(data)
|
||||
})
|
||||
.catch(err => {
|
||||
console.log(err)
|
||||
})
|
||||
}
|
||||
</script>
|
||||
|
Reference in New Issue
Block a user