react-modal-message
Version:
A lightweight and animated modal component for React applications, ideal for form confirmations.
47 lines (45 loc) • 896 B
CSS
.overlay {
position: fixed;
top: 0;
left: 0;
width: 100vw;
height: 100vh;
background-color: rgba(0, 0, 0, 0.7);
display: flex;
justify-content: center;
align-items: center;
z-index: 1000;
opacity: 1;
transition: opacity 300ms ease;
}
.overlay.hidden {
opacity: 0;
pointer-events: none;
}
.modal {
background-color: white;
padding: 20px 30px;
border-radius: 8px;
box-shadow: 0 2px 12px rgba(0, 0, 0, 0.2);
position: relative;
max-width: 400px;
width: 90%;
text-align: left;
font-size: 18px;
opacity: 1;
transform: scale(1);
transition: opacity 300ms ease, transform 300ms ease;
}
.modal.hidden {
opacity: 0;
transform: scale(0.95);
pointer-events: none;
}
.close-button {
position: absolute;
top: 10px;
right: 10px;
cursor: pointer;
border: none;
background-color: transparent;
}