diff --git a/backend/src/routes.rs b/backend/src/routes.rs index 8b36e76..066420e 100644 --- a/backend/src/routes.rs +++ b/backend/src/routes.rs @@ -64,6 +64,18 @@ async fn builder_get() -> Result { Ok(Template::render("mapbuilder", &context)) } +#[get("/frontend/index.html")] +async fn visualizer_get() -> Result { + let context = Context::new("Visualizer", None); + Ok(Template::render("visualizer", &context)) +} + +#[get("/visualizer")] +async fn visualizer_get_bis() -> Result { + let context = Context::new("Visualizer", None); + Ok(Template::render("visualizer", &context)) +} + #[get("/maps/")] async fn map_get(file: String) -> Result { let mut content = String::new(); @@ -74,5 +86,5 @@ async fn map_get(file: String) -> Result { } pub fn fuel(routes: &mut Vec) { - routes.extend(routes![files, index, map_post, map_get, maps_get, builder_get]); + routes.extend(routes![files, index, map_post, map_get, maps_get, builder_get, visualizer_get, visualizer_get_bis]); } diff --git a/backend/src/util.rs b/backend/src/util.rs index e034da3..ce961ce 100644 --- a/backend/src/util.rs +++ b/backend/src/util.rs @@ -1,7 +1,7 @@ use async_std::prelude::*; use async_std::fs; -static NAV: [(&'static str, &'static str); 3] = [("/", "Home"), ("/lobby", "Lobby"), ("/mapbuilder", "Map Builder")]; +static NAV: [(&'static str, &'static str); 4] = [("/", "Home"), ("/lobby", "Lobby"), ("/mapbuilder", "Map Builder"), ("/frontend/index.html", "Visualizer")]; #[derive(Serialize)] pub struct Map { diff --git a/backend/static/frontend b/backend/static/frontend new file mode 120000 index 0000000..ef93659 --- /dev/null +++ b/backend/static/frontend @@ -0,0 +1 @@ +../../frontend/www/frontend \ No newline at end of file diff --git a/backend/static/static b/backend/static/static new file mode 120000 index 0000000..89ec7c4 --- /dev/null +++ b/backend/static/static @@ -0,0 +1 @@ +../../frontend/www/static/ \ No newline at end of file diff --git a/backend/static/style/base.css b/backend/static/style/base.css index a5df373..b257e35 100644 --- a/backend/static/style/base.css +++ b/backend/static/style/base.css @@ -43,4 +43,16 @@ body { display: flex; flex-direction: column; align-items: stretch; -} \ No newline at end of file +} + +.content { + height: 100%; + width: 100%; + display: flex; + justify-content: center; + background: black; + color: #ff7f00; + line-height: 1.5rem; + overflow: hidden; + align-items: center; +} diff --git a/backend/static/style/visualizer.css b/backend/static/style/visualizer.css new file mode 120000 index 0000000..f875154 --- /dev/null +++ b/backend/static/style/visualizer.css @@ -0,0 +1 @@ +../../../frontend/www/static/res/style.css \ No newline at end of file diff --git a/backend/templates/base.html.tera b/backend/templates/base.html.tera index 9ad9ea5..cd0659a 100644 --- a/backend/templates/base.html.tera +++ b/backend/templates/base.html.tera @@ -3,8 +3,8 @@ Planetwars - - + +