Code runs and shows a base layout with some empty components.

This commit is contained in:
Ada Werefox 2023-07-03 18:58:08 -05:00
parent ef80ecff80
commit c04102d5e5
16 changed files with 92 additions and 9 deletions

1
.gitignore vendored
View File

@ -1 +1,2 @@
/target /target
/dist

6
.vscode/settings.json vendored Normal file
View File

@ -0,0 +1,6 @@
{
"rust-analyzer.linkedProjects": [
"./Cargo.toml",
],
"rust-analyzer.showUnlinkedFileNotification": false
}

View File

@ -33,7 +33,7 @@ index_on_404 = true
[web.resource] [web.resource]
# CSS style file # CSS style file
style = ["/styles/tailwind.min.css"] style = ["styles/tailwind.min.css"]
# Javascript code file # Javascript code file
script = [] script = []
@ -41,7 +41,7 @@ script = []
[web.resource.dev] [web.resource.dev]
# CSS style file # CSS style file
style = ["/styles/tailwind.min.css"] # style = ["styles/tailwind.min.css"]
# Javascript code file # Javascript code file
# serve: [dev-server] only # serve: [dev-server] only

View File

@ -1,7 +1,7 @@
fn main() { fn main() {
let mut tailwind = std::process::Command::new("npx"); let mut tailwind = std::process::Command::new("npx");
tailwind.args( tailwind.args(
"tailwindcss -i src/index.css -c tailwind.config.js -o styles/tailwind.min.css --minify" "tailwindcss -i src/index.css -c tailwind.config.js -o public/styles/tailwind.min.css --minify"
.split(" "), .split(" "),
); );
tailwind.env("NODE_ENV", "production"); tailwind.env("NODE_ENV", "production");

File diff suppressed because one or more lines are too long

7
src/components.rs Normal file
View File

@ -0,0 +1,7 @@
pub mod stream_base;
pub mod stream_title;
pub mod stream_content;
pub mod stream_sidebar;
pub mod stream_topbar;
pub mod stream_chat;
pub mod stream_overlays;

View File

@ -0,0 +1,20 @@
use dioxus::prelude::*;
use crate::components::stream_title::*;
use crate::components::stream_sidebar::*;
use crate::components::stream_topbar::*;
use crate::components::stream_content::*;
pub fn BasePage(cx: Scope) -> Element {
cx.render(rsx!{
div { class: "min-w-max min-h-screen bg-alice-werefox-grey-dark",
div { class: "relative w-1920 h-1080 p-4 ring-[1px] ring-pink-300",
div { class: "flex flex-col space-y-4",
StreamTitle {},
StreamSidebar {},
StreamTopbar {},
StreamContent {}
}
}
}
})
}

View File

View File

@ -0,0 +1,9 @@
use dioxus::prelude::*;
pub fn StreamContent(cx: Scope) -> Element {
cx.render(rsx!{
div { class: "absolute bottom-4 right-4 w-1280 h-720 p-4 ring-[1px] ring-ada-werefox-cyan bg-[rgb(255,0,150)]",
div {}
}
})
}

View File

View File

@ -0,0 +1,9 @@
use dioxus::prelude::*;
pub fn StreamSidebar(cx: Scope) -> Element {
cx.render(rsx!{
div { class: "absolute bottom-4 left-4 p-4 ring-[1px] ring-ada-werefox-cyan bg-alice-werefox-grey w-[36rem] h-[60rem]",
div {}
}
})
}

View File

@ -0,0 +1,11 @@
use dioxus::prelude::*;
pub fn StreamTitle(cx: Scope) -> Element {
return cx.render(rsx!{
div { class: "flex p-4 h-16 text-lg text-center ring-2 text-alice-werefox-grey-lighter ring-alice-werefox-grey-light bg-alice-werefox-grey",
div { class: "m-auto",
"Test Thing."
}
}
});
}

View File

@ -0,0 +1,9 @@
use dioxus::prelude::*;
pub fn StreamTopbar(cx: Scope) -> Element {
cx.render(rsx!{
div { class: "absolute top-[5.5rem] right-4 p-4 ring-[1px] ring-ada-werefox-cyan bg-alice-werefox-grey w-[80rem] h-[13rem]",
div {}
}
})
}

View File

@ -4,7 +4,7 @@
#![allow(non_snake_case)] #![allow(non_snake_case)]
// mod components; mod components;
// pub mod utils; // pub mod utils;
/// A module that handles the functions needed /// A module that handles the functions needed
@ -17,6 +17,7 @@ pub mod layouts_app {
// use dioxus_helmet::Helmet; // use dioxus_helmet::Helmet;
use dioxus_router::{Redirect, Route, Router}; use dioxus_router::{Redirect, Route, Router};
// use dioxus_use_storage::use_local_storage; // use dioxus_use_storage::use_local_storage;
use crate::components::stream_base::*;
pub fn DioxusApp(cx: Scope) -> Element { pub fn DioxusApp(cx: Scope) -> Element {
@ -38,9 +39,7 @@ pub mod layouts_app {
/// Renders the app and returns the rendered Element. /// Renders the app and returns the rendered Element.
pub fn HomePage(cx: Scope) -> Element { pub fn HomePage(cx: Scope) -> Element {
cx.render(rsx!{ cx.render(rsx!{
div { class: "", BasePage {}
"Hello, world!"
}
}) })
} }
} }

View File

@ -2,7 +2,10 @@
use console_error_panic_hook; use console_error_panic_hook;
#[cfg(target_family = "wasm")] #[cfg(target_family = "wasm")]
use layouts_app; use dioxus_web;
#[cfg(target_family = "wasm")]
use werefox_stream_layouts::layouts_app;
#[cfg(target_family = "wasm")] #[cfg(target_family = "wasm")]
use wasm_logger; use wasm_logger;

View File

@ -14,6 +14,15 @@ module.exports = {
} }
}, },
extend: { extend: {
width: {
"1920": "1920px",
"1280": "1280px",
"960": "960px",
},
height: {
"1080": "1080px",
"720": "720px",
},
fontFamily: { fontFamily: {
nerd: ["DejaVuSansMono"], nerd: ["DejaVuSansMono"],
open: ["OpenDyslexic"], open: ["OpenDyslexic"],