From b29a34043ba93350433c26d4a60bda67d4b35a40 Mon Sep 17 00:00:00 2001 From: psychobunny Date: Fri, 17 Apr 2015 15:17:53 -0400 Subject: [PATCH] material design style taskbar --- lib/persona.js | 19 ++++++++ modules/taskbar.less | 102 +++++++++++++++++++++++++++++-------------- 2 files changed, 89 insertions(+), 32 deletions(-) diff --git a/lib/persona.js b/lib/persona.js index 15558bc..76b862f 100644 --- a/lib/persona.js +++ b/lib/persona.js @@ -1,5 +1,7 @@ "use strict"; +/*globals config, utils*/ + $(document).ready(function() { setupSlideMenu(); @@ -40,6 +42,23 @@ $(document).ready(function() { $('.navbar-header button').click(); } }); + + $(window).on('filter:taskbar.push', function(ev, data) { + data.options.className = 'taskbar-' + data.module; + + if (data.module === 'composer') { + data.options.icon = 'fa-plus'; + } else if (data.module === 'chat') { + data.options.icon = 'fa-spinner fa-spin'; + + $.getJSON(config.relative_path + '/api/user/' + utils.slugify(data.options.title), function(user) { + var el = $('#taskbar [data-uuid="' + data.uuid + '"] a'); + el.find('i').remove(); + el.css('background-image', 'url(' + user.picture + ')'); + }); + } + + }); } diff --git a/modules/taskbar.less b/modules/taskbar.less index a429d22..97cfe1d 100644 --- a/modules/taskbar.less +++ b/modules/taskbar.less @@ -3,11 +3,13 @@ .taskbar { display: none; z-index: 10001; - -moz-opacity: 0.75; - opacity: 0.75; + margin-top: 0; .transition(.15s ease-in opacity); + background: none; + border: none; + &[data-active="1"] { display: block; } @@ -21,43 +23,79 @@ min-height: 32px; } - li { - float: left; + .navbar-nav { + padding-right: 15px; + padding-bottom: 15px; - &.new a { - -webkit-animation: taskbar-active 3s infinite; - -moz-animation: taskbar-active 3s infinite; - -o-animation: taskbar-active 3s infinite; - animation: taskbar-active 3s infinite; - } + li { + float: left; + + &.new a { + -webkit-animation: taskbar-active 3s infinite; + -moz-animation: taskbar-active 3s infinite; + -o-animation: taskbar-active 3s infinite; + animation: taskbar-active 3s infinite; + } - a { - padding: 3px 15px; - font-size: 13px; + a { + padding: 3px 15px; + font-size: 13px; - > span { - max-width: 200px; - text-overflow: ellipsis; - white-space: nowrap; - overflow: hidden; + border-radius: 50%; + height: 50px; + width: 50px; + + > span { + display: none; + } } - } - img { - max-width: 24px; - max-height: 24px; - margin-right: 1em; - } + img { + max-width: 24px; + max-height: 24px; + margin-right: 1em; + } - &.pulse { - -webkit-animation: pulsate 2500ms linear; - -webkit-animation-iteration-count: infinite; - } + &.pulse { + -webkit-animation: pulsate 2500ms linear; + -webkit-animation-iteration-count: infinite; + } + + @-webkit-keyframes pulsate { + 0% { background: none; } + 50% { background: #e5e5e5; } + 100% { background: none; } + } + + &.taskbar-composer { + a, a:hover, a:focus, a:active { + background: #f44336; + } + } - @-webkit-keyframes pulsate { - 0% { background: none; } - 50% { background: #e5e5e5; } - 100% { background: none; } + &.taskbar-chat { + a, a:hover, a:focus, a:active { + background: none; + background-size: cover; + + i { + color: @gray; + } + } + } + + &.taskbar-composer, &.taskbar-chat { + a { + text-align: center; + margin-left: 15px; + + i { + font-size: 18px; + margin-top: 12px; + color: #FFF; + } + } + } } }