Files
portal-api/resources/css/components/micromodal.css
T
2026-02-02 17:27:33 +07:00

241 lines
4.1 KiB
CSS

/* MicroModal Global Styles */
.modal {
display: none;
}
.modal.is-open {
display: block;
}
.modal__overlay {
position: fixed;
top: 0;
left: 0;
right: 0;
bottom: 0;
background: rgba(0, 0, 0, 0.6);
display: flex;
justify-content: center;
align-items: center;
z-index: 1050;
backdrop-filter: blur(2px);
}
.modal__container {
background-color: #fff;
border-radius: 0.75rem;
max-height: 90vh;
overflow-y: auto;
box-shadow: 0 20px 40px rgba(0, 0, 0, 0.15);
position: relative;
margin: 1rem;
}
/* Modal Sizes */
.modal--xs {
max-width: 300px;
width: 90%;
}
.modal--sm {
max-width: 400px;
width: 90%;
}
.modal--md {
max-width: 600px;
width: 90%;
}
.modal--lg {
max-width: 800px;
width: 90%;
}
.modal--xl {
max-width: 1000px;
width: 90%;
}
/* Modal Header */
.modal__header {
display: flex;
justify-content: space-between;
align-items: center;
padding: 1rem 1.25rem;
color: white;
}
.modal__title {
margin: 0;
font-size: 1.1rem;
font-weight: 600;
display: flex;
align-items: center;
}
.modal__close {
background: transparent;
border: none;
color: inherit;
cursor: pointer;
padding: 0.5rem;
border-radius: 0.375rem;
transition: all 0.2s ease;
display: flex;
align-items: center;
justify-content: center;
width: 2rem;
height: 2rem;
}
.modal__close:focus {
outline: 2px solid rgba(255, 255, 255, 0.5);
outline-offset: 2px;
}
/* Modal Content */
.modal__content {
padding: 1.5rem;
max-height: 60vh;
overflow-y: auto;
}
.modal__content::-webkit-scrollbar {
width: 6px;
}
.modal__content::-webkit-scrollbar-track {
background: #f1f1f1;
border-radius: 3px;
}
.modal__content::-webkit-scrollbar-thumb {
background: #c1c1c1;
border-radius: 3px;
}
.modal__content::-webkit-scrollbar-thumb:hover {
background: #a1a1a1;
}
/* Modal Footer */
.modal__footer {
padding: 1rem 1.25rem;
border-top: 1px solid #dee2e6;
background-color: #f8f9fa;
border-radius: 0 0 0.75rem 0.75rem;
display: flex;
justify-content: flex-end;
gap: 0.5rem;
}
.modal__footer.justify-content-center {
justify-content: center;
}
.modal__footer.justify-content-start {
justify-content: flex-start;
}
/* Animations */
.micromodal-slide {
display: none;
}
.micromodal-slide.is-open {
display: block;
}
.micromodal-slide .modal__overlay {
animation: mmfadeIn 0.3s cubic-bezier(0.0, 0.0, 0.2, 1);
}
.micromodal-slide .modal__container {
animation: mmslideIn 0.3s cubic-bezier(0, 0, 0.2, 1);
}
.micromodal-slide.is-closing .modal__overlay {
animation: mmfadeOut 0.3s cubic-bezier(0.0, 0.0, 0.2, 1);
}
.micromodal-slide.is-closing .modal__container {
animation: mmslideOut 0.3s cubic-bezier(0, 0, 0.2, 1);
}
/* Keyframes */
@keyframes mmfadeIn {
from { opacity: 0; }
to { opacity: 1; }
}
@keyframes mmfadeOut {
from { opacity: 1; }
to { opacity: 0; }
}
@keyframes mmslideIn {
from {
transform: translateY(-15%) scale(0.95);
opacity: 0;
}
to {
transform: translateY(0) scale(1);
opacity: 1;
}
}
@keyframes mmslideOut {
from {
transform: translateY(0) scale(1);
opacity: 1;
}
to {
transform: translateY(-15%) scale(0.95);
opacity: 0;
}
}
/* Responsive */
@media (max-width: 768px) {
.modal__container {
margin: 0.5rem;
max-height: 95vh;
}
.modal__header {
padding: 0.75rem 1rem;
}
.modal__content {
padding: 1rem;
}
.modal__footer {
padding: 0.75rem 1rem;
flex-direction: column;
}
.modal__footer .btn {
width: 100%;
margin-bottom: 0.5rem;
}
.modal__footer .btn:last-child {
margin-bottom: 0;
}
}
/* Dark mode support */
@media (prefers-color-scheme: dark) {
.modal__container {
background-color: #2d3748;
color: #f7fafc;;
}
.modal__footer {
background-color: #1a202c;
border-color: #4a5568;
}
}