переработал систему модалок и добавил блоки

This commit is contained in:
GP_DEV
2025-06-07 23:28:58 +03:00
parent 9aa5906efa
commit 5e346cfa36
10 changed files with 348 additions and 314 deletions

View File

@@ -5,15 +5,13 @@ function enqueue_theme_scripts() {
'modals-js',
get_template_directory_uri() . '/template-parts/la-components/js/modals.js',
array('jquery'),
'1.0.0',
'2.0.0',
true
);
}
add_action('wp_enqueue_scripts', 'enqueue_theme_scripts');
// Вывод всех модалок в футере
function modal_system_container() {
// Получаем список всех модалок
$modals_dir = get_template_directory() . '/template-parts/la-components/modals/';
$modals = array();
@@ -26,25 +24,18 @@ function modal_system_container() {
}
}
// общий контейнер
?>
<div id="modal-overlay" class="fixed inset-0 bg-[rgba(0,0,0,0.5)] backdrop-blur-sm z-50 flex items-center justify-center p-4 opacity-0 invisible transition-all duration-300">
<div class="bg-white rounded-lg shadow-2xl max-w-2xl w-full max-h-[90vh] relative transform scale-90 transition-transform duration-300 overflow-hidden">
<button id="modal-close" class="absolute top-4 right-4 z-10 w-8 h-8 flex items-center justify-center rounded-full hover:bg-gray-100 transition-colors text-gray-500 hover:text-gray-700">
<svg class="w-5 h-5" fill="none" stroke="currentColor" viewBox="0 0 24 24">
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M6 18L18 6M6 6l12 12"></path>
</svg>
</button>
<!-- Контейнер для контента модалок -->
<div id="modal-content" class="overflow-y-auto max-h-[90vh]">
</div>
<div id="modal-content" class="overflow-y-auto max-h-[90vh]"></div>
</div>
</div>
<div id="modal-templates" class="hidden">
<?php foreach ($modals as $modal_name): ?>
<div id="modal-template-<?php echo esc_attr($modal_name); ?>" class="modal-template">