Merge pull request #3063 from thelounge/astorije/scroll-down-btn-ui

Improve scroll-down button UI
This commit is contained in:
Jérémie Astori 2019-02-18 14:12:46 -05:00 committed by GitHub
commit 0c4e35b309
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 21 additions and 13 deletions

View File

@ -58,7 +58,8 @@
v-else v-else
class="chat-content"> class="chat-content">
<div <div
:class="['scroll-down', {'scroll-down-shown': !channel.scrolledToBottom}]" :class="['scroll-down tooltipped tooltipped-w', {'scroll-down-shown': !channel.scrolledToBottom}]"
aria-label="Jump to recent messages"
@click="$refs.messageList.jumpToBottom()"> @click="$refs.messageList.jumpToBottom()">
<div class="scroll-down-arrow" /> <div class="scroll-down-arrow" />
</div> </div>

View File

@ -11,6 +11,10 @@
/* Background color of the whole page */ /* Background color of the whole page */
--body-bg-color: #415364; --body-bg-color: #415364;
/* Main button color. Applies to border, text, and background on hover */
--button-color: #84ce88;
--button-text-color-hover: #fff;
/* Links and link-looking buttons */ /* Links and link-looking buttons */
--link-color: #50a656; --link-color: #50a656;
@ -155,9 +159,9 @@ kbd {
} }
.btn { .btn {
border: 2px solid #84ce88; border: 2px solid var(--button-color);
border-radius: 3px; border-radius: 3px;
color: #84ce88; color: var(--button-color);
display: inline-block; display: inline-block;
font-size: 12px; font-size: 12px;
font-weight: bold; font-weight: bold;
@ -177,8 +181,8 @@ kbd {
.btn:disabled, .btn:disabled,
.btn:hover, .btn:hover,
.btn:focus { .btn:focus {
background: #84ce88; background: var(--button-color);
color: #fff; color: var(--button-text-color-hover);
opacity: 1; opacity: 1;
} }
@ -1097,7 +1101,7 @@ background on hover (unless active) */
pointer-events: none; pointer-events: none;
opacity: 0; opacity: 0;
transform: translateY(16px); transform: translateY(16px);
transition: all 0.2s ease-in-out; transition: transform 0.2s, opacity 0.2s;
cursor: pointer; cursor: pointer;
} }
@ -1108,18 +1112,21 @@ background on hover (unless active) */
} }
.scroll-down-arrow { .scroll-down-arrow {
width: 48px; width: 36px;
height: 48px; height: 36px;
line-height: 48px; line-height: 34px;
border-radius: 50%; border-radius: 50%;
background: #fff; background: var(--window-bg-color);
color: #333; color: var(--button-color);
border: 1px solid #84ce88; border: 2px solid var(--button-color);
text-align: center; text-align: center;
transition: background 0.2s, color 0.2s;
box-shadow: 0 6px 10px 0 rgba(0, 0, 0, 0.15);
} }
.scroll-down:hover .scroll-down-arrow { .scroll-down:hover .scroll-down-arrow {
background: #84ce88; background: var(--button-color);
color: var(--button-text-color-hover);
} }
.scroll-down-arrow::after { .scroll-down-arrow::after {