phase iv -ii
This commit is contained in:
+25
-23
@@ -2677,28 +2677,37 @@ html {
|
|||||||
Info Modal - Modern Glassmorphism Design
|
Info Modal - Modern Glassmorphism Design
|
||||||
======================================== */
|
======================================== */
|
||||||
|
|
||||||
|
/* Native <dialog> element - centered by default, no positioning needed */
|
||||||
.info-modal {
|
.info-modal {
|
||||||
position: fixed;
|
border: none;
|
||||||
top: 0;
|
border-radius: 24px;
|
||||||
left: 0;
|
padding: 0;
|
||||||
width: 100%;
|
max-width: 500px;
|
||||||
height: 100%;
|
width: calc(100% - 2rem);
|
||||||
|
background: transparent;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Native ::backdrop pseudo-element replaces manual backdrop div */
|
||||||
|
.info-modal::backdrop {
|
||||||
background: rgba(0, 0, 0, 0.7);
|
background: rgba(0, 0, 0, 0.7);
|
||||||
backdrop-filter: blur(10px);
|
backdrop-filter: blur(10px);
|
||||||
-webkit-backdrop-filter: blur(10px);
|
-webkit-backdrop-filter: blur(10px);
|
||||||
display: flex;
|
|
||||||
align-items: center;
|
|
||||||
justify-content: center;
|
|
||||||
z-index: 1000;
|
|
||||||
opacity: 0;
|
|
||||||
visibility: hidden;
|
|
||||||
transition: opacity 0.3s ease, visibility 0.3s ease;
|
|
||||||
padding: 1rem;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
.info-modal.active {
|
/* Dialog opening animation - native dialog uses [open] attribute */
|
||||||
opacity: 1;
|
.info-modal[open] {
|
||||||
visibility: visible;
|
animation: modalFadeIn 0.3s ease;
|
||||||
|
}
|
||||||
|
|
||||||
|
@keyframes modalFadeIn {
|
||||||
|
from {
|
||||||
|
opacity: 0;
|
||||||
|
transform: scale(0.9) translateY(20px);
|
||||||
|
}
|
||||||
|
to {
|
||||||
|
opacity: 1;
|
||||||
|
transform: scale(1) translateY(0);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
.info-modal-content {
|
.info-modal-content {
|
||||||
@@ -2707,19 +2716,12 @@ html {
|
|||||||
-webkit-backdrop-filter: blur(20px);
|
-webkit-backdrop-filter: blur(20px);
|
||||||
border-radius: 24px;
|
border-radius: 24px;
|
||||||
box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3), 0 0 100px rgba(39, 174, 96, 0.1);
|
box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3), 0 0 100px rgba(39, 174, 96, 0.1);
|
||||||
max-width: 500px;
|
|
||||||
width: 100%;
|
width: 100%;
|
||||||
padding: 2.5rem;
|
padding: 2.5rem;
|
||||||
position: relative;
|
position: relative;
|
||||||
transform: scale(0.9) translateY(20px);
|
|
||||||
transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
|
|
||||||
border: 1px solid rgba(255, 255, 255, 0.8);
|
border: 1px solid rgba(255, 255, 255, 0.8);
|
||||||
}
|
}
|
||||||
|
|
||||||
.info-modal.active .info-modal-content {
|
|
||||||
transform: scale(1) translateY(0);
|
|
||||||
}
|
|
||||||
|
|
||||||
.info-modal-close {
|
.info-modal-close {
|
||||||
position: absolute;
|
position: absolute;
|
||||||
top: 1rem;
|
top: 1rem;
|
||||||
|
|||||||
+9
-49
@@ -641,56 +641,17 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
// =============================================================================
|
// =============================================================================
|
||||||
// MODALS
|
// MODALS - Using Native <dialog> Element
|
||||||
// =============================================================================
|
// =============================================================================
|
||||||
|
|
||||||
// Info Modal Functions
|
// Native <dialog> elements handle:
|
||||||
window.openInfoModal = function() {
|
// - Open/close with .showModal() and .close()
|
||||||
const modal = document.getElementById('info-modal');
|
// - Backdrop clicks (via ::backdrop CSS pseudo-element)
|
||||||
modal.classList.add('active');
|
// - Escape key to close (built-in browser behavior)
|
||||||
document.body.style.overflow = 'hidden'; // Prevent scrolling when modal is open
|
// - Body scroll prevention (automatic with modal dialogs)
|
||||||
};
|
// - Focus trapping (automatic accessibility feature)
|
||||||
|
//
|
||||||
window.closeInfoModal = function() {
|
// No JavaScript needed! All modal logic is now in HTML/CSS.
|
||||||
const modal = document.getElementById('info-modal');
|
|
||||||
modal.classList.remove('active');
|
|
||||||
document.body.style.overflow = ''; // Restore scrolling
|
|
||||||
};
|
|
||||||
|
|
||||||
window.closeInfoModalOnBackdrop = function(event) {
|
|
||||||
if (event.target.id === 'info-modal') {
|
|
||||||
window.closeInfoModal();
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
// PDF Modal Functions
|
|
||||||
window.openPdfModal = function() {
|
|
||||||
const modal = document.getElementById('pdf-modal');
|
|
||||||
modal.classList.add('active');
|
|
||||||
document.body.style.overflow = 'hidden'; // Prevent scrolling when modal is open
|
|
||||||
};
|
|
||||||
|
|
||||||
window.closePdfModal = function() {
|
|
||||||
const modal = document.getElementById('pdf-modal');
|
|
||||||
modal.classList.remove('active');
|
|
||||||
document.body.style.overflow = ''; // Restore scrolling
|
|
||||||
};
|
|
||||||
|
|
||||||
window.closePdfModalOnBackdrop = function(event) {
|
|
||||||
if (event.target.id === 'pdf-modal') {
|
|
||||||
window.closePdfModal();
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
// Close modals with Escape key
|
|
||||||
function initModalKeyHandlers() {
|
|
||||||
document.addEventListener('keydown', function(event) {
|
|
||||||
if (event.key === 'Escape') {
|
|
||||||
window.closeInfoModal();
|
|
||||||
window.closePdfModal();
|
|
||||||
}
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
// =============================================================================
|
// =============================================================================
|
||||||
// ERROR HANDLING
|
// ERROR HANDLING
|
||||||
@@ -786,7 +747,6 @@
|
|||||||
initClickOutsideHandler();
|
initClickOutsideHandler();
|
||||||
initPreferences();
|
initPreferences();
|
||||||
initScrollBehavior();
|
initScrollBehavior();
|
||||||
initModalKeyHandlers();
|
|
||||||
initHTMXHandlers();
|
initHTMXHandlers();
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|||||||
@@ -1,8 +1,8 @@
|
|||||||
{{define "info-modal"}}
|
{{define "info-modal"}}
|
||||||
<!-- Info Modal -->
|
<!-- Info Modal - Native Dialog -->
|
||||||
<div id="info-modal" class="info-modal no-print" onclick="closeInfoModalOnBackdrop(event)">
|
<dialog id="info-modal" class="info-modal no-print">
|
||||||
<div class="info-modal-content" onclick="event.stopPropagation()">
|
<div class="info-modal-content">
|
||||||
<button class="info-modal-close" onclick="closeInfoModal()" aria-label="Close">
|
<button class="info-modal-close" onclick="document.getElementById('info-modal').close()" aria-label="Close">
|
||||||
<iconify-icon icon="mdi:close" width="24" height="24"></iconify-icon>
|
<iconify-icon icon="mdi:close" width="24" height="24"></iconify-icon>
|
||||||
</button>
|
</button>
|
||||||
|
|
||||||
@@ -48,5 +48,5 @@
|
|||||||
</a>
|
</a>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</dialog>
|
||||||
{{end}}
|
{{end}}
|
||||||
|
|||||||
@@ -1,8 +1,8 @@
|
|||||||
{{define "pdf-modal"}}
|
{{define "pdf-modal"}}
|
||||||
<!-- PDF Export Modal -->
|
<!-- PDF Export Modal - Native Dialog -->
|
||||||
<div id="pdf-modal" class="info-modal no-print" onclick="closePdfModalOnBackdrop(event)">
|
<dialog id="pdf-modal" class="info-modal no-print">
|
||||||
<div class="info-modal-content" onclick="event.stopPropagation()">
|
<div class="info-modal-content">
|
||||||
<button class="info-modal-close" onclick="closePdfModal()" aria-label="Close">
|
<button class="info-modal-close" onclick="document.getElementById('pdf-modal').close()" aria-label="Close">
|
||||||
<iconify-icon icon="mdi:close" width="24" height="24"></iconify-icon>
|
<iconify-icon icon="mdi:close" width="24" height="24"></iconify-icon>
|
||||||
</button>
|
</button>
|
||||||
|
|
||||||
@@ -21,5 +21,5 @@
|
|||||||
</p>
|
</p>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</dialog>
|
||||||
{{end}}
|
{{end}}
|
||||||
|
|||||||
@@ -3,7 +3,7 @@
|
|||||||
<div class="action-buttons-right">
|
<div class="action-buttons-right">
|
||||||
<button
|
<button
|
||||||
class="action-btn pdf-btn"
|
class="action-btn pdf-btn"
|
||||||
onclick="openPdfModal()"
|
onclick="document.getElementById('pdf-modal').showModal()"
|
||||||
aria-label="{{if eq .Lang "es"}}Descargar como PDF{{else}}Download as PDF{{end}}">
|
aria-label="{{if eq .Lang "es"}}Descargar como PDF{{else}}Download as PDF{{end}}">
|
||||||
<iconify-icon icon="mdi:download" width="18" height="18"></iconify-icon>
|
<iconify-icon icon="mdi:download" width="18" height="18"></iconify-icon>
|
||||||
{{if eq .Lang "es"}}Descargar como PDF{{else}}Download as PDF{{end}}
|
{{if eq .Lang "es"}}Descargar como PDF{{else}}Download as PDF{{end}}
|
||||||
|
|||||||
@@ -148,7 +148,7 @@
|
|||||||
<span>{{if eq .Lang "es"}}Acciones{{else}}Actions{{end}}</span>
|
<span>{{if eq .Lang "es"}}Acciones{{else}}Actions{{end}}</span>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<button class="menu-action-btn" onclick="openPdfModal()">
|
<button class="menu-action-btn" onclick="document.getElementById('pdf-modal').showModal()">
|
||||||
<iconify-icon icon="mdi:download" width="20" height="20"></iconify-icon>
|
<iconify-icon icon="mdi:download" width="20" height="20"></iconify-icon>
|
||||||
<span>{{if eq .Lang "es"}}Descargar como PDF{{else}}Download as PDF{{end}}</span>
|
<span>{{if eq .Lang "es"}}Descargar como PDF{{else}}Download as PDF{{end}}</span>
|
||||||
</button>
|
</button>
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
{{define "info-button"}}
|
{{define "info-button"}}
|
||||||
<!-- Info Button (Bottom Left) -->
|
<!-- Info Button (Bottom Left) -->
|
||||||
<button id="info-button" class="info-button no-print" aria-label="{{if eq .Lang "es"}}Información{{else}}Information{{end}}" onclick="openInfoModal()">
|
<button id="info-button" class="info-button no-print" aria-label="{{if eq .Lang "es"}}Información{{else}}Information{{end}}" onclick="document.getElementById('info-modal').showModal()">
|
||||||
<iconify-icon icon="mdi:information-outline" width="24" height="24"></iconify-icon>
|
<iconify-icon icon="mdi:information-outline" width="24" height="24"></iconify-icon>
|
||||||
</button>
|
</button>
|
||||||
{{end}}
|
{{end}}
|
||||||
|
|||||||
Reference in New Issue
Block a user