Better system + main page debut
This commit is contained in:
2
.gitignore
vendored
Normal file
2
.gitignore
vendored
Normal file
@@ -0,0 +1,2 @@
|
|||||||
|
/target
|
||||||
|
*.env
|
||||||
18
Cargo.toml
Normal file
18
Cargo.toml
Normal 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
3
routes.json
Normal file
@@ -0,0 +1,3 @@
|
|||||||
|
{
|
||||||
|
"/": "static/html/index.html"
|
||||||
|
}
|
||||||
@@ -1,3 +1,25 @@
|
|||||||
h1 {
|
body {
|
||||||
color: red;
|
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;
|
||||||
}
|
}
|
||||||
@@ -1,10 +1,18 @@
|
|||||||
<!doctype html>
|
<!doctype html>
|
||||||
<html lang="en">
|
<html lang="en">
|
||||||
<head>
|
<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>
|
<title>VOTE!</title>
|
||||||
<link rel="stylesheet" href="static/css/index.css">
|
<link rel="stylesheet" href="static/css/index.css">
|
||||||
</head>
|
</head>
|
||||||
<body>
|
<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>
|
</body>
|
||||||
</html>
|
</html>
|
||||||
16
static/js/index.js
Normal file
16
static/js/index.js
Normal 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")
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user