From ccc632a4186d4cb7aa77932f400b9e374c59eacc Mon Sep 17 00:00:00 2001 From: AINDUSTRIES Date: Mon, 9 Sep 2024 23:34:18 +0200 Subject: [PATCH] Better system + main page debut --- .gitignore | 2 ++ Cargo.toml | 18 ++++++++++++++++++ routes.json | 3 +++ static/css/index.css | 26 ++++++++++++++++++++++++-- static/html/index.html | 10 +++++++++- static/js/index.js | 16 ++++++++++++++++ 6 files changed, 72 insertions(+), 3 deletions(-) create mode 100644 .gitignore create mode 100644 Cargo.toml create mode 100644 routes.json create mode 100644 static/js/index.js diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..90fcc0c --- /dev/null +++ b/.gitignore @@ -0,0 +1,2 @@ +/target +*.env diff --git a/Cargo.toml b/Cargo.toml new file mode 100644 index 0000000..b1162b5 --- /dev/null +++ b/Cargo.toml @@ -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" \ No newline at end of file diff --git a/routes.json b/routes.json new file mode 100644 index 0000000..fb74a8f --- /dev/null +++ b/routes.json @@ -0,0 +1,3 @@ +{ + "/": "static/html/index.html" +} \ No newline at end of file diff --git a/static/css/index.css b/static/css/index.css index 4717ad4..1cbd8f9 100644 --- a/static/css/index.css +++ b/static/css/index.css @@ -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; } \ No newline at end of file diff --git a/static/html/index.html b/static/html/index.html index fc512ca..b306a65 100644 --- a/static/html/index.html +++ b/static/html/index.html @@ -1,10 +1,18 @@ + + + VOTE! -

Bonjour cher voyageur

+
+ \ No newline at end of file diff --git a/static/js/index.js b/static/js/index.js new file mode 100644 index 0000000..d26ad9f --- /dev/null +++ b/static/js/index.js @@ -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") +} \ No newline at end of file