react-fresh-toast
Version:
React notification made easy
123 lines (108 loc) • 1.85 kB
CSS
.toast {
outline: none;
padding: 15px 20px;
margin: 10px;
color: #fff;
display: flex;
align-items: center;
border-radius: 10px;
box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
background: linear-gradient(145deg, rgba(0, 0, 0, 0.2), rgba(0, 0, 0, 0.4));
font-family: 'Arial', sans-serif;
font-size: 14px;
border: 1px solid rgba(0, 0, 0, 0.1);
transition: transform 0.3s ease, box-shadow 0.3s ease;
}
.success {
background-color: #4caf50;
}
.info {
background-color: #2196f3;
}
.warning {
background-color: #ff9800;
}
.error {
background-color: #f44336;
}
/* Positioning */
.top-right {
position: fixed;
top: 20px;
right: 20px;
}
.top-left {
position: fixed;
top: 20px;
left: 20px;
}
.bottom-right {
position: fixed;
bottom: 20px;
right: 20px;
}
.bottom-left {
position: fixed;
bottom: 20px;
left: 20px;
}
.top-center {
position: fixed;
top: 20px;
left: 50%;
transform: translateX(-50%);
}
.toast-container {
display: flex;
align-items: flex-end;
}
.toast-container.bottom {
flex-direction: column-reverse;
}
.toast-container.top {
flex-direction: column;
}
.closeBtn {
margin-left: 5px;
background: none;
border: none;
padding: 0;
cursor: pointer;
display: flex;
align-items: center;
}
@keyframes fadeIn {
from {
opacity: 0;
}
to {
opacity: 1;
}
}
@keyframes popup {
from {
transform: scale(0.5);
opacity: 0;
}
to {
transform: scale(1);
opacity: 1;
}
}
@keyframes slideIn {
from {
transform: translateY(100%);
}
to {
transform: translateY(0);
}
}
.fadeIn {
animation: fadeIn 0.5s;
}
.popup {
animation: popup 0.5s ease-out;
}
.slideIn {
animation: slideIn 0.5s ease-out;
}