responsive dashboard structure
This commit is contained in:
@@ -0,0 +1,62 @@
|
|||||||
|
body {
|
||||||
|
background-color: #111526;
|
||||||
|
margin: 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
.container {
|
||||||
|
display: grid;
|
||||||
|
grid-template-columns: minmax(200px, 1fr) 2fr 1.5fr;
|
||||||
|
gap: 20px;
|
||||||
|
}
|
||||||
|
|
||||||
|
#sidebar {
|
||||||
|
background-color: #171b2e;
|
||||||
|
height: 100vh;
|
||||||
|
border-top-right-radius: 20px;
|
||||||
|
border-bottom-right-radius: 20px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.left_container {
|
||||||
|
display: grid;
|
||||||
|
grid-template-rows: 200px 450px 230px;
|
||||||
|
gap: 20px;
|
||||||
|
padding-top: 20px;
|
||||||
|
}
|
||||||
|
|
||||||
|
#top_container,
|
||||||
|
#mid_container,
|
||||||
|
#bottom_container {
|
||||||
|
background-color: #bb69f4;
|
||||||
|
border-radius: 20px;
|
||||||
|
width: 100%;
|
||||||
|
}
|
||||||
|
|
||||||
|
.right_container {
|
||||||
|
display: grid;
|
||||||
|
grid-template-rows: 450px 450px;
|
||||||
|
gap: 20px;
|
||||||
|
padding-top: 20px;
|
||||||
|
padding-right: 20px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.right_box {
|
||||||
|
background-color: #bb69f4;
|
||||||
|
border-radius: 20px;
|
||||||
|
width: 100%;
|
||||||
|
}
|
||||||
|
|
||||||
|
@media (max-width: 1000px) {
|
||||||
|
.container {
|
||||||
|
display: flex;
|
||||||
|
flex-direction: column;
|
||||||
|
padding-left: 20px;
|
||||||
|
padding-right: 20px;
|
||||||
|
}
|
||||||
|
|
||||||
|
#sidebar {
|
||||||
|
display: none;
|
||||||
|
height: 150px;
|
||||||
|
border-radius: 20px;
|
||||||
|
width: 100%;
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -16,6 +16,7 @@
|
|||||||
height: 100%;
|
height: 100%;
|
||||||
object-fit: cover;
|
object-fit: cover;
|
||||||
z-index: -1;
|
z-index: -1;
|
||||||
|
user-select: none;
|
||||||
}
|
}
|
||||||
|
|
||||||
#login_container {
|
#login_container {
|
||||||
@@ -57,12 +58,16 @@ h1 {
|
|||||||
}
|
}
|
||||||
|
|
||||||
button {
|
button {
|
||||||
|
border: none;
|
||||||
|
outline: none;
|
||||||
|
background-color: white;
|
||||||
display: block;
|
display: block;
|
||||||
margin-top: 20px;
|
margin-top: 20px;
|
||||||
margin-left: auto;
|
margin-left: auto;
|
||||||
margin-right: auto;
|
margin-right: auto;
|
||||||
width: max-content;
|
width: max-content;
|
||||||
padding: 8px;
|
padding: 10px;
|
||||||
padding-left: 18px;
|
padding-left: 20px;
|
||||||
padding-right: 18px;
|
padding-right: 20px;
|
||||||
|
border-radius: 8px;
|
||||||
}
|
}
|
||||||
@@ -0,0 +1,27 @@
|
|||||||
|
use dioxus::prelude::*;
|
||||||
|
|
||||||
|
const DASHBOARD_CSS: Asset = asset!("/assets/dashboard.css");
|
||||||
|
|
||||||
|
#[component]
|
||||||
|
pub fn Dashboard() -> Element {
|
||||||
|
rsx! {
|
||||||
|
document::Link { rel: "stylesheet", href: DASHBOARD_CSS }
|
||||||
|
|
||||||
|
div {
|
||||||
|
class: "container",
|
||||||
|
|
||||||
|
div { id: "sidebar" }
|
||||||
|
div {
|
||||||
|
class: "left_container",
|
||||||
|
div { id: "top_container" }
|
||||||
|
div { id: "mid_container" }
|
||||||
|
div { id: "bottom_container" }
|
||||||
|
}
|
||||||
|
div {
|
||||||
|
class: "right_container",
|
||||||
|
div { class: "right_box" }
|
||||||
|
div { class: "right_box" }
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
+10
-1
@@ -1,8 +1,14 @@
|
|||||||
use dioxus::prelude::*;
|
use dioxus::prelude::*;
|
||||||
|
|
||||||
|
use crate::Route;
|
||||||
|
|
||||||
|
const LOGIN_CSS: Asset = asset!("/assets/login.css");
|
||||||
|
|
||||||
#[component]
|
#[component]
|
||||||
pub fn Login() -> Element {
|
pub fn Login() -> Element {
|
||||||
rsx! {
|
rsx! {
|
||||||
|
document::Link { rel: "stylesheet", href: LOGIN_CSS }
|
||||||
|
|
||||||
div {
|
div {
|
||||||
id: "login_wrapper",
|
id: "login_wrapper",
|
||||||
|
|
||||||
@@ -24,7 +30,10 @@ pub fn Login() -> Element {
|
|||||||
input { class: "field" }
|
input { class: "field" }
|
||||||
}
|
}
|
||||||
|
|
||||||
button { "Login" }
|
Link {
|
||||||
|
to: Route::Dashboard { },
|
||||||
|
button { "Login" }
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
+4
-2
@@ -1,8 +1,10 @@
|
|||||||
mod backend;
|
mod backend;
|
||||||
|
mod dashboard;
|
||||||
mod login;
|
mod login;
|
||||||
|
|
||||||
use dioxus::prelude::*;
|
use dioxus::prelude::*;
|
||||||
|
|
||||||
|
use dashboard::Dashboard;
|
||||||
use login::Login;
|
use login::Login;
|
||||||
|
|
||||||
#[derive(Debug, Clone, Routable, PartialEq)]
|
#[derive(Debug, Clone, Routable, PartialEq)]
|
||||||
@@ -10,10 +12,11 @@ use login::Login;
|
|||||||
enum Route {
|
enum Route {
|
||||||
#[route("/")]
|
#[route("/")]
|
||||||
Login {},
|
Login {},
|
||||||
|
#[route("/dashboard")]
|
||||||
|
Dashboard {},
|
||||||
}
|
}
|
||||||
|
|
||||||
const FAVICON: Asset = asset!("/assets/favicon.ico");
|
const FAVICON: Asset = asset!("/assets/favicon.ico");
|
||||||
const MAIN_CSS: Asset = asset!("/assets/main.css");
|
|
||||||
const FONT_CSS: Asset = asset!("/assets/font.css");
|
const FONT_CSS: Asset = asset!("/assets/font.css");
|
||||||
|
|
||||||
fn main() {
|
fn main() {
|
||||||
@@ -24,7 +27,6 @@ fn main() {
|
|||||||
fn App() -> Element {
|
fn App() -> Element {
|
||||||
rsx! {
|
rsx! {
|
||||||
document::Link { rel: "icon", href: FAVICON }
|
document::Link { rel: "icon", href: FAVICON }
|
||||||
document::Link { rel: "stylesheet", href: MAIN_CSS }
|
|
||||||
document::Link { rel: "stylesheet", href: FONT_CSS }
|
document::Link { rel: "stylesheet", href: FONT_CSS }
|
||||||
Router::<Route> {}
|
Router::<Route> {}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user