feat: initial commit

This commit is contained in:
2025-03-19 08:52:09 +01:00
commit 4fd2d85c97
26 changed files with 6300 additions and 0 deletions

30
src/views/blog.rs Normal file
View File

@@ -0,0 +1,30 @@
use crate::Route;
use dioxus::prelude::*;
const BLOG_CSS: Asset = asset!("/assets/styling/blog.css");
#[component]
pub fn Blog(id: i32) -> Element {
rsx! {
document::Link { rel: "stylesheet", href: BLOG_CSS}
div {
id: "blog",
// Content
h1 { "This is blog #{id}!" }
p { "In blog #{id}, we show how the Dioxus router works and how URL parameters can be passed as props to our route components." }
// Navigation links
Link {
to: Route::Blog { id: id - 1 },
"Previous"
}
span { " <---> " }
Link {
to: Route::Blog { id: id + 1 },
"Next"
}
}
}
}

102
src/views/calendar.rs Normal file
View File

@@ -0,0 +1,102 @@
use crate::Route;
use dioxus::{
html::{strong, th, tr},
prelude::*,
};
const CALENDAR_CSS: Asset = asset!("/assets/styling/calendar.css");
#[component]
pub fn Calendar(id: i32) -> Element {
rsx! {
document::Link { rel: "stylesheet", href: CALENDAR_CSS}
div {
id: "calendar",
// Content
h1 { "This is Calendar #{id}!" }
table {
tr {
th { "Monday" }
th { "Tuesday" }
th { "Wednesday" }
th { "Thursday" }
th { "Friday" }
th { "Saturday" }
th { "Sunday" }
}
tr {
th {
strong { "Family Guy" }
p { "S23E05" }
p { "01:00 Uhr" }
p { "FOX" }
}
th {
strong { "Die Rosenheim-Cops" }
p { "S24E23" }
p { "01:00 Uhr" }
p { "ZDFmediathek" }
}
th {}
th {}
th {}
th {}
th {}
}
tr {
th {
strong { "Married to Medicine" }
p { "S11E15" }
p { "01:00 Uhr" }
p { "Hayu" }
}
th {
strong { "SOKO Köln" }
p { "S23E23" }
p { "01:00 Uhr" }
p { "ZDFmediathek" }
}
th {}
th {}
th {}
th {}
th {}
}
tr {
th {
strong { "SOKO Potsdam" }
p { "S07E11" }
p { "01:00 Uhr" }
p { "ZDFmediathek" }
}
th {}
th {}
th {}
th {}
th {}
th {}
}
tr {
th {
strong { "Tracker" }
p { "S02E13" }
p { "01:00 Uhr" }
p { "CBS" }
}
th {}
th {}
th {}
th {}
th {}
th {}
}
}
}
}
}

10
src/views/home.rs Normal file
View File

@@ -0,0 +1,10 @@
use crate::components::{Echo, Hero};
use dioxus::prelude::*;
#[component]
pub fn Home() -> Element {
rsx! {
Hero {}
Echo {}
}
}

8
src/views/mod.rs Normal file
View File

@@ -0,0 +1,8 @@
mod home;
pub use home::Home;
mod blog;
pub use blog::Blog;
mod calendar;
pub use calendar::Calendar;