From 80006d33410c3dff01ccae3d2e3e61446f003221 Mon Sep 17 00:00:00 2001 From: Theo Beers <32523293+theodore-s-beers@users.noreply.github.com> Date: Tue, 26 Apr 2022 14:19:41 +0200 Subject: [PATCH] Update font and styles --- .prettierignore | 1 + Cargo.lock | 12 ++++++------ Cargo.toml | 2 +- head.html | 5 +++-- pretty.js | 2 +- src/main.rs | 2 +- styles.css | 20 +++++++++++++++----- 7 files changed, 28 insertions(+), 16 deletions(-) create mode 100644 .prettierignore diff --git a/.prettierignore b/.prettierignore new file mode 100644 index 0000000..b83d222 --- /dev/null +++ b/.prettierignore @@ -0,0 +1 @@ +/target/ diff --git a/Cargo.lock b/Cargo.lock index 28818df..5ff6dd7 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -247,9 +247,9 @@ dependencies = [ [[package]] name = "anyhow" -version = "1.0.56" +version = "1.0.57" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4361135be9122e0870de935d7c439aef945b9f9ddd4199a553b5270b49c82a27" +checksum = "08f9b8508dccb7687a1d6c4ce66b2b0ecef467c94667de27d8d7fe1f8d2a9cdc" [[package]] name = "askama_escape" @@ -768,9 +768,9 @@ checksum = "e2abad23fbc42b3700f2f279844dc832adb2b2eb069b2df918f455c4e18cc646" [[package]] name = "libc" -version = "0.2.123" +version = "0.2.124" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cb691a747a7ab48abc15c5b42066eaafde10dc427e3b6ee2a1cf43db04c763bd" +checksum = "21a41fed9d98f27ab1c6d161da622a4fa35e8a54a8adc24bbf3ddd0ef70b0e50" [[package]] name = "libnghttp2-sys" @@ -1303,9 +1303,9 @@ checksum = "42657b1a6f4d817cda8e7a0ace261fe0cc946cf3a80314390b22cc61ae080792" [[package]] name = "tinyvec" -version = "1.5.1" +version = "1.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2c1c1d5a42b6245520c249549ec267180beaffcc0615401ac8e31853d4b6d8d2" +checksum = "87cc5ceb3875bb20c2890005a4e226a4651264a5c75edb2421b52861a0a0cb50" dependencies = [ "tinyvec_macros", ] diff --git a/Cargo.toml b/Cargo.toml index bbbe1bf..35f5a7b 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -11,7 +11,7 @@ categories = ["internationalization", "template-engine", "text-processing"] [dependencies] actix-files = "0.6.0" actix-web = "4.0.1" -anyhow = "1.0.56" +anyhow = "1.0.57" isahc = "1.7.0" serde = { version = "1.0.136", features = ["derive"] } serde_json = "1.0.79" diff --git a/head.html b/head.html index c4256d9..fa41069 100644 --- a/head.html +++ b/head.html @@ -1,6 +1,7 @@ - + + diff --git a/pretty.js b/pretty.js index 4807287..031f120 100644 --- a/pretty.js +++ b/pretty.js @@ -76,7 +76,7 @@ function pretty() { // Iterate over hemistichs, calculating width of each for (const element of allHems) { const testText = element.innerText; - const hemWidth = getTextWidth(testText, "x-large Scheherazade"); + const hemWidth = getTextWidth(testText, "20px 'Scheherazade New'"); // If this hemistich's width is a new maximum, update if (hemWidth > maxWidth) { diff --git a/src/main.rs b/src/main.rs index a614d5a..33996a0 100644 --- a/src/main.rs +++ b/src/main.rs @@ -35,7 +35,7 @@ async fn main() -> std::io::Result<()> { #[get("/")] async fn hello() -> impl Responder { - HttpResponse::Ok().body("Hello world!") + HttpResponse::Ok().body("Hello!") } #[get("/robots.txt")] diff --git a/styles.css b/styles.css index d3b2fb6..41e4e89 100644 --- a/styles.css +++ b/styles.css @@ -1,16 +1,26 @@ +*, +*::before, +*::after { + box-sizing: border-box; +} + +* { + margin: 0; +} + :root { --hemistich-width: auto; } body { - margin: auto; - max-width: calc((var(--hemistich-width) * 2) + 10ch); - padding: 2ch 1ch; + margin: 1.5rem auto; + max-width: calc((var(--hemistich-width) * 2) + 12ch); + padding: 0 1ch; } p { - font-family: Scheherazade, serif; - font-size: x-large; + font-family: "Scheherazade New", serif; + font-size: 20px; margin: 0; text-align-last: justify; }