fradrive/templates/standalone/alerts.lucius
2018-07-06 00:41:21 +02:00

193 lines
3.2 KiB
Plaintext

/* ALERTS */
/**
.alert
Regular Info Alert
Disappears automatically after 3 seconds
Disappears after x seconds if sepcified via data-decay='x'
Can be told not to disappear with data-decay='0'
.alert-warning, .alert-error
Warning or Error alert
Don't disappear, only difference is color
.alert-warning is orange regardless of user's selected theme
.alert-error is red regardless of user's selected theme
*/
.alerts {
position: fixed;
bottom: 5%;
right: 0;
z-index: 20;
text-align: right;
display: flex;
flex-direction: column;
}
@media (min-width: 768px) {
.alerts {
top: 150px;
bottom: auto;
}
}
.alert {
position: relative;
display: inline-block;
background-color: var(--color-dark);
font-size: 1rem;
color: #f3f3f3;
z-index: 0;
max-height: 200px;
transition: all .3s ease-in-out;
padding-left: 20px;
margin-left: 20px;
animation: slide-in-alert .2s ease-out forwards;
+ .alert:not(.alert--invisible) {
margin-top: 20px;
}
&:hover {
.alert__content {
&::after {
opacity: 1;
}
}
}
}
@keyframes slide-in-alert {
from {
left: 120%;
}
to {
left: 0;
}
}
@media (min-width: 425px) {
.alert {
margin-left: 80px;
}
}
@media (min-width: 768px) {
.alert {
padding-left: 30px;
margin-left: 40px;
min-width: 400px;
}
}
@media (min-width: 1024px) {
.alert {
min-width: 350px;
}
}
.alert__content {
padding: 8px 1.5em;
min-height: 40px;
position: relative;
display: flex;
font-weight: 600;
justify-content: flex-end;
align-items: center;
}
@media (max-width: 768px) {
.alert__content {
padding: 4px 7px;
padding-left: 20px;
}
}
.alert__close {
cursor: pointer;
text-align: right;
position: absolute;
left: 0px;
top: 0;
width: 60px;
height: 100%;
/* TODO: remove next line as soon as messagerenderer-error in julius gets resolved */
color: var(--color-dark);
transition: all .3s ease;
z-index: 40;
&:hover {
transform: scale(1.05, 1.05);
&::before {
box-shadow: 0 0 4px white;
background-color: rgba(255, 255, 255, 0.1);
color: white;
}
}
&::before {
content: '\f00d';
position: absolute;
font-family: "Font Awesome 5 Free";
top: 50%;
left: 50%;
display: flex;
color: rgba(255, 255, 255, 0.5);
align-items: center;
justify-content: center;
transform: translate(-50%, -50%);
border-radius: 50%;
width: 30px;
height: 30px;
transition: all .15s ease;
}
}
@media (max-width: 768px) {
.alert__close {
width: 40px;
}
}
.alert-warning {
background-color: var(--color-warning);
color: var(--color-dark);
.alert__close {
color: var(--color-warning);
/* TODO: remove me as soon as messagerenderer-error in julius gets resolved */
&::before {
color: var(--color-dark);
}
}
}
.alert-danger,
.alert-error {
background-color: var(--color-error);
color: var(--color-lightwhite);
.alert__close {
color: var(--color-error);
/* TODO: remove me as soon as messagerenderer-error in julius gets resolved */
&::before {
color: var(--color-lightwhite);
}
}
}
.alert--invisible {
max-height: 0;
transform: translateX(120%);
}