add aspnet server
This commit is contained in:
23
client/src/app.rs
Normal file
23
client/src/app.rs
Normal file
@@ -0,0 +1,23 @@
|
||||
use dioxus::prelude::*;
|
||||
|
||||
use crate::route::Route;
|
||||
|
||||
const FAVICON: Asset = asset!("/assets/favicon.ico");
|
||||
const MAIN_CSS: Asset = asset!("/assets/styling/main.scss");
|
||||
|
||||
#[component]
|
||||
pub fn App() -> Element {
|
||||
rsx! {
|
||||
document::Link { rel: "icon", href: FAVICON }
|
||||
document::Link { rel: "stylesheet", href: MAIN_CSS }
|
||||
|
||||
document::Link { rel: "preconnect", href: "https://fonts.googleapis.com" }
|
||||
document::Link { rel: "preconnect", href: "https://fonts.gstatic.com" }
|
||||
document::Link {
|
||||
rel: "stylesheet",
|
||||
href: "https://fonts.googleapis.com/css2?family=Noto+Sans:ital,wght@0,100..900;1,100..900&display=swap",
|
||||
}
|
||||
|
||||
Router::<Route> {}
|
||||
}
|
||||
}
|
||||
6
client/src/components/calendar.rs
Normal file
6
client/src/components/calendar.rs
Normal file
@@ -0,0 +1,6 @@
|
||||
use dioxus::prelude::*;
|
||||
|
||||
#[component]
|
||||
pub fn Calendar() -> Element {
|
||||
rsx! {}
|
||||
}
|
||||
3
client/src/components/mod.rs
Normal file
3
client/src/components/mod.rs
Normal file
@@ -0,0 +1,3 @@
|
||||
mod calendar;
|
||||
pub mod playback;
|
||||
pub use calendar::*;
|
||||
6
client/src/components/playback/mod.rs
Normal file
6
client/src/components/playback/mod.rs
Normal file
@@ -0,0 +1,6 @@
|
||||
mod player;
|
||||
mod timeline;
|
||||
mod viewport;
|
||||
pub use player::*;
|
||||
pub use timeline::*;
|
||||
pub use viewport::*;
|
||||
19
client/src/components/playback/player.rs
Normal file
19
client/src/components/playback/player.rs
Normal file
@@ -0,0 +1,19 @@
|
||||
use dioxus::prelude::*;
|
||||
|
||||
use crate::components::playback::{Timeline, Viewport};
|
||||
const PLAYER_CSS: Asset = asset!("/assets/styling/player.scss");
|
||||
|
||||
#[component]
|
||||
pub fn Player() -> Element {
|
||||
rsx! {
|
||||
document::Link { rel: "stylesheet", href: PLAYER_CSS }
|
||||
div{
|
||||
id: "player",
|
||||
div {
|
||||
id: "head"
|
||||
}
|
||||
Viewport { }
|
||||
Timeline { }
|
||||
}
|
||||
}
|
||||
}
|
||||
10
client/src/components/playback/timeline.rs
Normal file
10
client/src/components/playback/timeline.rs
Normal file
@@ -0,0 +1,10 @@
|
||||
use dioxus::prelude::*;
|
||||
|
||||
#[component]
|
||||
pub fn Timeline() -> Element {
|
||||
rsx! {
|
||||
div{
|
||||
id: "timeline"
|
||||
}
|
||||
}
|
||||
}
|
||||
10
client/src/components/playback/viewport.rs
Normal file
10
client/src/components/playback/viewport.rs
Normal file
@@ -0,0 +1,10 @@
|
||||
use dioxus::prelude::*;
|
||||
|
||||
#[component]
|
||||
pub fn Viewport() -> Element {
|
||||
rsx! {
|
||||
div{
|
||||
id: "viewport"
|
||||
}
|
||||
}
|
||||
}
|
||||
4
client/src/env.rs
Normal file
4
client/src/env.rs
Normal file
@@ -0,0 +1,4 @@
|
||||
// This file is automatically generated by build.rs
|
||||
|
||||
#[allow(dead_code)]
|
||||
pub const APP_VERSION: &'static str = "Debug";
|
||||
11
client/src/main.rs
Normal file
11
client/src/main.rs
Normal file
@@ -0,0 +1,11 @@
|
||||
use crate::app::App;
|
||||
|
||||
mod app;
|
||||
mod components;
|
||||
mod env;
|
||||
mod route;
|
||||
mod views;
|
||||
|
||||
fn main() {
|
||||
dioxus::launch(App);
|
||||
}
|
||||
13
client/src/route.rs
Normal file
13
client/src/route.rs
Normal file
@@ -0,0 +1,13 @@
|
||||
use dioxus::prelude::*;
|
||||
|
||||
use crate::views::*;
|
||||
|
||||
#[derive(Debug, Clone, Routable, PartialEq)]
|
||||
#[rustfmt::skip]
|
||||
pub enum Route {
|
||||
#[layout(NavLayout)]
|
||||
#[route("/")]
|
||||
Home {},
|
||||
#[route("/settings")]
|
||||
Settings {},
|
||||
}
|
||||
8
client/src/views/home.rs
Normal file
8
client/src/views/home.rs
Normal file
@@ -0,0 +1,8 @@
|
||||
use crate::components::playback::Player;
|
||||
use dioxus::prelude::*;
|
||||
#[component]
|
||||
pub fn Home() -> Element {
|
||||
rsx! {
|
||||
Player{}
|
||||
}
|
||||
}
|
||||
7
client/src/views/mod.rs
Normal file
7
client/src/views/mod.rs
Normal file
@@ -0,0 +1,7 @@
|
||||
mod home;
|
||||
pub use home::*;
|
||||
|
||||
mod navbar;
|
||||
pub use navbar::*;
|
||||
mod settings;
|
||||
pub use settings::*;
|
||||
68
client/src/views/navbar.rs
Normal file
68
client/src/views/navbar.rs
Normal file
@@ -0,0 +1,68 @@
|
||||
use crate::{env::APP_VERSION, route::Route};
|
||||
use dioxus::prelude::*;
|
||||
const NAV_CSS: Asset = asset!("/assets/styling/navbar.scss");
|
||||
|
||||
#[component]
|
||||
pub fn NavLayout() -> Element {
|
||||
rsx! {
|
||||
|
||||
Navbar { }
|
||||
div {
|
||||
id: "content",
|
||||
Outlet::<Route> {}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
const NAV_ICON: Asset = asset!("/assets/favicon.ico");
|
||||
|
||||
#[component]
|
||||
pub fn Navbar() -> Element {
|
||||
rsx! {
|
||||
document::Link { rel: "stylesheet", href: NAV_CSS }
|
||||
nav {
|
||||
Branding {}
|
||||
MainNaviagation {}
|
||||
Widgets {}
|
||||
Utils {}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#[component]
|
||||
pub fn MainNaviagation() -> Element {
|
||||
rsx! {
|
||||
div { class: "mainNav",
|
||||
Link { class: "navItem", to: Route::Home { }, "Home" }
|
||||
Link { class: "navItem", to: Route::Settings {}, "Settings" }
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#[component]
|
||||
pub fn Branding() -> Element {
|
||||
rsx! {
|
||||
div { class: "branding",
|
||||
img { src: NAV_ICON, alt: "Aoba" }
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#[component]
|
||||
pub fn Widgets() -> Element {
|
||||
rsx! {
|
||||
div { class: "widgets" }
|
||||
}
|
||||
}
|
||||
|
||||
#[component]
|
||||
pub fn Utils() -> Element {
|
||||
// let mut auth_context = use_context::<AuthContext>();
|
||||
let version = APP_VERSION;
|
||||
rsx! {
|
||||
div { class: "utils",
|
||||
div { "{version}" }
|
||||
div { /*onclick: move |_| auth_context.logout(),*/ "Logout" }
|
||||
}
|
||||
}
|
||||
}
|
||||
8
client/src/views/settings.rs
Normal file
8
client/src/views/settings.rs
Normal file
@@ -0,0 +1,8 @@
|
||||
use dioxus::prelude::*;
|
||||
|
||||
#[component]
|
||||
pub fn Settings() -> Element {
|
||||
rsx! {
|
||||
"Settings"
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user