You've already forked AstralRinth
forked from didirus/AstralRinth
Final push before rewrite
This commit is contained in:
@@ -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
|
This is the API backend for Modrinth!
|
||||||
in progress mod distribution site.
|
|
||||||
|
|
||||||
More information coming soon.
|
Documentation coming soon.
|
||||||
@@ -1,5 +1,13 @@
|
|||||||
use actix_web::{get, web, HttpResponse};
|
use actix_web::{get, post, web, HttpResponse};
|
||||||
use handlebars::*;
|
use handlebars::*;
|
||||||
|
use serde::Deserialize;
|
||||||
|
|
||||||
|
#[derive(Deserialize)]
|
||||||
|
struct CreatedMod {
|
||||||
|
name: String,
|
||||||
|
description: String,
|
||||||
|
body: String,
|
||||||
|
}
|
||||||
|
|
||||||
#[get("createmod")]
|
#[get("createmod")]
|
||||||
pub async fn mod_create_get(hb: web::Data<Handlebars<'_>>) -> HttpResponse {
|
pub async fn mod_create_get(hb: web::Data<Handlebars<'_>>) -> HttpResponse {
|
||||||
@@ -8,5 +16,15 @@ pub async fn mod_create_get(hb: web::Data<Handlebars<'_>>) -> HttpResponse {
|
|||||||
});
|
});
|
||||||
let body = hb.render("mod-create", &data).unwrap();
|
let body = hb.render("mod-create", &data).unwrap();
|
||||||
|
|
||||||
|
HttpResponse::Ok().body(body)
|
||||||
|
}
|
||||||
|
|
||||||
|
#[post("createmod")]
|
||||||
|
pub async fn mod_create_post(hb: web::Data<Handlebars<'_>>) -> HttpResponse {
|
||||||
|
let data = json!({
|
||||||
|
"name": "Handlebars"
|
||||||
|
});
|
||||||
|
let body = hb.render("mod-create", &data).unwrap();
|
||||||
|
|
||||||
HttpResponse::Ok().body(body)
|
HttpResponse::Ok().body(body)
|
||||||
}
|
}
|
||||||
@@ -57,31 +57,11 @@
|
|||||||
|
|
||||||
@media (prefers-color-scheme: dark) {
|
@media (prefers-color-scheme: dark) {
|
||||||
[data-theme="light"] {
|
[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"] {
|
: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;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -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) {
|
function closePopup(e) {
|
||||||
e.parentElement.outerHTML = "";
|
e.parentElement.outerHTML = "";
|
||||||
}
|
}
|
||||||
@@ -26,6 +26,7 @@
|
|||||||
<a href="mods">mods</a>
|
<a href="mods">mods</a>
|
||||||
<a href="modpacks">modpacks</a>
|
<a href="modpacks">modpacks</a>
|
||||||
<a href="about">about</a>
|
<a href="about">about</a>
|
||||||
|
<input type="checkbox" onchange="switchThemes()">
|
||||||
</div>
|
</div>
|
||||||
</header>
|
</header>
|
||||||
|
|
||||||
@@ -150,7 +151,8 @@
|
|||||||
<div class="version-scroll" id="releases" style="display: none">
|
<div class="version-scroll" id="releases" style="display: none">
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div> <script src="/static/js/main.js"></script>
|
||||||
|
|
||||||
|
|
||||||
<div class="version-type">
|
<div class="version-type">
|
||||||
<p class="version-type-label" onclick="toggleVisibility(this)">[+] Snapshots</p>
|
<p class="version-type-label" onclick="toggleVisibility(this)">[+] Snapshots</p>
|
||||||
|
|||||||
Reference in New Issue
Block a user