UNPKG

mohas-popup

Version:

A customizable popup component for React applications.

97 lines (83 loc) 1.48 kB
.popup-overlay { position: fixed; top: 0; left: 0; width: 100%; height: 100vh; background: rgba(0, 0, 0, 0.4); display: flex; justify-content: center; align-items: center; z-index: 1000; opacity: 0; visibility: hidden; transition: opacity 0.3s ease, visibility 0.3s ease; } .popup-overlay.show { opacity: 1; visibility: visible; } .popup-box { background-color: rgba(51, 51, 51); padding: 27.6px; border-radius: 11px; width: 322px; height: 120px; text-align: left; box-shadow: 0 11px 46px rgba(0, 0, 0, 0.3); opacity: 0; transform: scale(0.8); animation: popup-in 0.3s ease-out forwards; position: relative; } .popup-box h2 { margin: 0; font-size: 1.38em; } .popup-box p { margin: 13.8px 0; color: #ccc; font-size: 1.11em; } .popup-buttons { display: flex; justify-content: space-between; } .popup-ok, .popup-cancel { margin-top: 13.8px; padding: 9.2px 16.6px; background: none; color: #007bff; border: none; border-radius: 7.4px; font-size: 1.1em; transition: background-color 0.3s ease; } .popup-ok { color: green; } .popup-cancel { color: red; } .popup-ok:active, .popup-cancel:active { background-color: #ffffff23; } @keyframes popup-in { 0% { opacity: 0; transform: scale(0.8); } 100% { opacity: 1; transform: scale(1); } } .popup-title { font-size: 1.38em; } .popup-title.success { color: #4caf50; } .popup-title.error { color: #ff3b30; }