Better system + main page debut

This commit is contained in:
2024-09-09 23:34:18 +02:00
parent 6c96cae51d
commit ccc632a418
6 changed files with 72 additions and 3 deletions

2
.gitignore vendored Normal file
View File

@@ -0,0 +1,2 @@
/target
*.env

18
Cargo.toml Normal file
View File

@@ -0,0 +1,18 @@
[package]
name = "vote"
version = "0.1.0"
edition = "2021"
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
[dependencies]
tokio = { version = "1.40.0", features = ["macros", "rt-multi-thread"]}
hyper = { version = "1.4.1", features = ["server", "http1"] }
hyper-util = { version = "0.1.8", features = ["tokio"]}
sqlx = { version = "0.8.2", features = ["runtime-tokio"] }
tokio-io = "0.2.0-alpha.6"
dotenvy = "0.15.7"
bytes = "1.7.1"
http-body-util = "0.1.2"
serde_json = "1.0.128"
log = "0.4.22"

3
routes.json Normal file
View File

@@ -0,0 +1,3 @@
{
"/": "static/html/index.html"
}

View File

@@ -1,3 +1,25 @@
h1 {
color: red;
body {
background-color: #11111b;
padding:0;
margin:0;
}
.footer {
margin: 0;
position: fixed;
bottom: 0;
width: 100%;
display: flex;
background-color: #b4befe;
justify-content: center;
}
.footer > a {
padding: 10px;
margin: 5px;
background-color: #94e2d5;
border-radius: 5px;
color: #1e1e2e;
font-family: "Segoe UI";
font-size: 20px;
}

View File

@@ -1,10 +1,18 @@
<!doctype html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<script src="static/js/index.js" defer="true"></script>
<title>VOTE!</title>
<link rel="stylesheet" href="static/css/index.css">
</head>
<body>
<h1>Bonjour cher voyageur</h1>
<div id="app" class="app"></div>
<div id="footer" class="footer">
<a href="/">Voter</a>
<a href="/results">Résultats</a>
<a href="/archives">Archives</a>
</div>
</body>
</html>

16
static/js/index.js Normal file
View File

@@ -0,0 +1,16 @@
App = {
div: document.getElementById("app"),
current_page: 0,
vote_plus_id: null,
vote_plus_nickname: null,
vote_plus_reason: null,
vote_moins_id: null,
vote_moins_nickname: null,
vote_moins_reason: null
}
load_page(App["current_page"])
function load_page(id) {
console.log("He he")
}