@rhavenside/baseline-ui 1.0.10 → 1.0.12
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/baseline.css +287 -7
- package/dist/baseline.css.map +1 -1
- package/dist/baseline.js +23 -4
- package/dist/baseline.js.map +2 -2
- package/dist/baseline.min.css +1 -1
- package/dist/baseline.min.js +1 -1
- package/dist/baseline.min.js.map +3 -3
- package/package.json +1 -1
- package/src/components/_modal.scss +341 -9
- package/src/js/components/modal.js +35 -4
package/dist/baseline.min.js.map
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../src/js/components/modal.js", "../src/js/components/dropdown.js", "../src/js/components/tooltip.js", "../src/js/components/tabs.js", "../src/js/components/alert.js", "../src/js/baseline.js"],
|
|
4
|
-
"sourcesContent": ["// ============================================================================\n// Modal Component JavaScript\n// ============================================================================\n\nexport function initModal(modalElement) {\n if (!modalElement) return;\n\n const backdrop = modalElement.querySelector('.bl-modal-backdrop') || document.createElement('div');\n if (!backdrop.classList.contains('bl-modal-backdrop')) {\n backdrop.className = 'bl-modal-backdrop';\n modalElement.insertBefore(backdrop, modalElement.firstChild);\n }\n\n // Open modal buttons\n const modalId = modalElement.id;\n if (modalId) {\n const openButtons = document.querySelectorAll(`[data-modal-open=\"${modalId}\"]`);\n openButtons.forEach(btn => {\n btn.addEventListener('click', () => {\n openModal(modalId);\n });\n });\n }\n\n // Close modal buttons\n const closeButtons = modalElement.querySelectorAll('.bl-modal-close, [data-modal-close]');\n closeButtons.forEach(btn => {\n btn.addEventListener('click', () => {\n closeModal(modalId);\n });\n });\n\n // Close on backdrop click\n backdrop.addEventListener('click', (e) => {\n if (e.target === backdrop) {\n closeModal(modalId);\n }\n });\n\n // Close on ESC key\n const escHandler = (e) => {\n if (e.key === 'Escape' && modalElement.style.display === 'block') {\n closeModal(modalId);\n }\n };\n document.addEventListener('keydown', escHandler);\n \n // Store handler for cleanup if needed\n modalElement._escHandler = escHandler;\n}\n\nexport function openModal(modalId) {\n const modal = document.getElementById(modalId);\n if (modal) {\n modal.style.display = 'block';\n document.body.style.overflow = 'hidden';\n }\n}\n\nexport function closeModal(modalId) {\n const modal = document.getElementById(modalId);\n if (modal) {\n modal.style.display = 'none';\n document.body.style.overflow = '';\n }\n}\n\n", "// ============================================================================\n// Dropdown Component JavaScript\n// ============================================================================\n\nexport function initDropdown(dropdownElement) {\n if (!dropdownElement) return;\n\n const toggle = dropdownElement.querySelector('.bl-dropdown-toggle');\n const menu = dropdownElement.querySelector('.bl-dropdown-menu');\n\n if (!toggle || !menu) return;\n\n toggle.addEventListener('click', (e) => {\n e.preventDefault();\n e.stopPropagation();\n\n // Close all other dropdowns\n document.querySelectorAll('.bl-dropdown-menu.bl-show').forEach(otherMenu => {\n if (otherMenu !== menu) {\n otherMenu.classList.remove('bl-show');\n }\n });\n\n // Toggle current dropdown\n menu.classList.toggle('bl-show');\n });\n\n // Close on outside click\n const outsideClickHandler = (e) => {\n if (!dropdownElement.contains(e.target)) {\n menu.classList.remove('bl-show');\n }\n };\n \n document.addEventListener('click', outsideClickHandler);\n \n // Store handler for cleanup if needed\n dropdownElement._outsideClickHandler = outsideClickHandler;\n}\n\n", "// ============================================================================\n// Tooltip Component JavaScript\n// ============================================================================\n\nexport function initTooltip(tooltipElement) {\n if (!tooltipElement) return;\n\n const trigger = tooltipElement.querySelector('.bl-tooltip-trigger');\n const content = tooltipElement.querySelector('.bl-tooltip-content');\n\n if (!trigger || !content) {\n console.warn('Baseline UI: Tooltip missing trigger or content', tooltipElement);\n return;\n }\n\n // Skip if already initialized\n if (tooltipElement._tooltipInitialized) return;\n\n // Create handlers - use tooltipElement to handle hover on entire tooltip\n const enterHandler = (e) => {\n content.classList.add('bl-show');\n };\n\n const leaveHandler = (e) => {\n // Only hide if mouse leaves the tooltip element (not just the trigger)\n if (!tooltipElement.contains(e.relatedTarget)) {\n content.classList.remove('bl-show');\n }\n };\n\n // Add event listeners to trigger\n trigger.addEventListener('mouseenter', enterHandler);\n trigger.addEventListener('mouseleave', leaveHandler);\n \n // Also handle mouseleave on tooltip element to hide when leaving tooltip area\n tooltipElement.addEventListener('mouseleave', leaveHandler);\n\n // Mark as initialized\n tooltipElement._tooltipInitialized = true;\n tooltipElement._tooltipEnterHandler = enterHandler;\n tooltipElement._tooltipLeaveHandler = leaveHandler;\n}\n\n", "// ============================================================================\n// Tabs Component JavaScript\n// ============================================================================\n\nexport function initTabs(tabsContainer) {\n if (!tabsContainer) return;\n\n const tabLinks = tabsContainer.querySelectorAll('.bl-nav-link[data-tab-target]');\n const tabGroup = tabsContainer.getAttribute('data-tab-group');\n\n tabLinks.forEach(link => {\n link.addEventListener('click', (e) => {\n e.preventDefault();\n\n // Remove active from all tabs in group\n if (tabGroup) {\n document.querySelectorAll(`[data-tab-group=\"${tabGroup}\"] .bl-nav-link`).forEach(l => {\n l.classList.remove('bl-active');\n });\n } else {\n tabsContainer.querySelectorAll('.bl-nav-link').forEach(l => {\n l.classList.remove('bl-active');\n });\n }\n\n // Add active to clicked tab\n link.classList.add('bl-active');\n\n // Show/hide tab content\n const targetId = link.getAttribute('data-tab-target');\n if (targetId) {\n // Find all tab contents - search in parent container or document\n const container = tabsContainer.closest('.docs-example-preview') || \n tabsContainer.parentElement || \n document;\n \n container.querySelectorAll('[data-tab-content]').forEach(content => {\n content.style.display = 'none';\n });\n\n const targetContent = document.getElementById(targetId);\n if (targetContent) {\n targetContent.style.display = 'block';\n }\n }\n });\n });\n}\n\n", "// ============================================================================\n// Alert Component JavaScript\n// ============================================================================\n\nexport function initAlert(alertElement) {\n if (!alertElement) return;\n\n const closeBtn = alertElement.querySelector('.bl-alert-close');\n if (!closeBtn) return;\n\n closeBtn.addEventListener('click', () => {\n dismissAlert(alertElement);\n });\n}\n\nexport function dismissAlert(alertElement) {\n if (!alertElement) return;\n \n alertElement.style.transition = 'opacity 0.3s ease-out';\n alertElement.style.opacity = '0';\n setTimeout(() => {\n alertElement.remove();\n }, 300);\n}\n\n", "// ============================================================================\n// Baseline UI JavaScript\n// Main Entry Point\n// ============================================================================\n\nimport { initModal, openModal, closeModal } from './components/modal.js';\nimport { initDropdown } from './components/dropdown.js';\nimport { initTooltip } from './components/tooltip.js';\nimport { initTabs } from './components/tabs.js';\nimport { initAlert, dismissAlert } from './components/alert.js';\n\n// Export all functions for manual use\nexport {\n initModal,\n openModal,\n closeModal,\n initDropdown,\n initTooltip,\n initTabs,\n initAlert,\n dismissAlert\n};\n\n// Auto-initialize on DOM ready\nfunction autoInit() {\n // Initialize all modals\n document.querySelectorAll('.bl-modal').forEach(modal => {\n initModal(modal);\n });\n\n // Initialize all dropdowns\n document.querySelectorAll('.bl-dropdown').forEach(dropdown => {\n initDropdown(dropdown);\n });\n\n // Initialize all tooltips\n document.querySelectorAll('.bl-tooltip').forEach(tooltip => {\n initTooltip(tooltip);\n });\n\n // Initialize all tabs\n document.querySelectorAll('.bl-nav-tabs').forEach(tabs => {\n initTabs(tabs);\n });\n\n // Initialize all dismissible alerts\n document.querySelectorAll('.bl-alert-dismissible').forEach(alert => {\n initAlert(alert);\n });\n}\n\n// Initialize when DOM is ready\n// Use requestAnimationFrame for better timing with ES modules\nif (document.readyState === 'loading') {\n document.addEventListener('DOMContentLoaded', () => {\n // Wait for next frame to ensure all elements are rendered\n requestAnimationFrame(() => {\n requestAnimationFrame(autoInit);\n });\n });\n} else {\n // DOM already loaded, but wait for next frame to ensure everything is ready\n requestAnimationFrame(() => {\n requestAnimationFrame(autoInit);\n });\n}\n\n"],
|
|
5
|
-
"mappings": "AAIO,SAASA,EAAUC,EAAc,CACtC,GAAI,CAACA,EAAc,OAEnB,IAAMC,EAAWD,EAAa,cAAc,oBAAoB,GAAK,SAAS,cAAc,KAAK,EAC5FC,EAAS,UAAU,SAAS,mBAAmB,IAClDA,EAAS,UAAY,oBACrBD,EAAa,aAAaC,EAAUD,EAAa,UAAU,GAI7D,IAAME,EAAUF,EAAa,GACzBE,GACkB,SAAS,iBAAiB,qBAAqBA,CAAO,IAAI,EAClE,QAAQC,GAAO,CACzBA,EAAI,iBAAiB,QAAS,IAAM,CAClCC,EAAUF,CAAO,CACnB,CAAC,CACH,CAAC,EAIkBF,EAAa,iBAAiB,qCAAqC,EAC3E,QAAQG,GAAO,CAC1BA,EAAI,iBAAiB,QAAS,IAAM,CAClCE,EAAWH,CAAO,CACpB,CAAC,CACH,CAAC,EAGDD,EAAS,iBAAiB,QAAUK,GAAM,CACpCA,EAAE,SAAWL,GACfI,EAAWH,CAAO,CAEtB,CAAC,EAGD,IAAMK,EAAcD,GAAM,CACpBA,EAAE,MAAQ,UAAYN,EAAa,
|
|
6
|
-
"names": ["initModal", "modalElement", "backdrop", "modalId", "btn", "openModal", "closeModal", "e", "escHandler", "modal", "initDropdown", "dropdownElement", "toggle", "menu", "e", "otherMenu", "outsideClickHandler", "initTooltip", "tooltipElement", "trigger", "content", "enterHandler", "e", "leaveHandler", "initTabs", "tabsContainer", "tabLinks", "tabGroup", "link", "e", "l", "targetId", "content", "targetContent", "initAlert", "alertElement", "closeBtn", "dismissAlert", "autoInit", "modal", "initModal", "dropdown", "initDropdown", "tooltip", "initTooltip", "tabs", "initTabs", "alert", "initAlert"]
|
|
4
|
+
"sourcesContent": ["// ============================================================================\n// Modal Component JavaScript\n// ============================================================================\n\nexport function initModal(modalElement) {\n if (!modalElement) return;\n\n const backdrop = modalElement.querySelector('.bl-modal-backdrop') || document.createElement('div');\n if (!backdrop.classList.contains('bl-modal-backdrop')) {\n backdrop.className = 'bl-modal-backdrop';\n modalElement.insertBefore(backdrop, modalElement.firstChild);\n }\n\n // Open modal buttons\n const modalId = modalElement.id;\n if (modalId) {\n const openButtons = document.querySelectorAll(`[data-modal-open=\"${modalId}\"]`);\n openButtons.forEach(btn => {\n btn.addEventListener('click', () => {\n openModal(modalId);\n });\n });\n }\n\n // Close modal buttons\n const closeButtons = modalElement.querySelectorAll('.bl-modal-close, [data-modal-close]');\n closeButtons.forEach(btn => {\n btn.addEventListener('click', () => {\n closeModal(modalId);\n });\n });\n\n // Close on backdrop click\n backdrop.addEventListener('click', (e) => {\n if (e.target === backdrop) {\n closeModal(modalId);\n }\n });\n\n // Close on ESC key\n const escHandler = (e) => {\n if (e.key === 'Escape' && modalElement.classList.contains('bl-modal-open')) {\n closeModal(modalId);\n }\n };\n document.addEventListener('keydown', escHandler);\n \n // Store handler for cleanup if needed\n modalElement._escHandler = escHandler;\n}\n\nexport function openModal(modalId) {\n const modal = document.getElementById(modalId);\n if (modal) {\n // Remove closing class if present\n modal.classList.remove('bl-modal-closing');\n // Add open class to trigger animation\n modal.classList.add('bl-modal-open');\n document.body.style.overflow = 'hidden';\n }\n}\n\nexport function closeModal(modalId) {\n const modal = document.getElementById(modalId);\n if (modal) {\n // Add closing class to trigger close animation\n modal.classList.add('bl-modal-closing');\n modal.classList.remove('bl-modal-open');\n \n // WICHTIG: Overflow sofort zur\u00FCcksetzen, wenn keine anderen Modals offen sind\n // (Animation l\u00E4uft weiter, aber Scrollen ist wieder m\u00F6glich)\n const openModals = document.querySelectorAll('.bl-modal.bl-modal-open');\n if (openModals.length === 0) {\n document.body.style.overflow = '';\n }\n \n // Wait for animation to complete before cleaning up\n const handleAnimationEnd = () => {\n modal.classList.remove('bl-modal-closing');\n };\n \n // Listen for animation end on dialog (which has the slide animation)\n const dialog = modal.querySelector('.bl-modal-dialog');\n if (dialog) {\n dialog.addEventListener('animationend', handleAnimationEnd, { once: true });\n } else {\n // Fallback: use backdrop animation or timeout\n const backdrop = modal.querySelector('.bl-modal-backdrop');\n if (backdrop) {\n backdrop.addEventListener('animationend', handleAnimationEnd, { once: true });\n } else {\n // Fallback timeout if no animation\n setTimeout(handleAnimationEnd, 200);\n }\n }\n }\n}\n\n", "// ============================================================================\n// Dropdown Component JavaScript\n// ============================================================================\n\nexport function initDropdown(dropdownElement) {\n if (!dropdownElement) return;\n\n const toggle = dropdownElement.querySelector('.bl-dropdown-toggle');\n const menu = dropdownElement.querySelector('.bl-dropdown-menu');\n\n if (!toggle || !menu) return;\n\n toggle.addEventListener('click', (e) => {\n e.preventDefault();\n e.stopPropagation();\n\n // Close all other dropdowns\n document.querySelectorAll('.bl-dropdown-menu.bl-show').forEach(otherMenu => {\n if (otherMenu !== menu) {\n otherMenu.classList.remove('bl-show');\n }\n });\n\n // Toggle current dropdown\n menu.classList.toggle('bl-show');\n });\n\n // Close on outside click\n const outsideClickHandler = (e) => {\n if (!dropdownElement.contains(e.target)) {\n menu.classList.remove('bl-show');\n }\n };\n \n document.addEventListener('click', outsideClickHandler);\n \n // Store handler for cleanup if needed\n dropdownElement._outsideClickHandler = outsideClickHandler;\n}\n\n", "// ============================================================================\n// Tooltip Component JavaScript\n// ============================================================================\n\nexport function initTooltip(tooltipElement) {\n if (!tooltipElement) return;\n\n const trigger = tooltipElement.querySelector('.bl-tooltip-trigger');\n const content = tooltipElement.querySelector('.bl-tooltip-content');\n\n if (!trigger || !content) {\n console.warn('Baseline UI: Tooltip missing trigger or content', tooltipElement);\n return;\n }\n\n // Skip if already initialized\n if (tooltipElement._tooltipInitialized) return;\n\n // Create handlers - use tooltipElement to handle hover on entire tooltip\n const enterHandler = (e) => {\n content.classList.add('bl-show');\n };\n\n const leaveHandler = (e) => {\n // Only hide if mouse leaves the tooltip element (not just the trigger)\n if (!tooltipElement.contains(e.relatedTarget)) {\n content.classList.remove('bl-show');\n }\n };\n\n // Add event listeners to trigger\n trigger.addEventListener('mouseenter', enterHandler);\n trigger.addEventListener('mouseleave', leaveHandler);\n \n // Also handle mouseleave on tooltip element to hide when leaving tooltip area\n tooltipElement.addEventListener('mouseleave', leaveHandler);\n\n // Mark as initialized\n tooltipElement._tooltipInitialized = true;\n tooltipElement._tooltipEnterHandler = enterHandler;\n tooltipElement._tooltipLeaveHandler = leaveHandler;\n}\n\n", "// ============================================================================\n// Tabs Component JavaScript\n// ============================================================================\n\nexport function initTabs(tabsContainer) {\n if (!tabsContainer) return;\n\n const tabLinks = tabsContainer.querySelectorAll('.bl-nav-link[data-tab-target]');\n const tabGroup = tabsContainer.getAttribute('data-tab-group');\n\n tabLinks.forEach(link => {\n link.addEventListener('click', (e) => {\n e.preventDefault();\n\n // Remove active from all tabs in group\n if (tabGroup) {\n document.querySelectorAll(`[data-tab-group=\"${tabGroup}\"] .bl-nav-link`).forEach(l => {\n l.classList.remove('bl-active');\n });\n } else {\n tabsContainer.querySelectorAll('.bl-nav-link').forEach(l => {\n l.classList.remove('bl-active');\n });\n }\n\n // Add active to clicked tab\n link.classList.add('bl-active');\n\n // Show/hide tab content\n const targetId = link.getAttribute('data-tab-target');\n if (targetId) {\n // Find all tab contents - search in parent container or document\n const container = tabsContainer.closest('.docs-example-preview') || \n tabsContainer.parentElement || \n document;\n \n container.querySelectorAll('[data-tab-content]').forEach(content => {\n content.style.display = 'none';\n });\n\n const targetContent = document.getElementById(targetId);\n if (targetContent) {\n targetContent.style.display = 'block';\n }\n }\n });\n });\n}\n\n", "// ============================================================================\n// Alert Component JavaScript\n// ============================================================================\n\nexport function initAlert(alertElement) {\n if (!alertElement) return;\n\n const closeBtn = alertElement.querySelector('.bl-alert-close');\n if (!closeBtn) return;\n\n closeBtn.addEventListener('click', () => {\n dismissAlert(alertElement);\n });\n}\n\nexport function dismissAlert(alertElement) {\n if (!alertElement) return;\n \n alertElement.style.transition = 'opacity 0.3s ease-out';\n alertElement.style.opacity = '0';\n setTimeout(() => {\n alertElement.remove();\n }, 300);\n}\n\n", "// ============================================================================\n// Baseline UI JavaScript\n// Main Entry Point\n// ============================================================================\n\nimport { initModal, openModal, closeModal } from './components/modal.js';\nimport { initDropdown } from './components/dropdown.js';\nimport { initTooltip } from './components/tooltip.js';\nimport { initTabs } from './components/tabs.js';\nimport { initAlert, dismissAlert } from './components/alert.js';\n\n// Export all functions for manual use\nexport {\n initModal,\n openModal,\n closeModal,\n initDropdown,\n initTooltip,\n initTabs,\n initAlert,\n dismissAlert\n};\n\n// Auto-initialize on DOM ready\nfunction autoInit() {\n // Initialize all modals\n document.querySelectorAll('.bl-modal').forEach(modal => {\n initModal(modal);\n });\n\n // Initialize all dropdowns\n document.querySelectorAll('.bl-dropdown').forEach(dropdown => {\n initDropdown(dropdown);\n });\n\n // Initialize all tooltips\n document.querySelectorAll('.bl-tooltip').forEach(tooltip => {\n initTooltip(tooltip);\n });\n\n // Initialize all tabs\n document.querySelectorAll('.bl-nav-tabs').forEach(tabs => {\n initTabs(tabs);\n });\n\n // Initialize all dismissible alerts\n document.querySelectorAll('.bl-alert-dismissible').forEach(alert => {\n initAlert(alert);\n });\n}\n\n// Initialize when DOM is ready\n// Use requestAnimationFrame for better timing with ES modules\nif (document.readyState === 'loading') {\n document.addEventListener('DOMContentLoaded', () => {\n // Wait for next frame to ensure all elements are rendered\n requestAnimationFrame(() => {\n requestAnimationFrame(autoInit);\n });\n });\n} else {\n // DOM already loaded, but wait for next frame to ensure everything is ready\n requestAnimationFrame(() => {\n requestAnimationFrame(autoInit);\n });\n}\n\n"],
|
|
5
|
+
"mappings": "AAIO,SAASA,EAAUC,EAAc,CACtC,GAAI,CAACA,EAAc,OAEnB,IAAMC,EAAWD,EAAa,cAAc,oBAAoB,GAAK,SAAS,cAAc,KAAK,EAC5FC,EAAS,UAAU,SAAS,mBAAmB,IAClDA,EAAS,UAAY,oBACrBD,EAAa,aAAaC,EAAUD,EAAa,UAAU,GAI7D,IAAME,EAAUF,EAAa,GACzBE,GACkB,SAAS,iBAAiB,qBAAqBA,CAAO,IAAI,EAClE,QAAQC,GAAO,CACzBA,EAAI,iBAAiB,QAAS,IAAM,CAClCC,EAAUF,CAAO,CACnB,CAAC,CACH,CAAC,EAIkBF,EAAa,iBAAiB,qCAAqC,EAC3E,QAAQG,GAAO,CAC1BA,EAAI,iBAAiB,QAAS,IAAM,CAClCE,EAAWH,CAAO,CACpB,CAAC,CACH,CAAC,EAGDD,EAAS,iBAAiB,QAAUK,GAAM,CACpCA,EAAE,SAAWL,GACfI,EAAWH,CAA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A,CAAQ,CAChC,CAAC",
|
|
6
|
+
"names": ["initModal", "modalElement", "backdrop", "modalId", "btn", "openModal", "closeModal", "e", "escHandler", "modal", "handleAnimationEnd", "dialog", "initDropdown", "dropdownElement", "toggle", "menu", "e", "otherMenu", "outsideClickHandler", "initTooltip", "tooltipElement", "trigger", "content", "enterHandler", "e", "leaveHandler", "initTabs", "tabsContainer", "tabLinks", "tabGroup", "link", "e", "l", "targetId", "content", "targetContent", "initAlert", "alertElement", "closeBtn", "dismissAlert", "autoInit", "modal", "initModal", "dropdown", "initDropdown", "tooltip", "initTooltip", "tabs", "initTabs", "alert", "initAlert"]
|
|
7
7
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@rhavenside/baseline-ui",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.12",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "A technical glass design framework with SCSS source and compiled CSS - minimalist, rectangular forms with milky glass effects",
|
|
6
6
|
"main": "dist/baseline.css",
|
|
@@ -14,10 +14,15 @@
|
|
|
14
14
|
overflow-x: hidden;
|
|
15
15
|
overflow-y: auto;
|
|
16
16
|
outline: 0;
|
|
17
|
-
display:
|
|
17
|
+
display: none; // Hidden by default
|
|
18
18
|
align-items: center;
|
|
19
19
|
justify-content: center;
|
|
20
20
|
padding: var(--spacing-md);
|
|
21
|
+
|
|
22
|
+
// Show modal when open
|
|
23
|
+
&.bl-modal-open {
|
|
24
|
+
display: flex;
|
|
25
|
+
}
|
|
21
26
|
}
|
|
22
27
|
|
|
23
28
|
.bl-modal-backdrop {
|
|
@@ -30,6 +35,17 @@
|
|
|
30
35
|
background: var(--color-bg-overlay);
|
|
31
36
|
backdrop-filter: blur(var(--glass-blur-lg));
|
|
32
37
|
-webkit-backdrop-filter: blur(var(--glass-blur-lg));
|
|
38
|
+
opacity: 0;
|
|
39
|
+
|
|
40
|
+
// Animate backdrop on open
|
|
41
|
+
.bl-modal.bl-modal-open & {
|
|
42
|
+
animation: bl-modal-backdrop-fade-in var(--transition-duration-slow) var(--transition-ease-out) forwards;
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
// Animate backdrop on close
|
|
46
|
+
.bl-modal.bl-modal-closing & {
|
|
47
|
+
animation: bl-modal-backdrop-fade-out var(--transition-duration-slow) var(--transition-ease-out) forwards;
|
|
48
|
+
}
|
|
33
49
|
}
|
|
34
50
|
|
|
35
51
|
.bl-modal-dialog {
|
|
@@ -51,6 +67,80 @@
|
|
|
51
67
|
@media (min-width: 1024px) {
|
|
52
68
|
max-width: 800px;
|
|
53
69
|
}
|
|
70
|
+
|
|
71
|
+
// Animationen basierend auf Position beim Öffnen
|
|
72
|
+
.bl-modal.bl-modal-open.bl-modal-top-left & {
|
|
73
|
+
animation: bl-modal-slide-from-top-left var(--transition-duration-slow) var(--transition-ease-out) forwards;
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
.bl-modal.bl-modal-open.bl-modal-top & {
|
|
77
|
+
animation: bl-modal-slide-from-top var(--transition-duration-slow) var(--transition-ease-out) forwards;
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
.bl-modal.bl-modal-open.bl-modal-top-right & {
|
|
81
|
+
animation: bl-modal-slide-from-top-right var(--transition-duration-slow) var(--transition-ease-out) forwards;
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
.bl-modal.bl-modal-open.bl-modal-left & {
|
|
85
|
+
animation: bl-modal-slide-from-left var(--transition-duration-slow) var(--transition-ease-out) forwards;
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
.bl-modal.bl-modal-open.bl-modal-centered & {
|
|
89
|
+
animation: bl-modal-fade-in var(--transition-duration-slow) var(--transition-ease-out) forwards;
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
.bl-modal.bl-modal-open.bl-modal-right & {
|
|
93
|
+
animation: bl-modal-slide-from-right var(--transition-duration-slow) var(--transition-ease-out) forwards;
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
.bl-modal.bl-modal-open.bl-modal-bottom-left & {
|
|
97
|
+
animation: bl-modal-slide-from-bottom-left var(--transition-duration-slow) var(--transition-ease-out) forwards;
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
.bl-modal.bl-modal-open.bl-modal-bottom & {
|
|
101
|
+
animation: bl-modal-slide-from-bottom var(--transition-duration-slow) var(--transition-ease-out) forwards;
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
.bl-modal.bl-modal-open.bl-modal-bottom-right & {
|
|
105
|
+
animation: bl-modal-slide-from-bottom-right var(--transition-duration-slow) var(--transition-ease-out) forwards;
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
// Animationen beim Schließen
|
|
109
|
+
.bl-modal.bl-modal-closing.bl-modal-top-left & {
|
|
110
|
+
animation: bl-modal-slide-to-top-left var(--transition-duration-slow) var(--transition-ease-out) forwards;
|
|
111
|
+
}
|
|
112
|
+
|
|
113
|
+
.bl-modal.bl-modal-closing.bl-modal-top & {
|
|
114
|
+
animation: bl-modal-slide-to-top var(--transition-duration-slow) var(--transition-ease-out) forwards;
|
|
115
|
+
}
|
|
116
|
+
|
|
117
|
+
.bl-modal.bl-modal-closing.bl-modal-top-right & {
|
|
118
|
+
animation: bl-modal-slide-to-top-right var(--transition-duration-slow) var(--transition-ease-out) forwards;
|
|
119
|
+
}
|
|
120
|
+
|
|
121
|
+
.bl-modal.bl-modal-closing.bl-modal-left & {
|
|
122
|
+
animation: bl-modal-slide-to-left var(--transition-duration-slow) var(--transition-ease-out) forwards;
|
|
123
|
+
}
|
|
124
|
+
|
|
125
|
+
.bl-modal.bl-modal-closing.bl-modal-centered & {
|
|
126
|
+
animation: bl-modal-fade-out var(--transition-duration-slow) var(--transition-ease-out) forwards;
|
|
127
|
+
}
|
|
128
|
+
|
|
129
|
+
.bl-modal.bl-modal-closing.bl-modal-right & {
|
|
130
|
+
animation: bl-modal-slide-to-right var(--transition-duration-slow) var(--transition-ease-out) forwards;
|
|
131
|
+
}
|
|
132
|
+
|
|
133
|
+
.bl-modal.bl-modal-closing.bl-modal-bottom-left & {
|
|
134
|
+
animation: bl-modal-slide-to-bottom-left var(--transition-duration-slow) var(--transition-ease-out) forwards;
|
|
135
|
+
}
|
|
136
|
+
|
|
137
|
+
.bl-modal.bl-modal-closing.bl-modal-bottom & {
|
|
138
|
+
animation: bl-modal-slide-to-bottom var(--transition-duration-slow) var(--transition-ease-out) forwards;
|
|
139
|
+
}
|
|
140
|
+
|
|
141
|
+
.bl-modal.bl-modal-closing.bl-modal-bottom-right & {
|
|
142
|
+
animation: bl-modal-slide-to-bottom-right var(--transition-duration-slow) var(--transition-ease-out) forwards;
|
|
143
|
+
}
|
|
54
144
|
}
|
|
55
145
|
|
|
56
146
|
.bl-modal-content {
|
|
@@ -158,19 +248,27 @@
|
|
|
158
248
|
}
|
|
159
249
|
}
|
|
160
250
|
|
|
161
|
-
// Modal Positions
|
|
251
|
+
// Modal Positions - 3x3 Grid
|
|
252
|
+
// Oben
|
|
253
|
+
.bl-modal.bl-modal-top-left {
|
|
254
|
+
align-items: flex-start !important;
|
|
255
|
+
justify-content: flex-start !important;
|
|
256
|
+
padding: var(--spacing-xl) var(--spacing-md) var(--spacing-md) var(--spacing-xl) !important;
|
|
257
|
+
}
|
|
258
|
+
|
|
162
259
|
.bl-modal.bl-modal-top {
|
|
163
260
|
align-items: flex-start !important;
|
|
164
261
|
justify-content: center !important;
|
|
165
262
|
padding: var(--spacing-xl) var(--spacing-md) var(--spacing-md) var(--spacing-md) !important;
|
|
166
263
|
}
|
|
167
264
|
|
|
168
|
-
.bl-modal.bl-modal-
|
|
169
|
-
align-items: flex-
|
|
170
|
-
justify-content:
|
|
171
|
-
padding: var(--spacing-
|
|
265
|
+
.bl-modal.bl-modal-top-right {
|
|
266
|
+
align-items: flex-start !important;
|
|
267
|
+
justify-content: flex-end !important;
|
|
268
|
+
padding: var(--spacing-xl) var(--spacing-xl) var(--spacing-md) var(--spacing-md) !important;
|
|
172
269
|
}
|
|
173
270
|
|
|
271
|
+
// Mitte
|
|
174
272
|
.bl-modal.bl-modal-left {
|
|
175
273
|
align-items: center !important;
|
|
176
274
|
justify-content: flex-start !important;
|
|
@@ -181,6 +279,11 @@
|
|
|
181
279
|
}
|
|
182
280
|
}
|
|
183
281
|
|
|
282
|
+
.bl-modal.bl-modal-centered {
|
|
283
|
+
align-items: center !important;
|
|
284
|
+
justify-content: center !important;
|
|
285
|
+
}
|
|
286
|
+
|
|
184
287
|
.bl-modal.bl-modal-right {
|
|
185
288
|
align-items: center !important;
|
|
186
289
|
justify-content: flex-end !important;
|
|
@@ -191,8 +294,237 @@
|
|
|
191
294
|
}
|
|
192
295
|
}
|
|
193
296
|
|
|
194
|
-
//
|
|
195
|
-
.bl-modal.bl-modal-
|
|
196
|
-
align-items:
|
|
297
|
+
// Unten
|
|
298
|
+
.bl-modal.bl-modal-bottom-left {
|
|
299
|
+
align-items: flex-end !important;
|
|
300
|
+
justify-content: flex-start !important;
|
|
301
|
+
padding: var(--spacing-md) var(--spacing-md) var(--spacing-xl) var(--spacing-xl) !important;
|
|
302
|
+
}
|
|
303
|
+
|
|
304
|
+
.bl-modal.bl-modal-bottom {
|
|
305
|
+
align-items: flex-end !important;
|
|
197
306
|
justify-content: center !important;
|
|
307
|
+
padding: var(--spacing-md) var(--spacing-md) var(--spacing-xl) var(--spacing-md) !important;
|
|
308
|
+
}
|
|
309
|
+
|
|
310
|
+
.bl-modal.bl-modal-bottom-right {
|
|
311
|
+
align-items: flex-end !important;
|
|
312
|
+
justify-content: flex-end !important;
|
|
313
|
+
padding: var(--spacing-md) var(--spacing-xl) var(--spacing-xl) var(--spacing-md) !important;
|
|
314
|
+
}
|
|
315
|
+
|
|
316
|
+
// Modal Animations
|
|
317
|
+
// Backdrop Fade Animation
|
|
318
|
+
@keyframes bl-modal-backdrop-fade-in {
|
|
319
|
+
from {
|
|
320
|
+
opacity: 0;
|
|
321
|
+
}
|
|
322
|
+
to {
|
|
323
|
+
opacity: 1;
|
|
324
|
+
}
|
|
325
|
+
}
|
|
326
|
+
|
|
327
|
+
@keyframes bl-modal-backdrop-fade-out {
|
|
328
|
+
from {
|
|
329
|
+
opacity: 1;
|
|
330
|
+
}
|
|
331
|
+
to {
|
|
332
|
+
opacity: 0;
|
|
333
|
+
}
|
|
334
|
+
}
|
|
335
|
+
|
|
336
|
+
// Dialog Slide Animations
|
|
337
|
+
@keyframes bl-modal-slide-from-top {
|
|
338
|
+
from {
|
|
339
|
+
transform: translateY(-100%);
|
|
340
|
+
opacity: 0;
|
|
341
|
+
}
|
|
342
|
+
to {
|
|
343
|
+
transform: translateY(0);
|
|
344
|
+
opacity: 1;
|
|
345
|
+
}
|
|
346
|
+
}
|
|
347
|
+
|
|
348
|
+
@keyframes bl-modal-slide-from-bottom {
|
|
349
|
+
from {
|
|
350
|
+
transform: translateY(100%);
|
|
351
|
+
opacity: 0;
|
|
352
|
+
}
|
|
353
|
+
to {
|
|
354
|
+
transform: translateY(0);
|
|
355
|
+
opacity: 1;
|
|
356
|
+
}
|
|
357
|
+
}
|
|
358
|
+
|
|
359
|
+
@keyframes bl-modal-slide-from-left {
|
|
360
|
+
from {
|
|
361
|
+
transform: translateX(-100%);
|
|
362
|
+
opacity: 0;
|
|
363
|
+
}
|
|
364
|
+
to {
|
|
365
|
+
transform: translateX(0);
|
|
366
|
+
opacity: 1;
|
|
367
|
+
}
|
|
368
|
+
}
|
|
369
|
+
|
|
370
|
+
@keyframes bl-modal-slide-from-right {
|
|
371
|
+
from {
|
|
372
|
+
transform: translateX(100%);
|
|
373
|
+
opacity: 0;
|
|
374
|
+
}
|
|
375
|
+
to {
|
|
376
|
+
transform: translateX(0);
|
|
377
|
+
opacity: 1;
|
|
378
|
+
}
|
|
379
|
+
}
|
|
380
|
+
|
|
381
|
+
@keyframes bl-modal-slide-from-top-left {
|
|
382
|
+
from {
|
|
383
|
+
transform: translate(-100%, -100%);
|
|
384
|
+
opacity: 0;
|
|
385
|
+
}
|
|
386
|
+
to {
|
|
387
|
+
transform: translate(0, 0);
|
|
388
|
+
opacity: 1;
|
|
389
|
+
}
|
|
390
|
+
}
|
|
391
|
+
|
|
392
|
+
@keyframes bl-modal-slide-from-top-right {
|
|
393
|
+
from {
|
|
394
|
+
transform: translate(100%, -100%);
|
|
395
|
+
opacity: 0;
|
|
396
|
+
}
|
|
397
|
+
to {
|
|
398
|
+
transform: translate(0, 0);
|
|
399
|
+
opacity: 1;
|
|
400
|
+
}
|
|
401
|
+
}
|
|
402
|
+
|
|
403
|
+
@keyframes bl-modal-slide-from-bottom-left {
|
|
404
|
+
from {
|
|
405
|
+
transform: translate(-100%, 100%);
|
|
406
|
+
opacity: 0;
|
|
407
|
+
}
|
|
408
|
+
to {
|
|
409
|
+
transform: translate(0, 0);
|
|
410
|
+
opacity: 1;
|
|
411
|
+
}
|
|
412
|
+
}
|
|
413
|
+
|
|
414
|
+
@keyframes bl-modal-slide-from-bottom-right {
|
|
415
|
+
from {
|
|
416
|
+
transform: translate(100%, 100%);
|
|
417
|
+
opacity: 0;
|
|
418
|
+
}
|
|
419
|
+
to {
|
|
420
|
+
transform: translate(0, 0);
|
|
421
|
+
opacity: 1;
|
|
422
|
+
}
|
|
423
|
+
}
|
|
424
|
+
|
|
425
|
+
@keyframes bl-modal-fade-in {
|
|
426
|
+
from {
|
|
427
|
+
opacity: 0;
|
|
428
|
+
}
|
|
429
|
+
to {
|
|
430
|
+
opacity: 1;
|
|
431
|
+
}
|
|
432
|
+
}
|
|
433
|
+
|
|
434
|
+
// Close Animations (reverse)
|
|
435
|
+
@keyframes bl-modal-slide-to-top {
|
|
436
|
+
from {
|
|
437
|
+
transform: translateY(0);
|
|
438
|
+
opacity: 1;
|
|
439
|
+
}
|
|
440
|
+
to {
|
|
441
|
+
transform: translateY(-100%);
|
|
442
|
+
opacity: 0;
|
|
443
|
+
}
|
|
444
|
+
}
|
|
445
|
+
|
|
446
|
+
@keyframes bl-modal-slide-to-bottom {
|
|
447
|
+
from {
|
|
448
|
+
transform: translateY(0);
|
|
449
|
+
opacity: 1;
|
|
450
|
+
}
|
|
451
|
+
to {
|
|
452
|
+
transform: translateY(100%);
|
|
453
|
+
opacity: 0;
|
|
454
|
+
}
|
|
455
|
+
}
|
|
456
|
+
|
|
457
|
+
@keyframes bl-modal-slide-to-left {
|
|
458
|
+
from {
|
|
459
|
+
transform: translateX(0);
|
|
460
|
+
opacity: 1;
|
|
461
|
+
}
|
|
462
|
+
to {
|
|
463
|
+
transform: translateX(-100%);
|
|
464
|
+
opacity: 0;
|
|
465
|
+
}
|
|
466
|
+
}
|
|
467
|
+
|
|
468
|
+
@keyframes bl-modal-slide-to-right {
|
|
469
|
+
from {
|
|
470
|
+
transform: translateX(0);
|
|
471
|
+
opacity: 1;
|
|
472
|
+
}
|
|
473
|
+
to {
|
|
474
|
+
transform: translateX(100%);
|
|
475
|
+
opacity: 0;
|
|
476
|
+
}
|
|
477
|
+
}
|
|
478
|
+
|
|
479
|
+
@keyframes bl-modal-slide-to-top-left {
|
|
480
|
+
from {
|
|
481
|
+
transform: translate(0, 0);
|
|
482
|
+
opacity: 1;
|
|
483
|
+
}
|
|
484
|
+
to {
|
|
485
|
+
transform: translate(-100%, -100%);
|
|
486
|
+
opacity: 0;
|
|
487
|
+
}
|
|
488
|
+
}
|
|
489
|
+
|
|
490
|
+
@keyframes bl-modal-slide-to-top-right {
|
|
491
|
+
from {
|
|
492
|
+
transform: translate(0, 0);
|
|
493
|
+
opacity: 1;
|
|
494
|
+
}
|
|
495
|
+
to {
|
|
496
|
+
transform: translate(100%, -100%);
|
|
497
|
+
opacity: 0;
|
|
498
|
+
}
|
|
499
|
+
}
|
|
500
|
+
|
|
501
|
+
@keyframes bl-modal-slide-to-bottom-left {
|
|
502
|
+
from {
|
|
503
|
+
transform: translate(0, 0);
|
|
504
|
+
opacity: 1;
|
|
505
|
+
}
|
|
506
|
+
to {
|
|
507
|
+
transform: translate(-100%, 100%);
|
|
508
|
+
opacity: 0;
|
|
509
|
+
}
|
|
510
|
+
}
|
|
511
|
+
|
|
512
|
+
@keyframes bl-modal-slide-to-bottom-right {
|
|
513
|
+
from {
|
|
514
|
+
transform: translate(0, 0);
|
|
515
|
+
opacity: 1;
|
|
516
|
+
}
|
|
517
|
+
to {
|
|
518
|
+
transform: translate(100%, 100%);
|
|
519
|
+
opacity: 0;
|
|
520
|
+
}
|
|
521
|
+
}
|
|
522
|
+
|
|
523
|
+
@keyframes bl-modal-fade-out {
|
|
524
|
+
from {
|
|
525
|
+
opacity: 1;
|
|
526
|
+
}
|
|
527
|
+
to {
|
|
528
|
+
opacity: 0;
|
|
529
|
+
}
|
|
198
530
|
}
|
|
@@ -39,7 +39,7 @@ export function initModal(modalElement) {
|
|
|
39
39
|
|
|
40
40
|
// Close on ESC key
|
|
41
41
|
const escHandler = (e) => {
|
|
42
|
-
if (e.key === 'Escape' && modalElement.
|
|
42
|
+
if (e.key === 'Escape' && modalElement.classList.contains('bl-modal-open')) {
|
|
43
43
|
closeModal(modalId);
|
|
44
44
|
}
|
|
45
45
|
};
|
|
@@ -52,7 +52,10 @@ export function initModal(modalElement) {
|
|
|
52
52
|
export function openModal(modalId) {
|
|
53
53
|
const modal = document.getElementById(modalId);
|
|
54
54
|
if (modal) {
|
|
55
|
-
|
|
55
|
+
// Remove closing class if present
|
|
56
|
+
modal.classList.remove('bl-modal-closing');
|
|
57
|
+
// Add open class to trigger animation
|
|
58
|
+
modal.classList.add('bl-modal-open');
|
|
56
59
|
document.body.style.overflow = 'hidden';
|
|
57
60
|
}
|
|
58
61
|
}
|
|
@@ -60,8 +63,36 @@ export function openModal(modalId) {
|
|
|
60
63
|
export function closeModal(modalId) {
|
|
61
64
|
const modal = document.getElementById(modalId);
|
|
62
65
|
if (modal) {
|
|
63
|
-
|
|
64
|
-
|
|
66
|
+
// Add closing class to trigger close animation
|
|
67
|
+
modal.classList.add('bl-modal-closing');
|
|
68
|
+
modal.classList.remove('bl-modal-open');
|
|
69
|
+
|
|
70
|
+
// WICHTIG: Overflow sofort zurücksetzen, wenn keine anderen Modals offen sind
|
|
71
|
+
// (Animation läuft weiter, aber Scrollen ist wieder möglich)
|
|
72
|
+
const openModals = document.querySelectorAll('.bl-modal.bl-modal-open');
|
|
73
|
+
if (openModals.length === 0) {
|
|
74
|
+
document.body.style.overflow = '';
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
// Wait for animation to complete before cleaning up
|
|
78
|
+
const handleAnimationEnd = () => {
|
|
79
|
+
modal.classList.remove('bl-modal-closing');
|
|
80
|
+
};
|
|
81
|
+
|
|
82
|
+
// Listen for animation end on dialog (which has the slide animation)
|
|
83
|
+
const dialog = modal.querySelector('.bl-modal-dialog');
|
|
84
|
+
if (dialog) {
|
|
85
|
+
dialog.addEventListener('animationend', handleAnimationEnd, { once: true });
|
|
86
|
+
} else {
|
|
87
|
+
// Fallback: use backdrop animation or timeout
|
|
88
|
+
const backdrop = modal.querySelector('.bl-modal-backdrop');
|
|
89
|
+
if (backdrop) {
|
|
90
|
+
backdrop.addEventListener('animationend', handleAnimationEnd, { once: true });
|
|
91
|
+
} else {
|
|
92
|
+
// Fallback timeout if no animation
|
|
93
|
+
setTimeout(handleAnimationEnd, 200);
|
|
94
|
+
}
|
|
95
|
+
}
|
|
65
96
|
}
|
|
66
97
|
}
|
|
67
98
|
|