fradrive/templates/standalone/alerts.lucius
2018-09-17 00:00:00 +02:00

163 lines
2.6 KiB
Plaintext

/* ALERTS */
/**
.alert
Regular Info Alert
Disappears automatically after 30 seconds
Disappears after x seconds if explicitly specified via data-decay='x' on html element
Can be told not to disappear with data-decay='0'
.alert-warning, .alert-error
Warning or Error alert
These 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;
}
.alert {
position: relative;
display: inline-block;
background-color: var(--color-dark);
font-size: 1rem;
color: var(--color-lightwhite);
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;
margin-bottom: 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;
max-width: 420px;
}
}
@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;
text-align: left;
}
@media (max-width: 768px) {
.alert__content {
padding: 4px 7px;
padding-left: 25px;
}
}
.alert__close {
cursor: pointer;
text-align: right;
position: absolute;
left: 0px;
top: 0;
width: 60px;
height: 100%;
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;
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);
}
.alert-danger,
.alert-error {
background-color: var(--color-error);
}
.alert--invisible {
max-height: 0;
transform: translateX(120%);
margin-bottom: 0;
overflow: hidden;
}