Change the default font + other little things
authorGreg Burri <greg.burri@gmail.com>
Tue, 12 May 2020 21:14:42 +0000 (23:14 +0200)
committerGreg Burri <greg.burri@gmail.com>
Tue, 12 May 2020 21:14:42 +0000 (23:14 +0200)
16 files changed:
.gitignore
backend/build.rs [new file with mode: 0644]
backend/src/db.rs
backend/src/main.rs
backend/static/FiraCode-Bold.woff2 [new file with mode: 0644]
backend/static/FiraCode-Light.woff2 [new file with mode: 0644]
backend/static/FiraCode-Medium.woff2 [new file with mode: 0644]
backend/static/FiraCode-Regular.woff2 [new file with mode: 0644]
backend/static/FiraCode-SemiBold.woff2 [new file with mode: 0644]
backend/static/Roobert-Bold.woff2 [deleted file]
backend/static/Roobert-Regular.woff2 [deleted file]
backend/static/Roobert-SemiBold.woff2 [deleted file]
backend/static/style.css [deleted file]
backend/style.scss [new file with mode: 0644]
backend/templates/main.html
deploy.ps1

index fad3c58..566e501 100644 (file)
@@ -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 (file)
index 0000000..c5f9e2e
--- /dev/null
@@ -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
index 6458c7e..a2066b8 100644 (file)
@@ -45,4 +45,8 @@ impl Connection {
             |row| Ok(dbg!("test"))\r
         )\r
     }\r
+\r
+    pub fn get_all_recipes() {\r
+\r
+    }\r
 }
\ No newline at end of file
index c043f7a..4c0d698 100644 (file)
@@ -27,7 +27,7 @@ pub struct Request {
 
 fn main_page(query: Query<Request>) -> HttpResponse {
 
-    let main_template = MainTemplate { test: &"*** test ***" };
+    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 (file)
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 (file)
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 (file)
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 (file)
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 (file)
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 (file)
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 (file)
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 (file)
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 (file)
index 45f5f2f..0000000
+++ /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 (file)
index 0000000..6ea838d
--- /dev/null
@@ -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
index 1d00b6e..c93dd65 100644 (file)
@@ -12,5 +12,6 @@
             <h1>{{ test }}</h1>
         </div>
         <p>Text to test the new font.</p>
+        <p>=> [|1, 2, 3|] <-</p>
     </body>
 </html>
\ No newline at end of file
index da77557..5a11697 100644 (file)
@@ -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"