-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
14 changed files
with
1,699 additions
and
52 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,54 @@ | ||
|
||
|
||
|
||
.fixed-container{ | ||
height: 300px; | ||
padding-bottom: 3px; | ||
} | ||
|
||
.sidebar{ | ||
margin: 0; | ||
padding: 0; | ||
width: 100px; | ||
height: 100%; | ||
} | ||
|
||
.flexcontainer{ | ||
display: flex; | ||
flex-direction: row; | ||
} | ||
|
||
.border{ | ||
border-style: solid; | ||
border-width: 2px; | ||
border-color: white; | ||
} | ||
|
||
.full{ | ||
width: 100%; | ||
height: 100%; | ||
} | ||
|
||
.nowrap{ | ||
white-space: nowrap; | ||
} | ||
|
||
.left-margin{ | ||
margin-left: 70px; | ||
} | ||
|
||
.skill-tag { | ||
display: inline-block; | ||
padding: 0.2rem 0.8rem; | ||
margin: 0.2rem; | ||
background: var(--primary); | ||
color: var(--primary-inverse); | ||
border-radius: 20px; | ||
font-size: 0.9rem; | ||
} | ||
.interests { | ||
background: var(--card-background-color); | ||
padding: 1rem; | ||
border-radius: var(--border-radius); | ||
} | ||
|
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
use maud::{html, Markup}; | ||
|
||
#[allow(dead_code)] | ||
pub fn list_of(any_vec: Vec<Markup>) -> Markup { | ||
html! { | ||
div { | ||
@for m in &any_vec { | ||
div { (m) } | ||
} | ||
} | ||
} | ||
} | ||
|
||
#[allow(dead_code)] | ||
pub fn grid_of(any_vec: Vec<Markup>) -> Markup { | ||
html! { | ||
div .container { | ||
div class="grid"{ | ||
@for m in &any_vec { | ||
div { (m) } | ||
} | ||
} | ||
} | ||
} | ||
} | ||
|
||
pub fn nav_button_with_class(text: &str, path: &str, class: &str) -> Markup { | ||
html! { | ||
button class=(class) hx-get=(path) hx-target="#body" { (text) } | ||
} | ||
} |
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,73 @@ | ||
|
||
|
||
|
||
:root { | ||
--pico-font-family-sans-serif: Inter, system-ui, "Segoe UI", Roboto, Oxygen, Ubuntu, Cantarell, Helvetica, Arial, "Helvetica Neue", sans-serif, var(--pico-font-family-emoji); | ||
--pico-font-size: 87.5%; | ||
/* Original: 100% */ | ||
--pico-line-height: 1.25; | ||
/* Original: 1.5 */ | ||
--pico-form-element-spacing-vertical: 0.5rem; | ||
/* Original: 1rem */ | ||
--pico-form-element-spacing-horizontal: 1.0rem; | ||
/* Original: 1.25rem */ | ||
--pico-border-radius: 0.375rem; | ||
/* Original: 0.25rem */ | ||
} | ||
|
||
@media (min-width: 576px) { | ||
:root { | ||
--pico-font-size: 87.5%; | ||
/* Original: 106.25% */ | ||
} | ||
} | ||
|
||
@media (min-width: 768px) { | ||
:root { | ||
--pico-font-size: 87.5%; | ||
/* Original: 112.5% */ | ||
} | ||
} | ||
|
||
@media (min-width: 1024px) { | ||
:root { | ||
--pico-font-size: 87.5%; | ||
/* Original: 118.75% */ | ||
} | ||
} | ||
|
||
@media (min-width: 1280px) { | ||
:root { | ||
--pico-font-size: 87.5%; | ||
/* Original: 125% */ | ||
} | ||
} | ||
|
||
@media (min-width: 1536px) { | ||
:root { | ||
--pico-font-size: 87.5%; | ||
/* Original: 131.25% */ | ||
} | ||
} | ||
|
||
h1, | ||
h2, | ||
h3, | ||
h4, | ||
h5, | ||
h6 { | ||
--pico-font-weight: 600; | ||
/* Original: 700 */ | ||
} | ||
|
||
article { | ||
border: 1px solid var(--pico-muted-border-color); | ||
/* Original doesn't have a border */ | ||
border-radius: calc(var(--pico-border-radius) * 2); | ||
/* Original: var(--pico-border-radius) */ | ||
} | ||
|
||
article>footer { | ||
border-radius: calc(var(--pico-border-radius) * 2); | ||
/* Original: var(--pico-border-radius) */ | ||
} |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
use rocket::{response::content, Build, Rocket}; | ||
|
||
#[get("/pico.violet.min.css")] | ||
fn pico_code() -> content::RawCss<&'static str> { | ||
let pico = include_str!("../../assets/pico.violet.min.css"); | ||
content::RawCss(pico) | ||
} | ||
|
||
#[get("/app.css")] | ||
fn app_css() -> content::RawCss<&'static str> { | ||
let app = include_str!("../../assets/app.css"); | ||
content::RawCss(app) | ||
} | ||
|
||
#[get("/htmx.min.js")] | ||
fn htmx_code() -> content::RawJavaScript<&'static str> { | ||
let app = include_str!("../../assets/htmx.min.js"); | ||
content::RawJavaScript(app) | ||
} | ||
|
||
#[get("/pico_ext.css")] | ||
fn pico_ext_css() -> content::RawCss<&'static str> { | ||
let app = include_str!("../../assets/pico_ext.css"); | ||
content::RawCss(app) | ||
} | ||
|
||
pub fn mount_assets(rocket: Rocket<Build>) -> Rocket<Build> { | ||
rocket.mount( | ||
"/_assets", | ||
routes![htmx_code, app_css, pico_code, pico_ext_css,], | ||
) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,30 @@ | ||
fn main() { | ||
println!("Hello, world!"); | ||
use rocket::{Build, Rocket}; | ||
|
||
#[macro_use] | ||
extern crate rocket; | ||
|
||
mod assets; | ||
mod view; | ||
|
||
#[launch] | ||
fn rocket() -> _ { | ||
let port = 12500; | ||
let address = "0.0.0.0"; | ||
|
||
let config = rocket::Config::figment() | ||
.merge(("port", port)) | ||
.merge(("address", address)); | ||
let rocket = rocket::custom(config); | ||
|
||
webbrowser::open(&format!("http://{}:{}", address, port)).unwrap_or_default(); | ||
mount(rocket) | ||
} | ||
|
||
fn mount(rocket: Rocket<Build>) -> Rocket<Build> { | ||
let with_index = rocket.mount( | ||
"/", | ||
routes![view::index, view::nav::get, view::dashboard::get,], | ||
); | ||
|
||
assets::mount_assets(with_index) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
use maud::{html, Markup}; | ||
|
||
#[allow(dead_code)] | ||
pub fn list_of(any_vec: Vec<Markup>) -> Markup { | ||
html! { | ||
div { | ||
@for m in &any_vec { | ||
div { (m) } | ||
} | ||
} | ||
} | ||
} | ||
|
||
#[allow(dead_code)] | ||
pub fn grid_of(any_vec: Vec<Markup>) -> Markup { | ||
html! { | ||
div .container { | ||
div class="grid"{ | ||
@for m in &any_vec { | ||
div { (m) } | ||
} | ||
} | ||
} | ||
} | ||
} | ||
|
||
pub fn nav_button_with_class(text: &str, path: &str, class: &str) -> Markup { | ||
html! { | ||
button class=(class) hx-get=(path) hx-target="#body" { (text) } | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
use maud::html; | ||
use rocket::response::content; | ||
|
||
#[get("/dashboard")] | ||
pub fn get() -> content::RawHtml<String> { | ||
let raw = html! { | ||
|
||
|
||
article { | ||
|
||
header { | ||
h2 { "Dashboard" } | ||
|
||
} | ||
|
||
} | ||
|
||
body{ | ||
div { | ||
// GitHub | ||
h3 { "GitHub" } | ||
} | ||
} | ||
|
||
|
||
footer { | ||
p{ | ||
"This is a work in progress." | ||
} | ||
} | ||
|
||
} | ||
.into_string(); | ||
content::RawHtml(raw) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,60 @@ | ||
use maud::{html, Markup, PreEscaped}; | ||
use rocket::response::content; | ||
|
||
mod components; | ||
pub mod dashboard; | ||
pub mod nav; | ||
|
||
#[get("/")] | ||
pub fn index() -> content::RawHtml<String> { | ||
let raw = page(html! { | ||
header { | ||
// load nav always | ||
div hx-get="/nav" hx-trigger="load" {} | ||
// load home first | ||
div hx-get="/dashboard" hx-trigger="load" hx-target="#body" {} | ||
} | ||
|
||
body { | ||
div #body {} | ||
} | ||
}) | ||
.into_string(); | ||
content::RawHtml(raw) | ||
} | ||
|
||
const CSS: &str = r#"<link rel="stylesheet" href="_assets/app.css">"#; | ||
const PICO_EXT: &str = r#"<link rel="stylesheet" href="_assets/pico_ext.css">"#; | ||
const HTMX: &str = r#"<script src="/_assets/htmx.min.js"></script>"#; | ||
const PICO: &str = r#"<link rel="stylesheet" href="_assets/pico.violet.min.css">"#; | ||
|
||
pub fn page(markup: Markup) -> Markup { | ||
html! { | ||
html { | ||
|
||
head { | ||
({scripts()}) | ||
({title("Candle")}) | ||
} | ||
|
||
body class="container" { | ||
(markup) | ||
} | ||
} | ||
} | ||
} | ||
|
||
fn scripts() -> Markup { | ||
html! { | ||
(PreEscaped(CSS)) | ||
(PreEscaped(HTMX)) | ||
(PreEscaped(PICO_EXT)) | ||
(PreEscaped(PICO)) | ||
} | ||
} | ||
|
||
fn title(title: impl Into<String>) -> Markup { | ||
html! { | ||
title { ({title.into()}) } | ||
} | ||
} |
Oops, something went wrong.