1
0
forked from fr/deguapp

some design improvments

This commit is contained in:
Filip Rojek 2023-10-24 01:28:16 +02:00
parent 02e8cf1cd3
commit 110ba61112
8 changed files with 115 additions and 6 deletions

28
frontend/css/_general.css Normal file
View File

@ -0,0 +1,28 @@
*{
padding: 0;
margin: 0;
box-sizing: border-box;
}
body {
font-family: OpenSans;
padding: 0 0.5rem;
}
.flex {
display: flex;
}
.f-row {
display: flex;
flex-direction: row;
}
.f-col {
display: flex;
flex-direction: column;
}
footer {
display: none;
}

View File

View File

@ -0,0 +1,3 @@
.main-wrapper h1 {
text-align: center;
}

8
frontend/css/nav.css Normal file
View File

@ -0,0 +1,8 @@
.nav-wrapper {
justify-content: space-between;
padding: 1rem 0.5rem;
}
a {
color: black;
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 188 KiB

View File

@ -11,7 +11,9 @@
// Date Time Zone
date_default_timezone_set('Europe/Prague');
$API_URL = "http://localhost:6060"
$API_URL = "http://localhost:6060";
$LOGGEDIN = !false;
?>
<!DOCTYPE html>
@ -20,22 +22,34 @@
<title>DeguApp</title>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link href="home.css" rel="stylesheet">
<link href="/css/_general.css" rel="stylesheet">
<link href="/css/_variables.css" rel="stylesheet">
<link href="/css/nav.css" rel="stylesheet">
<link href="/css/home.css" rel="stylesheet">
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
<link href="https://fonts.googleapis.com/css2?family=Open+Sans:ital,wght@0,400;0,500;0,700;1,400;1,500;1,700&display=swap" rel="stylesheet">
</head>
<body>
<header>
<div class="flex-left">
<header class="f-row nav-wrapper">
<div class="">
<a href="/">DeguApp</a>
</div>
<div class="flex-left">
<div class="">
<?php
if(!$LOGGEDIN) {
?>
<a href="/login">Přihlásit se</a>
<a href="/signup">Registrace</a>
<?php
} else{
?>
<a href="/add_beer">Přidat pivo</a>
<a href="/add_review">Přidat recenzi</a>
<?php } ?>
</div>
</header>
<section class="main-wrapper">
<h1>DeguApp</h1>
<!-- routing shits -->
<?php
$R = new Router();
$R->route('GET', '/', 'home');

View File

@ -0,0 +1,5 @@
<h1>DeguApp</h1>
<center>
<img src="/img/tabornici_logo.png" alt="tabornici logo" width="60%">
</center>

View 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>