diff --git a/.gitignore b/.gitignore index ea8c4bf..a803f50 100644 --- a/.gitignore +++ b/.gitignore @@ -1 +1,2 @@ /target +/dist \ No newline at end of file diff --git a/.vscode/settings.json b/.vscode/settings.json new file mode 100644 index 0000000..9e7406f --- /dev/null +++ b/.vscode/settings.json @@ -0,0 +1,6 @@ +{ + "rust-analyzer.linkedProjects": [ + "./Cargo.toml", + ], + "rust-analyzer.showUnlinkedFileNotification": false +} \ No newline at end of file diff --git a/Dioxus.toml b/Dioxus.toml index 28b0c2d..ad3cc7a 100644 --- a/Dioxus.toml +++ b/Dioxus.toml @@ -33,7 +33,7 @@ index_on_404 = true [web.resource] # CSS style file -style = ["/styles/tailwind.min.css"] +style = ["styles/tailwind.min.css"] # Javascript code file script = [] @@ -41,7 +41,7 @@ script = [] [web.resource.dev] # CSS style file -style = ["/styles/tailwind.min.css"] +# style = ["styles/tailwind.min.css"] # Javascript code file # serve: [dev-server] only diff --git a/build.rs b/build.rs index 73ebc7a..acb049a 100644 --- a/build.rs +++ b/build.rs @@ -1,7 +1,7 @@ fn main() { let mut tailwind = std::process::Command::new("npx"); 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(" "), ); tailwind.env("NODE_ENV", "production"); diff --git a/styles/tailwind.min.css b/public/styles/tailwind.min.css similarity index 59% rename from styles/tailwind.min.css rename to public/styles/tailwind.min.css index 3ffe549..a8e6125 100644 --- a/styles/tailwind.min.css +++ b/public/styles/tailwind.min.css @@ -1 +1 @@ -/*! tailwindcss v3.3.0 | MIT License | https://tailwindcss.com*/*,:after,:before{box-sizing:border-box;border:0 solid #e5e7eb}:after,:before{--tw-content:""}html{line-height:1.5;-webkit-text-size-adjust:100%;-moz-tab-size:4;-o-tab-size:4;tab-size:4;font-family:ui-sans-serif,system-ui,-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Helvetica Neue,Arial,Noto Sans,sans-serif,Apple Color Emoji,Segoe UI Emoji,Segoe UI Symbol,Noto Color Emoji;font-feature-settings:normal;font-variation-settings:normal}body{margin:0;line-height:inherit}hr{height:0;color:inherit;border-top-width:1px}abbr:where([title]){-webkit-text-decoration:underline dotted;text-decoration:underline dotted}h1,h2,h3,h4,h5,h6{font-size:inherit;font-weight:inherit}a{color:inherit;text-decoration:inherit}b,strong{font-weight:bolder}code,kbd,pre,samp{font-family:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,Liberation Mono,Courier New,monospace;font-size:1em}small{font-size:80%}sub,sup{font-size:75%;line-height:0;position:relative;vertical-align:initial}sub{bottom:-.25em}sup{top:-.5em}table{text-indent:0;border-color:inherit;border-collapse:collapse}button,input,optgroup,select,textarea{font-family:inherit;font-size:100%;font-weight:inherit;line-height:inherit;color:inherit;margin:0;padding:0}button,select{text-transform:none}[type=button],[type=reset],[type=submit],button{-webkit-appearance:button;background-color:initial;background-image:none}:-moz-focusring{outline:auto}:-moz-ui-invalid{box-shadow:none}progress{vertical-align:initial}::-webkit-inner-spin-button,::-webkit-outer-spin-button{height:auto}[type=search]{-webkit-appearance:textfield;outline-offset:-2px}::-webkit-search-decoration{-webkit-appearance:none}::-webkit-file-upload-button{-webkit-appearance:button;font:inherit}summary{display:list-item}blockquote,dd,dl,figure,h1,h2,h3,h4,h5,h6,hr,p,pre{margin:0}fieldset{margin:0}fieldset,legend{padding:0}menu,ol,ul{list-style:none;margin:0;padding:0}textarea{resize:vertical}input::-moz-placeholder,textarea::-moz-placeholder{opacity:1;color:#9ca3af}input::placeholder,textarea::placeholder{opacity:1;color:#9ca3af}[role=button],button{cursor:pointer}:disabled{cursor:default}audio,canvas,embed,iframe,img,object,svg,video{display:block;vertical-align:middle}img,video{max-width:100%;height:auto}[hidden]{display:none}*,::backdrop,:after,:before{--tw-border-spacing-x:0;--tw-border-spacing-y:0;--tw-translate-x:0;--tw-translate-y:0;--tw-rotate:0;--tw-skew-x:0;--tw-skew-y:0;--tw-scale-x:1;--tw-scale-y:1;--tw-pan-x: ;--tw-pan-y: ;--tw-pinch-zoom: ;--tw-scroll-snap-strictness:proximity;--tw-ordinal: ;--tw-slashed-zero: ;--tw-numeric-figure: ;--tw-numeric-spacing: ;--tw-numeric-fraction: ;--tw-ring-inset: ;--tw-ring-offset-width:0px;--tw-ring-offset-color:#fff;--tw-ring-color:#3b82f680;--tw-ring-offset-shadow:0 0 #0000;--tw-ring-shadow:0 0 #0000;--tw-shadow:0 0 #0000;--tw-shadow-colored:0 0 #0000;--tw-blur: ;--tw-brightness: ;--tw-contrast: ;--tw-grayscale: ;--tw-hue-rotate: ;--tw-invert: ;--tw-saturate: ;--tw-sepia: ;--tw-drop-shadow: ;--tw-backdrop-blur: ;--tw-backdrop-brightness: ;--tw-backdrop-contrast: ;--tw-backdrop-grayscale: ;--tw-backdrop-hue-rotate: ;--tw-backdrop-invert: ;--tw-backdrop-opacity: ;--tw-backdrop-saturate: ;--tw-backdrop-sepia: }.hidden{display:none}@font-face{font-family:OpenDyslexic;src:url(/fonts/OpenDyslexic-Regular.otf)}@font-face{font-family:DejaVuSansMono;src:url(/fonts/DejaVuSansMono.ttf)} \ No newline at end of file +/*! tailwindcss v3.3.0 | MIT License | https://tailwindcss.com*/*,:after,:before{box-sizing:border-box;border:0 solid #e5e7eb}:after,:before{--tw-content:""}html{line-height:1.5;-webkit-text-size-adjust:100%;-moz-tab-size:4;-o-tab-size:4;tab-size:4;font-family:ui-sans-serif,system-ui,-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Helvetica Neue,Arial,Noto Sans,sans-serif,Apple Color Emoji,Segoe UI Emoji,Segoe UI Symbol,Noto Color Emoji;font-feature-settings:normal;font-variation-settings:normal}body{margin:0;line-height:inherit}hr{height:0;color:inherit;border-top-width:1px}abbr:where([title]){-webkit-text-decoration:underline dotted;text-decoration:underline dotted}h1,h2,h3,h4,h5,h6{font-size:inherit;font-weight:inherit}a{color:inherit;text-decoration:inherit}b,strong{font-weight:bolder}code,kbd,pre,samp{font-family:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,Liberation Mono,Courier New,monospace;font-size:1em}small{font-size:80%}sub,sup{font-size:75%;line-height:0;position:relative;vertical-align:initial}sub{bottom:-.25em}sup{top:-.5em}table{text-indent:0;border-color:inherit;border-collapse:collapse}button,input,optgroup,select,textarea{font-family:inherit;font-size:100%;font-weight:inherit;line-height:inherit;color:inherit;margin:0;padding:0}button,select{text-transform:none}[type=button],[type=reset],[type=submit],button{-webkit-appearance:button;background-color:initial;background-image:none}:-moz-focusring{outline:auto}:-moz-ui-invalid{box-shadow:none}progress{vertical-align:initial}::-webkit-inner-spin-button,::-webkit-outer-spin-button{height:auto}[type=search]{-webkit-appearance:textfield;outline-offset:-2px}::-webkit-search-decoration{-webkit-appearance:none}::-webkit-file-upload-button{-webkit-appearance:button;font:inherit}summary{display:list-item}blockquote,dd,dl,figure,h1,h2,h3,h4,h5,h6,hr,p,pre{margin:0}fieldset{margin:0}fieldset,legend{padding:0}menu,ol,ul{list-style:none;margin:0;padding:0}textarea{resize:vertical}input::-moz-placeholder,textarea::-moz-placeholder{opacity:1;color:#9ca3af}input::placeholder,textarea::placeholder{opacity:1;color:#9ca3af}[role=button],button{cursor:pointer}:disabled{cursor:default}audio,canvas,embed,iframe,img,object,svg,video{display:block;vertical-align:middle}img,video{max-width:100%;height:auto}[hidden]{display:none}*,::backdrop,:after,:before{--tw-border-spacing-x:0;--tw-border-spacing-y:0;--tw-translate-x:0;--tw-translate-y:0;--tw-rotate:0;--tw-skew-x:0;--tw-skew-y:0;--tw-scale-x:1;--tw-scale-y:1;--tw-pan-x: ;--tw-pan-y: ;--tw-pinch-zoom: ;--tw-scroll-snap-strictness:proximity;--tw-ordinal: ;--tw-slashed-zero: ;--tw-numeric-figure: ;--tw-numeric-spacing: ;--tw-numeric-fraction: ;--tw-ring-inset: ;--tw-ring-offset-width:0px;--tw-ring-offset-color:#fff;--tw-ring-color:#3b82f680;--tw-ring-offset-shadow:0 0 #0000;--tw-ring-shadow:0 0 #0000;--tw-shadow:0 0 #0000;--tw-shadow-colored:0 0 #0000;--tw-blur: ;--tw-brightness: ;--tw-contrast: ;--tw-grayscale: ;--tw-hue-rotate: ;--tw-invert: ;--tw-saturate: ;--tw-sepia: ;--tw-drop-shadow: ;--tw-backdrop-blur: ;--tw-backdrop-brightness: ;--tw-backdrop-contrast: ;--tw-backdrop-grayscale: ;--tw-backdrop-hue-rotate: ;--tw-backdrop-invert: ;--tw-backdrop-opacity: ;--tw-backdrop-saturate: ;--tw-backdrop-sepia: }.absolute{position:absolute}.relative{position:relative}.bottom-4{bottom:1rem}.left-4{left:1rem}.right-4{right:1rem}.top-\[5\.5rem\]{top:5.5rem}.m-auto{margin:auto}.flex{display:flex}.hidden{display:none}.h-1080{height:1080px}.h-16{height:4rem}.h-720{height:720px}.h-\[13rem\]{height:13rem}.h-\[60rem\]{height:60rem}.min-h-screen{min-height:100vh}.w-1280{width:1280px}.w-1920{width:1920px}.w-\[36rem\]{width:36rem}.w-\[80rem\]{width:80rem}.min-w-max{min-width:-moz-max-content;min-width:max-content}.flex-col{flex-direction:column}.space-y-4>:not([hidden])~:not([hidden]){--tw-space-y-reverse:0;margin-top:calc(1rem*(1 - var(--tw-space-y-reverse)));margin-bottom:calc(1rem*var(--tw-space-y-reverse))}.bg-\[rgb\(255\2c 0\2c 150\)\]{--tw-bg-opacity:1;background-color:rgb(255 0 150/var(--tw-bg-opacity))}.bg-alice-werefox-grey{--tw-bg-opacity:1;background-color:rgb(36 36 36/var(--tw-bg-opacity))}.bg-alice-werefox-grey-dark{--tw-bg-opacity:1;background-color:rgb(18 18 18/var(--tw-bg-opacity))}.p-4{padding:1rem}.text-center{text-align:center}.text-lg{font-size:1.125rem;line-height:1.75rem}.text-alice-werefox-grey-lighter{--tw-text-opacity:1;color:rgb(219 219 219/var(--tw-text-opacity))}.ring-2{--tw-ring-offset-shadow:var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-shadow:var(--tw-ring-inset) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color)}.ring-2,.ring-\[1px\]{box-shadow:var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow,0 0 #0000)}.ring-\[1px\]{--tw-ring-offset-shadow:var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-shadow:var(--tw-ring-inset) 0 0 0 calc(1px + var(--tw-ring-offset-width)) var(--tw-ring-color)}.ring-ada-werefox-cyan{--tw-ring-opacity:1;--tw-ring-color:rgb(80 255 255/var(--tw-ring-opacity))}.ring-alice-werefox-grey-light{--tw-ring-opacity:1;--tw-ring-color:rgb(204 204 204/var(--tw-ring-opacity))}.ring-pink-300{--tw-ring-opacity:1;--tw-ring-color:rgb(249 168 212/var(--tw-ring-opacity))}@font-face{font-family:OpenDyslexic;src:url(/fonts/OpenDyslexic-Regular.otf)}@font-face{font-family:DejaVuSansMono;src:url(/fonts/DejaVuSansMono.ttf)} \ No newline at end of file diff --git a/src/components.rs b/src/components.rs new file mode 100644 index 0000000..8f0186c --- /dev/null +++ b/src/components.rs @@ -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; \ No newline at end of file diff --git a/src/components/stream_base.rs b/src/components/stream_base.rs new file mode 100644 index 0000000..44c92ea --- /dev/null +++ b/src/components/stream_base.rs @@ -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 {} + } + } + } + }) +} \ No newline at end of file diff --git a/src/components/stream_chat.rs b/src/components/stream_chat.rs new file mode 100644 index 0000000..e69de29 diff --git a/src/components/stream_content.rs b/src/components/stream_content.rs new file mode 100644 index 0000000..1635bfa --- /dev/null +++ b/src/components/stream_content.rs @@ -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 {} + } + }) +} \ No newline at end of file diff --git a/src/components/stream_overlays.rs b/src/components/stream_overlays.rs new file mode 100644 index 0000000..e69de29 diff --git a/src/components/stream_sidebar.rs b/src/components/stream_sidebar.rs new file mode 100644 index 0000000..5701238 --- /dev/null +++ b/src/components/stream_sidebar.rs @@ -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 {} + } + }) +} \ No newline at end of file diff --git a/src/components/stream_title.rs b/src/components/stream_title.rs new file mode 100644 index 0000000..8a39fd7 --- /dev/null +++ b/src/components/stream_title.rs @@ -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." + } + } + }); +} \ No newline at end of file diff --git a/src/components/stream_topbar.rs b/src/components/stream_topbar.rs new file mode 100644 index 0000000..d75f52b --- /dev/null +++ b/src/components/stream_topbar.rs @@ -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 {} + } + }) +} \ No newline at end of file diff --git a/src/lib.rs b/src/lib.rs index 66425df..4d805a9 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -4,7 +4,7 @@ #![allow(non_snake_case)] -// mod components; +mod components; // pub mod utils; /// A module that handles the functions needed @@ -17,6 +17,7 @@ pub mod layouts_app { // use dioxus_helmet::Helmet; use dioxus_router::{Redirect, Route, Router}; // use dioxus_use_storage::use_local_storage; + use crate::components::stream_base::*; pub fn DioxusApp(cx: Scope) -> Element { @@ -38,9 +39,7 @@ pub mod layouts_app { /// Renders the app and returns the rendered Element. pub fn HomePage(cx: Scope) -> Element { cx.render(rsx!{ - div { class: "", - "Hello, world!" - } + BasePage {} }) } } diff --git a/src/main.rs b/src/main.rs index 104daf3..50e2b23 100644 --- a/src/main.rs +++ b/src/main.rs @@ -2,7 +2,10 @@ use console_error_panic_hook; #[cfg(target_family = "wasm")] -use layouts_app; +use dioxus_web; + +#[cfg(target_family = "wasm")] +use werefox_stream_layouts::layouts_app; #[cfg(target_family = "wasm")] use wasm_logger; diff --git a/tailwind.config.js b/tailwind.config.js index 3e2bfb8..ad3c28e 100644 --- a/tailwind.config.js +++ b/tailwind.config.js @@ -14,6 +14,15 @@ module.exports = { } }, extend: { + width: { + "1920": "1920px", + "1280": "1280px", + "960": "960px", + }, + height: { + "1080": "1080px", + "720": "720px", + }, fontFamily: { nerd: ["DejaVuSansMono"], open: ["OpenDyslexic"],