Build css

This commit is contained in:
eraden 2024-10-23 14:17:52 +02:00
parent 2435549298
commit 69bc087044
6 changed files with 206 additions and 162 deletions

156
Cargo.lock generated
View File

@ -153,7 +153,7 @@ dependencies = [
"actix-utils", "actix-utils",
"futures-core", "futures-core",
"futures-util", "futures-util",
"mio", "mio 1.0.2",
"socket2 0.5.7", "socket2 0.5.7",
"tokio", "tokio",
"tokio-uring", "tokio-uring",
@ -1076,6 +1076,7 @@ dependencies = [
"migration", "migration",
"redis", "redis",
"rswind", "rswind",
"rswind_cli",
"sea-orm", "sea-orm",
"serde", "serde",
"serde_json", "serde_json",
@ -1479,6 +1480,27 @@ version = "2.1.1"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "e8c02a5121d4ea3eb16a80748c74f5549a5665e4c21333c6098f283870fbdea6" checksum = "e8c02a5121d4ea3eb16a80748c74f5549a5665e4c21333c6098f283870fbdea6"
[[package]]
name = "file-id"
version = "0.2.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "6584280525fb2059cba3db2c04abf947a1a29a45ddae89f3870f8281704fafc9"
dependencies = [
"windows-sys 0.48.0",
]
[[package]]
name = "filetime"
version = "0.2.25"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "35c0522e981e68cbfa8c3f978441a5f34b30b96e146b33cd3359176b50fe8586"
dependencies = [
"cfg-if",
"libc",
"libredox",
"windows-sys 0.59.0",
]
[[package]] [[package]]
name = "flume" name = "flume"
version = "0.11.1" version = "0.11.1"
@ -1505,6 +1527,15 @@ dependencies = [
"percent-encoding", "percent-encoding",
] ]
[[package]]
name = "fsevent-sys"
version = "4.1.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "76ee7a02da4d231650c7cea31349b889be2f45ddb3ef3032d2ec8185f6313fd2"
dependencies = [
"libc",
]
[[package]] [[package]]
name = "funty" name = "funty"
version = "2.0.0" version = "2.0.0"
@ -1686,6 +1717,7 @@ dependencies = [
"bstr", "bstr",
"regex-automata 0.4.8", "regex-automata 0.4.8",
"regex-syntax 0.8.5", "regex-syntax 0.8.5",
"serde",
] ]
[[package]] [[package]]
@ -1914,6 +1946,26 @@ dependencies = [
"syn 2.0.82", "syn 2.0.82",
] ]
[[package]]
name = "inotify"
version = "0.9.6"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "f8069d3ec154eb856955c1c0fbffefbf5f3c40a104ec912d4797314c1801abff"
dependencies = [
"bitflags 1.3.2",
"inotify-sys",
"libc",
]
[[package]]
name = "inotify-sys"
version = "0.1.5"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "e05c02b5e89bff3b946cedeca278abc628fe811e604f027c45a8aa3cf793d0eb"
dependencies = [
"libc",
]
[[package]] [[package]]
name = "inout" name = "inout"
version = "0.1.3" version = "0.1.3"
@ -1983,6 +2035,26 @@ dependencies = [
"serde", "serde",
] ]
[[package]]
name = "kqueue"
version = "1.0.8"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "7447f1ca1b7b563588a205fe93dea8df60fd981423a768bc1c0ded35ed147d0c"
dependencies = [
"kqueue-sys",
"libc",
]
[[package]]
name = "kqueue-sys"
version = "1.0.4"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "ed9625ffda8729b85e45cf04090035ac368927b8cebc34898e7c120f52e4838b"
dependencies = [
"bitflags 1.3.2",
"libc",
]
[[package]] [[package]]
name = "kv-log-macro" name = "kv-log-macro"
version = "1.0.7" version = "1.0.7"
@ -2029,6 +2101,17 @@ version = "0.2.8"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "4ec2a862134d2a7d32d7983ddcdd1c4923530833c9f2ea1a44fc5fa473989058" checksum = "4ec2a862134d2a7d32d7983ddcdd1c4923530833c9f2ea1a44fc5fa473989058"
[[package]]
name = "libredox"
version = "0.1.3"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "c0ff37bd590ca25063e35af745c343cb7a0271906fb7b37e4813e8f79f00268d"
dependencies = [
"bitflags 2.6.0",
"libc",
"redox_syscall",
]
[[package]] [[package]]
name = "libsqlite3-sys" name = "libsqlite3-sys"
version = "0.30.1" version = "0.30.1"
@ -2199,6 +2282,18 @@ dependencies = [
"adler2", "adler2",
] ]
[[package]]
name = "mio"
version = "0.8.11"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "a4a650543ca06a924e8b371db273b2756685faae30f8487da1b56505a8f78b0c"
dependencies = [
"libc",
"log",
"wasi",
"windows-sys 0.48.0",
]
[[package]] [[package]]
name = "mio" name = "mio"
version = "1.0.2" version = "1.0.2"
@ -2273,6 +2368,39 @@ dependencies = [
"minimal-lexical", "minimal-lexical",
] ]
[[package]]
name = "notify"
version = "6.1.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "6205bd8bb1e454ad2e27422015fb5e4f2bcc7e08fa8f27058670d208324a4d2d"
dependencies = [
"bitflags 2.6.0",
"crossbeam-channel",
"filetime",
"fsevent-sys",
"inotify",
"kqueue",
"libc",
"log",
"mio 0.8.11",
"walkdir",
"windows-sys 0.48.0",
]
[[package]]
name = "notify-debouncer-full"
version = "0.3.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "fb7fd166739789c9ff169e654dc1501373db9d80a4c3f972817c8a4d7cf8f34e"
dependencies = [
"crossbeam-channel",
"file-id",
"log",
"notify",
"parking_lot",
"walkdir",
]
[[package]] [[package]]
name = "nu-ansi-term" name = "nu-ansi-term"
version = "0.46.0" version = "0.46.0"
@ -3129,6 +3257,30 @@ dependencies = [
"wasm-bindgen", "wasm-bindgen",
] ]
[[package]]
name = "rswind_cli"
version = "0.0.1-alpha.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "f3d818e725a7f58844c2a90a4a7fd48b1bfb119bb9b2eb8270c8a039c47801f0"
dependencies = [
"clap",
"colored",
"config",
"cssparser",
"globset",
"notify",
"notify-debouncer-full",
"rayon",
"rswind",
"rswind_extractor",
"rustc-hash",
"smol_str",
"thiserror",
"tracing",
"tracing-subscriber",
"walkdir",
]
[[package]] [[package]]
name = "rswind_common" name = "rswind_common"
version = "0.0.1-alpha.1" version = "0.0.1-alpha.1"
@ -4119,7 +4271,7 @@ dependencies = [
"backtrace", "backtrace",
"bytes", "bytes",
"libc", "libc",
"mio", "mio 1.0.2",
"parking_lot", "parking_lot",
"pin-project-lite", "pin-project-lite",
"signal-hook-registry", "signal-hook-registry",

View File

@ -13,11 +13,11 @@ redis = { version = "0.27.5", features = ["tokio", "json", "uuid", "tokio-comp",
sea-orm = { version = "1.1.0", default-features = false, features = ["chrono", "macros", "runtime-actix-rustls", "serde_json", "sqlx-postgres", "with-uuid"] } sea-orm = { version = "1.1.0", default-features = false, features = ["chrono", "macros", "runtime-actix-rustls", "serde_json", "sqlx-postgres", "with-uuid"] }
tracing = "0.1.40" tracing = "0.1.40"
tracing-subscriber = "0.3.18" tracing-subscriber = "0.3.18"
rswind = "0.0.1-alpha.1"
serde = "1.0.210" serde = "1.0.210"
serde_json = "1.0.132" serde_json = "1.0.132"
uuid = { version = "1.11.0", features = ["v4", "v8"] } uuid = { version = "1.11.0", features = ["v4", "v8"] }
migration = { path = "./migration" } migration = { path = "./migration" }
rswind = "0.0.1-alpha.1"
rswind_cli = "0.0.1-alpha.1"
[build-dependencies] [build-dependencies]
rswind = "0.0.1-alpha.1"

View File

@ -1,6 +1,3 @@
use glob::GlobMatcher;
use rswind::*;
fn main() { fn main() {
// let mut p = create_app(); // let mut p = create_app();
// p.processor.options.watch = false; // p.processor.options.watch = false;

View File

@ -15,6 +15,7 @@ mod entities;
#[derive(Debug, Template)] #[derive(Debug, Template)]
#[template(path = "recipe_card.html")] #[template(path = "recipe_card.html")]
struct RecipeCard { struct RecipeCard {
id: i64,
author: Option<String>, author: Option<String>,
image_url: String, image_url: String,
title: String, title: String,
@ -131,6 +132,7 @@ async fn index_html(db: Data<DatabaseConnection>) -> IndexTemplate {
recipies: recipies recipies: recipies
.into_iter() .into_iter()
.map(|r| RecipeCard { .map(|r| RecipeCard {
id: r.id,
author: r.author, author: r.author,
image_url: r.image_url.unwrap_or_default(), image_url: r.image_url.unwrap_or_default(),
title: r.title, title: r.title,
@ -200,6 +202,7 @@ async fn styles_css() -> HttpResponse {
#[actix_web::main] #[actix_web::main]
async fn main() { async fn main() {
let _ = tracing_subscriber::fmt::init(); let _ = tracing_subscriber::fmt::init();
// rswind_cli::cli(["--cwd", ".", "-o", "./templates/styles.css"]);
tracing::info!("You can define admins by setting env variable ADMINS"); tracing::info!("You can define admins by setting env variable ADMINS");
tracing::info!(" Example: ADMINS=login1:pass1,login2,pass2"); tracing::info!(" Example: ADMINS=login1:pass1,login2,pass2");

View File

@ -1,4 +1,4 @@
<div class="card hover:shadow-lg transition ease-linear transform hover:scale-105"> <a class="card hover:shadow-lg transition ease-linear transform hover:scale-105" href="/recipies/{{id}}">
<img src={{image_url}} alt="noodles" class="w-full h-32 md:h-48 object-cover"> <img src={{image_url}} alt="noodles" class="w-full h-32 md:h-48 object-cover">
<div class="m-4"> <div class="m-4">
<span class="font-bold">{{title}}</span> <span class="font-bold">{{title}}</span>
@ -19,4 +19,4 @@
</div> </div>
{% when None %} {% when None %}
{% endmatch %} {% endmatch %}
</div> </a>

View File

@ -560,10 +560,42 @@ video {
margin: 1rem; margin: 1rem;
} }
.mb-2{
margin-bottom: 0.5rem;
}
.mb-3{
margin-bottom: 0.75rem;
}
.mb-5{
margin-bottom: 1.25rem;
}
.mb-7{
margin-bottom: 1.75rem;
}
.ml-2{ .ml-2{
margin-left: 0.5rem; margin-left: 0.5rem;
} }
.ml-6{
margin-left: 1.5rem;
}
.ml-auto{
margin-left: auto;
}
.mr-2{
margin-right: 0.5rem;
}
.mr-auto{
margin-right: auto;
}
.mt-12{ .mt-12{
margin-top: 3rem; margin-top: 3rem;
} }
@ -580,54 +612,6 @@ video {
margin-top: 2rem; margin-top: 2rem;
} }
.mb-2{
margin-bottom: 0.5rem;
}
.mb-3{
margin-bottom: 0.75rem;
}
.mb-5{
margin-bottom: 1.25rem;
}
.mb-6{
margin-bottom: 1.5rem;
}
.mb-7{
margin-bottom: 1.75rem;
}
.mb-8{
margin-bottom: 2rem;
}
.ml-6{
margin-left: 1.5rem;
}
.ml-\[1\.7rem\]{
margin-left: 1.7rem;
}
.ml-auto{
margin-left: auto;
}
.mr-4{
margin-right: 1rem;
}
.mr-auto{
margin-right: auto;
}
.mr-2{
margin-right: 0.5rem;
}
.block{ .block{
display: block; display: block;
} }
@ -640,10 +624,6 @@ video {
display: flex; display: flex;
} }
.table{
display: table;
}
.grid{ .grid{
display: grid; display: grid;
} }
@ -672,10 +652,6 @@ video {
width: 1.5rem; width: 1.5rem;
} }
.w-full{
width: 100%;
}
.w-\[20\.2rem\]{ .w-\[20\.2rem\]{
width: 20.2rem; width: 20.2rem;
} }
@ -684,9 +660,8 @@ video {
width: 20rem; width: 20rem;
} }
.w-fit{ .w-full{
width: -moz-fit-content; width: 100%;
width: fit-content;
} }
.transform{ .transform{
@ -725,26 +700,18 @@ video {
gap: 2.5rem; gap: 2.5rem;
} }
.rounded-xl{
border-radius: 0.75rem;
}
.border-b{ .border-b{
border-bottom-width: 1px; border-bottom-width: 1px;
} }
.border-r-4{
border-right-width: 4px;
}
.border-b-2{
border-bottom-width: 2px;
}
.border-b-\[2px\]{ .border-b-\[2px\]{
border-bottom-width: 2px; border-bottom-width: 2px;
} }
.border-r-4{
border-right-width: 4px;
}
.border-gray-100{ .border-gray-100{
--tw-border-opacity: 1; --tw-border-opacity: 1;
border-color: rgb(243 244 246 / var(--tw-border-opacity)); border-color: rgb(243 244 246 / var(--tw-border-opacity));
@ -775,11 +742,6 @@ video {
background-color: rgb(226 226 213 / var(--tw-bg-opacity)); background-color: rgb(226 226 213 / var(--tw-bg-opacity));
} }
.bg-rose-50{
--tw-bg-opacity: 1;
background-color: rgb(255 241 242 / var(--tw-bg-opacity));
}
.object-cover{ .object-cover{
-o-object-fit: cover; -o-object-fit: cover;
object-fit: cover; object-fit: cover;
@ -809,19 +771,10 @@ video {
padding-bottom: 1.5rem; padding-bottom: 1.5rem;
} }
.py-5{
padding-top: 1.25rem;
padding-bottom: 1.25rem;
}
.pb-2{ .pb-2{
padding-bottom: 0.5rem; padding-bottom: 0.5rem;
} }
.pl-1{
padding-left: 0.25rem;
}
.pb-4{ .pb-4{
padding-bottom: 1rem; padding-bottom: 1rem;
} }
@ -830,18 +783,14 @@ video {
padding-bottom: 1.5rem; padding-bottom: 1.5rem;
} }
.pl-1{
padding-left: 0.25rem;
}
.pl-3{ .pl-3{
padding-left: 0.75rem; padding-left: 0.75rem;
} }
.pl-7{
padding-left: 1.75rem;
}
.pl-8{
padding-left: 2rem;
}
.pl-\[1\.7rem\]{ .pl-\[1\.7rem\]{
padding-left: 1.7rem; padding-left: 1.7rem;
} }
@ -872,11 +821,6 @@ video {
line-height: 1; line-height: 1;
} }
.text-sm{
font-size: 0.875rem;
line-height: 1.25rem;
}
.text-\[17px\]{ .text-\[17px\]{
font-size: 17px; font-size: 17px;
} }
@ -890,14 +834,9 @@ video {
line-height: 1.5rem; line-height: 1.5rem;
} }
.text-lg{ .text-sm{
font-size: 1.125rem; font-size: 0.875rem;
line-height: 1.75rem; line-height: 1.25rem;
}
.text-xl{
font-size: 1.25rem;
line-height: 1.75rem;
} }
.font-bold{ .font-bold{
@ -916,10 +855,6 @@ video {
line-height: 2.5rem; line-height: 2.5rem;
} }
.leading-\[2\.8rem\]{
line-height: 2.8rem;
}
.text-gray-500{ .text-gray-500{
--tw-text-opacity: 1; --tw-text-opacity: 1;
color: rgb(107 114 128 / var(--tw-text-opacity)); color: rgb(107 114 128 / var(--tw-text-opacity));
@ -945,21 +880,11 @@ video {
color: rgb(136 136 131 / var(--tw-text-opacity)); color: rgb(136 136 131 / var(--tw-text-opacity));
} }
.text-rose-900{
--tw-text-opacity: 1;
color: rgb(136 19 55 / var(--tw-text-opacity));
}
.text-stone-500{ .text-stone-500{
--tw-text-opacity: 1; --tw-text-opacity: 1;
color: rgb(120 113 108 / var(--tw-text-opacity)); color: rgb(120 113 108 / var(--tw-text-opacity));
} }
.text-stone-600{
--tw-text-opacity: 1;
color: rgb(87 83 78 / var(--tw-text-opacity));
}
.text-stone-700{ .text-stone-700{
--tw-text-opacity: 1; --tw-text-opacity: 1;
color: rgb(68 64 60 / var(--tw-text-opacity)); color: rgb(68 64 60 / var(--tw-text-opacity));
@ -1081,18 +1006,10 @@ video {
} }
@media (min-width: 640px){ @media (min-width: 640px){
.sm\:ml-0{
margin-left: 0px;
}
.sm\:ml-auto{ .sm\:ml-auto{
margin-left: auto; margin-left: auto;
} }
.sm\:mr-0{
margin-right: 0px;
}
.sm\:mr-auto{ .sm\:mr-auto{
margin-right: auto; margin-right: auto;
} }
@ -1113,10 +1030,6 @@ video {
width: auto; width: auto;
} }
.sm\:w-full{
width: 100%;
}
.sm\:rounded-3xl{ .sm\:rounded-3xl{
border-radius: 1.5rem; border-radius: 1.5rem;
} }
@ -1138,27 +1051,6 @@ video {
padding: 2.5rem; padding: 2.5rem;
} }
.sm\:py-6{
padding-top: 1.5rem;
padding-bottom: 1.5rem;
}
.sm\:pb-0{
padding-bottom: 0px;
}
.sm\:pl-8{
padding-left: 2rem;
}
.sm\:text-left{
text-align: left;
}
.sm\:text-\[16px\]{
font-size: 16px;
}
.sm\:text-base{ .sm\:text-base{
font-size: 1rem; font-size: 1rem;
line-height: 1.5rem; line-height: 1.5rem;