🍞 Toast Notification

Всплывающие уведомления с различными стилями

← Назад к Уведомления
Success Toast
HTML
<div class="toast-success">
  <span class="toast-icon">✓</span>
  <div class="toast-content">
    <div class="toast-title">Success!</div>
    <div class="toast-message">Your changes have been saved.</div>
  </div>
  <button class="toast-close">×</button>
</div>
CSS
.toast-success {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  padding: 1rem 1.25rem;
  background: white;
  border-left: 4px solid #43e97b;
  border-radius: 8px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.1);
  width: 320px;
  animation: slideIn 0.3s ease;
}
.toast-icon {
  width: 24px;
  height: 24px;
  background: linear-gradient(135deg, #43e97b 0%, #38f9d7 100%);
  color: white;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: bold;
  font-size: 14px;
  flex-shrink: 0;
}
.toast-content {
  flex: 1;
}
.toast-title {
  font-size: 0.95rem;
  font-weight: 700;
  color: #1a1a2e;
  margin-bottom: 0.25rem;
}
.toast-message {
  font-size: 0.85rem;
  color: #666;
  line-height: 1.4;
}
.toast-close {
  background: none;
  border: none;
  color: #999;
  font-size: 1.25rem;
  cursor: pointer;
  padding: 0;
  line-height: 1;
  transition: color 0.2s;
}
.toast-close:hover {
  color: #1a1a2e;
}
@keyframes slideIn {
  from { transform: translateX(100%); opacity: 0; }
  to { transform: translateX(0); opacity: 1; }
}
Error Toast
HTML
<div class="toast-error">
  <span class="toast-icon">✕</span>
  <div class="toast-content">
    <div class="toast-title">Error!</div>
    <div class="toast-message">Something went wrong. Please try again.</div>
  </div>
  <button class="toast-close">×</button>
</div>
CSS
.toast-error {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  padding: 1rem 1.25rem;
  background: white;
  border-left: 4px solid #ef3b53;
  border-radius: 8px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.1);
  width: 320px;
  animation: slideIn 0.3s ease;
}
.toast-icon {
  width: 24px;
  height: 24px;
  background: linear-gradient(135deg, #ef3b53 0%, #f5576c 100%);
  color: white;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: bold;
  font-size: 14px;
  flex-shrink: 0;
}
.toast-content {
  flex: 1;
}
.toast-title {
  font-size: 0.95rem;
  font-weight: 700;
  color: #1a1a2e;
  margin-bottom: 0.25rem;
}
.toast-message {
  font-size: 0.85rem;
  color: #666;
  line-height: 1.4;
}
.toast-close {
  background: none;
  border: none;
  color: #999;
  font-size: 1.25rem;
  cursor: pointer;
  padding: 0;
  line-height: 1;
  transition: color 0.2s;
}
.toast-close:hover {
  color: #1a1a2e;
}
@keyframes slideIn {
  from { transform: translateX(100%); opacity: 0; }
  to { transform: translateX(0); opacity: 1; }
}
Gradient Toast
HTML
<div class="toast-gradient">
  <span class="toast-gradient-icon">🔔</span>
  <div class="toast-gradient-content">
    <div class="toast-gradient-title">New Message!</div>
    <div class="toast-gradient-message">You have 3 new notifications.</div>
  </div>
</div>
CSS
.toast-gradient {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 1rem 1.25rem;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  border-radius: 12px;
  box-shadow: 0 8px 24px rgba(102, 126, 234, 0.3);
  width: 320px;
  color: white;
  animation: slideIn 0.3s ease;
}
.toast-gradient-icon {
  font-size: 1.5rem;
  flex-shrink: 0;
}
.toast-gradient-content {
  flex: 1;
}
.toast-gradient-title {
  font-size: 0.95rem;
  font-weight: 700;
  margin-bottom: 0.25rem;
}
.toast-gradient-message {
  font-size: 0.85rem;
  opacity: 0.9;
  line-height: 1.4;
}
@keyframes slideIn {
  from { transform: translateX(100%); opacity: 0; }
  to { transform: translateX(0); opacity: 1; }
}