From 867917ff6ebf83b7f53bd1b8c03e87c2a9a7357c Mon Sep 17 00:00:00 2001 From: Maxime Poulin Date: Sat, 20 Feb 2016 20:28:45 -0500 Subject: [PATCH] Fade long channel names in sidebar --- client/css/style.css | 42 ++++++++++++++++++++++++++++++++++++++---- client/views/chan.tpl | 2 +- 2 files changed, 39 insertions(+), 5 deletions(-) diff --git a/client/css/style.css b/client/css/style.css index 1f9c1810..4abf27a7 100644 --- a/client/css/style.css +++ b/client/css/style.css @@ -287,7 +287,7 @@ button, #sidebar .chan-placeholder { display: block; margin: 1px -10px; - padding: 6px 10px 8px; + padding: 6px 10px 8px 36px; position: relative; text-align: left; transition: color .2s; @@ -319,6 +319,12 @@ button, text-align: center; } +#sidebar .chan:before { + position: absolute; + top: 4px; + left: 10px; +} + #chat .title:before { margin-top: 17px; } @@ -340,22 +346,49 @@ button, #sidebar .chan:hover .badge { opacity: 0; + position: absolute; + z-index: 1; + right: 10px; } #sidebar .chan:hover .close { opacity: .2; } +#sidebar .chan:hover .name { + margin-right: 16px; +} + +#sidebar .chan .name { + position: relative; + z-index: 0; + display: block; + overflow: hidden; + white-space: nowrap; + margin-right: 5px; +} + +#sidebar .chan .name:after { + position: absolute; + top: 0; + right: 0; + bottom: 0; + width: 20px; + background: linear-gradient(to right, rgba(69, 81, 100, 0) 0%, rgba(69, 81, 100, 1) 100%); + content: " "; +} + #sidebar .badge { background: rgba(255, 255, 255, .06); border-radius: 3px; color: #afb6c0; font-size: 10px; margin-top: 1px; + margin-right: -5px; + margin-left: 5px; padding: 3px 6px; - position: absolute; - right: 5px; - transition: all .2s; + float: right; + transition: opacity .2s; } #sidebar .badge.highlight { @@ -372,6 +405,7 @@ button, margin-right: 5px; opacity: 0; position: absolute; + z-index: 2; right: 0; transition: all .2s; } diff --git a/client/views/chan.tpl b/client/views/chan.tpl index 58d170ec..37b18b33 100644 --- a/client/views/chan.tpl +++ b/client/views/chan.tpl @@ -2,6 +2,6 @@
{{#if unread}}{{unread}}{{/if}} - {{name}} + {{name}}
{{/each}}