parent
32e9eba2ac
commit
9aa5906efa
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@ -1 +1,191 @@ |
|||||||
(()=>{var e,r={547:()=>{},566:()=>{},988:()=>{window.addEventListener("load",(function(){var e=document.querySelector("#primary-menu");document.querySelector("#primary-menu-toggle").addEventListener("click",(function(r){r.preventDefault(),e.classList.toggle("hidden")}))}))}},t={};function n(e){var o=t[e];if(void 0!==o)return o.exports;var i=t[e]={exports:{}};return r[e](i,i.exports,n),i.exports}n.m=r,e=[],n.O=(r,t,o,i)=>{if(!t){var a=1/0;for(u=0;u<e.length;u++){for(var[t,o,i]=e[u],l=!0,s=0;s<t.length;s++)(!1&i||a>=i)&&Object.keys(n.O).every((e=>n.O[e](t[s])))?t.splice(s--,1):(l=!1,i<a&&(a=i));if(l){e.splice(u--,1);var v=o();void 0!==v&&(r=v)}}return r}i=i||0;for(var u=e.length;u>0&&e[u-1][2]>i;u--)e[u]=e[u-1];e[u]=[t,o,i]},n.o=(e,r)=>Object.prototype.hasOwnProperty.call(e,r),(()=>{var e={847:0,992:0,252:0};n.O.j=r=>0===e[r];var r=(r,t)=>{var o,i,[a,l,s]=t,v=0;if(a.some((r=>0!==e[r]))){for(o in l)n.o(l,o)&&(n.m[o]=l[o]);if(s)var u=s(n)}for(r&&r(t);v<a.length;v++)i=a[v],n.o(e,i)&&e[i]&&e[i][0](),e[i]=0;return n.O(u)},t=self.webpackChunktailpress=self.webpackChunktailpress||[];t.forEach(r.bind(null,0)),t.push=r.bind(null,t.push.bind(t))})(),n.O(void 0,[992,252],(()=>n(988))),n.O(void 0,[992,252],(()=>n(547)));var o=n.O(void 0,[992,252],(()=>n(566)));o=n.O(o)})(); |
/******/ (() => { // webpackBootstrap
|
||||||
|
/******/ var __webpack_modules__ = ({ |
||||||
|
|
||||||
|
/***/ "./resources/css/app.css": |
||||||
|
/*!*******************************!*\ |
||||||
|
!*** ./resources/css/app.css ***! |
||||||
|
\*******************************/ |
||||||
|
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { |
||||||
|
|
||||||
|
"use strict"; |
||||||
|
__webpack_require__.r(__webpack_exports__); |
||||||
|
// extracted by mini-css-extract-plugin
|
||||||
|
|
||||||
|
|
||||||
|
/***/ }), |
||||||
|
|
||||||
|
/***/ "./resources/css/editor-style.css": |
||||||
|
/*!****************************************!*\ |
||||||
|
!*** ./resources/css/editor-style.css ***! |
||||||
|
\****************************************/ |
||||||
|
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { |
||||||
|
|
||||||
|
"use strict"; |
||||||
|
__webpack_require__.r(__webpack_exports__); |
||||||
|
// extracted by mini-css-extract-plugin
|
||||||
|
|
||||||
|
|
||||||
|
/***/ }), |
||||||
|
|
||||||
|
/***/ "./resources/js/app.js": |
||||||
|
/*!*****************************!*\ |
||||||
|
!*** ./resources/js/app.js ***! |
||||||
|
\*****************************/ |
||||||
|
/***/ (() => { |
||||||
|
|
||||||
|
// Navigation toggle
|
||||||
|
window.addEventListener('load', function () { |
||||||
|
var main_navigation = document.querySelector('#primary-menu'); |
||||||
|
document.querySelector('#primary-menu-toggle').addEventListener('click', function (e) { |
||||||
|
e.preventDefault(); |
||||||
|
main_navigation.classList.toggle('hidden'); |
||||||
|
}); |
||||||
|
}); |
||||||
|
|
||||||
|
/***/ }) |
||||||
|
|
||||||
|
/******/ }); |
||||||
|
/************************************************************************/ |
||||||
|
/******/ // The module cache
|
||||||
|
/******/ var __webpack_module_cache__ = {}; |
||||||
|
/******/
|
||||||
|
/******/ // The require function
|
||||||
|
/******/ function __webpack_require__(moduleId) { |
||||||
|
/******/ // Check if module is in cache
|
||||||
|
/******/ var cachedModule = __webpack_module_cache__[moduleId]; |
||||||
|
/******/ if (cachedModule !== undefined) { |
||||||
|
/******/ return cachedModule.exports; |
||||||
|
/******/ } |
||||||
|
/******/ // Create a new module (and put it into the cache)
|
||||||
|
/******/ var module = __webpack_module_cache__[moduleId] = { |
||||||
|
/******/ // no module.id needed
|
||||||
|
/******/ // no module.loaded needed
|
||||||
|
/******/ exports: {} |
||||||
|
/******/ }; |
||||||
|
/******/
|
||||||
|
/******/ // Execute the module function
|
||||||
|
/******/ __webpack_modules__[moduleId](module, module.exports, __webpack_require__); |
||||||
|
/******/
|
||||||
|
/******/ // Return the exports of the module
|
||||||
|
/******/ return module.exports; |
||||||
|
/******/ } |
||||||
|
/******/
|
||||||
|
/******/ // expose the modules object (__webpack_modules__)
|
||||||
|
/******/ __webpack_require__.m = __webpack_modules__; |
||||||
|
/******/
|
||||||
|
/************************************************************************/ |
||||||
|
/******/ /* webpack/runtime/chunk loaded */ |
||||||
|
/******/ (() => { |
||||||
|
/******/ var deferred = []; |
||||||
|
/******/ __webpack_require__.O = (result, chunkIds, fn, priority) => { |
||||||
|
/******/ if(chunkIds) { |
||||||
|
/******/ priority = priority || 0; |
||||||
|
/******/ for(var i = deferred.length; i > 0 && deferred[i - 1][2] > priority; i--) deferred[i] = deferred[i - 1]; |
||||||
|
/******/ deferred[i] = [chunkIds, fn, priority]; |
||||||
|
/******/ return; |
||||||
|
/******/ } |
||||||
|
/******/ var notFulfilled = Infinity; |
||||||
|
/******/ for (var i = 0; i < deferred.length; i++) { |
||||||
|
/******/ var [chunkIds, fn, priority] = deferred[i]; |
||||||
|
/******/ var fulfilled = true; |
||||||
|
/******/ for (var j = 0; j < chunkIds.length; j++) { |
||||||
|
/******/ if ((priority & 1 === 0 || notFulfilled >= priority) && Object.keys(__webpack_require__.O).every((key) => (__webpack_require__.O[key](chunkIds[j])))) { |
||||||
|
/******/ chunkIds.splice(j--, 1); |
||||||
|
/******/ } else { |
||||||
|
/******/ fulfilled = false; |
||||||
|
/******/ if(priority < notFulfilled) notFulfilled = priority; |
||||||
|
/******/ } |
||||||
|
/******/ } |
||||||
|
/******/ if(fulfilled) { |
||||||
|
/******/ deferred.splice(i--, 1) |
||||||
|
/******/ var r = fn(); |
||||||
|
/******/ if (r !== undefined) result = r; |
||||||
|
/******/ } |
||||||
|
/******/ } |
||||||
|
/******/ return result; |
||||||
|
/******/ }; |
||||||
|
/******/ })(); |
||||||
|
/******/
|
||||||
|
/******/ /* webpack/runtime/hasOwnProperty shorthand */ |
||||||
|
/******/ (() => { |
||||||
|
/******/ __webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop)) |
||||||
|
/******/ })(); |
||||||
|
/******/
|
||||||
|
/******/ /* webpack/runtime/make namespace object */ |
||||||
|
/******/ (() => { |
||||||
|
/******/ // define __esModule on exports
|
||||||
|
/******/ __webpack_require__.r = (exports) => { |
||||||
|
/******/ if(typeof Symbol !== 'undefined' && Symbol.toStringTag) { |
||||||
|
/******/ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' }); |
||||||
|
/******/ } |
||||||
|
/******/ Object.defineProperty(exports, '__esModule', { value: true }); |
||||||
|
/******/ }; |
||||||
|
/******/ })(); |
||||||
|
/******/
|
||||||
|
/******/ /* webpack/runtime/jsonp chunk loading */ |
||||||
|
/******/ (() => { |
||||||
|
/******/ // no baseURI
|
||||||
|
/******/
|
||||||
|
/******/ // object to store loaded and loading chunks
|
||||||
|
/******/ // undefined = chunk not loaded, null = chunk preloaded/prefetched
|
||||||
|
/******/ // [resolve, reject, Promise] = chunk loading, 0 = chunk loaded
|
||||||
|
/******/ var installedChunks = { |
||||||
|
/******/ "/js/app": 0, |
||||||
|
/******/ "css/editor-style": 0, |
||||||
|
/******/ "css/app": 0 |
||||||
|
/******/ }; |
||||||
|
/******/
|
||||||
|
/******/ // no chunk on demand loading
|
||||||
|
/******/
|
||||||
|
/******/ // no prefetching
|
||||||
|
/******/
|
||||||
|
/******/ // no preloaded
|
||||||
|
/******/
|
||||||
|
/******/ // no HMR
|
||||||
|
/******/
|
||||||
|
/******/ // no HMR manifest
|
||||||
|
/******/
|
||||||
|
/******/ __webpack_require__.O.j = (chunkId) => (installedChunks[chunkId] === 0); |
||||||
|
/******/
|
||||||
|
/******/ // install a JSONP callback for chunk loading
|
||||||
|
/******/ var webpackJsonpCallback = (parentChunkLoadingFunction, data) => { |
||||||
|
/******/ var [chunkIds, moreModules, runtime] = data; |
||||||
|
/******/ // add "moreModules" to the modules object,
|
||||||
|
/******/ // then flag all "chunkIds" as loaded and fire callback
|
||||||
|
/******/ var moduleId, chunkId, i = 0; |
||||||
|
/******/ if(chunkIds.some((id) => (installedChunks[id] !== 0))) { |
||||||
|
/******/ for(moduleId in moreModules) { |
||||||
|
/******/ if(__webpack_require__.o(moreModules, moduleId)) { |
||||||
|
/******/ __webpack_require__.m[moduleId] = moreModules[moduleId]; |
||||||
|
/******/ } |
||||||
|
/******/ } |
||||||
|
/******/ if(runtime) var result = runtime(__webpack_require__); |
||||||
|
/******/ } |
||||||
|
/******/ if(parentChunkLoadingFunction) parentChunkLoadingFunction(data); |
||||||
|
/******/ for(;i < chunkIds.length; i++) { |
||||||
|
/******/ chunkId = chunkIds[i]; |
||||||
|
/******/ if(__webpack_require__.o(installedChunks, chunkId) && installedChunks[chunkId]) { |
||||||
|
/******/ installedChunks[chunkId][0](); |
||||||
|
/******/ } |
||||||
|
/******/ installedChunks[chunkId] = 0; |
||||||
|
/******/ } |
||||||
|
/******/ return __webpack_require__.O(result); |
||||||
|
/******/ } |
||||||
|
/******/
|
||||||
|
/******/ var chunkLoadingGlobal = self["webpackChunktailpress"] = self["webpackChunktailpress"] || []; |
||||||
|
/******/ chunkLoadingGlobal.forEach(webpackJsonpCallback.bind(null, 0)); |
||||||
|
/******/ chunkLoadingGlobal.push = webpackJsonpCallback.bind(null, chunkLoadingGlobal.push.bind(chunkLoadingGlobal)); |
||||||
|
/******/ })(); |
||||||
|
/******/
|
||||||
|
/************************************************************************/ |
||||||
|
/******/
|
||||||
|
/******/ // startup
|
||||||
|
/******/ // Load entry module and return exports
|
||||||
|
/******/ // This entry module depends on other loaded chunks and execution need to be delayed
|
||||||
|
/******/ __webpack_require__.O(undefined, ["css/editor-style","css/app"], () => (__webpack_require__("./resources/js/app.js"))) |
||||||
|
/******/ __webpack_require__.O(undefined, ["css/editor-style","css/app"], () => (__webpack_require__("./resources/css/app.css"))) |
||||||
|
/******/ var __webpack_exports__ = __webpack_require__.O(undefined, ["css/editor-style","css/app"], () => (__webpack_require__("./resources/css/editor-style.css"))) |
||||||
|
/******/ __webpack_exports__ = __webpack_require__.O(__webpack_exports__); |
||||||
|
/******/
|
||||||
|
/******/ })() |
||||||
|
; |
@ -1,136 +1,86 @@ |
|||||||
<?php |
<?php |
||||||
|
|
||||||
// Моковые данные (потом заменить на ACF поля) |
$id = 'gallery-tabs-' . $block['id']; |
||||||
$galleryData = [ |
if ( ! empty($block['anchor'] ) ) { |
||||||
'reception' => [ |
$id = $block['anchor']; |
||||||
'title' => 'Зона ресепшен', |
} |
||||||
'images' => [ |
|
||||||
[ |
$classes = 'block-gallery-tabs'; |
||||||
'src' => 'https://placehold.co/800x600/4a5568/ffffff?text=Ресепшен+1', |
if ( ! empty( $block['className'] ) ) { |
||||||
'thumb' => 'https://placehold.co/150x100/4a5568/ffffff?text=Р1', |
$classes .= ' ' . $block['className']; |
||||||
'alt' => 'Ресепшен 1' |
} |
||||||
], |
if ( ! empty( $block['align'] ) ) { |
||||||
[ |
$classes .= ' align' . $block['align']; |
||||||
'src' => 'https://placehold.co/800x600/2d3748/ffffff?text=Ресепшен+2', |
} |
||||||
'thumb' => 'https://placehold.co/150x100/2d3748/ffffff?text=Р2', |
|
||||||
'alt' => 'Ресепшен 2' |
$heading = get_field('heading'); |
||||||
], |
$slider_tabs = get_field('slider_tabs'); |
||||||
[ |
|
||||||
'src' => 'https://placehold.co/800x600/1a202c/ffffff?text=Ресепшен+3', |
|
||||||
'thumb' => 'https://placehold.co/150x100/1a202c/ffffff?text=Р3', |
|
||||||
'alt' => 'Ресепшен 3' |
|
||||||
], |
|
||||||
[ |
|
||||||
'src' => 'https://placehold.co/800x600/718096/ffffff?text=Ресепшен+4', |
|
||||||
'thumb' => 'https://placehold.co/150x100/718096/ffffff?text=Р4', |
|
||||||
'alt' => 'Ресепшен 4' |
|
||||||
] |
|
||||||
] |
|
||||||
], |
|
||||||
'gym' => [ |
|
||||||
'title' => 'Зона тренажерного зала', |
|
||||||
'images' => [ |
|
||||||
[ |
|
||||||
'src' => 'https://placehold.co/800x600/dc2626/ffffff?text=Тренажёрный+1', |
|
||||||
'thumb' => 'https://placehold.co/150x100/dc2626/ffffff?text=Т1', |
|
||||||
'alt' => 'Тренажерный зал 1' |
|
||||||
], |
|
||||||
[ |
|
||||||
'src' => 'https://placehold.co/800x600/b91c1c/ffffff?text=Тренажёрный+2', |
|
||||||
'thumb' => 'https://placehold.co/150x100/b91c1c/ffffff?text=Т2', |
|
||||||
'alt' => 'Тренажерный зал 2' |
|
||||||
], |
|
||||||
[ |
|
||||||
'src' => 'https://placehold.co/800x600/991b1b/ffffff?text=Тренажёрный+3', |
|
||||||
'thumb' => 'https://placehold.co/150x100/991b1b/ffffff?text=Т3', |
|
||||||
'alt' => 'Тренажерный зал 3' |
|
||||||
], |
|
||||||
[ |
|
||||||
'src' => 'https://placehold.co/800x600/7f1d1d/ffffff?text=Тренажёрный+4', |
|
||||||
'thumb' => 'https://placehold.co/150x100/7f1d1d/ffffff?text=Т4', |
|
||||||
'alt' => 'Тренажерный зал 4' |
|
||||||
], |
|
||||||
[ |
|
||||||
'src' => 'https://placehold.co/800x600/ef4444/ffffff?text=Тренажёрный+5', |
|
||||||
'thumb' => 'https://placehold.co/150x100/ef4444/ffffff?text=Т5', |
|
||||||
'alt' => 'Тренажерный зал 5' |
|
||||||
] |
|
||||||
] |
|
||||||
], |
|
||||||
'group' => [ |
|
||||||
'title' => 'Залы для групповых тренировок', |
|
||||||
'images' => [ |
|
||||||
[ |
|
||||||
'src' => 'https://placehold.co/800x600/059669/ffffff?text=Групповые+1', |
|
||||||
'thumb' => 'https://placehold.co/150x100/059669/ffffff?text=Г1', |
|
||||||
'alt' => 'Групповые тренировки 1' |
|
||||||
], |
|
||||||
[ |
|
||||||
'src' => 'https://placehold.co/800x600/047857/ffffff?text=Групповые+2', |
|
||||||
'thumb' => 'https://placehold.co/150x100/047857/ffffff?text=Г2', |
|
||||||
'alt' => 'Групповые тренировки 2' |
|
||||||
], |
|
||||||
[ |
|
||||||
'src' => 'https://placehold.co/800x600/065f46/ffffff?text=Групповые+3', |
|
||||||
'thumb' => 'https://placehold.co/150x100/065f46/ffffff?text=Г3', |
|
||||||
'alt' => 'Групповые тренировки 3' |
|
||||||
] |
|
||||||
] |
|
||||||
] |
|
||||||
]; |
|
||||||
|
|
||||||
$block_id = 'gallery-' . $block['id']; |
|
||||||
?> |
?> |
||||||
|
|
||||||
<div class="gallery-block" |
<div class="gallery-block mt-[24px]" |
||||||
id="<?php echo $block_id; ?>"
|
id="<?php echo esc_attr( $id ); ?>"
|
||||||
data-gallery-id="<?php echo $block_id; ?>">
|
data-gallery-id="<?php echo esc_attr( $id ); ?>">
|
||||||
<div class="container mx-auto"> |
<div class="container mx-auto"> |
||||||
<h2 class="text-[32px] font-bold mb-[30px]">Галерея</h2> |
|
||||||
|
|
||||||
<div class="flex gap-[10px] mb-[30px]"> |
<?php if ($heading) : ?> |
||||||
<?php foreach ($galleryData as $index => $tab): ?> |
<h2 class="text-[32px] font-bold"><?php echo esc_html($heading); ?></h2>
|
||||||
<button class="tab-button px-[24px] py-[12px] border-0 rounded-[25px] cursor-pointer transition-all <?php echo $index === 'reception' ? 'active underline' : ''; ?>"
|
<?php endif; ?> |
||||||
data-tab="<?php echo $index; ?>">
|
|
||||||
<?php echo esc_html($tab['title']); ?> |
<?php if ($slider_tabs && !empty($slider_tabs['slider_tab'])) : ?> |
||||||
</button> |
<div class="flex gap-[10px] mt-[24px]"> |
||||||
<?php endforeach; ?> |
<?php foreach ($slider_tabs['slider_tab'] as $tab_index => $tab) : ?> |
||||||
</div> |
<?php if (!empty($tab['tab_name'])) : ?> |
||||||
|
<button class="tab-button px-[24px] py-[12px] border rounded-[25px] cursor-pointer transition-all <?php echo $tab_index === 0 ? 'active underline' : ''; ?>"
|
||||||
|
data-tab="<?php echo $tab_index; ?>">
|
||||||
|
<?php echo esc_html($tab['tab_name']); ?> |
||||||
|
</button> |
||||||
|
<?php endif; ?> |
||||||
|
<?php endforeach; ?> |
||||||
|
</div> |
||||||
|
<?php endif; ?> |
||||||
</div> |
</div> |
||||||
|
|
||||||
<?php foreach ($galleryData as $tab_id => $tab_data): ?> |
<?php if ($slider_tabs && !empty($slider_tabs['slider_tab'])) : ?> |
||||||
<div class="tab-content <?php echo $tab_id === 'reception' ? 'block' : 'hidden'; ?>"
|
<?php foreach ($slider_tabs['slider_tab'] as $tab_index => $tab) : ?> |
||||||
id="tab-<?php echo $tab_id; ?>">
|
<div class="tab-content <?php echo $tab_index === 0 ? 'block' : 'hidden'; ?>"
|
||||||
|
id="tab-<?php echo $tab_index; ?>">
|
||||||
|
|
||||||
<div class="swiper gallery-swiper mb-[20px] h-[440px]" id="swiper-<?php echo $tab_id; ?>">
|
<?php if (!empty($tab['slider_images'])) : ?> |
||||||
<div class="swiper-wrapper"> |
<div class="swiper mt-[24px] gallery-swiper h-[440px]" id="swiper-<?php echo $tab_index; ?>">
|
||||||
<?php foreach ($tab_data['images'] as $image): ?> |
<div class="swiper-wrapper"> |
||||||
<div class="swiper-slide cursor-pointer min-h-[440px]"> |
<?php foreach ($tab['slider_images'] as $image) : ?> |
||||||
<a href="<?php echo esc_url($image['src']); ?>"
|
<div class="swiper-slide cursor-pointer min-h-[440px]"> |
||||||
class="glightbox block w-full h-full" |
<a href="<?php echo esc_url($image['url']); ?>"
|
||||||
data-gallery="gallery-<?php echo $tab_id; ?>">
|
class="glightbox block w-full h-full" |
||||||
<img src="<?php echo esc_url($image['src']); ?>"
|
data-gallery="gallery-<?php echo $tab_index; ?>">
|
||||||
alt="<?php echo esc_attr($image['alt']); ?>"
|
<img src="<?php echo esc_url($image['url']); ?>"
|
||||||
class="w-full h-full object-cover"> |
alt="<?php echo esc_attr($image['alt']); ?>"
|
||||||
</a> |
class="w-full h-full object-cover"> |
||||||
|
</a> |
||||||
|
</div> |
||||||
|
<?php endforeach; ?> |
||||||
</div> |
</div> |
||||||
<?php endforeach; ?> |
<div class="swiper-button-next"></div> |
||||||
</div> |
<div class="swiper-button-prev"></div> |
||||||
<div class="swiper-button-next"></div> |
</div> |
||||||
<div class="swiper-button-prev"></div> |
|
||||||
</div> |
|
||||||
|
|
||||||
<div class="flex gap-[8px] overflow-x-auto"> |
<div class="flex mt-[24px] gap-[8px] overflow-x-auto"> |
||||||
<?php foreach ($tab_data['images'] as $thumb_index => $image): ?> |
<?php foreach ($tab['slider_images'] as $thumb_index => $image) : ?> |
||||||
<div class="thumbnail flex-shrink-0 w-[80px] h-[60px] rounded-[5px] overflow-hidden cursor-pointer border-2 border-transparent <?php echo $thumb_index === 0 ? 'active !border-blue-500' : ''; ?>"
|
<div class="thumbnail flex-shrink-0 w-[80px] h-[60px] rounded-[5px] overflow-hidden cursor-pointer border-2 border-transparent <?php echo $thumb_index === 0 ? 'active !border-blue-500' : ''; ?>"
|
||||||
data-index="<?php echo $thumb_index; ?>">
|
data-index="<?php echo $thumb_index; ?>">
|
||||||
<img src="<?php echo esc_url($image['thumb']); ?>"
|
<img src="<?php echo esc_url($image['sizes']['thumbnail']); ?>"
|
||||||
alt="<?php echo esc_attr($image['alt']); ?>"
|
alt="<?php echo esc_attr($image['alt']); ?>"
|
||||||
class="w-full h-full object-cover"> |
class="w-full h-full object-cover"> |
||||||
|
</div> |
||||||
|
<?php endforeach; ?> |
||||||
</div> |
</div> |
||||||
<?php endforeach; ?> |
|
||||||
</div> |
|
||||||
</div> |
|
||||||
<?php endforeach; ?> |
|
||||||
</div> |
|
||||||
|
|
||||||
|
<?php if (!empty($image['caption'])) : ?> |
||||||
|
<p><?php echo esc_html($image['caption']); ?></p>
|
||||||
|
<?php endif; ?> |
||||||
|
<?php endif; ?> |
||||||
|
</div> |
||||||
|
<?php endforeach; ?> |
||||||
|
<?php endif; ?> |
||||||
|
</div> |
@ -0,0 +1,62 @@ |
|||||||
|
<?php |
||||||
|
|
||||||
|
$id = 'tiles-block-' . $block['id']; |
||||||
|
if ( ! empty($block['anchor'] ) ) { |
||||||
|
$id = $block['anchor']; |
||||||
|
} |
||||||
|
|
||||||
|
$classes = 'block-tiles-block'; |
||||||
|
if ( ! empty( $block['className'] ) ) { |
||||||
|
$classes .= ' ' . $block['className']; |
||||||
|
} |
||||||
|
if ( ! empty( $block['align'] ) ) { |
||||||
|
$classes .= ' align' . $block['align']; |
||||||
|
} |
||||||
|
|
||||||
|
$heading = get_field('heading'); |
||||||
|
$tiles_repeater = get_field('tiles_repeater'); |
||||||
|
|
||||||
|
|
||||||
|
?> |
||||||
|
|
||||||
|
<section id="<?php echo esc_attr( $id ); ?>" class="<?php echo esc_attr( $classes ); ?>">
|
||||||
|
<div class="container mx-auto mt-[24px]"> |
||||||
|
|
||||||
|
<?php if ($heading) : ?> |
||||||
|
<h2 class="text-[48px] max-[768px]:text-[36px] font-bold text-center text-[#1f2937]"> |
||||||
|
<?php echo esc_html($heading); ?> |
||||||
|
</h2> |
||||||
|
<?php endif; ?> |
||||||
|
|
||||||
|
<?php if ($tiles_repeater) : ?> |
||||||
|
<div class="mt-[24px] grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-[30px] max-[768px]:gap-[20px]"> |
||||||
|
<?php foreach ($tiles_repeater as $tile) : ?> |
||||||
|
<div class="bg-[#ffffff] border-[1px] border-[#e5e7eb] rounded-[16px] p-[30px] max-[768px]:p-[20px] shadow-lg hover:shadow-xl transition-shadow duration-300"> |
||||||
|
|
||||||
|
<?php if (!empty($tile['image'])) : ?> |
||||||
|
<div class="w-[80px] h-[80px] rounded-full overflow-hidden mb-[20px] mx-auto bg-[#f3f4f6] flex items-center justify-center"> |
||||||
|
<img src="<?php echo esc_url($tile['image']['url']); ?>"
|
||||||
|
alt="<?php echo esc_attr($tile['image']['alt']); ?>"
|
||||||
|
class="w-full h-full object-cover" /> |
||||||
|
</div> |
||||||
|
<?php endif; ?> |
||||||
|
|
||||||
|
<?php if (!empty($tile['title'])) : ?> |
||||||
|
<h3 class="text-[24px] max-[768px]:text-[20px] font-semibold text-[#1f2937] mb-[16px] text-center"> |
||||||
|
<?php echo esc_html($tile['title']); ?> |
||||||
|
</h3> |
||||||
|
<?php endif; ?> |
||||||
|
|
||||||
|
<?php if (!empty($tile['text'])) : ?> |
||||||
|
<div class="text-[16px] max-[768px]:text-[14px] text-[#6b7280] leading-[150%] text-center"> |
||||||
|
<?php echo wp_kses_post($tile['text']); ?> |
||||||
|
</div> |
||||||
|
<?php endif; ?> |
||||||
|
|
||||||
|
</div> |
||||||
|
<?php endforeach; ?> |
||||||
|
</div> |
||||||
|
<?php endif; ?> |
||||||
|
|
||||||
|
</div> |
||||||
|
</section> |
Loading…
Reference in new issue