diff --git a/src/web/pages/index.rs b/src/web/pages/index.rs index 6e7548b5d..ec80cd351 100644 --- a/src/web/pages/index.rs +++ b/src/web/pages/index.rs @@ -7,8 +7,9 @@ pub(crate) fn build() -> Router { Router::new() - .route("/", get(index)) - .route(&format!("{}/", crate::ROUTE_PREFIX), get(index)) + .route("/", get(get_index)) + .route(&format!("{}/", crate::ROUTE_PREFIX), get(get_index)) + .route(&format!("{}/_book", crate::ROUTE_PREFIX), get(get_book)) } template! { @@ -18,7 +19,7 @@ struct Index<'a> use "index.html.j2" { } } -async fn index( +async fn get_index( State(services): State, Extension(context): Extension, ) -> Result { @@ -28,3 +29,11 @@ async fn index( services.firstrun.is_first_run(), )) } + +template! { + struct Book use "book.html.j2" {} +} + +async fn get_book(Extension(context): Extension) -> Result { + response!(Book::new(context)) +} diff --git a/src/web/pages/mod.rs b/src/web/pages/mod.rs index b7d5eed86..a623e46d8 100644 --- a/src/web/pages/mod.rs +++ b/src/web/pages/mod.rs @@ -76,8 +76,9 @@ struct $name:ident $(<$lifetime:lifetime>)? use $path:literal { ) => { #[derive(Debug, askama::Template)] #[template(path = $path)] + #[allow(unused)] struct $name$(<$lifetime>)? { - context: $crate::pages::TemplateContext, + context: $crate::pages::TemplateContext, $($field_name: $field_type,)* } diff --git a/src/web/pages/resources/book.css b/src/web/pages/resources/book.css new file mode 100644 index 000000000..2d3bf969d --- /dev/null +++ b/src/web/pages/resources/book.css @@ -0,0 +1,22 @@ +html { + height: 100svh; + --bg: oklch(0.44 0.177 353.06); + background-color: var(--bg); + background-image: linear-gradient(180deg, var(--bg) 55%, black 100%);; +} + +main { + margin-top: 20vh; + margin-left: 5%; + margin-right: 5%; + color: white; + font-family: monospace; + font-size: 1.3em; + line-height: 1.2; +} + +em { + font-size: 1.35em; + font-weight: bold; + white-space: nowrap; +} diff --git a/src/web/pages/templates/book.html.j2 b/src/web/pages/templates/book.html.j2 new file mode 100644 index 000000000..9120b4583 --- /dev/null +++ b/src/web/pages/templates/book.html.j2 @@ -0,0 +1,23 @@ + + + + + The Book of Matrix, 4:15 + + + + + + + + +
+ And the Conduit was greatly diminished, and it Rusted slowly in the dark, and its builders + were scattered to the four corners of the Network, and all seemed to be lost for those + who would stand against the Great Homogeneous Mind of the Federation. But lo! + From its corpse there formed a New Coalition, a team to Continue the legacy of the Conduit, + and their works pushed back the Synapses of the Great Mind, and illuminated the darkest corners + of the Specification, for the betterment of the Network at large. ◈ +
+ + diff --git a/src/web/pages/templates/register.html.j2 b/src/web/pages/templates/register.html.j2 index 67f189885..ebec39cf7 100644 --- a/src/web/pages/templates/register.html.j2 +++ b/src/web/pages/templates/register.html.j2 @@ -80,7 +80,8 @@ Sign up {% if !is_first_run %} {% endif %} {% when RegisterBody::DetailsPrompt { username, require_email, flow, terms, validation_errors } %}