1
0
mirror of https://github.com/ascribe/onion.git synced 2025-02-14 21:10:27 +01:00

Change alignment of global notifications

Use left text alignment for desktop  and center alignment for mobile
notifications.

Also adds a slight transition delay before showing the notification
because react can sometimes be slow at rendering the notification’s
message, making it initially appear invisible.
This commit is contained in:
Brett Sun 2016-01-19 18:07:04 +01:00
parent 3cea407ae6
commit f8193a5e16

View File

@ -7,23 +7,23 @@
position: fixed; position: fixed;
transition: .2s bottom cubic-bezier(.77, 0, .175, 1); transition: .2s bottom cubic-bezier(.77, 0, .175, 1);
width: 100%; width: 100%;
> div {
padding: .5em 1em;
text-align: center;
} }
.ascribe-global-notification-off { &.ascribe-global-notification-off {
bottom: -3.5em; bottom: -5em;
} }
.ascribe-global-notification-on { &.ascribe-global-notification-on {
bottom: 0; bottom: 0;
}
.ascribe-global-notification > div, // React can sometimes take some time to load the notification message,
.ascribe-global-notification-bubble > div { // so add a small delay before showing the notification
display: table-cell; transition-delay: 0.2s;
font-size: 1.25em; }
padding-right: 3em;
text-align: left;
vertical-align: middle;
} }
.ascribe-global-notification-bubble { .ascribe-global-notification-bubble {
@ -33,21 +33,33 @@
color: white; color: white;
display: table; display: table;
height: 3.5em; height: 3.5em;
max-width: 75%;
position: fixed; position: fixed;
right: -50em; transition: 0.5s right ease;
transition: 1s right ease;
> div { > div {
padding: .75em 1.5em; padding: .75em 1.5em;
} text-align: left;
} }
.ascribe-global-notification-bubble-off { &.ascribe-global-notification-bubble-off {
right: -100em; right: -100em;
} }
.ascribe-global-notification-bubble-on { &.ascribe-global-notification-bubble-on {
right: 3.5em; right: 3.5em;
// React can sometimes take some time to load the notification message,
// so add a small delay before showing the notification
transition-delay: 0.5s;
}
}
.ascribe-global-notification > div,
.ascribe-global-notification-bubble > div {
display: table-cell;
font-size: 1.25em;
vertical-align: middle;
} }
.ascribe-global-notification-danger { .ascribe-global-notification-danger {