diff --git a/dist/favicon.ico b/dist/favicon.ico new file mode 100644 index 0000000..4afef56 Binary files /dev/null and b/dist/favicon.ico differ diff --git a/dist/favicon.jpg b/dist/favicon.jpg new file mode 100644 index 0000000..262f8b8 Binary files /dev/null and b/dist/favicon.jpg differ diff --git a/dist/index.html b/dist/index.html index db3247b..bdad888 100644 --- a/dist/index.html +++ b/dist/index.html @@ -193,9 +193,9 @@ select { /* 1 */ */ button, -[type="button"], -[type="reset"], -[type="submit"] { +[type="button"], +[type="reset"], +[type="submit"] { -webkit-appearance: button; } @@ -204,9 +204,9 @@ button, */ button::-moz-focus-inner, -[type="button"]::-moz-focus-inner, -[type="reset"]::-moz-focus-inner, -[type="submit"]::-moz-focus-inner { +[type="button"]::-moz-focus-inner, +[type="reset"]::-moz-focus-inner, +[type="submit"]::-moz-focus-inner { border-style: none; padding: 0; } @@ -216,9 +216,9 @@ button::-moz-focus-inner, */ button:-moz-focusring, -[type="button"]:-moz-focusring, -[type="reset"]:-moz-focusring, -[type="submit"]:-moz-focusring { +[type="button"]:-moz-focusring, +[type="reset"]:-moz-focusring, +[type="submit"]:-moz-focusring { outline: 1px dotted ButtonText; } @@ -267,8 +267,8 @@ textarea { * 2. Remove the padding in IE 10. */ -[type="checkbox"], -[type="radio"] { +[type="checkbox"], +[type="radio"] { box-sizing: border-box; /* 1 */ padding: 0; /* 2 */ } @@ -277,8 +277,8 @@ textarea { * Correct the cursor style of increment and decrement buttons in Chrome. */ -[type="number"]::-webkit-inner-spin-button, -[type="number"]::-webkit-outer-spin-button { +[type="number"]::-webkit-inner-spin-button, +[type="number"]::-webkit-outer-spin-button { height: auto; } @@ -287,7 +287,7 @@ textarea { * 2. Correct the outline style in Safari. */ -[type="search"] { +[type="search"] { -webkit-appearance: textfield; /* 1 */ outline-offset: -2px; /* 2 */ } @@ -296,7 +296,7 @@ textarea { * Remove the inner padding in Chrome and Safari on macOS. */ -[type="search"]::-webkit-search-decoration { +[type="search"]::-webkit-search-decoration { -webkit-appearance: none; } @@ -348,7 +348,8 @@ template { display: none; } -

logan's site


me

- I am a programming and philosophy - enthusiast. Once upon a time i was a - competitive debater on a few local and - state circuits. After over 10 years of - doing robotics I'm finally starting to - get the hang of it. Currently in the - process of discovering my love for - hypertext and the world wide web! -

migration

- I am currently in the process of migrating my git repositories - and portfolio to be entirely self hosted. Some features and - integrations are still a work in progress. Fishbowl will return soon! -
\ No newline at end of file + I am a programming and philosophy + enthusiast. Once upon a time i was a + competitive debater on a few local and + state circuits. After over 10 years of + doing robotics I'm finally starting to + get the hang of it. Currently in the + process of discovering my love for + hypertext and the world wide web! +

migration

+ I am currently in the process of migrating my git repositories + and portfolio to be entirely self hosted. Some features and + integrations are still a work in progress. Fishbowl will return soon! +

portfolio

\ No newline at end of file diff --git a/dist/projects/fishbowl.html b/dist/projects/fishbowl.html new file mode 100644 index 0000000..ee03d45 --- /dev/null +++ b/dist/projects/fishbowl.html @@ -0,0 +1,498 @@ +logan's site

fishbowl

+ Choose an image and click submit. The image will be sent and processed by + my server, so be mindful of what you submit. No logs or copies of the + input are preserved. +




\ No newline at end of file diff --git a/src/fishbowl.js b/src/fishbowl.js new file mode 100644 index 0000000..084a142 --- /dev/null +++ b/src/fishbowl.js @@ -0,0 +1,20 @@ +const form = document.getElementById("fishForm"); +const image = document.getElementById("fishImage"); + +form.onsubmit = async (ev) => { + ev.preventDefault(); + image.src = ""; + try { + const file = document.getElementById("fishFile").files[0]; + const arrayBuf = await file.arrayBuffer(); + const response = await fetch("/api/fishbowl", { + method: 'POST', + body: arrayBuf, + }); + const blob = await response.blob(); + image.src = URL.createObjectURL(blob); + } catch (error) { + console.log(error); + } +} + diff --git a/src/homepage.rs b/src/homepage.rs new file mode 100644 index 0000000..b55c502 --- /dev/null +++ b/src/homepage.rs @@ -0,0 +1,64 @@ +use crate::*; + +fn prow(name: &str, desc: &str, _date: &str, link: &str) -> Markup { + html! { + tr { + td { a href=(link) { (name) } } + td { (desc) } + } + } +} + +pub fn index() -> Markup { + template(html! { + h1 {"logan's site"} + hr; + div .flex { + div .half { + h2 {"me"} + " + I am a programming and philosophy + enthusiast. Once upon a time i was a + competitive debater on a few local and + state circuits. After over 10 years of + doing robotics I'm finally starting to + get the hang of it. Currently in the + process of discovering my love for + hypertext and the world wide web! + " + h2 {"migration"} + " + I am currently in the process of migrating my git repositories + and portfolio to be entirely self hosted. Some features and + integrations are still a work in progress. Fishbowl will return soon! + " + } + div .half { + h2 {"portfolio"} + ul { + li { + a href="https://git.lgatlin.dev/logan" { "my git server" } + } + li { + a href="https://git.lgatlin.dev/logan/http-server" { "http web server" } + } + li { + a href="https://git.lgatlin.dev/logan/html-templater" { "html templating language" } + } + li { + a href="https://git.lgatlin.dev/logan/fishbowl" { "kinematic image processing" } + } + li { + a href="https://git.lgatlin.dev/logan/forte" { "stack based assembly language" } + } + li { + a href="https://git.lgatlin.dev/logan/nrange" { "n dimensional cartesian product" } + } + li { + a href="https://git.lgatlin.dev/logan/stocks" { "stock trading algorithm" } + } + } + } + } + }) +} diff --git a/src/index.js b/src/index.js deleted file mode 100644 index e69de29..0000000 diff --git a/src/main.css b/src/main.css index b1b956f..420a38c 100644 --- a/src/main.css +++ b/src/main.css @@ -69,7 +69,7 @@ code { text-align: center; } -.twocols{ +.twocols { display: inline-block; columns: 2; text-align: left; diff --git a/src/main.rs b/src/main.rs index db0165d..4cfb852 100644 --- a/src/main.rs +++ b/src/main.rs @@ -1,9 +1,9 @@ +mod homepage; +mod projects; + use maud::*; use std::fs::File; use std::io::prelude::*; -use sysinfo::*; - -const MB: u64 = 1048576; fn head() -> Markup { html! { @@ -12,8 +12,11 @@ fn head() -> Markup { meta name="viewport" content="width=device-width, initial-scale=1.0"; meta http-equiv="X-UA-Compatible" content="ie=edge"; title { "logan's site" }; - style { (include_str!("normalize.css")) } - style { (PreEscaped(include_str!("main.css"))) } + style { + (PreEscaped(include_str!("normalize.css"))) + "\n" + (PreEscaped(include_str!("main.css"))) + } } } } @@ -24,73 +27,19 @@ fn template(inner: Markup) -> Markup { html { (head()) body { - (inner) - } - } - } -} - -fn prow(name: &str, desc: &str, date: &str, link: &str) -> Markup { - html! { - tr { - td { a href=(link) { (name) } } - td { (desc) } - } - } -} - -fn index() -> Markup { - let mut sys = System::new_all(); - let system_name = System::name().unwrap(); - let used_mem = sys.used_memory() / MB; - let total_mem = sys.total_memory() / MB; - let load_avg = System::load_average(); - sys.refresh_all(); - template(html! { - div .container .flex { - main .tile .big { - h1 {"logan's site"} - hr; - div .flex { - div .half { - h2 {"me"} - " - I am a programming and philosophy - enthusiast. Once upon a time i was a - competitive debater on a few local and - state circuits. After over 10 years of - doing robotics I'm finally starting to - get the hang of it. Currently in the - process of discovering my love for - hypertext and the world wide web! - " - h2 {"migration"} - " - I am currently in the process of migrating my git repositories - and portfolio to be entirely self hosted. Some features and - integrations are still a work in progress. Fishbowl will return soon! - " - } - div .half { - h2 {"portfolio"} - ul { - li { a href="https://git.lgatlin.dev/" { "my git server" } } - li { a href="https://git.lgatlin.dev/logan/http-server" { "http web server" } } - li { a href="https://git.lgatlin.dev/logan/html-templater" { "html templating language" } } - li { a href="https://git.lgatlin.dev/logan/fishbowl" { "kinematic image processing" } } - li { a href="https://git.lgatlin.dev/logan/forte" { "stack based assembly language" }} - li { a href="https://git.lgatlin.dev/logan/nrange" { "n dimensional cartesian product" }} - li { a href="https://git.lgatlin.dev/logan/stocks" { "stock trading algorithm" }} - } + div .container .flex { + main .tile .big { + (inner) } } } } - }) + } } fn main() -> std::io::Result<()> { - make_page("index", index())?; + make_page("index", homepage::index())?; + make_page("projects/fishbowl", projects::fishbowl())?; Ok(()) } diff --git a/src/projects.rs b/src/projects.rs new file mode 100644 index 0000000..f88cfb6 --- /dev/null +++ b/src/projects.rs @@ -0,0 +1,26 @@ +use crate::*; + +pub fn fishbowl() -> Markup { + template(html! { + h1 {"fishbowl"} + p { + " + Choose an image and click submit. The image will be sent and processed by + my server, so be mindful of what you submit. No logs or copies of the + input are preserved. + " + } + form #fishForm { + label for="file" {"Select an image:"} + br; + input #fishFile accept="image/*" name="image" type="file"; + br; + input value="Run Fishbowl" type="submit"; + } + br; + img #fishImage width="480" height="480"; + script { + (PreEscaped(include_str!("fishbowl.js"))) + } + }) +}