From: Greg Burri Date: Tue, 12 May 2020 21:14:42 +0000 (+0200) Subject: Change the default font + other little things X-Git-Url: http://git.euphorik.ch/?p=recipes.git;a=commitdiff_plain;h=3ebbe8172b0430bae5c554925a4582c9fec545f3 Change the default font + other little things --- diff --git a/.gitignore b/.gitignore index fad3c58..566e501 100644 --- a/.gitignore +++ b/.gitignore @@ -2,3 +2,4 @@ target **/*.rs.bk backend/data/recipes.sqlite /deploy-to-pi.ps1 +style.css.map \ No newline at end of file diff --git a/backend/build.rs b/backend/build.rs new file mode 100644 index 0000000..c5f9e2e --- /dev/null +++ b/backend/build.rs @@ -0,0 +1,11 @@ +use std::process::Command; + +fn main() { + println!("cargo:rerun-if-changed=style.scss"); + + Command::new("sass") + .arg("./style.scss") + .arg("./static/style.css") + .output() + .expect("Unable to compile SASS file, install SASS, see https://sass-lang.com/"); +} \ No newline at end of file diff --git a/backend/src/db.rs b/backend/src/db.rs index 6458c7e..a2066b8 100644 --- a/backend/src/db.rs +++ b/backend/src/db.rs @@ -45,4 +45,8 @@ impl Connection { |row| Ok(dbg!("test")) ) } + + pub fn get_all_recipes() { + + } } \ No newline at end of file diff --git a/backend/src/main.rs b/backend/src/main.rs index c043f7a..4c0d698 100644 --- a/backend/src/main.rs +++ b/backend/src/main.rs @@ -27,7 +27,7 @@ pub struct Request { fn main_page(query: Query) -> HttpResponse { - let main_template = MainTemplate { test: &"*** test 2 ***" }; + let main_template = MainTemplate { test: &"*** test ***" }; let s = main_template.render().unwrap(); HttpResponse::Ok().content_type("text/html").body(s) diff --git a/backend/static/FiraCode-Bold.woff2 b/backend/static/FiraCode-Bold.woff2 new file mode 100644 index 0000000..d8b3179 Binary files /dev/null and b/backend/static/FiraCode-Bold.woff2 differ diff --git a/backend/static/FiraCode-Light.woff2 b/backend/static/FiraCode-Light.woff2 new file mode 100644 index 0000000..9cb6aee Binary files /dev/null and b/backend/static/FiraCode-Light.woff2 differ diff --git a/backend/static/FiraCode-Medium.woff2 b/backend/static/FiraCode-Medium.woff2 new file mode 100644 index 0000000..dfeb9de Binary files /dev/null and b/backend/static/FiraCode-Medium.woff2 differ diff --git a/backend/static/FiraCode-Regular.woff2 b/backend/static/FiraCode-Regular.woff2 new file mode 100644 index 0000000..1979211 Binary files /dev/null and b/backend/static/FiraCode-Regular.woff2 differ diff --git a/backend/static/FiraCode-SemiBold.woff2 b/backend/static/FiraCode-SemiBold.woff2 new file mode 100644 index 0000000..ecec57d Binary files /dev/null and b/backend/static/FiraCode-SemiBold.woff2 differ diff --git a/backend/static/Roobert-Bold.woff2 b/backend/static/Roobert-Bold.woff2 deleted file mode 100644 index 77c344b..0000000 Binary files a/backend/static/Roobert-Bold.woff2 and /dev/null differ diff --git a/backend/static/Roobert-Regular.woff2 b/backend/static/Roobert-Regular.woff2 deleted file mode 100644 index ae13580..0000000 Binary files a/backend/static/Roobert-Regular.woff2 and /dev/null differ diff --git a/backend/static/Roobert-SemiBold.woff2 b/backend/static/Roobert-SemiBold.woff2 deleted file mode 100644 index 7dd8607..0000000 Binary files a/backend/static/Roobert-SemiBold.woff2 and /dev/null differ diff --git a/backend/static/style.css b/backend/static/style.css deleted file mode 100644 index 45f5f2f..0000000 --- a/backend/static/style.css +++ /dev/null @@ -1,23 +0,0 @@ -@font-face{font-family: Roobert; font-weight:400; src:url(Roobert-Regular.woff2) format("woff2"); } -@font-face{font-family:Roobert; font-weight:600; src:url(Roobert-SemiBold.woff2) format("woff2"); } -@font-face{font-family:Roobert; font-weight:700; src:url(Roobert-Bold.woff2) format("woff2"); } - -* { - margin: 50px; - padding: 0px; -} - -body { - font-size: 18px; - font-family: Roobert, Helvetica Neue, Helvetica, Arial, sans-serif; - text-shadow: 2px 2px 2px rgb(0, 0, 0); - text-align: center; - line-height: 18px; - color: rgb(255, 255, 255); - background-color: rgb(24, 24, 27); - margin: 0px; -} - -img { - border: 0px; -} \ No newline at end of file diff --git a/backend/style.scss b/backend/style.scss new file mode 100644 index 0000000..6ea838d --- /dev/null +++ b/backend/style.scss @@ -0,0 +1,24 @@ +@font-face{font-family: Fira Code; font-weight:200; src:url(FiraCode-Light.woff2) format("woff2"); } +@font-face{font-family: Fira Code; font-weight:400; src:url(FiraCode-Regular.woff2) format("woff2"); } +@font-face{font-family: Fira Code; font-weight:600; src:url(FiraCode-SemiBold.woff2) format("woff2"); } +@font-face{font-family: Fira Code; font-weight:700; src:url(FiraCode-Bold.woff2) format("woff2"); } + +* { + margin: 50px; + padding: 0px; +} + +body { + font-size: 18px; + font-family: Fira Code, Helvetica Neue, Helvetica, Arial, sans-serif; + text-shadow: 2px 2px 2px rgb(0, 0, 0); + text-align: center; + line-height: 18px; + color: rgb(255, 255, 255); + background-color: rgb(24, 24, 27); + margin: 0px; +} + +img { + border: 0px; +} \ No newline at end of file diff --git a/backend/templates/main.html b/backend/templates/main.html index 1d00b6e..c93dd65 100644 --- a/backend/templates/main.html +++ b/backend/templates/main.html @@ -12,5 +12,6 @@

{{ test }}

Text to test the new font.

+

=> [|1, 2, 3|] <-

\ No newline at end of file diff --git a/deploy.ps1 b/deploy.ps1 index da77557..5a11697 100644 --- a/deploy.ps1 +++ b/deploy.ps1 @@ -31,13 +31,15 @@ function Copy-SSH([string]$source, [string]$destination) cargo build --target arm-unknown-linux-gnueabihf --release -# $a = Invoke-Expression ($ssh_command + "ls") -Invoke-SSH("sudo systemctl stop recipes") +Invoke-SSH "sudo systemctl stop recipes" Copy-SSH -source "./target/arm-unknown-linux-gnueabihf/release/recipes" -destination "~/recipes/" + +Invoke-SSH "rm -rf recipes/static" Copy-SSH -source "./backend/static/" -destination "~/recipes/" -Invoke-SSH("chmod u+x recipes/recipes") -Invoke-SSH("sudo systemctl start recipes") +Invoke-SSH "chmod u+x recipes/recipes" +Invoke-SSH "strip recipes/recipes" +Invoke-SSH "sudo systemctl start recipes" Write-Output "Deployment finished"