✅ Confirmation Modal
Модальные окна подтверждения действия
← Назад к Модальные окна
Delete Confirmation
HTML
<div class="modal-overlay">
<div class="modal-confirm">
<div class="modal-confirm-icon danger">
<span>🗑️</span>
</div>
<h3 class="modal-confirm-title">Delete Item?</h3>
<p class="modal-confirm-text">This action cannot be undone. The item will be permanently removed from your account.</p>
<div class="modal-confirm-actions">
<button class="modal-confirm-cancel">Cancel</button>
<button class="modal-confirm-delete">Delete</button>
</div>
</div>
</div>
CSS
.modal-overlay {
position: relative;
width: 100%;
min-height: 400px;
background: rgba(0, 0, 0, 0.5);
display: flex;
align-items: center;
justify-content: center;
padding: 2rem;
border-radius: 8px;
}
.modal-confirm {
background: white;
border-radius: 16px;
width: 400px;
max-width: 100%;
padding: 2rem;
text-align: center;
box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
animation: modalFadeIn 0.3s ease;
}
.modal-confirm-icon {
width: 70px;
height: 70px;
border-radius: 50%;
display: flex;
align-items: center;
justify-content: center;
margin: 0 auto 1.25rem;
font-size: 2rem;
}
.modal-confirm-icon.danger {
background: rgba(239, 59, 83, 0.1);
}
.modal-confirm-title {
margin: 0 0 0.75rem;
font-size: 1.3rem;
font-weight: 700;
color: #1a1a2e;
}
.modal-confirm-text {
margin: 0 0 1.5rem;
font-size: 0.95rem;
color: #666;
line-height: 1.6;
}
.modal-confirm-actions {
display: flex;
gap: 0.75rem;
}
.modal-confirm-cancel {
flex: 1;
padding: 0.75rem;
background: #f5f5f5;
color: #666;
border: none;
border-radius: 8px;
font-weight: 600;
cursor: pointer;
transition: all 0.2s;
}
.modal-confirm-cancel:hover {
background: #e0e0e0;
}
.modal-confirm-delete {
flex: 1;
padding: 0.75rem;
background: linear-gradient(135deg, #ef3b53 0%, #f5576c 100%);
color: white;
border: none;
border-radius: 8px;
font-weight: 600;
cursor: pointer;
transition: all 0.3s;
}
.modal-confirm-delete:hover {
transform: translateY(-1px);
box-shadow: 0 4px 12px rgba(239, 59, 83, 0.4);
}
@keyframes modalFadeIn {
from { opacity: 0; transform: scale(0.95); }
to { opacity: 1; transform: scale(1); }
}
Success Confirmation
HTML
<div class="modal-overlay">
<div class="modal-confirm">
<div class="modal-confirm-icon success">
<span>✓</span>
</div>
<h3 class="modal-confirm-title">Order Placed!</h3>
<p class="modal-confirm-text">Your order has been successfully placed. You will receive a confirmation email shortly.</p>
<button class="modal-confirm-ok">OK</button>
</div>
</div>
CSS
.modal-overlay {
position: relative;
width: 100%;
min-height: 400px;
background: rgba(0, 0, 0, 0.5);
display: flex;
align-items: center;
justify-content: center;
padding: 2rem;
border-radius: 8px;
}
.modal-confirm {
background: white;
border-radius: 16px;
width: 400px;
max-width: 100%;
padding: 2rem;
text-align: center;
box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
animation: modalFadeIn 0.3s ease;
}
.modal-confirm-icon {
width: 70px;
height: 70px;
border-radius: 50%;
display: flex;
align-items: center;
justify-content: center;
margin: 0 auto 1.25rem;
font-size: 2rem;
font-weight: bold;
}
.modal-confirm-icon.success {
background: linear-gradient(135deg, #43e97b 0%, #38f9d7 100%);
color: white;
}
.modal-confirm-title {
margin: 0 0 0.75rem;
font-size: 1.3rem;
font-weight: 700;
color: #1a1a2e;
}
.modal-confirm-text {
margin: 0 0 1.5rem;
font-size: 0.95rem;
color: #666;
line-height: 1.6;
}
.modal-confirm-ok {
width: 100%;
padding: 0.85rem;
background: linear-gradient(135deg, #43e97b 0%, #38f9d7 100%);
color: white;
border: none;
border-radius: 8px;
font-weight: 600;
cursor: pointer;
transition: all 0.3s;
font-size: 0.95rem;
}
.modal-confirm-ok:hover {
transform: translateY(-2px);
box-shadow: 0 8px 20px rgba(67, 233, 123, 0.4);
}
@keyframes modalFadeIn {
from { opacity: 0; transform: scale(0.95); }
to { opacity: 1; transform: scale(1); }
}
Warning Confirmation
HTML
<div class="modal-overlay">
<div class="modal-confirm">
<div class="modal-confirm-icon warning">
<span>⚠️</span>
</div>
<h3 class="modal-confirm-title">Unsaved Changes</h3>
<p class="modal-confirm-text">You have unsaved changes. Are you sure you want to leave? All changes will be lost.</p>
<div class="modal-confirm-actions">
<button class="modal-confirm-leave">Leave</button>
<button class="modal-confirm-stay">Stay</button>
</div>
</div>
</div>
CSS
.modal-overlay {
position: relative;
width: 100%;
min-height: 400px;
background: rgba(0, 0, 0, 0.5);
display: flex;
align-items: center;
justify-content: center;
padding: 2rem;
border-radius: 8px;
}
.modal-confirm {
background: white;
border-radius: 16px;
width: 400px;
max-width: 100%;
padding: 2rem;
text-align: center;
box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
animation: modalFadeIn 0.3s ease;
}
.modal-confirm-icon {
width: 70px;
height: 70px;
border-radius: 50%;
display: flex;
align-items: center;
justify-content: center;
margin: 0 auto 1.25rem;
font-size: 2rem;
}
.modal-confirm-icon.warning {
background: rgba(250, 112, 154, 0.1);
}
.modal-confirm-title {
margin: 0 0 0.75rem;
font-size: 1.3rem;
font-weight: 700;
color: #1a1a2e;
}
.modal-confirm-text {
margin: 0 0 1.5rem;
font-size: 0.95rem;
color: #666;
line-height: 1.6;
}
.modal-confirm-actions {
display: flex;
gap: 0.75rem;
}
.modal-confirm-leave {
flex: 1;
padding: 0.75rem;
background: linear-gradient(135deg, #fa709a 0%, #fee140 100%);
color: #1a1a2e;
border: none;
border-radius: 8px;
font-weight: 600;
cursor: pointer;
transition: all 0.3s;
}
.modal-confirm-leave:hover {
transform: translateY(-1px);
box-shadow: 0 4px 12px rgba(250, 112, 154, 0.4);
}
.modal-confirm-stay {
flex: 1;
padding: 0.75rem;
background: #f5f5f5;
color: #666;
border: none;
border-radius: 8px;
font-weight: 600;
cursor: pointer;
transition: all 0.2s;
}
.modal-confirm-stay:hover {
background: #e0e0e0;
}
@keyframes modalFadeIn {
from { opacity: 0; transform: scale(0.95); }
to { opacity: 1; transform: scale(1); }
}