diff --git a/Cargo.lock b/Cargo.lock index 00e9889..7e1f459 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -341,6 +341,15 @@ dependencies = [ "num-traits", ] +[[package]] +name = "bincode" +version = "1.3.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b1f45e9417d87227c7a56d22e471c6206462cba514c7590c09aff4cf6d1ddcad" +dependencies = [ + "serde", +] + [[package]] name = "bitflags" version = "1.3.2" @@ -611,6 +620,15 @@ version = "2.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "19d374276b40fb8bbdee95aef7c7fa6b5316ec764510eb64b8dd0e2ed0d7e7f5" +[[package]] +name = "crc32fast" +version = "1.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b3855a8a784b474f333699ef2bbca9db2c4a1f6d9088a90a2d25b1eb53111eaa" +dependencies = [ + "cfg-if", +] + [[package]] name = "crossbeam-channel" version = "0.5.12" @@ -792,7 +810,7 @@ checksum = "1ee447700ac8aa0b2f2bd7bc4462ad686ba06baa6727ac149a2d6277f0d240fd" dependencies = [ "cfg-if", "libc", - "redox_syscall", + "redox_syscall 0.4.1", "windows-sys 0.52.0", ] @@ -828,6 +846,16 @@ dependencies = [ "percent-encoding", ] +[[package]] +name = "fs2" +version = "0.4.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9564fc758e15025b46aa6643b1b77d047d1a56a1aea6e01002ac0c7026876213" +dependencies = [ + "libc", + "winapi", +] + [[package]] name = "fsevent-sys" version = "4.1.0" @@ -892,7 +920,7 @@ checksum = "1d930c203dd0b6ff06e0201a4a2fe9149b43c684fd4420555b26d21b1a02956f" dependencies = [ "futures-core", "lock_api", - "parking_lot", + "parking_lot 0.12.1", ] [[package]] @@ -942,6 +970,15 @@ dependencies = [ "slab", ] +[[package]] +name = "fxhash" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c31b6d751ae2c7f11320402d34e41349dd1016f8d5d45e48c4312bc8625af50c" +dependencies = [ + "byteorder", +] + [[package]] name = "generic-array" version = "0.14.7" @@ -1244,6 +1281,15 @@ dependencies = [ "libc", ] +[[package]] +name = "instant" +version = "0.1.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7a5bbe824c507c5da5956355e86a746d82e0e1464f65d862cc5e71da70e94b2c" +dependencies = [ + "cfg-if", +] + [[package]] name = "itertools" version = "0.12.1" @@ -1457,7 +1503,7 @@ dependencies = [ "crossbeam-utils", "futures-util", "once_cell", - "parking_lot", + "parking_lot 0.12.1", "quanta", "rustc_version", "skeptic", @@ -1633,6 +1679,17 @@ version = "0.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b15813163c1d831bf4a13c3610c05c0d03b39feb07f7e09fa234dac9b15aaf39" +[[package]] +name = "parking_lot" +version = "0.11.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7d17b78036a60663b797adeaee46f5c9dfebb86948d1255007a1d6be0271ff99" +dependencies = [ + "instant", + "lock_api", + "parking_lot_core 0.8.6", +] + [[package]] name = "parking_lot" version = "0.12.1" @@ -1640,7 +1697,21 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3742b2c103b9f06bc9fff0a37ff4912935851bee6d36f3c02bcc755bcfec228f" dependencies = [ "lock_api", - "parking_lot_core", + "parking_lot_core 0.9.9", +] + +[[package]] +name = "parking_lot_core" +version = "0.8.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "60a2cfe6f0ad2bfc16aefa463b497d5c7a5ecd44a23efa72aa342d90177356dc" +dependencies = [ + "cfg-if", + "instant", + "libc", + "redox_syscall 0.2.16", + "smallvec", + "winapi", ] [[package]] @@ -1651,7 +1722,7 @@ checksum = "4c42a9226546d68acdd9c0a280d17ce19bfe27a46bf68784e4066115788d008e" dependencies = [ "cfg-if", "libc", - "redox_syscall", + "redox_syscall 0.4.1", "smallvec", "windows-targets 0.48.5", ] @@ -1730,6 +1801,7 @@ dependencies = [ "axum", "axum-htmx", "axum-login", + "bincode", "clap", "dotenvy", "env_logger", @@ -1738,6 +1810,7 @@ dependencies = [ "rand", "sea-orm", "serde", + "sled", "thiserror", "tokio", "tower-http", @@ -1929,6 +2002,15 @@ dependencies = [ "bitflags 2.4.2", ] +[[package]] +name = "redox_syscall" +version = "0.2.16" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fb5a58c1855b4b6819d59012155603f0b22ad30cad752600aadfcb695265519a" +dependencies = [ + "bitflags 1.3.2", +] + [[package]] name = "redox_syscall" version = "0.4.1" @@ -2430,6 +2512,22 @@ dependencies = [ "autocfg", ] +[[package]] +name = "sled" +version = "0.34.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7f96b4737c2ce5987354855aed3797279def4ebf734436c6aa4552cf8e169935" +dependencies = [ + "crc32fast", + "crossbeam-epoch", + "crossbeam-utils", + "fs2", + "fxhash", + "libc", + "log", + "parking_lot 0.11.2", +] + [[package]] name = "smallvec" version = "1.13.1" @@ -2884,7 +2982,7 @@ dependencies = [ "libc", "mio", "num_cpus", - "parking_lot", + "parking_lot 0.12.1", "pin-project-lite", "signal-hook-registry", "socket2", @@ -2972,7 +3070,7 @@ dependencies = [ "cookie", "futures-util", "http", - "parking_lot", + "parking_lot 0.12.1", "pin-project-lite", "tower-layer", "tower-service", @@ -3044,7 +3142,7 @@ dependencies = [ "base64 0.22.0", "futures", "http", - "parking_lot", + "parking_lot 0.12.1", "rand", "serde", "serde_json", @@ -3363,7 +3461,7 @@ version = "1.5.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a44ab49fad634e88f55bf8f9bb3abd2f27d7204172a112c7c9987e01c1c94ea9" dependencies = [ - "redox_syscall", + "redox_syscall 0.4.1", "wasite", ] diff --git a/Cargo.toml b/Cargo.toml index 1851036..fcd4b84 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -13,6 +13,7 @@ async-trait = "0.1.78" axum = "0.7.4" axum-htmx = { version = "0.5.0", features = ["guards", "serde"] } axum-login = "0.14.0" +bincode = "1.3.3" clap = { version = "4.5.3", features = ["derive", "env"] } dotenvy = "0.15.7" env_logger = "0.11.3" @@ -21,6 +22,7 @@ minijinja-autoreload = "1.0.14" rand = "0.8.5" sea-orm = { version = "0.12.15", features = ["sqlx-sqlite", "macros", "runtime-tokio-rustls"] } serde = { version = "1.0.197", features = ["derive"] } +sled = "0.34.7" thiserror = "1.0.58" tokio = { version = "1.36.0", features = ["rt", "full"] } tower-http = { version = "0.5.2", features = ["fs", "trace"] } diff --git a/src/handler/home.rs b/src/handler/home.rs index 79b6c26..8268cc4 100644 --- a/src/handler/home.rs +++ b/src/handler/home.rs @@ -1,12 +1,28 @@ use axum::response::Redirect; use axum_login::AuthSession; -use crate::prelude::*; +use crate::{models::Project, prelude::*}; pub async fn home_page(State(ctx): State, auth_session: AuthSession) -> Response { if let Some(user) = auth_session.user { + let projects: Vec = vec![ + Project { + id: 1, + owner_id: 1, + name: "Blog posts".to_owned(), + key: "BLOG".to_owned(), + }, + Project { + id: 2, + owner_id: 1, + name: "Bugs (Pique)".to_owned(), + key: "BUG".to_owned(), + }, + ]; + let values = context! { user => user, + projects => projects, }; ctx.render_resp("home.html", values) diff --git a/src/lib.rs b/src/lib.rs index c3aac44..a8fe969 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -4,8 +4,10 @@ pub mod db; pub mod entity; pub mod handler; pub mod logging; +pub mod models; pub mod password; pub mod prelude; +pub mod serialize; pub mod server; pub mod session; pub mod templates; diff --git a/src/models.rs b/src/models.rs new file mode 100644 index 0000000..bfd9d34 --- /dev/null +++ b/src/models.rs @@ -0,0 +1,23 @@ +use serde::{Deserialize, Serialize}; + +#[derive(Debug, Serialize, Deserialize, PartialEq)] +pub struct Project { + pub id: u64, + pub owner_id: i32, + + pub name: String, + + // The key is the short code, like BUG, which is used to refer to a project + // quickly and to display it more compactly. This must be unique across the + // projects a user owns. + pub key: String, +} + +#[derive(Debug, Serialize, Deserialize, PartialEq)] +pub struct Document { + pub id: u64, + pub project_id: u64, + + pub title: String, + pub content: String, +} diff --git a/src/serialize.rs b/src/serialize.rs new file mode 100644 index 0000000..7d790f8 --- /dev/null +++ b/src/serialize.rs @@ -0,0 +1,16 @@ +use bincode::{DefaultOptions, Options}; +use serde::{Deserialize, Serialize}; + +fn bincode_options() -> impl Options { + DefaultOptions::new().with_big_endian() +} + +pub fn serialize(value: &T) -> Result, bincode::Error> { + let options = bincode_options(); + options.serialize(value) +} + +pub fn deserialize<'a, T: Deserialize<'a>>(bytes: &'a [u8]) -> Result { + let options = bincode_options(); + options.deserialize(bytes) +} diff --git a/static/main.css b/static/main.css index fc4e466..7610f70 100644 --- a/static/main.css +++ b/static/main.css @@ -560,84 +560,15 @@ video { position: fixed; } -.absolute { - position: absolute; -} - -.relative { - position: relative; -} - -.sticky { - position: sticky; -} - -.inset-0 { - inset: 0px; -} - -.-inset-0 { - inset: -0px; -} - -.-inset-0\.5 { - inset: -0.125rem; -} - -.-inset-1 { - inset: -0.25rem; -} - -.-inset-1\.5 { - inset: -0.375rem; -} - .inset-y-0 { top: 0px; bottom: 0px; } -.left-0 { - left: 0px; -} - -.right-0 { - right: 0px; -} - -.left-full { - left: 100%; -} - -.top-0 { - top: 0px; -} - -.z-10 { - z-index: 10; -} - -.z-40 { - z-index: 40; -} - .z-50 { z-index: 50; } -.-m-2 { - margin: -0.5rem; -} - -.-m-2\.5 { - margin: -0.625rem; -} - -.mx-auto { - margin-left: auto; - margin-right: auto; -} - .-mx-2 { margin-left: -0.5rem; margin-right: -0.5rem; @@ -648,10 +579,6 @@ video { margin-right: -1.5rem; } -.ml-3 { - margin-left: 0.75rem; -} - .mt-10 { margin-top: 2.5rem; } @@ -664,82 +591,18 @@ video { margin-top: 1.5rem; } -.mb-6 { - margin-bottom: 1.5rem; -} - -.mt-1 { - margin-top: 0.25rem; -} - -.ml-auto { - margin-left: auto; -} - .mt-auto { margin-top: auto; } -.mr-16 { - margin-right: 4rem; -} - -.-mr-2 { - margin-right: -0.5rem; -} - -.ml-10 { - margin-left: 2.5rem; -} - -.ml-4 { - margin-left: 1rem; -} - -.mt-3 { - margin-top: 0.75rem; -} - .block { display: block; } -.inline-block { - display: inline-block; -} - .flex { display: flex; } -.inline-flex { - display: inline-flex; -} - -.grid { - display: grid; -} - -.hidden { - display: none; -} - -.h-full { - height: 100%; -} - -.h-10 { - height: 2.5rem; -} - -.h-4 { - height: 1rem; -} - -.h-5 { - height: 1.25rem; -} - .h-16 { height: 4rem; } @@ -752,20 +615,24 @@ video { height: 2rem; } -.min-h-screen { - min-height: 100vh; +.h-full { + height: 100%; } .min-h-full { min-height: 100%; } -.w-4 { - width: 1rem; +.w-6 { + width: 1.5rem; } -.w-5 { - width: 1.25rem; +.w-72 { + width: 18rem; +} + +.w-8 { + width: 2rem; } .w-auto { @@ -776,105 +643,22 @@ video { width: 100%; } -.w-48 { - width: 12rem; -} - -.w-6 { - width: 1.5rem; -} - -.w-8 { - width: 2rem; -} - -.w-9 { - width: 2.25rem; -} - -.w-16 { - width: 4rem; -} - .w-10 { width: 2.5rem; } -.min-w-max { - min-width: -moz-max-content; - min-width: max-content; -} - -.max-w-sm { - max-width: 24rem; -} - -.max-w-7xl { - max-width: 80rem; -} - -.max-w-xs { - max-width: 20rem; -} - .flex-1 { flex: 1 1 0%; } -.flex-shrink-0 { - flex-shrink: 0; -} - .shrink-0 { flex-shrink: 0; } -.grow-0 { - flex-grow: 0; -} - .grow { flex-grow: 1; } -.origin-top-right { - transform-origin: top right; -} - -.-translate-x-full { - --tw-translate-x: -100%; - transform: translate(var(--tw-translate-x), var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y)); -} - -.translate-x-0 { - --tw-translate-x: 0px; - transform: translate(var(--tw-translate-x), var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y)); -} - -.scale-100 { - --tw-scale-x: 1; - --tw-scale-y: 1; - transform: translate(var(--tw-translate-x), var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y)); -} - -.scale-95 { - --tw-scale-x: .95; - --tw-scale-y: .95; - transform: translate(var(--tw-translate-x), var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y)); -} - -.transform { - transform: translate(var(--tw-translate-x), var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y)); -} - -.grid-cols-2 { - grid-template-columns: repeat(2, minmax(0, 1fr)); -} - -.flex-row { - flex-direction: row; -} - .flex-col { flex-direction: column; } @@ -883,26 +667,10 @@ video { align-items: center; } -.items-baseline { - align-items: baseline; -} - .justify-center { justify-content: center; } -.justify-between { - justify-content: space-between; -} - -.gap-3 { - gap: 0.75rem; -} - -.gap-4 { - gap: 1rem; -} - .gap-x-3 { -moz-column-gap: 0.75rem; column-gap: 0.75rem; @@ -921,31 +689,16 @@ video { row-gap: 1.75rem; } -.gap-x-6 { - -moz-column-gap: 1.5rem; - column-gap: 1.5rem; -} - -.space-y-6 > :not([hidden]) ~ :not([hidden]) { - --tw-space-y-reverse: 0; - margin-top: calc(1.5rem * calc(1 - var(--tw-space-y-reverse))); - margin-bottom: calc(1.5rem * var(--tw-space-y-reverse)); -} - .space-y-1 > :not([hidden]) ~ :not([hidden]) { --tw-space-y-reverse: 0; margin-top: calc(0.25rem * calc(1 - var(--tw-space-y-reverse))); margin-bottom: calc(0.25rem * var(--tw-space-y-reverse)); } -.space-x-4 > :not([hidden]) ~ :not([hidden]) { - --tw-space-x-reverse: 0; - margin-right: calc(1rem * var(--tw-space-x-reverse)); - margin-left: calc(1rem * calc(1 - var(--tw-space-x-reverse))); -} - -.overflow-hidden { - overflow: hidden; +.space-y-6 > :not([hidden]) ~ :not([hidden]) { + --tw-space-y-reverse: 0; + margin-top: calc(1.5rem * calc(1 - var(--tw-space-y-reverse))); + margin-bottom: calc(1.5rem * var(--tw-space-y-reverse)); } .overflow-y-auto { @@ -958,18 +711,6 @@ video { white-space: nowrap; } -.whitespace-nowrap { - white-space: nowrap; -} - -.rounded { - border-radius: 0.25rem; -} - -.rounded-md { - border-radius: 0.375rem; -} - .rounded-full { border-radius: 9999px; } @@ -978,24 +719,28 @@ video { border-radius: 0.5rem; } -.border-0 { - border-width: 0px; +.rounded-md { + border-radius: 0.375rem; } .border { border-width: 1px; } -.border-t { - border-top-width: 1px; +.border-0 { + border-width: 0px; } -.border-b-2 { - border-bottom-width: 2px; +.border-2 { + border-width: 2px; } -.border-l-4 { - border-left-width: 4px; +.border-r { + border-right-width: 1px; +} + +.border-solid { + border-style: solid; } .border-gray-200 { @@ -1003,38 +748,19 @@ video { border-color: rgb(229 231 235 / var(--tw-border-opacity)); } -.border-gray-300 { +.border-indigo-600 { --tw-border-opacity: 1; - border-color: rgb(209 213 219 / var(--tw-border-opacity)); + border-color: rgb(79 70 229 / var(--tw-border-opacity)); } -.border-indigo-500 { - --tw-border-opacity: 1; - border-color: rgb(99 102 241 / var(--tw-border-opacity)); +.bg-emerald-600 { + --tw-bg-opacity: 1; + background-color: rgb(5 150 105 / var(--tw-bg-opacity)); } -.border-transparent { - border-color: transparent; -} - -.border-indigo-400 { - --tw-border-opacity: 1; - border-color: rgb(129 140 248 / var(--tw-border-opacity)); -} - -.border-indigo-700 { - --tw-border-opacity: 1; - border-color: rgb(67 56 202 / var(--tw-border-opacity)); -} - -.border-purple-700 { - --tw-border-opacity: 1; - border-color: rgb(126 34 206 / var(--tw-border-opacity)); -} - -.border-emerald-700 { - --tw-border-opacity: 1; - border-color: rgb(4 120 87 / var(--tw-border-opacity)); +.bg-gray-50 { + --tw-bg-opacity: 1; + background-color: rgb(249 250 251 / var(--tw-bg-opacity)); } .bg-purple-100 { @@ -1047,116 +773,30 @@ video { background-color: rgb(255 255 255 / var(--tw-bg-opacity)); } -.bg-indigo-600 { - --tw-bg-opacity: 1; - background-color: rgb(79 70 229 / var(--tw-bg-opacity)); -} - -.bg-pink-600 { - --tw-bg-opacity: 1; - background-color: rgb(219 39 119 / var(--tw-bg-opacity)); -} - -.bg-orange-600 { - --tw-bg-opacity: 1; - background-color: rgb(234 88 12 / var(--tw-bg-opacity)); -} - -.bg-green-600 { - --tw-bg-opacity: 1; - background-color: rgb(22 163 74 / var(--tw-bg-opacity)); -} - -.bg-emerald-600 { - --tw-bg-opacity: 1; - background-color: rgb(5 150 105 / var(--tw-bg-opacity)); -} - -.bg-gray-100 { - --tw-bg-opacity: 1; - background-color: rgb(243 244 246 / var(--tw-bg-opacity)); -} - -.bg-indigo-50 { - --tw-bg-opacity: 1; - background-color: rgb(238 242 255 / var(--tw-bg-opacity)); -} - -.bg-indigo-500 { - --tw-bg-opacity: 1; - background-color: rgb(99 102 241 / var(--tw-bg-opacity)); -} - -.bg-indigo-700 { - --tw-bg-opacity: 1; - background-color: rgb(67 56 202 / var(--tw-bg-opacity)); -} - -.bg-gray-900\/80 { - background-color: rgb(17 24 39 / 0.8); -} - -.bg-purple-600 { - --tw-bg-opacity: 1; - background-color: rgb(147 51 234 / var(--tw-bg-opacity)); -} - -.bg-purple-700 { - --tw-bg-opacity: 1; - background-color: rgb(126 34 206 / var(--tw-bg-opacity)); -} - -.bg-emerald-700 { - --tw-bg-opacity: 1; - background-color: rgb(4 120 87 / var(--tw-bg-opacity)); -} - -.bg-purple-200 { - --tw-bg-opacity: 1; - background-color: rgb(233 213 255 / var(--tw-bg-opacity)); -} - -.bg-purple-300 { - --tw-bg-opacity: 1; - background-color: rgb(216 180 254 / var(--tw-bg-opacity)); -} - -.bg-gray-200 { - --tw-bg-opacity: 1; - background-color: rgb(229 231 235 / var(--tw-bg-opacity)); -} - -.fill-\[\#24292F\] { - fill: #24292F; -} - -.p-1 { - padding: 0.25rem; -} - .p-2 { padding: 0.5rem; } -.p-2\.5 { - padding: 0.625rem; -} - -.py-12 { - padding-top: 3rem; - padding-bottom: 3rem; -} - .px-3 { padding-left: 0.75rem; padding-right: 0.75rem; } +.px-4 { + padding-left: 1rem; + padding-right: 1rem; +} + .px-6 { padding-left: 1.5rem; padding-right: 1.5rem; } +.px-8 { + padding-left: 2rem; + padding-right: 2rem; +} + .py-1 { padding-top: 0.25rem; padding-bottom: 0.25rem; @@ -1167,39 +807,14 @@ video { padding-bottom: 0.375rem; } -.py-2 { - padding-top: 0.5rem; - padding-bottom: 0.5rem; +.py-10 { + padding-top: 2.5rem; + padding-bottom: 2.5rem; } -.px-1 { - padding-left: 0.25rem; - padding-right: 0.25rem; -} - -.px-2 { - padding-left: 0.5rem; - padding-right: 0.5rem; -} - -.px-4 { - padding-left: 1rem; - padding-right: 1rem; -} - -.px-2\.5 { - padding-left: 0.625rem; - padding-right: 0.625rem; -} - -.py-0 { - padding-top: 0px; - padding-bottom: 0px; -} - -.py-0\.5 { - padding-top: 0.125rem; - padding-bottom: 0.125rem; +.py-12 { + padding-top: 3rem; + padding-bottom: 3rem; } .py-3 { @@ -1207,105 +822,35 @@ video { padding-bottom: 0.75rem; } -.py-10 { - padding-top: 2.5rem; - padding-bottom: 2.5rem; -} - -.py-4 { - padding-top: 1rem; - padding-bottom: 1rem; -} - -.px-5 { - padding-left: 1.25rem; - padding-right: 1.25rem; -} - -.py-6 { - padding-top: 1.5rem; - padding-bottom: 1.5rem; -} - -.pb-6 { - padding-bottom: 1.5rem; -} - -.pb-4 { - padding-bottom: 1rem; -} - -.pl-3 { - padding-left: 0.75rem; -} - -.pr-2 { - padding-right: 0.5rem; -} - -.pr-4 { - padding-right: 1rem; -} - -.pt-1 { - padding-top: 0.25rem; -} - -.pt-2 { - padding-top: 0.5rem; -} - -.pb-2 { - padding-bottom: 0.5rem; -} - -.pt-5 { - padding-top: 1.25rem; -} - -.pb-3 { - padding-bottom: 0.75rem; -} - -.pt-4 { - padding-top: 1rem; +.pl-72 { + padding-left: 18rem; } .text-center { text-align: center; } -.text-xl { - font-size: 1.25rem; - line-height: 1.75rem; -} - .text-2xl { font-size: 1.5rem; line-height: 2rem; } +.text-\[0\.625rem\] { + font-size: 0.625rem; +} + .text-sm { font-size: 0.875rem; line-height: 1.25rem; } -.text-base { - font-size: 1rem; - line-height: 1.5rem; -} - -.text-\[0\.625rem\] { - font-size: 0.625rem; -} - .text-xs { font-size: 0.75rem; line-height: 1rem; } -.text-lg { - font-size: 1.125rem; +.text-xl { + font-size: 1.25rem; line-height: 1.75rem; } @@ -1329,17 +874,18 @@ video { line-height: 2.25rem; } -.leading-5 { - line-height: 1.25rem; -} - .tracking-tight { letter-spacing: -0.025em; } -.text-gray-500 { +.text-gray-400 { --tw-text-opacity: 1; - color: rgb(107 114 128 / var(--tw-text-opacity)); + color: rgb(156 163 175 / var(--tw-text-opacity)); +} + +.text-gray-700 { + --tw-text-opacity: 1; + color: rgb(55 65 81 / var(--tw-text-opacity)); } .text-gray-900 { @@ -1357,100 +903,6 @@ video { color: rgb(255 255 255 / var(--tw-text-opacity)); } -.text-pink-600 { - --tw-text-opacity: 1; - color: rgb(219 39 119 / var(--tw-text-opacity)); -} - -.text-orange-600 { - --tw-text-opacity: 1; - color: rgb(234 88 12 / var(--tw-text-opacity)); -} - -.text-green-600 { - --tw-text-opacity: 1; - color: rgb(22 163 74 / var(--tw-text-opacity)); -} - -.text-emerald-600 { - --tw-text-opacity: 1; - color: rgb(5 150 105 / var(--tw-text-opacity)); -} - -.text-gray-400 { - --tw-text-opacity: 1; - color: rgb(156 163 175 / var(--tw-text-opacity)); -} - -.text-gray-700 { - --tw-text-opacity: 1; - color: rgb(55 65 81 / var(--tw-text-opacity)); -} - -.text-indigo-700 { - --tw-text-opacity: 1; - color: rgb(67 56 202 / var(--tw-text-opacity)); -} - -.text-indigo-200 { - --tw-text-opacity: 1; - color: rgb(199 210 254 / var(--tw-text-opacity)); -} - -.text-indigo-300 { - --tw-text-opacity: 1; - color: rgb(165 180 252 / var(--tw-text-opacity)); -} - -.text-purple-200 { - --tw-text-opacity: 1; - color: rgb(233 213 255 / var(--tw-text-opacity)); -} - -.text-purple-300 { - --tw-text-opacity: 1; - color: rgb(216 180 254 / var(--tw-text-opacity)); -} - -.text-emerald-200 { - --tw-text-opacity: 1; - color: rgb(167 243 208 / var(--tw-text-opacity)); -} - -.text-emerald-300 { - --tw-text-opacity: 1; - color: rgb(110 231 183 / var(--tw-text-opacity)); -} - -.text-gray-300 { - --tw-text-opacity: 1; - color: rgb(209 213 219 / var(--tw-text-opacity)); -} - -.text-black { - --tw-text-opacity: 1; - color: rgb(0 0 0 / var(--tw-text-opacity)); -} - -.text-gray-600 { - --tw-text-opacity: 1; - color: rgb(75 85 99 / var(--tw-text-opacity)); -} - -.opacity-0 { - opacity: 0; -} - -.opacity-100 { - opacity: 1; -} - -.shadow-lg { - --tw-shadow: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1); - --tw-shadow-colored: 0 10px 15px -3px var(--tw-shadow-color), 0 4px 6px -4px var(--tw-shadow-color); - box-shadow: var(--tw-ring-offset-shadow, 0 0 #0000), var(--tw-ring-shadow, 0 0 #0000), var(--tw-shadow); -} - .shadow { --tw-shadow: 0 1px 3px 0 rgb(0 0 0 / 0.1), 0 1px 2px -1px rgb(0 0 0 / 0.1); --tw-shadow-colored: 0 1px 3px 0 var(--tw-shadow-color), 0 1px 2px -1px var(--tw-shadow-color); @@ -1478,66 +930,6 @@ video { --tw-ring-color: rgb(209 213 219 / var(--tw-ring-opacity)); } -.ring-black { - --tw-ring-opacity: 1; - --tw-ring-color: rgb(0 0 0 / var(--tw-ring-opacity)); -} - -.ring-indigo-500 { - --tw-ring-opacity: 1; - --tw-ring-color: rgb(99 102 241 / var(--tw-ring-opacity)); -} - -.ring-opacity-5 { - --tw-ring-opacity: 0.05; -} - -.transition { - transition-property: color, background-color, border-color, text-decoration-color, fill, stroke, opacity, box-shadow, transform, filter, -webkit-backdrop-filter; - transition-property: color, background-color, border-color, text-decoration-color, fill, stroke, opacity, box-shadow, transform, filter, backdrop-filter; - transition-property: color, background-color, border-color, text-decoration-color, fill, stroke, opacity, box-shadow, transform, filter, backdrop-filter, -webkit-backdrop-filter; - transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1); - transition-duration: 150ms; -} - -.transition-opacity { - transition-property: opacity; - transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1); - transition-duration: 150ms; -} - -.duration-200 { - transition-duration: 200ms; -} - -.duration-75 { - transition-duration: 75ms; -} - -.duration-300 { - transition-duration: 300ms; -} - -.duration-100 { - transition-duration: 100ms; -} - -.ease-in { - transition-timing-function: cubic-bezier(0.4, 0, 1, 1); -} - -.ease-out { - transition-timing-function: cubic-bezier(0, 0, 0.2, 1); -} - -.ease-in-out { - transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1); -} - -.ease-linear { - transition-timing-function: linear; -} - .placeholder\:text-gray-400::-moz-placeholder { --tw-text-opacity: 1; color: rgb(156 163 175 / var(--tw-text-opacity)); @@ -1548,9 +940,9 @@ video { color: rgb(156 163 175 / var(--tw-text-opacity)); } -.hover\:border-gray-300:hover { - --tw-border-opacity: 1; - border-color: rgb(209 213 219 / var(--tw-border-opacity)); +.hover\:bg-emerald-500:hover { + --tw-bg-opacity: 1; + background-color: rgb(16 185 129 / var(--tw-bg-opacity)); } .hover\:bg-gray-50:hover { @@ -1558,93 +950,9 @@ video { background-color: rgb(249 250 251 / var(--tw-bg-opacity)); } -.hover\:bg-indigo-500:hover { - --tw-bg-opacity: 1; - background-color: rgb(99 102 241 / var(--tw-bg-opacity)); -} - -.hover\:bg-pink-500:hover { - --tw-bg-opacity: 1; - background-color: rgb(236 72 153 / var(--tw-bg-opacity)); -} - -.hover\:bg-orange-500:hover { - --tw-bg-opacity: 1; - background-color: rgb(249 115 22 / var(--tw-bg-opacity)); -} - -.hover\:bg-green-500:hover { - --tw-bg-opacity: 1; - background-color: rgb(34 197 94 / var(--tw-bg-opacity)); -} - -.hover\:bg-emerald-500:hover { - --tw-bg-opacity: 1; - background-color: rgb(16 185 129 / var(--tw-bg-opacity)); -} - -.hover\:bg-gray-100:hover { - --tw-bg-opacity: 1; - background-color: rgb(243 244 246 / var(--tw-bg-opacity)); -} - -.hover\:bg-indigo-700:hover { - --tw-bg-opacity: 1; - background-color: rgb(67 56 202 / var(--tw-bg-opacity)); -} - -.hover\:bg-purple-500:hover { - --tw-bg-opacity: 1; - background-color: rgb(168 85 247 / var(--tw-bg-opacity)); -} - -.hover\:bg-opacity-75:hover { - --tw-bg-opacity: 0.75; -} - -.hover\:text-indigo-500:hover { +.hover\:text-indigo-600:hover { --tw-text-opacity: 1; - color: rgb(99 102 241 / var(--tw-text-opacity)); -} - -.hover\:text-pink-500:hover { - --tw-text-opacity: 1; - color: rgb(236 72 153 / var(--tw-text-opacity)); -} - -.hover\:text-orange-500:hover { - --tw-text-opacity: 1; - color: rgb(249 115 22 / var(--tw-text-opacity)); -} - -.hover\:text-green-500:hover { - --tw-text-opacity: 1; - color: rgb(34 197 94 / var(--tw-text-opacity)); -} - -.hover\:text-emerald-500:hover { - --tw-text-opacity: 1; - color: rgb(16 185 129 / var(--tw-text-opacity)); -} - -.hover\:text-gray-500:hover { - --tw-text-opacity: 1; - color: rgb(107 114 128 / var(--tw-text-opacity)); -} - -.hover\:text-gray-700:hover { - --tw-text-opacity: 1; - color: rgb(55 65 81 / var(--tw-text-opacity)); -} - -.hover\:text-white:hover { - --tw-text-opacity: 1; - color: rgb(255 255 255 / var(--tw-text-opacity)); -} - -.focus\:outline-none:focus { - outline: 2px solid transparent; - outline-offset: 2px; + color: rgb(79 70 229 / var(--tw-text-opacity)); } .focus\:ring-2:focus { @@ -1657,57 +965,11 @@ video { --tw-ring-inset: inset; } -.focus\:ring-indigo-600:focus { - --tw-ring-opacity: 1; - --tw-ring-color: rgb(79 70 229 / var(--tw-ring-opacity)); -} - -.focus\:ring-pink-600:focus { - --tw-ring-opacity: 1; - --tw-ring-color: rgb(219 39 119 / var(--tw-ring-opacity)); -} - -.focus\:ring-orange-600:focus { - --tw-ring-opacity: 1; - --tw-ring-color: rgb(234 88 12 / var(--tw-ring-opacity)); -} - -.focus\:ring-green-600:focus { - --tw-ring-opacity: 1; - --tw-ring-color: rgb(22 163 74 / var(--tw-ring-opacity)); -} - .focus\:ring-emerald-600:focus { --tw-ring-opacity: 1; --tw-ring-color: rgb(5 150 105 / var(--tw-ring-opacity)); } -.focus\:ring-indigo-500:focus { - --tw-ring-opacity: 1; - --tw-ring-color: rgb(99 102 241 / var(--tw-ring-opacity)); -} - -.focus\:ring-white:focus { - --tw-ring-opacity: 1; - --tw-ring-color: rgb(255 255 255 / var(--tw-ring-opacity)); -} - -.focus\:ring-offset-2:focus { - --tw-ring-offset-width: 2px; -} - -.focus\:ring-offset-indigo-600:focus { - --tw-ring-offset-color: #4f46e5; -} - -.focus\:ring-offset-purple-600:focus { - --tw-ring-offset-color: #9333ea; -} - -.focus\:ring-offset-emerald-600:focus { - --tw-ring-offset-color: #059669; -} - .focus-visible\:outline:focus-visible { outline-style: solid; } @@ -1720,61 +982,26 @@ video { outline-offset: 2px; } -.focus-visible\:outline-indigo-600:focus-visible { - outline-color: #4f46e5; -} - -.focus-visible\:outline-pink-600:focus-visible { - outline-color: #db2777; -} - -.focus-visible\:outline-orange-600:focus-visible { - outline-color: #ea580c; -} - -.focus-visible\:outline-green-600:focus-visible { - outline-color: #16a34a; -} - .focus-visible\:outline-emerald-600:focus-visible { outline-color: #059669; } -.focus-visible\:ring-transparent:focus-visible { - --tw-ring-color: transparent; +.group:hover .group-hover\:border-indigo-600 { + --tw-border-opacity: 1; + border-color: rgb(79 70 229 / var(--tw-border-opacity)); } -.group:hover .group-hover\:text-white { +.group:hover .group-hover\:text-indigo-600 { --tw-text-opacity: 1; - color: rgb(255 255 255 / var(--tw-text-opacity)); + color: rgb(79 70 229 / var(--tw-text-opacity)); } @media (min-width: 640px) { - .sm\:static { - position: static; - } - - .sm\:inset-auto { - inset: auto; - } - .sm\:mx-auto { margin-left: auto; margin-right: auto; } - .sm\:ml-6 { - margin-left: 1.5rem; - } - - .sm\:flex { - display: flex; - } - - .sm\:hidden { - display: none; - } - .sm\:w-full { width: 100%; } @@ -1787,20 +1014,6 @@ video { max-width: 28rem; } - .sm\:items-stretch { - align-items: stretch; - } - - .sm\:justify-start { - justify-content: flex-start; - } - - .sm\:space-x-8 > :not([hidden]) ~ :not([hidden]) { - --tw-space-x-reverse: 0; - margin-right: calc(2rem * var(--tw-space-x-reverse)); - margin-left: calc(2rem * calc(1 - var(--tw-space-x-reverse))); - } - .sm\:rounded-lg { border-radius: 0.5rem; } @@ -1815,15 +1028,6 @@ video { padding-right: 1.5rem; } - .sm\:px-3 { - padding-left: 0.75rem; - padding-right: 0.75rem; - } - - .sm\:pr-0 { - padding-right: 0px; - } - .sm\:text-sm { font-size: 0.875rem; line-height: 1.25rem; @@ -1834,56 +1038,9 @@ video { } } -@media (min-width: 768px) { - .md\:ml-6 { - margin-left: 1.5rem; - } - - .md\:block { - display: block; - } - - .md\:hidden { - display: none; - } -} - @media (min-width: 1024px) { - .lg\:fixed { - position: fixed; - } - - .lg\:inset-y-0 { - top: 0px; - bottom: 0px; - } - - .lg\:z-50 { - z-index: 50; - } - - .lg\:flex { - display: flex; - } - - .lg\:hidden { - display: none; - } - - .lg\:w-72 { - width: 18rem; - } - - .lg\:flex-col { - flex-direction: column; - } - .lg\:px-8 { padding-left: 2rem; padding-right: 2rem; } - - .lg\:pl-72 { - padding-left: 18rem; - } } diff --git a/static/main.js b/static/main.js index 3744808..afabf22 100644 --- a/static/main.js +++ b/static/main.js @@ -1,46 +1,46 @@ -let mobile_open_button = document.getElementById("mobile-menu-open-button"); -let mobile_close_button = document.getElementById("mobile-menu-close-button"); -let mobile_menu = document.getElementById("mobile-menu"); - -const profile_button = document.getElementById("profile-menu-button"); -let profile_dropdown = document.getElementById("profile-dropdown"); - -function toggle_mobile_menu() { - - if (mobile_open_button.classList.contains("block")) { - mobile_menu.classList.remove("hidden"); - mobile_open_button.classList.remove("block"); - mobile_open_button.classList.add("hidden"); - mobile_close_button.classList.remove("hidden"); - mobile_close_button.classList.add("block"); - } else { - mobile_menu.classList.add("hidden"); - mobile_close_button.classList.remove("block"); - mobile_close_button.classList.add("hidden"); - mobile_open_button.classList.remove("hidden"); - mobile_open_button.classList.add("block"); - } -} - -function toggle_profile_dropdown() { - - if (profile_dropdown.classList.contains("hidden")) { - profile_dropdown.classList.remove("hidden"); - } else { - profile_dropdown.classList.add("hidden"); - } -} - -function hide_profile_dropdown() { - let profile_dropdown = document.getElementById("profile-dropdown"); - - if (!profile_dropdown.classList.contains("hidden")) { - profile_dropdown.classList.add("hidden"); - } -} - -document.addEventListener("click", (event) => { - if (!profile_button.contains(event.target) && !profile_dropdown.contains(event.target)) { - profile_dropdown.classList.add("hidden"); - } -}); +//let mobile_open_button = document.getElementById("mobile-menu-open-button"); +//let mobile_close_button = document.getElementById("mobile-menu-close-button"); +//let mobile_menu = document.getElementById("mobile-menu"); +// +//const profile_button = document.getElementById("profile-menu-button"); +//let profile_dropdown = document.getElementById("profile-dropdown"); +// +//function toggle_mobile_menu() { +// +// if (mobile_open_button.classList.contains("block")) { +// mobile_menu.classList.remove("hidden"); +// mobile_open_button.classList.remove("block"); +// mobile_open_button.classList.add("hidden"); +// mobile_close_button.classList.remove("hidden"); +// mobile_close_button.classList.add("block"); +// } else { +// mobile_menu.classList.add("hidden"); +// mobile_close_button.classList.remove("block"); +// mobile_close_button.classList.add("hidden"); +// mobile_open_button.classList.remove("hidden"); +// mobile_open_button.classList.add("block"); +// } +//} +// +//function toggle_profile_dropdown() { +// +// if (profile_dropdown.classList.contains("hidden")) { +// profile_dropdown.classList.remove("hidden"); +// } else { +// profile_dropdown.classList.add("hidden"); +// } +//} +// +//function hide_profile_dropdown() { +// let profile_dropdown = document.getElementById("profile-dropdown"); +// +// if (!profile_dropdown.classList.contains("hidden")) { +// profile_dropdown.classList.add("hidden"); +// } +//} +// +//document.addEventListener("click", (event) => { +// if (!profile_button.contains(event.target) && !profile_dropdown.contains(event.target)) { +// profile_dropdown.classList.add("hidden"); +// } +//}); diff --git a/templates/components/sidebar.html b/templates/components/sidebar.html new file mode 100644 index 0000000..8bdd34d --- /dev/null +++ b/templates/components/sidebar.html @@ -0,0 +1,85 @@ +
+
+ +
+ ⛰️ +
+ + + +
+
diff --git a/templates/head.html b/templates/head.html index 33fdb38..3dacea1 100644 --- a/templates/head.html +++ b/templates/head.html @@ -4,5 +4,5 @@ Pique - + diff --git a/templates/home.html b/templates/home.html index 32fd3a5..30e9ce1 100644 --- a/templates/home.html +++ b/templates/home.html @@ -2,115 +2,16 @@ {% include "head.html" %} - -
- - -
-
- - Hi there! +
+ {% include "components/sidebar.html" %} +
+
+ Main content.
-
+