Skip to content

Commit

Permalink
Update font and styles
Browse files Browse the repository at this point in the history
  • Loading branch information
theodore-s-beers committed Apr 26, 2022
1 parent 7a05036 commit 80006d3
Show file tree
Hide file tree
Showing 7 changed files with 28 additions and 16 deletions.
1 change: 1 addition & 0 deletions .prettierignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
/target/
12 changes: 6 additions & 6 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
5 changes: 3 additions & 2 deletions head.html
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
<link rel="preconnect" href="https://fonts.gstatic.com" />
<link rel="preconnect" href="https://fonts.googleapis.com" />
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin />
<link
href="https://fonts.googleapis.com/css2?family=Scheherazade&display=swap"
href="https://fonts.googleapis.com/css2?family=Scheherazade+New&display=swap"
rel="stylesheet"
/>
<link rel="stylesheet" href="/styles.css" />
Expand Down
2 changes: 1 addition & 1 deletion pretty.js
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down
2 changes: 1 addition & 1 deletion src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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")]
Expand Down
20 changes: 15 additions & 5 deletions styles.css
Original file line number Diff line number Diff line change
@@ -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;
}
Expand Down

0 comments on commit 80006d3

Please sign in to comment.