Files
LifeFaq/static/sass/components/_modals.scss

88 lines
2.1 KiB
SCSS
Raw Normal View History

2024-12-17 17:10:37 +01:00
// Variables
$modal-bg: rgba(0, 0, 0, 0.3);
$modal-blur: 8px;
$modal-z-index: 999999;
$modal-content-z-index: 50000;
$modal-content-bg: #fff;
$modal-content-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
// Modal background with blur effect
.modal {
display: none; // Hidden by default
position: fixed;
top: 0;
left: 0;
width: 100%;
height: 100%;
background: $modal-bg; // Semi-transparent dark background
backdrop-filter: blur($modal-blur); // Blurs everything behind the modal
display: flex;
justify-content: center;
align-items: center;
z-index: $modal-z-index; // Ensure it stays on top
2024-12-17 21:28:10 +01:00
overflow-y: auto; // Enable vertical scrolling on mobile if needed
2024-12-17 17:10:37 +01:00
}
// Modal content
.modal-content {
background-color: $modal-content-bg;
padding: 20px;
2024-12-17 21:28:10 +01:00
border-radius: 10px;
2024-12-17 17:10:37 +01:00
box-shadow: $modal-content-shadow;
2024-12-17 21:28:10 +01:00
width: 90%; /* Use 90% width for small screens */
max-width: 600px; /* Prevent it from getting too large */
height: auto; /* Automatic height */
max-height: 90%; /* Prevent it from overflowing the screen */
2024-12-17 17:10:37 +01:00
text-align: center;
2024-12-17 21:28:10 +01:00
z-index: $modal-content-z-index;
margin: 0; /* Remove hardcoded margin */
overflow-y: auto; /* Scroll if content exceeds max-height */
2024-12-17 17:10:37 +01:00
}
// Rotating buttons
2024-12-17 21:28:10 +01:00
.open, .open_inv {
display: inline-block;
padding: 10px 20px;
margin: 10px auto;
border: none;
background-color: #007BFF;
color: #fff;
border-radius: 5px;
font-size: 16px;
cursor: pointer;
transition: transform 0.2s ease;
2024-12-17 19:06:34 +01:00
2024-12-17 21:28:10 +01:00
&.open {
transform: rotate(15deg); // Rotates button 15 degrees clockwise
}
&.open_inv {
transform: rotate(-15deg); // Rotates button 15 degrees counterclockwise
}
2024-12-17 17:10:37 +01:00
}
2024-12-17 21:28:10 +01:00
// Responsive adjustments for smaller screens
@media (max-width: 768px) {
.modal-content {
width: 95%; /* Use nearly full width for small devices */
height: auto;
padding: 15px; /* Reduce padding for smaller screens */
}
2024-12-17 19:06:34 +01:00
2024-12-17 21:28:10 +01:00
.open, .open_inv {
font-size: 14px; /* Smaller buttons for smaller screens */
padding: 8px 15px;
}
}
@media (max-width: 480px) {
.modal-content {
border-radius: 5px; /* Smaller radius for small devices */
}
.open, .open_inv {
font-size: 12px;
padding: 6px 12px;
}
}