diff --git a/README.md b/README.md index 8aaf71440..6747342be 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,5 @@ -# Fabricate +# Labrinth -Welcome to Fabricate (the temporary name I'm calling this until I come up with a good one)! This is an open source work -in progress mod distribution site. +This is the API backend for Modrinth! -More information coming soon. \ No newline at end of file +Documentation coming soon. \ No newline at end of file diff --git a/src/routes/mod_create.rs b/src/routes/mod_create.rs index aa549e387..c4630825a 100644 --- a/src/routes/mod_create.rs +++ b/src/routes/mod_create.rs @@ -1,5 +1,13 @@ -use actix_web::{get, web, HttpResponse}; +use actix_web::{get, post, web, HttpResponse}; use handlebars::*; +use serde::Deserialize; + +#[derive(Deserialize)] +struct CreatedMod { + name: String, + description: String, + body: String, +} #[get("createmod")] pub async fn mod_create_get(hb: web::Data>) -> HttpResponse { @@ -8,5 +16,15 @@ pub async fn mod_create_get(hb: web::Data>) -> HttpResponse { }); let body = hb.render("mod-create", &data).unwrap(); + HttpResponse::Ok().body(body) +} + +#[post("createmod")] +pub async fn mod_create_post(hb: web::Data>) -> HttpResponse { + let data = json!({ + "name": "Handlebars" + }); + let body = hb.render("mod-create", &data).unwrap(); + HttpResponse::Ok().body(body) } \ No newline at end of file diff --git a/static/css/main.css b/static/css/main.css index 34fa6dc65..35cf42cc5 100644 --- a/static/css/main.css +++ b/static/css/main.css @@ -57,31 +57,11 @@ @media (prefers-color-scheme: dark) { [data-theme="light"] { - --background: #f3f2f0; - --highlight: #0b75d8; - --border: #a9a9a9; - --mod-bar: #fefefe; - --content-background: white; - --nav-background: #dfdfdf; - --content-text: black; - --header-text: black; - --white-text: white; - --muted: gray; - --forge-color: #1e2d44; + } :root, [data-theme="dark"] { - --background: #1b1b1b; - --highlight: #0b75d8; - --border: #1d1d1d; - --mod-bar: #222222; - --content-background: rgb(34, 34, 34); - --nav-background: #252525; - --content-text: rgb(241, 241, 241); - --header-text: rgb(241, 241, 241); - --white-text: white; - --muted: gray; - --forge-color: white; + } } diff --git a/static/js/main.js b/static/js/main.js index c27362134..639634458 100644 --- a/static/js/main.js +++ b/static/js/main.js @@ -4,6 +4,13 @@ window.onload = function () { } } +function switchThemes() { + let switchTheme = localStorage.getItem("data-theme") === "light" ? "dark" : "light"; + + localStorage.setItem("data-theme", switchTheme); + document.documentElement.setAttribute("data-theme", switchTheme); +} + function closePopup(e) { e.parentElement.outerHTML = ""; } \ No newline at end of file diff --git a/templates/search.hbs b/templates/search.hbs index 4b90f6fa9..522b9c1eb 100644 --- a/templates/search.hbs +++ b/templates/search.hbs @@ -26,6 +26,7 @@ mods modpacks about + @@ -150,7 +151,8 @@ - + +

[+] Snapshots