From d41a2670faa86979605bdf9514e80db63fa314c7 Mon Sep 17 00:00:00 2001 From: Juan de la Cruz Date: Tue, 15 Dec 2015 22:56:03 +0100 Subject: [PATCH] add library bar and grid --- frontend/uxbox/ui/elements.cljs | 14 +- frontend/uxbox/ui/library_bar.cljs | 84 ++++++++++++ .../public/styles/partials/dashboard-bar.scss | 4 +- .../styles/partials/dashboard-grid.scss | 56 +++++++- .../public/styles/partials/library-bar.scss | 121 ++++++++++-------- .../public/styles/partials/main-bar.scss | 2 +- 6 files changed, 220 insertions(+), 61 deletions(-) create mode 100644 frontend/uxbox/ui/library_bar.cljs diff --git a/frontend/uxbox/ui/elements.cljs b/frontend/uxbox/ui/elements.cljs index d2e9f7da5..a9e65dc78 100644 --- a/frontend/uxbox/ui/elements.cljs +++ b/frontend/uxbox/ui/elements.cljs @@ -2,6 +2,7 @@ (:require [sablono.core :as html :refer-macros [html]] [rum.core :as rum] [uxbox.ui.header :as ui.header] + [uxbox.ui.library-bar :as ui.library-bar] [uxbox.ui.icons :as icons] [uxbox.util :as util])) @@ -15,16 +16,25 @@ [:main.dashboard-main (ui.header/header) [:section.dashboard-content - [:section#dashboard-bar.dashboard-bar.library-bar + [:section#dashboard-bar.dashboard-bar.library-gap [:div.dashboard-info [:span.dashboard-projects "20 elements"] [:span "Sort by"] #_(project-sort-selector (atom :name))] [:div.dashboard-search icons/search]] + (ui.library-bar/library-bar) [:section.dashboard-grid.library - [:h2 "Library name"] + [:div.dashboard-title + [:h2 "Library name"] + [:div.edition + [:span icons/pencil] + [:span icons/trash] + ] + ] [:div.dashboard-grid-content + [:div.grid-item.add-project + [:span "+ New element"]] [:div.grid-item.project-th [:span.grid-item-image icons/image] [:h3 "Custom element"] diff --git a/frontend/uxbox/ui/library_bar.cljs b/frontend/uxbox/ui/library_bar.cljs new file mode 100644 index 000000000..44fe3360e --- /dev/null +++ b/frontend/uxbox/ui/library_bar.cljs @@ -0,0 +1,84 @@ +(ns uxbox.ui.library-bar + (:require [sablono.core :as html :refer-macros [html]] + [rum.core :as rum] + [uxbox.util :as util] + [uxbox.ui.icons :as i])) + +(defn library-bar-render + [own] + (html + [:div.library-bar + [:div.library-bar-inside + [:ul.library-tabs + [:li "STANDARD"] + [:li.current "YOUR WIDGETS"] + ] + [:ul.library-elements + [:li + [:a.btn-primary {:href "#"} "+ New library"] + ] + [:li + [:span.element-title "Forms"] + [:span.element-subtitle "21 widgets"] + ] + [:li + [:span.element-title "Forms"] + [:span.element-subtitle "21 widgets"] + ] + [:li + [:span.element-title "Forms"] + [:span.element-subtitle "21 widgets"] + ] + [:li + [:span.element-title "Forms"] + [:span.element-subtitle "21 widgets"] + ] + [:li + [:span.element-title "Forms"] + [:span.element-subtitle "21 widgets"] + ] + [:li + [:span.element-title "Forms"] + [:span.element-subtitle "21 widgets"] + ] + [:li + [:span.element-title "Forms"] + [:span.element-subtitle "21 widgets"] + ] + [:li + [:span.element-title "Forms"] + [:span.element-subtitle "21 widgets"] + ] + [:li + [:span.element-title "Forms"] + [:span.element-subtitle "21 widgets"] + ] + [:li + [:span.element-title "Forms"] + [:span.element-subtitle "21 widgets"] + ] + [:li + [:span.element-title "Forms"] + [:span.element-subtitle "21 widgets"] + ] + [:li + [:span.element-title "Forms"] + [:span.element-subtitle "21 widgets"] + ] + [:li + [:span.element-title "Forms"] + [:span.element-subtitle "21 widgets"] + ] + [:li + [:span.element-title "Forms"] + [:span.element-subtitle "21 widgets"] + ] + ] + ] + ])) + +(def ^:static library-bar + (util/component + {:render library-bar-render + :name "library-bar" + :mixins [rum/static]})) diff --git a/resources/public/styles/partials/dashboard-bar.scss b/resources/public/styles/partials/dashboard-bar.scss index 389b2e054..19b89c59a 100644 --- a/resources/public/styles/partials/dashboard-bar.scss +++ b/resources/public/styles/partials/dashboard-bar.scss @@ -44,8 +44,8 @@ } - &.library-bar { - padding: $small $medium $small 230px; + &.library-gap { + padding: $small $medium $small 270px; } } diff --git a/resources/public/styles/partials/dashboard-grid.scss b/resources/public/styles/partials/dashboard-grid.scss index d44f30a9e..5e5606465 100644 --- a/resources/public/styles/partials/dashboard-grid.scss +++ b/resources/public/styles/partials/dashboard-grid.scss @@ -5,6 +5,46 @@ font-size: $fs14; padding: $medium 250px $medium $medium; + .dashboard-title { + position: relative; + width: 100%; + + h2 { + text-align: center; + width: 100%; + } + + .edition { + align-items: center; + display: flex; + position: absolute; + right: 40px; + top: 0; + + span { + cursor: pointer; + + svg { + fill: $color-gray; + height: 20px; + margin: 0 10px; + width: 20px; + } + + &:hover { + + svg { + fill: $color-gray-darker; + } + + } + + } + + } + + } + .dashboard-grid-content { align-items: center; box-sizing: border-box; @@ -13,9 +53,10 @@ height: 100%; justify-content: center; margin: $big; - max-height: 75vh; + max-height: 77vh; min-height: 60vh; overflow: scroll; + padding-bottom: 30px; width: 100%; .grid-item { @@ -148,6 +189,19 @@ // STYLES FOR LIBRARIES &.library { padding: $medium $medium $medium 250px; + + .dashboard-grid-content { + + .grid-item { + + h3 { + font-size: $fs18; + } + + } + + } + } } diff --git a/resources/public/styles/partials/library-bar.scss b/resources/public/styles/partials/library-bar.scss index bbc5764f6..a50f02562 100644 --- a/resources/public/styles/partials/library-bar.scss +++ b/resources/public/styles/partials/library-bar.scss @@ -1,75 +1,86 @@ -.activity-bar { +.library-bar { background-color: $color-white; bottom: 0; height: 100%; + left: 0; position: fixed; - right: 0; width: 250px; - .activity-bar-inside { - align-items: center; + .library-bar-inside { display: flex; flex-direction: column; - overflow-y: auto; - padding-top: 70px; - } + height: 100%; + padding-top: 60px; - h4 { - color: $color-gray-dark; - font-size: $fs16; - font-weight: bold; - margin-bottom: $x-small; - } - - .date-ribbon { - background-color: lighten($color-gray-light, 12%); - box-sizing: border-box; - color: $color-white; - font-size: $fs12; - font-weight: bold; - padding: 2px; - text-align: center; - width: 100%; - } - - .activity-input { - border-bottom: 1px solid $color-gray-lighter; - box-sizing: border-box; - display: flex; - font-size: $fs13; - padding: $small; - width: 100%; - - img.activity-author { - border-radius: 50%; - flex-shrink: 0; - height: 30px; - margin-right: $medium; - width: 30px; - } - - .activity-content { + .library-tabs { + align-items: center; + background-color: $color-gray-lighter; display: flex; - flex-direction: column; + justify-content: space-around; + margin: 0; + padding-top: 12px; - .activity-project { - align-items: center; - display: flex; - flex-wrap: wrap; + li { + background-color: darken($color-gray-lighter, 10%); + border-top-left-radius: 3px; + border-top-right-radius: 3px; + color: $color-gray; + cursor: pointer; + font-weight: bold; + padding: .6rem; - a { - font-weight: bold; - margin: 0 3px; + &:hover { + color: $color-white; + } + + &.current { + background-color: $color-white; + color: $color-primary; } } - .activity-time { - color: $color-gray-light; - font-size: $fs11; - font-style: italic; - } } + + .library-elements { + display: flex; + flex-direction: column; + height: 85%; + overflow-y: auto; + padding-bottom: 20px; + + li { + border-bottom: 1px solid $color-gray-lighter; + cursor: pointer; + display: flex; + flex-direction: column; + padding: 10px; + + .element-title { + color: $color-gray-dark; + font-weight: bold; + margin-bottom: 5px; + } + + .element-subtitle { + color: $color-gray-light; + font-style: italic; + } + + &:hover, + .current { + background-color: $color-primary; + + .element-title, + .element-subtitle { + color: $color-white; + } + } + + } + + } + } } diff --git a/resources/public/styles/partials/main-bar.scss b/resources/public/styles/partials/main-bar.scss index f0a360365..09a0537c7 100644 --- a/resources/public/styles/partials/main-bar.scss +++ b/resources/public/styles/partials/main-bar.scss @@ -23,7 +23,7 @@ align-items: center; display: flex; height: 50px; - margin: 0 0 0 100px; + margin: 0 0 0 120px; li {