diff --git a/jirs-client/dev/feedback.png b/jirs-client/dev/feedback.png new file mode 100644 index 00000000..dbaf66eb Binary files /dev/null and b/jirs-client/dev/feedback.png differ diff --git a/jirs-client/js/css/aside.css b/jirs-client/js/css/aside.css new file mode 100644 index 00000000..9ef9609d --- /dev/null +++ b/jirs-client/js/css/aside.css @@ -0,0 +1,106 @@ +aside#navbar-left { + z-index: var(--navLeft); + position: fixed; + top: 0; + left: 0; + overflow-x: hidden; + height: 100vh; + width: var(--appNavBarLeftWidth); + background: var(--backgroundDarkPrimary); + transition: all 0.1s; + transform: translateZ(0); +} + +aside#navbar-left:hover { + width: 200px; + box-shadow: 0 0 50px 0 rgba(0, 0, 0, 0.6); +} + +aside#navbar-left > .logoLink { + display: block; + position: relative; + left: 0; + margin: 20px 0 10px; + transition: left 0.1s; +} + +aside#navbar-left > .logoLink > .styledLogo { + display: inline-block; + margin-left: 8px; + padding: 10px; + cursor: pointer; + user-select: none; +} + +aside#navbar-left .item { + position: relative; + width: 100%; + height: 42px; + line-height: 42px; + padding-left: 64px; + color: #deebff; + transition: color 0.1s; + cursor: pointer; + user-select: none; +} + +aside#navbar-left .item:hover { + background: rgba(255, 255, 255, 0.1); +} + +aside#navbar-left .item > .styledIcon { + position: absolute; + left: 18px; +} + +aside#navbar-left > .item > .styledIcon.search { + font-size: 22px; + color: #DEEBFE; +} + +aside#navbar-left > .item > .styledIcon.plus { + font-size: 27px; + color: #DEEBFE; +} + +aside#navbar-left .item > .styledIcon.help { + font-size: 27px; + color: #DEEBFE; +} + +aside#navbar-left .item > .itemText { + position: relative; + right: 12px; + visibility: hidden; + opacity: 0; + text-transform: uppercase; + transition: all 0.1s; + font-family: var(--font-bold); + font-size: 12px; + transition-property: right, visibility, opacity; +} + +aside#navbar-left > .bottom { + position: absolute; + bottom: 20px; + left: 0; + width: 100%; +} + +aside#navbar-left > .bottom > .aboutTooltip {} + +aside#navbar-left:hover .item > .itemText { + right: 0; + visibility: visible; + opacity: 1; +} + +aside#navbar-left .styledTooltip { + z-index: calc(var(--modal) + 1); + position: fixed; + width: 300px; + border-radius: 3px; + background: #fff; + transform: translateZ(0); + box-shadow: rgba(9, 30, 66, 0.25) 0 4px 8px -2px, rgba(9, 30, 66, 0.31) 0 0 1px; +} diff --git a/jirs-client/js/css/variables.css b/jirs-client/js/css/variables.css index a60d8ccb..9cd1577e 100644 --- a/jirs-client/js/css/variables.css +++ b/jirs-client/js/css/variables.css @@ -46,9 +46,9 @@ } :root /* sizes */ { - --appNavBarLeftWidth: 64; - --secondarySideBarWidth: 230; - --minViewportWidth: 1000; + --appNavBarLeftWidth: 64px; + --secondarySideBarWidth: 230px; + --minViewportWidth: 1000px; } :root /* z-index */ { diff --git a/jirs-client/js/styles.css b/jirs-client/js/styles.css index c0e9cc43..c5cf28e6 100644 --- a/jirs-client/js/styles.css +++ b/jirs-client/js/styles.css @@ -3,6 +3,7 @@ @import "css/variables.css"; @import "css/global.css"; @import "css/sidebar.css"; +@import "css/aside.css"; @import "css/icon.css"; @import "css/shared.css"; @import "css/app.css"; diff --git a/jirs-client/src/shared.rs b/jirs-client/src/shared.rs index 313f4824..24581b1d 100644 --- a/jirs-client/src/shared.rs +++ b/jirs-client/src/shared.rs @@ -7,22 +7,58 @@ use jirs_data::FullProjectResponse; use crate::model::{Icon, Model, Page}; use crate::Msg; +pub fn navbar_left(model: &Model) -> Node { + let mut logo_svg = Node::from_html(include_str!("../static/logo.svg")); + + aside![ + id!["navbar-left"], + a![ + attrs![At::Class => "logoLink", At::Href => "/"], + div![attrs![At::Class => "styledLogo"], logo_svg] + ], + navbar_left_item(model, "Search issues", Icon::Search), + navbar_left_item(model, "Create Issue", Icon::Plus), + div![ + attrs![At::Class => "bottom"], + about_tooltip(model, navbar_left_item(model, "About", Icon::Help)) + ] + ] +} + +fn navbar_left_item(_model: &Model, text: &str, logo: Icon) -> Node { + div![ + attrs![At::Class => "item"], + i![attrs![At::Class => format!("styledIcon {}", logo)]], + span![attrs![At::Class => "itemText"], text] + ] +} + +pub fn about_tooltip(_model: &Model, children: Node) -> Node { + div![attrs![At::Class => "aboutTooltip"], children] +} + +pub fn styled_tooltip() -> Node { + div![attrs![At::Class => "styledTooltip"]] +} + pub fn sidebar(model: &Model) -> Node { + let project_icon = Node::from_html(include_str!("../static/project-avatar.svg")); let project_info = match model.project.as_ref() { Some(project) => li![ id!["projectInfo"], + project_icon, div![ - attrs![At::Class => ".projectTexts";], - div![attrs![At::Class => ".projectName";], project.name], - div![attrs![At::Class => ".projectCategory";], project.category] + attrs![At::Class => "projectTexts";], + div![attrs![At::Class => "projectName";], project.name], + div![attrs![At::Class => "projectCategory";], project.category] ], ], _ => li![ id!["projectInfo"], div![ - attrs![At::Class => ".projectTexts";], - div![attrs![At::Class => ".projectName";], ""], - div![attrs![At::Class => ".projectCategory";], ""] + attrs![At::Class => "projectTexts";], + div![attrs![At::Class => "projectName";], ""], + div![attrs![At::Class => "projectCategory";], ""] ], ], }; @@ -71,7 +107,12 @@ pub fn divider() -> Node { } pub fn inner_layout(model: &Model, children: Node) -> Node { - article![id!["inner-layout"], sidebar(model), children,] + article![ + id!["inner-layout"], + navbar_left(model), + sidebar(model), + children, + ] } pub fn host_client(host_url: String, path: &str) -> Result { diff --git a/jirs-client/static/logo.svg b/jirs-client/static/logo.svg new file mode 100644 index 00000000..b6646d0e --- /dev/null +++ b/jirs-client/static/logo.svg @@ -0,0 +1,45 @@ + + + + + + + + + Jira Software-blue + + + + + + + + diff --git a/jirs-client/static/project-avatar.svg b/jirs-client/static/project-avatar.svg new file mode 100644 index 00000000..6263be5e --- /dev/null +++ b/jirs-client/static/project-avatar.svg @@ -0,0 +1,95 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + +