Better CSS

This commit is contained in:
2024-12-17 21:28:10 +01:00
parent dea59f3d23
commit b4c673bdc4
3 changed files with 94 additions and 29 deletions

View File

@@ -20,33 +20,68 @@ $modal-content-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
justify-content: center;
align-items: center;
z-index: $modal-z-index; // Ensure it stays on top
overflow-y: auto; // Enable vertical scrolling on mobile if needed
}
// Modal content
.modal-content {
background-color: $modal-content-bg;
padding: 20px;
border-radius: 5px;
border-radius: 10px;
box-shadow: $modal-content-shadow;
width: 90%; /* Sæt bredden til 80% af skærmens bredde */
height: 90%;
// max-width: 1200px; /* Tilføj en maks-bredde for store skærme */
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 */
text-align: center;
z-index: $modal-content-z-index; /* Content stays above the blurred overlay */
margin: 10% auto; /* Centrer modalen horisontalt og tilføj vertikal afstand */
z-index: $modal-content-z-index;
margin: 0; /* Remove hardcoded margin */
overflow-y: auto; /* Scroll if content exceeds max-height */
}
// Rotating buttons
.open {
padding: -20px;
margin: -10% auto; /* Centrer modalen horisontalt og tilføj vertikal afstand */
.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;
transform: rotate(15deg); // Rotates button 15 degrees clockwise
&.open {
transform: rotate(15deg); // Rotates button 15 degrees clockwise
}
&.open_inv {
transform: rotate(-15deg); // Rotates button 15 degrees counterclockwise
}
}
.open_inv {
padding: -20px;
margin: -10% auto; /* Centrer modalen horisontalt og tilføj vertikal afstand */
// 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 */
}
transform: rotate(-15deg); // Rotates button 15 degrees counterclockwise
}
.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;
}
}