This commit is contained in:
Tomas Dvorak
2025-11-03 19:54:39 +01:00
parent 087f30e82c
commit d5b4faea61
141 changed files with 78770 additions and 966 deletions
+74
View File
@@ -0,0 +1,74 @@
'use strict';
(function(){
const KEY = 'adminAuthB64'; // stores base64 of user:pass
function b64(u, p){
try { return btoa(`${u}:${p}`); } catch { return ''; }
}
function get(){
try { return localStorage.getItem(KEY) || ''; } catch { return ''; }
}
function set(val){
try { localStorage.setItem(KEY, val||''); } catch {}
}
function clear(){
try { localStorage.removeItem(KEY); } catch {}
}
window.AdminAuth = {
has(){ return !!get(); },
getHeaders(){ const v = get(); return v ? { 'Authorization': 'Basic '+v } : {}; },
setCreds(user, pass){ set(b64(user, pass)); },
clear(){ clear(); }
};
// small UI helper (optional) appears bottom-left
function ensureWidget(){
if (document.getElementById('admin-auth-widget')) return;
const wrap = document.createElement('div');
wrap.id = 'admin-auth-widget';
wrap.style.position = 'fixed';
wrap.style.left = '12px';
wrap.style.bottom = '12px';
wrap.style.zIndex = '9999';
wrap.style.display = 'flex';
wrap.style.gap = '6px';
const btnSet = document.createElement('button');
btnSet.textContent = 'Přihlásit';
btnSet.style.padding = '6px 10px';
btnSet.style.borderRadius = '8px';
btnSet.style.border = '1px solid #cbd5e1';
btnSet.style.background = '#fff';
btnSet.addEventListener('click', () => {
const u = prompt('Uživatel (e-mail):');
if (!u) return;
const p = prompt('Heslo:');
if (p == null) return;
window.AdminAuth.setCreds(u, p);
alert('Přihlašovací údaje uloženy do tohoto prohlížeče.');
});
const btnClr = document.createElement('button');
btnClr.textContent = 'Odhlásit';
btnClr.style.padding = '6px 10px';
btnClr.style.borderRadius = '8px';
btnClr.style.border = '1px solid #cbd5e1';
btnClr.style.background = '#fff';
btnClr.addEventListener('click', () => {
window.AdminAuth.clear();
alert('Odhlášeno uložené údaje odstraněny.');
});
wrap.appendChild(btnSet);
wrap.appendChild(btnClr);
document.body.appendChild(wrap);
}
if (document.readyState === 'loading') {
document.addEventListener('DOMContentLoaded', ensureWidget);
} else {
ensureWidget();
}
})();
+89
View File
@@ -0,0 +1,89 @@
'use strict';
(function(){
function h(el, attrs={}, children=[]) {
const e = document.createElement(el);
for (const [k,v] of Object.entries(attrs||{})) {
if (k === 'class') e.className = v; else if (k === 'html') e.innerHTML = v; else e.setAttribute(k, v);
}
for (const c of (children||[])) e.appendChild(c);
return e;
}
function renderItem(item){
const col = h('div', {class: 'items col-xl-6 col-lg-6 col-md-6 col-sm-6 col-ms-6 col-xs-12'});
const article = h('article', {class: 'post-25620 post type-post status-publish format-standard has-post-thumbnail hentry'});
const aPhoto = h('a', {href: item.link, class: 'lte-photo'});
const img = h('img', {
src: item.image,
width: '500',
height: '300',
decoding: 'async',
fetchpriority: 'high',
class: 'attachment-atleticos-blog size-atleticos-blog wp-post-image',
alt: ''
});
aPhoto.appendChild(img);
aPhoto.appendChild(h('span', {class: 'lte-photo-overlay'}));
const descr = h('div', {class: 'lte-description'});
const aHeader = h('a', {href: item.link, class: 'lte-header'});
const h3 = h('h3', {html: item.title || ('Článek ' + item.id)});
aHeader.appendChild(h3);
// const excerpt = h('div', {class: 'lte-excerpt', html: ''});
descr.appendChild(aHeader);
// descr.appendChild(excerpt);
article.appendChild(aPhoto);
article.appendChild(descr);
col.appendChild(article);
return col;
}
async function loadLatest(attempt = 0) {
const primary = document.getElementById('latest-blog-items');
const secondary = document.getElementById('other-blog-items');
if (!primary && !secondary) return;
if (primary) primary.innerHTML = '<div style="width:100%;text-align:center;padding:12px;color:#888;">Načítání…</div>';
if (secondary) secondary.innerHTML = '';
try {
const res = await fetch('/api/blog/latest?limit=12', {credentials: 'omit'});
if (!res.ok) throw new Error('HTTP '+res.status);
let items = await res.json();
if (primary) primary.innerHTML = '';
if (!Array.isArray(items) || items.length === 0) {
if (primary) primary.innerHTML = '<div style="width:100%;text-align:center;padding:12px;color:#888;">Žádné příspěvky zatím nejsou.</div>';
return;
}
// Exclude carousel-used posts and pinned 0000 from the 4-grid
const hasCarouselIds = Array.isArray(window.CAROUSEL_BLOG_IDS) && window.CAROUSEL_BLOG_IDS.length > 0;
// If carousel IDs are not ready yet, retry shortly (max 5 attempts)
if (!hasCarouselIds && attempt < 5) {
setTimeout(() => loadLatest(attempt + 1), 300);
return;
}
const excluded = new Set(hasCarouselIds ? window.CAROUSEL_BLOG_IDS : []);
const four = items.filter(it => it && it.id !== '0000' && !excluded.has(it.id)).slice(0, 4);
// Prefer rendering into primary; keep secondary empty to avoid duplicates
const target = primary || secondary;
if (target) {
const frag = document.createDocumentFragment();
four.forEach(it => frag.appendChild(renderItem(it)));
target.appendChild(frag);
}
if (secondary && secondary !== target) secondary.innerHTML = '';
} catch (e) {
console.error('Load latest blog error', e);
if (primary) primary.innerHTML = '<div style="width:100%;text-align:center;padding:12px;color:#c00;">Nepodařilo se načíst novinky.</div>';
}
}
if (document.readyState === 'loading') {
document.addEventListener('DOMContentLoaded', () => loadLatest(0));
} else {
loadLatest(0);
}
})();
+85
View File
@@ -0,0 +1,85 @@
'use strict';
(function(){
function h(el, attrs={}, children=[]) {
const e = document.createElement(el);
for (const [k,v] of Object.entries(attrs||{})) {
if (k === 'class') e.className = v; else if (k === 'html') e.innerHTML = v; else e.setAttribute(k, v);
}
for (const c of (children||[])) e.appendChild(c);
return e;
}
function renderItem(item){
const col = h('div', {class: 'col-xl-4 col-lg-6 col-md-6 col-sm-12 col-xs-12 item div-thumbnail'});
const article = h('article', {class: 'post-25620 post type-post status-publish format-standard has-post-thumbnail hentry'});
const aPhoto = h('a', {href: item.link, class: 'lte-photo'});
const img = h('img', {
src: item.image,
width: '500', height: '300', decoding: 'async', fetchpriority: 'high',
class: 'attachment-atleticos-blog size-atleticos-blog wp-post-image', alt: ''
});
aPhoto.appendChild(img);
aPhoto.appendChild(h('span', {class: 'lte-photo-overlay'}));
const descr = h('div', {class: 'lte-description'});
const aHeader = h('a', {href: item.link, class: 'lte-header'});
aHeader.appendChild(h('h3', {html: item.title || ('Článek ' + item.id)}));
descr.appendChild(aHeader);
article.appendChild(aPhoto);
article.appendChild(descr);
col.appendChild(article);
return col;
}
function numericDesc(a,b){
const ai = parseInt(a.id,10); const bi = parseInt(b.id,10);
if (!isNaN(ai) && !isNaN(bi)) return bi - ai;
return (b.id||'').localeCompare(a.id||'');
}
function getQueryParam(name){
const url = new URL(window.location.href);
return url.searchParams.get(name);
}
function normalize(s){ return (s||'').toString().trim().toLowerCase(); }
async function loadAll(){
// Render into the primary masonry grid, overwriting any static items
const mount = document.querySelector('.lte-blog-wrap .blog .row.masonry');
if (!mount) return;
mount.innerHTML = '<div style="width:100%;text-align:center;padding:12px;color:#888;">Načítání…</div>';
try {
const res = await fetch('/api/blog/latest?limit=10000', {credentials: 'omit'});
if (!res.ok) throw new Error('HTTP '+res.status);
let items = await res.json();
if (!Array.isArray(items)) items = [];
// Sort by numeric ID desc to ensure largest number is latest
items.sort(numericDesc);
// Optional filter by category via ?category=XYZ
const qCat = getQueryParam('category');
if (qCat) {
const want = normalize(qCat);
items = items.filter(it => Array.isArray(it.categories) && it.categories.some(c => normalize(c) === want));
}
mount.innerHTML = '';
if (items.length === 0) {
mount.innerHTML = '<div style="width:100%;text-align:center;padding:12px;color:#888;">Žádné příspěvky zatím nejsou.</div>';
return;
}
const frag = document.createDocumentFragment();
items.forEach(it => frag.appendChild(renderItem(it)));
mount.appendChild(frag);
} catch (e) {
console.error('Load blog list error', e);
mount.innerHTML = '<div style="width:100%;text-align:center;padding:12px;color:#c00;">Nepodařilo se načíst seznam článků.</div>';
}
}
if (document.readyState === 'loading') {
document.addEventListener('DOMContentLoaded', loadAll);
} else {
loadAll();
}
})();
+7
View File
File diff suppressed because one or more lines are too long
+116
View File
File diff suppressed because one or more lines are too long
+471
View File
@@ -0,0 +1,471 @@
(function(){
const DATA_URL_JSON = '/data/club.json';
const TZ = 'Europe/Prague';
let state = {
data: null,
compIndex: 0,
matchIndex: 0,
intervalId: null,
upcomingTimerId: null,
};
function parseCZDate(s){
try{
// format: 02.01.2006 15:04
const [d, t] = s.split(' ');
const [day, month, year] = d.split('.').map(Number);
const [hour, minute] = t.split(':').map(Number);
// Interpret as local time (Europe/Prague). Using local constructor avoids UTC offset skew.
const dt = new Date(year, month-1, day, hour, minute);
return dt;
}catch(e){ return null; }
}
// using original logo URLs; no cleaning/proxy
function ensureFacrStyles(){
if(document.getElementById('facr-styles')) return;
const css = `
/* logo background unchanged */
.facr-nav{ background:#ffffff22; border:1px solid #ffffff55; color:#fff; padding:6px 10px; border-radius:6px; cursor:pointer; backdrop-filter: blur(2px); }
.facr-nav:hover{ background:#ffffff40; }
.facr-nav:disabled{ opacity:.5; cursor:default; }
.facr-tab{ padding:6px 10px; margin:4px; border-radius:16px; border:1px solid #c42221; color:#c42221; background:#ffffff; font-weight:600; }
.facr-tab.active{ background:#c42221; color:#ffffff; }
.facr-tab:hover{ background:#c42221cc; color:#ffffff; }
.facr-inline-status{ margin-left:8px; font-weight:700; font-size:14px; white-space:nowrap; color:inherit; display:inline-block; vertical-align:middle; }
/* Default (desktop): show middle only */
#facr-countdown{ display:none !important; }
.facr-inline-status{ display:none !important; }
.facr-mob-center-score{ display:none; font-weight:700; font-size:24px; line-height:1; }
/* Mobile: keep only the bottom countdown by default */
@media (max-width: 767px){
#facr-mid{ display:none !important; }
#facr-countdown{ display:block !important; }
.facr-inline-status{ display:none !important; }
.facr-mob-center-score{ display:inline-block !important; }
/* If finished, hide the bottom countdown */
.facr-finished #facr-countdown{ display:none !important; }
}
@media (max-width: 480px){
#facr-mid{ font-size:28px !important; min-width:100px; }
.facr-tab{ padding:4px 8px; font-size:14px; }
.facr-inline-status{ font-size:12px; margin-left:6px; }
.facr-nav{ padding:4px 8px; }
}
`;
const style = document.createElement('style');
style.id = 'facr-styles';
style.type = 'text/css';
style.appendChild(document.createTextNode(css));
document.head.appendChild(style);
}
function fmtCountdown(ms){
if(ms <= 0) return '0m';
const totalMin = Math.floor(ms/60000);
const d = Math.floor(totalMin/(60*24));
const h = Math.floor((totalMin - d*60*24)/60);
const m = totalMin % 60;
const parts = [];
if(d) parts.push(`${d}d`);
if(h || d) parts.push(`${h}h`);
parts.push(`${m}m`);
return parts.join(' ');
}
function fmtCountdownLong(ms){
if(ms < 0) ms = 0;
const totalSec = Math.floor(ms/1000);
const d = Math.floor(totalSec / (24*3600));
const h = Math.floor((totalSec % (24*3600)) / 3600);
const m = Math.floor((totalSec % 3600) / 60);
const s = totalSec % 60;
const dd = d > 0 ? `${d}d ` : '';
const hh = String(h).padStart(2,'0');
const mm = String(m).padStart(2,'0');
const ss = String(s).padStart(2,'0');
return `${dd}${hh}:${mm}:${ss}`.trim();
}
function todayCZ(){
const now = new Date();
const dd = String(now.getDate()).padStart(2,'0');
const mm = String(now.getMonth()+1).padStart(2,'0');
const yyyy = now.getFullYear();
return `${dd}.${mm}.${yyyy}`;
}
async function fetchData(){
const res = await fetch(DATA_URL_JSON, { cache: 'no-cache' });
if(!res.ok) throw new Error('Failed to fetch data');
const data = await res.json();
state.data = data;
return data;
}
function escapeHTML(s){
if(s == null) return '';
return String(s)
.replace(/&/g, '&amp;')
.replace(/</g, '&lt;')
.replace(/>/g, '&gt;')
.replace(/"/g, '&quot;')
.replace(/'/g, '&#39;');
}
function truncate(s, max){
const str = s == null ? '' : String(s);
if(max <= 0) return '';
return str.length > max ? str.slice(0, max - 1) + '…' : str;
}
function isWithinMatchWindow(){
if(!state.data) return false;
const now = new Date();
for(const comp of state.data.club_detail.competitions || []){
for(const m of comp.matches || []){
const dt = parseCZDate(m.date_time);
if(!dt) continue;
const diffMs = Math.abs(now - dt);
if(diffMs <= 2*60*60*1000) return true;
}
}
return false;
}
function upcomingMatchesAll(){
const list = [];
if(!state.data) return list;
const now = new Date();
const windowStart = new Date(now.getTime() - 3*24*60*60*1000);
for(const comp of state.data.club_detail.competitions || []){
const candidates = (comp.matches || [])
.map(m=>({ comp, match: m, dt: parseCZDate(m.date_time) }))
.filter(x=> x.dt && x.dt >= windowStart)
.sort((a,b)=> a.dt - b.dt);
if(candidates.length === 0) continue;
// Prefer the latest recently finished match within the 3-day window;
// if none, then choose the next upcoming; if none, fall back to the latest overall in window
let pick = null;
// find latest finished (dt < now) within window
for(let i = candidates.length - 1; i >= 0; i--){
if(candidates[i].dt < now){ pick = candidates[i]; break; }
}
if(!pick){
pick = candidates.find(x=> x.dt >= now) || candidates[candidates.length - 1];
}
list.push(pick);
}
// sort resulting per-competition picks by time ascending for navigation
list.sort((a,b)=> a.dt - b.dt);
return list;
}
function renderUpcoming(){
const root = document.getElementById('facr-upcoming');
if(!root) return;
ensureFacrStyles();
// clear any previous per-second timer
if(state.upcomingTimerId){
clearInterval(state.upcomingTimerId);
state.upcomingTimerId = null;
}
const items = upcomingMatchesAll();
if(items.length === 0){
root.innerHTML = '<div class="lte-football-upcoming"><span class="lte-header lte-header-upcoming">Žádné nadcházející zápasy</span></div>';
return;
}
// Selection policy:
// 1) If there is any finished match within the last 3 days across competitions,
// show the latest such finished match (keep result visible for 3 days)
// 2) Otherwise, show the first future match
// 3) If none, show the latest overall (shouldn't happen as items filtered by 3d window per-comp)
const now = new Date();
const threeDms = 3*24*60*60*1000;
let latestRecentIdx = -1;
let latestRecentTime = -Infinity;
items.forEach((it, i) => {
const dtms = it.dt.getTime();
if(dtms <= now.getTime() && now.getTime() - dtms <= threeDms){
if(dtms > latestRecentTime){ latestRecentTime = dtms; latestRecentIdx = i; }
}
});
let preferredIdx = latestRecentIdx;
if(preferredIdx === -1){
preferredIdx = items.findIndex(it => it.dt >= now);
if(preferredIdx === -1) preferredIdx = items.length - 1;
}
const idx = Math.min(state.matchIndex || preferredIdx, items.length-1);
const { comp, match:m } = items[idx];
const compName = truncate(escapeHTML(comp.name || comp.code || 'Soutěž'), 60);
const homeLogo = m.home_logo_url || 'img/logo.png';
const awayLogo = m.away_logo_url || 'img/logo.png';
const facrLink = m.facr_link || comp.matches_link || state.data.club_detail.url || '#';
const UP_MAX = 24;
const homeName = truncate(escapeHTML(m.home), UP_MAX);
const awayName = truncate(escapeHTML(m.away), UP_MAX);
const dateVenue = truncate(escapeHTML(m.date_time + (m.venue?`, ${m.venue}`:'')), 40);
// Determine if match is today (CZ date) and precompute mid display text
const matchDayCZ = (m.date_time || '').split(' ')[0];
const isToday = matchDayCZ === todayCZ();
const startDt = m.date_time ? parseCZDate(m.date_time) : null;
const diffMsPre = startDt ? (startDt.getTime() - new Date().getTime()) : 0;
const midText = (diffMsPre > 0) ? `Za ${fmtCountdownLong(diffMsPre)}` : (m.score || '-');
// Determine status flags and parse score parts if any
const now2_forTpl = new Date();
const startMs_forTpl = m.date_time ? parseCZDate(m.date_time).getTime() : 0;
const diff_forTpl = startMs_forTpl - now2_forTpl.getTime();
const twoH_forTpl = 2*60*60*1000;
const threeD_forTpl = 3*24*60*60*1000;
const isFuture = diff_forTpl > 0;
const isLive = Math.abs(diff_forTpl) <= twoH_forTpl;
const isRecentFinished = (!isFuture && !isLive && -diff_forTpl < threeD_forTpl);
const scoreStr = m.score || '';
const s1 = scoreStr && scoreStr.includes(':') ? escapeHTML(scoreStr.split(':')[0]) : '';
const s2 = scoreStr && scoreStr.includes(':') ? escapeHTML(scoreStr.split(':')[1]) : '';
// Date/time formatting for display lines
const dtForDisp = startDt || (m.date_time ? parseCZDate(m.date_time) : null);
const dd = dtForDisp ? String(dtForDisp.getDate()).padStart(1,'') : '';
const mm = dtForDisp ? String(dtForDisp.getMonth()+1).padStart(1,'') : '';
const yyyy = dtForDisp ? dtForDisp.getFullYear() : '';
const HH = dtForDisp ? String(dtForDisp.getHours()).padStart(2,'0') : '';
const MM = dtForDisp ? String(dtForDisp.getMinutes()).padStart(2,'0') : '';
const dateOnly = dtForDisp ? `${dd}. ${mm}. ${yyyy}` : '';
const timeToken = (m.date_time || '').split(' ')[1] || '';
const timeOnly = dtForDisp ? `${HH}:${MM}` : '';
const timeDisplay = dtForDisp ? ((timeToken === '' || timeToken === '00:00') ? 'Bude upřesněno' : timeOnly) : '';
const venue = m.venue || '';
const wrapperExtraClass = (isRecentFinished && s1 && s2) ? ' facr-finished' : '';
const headerLabel = isLive ? 'Aktuální zápas' : (isFuture ? 'Nadcházející zápas' : (isRecentFinished ? 'Poslední zápas' : `Zápasy (${idx+1}/${items.length})`));
root.innerHTML = `
<div class="lte-football-upcoming${wrapperExtraClass}">
<div class="facr-comp-title lte-football-date" style="text-align:center; margin-bottom:6px;">${compName}</div>
<div class="facr-upcoming-header">
<button id="facr-prev" class="facr-nav">◀</button>
<span class="lte-header lte-header-upcoming">${headerLabel}</span>
<button id="facr-next" class="facr-nav">▶</button>
</div>
<div class="lte-teams">
<span class="lte-team-name lte-team-1 lte-header" title="${escapeHTML(m.home)}">
<span class="lte-team-logo"><img decoding="async" src="${homeLogo}" alt="${escapeHTML(m.home)}"></span>${homeName}
<span id="facr-inline-status" class="facr-inline-status" aria-live="polite"></span>
${isRecentFinished && s1 ? `<span class="lte-team-count-mob">${s1}</span>` : ''}
</span>
<span class="lte-team-count">
<span id="facr-mid" style="font-size:32px; line-height:1; font-weight:700; display:inline-block; min-width:120px; text-align:center;">${midText}</span>
${isRecentFinished && s1 && s2 ? `<span class="facr-mob-center-score">${s1}<span>:</span>${s2}</span>` : ''}
</span>
<span class="lte-team-name lte-team-2 lte-header" title="${escapeHTML(m.away)}">
${isRecentFinished && s2 ? `<span class=\"lte-team-count-mob\">${s2}</span>` : ''}${awayName}<span class="lte-team-logo"><img decoding="async" src="${awayLogo}" alt="${escapeHTML(m.away)}"></span>
</span>
</div>
<span class="lte-football-date" style="text-align:center;" title="${escapeHTML(m.date_time + (m.venue?`, ${m.venue}`:''))}">${escapeHTML(dateOnly + (venue?`, ${venue}`:''))}</span>
${timeDisplay ? `<span class="lte-football-time" style="display:block; text-align:center;">${escapeHTML(timeDisplay)}</span>` : ''}
<span id="facr-countdown" class="lte-football-date" style="display:block; text-align:center;"></span>
<br>
<a class="lte-football-date" target="_blank" href="${facrLink}" style="text-align:center; background-color:#c42221; color:#ffffff; opacity:1;">Detail na FACR</a>
<span style="display:block; margin-top:6px;"></span>
<a class="lte-football-date" href="#tabulka" style="text-align:center; background-color:#ffffff43; color:#ffffff; opacity:1; width:49%; display:inline-block;">Tabulka bodů</a>
<a class="lte-football-date" href="/zapasy/vsechny.html" style="text-align:center; background-color:#ffffff43; color:#ffffff; opacity:1; width:49%; display:inline-block;">Všechny zápasy</a>
</div>`;
const prev = document.getElementById('facr-prev');
const next = document.getElementById('facr-next');
if(prev) prev.onclick = ()=>{ state.matchIndex = (idx - 1 + items.length) % items.length; renderUpcoming(); };
if(next) next.onclick = ()=>{ state.matchIndex = (idx + 1) % items.length; renderUpcoming(); };
// setup countdown / status text
const cd = document.getElementById('facr-countdown');
const inlineStatus = document.getElementById('facr-inline-status');
if(cd || inlineStatus){
const now2 = new Date();
const startMs = m.date_time ? parseCZDate(m.date_time).getTime() : 0;
const diff = startMs - now2.getTime();
const twoH = 2*60*60*1000;
const threeD = 3*24*60*60*1000;
let text = '';
if(diff > 0){
text = `Začátek za ${fmtCountdown(diff)}`;
}else if(Math.abs(diff) <= twoH){
text = 'Právě probíhá';
}else if(-diff < threeD){
text = (m.score ? `Výsledek: ${m.score}` : 'Ukončeno');
}else{
text = '';
}
if(cd) cd.textContent = text;
if(inlineStatus) inlineStatus.textContent = text;
}
// Live countdown in the middle area when future and not today
const midEl = document.getElementById('facr-mid');
if(midEl){
const startTime = m.date_time ? parseCZDate(m.date_time).getTime() : 0;
function tick(){
const now = Date.now();
const diff = startTime - now;
if(diff > 0){
const longTxt = `Za ${fmtCountdownLong(diff)}`;
midEl.textContent = longTxt;
const inlineEl = document.getElementById('facr-inline-status');
if(inlineEl) inlineEl.textContent = `Začátek za ${fmtCountdown(diff)}`;
const cdEl = document.getElementById('facr-countdown');
if(cdEl) cdEl.textContent = `Začátek za ${fmtCountdown(diff)}`;
}else{
// switch to score at/after kickoff
const scoreTxt = m.score || '-';
midEl.textContent = scoreTxt;
const inlineEl = document.getElementById('facr-inline-status');
if(inlineEl) inlineEl.textContent = (m.score ? `Výsledek: ${m.score}` : 'Ukončeno');
const cdEl = document.getElementById('facr-countdown');
if(cdEl) cdEl.textContent = (m.score ? `Výsledek: ${m.score}` : 'Ukončeno');
if(state.upcomingTimerId){ clearInterval(state.upcomingTimerId); state.upcomingTimerId = null; }
}
}
// Run live countdown for any future match (including today)
if(startTime > Date.now()){
tick();
state.upcomingTimerId = setInterval(tick, 1000);
} else {
// Ensure inline status reflects finished state on initial render
const inlineEl = document.getElementById('facr-inline-status');
if(inlineEl) inlineEl.textContent = (m.score ? `Výsledek: ${m.score}` : 'Ukončeno');
}
}
}
function renderCompetitionTabs(){
const tabs = document.getElementById('facr-comp-tabs');
if(!tabs || !state.data) return;
ensureFacrStyles();
const comps = state.data.club_table.competitions || [];
tabs.innerHTML = comps.map((c,i)=>
`<button class="facr-tab ${i===state.compIndex?'active':''}" data-idx="${i}">${c.name || c.code || 'Soutěž'}</button>`
).join('');
tabs.querySelectorAll('button').forEach(btn=>{
btn.addEventListener('click', ()=>{
state.compIndex = Number(btn.dataset.idx)||0;
renderCompetitionTabs();
renderTable();
});
});
}
function renderTable(){
const tbody = document.getElementById('facr-table-body');
const badge = document.getElementById('facr-comp-badge');
if(!tbody || !state.data) return;
const comps = state.data.club_table.competitions || [];
if(comps.length === 0){ tbody.innerHTML = ''; return; }
const comp = comps[Math.min(state.compIndex, comps.length-1)];
if(badge){ badge.textContent = comp.name || comp.code || 'Soutěž'; }
const rows = comp.table && comp.table.overall ? comp.table.overall : [];
tbody.innerHTML = rows.map(r=>`
<tr>
<td class="lte-row"><span>${r.rank}</span></td>
<td class="lte-club-logo"><img decoding="async" src="${r.team_logo_url || 'img/logo.png'}"></td>
<td class="lte-name">${r.team}</td>
<td class="lte-rate">${r.played}</td>
<td class="lte-rate">${r.wins}</td>
<td class="lte-rate">${r.draws}</td>
<td class="lte-rate">${r.losses}</td>
<td class="lte-rate">${r.score}</td>
<td class="lte-summary">${r.points}</td>
</tr>
`).join('');
}
function renderAllMatches(){
const container = document.getElementById('facr-all-matches');
if(!container || !state.data) return;
const comps = state.data.club_detail.competitions || [];
const sections = [];
for(const comp of comps){
const matches = (comp.matches || [])
.map(m=>({ m, dt: parseCZDate(m.date_time) }))
.filter(x=>!!x.dt)
.sort((a,b)=> b.dt - a.dt);
if(matches.length === 0) continue;
const compName = truncate(escapeHTML(comp.name || comp.code || 'Soutěž'), 40);
const itemsHtml = matches.map(({m})=>{
const homeLogo = m.home_logo_url || '../img/logo.png';
const awayLogo = m.away_logo_url || '../img/logo.png';
const facrLink = m.report_url || comp.matches_link || state.data.club_detail.url || '#';
const score = m.score || '-';
const GRID_MAX = 22;
const home = truncate(escapeHTML(m.home), GRID_MAX);
const away = truncate(escapeHTML(m.away), GRID_MAX);
const dateVenue = truncate(escapeHTML(m.date_time + (m.venue?`, ${m.venue}`:'')), 36);
const s1 = escapeHTML((score.split(':')[0]||'-'));
const s2 = escapeHTML((score.split(':')[1]||'-'));
return `
<a href="${facrLink}" target="_blank" class="lte-item swiper-slide">
<div class="lte-teams lte-match-time-public">
<span class="lte-team-name lte-team-1 lte-header" title="${escapeHTML(m.home)}">
<span class="lte-team-logo"><img src="${homeLogo}" alt="${escapeHTML(m.home)}"></span>${home}</span>
<span class="lte-score-mob lte-score-1">${s1}</span>
<span class="lte-team-count">
<span class="lte-c lte-score-1">${s1}</span>
<span class="lte-d">:</span>
<span class="lte-c lte-score-4">${s2}</span>
</span>
<span class="lte-team-name lte-team-2 lte-header" title="${escapeHTML(m.away)}">${away}
<span class="lte-team-logo"><img src="${awayLogo}" alt="${escapeHTML(m.away)}"></span>
</span>
<span class="lte-score-mob lte-score-4">${s2}</span>
</div>
<div class="lte-footer">
<span class="lte-football-date" title="${escapeHTML(m.date_time + (m.venue?`, ${m.venue}`:''))}">${dateVenue}</span>
</div>
</a>`;
}).join('');
sections.push(`
<div class="lte-section">
<h3 class="lte-header" style="margin: 20px 0 10px;">${compName}</h3>
<div class="lte-football-matches inner-page">${itemsHtml}</div>
</div>
`);
}
container.innerHTML = sections.join('');
}
function schedule(){
if(state.intervalId) clearInterval(state.intervalId);
const intervalMs = isWithinMatchWindow() ? 2*60*1000 : 30*60*1000;
state.intervalId = setInterval(async ()=>{
try{
await fetchData();
renderUpcoming();
renderCompetitionTabs();
renderTable();
renderAllMatches();
schedule(); // reevaluate interval if window changed
}catch(e){ console.warn('refresh failed', e); }
}, intervalMs);
}
async function init(){
try{
await fetchData();
renderUpcoming();
renderCompetitionTabs();
renderTable();
renderAllMatches();
schedule();
}catch(e){
console.error('FACR init failed', e);
}
}
document.addEventListener('DOMContentLoaded', init);
})();
File diff suppressed because one or more lines are too long
+552
View File
@@ -0,0 +1,552 @@
/* LT-Ext Plugin Frontend functions */
"use strict";
var lteMinicartDelay;
jQuery( function() {
initSwiperWrappers();
initMiniCart();
setTimeout(function() {
jQuery('.elementor-accordion .elementor-tab-title').removeClass('elementor-active');
jQuery('.elementor-accordion .elementor-tab-content').css('display', 'none');
}, 200);
});
jQuery(window).on('elementor/frontend/init', function () {
elementorFrontend.hooks.addAction('frontend/element_ready/lte-product-categories.default', initSwiperWrappers);
elementorFrontend.hooks.addAction('frontend/element_ready/lte-products.default', initSwiperWrappers);
elementorFrontend.hooks.addAction('frontend/element_ready/lte-testimonials.default', initSwiperWrappers);
elementorFrontend.hooks.addAction('frontend/element_ready/lte-zoomslider.default', initSwiperWrappers);
elementorFrontend.hooks.addAction('frontend/element_ready/lte-gallery.default', initSwiperWrappers);
elementorFrontend.hooks.addAction('frontend/element_ready/lte-team.default', initSwiperWrappers);
elementorFrontend.hooks.addAction('frontend/element_ready/lte-services.default', initServices);
elementorFrontend.hooks.addAction('frontend/element_ready/lte-rental-search.default', initCf7Styles);
elementorFrontend.hooks.addAction('frontend/element_ready/lte-cf7.default', initCf7Styles);
elementorFrontend.hooks.addAction('frontend/element_ready/accordion', function() { });
elementorFrontend.hooks.addAction('frontend/element_ready/container', function( a, b ) {
jQuery(this).prepend('<div class="lte-background-overlay-editor">');
jQuery(a).prepend('<div class="lte-background-overlay-editor">');
});
jQuery('.elementor-tab-title.elementor-active').removeClass('elementor-active');
});
function initServices() {
jQuery('.lte-services-sc.lte-layout-tabs .lte-tab').on('click', function(i, el) {
var lte_id = jQuery(this).data('lte-id'),
el = jQuery(this);
el.parent().find('.active').removeClass('active');
el.addClass('active');
el.parent().next().find('.lte-item.active').removeClass('active').fadeOut(200, function() {
setTimeout(function() {
el.parent().next().find('.lte-item-' + lte_id).addClass('active').fadeIn(400, function() {
//tabs.removeClass('animated');
});
}, 150);
});
});
}
function initSwiperWrappers() {
initSwiperSliders();
initFilterContainer();
}
/* Swiper Slider Containers and Script Initialization */
function initSwiperSliders() {
var lteSliders = jQuery('.lte-swiper-slider:not(".lte-inited")');
jQuery(lteSliders).each(function(i, el) {
var container = jQuery(el),
id = 'lte-id-' + Math.floor(Math.random() * Math.floor(10000)),
autoplay = false,
autoplay_interact = false,
navigation = false,
pagination = false,
slidesPerView = false,
centeredSlides = false,
simulateTouch = true,
touchRatio = container.data('touch-move'),
allowTouchMove = true,
spg = 1,
slidesPerGroup = 1,
spaceBetween = container.data('space-between'),
loop = container.data('loop'),
effect = container.data('effect'),
speed = container.data('speed'),
breakpoints_per = container.data('breakpoints').split(';'),
breakpoints_viewports = [1599, 1199, 991, 768, 480, 0],
breakpoints = {};
if ( jQuery(el).hasClass('lte-layout-tickets') ) {
breakpoints_viewports = [2000, 1799, 1199, 991, 768, 0];
}
if ( container.data('autoplay') && container.data('autoplay') > 0 ) {
if ( container.data('autoplay-interaction') === 1 ) {
autoplay_interact = true;
}
else {
autoplay_interact = false;
}
autoplay = {
delay: container.data('autoplay'),
disableOnInteraction: autoplay_interact,
}
}
if ( container.data('center-slide') ) {
centeredSlides = true;
}
if ( container.data('arrows') && container.data('arrows') != 'disabled' ) {
var arrows_html = '<div class="'+ id + '-arrows lte-arrows lte-arrows-' + container.data('arrows') + '"><a href="#" class="lte-arrow-left"></a><a href="#" class="lte-arrow-right"></a></div>';
if ( container.data('arrows') == 'right-top' ||container.data('arrows') == 'right' || container.data('arrows') == 'sides-outside' || container.data('arrows') == 'sides-small' ) {
jQuery(container).after(arrows_html);
}
else
if ( container.data('arrows') != 'custom' ) {
jQuery(container).append(arrows_html);
}
navigation = {
nextEl: '.' + id + '-arrows .lte-arrow-right',
prevEl: '.' + id + '-arrows .lte-arrow-left',
}
}
if ( !loop ) loop = false;
jQuery(breakpoints_per).each(function(i, el) {
if ( !slidesPerView && el ) {
slidesPerView = 1;
if ( container.data('slides-per-group') ) slidesPerGroup = el;
slidesPerGroup = 1;
}
if ( el ) {
if ( container.data('slides-per-group') ) spg = el; else spg = 1;
spg = 1;
if ( container.data('slides-per-group') == -1 ) spg = -1;
breakpoints[breakpoints_viewports[i]] = { slidesPerView : el, slidesPerGroup : el };
if ( spg == -1 ) delete breakpoints[breakpoints_viewports[i]]['slidesPerGroup'];
}
});
if ( container.data('pagination') && container.data('pagination') == 'bullets' ) {
pagination = {
el: '.swiper-pagination',
type: 'bullets',
clickable: true
};
jQuery(container).append('<div class="swiper-pagination"></div>');
}
else
if ( container.data('pagination') && container.data('pagination') == 'fraction' ) {
pagination = {
el: '.swiper-pagination',
type: 'fraction',
};
jQuery(container).append('<div class="swiper-pagination"></div>');
}
else
if ( container.data('pagination') && container.data('pagination') == 'custom' ) {
pagination = {
el: '.swiper-pagination-custom',
clickable: true,
renderBullet: function (index, className) {
var pages = (container.data('pagination-custom'));
return '<span class="' + className + ' ' + pages[index]['cats'] +'"><span class="lte-img"><img src="' + pages[index]['image'] + '" alt="' + pages[index]['header'] + '"></span><span class="lte-title">' + pages[index]['header'] + '</span></span>';
},
};
}
if ( container.data('simulate-touch') ) {
simulateTouch = false;
allowTouchMove = false;
}
if ( !slidesPerView ) slidesPerView = 1;
var conf = {
initialSlide : 0,
spaceBetween : spaceBetween,
centeredSlides : centeredSlides,
slidesPerView : slidesPerView,
slidesPerGroup : slidesPerGroup,
breakpoints : breakpoints,
loop : loop,
speed : speed,
navigation : navigation,
autoplay : autoplay,
pagination : pagination,
touchRatio : touchRatio,
simulateTouch : simulateTouch,
allowTouchMove : allowTouchMove,
/*
slideChangeTransitionStart: function(s) {
var currentSlide = $(s.slides[s.activeIndex]);
var elems = currentSlide.find(".animated")
elems.each(function() {
var $this = $(this);
var animationType = $this.data('animation');
$this.addClass(animationType, 100).on(animEndEv, function() {
$this.removeClass(animationType);
});
});
},
slideChangeTransitionEnd: function(s) {
var currentSlide = $(s.slides[s.activeIndex]);
}
*/
on: {
init: function () {
var activeIndex = this.activeIndex;
var realIndex = this.slides.eq(activeIndex).attr('data-swiper-slide-index');
jQuery('.swiper-slide').removeClass('swiper-slide-nth-prev-2 swiper-slide-nth-next-2');
jQuery('.swiper-slide[data-swiper-slide-index="'+realIndex+'"]').prev().prev().addClass('swiper-slide-nth-prev-2');
jQuery('.swiper-slide[data-swiper-slide-index="'+realIndex+'"]').next().next().addClass('swiper-slide-nth-next-2');
},
slideChange: function () {
var activeIndex = this.activeIndex;
var realIndex = this.slides.eq(activeIndex).attr('data-swiper-slide-index');
jQuery('.swiper-slide').removeClass('swiper-slide-nth-prev-2 swiper-slide-nth-next-2');
jQuery('.swiper-slide[data-swiper-slide-index="'+realIndex+'"]').prev().prev().addClass('swiper-slide-nth-prev-2');
jQuery('.swiper-slide[data-swiper-slide-index="'+realIndex+'"]').next().next().addClass('swiper-slide-nth-next-2');
if ( jQuery(this.el).hasClass('lte-team-list') ) {
jQuery(this.el).parent().parent().children('.lte-team-descr').html(jQuery(this.slides[this.activeIndex].innerHTML).find('.lte-descr'));
}
},
}
};
if ( slidesPerGroup == 1) delete conf['slidesPerGroup'];
if ( effect == 'fade') {
conf["effect"] = 'fade';
conf["fadeEffect"] = { crossFade: true };
}
else
if ( effect == 'coverflow') {
var ww = jQuery(window).width();
conf['centeredSlides'] = true;
conf["loop"] = true;
conf["effect"] = 'coverflow';
if ( ww > 1199 ) {
conf["coverflowEffect"] = {
rotate : 0,
stretch : -100,
scale: 1,
depth: 0,
modifier: 10,
slideShadows: false,
};
}
else {
conf["coverflowEffect"] = {
rotate : 0,
stretch :0,
depth: 0,
modifier: 0,
slideShadows: false,
};
}
}
else
if ( effect == 'flip') {
conf["effect"] = 'flip';
conf["flipEffect"] = { slideShadows: false };
}
else
if ( effect == 'cube') {
conf["effect"] = 'cube';
conf["cubeEffect"] = { slideShadows: false };
}
var swiper = new Swiper(container, conf);
if ( container.data('autoplay') > 0 && container.data('autoplay-interaction') === 1 ) {
swiper.el.addEventListener("mouseenter", function( event ) { swiper.autoplay.stop(); }, false);
swiper.el.addEventListener("mouseout", function( event ) { swiper.autoplay.start(); }, false);
}
container.addClass('lte-inited');
swiper.update();
});
}
/* Tabs Filterered Container */
function initFilterContainer() {
var container = jQuery('.lte-filter-container:not(".lte-inited")');
jQuery(container).each(function(i, el) {
var wrapper = jQuery(el),
tabs = wrapper.find('.lte-tabs-cats'),
images = wrapper.find('.lte-images');
if (tabs.length) {
tabs.on('click', '.lte-tab', function() {
if ( !wrapper.hasClass('hasHeight') ) {
wrapper.css('height', container.height());
wrapper.addClass('hasHeight');
}
if ( !tabs.hasClass('animated') ) {
var el = jQuery(this),
filter = el.data('filter');
el.parent().parent().find('.active').removeClass('active');
el.addClass('active');
console.log(images);
if ( images.length ) {
images.find('.lte-image').removeClass('active');
wrapper.find('.lte-image-' + filter).addClass('active');
/*
.fadeOut(150, function() {
wrapper.find('.lte-image-' + filter).addClass('active').fadeIn(150, function() {
});
});
*/
}
if (filter === 0) {
wrapper.find('.lte-filter-item').show();
}
else
if (filter !== '') {
wrapper.find('.lte-filter-item').removeClass('show-item').fadeOut(200, function() {
tabs.addClass('animated');
setTimeout(function() {
wrapper.find('.lte-filter-item.lte-filter-id-' + filter).addClass('show-item').fadeIn(200, function() {
tabs.removeClass('animated');
});
var mySwiper = document.querySelector('.lte-filter-item.lte-filter-id-' + filter + ' .swiper-container');
if ( document.querySelector('.lte-filter-item.lte-filter-id-' + filter + ' .swiper-container') !== null ) {
mySwiper = mySwiper.swiper;
mySwiper.update();
}
}, 200);
});;
}
return false;
}
return false;
});
// First Init, Activating first tab
var firstBtn = tabs.find('.lte-tab:first');
firstBtn.addClass('active');
if ( firstBtn.data('filter') != 0 ) {
wrapper.find('.lte-filter-item').hide();
wrapper.find('.lte-filter-item.lte-filter-id-' + firstBtn.data('filter') + '').addClass('show-item').show();
wrapper.closest('.elementor-element').css('min-height', container.height());
}
jQuery(el).addClass('lte-inited');
jQuery(window).resize();
}
});
}
function initFCSwiper() {
var container = jQuery('.elementor-widget-lte-slider-full'),
menu = container.find('.lte-slider-fc-menu'),
items = container.find('.lte-item');
var current = menu.find('span').first().addClass('active').data('id');
container.find('.lte-wrapper-item').fadeOut();
container.find('.lte-wrapper-item-' + current).fadeIn();
menu.on('click', 'span', function() {
menu.find('span').removeClass('active');
current = jQuery(this).addClass('active').data('id');
container.find('.lte-wrapper-item').fadeOut();
container.find('.lte-wrapper-item-' + current).delay(300).fadeIn("slow");
});
if ( document.querySelector('.swiper-container') !== null ) {
var swiper = document.querySelector('.swiper-container').swiper;
swiper.update();
}
}
function initCf7Styles() {
jQuery('form.wpcf7-form select').parent(":not(.select-wrap)").find('select').wrap('<div class="select-wrap"></div>');
}
/* Navbar MiniCart Init */
function initMiniCart() {
var events = [
'.add_to_cart_button',
".single_add_to_cart_button",
".remove_from_cart_button",
".product-remove a"
];
jQuery(document.body).on('click change', events.join(','), function() {
updateMiniCartRequest();
});
jQuery(document.body).on('updated_cart_totals', function() {
updateMiniCartRequest();
});
jQuery(document.body).on('click', '.lte-minicart .lte-remove', function( e ) {
var el = jQuery(this);
e.preventDefault();
jQuery(this).closest('.lte-item').fadeOut();
jQuery.ajax({
type : 'POST',
url: wc_add_to_cart_params.wc_ajax_url.toString().replace( '%%endpoint%%', 'remove_from_cart' ),
data: {
cart_item_key : el.data( 'cart_item_key' )
},
success : function( response ) {
updateMiniCartRequest();
}
});
});
}
function updateMiniCartRequest() {
clearTimeout( lteMinicartDelay );
lteMinicartDelay = setTimeout( updateMiniCart, 1500);
}
function updateMiniCart() {
var data = {
_ajax_nonce: lte_mini_cart.nonce,
action : "lte_wc_cart_update",
};
jQuery.ajax({
type : 'POST',
url : lte_mini_cart.ajax_url,
data : data,
success : function( response ) {
jQuery('.lte-minicart').html( response );
}
});
}
+2
View File
File diff suppressed because one or more lines are too long
+67
View File
@@ -0,0 +1,67 @@
'use strict';
(function(){
async function updateHeroFromLatest() {
try {
const res = await fetch('/api/blog/latest?limit=8', {credentials:'omit'});
if (!res.ok) throw new Error('HTTP '+res.status);
let items = await res.json();
if (!Array.isArray(items) || items.length === 0) items = [];
// Update background images of zoom slider slides if present
const slides = document.querySelectorAll('.lte-slider-zoom .zs-slides .zs-slide');
// If slides are not yet initialized by the plugin, try again shortly
if (!slides || slides.length === 0) {
setTimeout(updateHeroFromLatest, 600);
return;
}
// Track which IDs are used in the carousel
const usedIds = [];
// Slide 0 is always the intro post 0000
const slide0 = slides[0];
if (slide0) {
usedIds.push('0000');
slide0.style.backgroundImage = `url('img/blog/0000.png')`;
const content0 = document.querySelector(`.lte-zs-slider-inner.lte-zs-slide-0`);
if (content0) {
const btn0 = content0.querySelector('a.lte-btn');
if (btn0) btn0.setAttribute('href', 'blog/0000.html');
// Do not alter existing H2 text; designers may have custom text
}
}
// Fill remaining slides with latest posts, skipping 0000
const rest = items.filter(it => it && it.id !== '0000');
const max = Math.min(rest.length, Math.max(0, slides.length - 1));
for (let i = 0; i < max; i++) {
const it = rest[i];
if (it && it.id) usedIds.push(it.id);
const slide = slides[i+1];
if (!slide) continue;
slide.style.backgroundImage = `url('${it.image}')`;
const content = document.querySelector(`.lte-zs-slider-inner.lte-zs-slide-${i+1}`);
if (content) {
const header = content.querySelector('h2.lte-header');
if (header) header.textContent = it.title || '';
const btn = content.querySelector('a.lte-btn');
if (btn) btn.setAttribute('href', it.link);
}
}
// Expose used IDs so other widgets can exclude them (e.g., 4-post grid)
window.CAROUSEL_BLOG_IDS = usedIds;
} catch (e) {
console.error('home-autofill hero update error', e);
}
}
function onReady(fn){
if (document.readyState === 'loading') document.addEventListener('DOMContentLoaded', fn); else fn();
}
onReady(() => {
// Delay a bit to allow zoomslider to initialize, then update
setTimeout(updateHeroFromLatest, 500);
});
})();
+13
View File
@@ -0,0 +1,13 @@
/*! This file is auto-generated */
/*!
* imagesLoaded PACKAGED v5.0.0
* JavaScript is all like "You images are done yet or what?"
* MIT License
*/
!function(t,e){"object"==typeof module&&module.exports?module.exports=e():t.EvEmitter=e()}("undefined"!=typeof window?window:this,(function(){function t(){}let e=t.prototype;return e.on=function(t,e){if(!t||!e)return this;let i=this._events=this._events||{},s=i[t]=i[t]||[];return s.includes(e)||s.push(e),this},e.once=function(t,e){if(!t||!e)return this;this.on(t,e);let i=this._onceEvents=this._onceEvents||{};return(i[t]=i[t]||{})[e]=!0,this},e.off=function(t,e){let i=this._events&&this._events[t];if(!i||!i.length)return this;let s=i.indexOf(e);return-1!=s&&i.splice(s,1),this},e.emitEvent=function(t,e){let i=this._events&&this._events[t];if(!i||!i.length)return this;i=i.slice(0),e=e||[];let s=this._onceEvents&&this._onceEvents[t];for(let n of i){s&&s[n]&&(this.off(t,n),delete s[n]),n.apply(this,e)}return this},e.allOff=function(){return delete this._events,delete this._onceEvents,this},t})),
/*!
* imagesLoaded v5.0.0
* JavaScript is all like "You images are done yet or what?"
* MIT License
*/
function(t,e){"object"==typeof module&&module.exports?module.exports=e(t,require("ev-emitter")):t.imagesLoaded=e(t,t.EvEmitter)}("undefined"!=typeof window?window:this,(function(t,e){let i=t.jQuery,s=t.console;function n(t,e,o){if(!(this instanceof n))return new n(t,e,o);let r=t;var h;("string"==typeof t&&(r=document.querySelectorAll(t)),r)?(this.elements=(h=r,Array.isArray(h)?h:"object"==typeof h&&"number"==typeof h.length?[...h]:[h]),this.options={},"function"==typeof e?o=e:Object.assign(this.options,e),o&&this.on("always",o),this.getImages(),i&&(this.jqDeferred=new i.Deferred),setTimeout(this.check.bind(this))):s.error(`Bad element for imagesLoaded ${r||t}`)}n.prototype=Object.create(e.prototype),n.prototype.getImages=function(){this.images=[],this.elements.forEach(this.addElementImages,this)};const o=[1,9,11];n.prototype.addElementImages=function(t){"IMG"===t.nodeName&&this.addImage(t),!0===this.options.background&&this.addElementBackgroundImages(t);let{nodeType:e}=t;if(!e||!o.includes(e))return;let i=t.querySelectorAll("img");for(let t of i)this.addImage(t);if("string"==typeof this.options.background){let e=t.querySelectorAll(this.options.background);for(let t of e)this.addElementBackgroundImages(t)}};const r=/url\((['"])?(.*?)\1\)/gi;function h(t){this.img=t}function d(t,e){this.url=t,this.element=e,this.img=new Image}return n.prototype.addElementBackgroundImages=function(t){let e=getComputedStyle(t);if(!e)return;let i=r.exec(e.backgroundImage);for(;null!==i;){let s=i&&i[2];s&&this.addBackground(s,t),i=r.exec(e.backgroundImage)}},n.prototype.addImage=function(t){let e=new h(t);this.images.push(e)},n.prototype.addBackground=function(t,e){let i=new d(t,e);this.images.push(i)},n.prototype.check=function(){if(this.progressedCount=0,this.hasAnyBroken=!1,!this.images.length)return void this.complete();let t=(t,e,i)=>{setTimeout((()=>{this.progress(t,e,i)}))};this.images.forEach((function(e){e.once("progress",t),e.check()}))},n.prototype.progress=function(t,e,i){this.progressedCount++,this.hasAnyBroken=this.hasAnyBroken||!t.isLoaded,this.emitEvent("progress",[this,t,e]),this.jqDeferred&&this.jqDeferred.notify&&this.jqDeferred.notify(this,t),this.progressedCount===this.images.length&&this.complete(),this.options.debug&&s&&s.log(`progress: ${i}`,t,e)},n.prototype.complete=function(){let t=this.hasAnyBroken?"fail":"done";if(this.isComplete=!0,this.emitEvent(t,[this]),this.emitEvent("always",[this]),this.jqDeferred){let t=this.hasAnyBroken?"reject":"resolve";this.jqDeferred[t](this)}},h.prototype=Object.create(e.prototype),h.prototype.check=function(){this.getIsImageComplete()?this.confirm(0!==this.img.naturalWidth,"naturalWidth"):(this.proxyImage=new Image,this.img.crossOrigin&&(this.proxyImage.crossOrigin=this.img.crossOrigin),this.proxyImage.addEventListener("load",this),this.proxyImage.addEventListener("error",this),this.img.addEventListener("load",this),this.img.addEventListener("error",this),this.proxyImage.src=this.img.currentSrc||this.img.src)},h.prototype.getIsImageComplete=function(){return this.img.complete&&this.img.naturalWidth},h.prototype.confirm=function(t,e){this.isLoaded=t;let{parentNode:i}=this.img,s="PICTURE"===i.nodeName?i:this.img;this.emitEvent("progress",[this,s,e])},h.prototype.handleEvent=function(t){let e="on"+t.type;this[e]&&this[e](t)},h.prototype.onload=function(){this.confirm(!0,"onload"),this.unbindEvents()},h.prototype.onerror=function(){this.confirm(!1,"onerror"),this.unbindEvents()},h.prototype.unbindEvents=function(){this.proxyImage.removeEventListener("load",this),this.proxyImage.removeEventListener("error",this),this.img.removeEventListener("load",this),this.img.removeEventListener("error",this)},d.prototype=Object.create(h.prototype),d.prototype.check=function(){this.img.addEventListener("load",this),this.img.addEventListener("error",this),this.img.src=this.url,this.getIsImageComplete()&&(this.confirm(0!==this.img.naturalWidth,"naturalWidth"),this.unbindEvents())},d.prototype.unbindEvents=function(){this.img.removeEventListener("load",this),this.img.removeEventListener("error",this)},d.prototype.confirm=function(t,e){this.isLoaded=t,this.emitEvent("progress",[this,this.element,e])},n.makeJQueryPlugin=function(e){(e=e||t.jQuery)&&(i=e,i.fn.imagesLoaded=function(t,e){return new n(this,t,e).jqDeferred.promise(i(this))})},n.makeJQueryPlugin(),n}));
+1
View File
File diff suppressed because one or more lines are too long
+2
View File
File diff suppressed because one or more lines are too long
+14
View File
File diff suppressed because one or more lines are too long
+11
View File
@@ -0,0 +1,11 @@
/*!
* Masonry v2 shim
* to maintain backwards compatibility
* as of Masonry v3.1.2
*
* Cascading grid layout library
* http://masonry.desandro.com
* MIT License
* by David DeSandro
*/
!function(a){"use strict";var b=a.Masonry;b.prototype._remapV2Options=function(){this._remapOption("gutterWidth","gutter"),this._remapOption("isResizable","isResizeBound"),this._remapOption("isRTL","isOriginLeft",function(a){return!a});var a=this.options.isAnimated;if(void 0!==a&&(this.options.transitionDuration=a?this.options.transitionDuration:0),void 0===a||a){var b=this.options.animationOptions,c=b&&b.duration;c&&(this.options.transitionDuration="string"==typeof c?c:c+"ms")}},b.prototype._remapOption=function(a,b,c){var d=this.options[a];void 0!==d&&(this.options[b]=c?c(d):d)};var c=b.prototype._create;b.prototype._create=function(){var a=this;this._remapV2Options(),c.apply(this,arguments),setTimeout(function(){jQuery(a.element).addClass("masonry")},0)};var d=b.prototype.layout;b.prototype.layout=function(){this._remapV2Options(),d.apply(this,arguments)};var e=b.prototype.option;b.prototype.option=function(){e.apply(this,arguments),this._remapV2Options()};var f=b.prototype._itemize;b.prototype._itemize=function(a){var b=f.apply(this,arguments);return jQuery(a).addClass("masonry-brick"),b};var g=b.prototype.measureColumns;b.prototype.measureColumns=function(){var a=this.options.columnWidth;a&&"function"==typeof a&&(this.getContainerWidth(),this.columnWidth=a(this.containerWidth)),g.apply(this,arguments)},b.prototype.reload=function(){this.reloadItems.apply(this,arguments),this.layout.apply(this)};var h=b.prototype.destroy;b.prototype.destroy=function(){var a=this.getItemElements();jQuery(this.element).removeClass("masonry"),jQuery(a).removeClass("masonry-brick"),h.apply(this,arguments)}}(window);
+6
View File
@@ -0,0 +1,6 @@
/**
* jquery-match-height master by @liabru
* http://brm.io/jquery-match-height/
* License: MIT
*/
!function(t){"use strict";"function"==typeof define&&define.amd?define(["jquery"],t):"undefined"!=typeof module&&module.exports?module.exports=t(require("jquery")):t(jQuery)}(function(t){var e=-1,o=-1,a=function(t){return parseFloat(t)||0},i=function(e){var o=1,i=t(e),n=null,r=[];return i.each(function(){var e=t(this),i=e.offset().top-a(e.css("margin-top")),s=r.length>0?r[r.length-1]:null;null===s?r.push(e):Math.floor(Math.abs(n-i))<=o?r[r.length-1]=s.add(e):r.push(e),n=i}),r},n=function(e){var o={byRow:!0,property:"height",target:null,remove:!1};return"object"==typeof e?t.extend(o,e):("boolean"==typeof e?o.byRow=e:"remove"===e&&(o.remove=!0),o)},r=t.fn.matchHeight=function(e){var o=n(e);if(o.remove){var a=this;return this.css(o.property,""),t.each(r._groups,function(t,e){e.elements=e.elements.not(a)}),this}return this.length<=1&&!o.target?this:(r._groups.push({elements:this,options:o}),r._apply(this,o),this)};r.version="master",r._groups=[],r._throttle=80,r._maintainScroll=!1,r._beforeUpdate=null,r._afterUpdate=null,r._rows=i,r._parse=a,r._parseOptions=n,r._apply=function(e,o){var s=n(o),h=t(e),l=[h],c=t(window).scrollTop(),p=t("html").outerHeight(!0),d=h.parents().filter(":hidden");return d.each(function(){var e=t(this);e.data("style-cache",e.attr("style"))}),d.css("display","block"),s.byRow&&!s.target&&(h.each(function(){var e=t(this),o=e.css("display");"inline-block"!==o&&"flex"!==o&&"inline-flex"!==o&&(o="block"),e.data("style-cache",e.attr("style")),e.css({display:o,"padding-top":"0","padding-bottom":"0","margin-top":"0","margin-bottom":"0","border-top-width":"0","border-bottom-width":"0",height:"100px",overflow:"hidden"})}),l=i(h),h.each(function(){var e=t(this);e.attr("style",e.data("style-cache")||"")})),t.each(l,function(e,o){var i=t(o),n=0;if(s.target)n=s.target.outerHeight(!1);else{if(s.byRow&&i.length<=1)return void i.css(s.property,"");i.each(function(){var e=t(this),o=e.attr("style"),a=e.css("display");"inline-block"!==a&&"flex"!==a&&"inline-flex"!==a&&(a="block");var i={display:a};i[s.property]="",e.css(i),e.outerHeight(!1)>n&&(n=e.outerHeight(!1)),o?e.attr("style",o):e.css("display","")})}i.each(function(){var e=t(this),o=0;s.target&&e.is(s.target)||("border-box"!==e.css("box-sizing")&&(o+=a(e.css("border-top-width"))+a(e.css("border-bottom-width")),o+=a(e.css("padding-top"))+a(e.css("padding-bottom"))),e.css(s.property,n-o+"px"))})}),d.each(function(){var e=t(this);e.attr("style",e.data("style-cache")||null)}),r._maintainScroll&&t(window).scrollTop(c/p*t("html").outerHeight(!0)),this},r._applyDataApi=function(){var e={};t("[data-match-height], [data-mh]").each(function(){var o=t(this),a=o.attr("data-mh")||o.attr("data-match-height");a in e?e[a]=e[a].add(o):e[a]=o}),t.each(e,function(){this.matchHeight(!0)})};var s=function(e){r._beforeUpdate&&r._beforeUpdate(e,r._groups),t.each(r._groups,function(){r._apply(this.elements,this.options)}),r._afterUpdate&&r._afterUpdate(e,r._groups)};r._update=function(a,i){if(i&&"resize"===i.type){var n=t(window).width();if(n===e)return;e=n}a?o===-1&&(o=setTimeout(function(){s(i),o=-1},r._throttle)):s(i)},t(r._applyDataApi),t(window).bind("load",function(t){r._update(!1,t)}),t(window).bind("resize orientationchange",function(t){r._update(!0,t)})});
+3
View File
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
+238
View File
@@ -0,0 +1,238 @@
/**
* jQuery plugin paroller.js v1.4.7
* https://github.com/tgomilar/paroller.js
* preview: https://tgomilar.github.io/paroller/
* author: Tanja Gomilar
**/
(function (factory) {
'use strict';
if (typeof define === 'function' && define.amd) {
define('parollerjs', ['jquery'], factory);
} else if (typeof module === 'object' && typeof module.exports === 'object') {
module.exports = factory(require('jquery'));
}
else {
factory(jQuery);
}
})(function ($) {
'use strict';
var working = false;
var scrollAction = function() {
working = false;
};
var setDirection = {
bgVertical: function (elem, bgOffset) {
return elem.css({'background-position': 'center ' + -bgOffset + 'px'});
},
bgHorizontal: function (elem, bgOffset) {
return elem.css({'background-position': -bgOffset + 'px' + ' center'});
},
vertical: function (elem, elemOffset, transition, oldTransform) {
(oldTransform === 'none' ? oldTransform = '' : true);
return elem.css({
'-webkit-transform': 'translateY(' + elemOffset + 'px)' + oldTransform,
'-moz-transform': 'translateY(' + elemOffset + 'px)' + oldTransform,
'transform': 'translateY(' + elemOffset + 'px)' + oldTransform,
'transition': transition,
'will-change': 'transform'
});
},
horizontal: function (elem, elemOffset, transition, oldTransform) {
(oldTransform === 'none' ? oldTransform = '' : true);
return elem.css({
'-webkit-transform': 'translateX(' + elemOffset + 'px)' + oldTransform,
'-moz-transform': 'translateX(' + elemOffset + 'px)' + oldTransform,
'transform': 'translateX(' + elemOffset + 'px)' + oldTransform,
'transition': transition,
'will-change': 'transform'
});
}
};
var setMovement = {
factor: function (elem, width, options) {
var dataFactor = elem.data('paroller-factor');
var factor = (dataFactor) ? dataFactor : options.factor;
if (width < 576) {
var dataFactorXs = elem.data('paroller-factor-xs');
var factorXs = (dataFactorXs) ? dataFactorXs : options.factorXs;
return (factorXs) ? factorXs : factor;
}
else if (width <= 768) {
var dataFactorSm = elem.data('paroller-factor-sm');
var factorSm = (dataFactorSm) ? dataFactorSm : options.factorSm;
return (factorSm) ? factorSm : factor;
}
else if (width <= 1024) {
var dataFactorMd = elem.data('paroller-factor-md');
var factorMd = (dataFactorMd) ? dataFactorMd : options.factorMd;
return (factorMd) ? factorMd : factor;
}
else if (width <= 1200) {
var dataFactorLg = elem.data('paroller-factor-lg');
var factorLg = (dataFactorLg) ? dataFactorLg : options.factorLg;
return (factorLg) ? factorLg : factor;
} else if (width <= 1920) {
var dataFactorXl = elem.data('paroller-factor-xl');
var factorXl = (dataFactorXl) ? dataFactorXl : options.factorXl;
return (factorXl) ? factorXl : factor;
} else {
return factor;
}
},
bgOffset: function (offset, factor) {
return Math.round(offset * factor);
},
transform: function (offset, factor, windowHeight, height) {
return Math.round((offset - (windowHeight / 2) + height) * factor);
}
};
var clearPositions = {
background: function (elem) {
return elem.css({'background-position': 'unset'});
},
foreground: function (elem) {
return elem.css({
'transform' : 'unset',
'transition' : 'unset'
});
}
};
$.fn.paroller = function (options) {
var windowHeight = $(window).height();
var documentHeight = $(document).height();
// default options
var options = $.extend({
factor: 0, // - to +
factorXs: 0, // - to +
factorSm: 0, // - to +
factorMd: 0, // - to +
factorLg: 0, // - to +
factorXl: 0, // - to +
transition: 'translate 0.1s ease', // CSS transition
type: 'background', // foreground
direction: 'vertical', // horizontal
offsetVal : 0, // horizontal
}, options);
return this.each(function () {
var $this = $(this);
var width = $(window).width();
var offset = $this.offset().top;
var height = $this.outerHeight();
var dataType = $this.data('paroller-type');
var dataDirection = $this.data('paroller-direction');
var dataTransition = $this.data('paroller-transition');
var oldTransform = $this.css('transform');
var offsetVal = parseInt($this.data('offset'));
var transition = (dataTransition) ? dataTransition : options.transition;
var type = (dataType) ? dataType : options.type;
var direction = (dataDirection) ? dataDirection : options.direction;
var factor = 0;
var bgOffset = setMovement.bgOffset(offset, factor);
var transform = setMovement.transform(offset, factor, windowHeight, height);
if (type === 'background') {
if (direction === 'vertical') {
setDirection.bgVertical($this, bgOffset);
}
else if (direction === 'horizontal') {
setDirection.bgHorizontal($this, bgOffset);
}
}
else if (type === 'foreground') {
if (direction === 'vertical') {
setDirection.vertical($this, transform, transition, oldTransform);
}
else if (direction === 'horizontal') {
setDirection.horizontal($this, transform, transition, oldTransform);
}
}
$(window).on('resize', function () {
var scrolling = $(this).scrollTop();
width = $(window).width();
offset = $this.offset().top;
height = $this.outerHeight();
factor = setMovement.factor($this, width, options);
bgOffset = Math.round(offset * factor);
transform = Math.round((offset - (windowHeight / 2) + height) * factor);
/*if ( offsetVal != 0 )*/
offset = offset - 400;
if (! working) {
window.requestAnimationFrame(scrollAction);
working = true;
}
if (type === 'background') {
clearPositions.background($this);
if (direction === 'vertical') {
setDirection.bgVertical($this, bgOffset);
}
else if (direction === 'horizontal') {
setDirection.bgHorizontal($this, bgOffset);
}
}
else if ((type === 'foreground') && (scrolling <= documentHeight)) {
clearPositions.foreground($this);
if (direction === 'vertical') {
setDirection.vertical($this, transform, transition);
}
else if (direction === 'horizontal') {
setDirection.horizontal($this, transform, transition);
}
}
});
$(window).on('scroll', function () {
var scrolling = $(this).scrollTop();
var scrollTop = $(document).scrollTop();
if (scrollTop === 0) {
factor = 0;
} else {
factor = setMovement.factor($this, width, options);
}
bgOffset = Math.round((offset - scrolling) * factor);
transform = Math.round(((offset - (windowHeight / 2) + height) - scrolling) * factor);
if (! working) {
window.requestAnimationFrame(scrollAction);
working = true;
}
if (type === 'background') {
if (direction === 'vertical') {
setDirection.bgVertical($this, bgOffset);
}
else if (direction === 'horizontal') {
setDirection.bgHorizontal($this, bgOffset);
}
}
else if ((type === 'foreground') && (scrolling <= documentHeight)) {
if (direction === 'vertical') {
setDirection.vertical($this, transform, transition, oldTransform);
}
else if (direction === 'horizontal') {
setDirection.horizontal($this, transform, transition, oldTransform);
}
}
});
});
};
});
+75
View File
@@ -0,0 +1,75 @@
!(function (r) {
"use strict";
"object" == typeof module && "object" == typeof module.exports ? (module.exports = r(require("jquery"))) : r(jQuery);
})(function ($) {
"use strict";
var r = {
bgVertical: function (r, t) {
return r.css({ "background-position": "center " + -t + "px" });
},
bgHorizontal: function (r, t) {
return r.css({ "background-position": -t + "px center" });
},
vertical: function (r, t, o) {
return (
"none" === o ? (o = "") : !0,
r.css({ "-webkit-transform": "translateY(" + t + "px)" + o, "-moz-transform": "translateY(" + t + "px)" + o, transform: "translateY(" + t + "px)" + o, transition: "transform linear", "will-change": "transform" })
);
},
horizontal: function (r, t, o) {
return (
"none" === o ? (o = "") : !0,
r.css({ "-webkit-transform": "translateX(" + t + "px)" + o, "-moz-transform": "translateX(" + t + "px)" + o, transform: "translateX(" + t + "px)" + o, transition: "transform linear", "will-change": "transform" })
);
},
};
$.fn.paroller = function (t) {
var o = $(window).height(),
n = $(document).height(),
t = $.extend({ factor: 0, type: "background", direction: "vertical" }, t);
return this.each(function () {
var a = !1,
e = $(this),
i = e.offset().top,
c = e.outerHeight(),
l = e.data("paroller-factor"),
s = e.data("paroller-type"),
u = e.data("paroller-direction"),
offVal = e.data("paroller-offset"),
f = l ? l : t.factor,
d = s ? s : t.type,
h = u ? u : t.direction,
p = Math.round(i * f),
g = Math.round((i - o / 2 + c) * f),
m = e.css("transform");
"background" == d ? ("vertical" == h ? r.bgVertical(e, p) : "horizontal" == h && r.bgHorizontal(e, p)) : "foreground" == d && ("vertical" == h ? r.vertical(e, g, m) : "horizontal" == h && r.horizontal(e, g, m));
var b = function () {
a = !1;
};
if (typeof offVal !== 'undefined') {
i = parseInt(offVal);
}
$(window)
.on("scroll", function () {
if (!a) {
var t = $(this).scrollTop();
(n = $(document).height()),
(p = Math.round((i - t) * f)),
(g = Math.round((i - o / 2 + c - t) * f)),
"background" == d
? "vertical" == h
? r.bgVertical(e, p)
: "horizontal" == h && r.bgHorizontal(e, p)
: "foreground" == d && n >= t && ("vertical" == h ? r.vertical(e, g, m) : "horizontal" == h && r.horizontal(e, g, m)),
window.requestAnimationFrame(b),
(a = !0);
}
})
.trigger("scroll");
});
};
});
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
+409
View File
@@ -0,0 +1,409 @@
/*
* zoomSlider - v1.0.2 Fork
* CSS3 background zoom slideshow
* http://mingthings.com
*
* Made by Ming Yeung
* Under MIT License
*/
;(function ( $, window, document, undefined ) {
var pluginName = "zoomSlider",
defaults = {
src: null,
src2: null,
speed: 8000,
initzoom: 1.2,
switchSpeed: 1000,
interval: 4600,
autoplay: true,
bullets: true,
overlay: 'plain' // false, plain, dots
};
// The actual plugin constructor
function Plugin ( element, options ) {
this.element = element;
this.$el = $(element);
this._defaults = defaults;
this._name = pluginName;
var elData = this.$el.data();
var elDataObj = {};
for (var key in elData) {
if ( elData.hasOwnProperty(key) ) {
if ( key.match(/zs[A-Z]/) ) {
var keyName = key.substr(2);
keyName = keyName.charAt(0).toLowerCase() + keyName.slice(1);
elDataObj[keyName] = elData[key]
}
}
}
this.settings = $.extend( {}, defaults, elDataObj, options );
if ( this.settings.src == null || this.settings.src.length < 1 ) {
console.log('ZoomSlider terminated - invalid input.');
return;
}
this.init();
}
// Avoid Plugin.prototype conflicts
$.extend(Plugin.prototype, {
init: function () {
// Place initialization logic here
// You already have access to the DOM element and
// the options via the instance, e.g. this.element
// and this.settings
// you can add more functions like the one below and
// call them like so: this.yourOtherFunction(this.element, this.settings).
// make sure src is an Array
if ($.isArray(this.settings.src) == false) {
this.settings.src = [this.settings.src];
}
if ($.isArray(this.settings.src2) == false) {
this.settings.src2 = [this.settings.src2];
}
// https://github.com/twitter/bootstrap/issues/2870
this.transEndEventNames = {
'WebkitTransition' : 'webkitTransitionEnd',
'MozTransition' : 'transitionend',
'OTransition' : 'oTransitionEnd',
'msTransition' : 'MSTransitionEnd',
'transition' : 'transitionend'
};
this.transEndEventName = this.transEndEventNames[ Modernizr.prefixed( 'transition' ) ];
// suport for css transforms and css transitions
this.support = Modernizr.csstransitions && Modernizr.csstransforms;
// set inline CSS3 transition properties
var transformPrefixed = Modernizr.prefixed('transform');
transformPrefixed = transformPrefixed.replace(/([A-Z])/g, function(transformPrefixed,m1){ return '-' + m1.toLowerCase(); }).replace(/^ms-/,'-ms-');
this.transitionProp = {
'transition': transformPrefixed+' '+this.settings.speed+'ms ease-out, opacity '+this.settings.switchSpeed+'ms'
};
this.numSlides = this.settings.src.length;
// make sure the container is not [position: static]
switch(this.$el.css('position')) {
case 'relative':
case 'absolute':
case 'fixed':
break;
default:
this.$el.css('position', 'relative');
break;
}
// make sure the first image has been loaded.
var self = this;
var $img = $('<img />');
//$img.load( function() {
if (self.numSlides == 1) {
self.initSingle();
} else {
self.initSlideshow();
}
//});
$img.attr('src', this.settings.src[0]);
},
initSlideshow: function () {
var self = this;
var $slideshow = $('<div class="zs-slideshow"></div>'),
$slidesWrap = $('<div class="zs-slides"></div>'),
$arrowsWrap = $('<div class="zs-arrows"></div>'),
$zslayer = $('<div class="zs-layer"></div>'),
$bulletsWrap = $('<div class="zs-bullets"></div>'),
$ww = $(window).width();
for (i = 0; i < this.numSlides; i++) {
var $slide = $('<div class="zs-slide zs-slide-' + i + '"></div>');
if ( $ww <= 767 && this.settings.src2[i].length ) {
$slide.css({ 'background-image': "url('" + this.settings.src2[i] + "')" }).appendTo( $slidesWrap );
}
else {
$slide.css({ 'background-image': "url('" + this.settings.src[i] + "')" }).appendTo( $slidesWrap );
}
var $bullet = $('<div class="zs-bullet zs-bullet-' + i + '"></div>')
$bullet.appendTo( $bulletsWrap );
if (i == 0) {
$slide.addClass('active').css('opacity', 1);
$bullet.addClass('active');
$('.zs-enabled .lte-zs-slider-inner.lte-zs-slide-' + i).addClass('visible');
}
}
self._promoteChildren();
$slideshow.append( $zslayer );
$slideshow.append( $slidesWrap ).prependTo( this.$el );
if ( this.settings.bullets != false || this.settings.bullets == 'outside' ) {
if ( this.settings.bullets == 'outside' ) {
$slideshow.after( $bulletsWrap );
}
else {
$slideshow.append( $bulletsWrap );
}
$slideshow.on('click', '.zs-bullet', function(e){
self.jump( $(this).index() );
});
}
if ( this.settings.arrows == true || this.settings.arrows == 'right' || this.settings.arrows == 'bottom' ) {
var container_class = '';
if ( this.settings.arrows == 'bottom' ) {
container_class = 'container';
}
$('<div class="'+container_class+'"><span class="lte-arrow-left">'+this.settings.prev+'</span><span class="lte-arrow-right">'+this.settings.next+'</span></div>').appendTo( $arrowsWrap );
this.$el.append( $arrowsWrap );
this.$el.on('click', '.lte-arrow-left', function(e){
self.prev();
});
this.$el.on('click', '.lte-arrow-right', function(e){
self.next() ;
});
}
this.pos = 0;
this.pending = null;
this.switching = false;
this.$slideshow = $slideshow;
this.$slides = $slidesWrap.children( '.zs-slide' );
this.$bullets = $bulletsWrap.children( '.zs-bullet' );
this.$el.addClass('zs-enabled');
var $firstBlock = $('.zs-enabled .lte-zs-slider-inner');
$('.zs-enabled .lte-zs-slider-inner').css('opacity', '');
var minHeight = 0;
$('.lte-zs-slider-inner').each(function(i, el) {
if ( $(el).height() > minHeight ) {
minHeight = $(el).height();
}
});
if (this.support) {
var $firstSlide = this.$slides.eq(0);
var $initzoom = this.settings.initzoom;
$firstSlide.css('opacity', 0).css( this.transitionProp );
$('.lte-zs-slider-wrapper').css('min-height', (minHeight ) + 'px' );
$('.zs-slideshow').css('min-height', (minHeight - 2 ) + 'px' );
jQuery(window).on('resize', function(){
var minHeight = 0;
$('.lte-zs-slider-inner').each(function(i, el) {
if ( $(el).height() > minHeight ) {
minHeight = $(el).height();
}
});
$('.lte-zs-slider-wrapper').css('min-height', (minHeight ) + 'px' );
$('.zs-slideshow').css('min-height', (minHeight - 2 ) + 'px' );
});
setTimeout(function(){
$firstSlide.css( { 'opacity': 1.0, 'transform': 'scale('+ $initzoom +', '+ $initzoom +')', 'z-index': 2 } );
}, 50);
}
if (this.settings.autoplay == true) {
this.play();
}
},
initSingle: function() {
var self = this;
var $slideshow = $('<div class="zs-slideshow"></div>'),
$slidesWrap = $('<div class="zs-slides"></div>'),
$slide = $('<div class="zs-slide zs-slide-0"></div>');
$slide.css({ 'background-image': "url('" + this.settings.src[0] + "')" }).appendTo( $slidesWrap );
$slide.addClass('active').css('opacity', 1);
$('.zs-enabled .lte-zs-slider-inner.lte-zs-slide-0').addClass('visible').addClass('single');
self._promoteChildren();
$slideshow.append( $slidesWrap ).prependTo( this.$el );
this.$el.addClass('zs-enabled');
if (this.settings.overlay == 'dots') {
this.$el.addClass('overlay-dots');
} else if (this.settings.overlay == 'plain') {
this.$el.addClass('overlay-plain')
}
if (this.support) {
$slide.css('opacity', 1).css( this.transitionProp );
if (this.settings) {
setTimeout(function(){
$slide.css( { 'opacity': 1.0, 'transform': 'scale(1)', 'z-index': 2 } )
}, 50);
}
}
},
_promoteChildren: function() {
// make sure every children have high enough z-index
this.$el.children().each(function(index){
$this = $(this);
if ($this.css('z-index') == 'auto') {
$this.css('z-index', 2);
}
if ($this.css('position') == 'static') {
$this.css('position', 'relative');
}
});
},
jump: function( pos ) {
if ( pos >= this.numSlides ) {
console.log('ZoomSlider: jump(pos) aborted. supplied index out of range.');
return;
}
if ( this.pos == pos ) return;
if ( this.switching ) {
this.pending = pos;
return;
}
var self = this;
var $lastSlide = this.$slides.eq( this.pos );
var $nowSlide = this.$slides.eq( pos );
$('.zs-enabled .lte-zoompages .current').html(pos + 1);
$('.zs-enabled .lte-zs-slider-inner.visible').removeClass('visible');
$('.zs-enabled .lte-zs-slider-inner.lte-zs-slide-' + pos).addClass('visible');
if ( this.support ) {
this.switching = true;
$lastSlide.css('z-index', 1);
$nowSlide.addClass('active')
.css( this.transitionProp )
.css( { 'opacity': 1.0, 'transform': 'scale('+this.settings.initzoom+', '+this.settings.initzoom+')', 'z-index': 2 } )
.on( this.transEndEventName, function(e) {
if (e.originalEvent.propertyName == 'opacity') {
lastSlideBg = $lastSlide.css('background-image');
$lastSlide.removeClass('active')
.removeAttr('style')
.css('background-image', lastSlideBg);
$nowSlide.off( self.transEndEventName );
self.switching = false;
if ( self.pending != null ) {
setTimeout(function(){
var newPos = self.pending;
self.pending = null;
self.$bullets.eq(newPos).click();
}, 30)
}
}
});
} else {
$lastSlide.removeClass('active');
$nowSlide.addClass('active');
}
this.$bullets.eq(this.pos).removeClass('active');
this.$bullets.eq(pos).addClass('active');
this.pos = pos;
if (this.settings.autoplay) {
this.play();
}
},
prev: function() {
var posPrev = this.pos - 1;
if (posPrev < 0) posPrev = this.numSlides - 1;
this.jump( posPrev );
},
next: function() {
var posNext = this.pos + 1;
if (posNext >= this.numSlides) posNext = 0;
this.jump( posNext );
},
play: function() {
// clear any existing timer
if (this.timer != null) {
clearInterval(this.timer);
}
var self = this;
this.settings.autoplay = true;
// add timer
this.timer = setInterval( function(){
self.next();
}, this.settings.interval );
},
stop: function() {
this.settings.autoplay = false;
clearInterval(this.timer);
this.timer = null;
}
});
// A really lightweight plugin wrapper around the constructor,
// preventing against multiple instantiations
$.fn[ pluginName ] = function ( options ) {
return this.each(function() {
if ( !$.data( this, "plugin_" + pluginName ) ) {
$.data( this, "plugin_" + pluginName, new Plugin( this, options ) );
}
});
};
var WidgetZoomsliderHandler = function ($scope, $) {
// auto create slideshow on [data-zs-enabled] instances.
var $instances = $('[data-zs-src]');
if ($instances.length > 0) {
$instances.each( function(index) {
var $this = $(this);
$this.zoomSlider();
});
}
};
$(window).on('elementor/frontend/init', function () {
elementorFrontend.hooks.addAction('frontend/element_ready/lte-zoomslider.default', WidgetZoomsliderHandler);
});
})( jQuery, window, document );
+10
View File
File diff suppressed because one or more lines are too long
+4
View File
File diff suppressed because one or more lines are too long
File diff suppressed because it is too large Load Diff
+71
View File
@@ -0,0 +1,71 @@
/*
Plugin: jQuery Parallax
Version 1.1.3
Author: Ian Lunn
Twitter: @IanLunn
Author URL: http://www.ianlunn.co.uk/
Plugin URL: http://www.ianlunn.co.uk/plugins/jquery-parallax/
Dual licensed under the MIT and GPL licenses:
http://www.opensource.org/licenses/mit-license.php
http://www.gnu.org/licenses/gpl.html
*/
(function( $ ){
"use strict";
var $window = $(window);
var windowHeight = $window.height();
$window.resize(function () {
windowHeight = $window.height();
});
$.fn.parallax = function(xpos, speedFactor, outerHeight) {
var $this = $(this);
var getHeight;
var firstTop;
var paddingTop = 0;
// get the starting position of each element to have parallax applied to it
$this.each(function(){
firstTop = $this.offset().top;
});
if (outerHeight) {
getHeight = function(jqo) {
return jqo.outerHeight(true);
};
} else {
getHeight = function(jqo) {
return jqo.height();
};
}
// setup defaults if arguments aren't specified
if (arguments.length < 1 || xpos === null) xpos = "50%";
if (arguments.length < 2 || speedFactor === null) speedFactor = 0.1;
if (arguments.length < 3 || outerHeight === null) outerHeight = true;
// function to be called whenever the window is scrolled or resized
function update(){
var pos = $window.scrollTop();
$this.each(function(){
var $element = $(this);
var top = $element.offset().top;
var height = getHeight($element);
// Check if totally above or totally below viewport
if (top + height < pos || top > pos + windowHeight) {
return;
}
$this.css('backgroundPosition', xpos + " " + Math.round((top - pos) * speedFactor) + "px");
});
}
$window.bind('scroll', update).resize(update);
update();
};
})(jQuery);
+11
View File
@@ -0,0 +1,11 @@
/**
* This JS file was auto-generated via Terser.
*
* Contributors should avoid editing this file, but instead edit the associated
* non minified file file. For more information, check out our engineering docs
* on how we handle JS minification in our engineering docs.
*
* @see: https://evnt.is/dev-docs-minification
*/
var tribe_tickets_rsvp={num_attendees:0,event:{}};!function($,my){"use strict";my.init=function(){my.$rsvp=$(".tribe-events-tickets-rsvp"),my.attendee_template=$(document.getElementById("tribe-tickets-rsvp-tmpl")).html(),my.$rsvp.on("change input keyup",".tribe-tickets-quantity",my.event.quantity_changed),my.$rsvp.closest(".cart").on("submit",my.event.handle_submission),$(".tribe-rsvp-list").on("click",".attendee-meta-row .toggle",(function(){$(this).toggleClass("on").siblings(".attendee-meta-details").slideToggle()}))},my.quantity_changed=function($quantity){const $rsvp=$quantity.closest(".tribe-events-tickets-rsvp"),$rsvpQtys=$rsvp.find(".tribe-tickets-quantity");let rsvpQty=0;$rsvpQtys.each((function(){rsvpQty+=parseInt($(this).val(),10)})),0===rsvpQty?$rsvp.removeClass("tribe-tickets-has-rsvp"):$rsvp.addClass("tribe-tickets-has-rsvp")},my.validate_rsvp_info=function($form){const $qty=$form.find("input.tribe-tickets-quantity"),$name=$form.find("input#tribe-tickets-full-name"),$email=$form.find("input#tribe-tickets-email");let rsvpQty=0;return $qty.each((function(){rsvpQty+=parseInt($(this).val(),10)})),$name.val().trim().length&&$email.val().trim().length&&rsvpQty},my.validate_meta=function($form){let isMetaValid=!0;return!!window.tribe_event_tickets_plus&&(isMetaValid=window.tribe_event_tickets_plus.meta.validate_meta($form)),isMetaValid},my.event.quantity_changed=function(){my.quantity_changed($(this))},my.event.handle_submission=function(e){const $form=$(this).closest("form"),$rsvpMessages=$form.find(".tribe-rsvp-messages, .tribe-rsvp-message-confirmation-error"),$etpMetaMessages=$form.find(".tribe-event-tickets-meta-required-message"),isRsvpInfoValid=my.validate_rsvp_info($form),isAttendeeMetaValid=my.validate_meta($form);return!(!isRsvpInfoValid||!isAttendeeMetaValid)||(isRsvpInfoValid?$rsvpMessages.hide():$rsvpMessages.show(),isAttendeeMetaValid?($etpMetaMessages.hide(),$form.removeClass("tribe-event-tickets-plus-meta-missing-required")):($form.addClass("tribe-event-tickets-plus-meta-missing-required"),$etpMetaMessages.show()),$("html, body").animate({scrollTop:$form.offset().top-100},300),!1)},$(my.init)}(jQuery,tribe_tickets_rsvp);
+41
View File
@@ -0,0 +1,41 @@
document.addEventListener("DOMContentLoaded", function() {
// Get the buttons and the navbar element
const openButton = document.getElementById('open-button');
const closeButton = document.getElementById('close-button');
const navbar = document.getElementById('navbar');
// Log to check if elements exist
console.log('Open button:', openButton);
console.log('Close button:', closeButton);
console.log('Navbar:', navbar);
// Ensure that buttons and navbar exist
if (openButton && closeButton && navbar) {
console.log('Elements found and event listeners ready.');
// Add event listener to the open button to remove the collapse class
openButton.addEventListener('click', function() {
console.log('Open button clicked');
if (navbar.classList.contains('collapse')) {
navbar.classList.remove('collapse');
console.log('Collapse class removed');
} else {
console.log('Navbar is already open (no collapse class).');
}
});
// Add event listener to the close button to add the collapse class
closeButton.addEventListener('click', function() {
console.log('Close button clicked');
if (!navbar.classList.contains('collapse')) {
navbar.classList.add('collapse');
console.log('Collapse class added');
} else {
console.log('Navbar is already collapsed (collapse class exists).');
}
});
} else {
console.error('Error: Buttons or navbar element not found.');
}
});
+819
View File
@@ -0,0 +1,819 @@
"use strict";
jQuery( function() {
initEvents();
initStyles();
sanitizeBlogContent();
cleanupDuplicateBlocks();
initCollapseMenu();
checkCountUp();
initScrollReveal();
checkScrollAnimation();
});
jQuery(window).on('scroll', function (event) {
checkNavbar();
checkGoTop();
checkScrollAnimation();
}).scroll();
jQuery(window).on('load', function(){
initMasonry();
initParallax();
});
jQuery(window).on("resize", function () {
setResizeStyles();
}).resize();
/* Navbar menu initialization */
function initCollapseMenu() {
var navbar = jQuery('.lte-navbar-items'),
navbar_toggle = jQuery('.lte-navbar-toggle'),
navbar_wrapper = jQuery("#lte-nav-wrapper");
navbar_wrapper.on('click', '.lte-navbar-toggle', function (e) {
navbar_toggle.toggleClass('collapsed');
navbar.toggleClass('collapse');
navbar_wrapper.toggleClass('mob-visible');
});
// Anchor mobile menu
navbar.on('click', '.menu-item-type-custom > a', function(e) {
var el = jQuery(this);
if ( jQuery(this).attr('href') != '#pll_switcher' && typeof jQuery(this).attr('href') !== 'undefined' && jQuery(this).attr('href') !== '#' && jQuery(this).attr('href').indexOf("#") != -1 &&
( ( el.closest('li').hasClass('menu-item-has-children') && e.target.tagName != 'A') ||
( !el.closest('li').hasClass('menu-item-has-children') && e.target.tagName == 'A')) ) {
navbar_toggle.addClass('collapsed');
navbar.addClass('collapse');
navbar_wrapper.removeClass('mob-visible');
}
});
navbar.on('click', '.menu-item-has-children > a', function(e) {
var el = jQuery(this);
if (!el.closest('.lte-navbar-items').hasClass('collapse')) {
if ((el.attr('href') === undefined || el.attr('href') === '#') || e.target.tagName == 'A') {
el.next().toggleClass('show');
el.parent().toggleClass('show');
return false;
}
// Remove duplicate footers and duplicate blog grids (defensive cleanup)
function cleanupDuplicateBlocks(){
try {
// Keep only the first footer wrapper
var footers = document.querySelectorAll('.lte-footer-wrapper');
for (var i = 1; i < footers.length; i++) {
footers[i].remove();
}
// Keep only the first blog grid inside main blog wrap
var grids = document.querySelectorAll('.lte-blog-wrap .blog.blog-block');
for (var j = 1; j < grids.length; j++) {
grids[j].remove();
}
} catch(e) { /* no-op */ }
}
}
});
var lastWidth;
jQuery(window).on("resize", function () {
checkNavbar();
var winWidth = jQuery(window).width(),
winHeight = jQuery(window).height();
lastWidth = winWidth;
});
}
// Remove empty/garbage paragraphs from blog content and normalize spacing
function sanitizeBlogContent(){
try {
var blocks = document.querySelectorAll('.text.lte-text-page.clearfix');
blocks.forEach(function(block){
// remove <p> that are empty or contain only <br> or whitespace
Array.from(block.querySelectorAll('p')).forEach(function(p){
var html = p.innerHTML.trim();
var text = p.textContent.replace(/\u00A0/g,' ').trim();
if (!text || /^<br\s*\/?>(\s|&nbsp;)*$/i.test(html)) {
p.remove();
return;
}
// remove hashtag-only paragraphs (e.g., #tag #tag2)
var anchors = Array.from(p.querySelectorAll('a'));
var allHashLinks = anchors.length > 0 && anchors.every(function(a){
var t = (a.textContent||'').trim();
return t.startsWith('#');
});
var pureHashText = /^#\S+(?:\s+#\S+)*$/.test(text);
if (allHashLinks || pureHashText) {
p.remove();
return;
}
// strip excessive bottom margins coming from pasted content
p.style.marginBottom = '';
p.style.marginTop = '';
});
// collapse consecutive <p> duplicates with same text
var prevText = null;
Array.from(block.querySelectorAll('p')).forEach(function(p){
var t = p.textContent.trim();
if (prevText !== null && t === prevText) {
p.remove();
} else {
prevText = t;
}
});
});
// Remove tags/sharing/related containers if still present in DOM
document.querySelectorAll('.blog-info-post-bottom, .tags-line, .lte-sharing, .lte-related').forEach(function(el){
el.remove();
});
} catch(e) { /* no-op */ }
}
/* Navbar attributes with dependency on resolution and scroll status */
function checkNavbar() {
var navbar = jQuery('.lte-navbar-items'),
scroll = jQuery(window).scrollTop(),
navBar = jQuery('.lte-navbar'),
topBar = jQuery('.lte-topbar-block'),
navbar_toggle = jQuery('.lte-navbar-toggle'),
navbar_wrapper = jQuery("#lte-nav-wrapper"),
slideDiv = jQuery('.slider-full'),
winWidth = jQuery(window).width(),
winHeight = jQuery(window).height(),
navbar_mobile_width = navbar.data('mobile-screen-width');
if ( winWidth < navbar_mobile_width ) {
navbar.addClass('navbar-mobile').removeClass('navbar-desktop');
navbar_wrapper.addClass('lte-navwrapper-mobile').removeClass('lte-navwrapper-desktop');
}
else {
navbar.addClass('navbar-desktop').removeClass('navbar-mobile');
navbar_wrapper.addClass('lte-navwrapper-desktop').removeClass('lte-navwrapper-mobile');
}
topBar.addClass('inited');
navbar_wrapper.addClass('inited');
if ( topBar.length ) {
navBar.data('offset-top', topBar.height());
}
if (winWidth > navbar_mobile_width && navbar_toggle.is(':hidden')) {
navbar.addClass('collapse');
navbar_toggle.addClass('collapsed');
navbar_wrapper.removeClass('mob-visible');
}
jQuery("#lte-nav-wrapper.navbar-layout-transparent + .lte-page-header, #lte-nav-wrapper.navbar-layout-transparent + .main-wrapper").css('margin-top', '-' + navbar_wrapper.height() + 'px');
jQuery(".lte-image-preview img").each(function(i, el) {
var height = jQuery(el).height() - 700;
jQuery(el)
.on('mouseover', function() {
jQuery(this).css( { '-webkit-transform' : 'translateY(-' + height + 'px)', 'transform' : 'translateY(-' + height + 'px)' } );
})
.on('mouseout', function() {
jQuery(this).css( { '-webkit-transform' : 'translateY(0px)', 'transform' : 'translateY(0px)' } );
});
});
}
/* Check GoTop Visibility */
function checkGoTop() {
var gotop = jQuery('.lte-go-top'),
scrollBottom = jQuery(document).height() - jQuery(window).height() - jQuery(window).scrollTop();
if ( gotop.length ) {
if ( jQuery(window).scrollTop() > 400 ) {
gotop.addClass('show');
}
else {
gotop.removeClass('show');
}
if ( scrollBottom < 50 ) {
gotop.addClass('scroll-bottom');
}
else {
gotop.removeClass('scroll-bottom');
}
}
}
/* All keyboard and mouse events */
function initEvents() {
initSearch();
jQuery('.swipebox.photo').magnificPopup({type:'image', gallery: { enabled: true }});
jQuery('.swipebox.lte-video-popup').magnificPopup({type:'iframe'});
jQuery('.magnific-popup-link').magnificPopup({type:'ajax'});
jQuery('.swipebox-gallery').each(function() {
jQuery(this).magnificPopup({type:'image', delegate: '.lte-gallery', gallery: { enabled: true }});
});
if (!/Mobi/.test(navigator.userAgent) && jQuery(window).width() > 768) {
jQuery('.matchHeight').matchHeight();
jQuery('.items-matchHeight article').matchHeight();
}
jQuery('.lte-sidebar-filter').on('click', function() {
jQuery(this).parent().toggleClass('lte-show');
});
jQuery('.lte-sidebar-close').on('click', function() {
jQuery(this).parent().parent().removeClass('lte-show');
});
jQuery('.lte-sidebar-overlay').on('click', function() {
jQuery(this).parent().removeClass('lte-show');
});
/* Scrolling to navbar from "go top" button in footer */
jQuery('.lte-go-top').on('click', function() {
jQuery('html, body').animate({ scrollTop: 0 }, 1200);
return false;
});
// WooCommerce grid-list toggle
jQuery('.gridlist-toggle').on('click', 'a', function() {
jQuery('.matchHeight').matchHeight();
});
jQuery('.woocommerce').on('click', 'div.quantity > span', function(e) {
var f = jQuery(this).siblings('input'),
step = 1,
fixed = 0,
val;
if ( jQuery(f).is("[step]") ) {
step = parseFloat(jQuery(f).attr('step'));
}
if ( step != 1 ) fixed = 1;
if (jQuery(this).hasClass('more')) {
val = parseFloat(f.val()) + step;
}
else {
val = parseFloat(f.val()) - step;
}
f.val(val);
e.preventDefault();
jQuery(this).siblings('input').change();
return false;
});
if ( jQuery('.lte-mouse-move-object').length ) {
jQuery('.lte-mouse-move-object').each(function(i, el) {
jQuery('body').on('mousemove', function(e){
jQuery(el)[0].style.WebkitTransform = 'translate3d(' + '-' + (((e.pageX - jQuery(this).offset().left) / jQuery(el).width()) * 10) + 'px, 0, 0)';
});
});
}
jQuery('.lte-mouse-move .elementor-column-wrap')
.on('mouseover', function() {
if ( typeof jQuery(this).data('bg-size') === 'undefined' ) {
jQuery(this).data('bg-size', jQuery(this).css('background-size'));
}
if ( jQuery(this).css( 'background-size' ) != 'cover' ) {
jQuery(this)[0].style.setProperty( 'background-size', parseInt(jQuery(this).data('bg-size')) + 10 + '%', 'important' );
}
})
.on('mouseout', function(){
if ( jQuery(this).css( 'background-size' ) != 'cover' ) {
jQuery(this)[0].style.setProperty( 'background-size', jQuery(this).data('bg-size'), 'important' );
}
})
.on('mousemove', function(e){
if ( jQuery(this).css( 'background-size' ) != 'cover' ) {
jQuery(this)[0].style.setProperty( 'background-position', ((e.pageX - jQuery(this).offset().left) / jQuery(this).width()) * 100 + '% ' + ((e.pageY - jQuery(this).offset().top) / jQuery(this).height()) * 100 + '%', 'important' );
}
});
jQuery('.lte-services-sc.lte-layout-promo .lte-item')
.on('mouseover', function(i, el) {
jQuery(this).siblings().removeClass('lte-active');
jQuery(this).addClass('lte-active');
jQuery(this).parent().parent().find('.lte-bg-item.lte-active').removeClass('lte-active');
jQuery(this).parent().parent().find('.lte-bg-item-' + jQuery(this).data('id')).addClass('lte-active');
});
jQuery('.lte-events-sc.lte-events-layout-grid .lte-item')
.on('mouseover', function(i, el) {
var height = jQuery(this).find('.lte-excerpt').height();
jQuery(this).find('.lte-event-pre').css( { '-webkit-transform' : 'translateY(-' + height + 'px)', 'transform' : 'translateY(-' + height + 'px)' } );
})
.on('mouseout', function(i, el) {
var height = 0;
jQuery(this).find('.lte-event-pre').css( { '-webkit-transform' : 'translateY(-' + height + 'px)', 'transform' : 'translateY(-' + height + 'px)' } );
});
jQuery('.lte-navbar').on( 'affix.bs.affix', function(){
if (!jQuery( window ).scrollTop()) return false;
});
jQuery('.lte-cursor-follow-wrapper').mousemove(function(i, el) {
var relX = i.pageX - jQuery(this).offset().left;
var relY = i.pageY - jQuery(this).offset().top;
jQuery(this).find('.lte-tab-cursor').css({"left" : relX, "top" : relY});
});
if ( jQuery('.lte-particles-ripples').length ) {
jQuery('.lte-particles-ripples').ripples({
resolution: 512,
dropRadius: 20,
perturbance: 0.04,
});
setInterval(function() {
if ( !document.hidden ) {
var $el = jQuery('.lte-particles-ripples');
var x = Math.random() * $el.outerWidth();
var y = Math.random() * $el.outerHeight();
var dropRadius = 20;
var strength = 0.04 + Math.random() * 0.04;
$el.ripples('drop', x, y, dropRadius, strength);
}
}, 400);
}
}
function initSearch() {
let searchHandler = function(event){
if (jQuery(event.target).is(".lte-top-search-wrapper, .lte-top-search-wrapper *")) return;
jQuery(document).off("click", searchHandler);
jQuery('.lte-top-search-wrapper').removeClass('show-field');
jQuery('.lte-navbar-items').removeClass('muted');
}
let search_href = jQuery('.lte-top-search-wrapper').data('base-href'),
search_soruce = jQuery('.lte-top-search-wrapper').data('source');
jQuery('.lte-top-search-ico').on('click', function (e) {
e.preventDefault();
jQuery(this).parent().toggleClass('show-field');
jQuery('.lte-navbar-items').toggleClass('muted');
if (jQuery(this).parent().hasClass('show-field')) {
jQuery(document).on("click", searchHandler);
}
else {
jQuery(document).off("click", searchHandler);
}
});
jQuery('.lte-nav-search .lte-header').on('click', function(e) {
jQuery(this).prev().find('.lte-top-search-ico').click();
return false;
});
jQuery('.lte-top-search-ico-close').on('click', function (e) {
jQuery(this).parent().toggleClass('show-field');
jQuery('.lte-navbar-items').toggleClass('muted');
return false;
});
jQuery('#lte-top-search-ico-mobile').on('click', function() {
if ( search_soruce == 'woocommerce' ) {
window.location = search_href + '?s=' + jQuery(this).next().val() + '&post_type=product';
}
else {
window.location = search_href + '?s=' + jQuery(this).next().val();
}
return false;
});
jQuery('.lte-top-search-wrapper input').keypress(function (e) {
if (e.which == 13) {
if ( search_soruce == 'woocommerce' ) {
window.location = search_href + '?s=' + jQuery(this).val() + '&post_type=product';
}
else {
window.location = search_href + '?s=' + jQuery(this).val();
}
return false;
}
});
}
function lteUrlDecode(str) {
return decodeURIComponent((str+'').replace(/\+/g, '%20'));
}
/* Parallax initialization */
function initParallax() {
// Only for desktop
if (/Mobi/.test(navigator.userAgent)) return false;
jQuery('.lte-parallax').parallax("50%", 0.2);
jQuery('section.lte-parallax-yes, .elementor-element.lte-parallax-yes, div.lte-parallax-yes > .elementor-column-wrap').each(function(i, el) {
var val = jQuery(el).attr('class').match(/lte-bg-parallax-value-(\S+)/);
if ( val === null ) var val = [0, 0.2];
jQuery(el).parallax("50%", parseFloat(val[1]));
});
if ( jQuery('.lte-parallax-image').length ) {
var id = 'lte-p-id' + Math.floor(Math.random() * 100000);
jQuery('.lte-parallax-image').closest('.elementor-widget-wrap').attr('id', id );
var parallaxInstance = new Parallax(document.getElementById(id));
}
if ( jQuery('.lte-parallax-slider-sc').length ) {
var parallaxInstance = new Parallax(document.getElementById('lte-parallax-slider-sc-wrap'));
}
if (typeof jQuery().paroller === "function") {
jQuery("[data-paroller-factor]").paroller();
setTimeout(function() { window.dispatchEvent(new Event('resize')); }, 400);
}
}
/* Adding custom classes to elements */
function initStyles() {
jQuery('select.wpcf7-select, aside select, .lte-wc-order select').wrap('<div class="select-wrap"></div>')
jQuery('.wpcf7-checkbox').parent().addClass('margin-none');
jQuery('input[type="submit"], button[type="submit"]').not('.lte-btn').addClass('lte-btn');
jQuery('#send_comment').removeClass('btn-xs');
jQuery('#searchsubmit').removeClass('lte-btn');
jQuery('blockquote').append('<span class="lte-triangle"></span>');
jQuery('table:not([class])').addClass('lte-table');
jQuery('ul:not([class]), ol:not([class])').addClass('lte-list');
jQuery('.lte-sidebar-header .lte-header-widget').each(function(i, el) {
jQuery(el).clone().removeClass('lte-header-widget').addClass('lte-header-watermark').insertAfter(el);
});
jQuery('.current-menu-ancestor, .current-menu-item, .current-menu-parent, .current_page_parent, .current_page_item').addClass('lte-active');
// WooCommerce styles
jQuery('.woocommerce .button').addClass('lte-btn btn-main').removeClass('button');
jQuery('.woocommerce-message .lte-btn, .woocommerce-info .lte-btn').addClass('btn-xs');
jQuery('.woocommerce .price_slider_amount .lte-btn').removeClass('btn-black color-hover-white').addClass('btn btn-main btn-xs');
jQuery('.woocommerce .checkout-button').removeClass('btn-black color-hover-white').addClass('btn btn-black color-hover-main');
jQuery('button.single_add_to_cart_button').removeClass('btn-xs color-hover-white').addClass('color-hover-main');
jQuery('.woocommerce .coupon .lte-btn').removeClass('color-hover-white').addClass('color-hover-main');
jQuery('.woocommerce .product .wc-label-new').closest('.product').addClass('lte-wc-new');
jQuery('.widget_product_search button').removeClass('lte-btn btn-xs');
jQuery('.woocommerce .product_meta span').each(function(i, el) {
jQuery(el).html(jQuery(el).html().replace(/\,/gi, '<span class="lte-coma">,</span>'));
});
// Cart quanity change
jQuery('.woocommerce div.quantity,.woocommerce-page div.quantity').append('<span class="more"></span><span class="less"></span>');
jQuery(document).off('updated_wc_div').on('updated_wc_div', function () {
jQuery('.woocommerce div.quantity,.woocommerce-page div.quantity').append('<span class="more"></span><span class="less"></span>');
initStyles();
});
jQuery('.input-group-append .lte-btn').removeClass('btn-xs');
jQuery(".woocommerce *:not(.lte-btn-wrap) > .lte-btn").wrap('<span class="lte-btn-wrap"></span');
jQuery(".container .wpcf7-submit").removeClass('btn-xs').wrap('<span class="lte-btn-wrap"></span');
jQuery('.blog-post .nav-links > a').wrapInner('<span></span>');
jQuery('.blog-post .nav-links > a[rel="next"]').wrap('<span class="next"></span>');
jQuery('.blog-post .nav-links > a[rel="prev"]').wrap('<span class="prev"></span>');
jQuery('.lte-background-no-img').each(function() {
var rx = Math.floor((Math.random() * 1200)) + 'px',
ry = Math.floor((Math.random() * 900)) + 'px';
jQuery(this).css('background-position', rx + ' ' + ry);
});
var overlays = jQuery('*[class*="lte-overlay-wrapper-"]')
.each(function (i, el) {
var overlay = this.className.match(/lte-overlay-wrapper-(\S+)/);
if ( jQuery(this).hasClass('elementor-column') ) {
jQuery(el).children('.elementor-column-wrap').prepend('<div class="lte-background-overlay lte-overlay-' + overlay[1] + '"></div>');
}
else {
jQuery(el).prepend('<div class="lte-background-overlay lte-overlay-' + overlay[1] + '"></div>');
}
});
var header_icon_class = jQuery('#lte-header-icon').data('icon');
jQuery('.wp-searchform .lte-btn').removeClass('lte-btn');
// Settings copyrights overlay for non-default heights
var copyrights = jQuery('.copyright-block.copyright-layout-copyright-transparent'),
footer = jQuery('#lte-widgets-footer + .copyright-block-transparent'),
widgets_footer = jQuery('#lte-widgets-footer'),
footerHeight = footer.outerHeight();
widgets_footer.css('padding-bottom', 0 + footerHeight + 'px');
footer.css('margin-top', '-' + 0 + (footerHeight - -2) + 'px');
copyrights.css('margin-top', '-' + (copyrights.outerHeight()) + 'px')
var bodyStyles = window.getComputedStyle(document.body);
var niceScrollConf = {cursorcolor:bodyStyles.getPropertyValue('--main'),cursorborder:"0px",background:"#fff",cursorwidth: "5px",cursorborderradius: "0px",autohidemode:false};
jQuery('.lte-price-sc.lte-scroll-yes .lte-filter-item').niceScroll(niceScrollConf);
}
/* Styles reloaded then page has been resized */
function setResizeStyles() {
var videos = jQuery('.blog-post article.format-video iframe'),
container = jQuery('.blog-post'),
bodyWidth = jQuery(window).outerWidth(),
contentWrapper = jQuery('.lte-content-wrapper.lte-footer-parallax'),
footerWrapper = jQuery('.lte-content-wrapper.lte-footer-parallax + .lte-footer-wrapper');
contentWrapper.css('margin-bottom', footerWrapper.outerHeight() + 'px');
jQuery.each(videos, function(i, el) {
var height = jQuery(el).height(),
width = jQuery(el).width(),
containerW = jQuery(container).width(),
ratio = containerW / width;
jQuery(el).css('width', width * ratio);
jQuery(el).css('height', height * ratio);
});
jQuery('.lte-services-sc.lte-layout-tabs').each(function(i, el) {
var wrapper = jQuery(el)
if ( !wrapper.hasClass('hasHeight') ) {
wrapper.css('height', wrapper.height());
wrapper.addClass('hasHeight');
}
});
document.documentElement.style.setProperty( '--fullwidth', bodyWidth + 'px' );
}
/* Starting countUp function */
function checkCountUp() {
if (jQuery(".lte-countup-animation").length){
jQuery('.lte-countup-animation').counterUp();
}
}
/*
Scroll Reveal Initialization
Catches the classes: lte-sr-fade_in lte-sr-text_el lte-sr-delay-200 lte-sr-duration-300 lte-sr-sequences-100
*/
function initScrollReveal() {
if (/Mobi/.test(navigator.userAgent) || jQuery(window).width() < 768) return false;
window.sr = ScrollReveal();
var srAnimations = {
zoom_in: {
opacity : 1,
scale : 0.01,
},
zoom_in_large: {
opacity : 0,
scale : 5.01,
},
fade_in: {
distance: 1,
opacity : 0,
scale : 1,
},
slide_from_left: {
distance: '50%',
origin: 'left',
scale : 1,
},
slide_from_right: {
distance: '50%',
origin: 'right',
scale : 1,
},
slide_from_top: {
distance: '50%',
origin: 'top',
scale : 1,
},
slide_from_bottom: {
distance: '50%',
origin: 'bottom',
scale : 1,
},
slide_rotate: {
rotate: { x: 0, y: 0, z: 360 },
},
};
var srElCfg = {
block: [''],
items: ['article', '.item'],
text_el: ['.heading', '.lte-btn', '.lte-btn-wrap', 'p', 'ul', 'img'],
list_el: ['li']
};
/*
Parsing elements class to get variables
*/
jQuery('.lte-sr').each(function() {
var el = jQuery(this),
srClass = el.attr('class');
var srId = srClass.match(/lte-sr-id-(\S+)/),
srEffect = srClass.match(/lte-sr-effect-(\S+)/),
srEl = srClass.match(/lte-sr-el-(\S+)/),
srDelay = srClass.match(/lte-sr-delay-(\d+)/),
srDuration = srClass.match(/lte-sr-duration-(\d+)/),
srSeq = srClass.match(/lte-sr-sequences-(\d+)/);
var cfg = srAnimations[srEffect[1]];
var srConfig = {
delay : parseInt(srDelay[1]),
duration : parseInt(srDuration[1]),
easing : 'ease-in-out',
afterReveal: function (domEl) { jQuery(domEl).css('transition', 'all .3s ease'); }
}
cfg = jQuery.extend({}, cfg, srConfig);
var initedEls = [];
jQuery.each(srElCfg[srEl[1]], function(i, e) {
initedEls.push('.lte-sr-id-' + srId[1] + ' ' + e);
});
sr.reveal(initedEls.join(','), cfg, parseInt(srSeq[1]));
});
}
/* Masonry initialization */
function initMasonry() {
jQuery('.masonry').masonry({
itemSelector: '.item',
columnWidth: '.item'
});
jQuery('.gallery-inner').masonry({
itemSelector: '.mdiv',
columnWidth: '.mdiv'
});
}
/* Scroll animation used for homepages */
function checkScrollAnimation() {
var scrollBlock = jQuery('.ltx-check-scroll:not(.done)');
if (scrollBlock.length) {
jQuery.each(scrollBlock, function(i, el) {
var scrollTop = scrollBlock.offset().top - window.innerHeight;
if ( jQuery(window).scrollTop() >= scrollTop ) {
scrollBlock.addClass('done');
}
});
}
}
setTimeout(function() { if ( typeof Pace !== 'undefined' ) { Pace.stop(); } }, 3000);
File diff suppressed because one or more lines are too long
+1
View File
File diff suppressed because one or more lines are too long
+13
View File
File diff suppressed because one or more lines are too long
+328
View File
@@ -0,0 +1,328 @@
// team-switcher.js
// Loads team data from XML and populates the team slider. Adds a men/women switcher.
(function () {
const XML_URL = 'data/team.xml';
const SWITCHER_ID = 'gender-switcher';
const WRAPPER_ID = 'team-swiper-wrapper-1';
const PRELOADER_ID = 'team-preloader-1';
const SECTION_ID = 'team-section-1';
let teamData = null; // cached parsed XML data
let currentGender = 'men';
// Autoscroll timers
let autoTimer = null;
let resumeTimer = null;
const AUTO_DELAY = 3500; // 5s
const RESUME_AFTER = 10000; // resume 10s after user interaction
function qs(sel, root = document) { return root.querySelector(sel); }
function qsa(sel, root = document) { return Array.from(root.querySelectorAll(sel)); }
async function loadXML() {
if (teamData) return teamData;
const res = await fetch(XML_URL, { cache: 'no-cache' });
if (!res.ok) throw new Error('Failed to fetch team.xml');
const text = await res.text();
const parser = new DOMParser();
const xml = parser.parseFromString(text, 'application/xml');
const parseError = xml.querySelector('parsererror');
if (parseError) throw new Error('Invalid XML in team.xml');
teamData = xml;
return xml;
}
function getMembersByCategory(xml, categoryName) {
const cat = Array.from(xml.querySelectorAll('team > category'))
.find(c => (c.getAttribute('name') || '').toLowerCase() === categoryName);
if (!cat) return [];
return Array.from(cat.querySelectorAll('member')).map(m => ({
name: (m.querySelector('name')?.textContent || '').trim(),
number: (m.querySelector('number')?.textContent || '').trim(),
role: (m.querySelector('role')?.textContent || '').trim(),
image: (m.querySelector('image')?.textContent || '').trim(),
}));
}
function slideHTML(member) {
const numHTML = member.number ? `<div class="lte-num">${member.number}</div>` : '<div class="lte-num"></div>';
const safeImg = member.image || '';
return (
`<div class="lte-item swiper-slide">
<div class="lte-team-item">
<a class="lte-image" style="background-image: url()">
<img loading="lazy" decoding="async" width="800" height="1200" src="${safeImg}" class="attachment-full size-full" />
</a>
<div class="lte-descr">
${numHTML}
<a href="${safeImg}" target="_blank">
<h4 class="lte-header">${member.name}</h4>
</a>
<p class="lte-subheader" style="color: #c42221">${member.role}
</p>
</div>
</div>
</div>`
);
}
function renderMembers(members) {
const wrapper = document.getElementById(WRAPPER_ID);
if (!wrapper) return;
const swiperEl = wrapper.closest('.swiper-container');
const swiper = swiperEl && swiperEl.swiper;
// Use DOM-based rendering to match theme's slider expectations
wrapper.innerHTML = members.map(slideHTML).join('');
// Strong refresh
if (swiper) {
try {
if (typeof swiper.updateSlides === 'function') swiper.updateSlides();
if (typeof swiper.updateSize === 'function') swiper.updateSize();
if (typeof swiper.updateAutoHeight === 'function') swiper.updateAutoHeight(0);
if (typeof swiper.slideTo === 'function') swiper.slideTo(0, 0, false);
if (typeof swiper.update === 'function') swiper.update();
} catch (e) {}
}
// Ask the theme to re-init this slider completely so arrows/loop/order are consistent
const sliderContainer = wrapper.closest('.lte-swiper-slider');
if (sliderContainer) sliderContainer.classList.remove('lte-inited');
if (typeof window.initSwiperWrappers === 'function') {
try { window.initSwiperWrappers(); } catch (_) {}
}
// Remove any duplicate arrow bars the theme may have added on re-init
cleanupDuplicateArrows();
setTimeout(() => window.dispatchEvent(new Event('resize')), 0);
// Ensure arrows exist and are bound; manual endless wrap
setupEndlessNavigation(swiperEl);
setupDragWrap(swiper);
// Restart autoscroll on fresh render
stopAutoScroll();
startAutoScroll();
}
// Keep only one arrows bar; prefer the one whose anchors already have our data-ts-bound
function cleanupDuplicateArrows() {
const wrapper = document.getElementById(WRAPPER_ID);
if (!wrapper) return;
const slider = wrapper.closest('.lte-swiper-slider');
if (!slider) return;
// Arrows can be siblings of slider or children inside slider depending on theme config
const candidates = [];
const parent = slider.parentElement;
if (parent) {
Array.from(parent.children).forEach((el) => { if (el.classList && el.classList.contains('lte-arrows')) candidates.push(el); });
}
Array.from(slider.children).forEach((el) => { if (el.classList && el.classList.contains('lte-arrows')) candidates.push(el); });
if (candidates.length <= 1) return;
// Prefer the one that already has data-ts-bound anchors
const hasBound = candidates.find(a => a.querySelector('a[data-ts-bound="1"]'));
const keep = hasBound || candidates[0];
candidates.forEach((a) => { if (a !== keep && a.parentElement) a.parentElement.removeChild(a); });
}
async function switchGender(gender) {
currentGender = gender;
try {
showPreloader();
const xml = await loadXML();
// Keep the order as in XML so the first visible is the first listed (e.g., Janečka Martin)
const list = getMembersByCategory(xml, gender);
renderMembers(list);
updateActiveButton();
markReady();
hidePreloader();
} catch (e) {
console.error(e);
hidePreloader();
}
}
function updateActiveButton() {
const container = document.getElementById(SWITCHER_ID);
if (!container) return;
qsa('button[data-gender]', container).forEach(btn => {
btn.classList.toggle('active', btn.dataset.gender === currentGender);
});
}
function bindUI() {
const container = document.getElementById(SWITCHER_ID);
if (!container) return;
container.addEventListener('click', (e) => {
const btn = e.target.closest('button[data-gender]');
if (!btn) return;
const gender = btn.dataset.gender;
if (gender && gender !== currentGender) switchGender(gender);
});
}
function ensureBasicStyles() {
const css = `
#${SWITCHER_ID}{display:flex;gap:.5rem;justify-content:center;margin:10px 0}
#${SWITCHER_ID} .switch-btn{background:#eee;border:1px solid #ccc;border-radius:20px;padding:.35rem .9rem;font-weight:600;cursor:pointer}
#${SWITCHER_ID} .switch-btn.active{background:#111;color:#fff;border-color:#111}
#${PRELOADER_ID}{display:none;align-items:center;justify-content:center;gap:.6rem;color:#fff;padding:8px 0}
#${PRELOADER_ID}.visible{display:flex}
#${PRELOADER_ID} .spinner{width:16px;height:16px;border:2px solid rgba(255,255,255,.3);border-top-color:#fff;border-radius:50%;animation:ts-spin .8s linear infinite}
@keyframes ts-spin{to{transform:rotate(360deg)}}
#${SECTION_ID}.not-ready .lte-swiper-slider-wrapper{visibility:hidden}
`;
const style = document.createElement('style');
style.textContent = css;
document.head.appendChild(style);
}
function getSwiperInstance() {
const wrapper = document.getElementById(WRAPPER_ID);
const swiperEl = wrapper && wrapper.closest('.swiper-container');
return swiperEl && swiperEl.swiper ? { el: swiperEl, api: swiperEl.swiper } : null;
}
function setupEndlessNavigation(swiperContainerEl) {
const inst = getSwiperInstance();
if (!inst) return;
const { el, api } = inst;
// Ensure only one set of arrows remains before binding
cleanupDuplicateArrows();
// Theme uses .lte-arrow-left / .lte-arrow-right (see frontend.js init)
let nextBtn = el.parentElement && el.parentElement.querySelector('.lte-arrows .lte-arrow-right');
let prevBtn = el.parentElement && el.parentElement.querySelector('.lte-arrows .lte-arrow-left');
// Fallback to common Swiper classes if theme structure changes
if (!nextBtn) nextBtn = el.querySelector('.swiper-button-next, .lte-swiper-button-next, .lte-next, .lte-arrow-next, .lte-arrow-right');
if (!prevBtn) prevBtn = el.querySelector('.swiper-button-prev, .lte-swiper-button-prev, .lte-prev, .lte-arrow-prev, .lte-arrow-left');
// Do not create fallback arrows; rely on theme arrows only
function bind(btn, dir) {
if (!btn || btn.dataset.tsBound) return;
btn.addEventListener('click', (e) => {
e.preventDefault();
if (!api) return;
// User override: pause and schedule resume
stopAutoScroll();
scheduleAutoResume();
if (dir === 'next') {
if (typeof api.slideNext === 'function') api.slideNext(400);
else api.slideTo((api.activeIndex || 0) + 1, 400, false);
} else {
if (typeof api.slidePrev === 'function') api.slidePrev(400);
else api.slideTo(Math.max((api.activeIndex || 0) - 1, 0), 400, false);
}
});
btn.dataset.tsBound = '1';
}
bind(nextBtn, 'next');
bind(prevBtn, 'prev');
// Hover pause/resume on the whole slider area
if (el && !el.__tsHoverBound) {
el.addEventListener('mouseenter', () => stopAutoScroll());
el.addEventListener('mouseleave', () => startAutoScroll());
el.__tsHoverBound = true;
}
}
function setupDragWrap(swiper) {
if (!swiper || !swiper.on) return;
if (!swiper.__tsWrapBound) {
swiper.on('reachEnd', () => { swiper.slideTo(0, 400, false); });
swiper.on('reachBeginning', () => {
const last = (swiper.slides && swiper.slides.length ? swiper.slides.length - 1 : 0);
swiper.slideTo(last, 400, false);
});
swiper.__tsWrapBound = true;
}
// Pause autoscroll on user touch/drag and schedule resume on release
if (!swiper.__tsAutoBound) {
try {
swiper.on('touchStart', () => { stopAutoScroll(); });
swiper.on('touchEnd', () => { scheduleAutoResume(); });
swiper.on('pointerDown', () => { stopAutoScroll(); });
swiper.on('pointerUp', () => { scheduleAutoResume(); });
} catch (_) {}
swiper.__tsAutoBound = true;
}
}
function startAutoScroll() {
const inst = getSwiperInstance();
if (!inst) return;
const { api } = inst;
stopAutoScroll();
autoTimer = window.setInterval(() => {
if (!api) return;
try {
// If not looping, wrap to first when at end
const loop = api.params && api.params.loop;
if (!loop && api.isEnd) {
api.slideTo(0, 600, false);
} else if (typeof api.slideNext === 'function') {
api.slideNext(600);
}
} catch (_) {}
}, AUTO_DELAY);
}
function stopAutoScroll() {
if (autoTimer) {
clearInterval(autoTimer);
autoTimer = null;
}
if (resumeTimer) {
clearTimeout(resumeTimer);
resumeTimer = null;
}
}
function scheduleAutoResume() {
if (resumeTimer) {
clearTimeout(resumeTimer);
resumeTimer = null;
}
resumeTimer = window.setTimeout(() => {
startAutoScroll();
}, RESUME_AFTER);
}
function showPreloader() {
const el = document.getElementById(PRELOADER_ID);
if (el) el.classList.add('visible');
}
function hidePreloader() {
const el = document.getElementById(PRELOADER_ID);
if (el) el.classList.remove('visible');
}
function markNotReady() {
const sec = document.getElementById(SECTION_ID);
if (sec) sec.classList.add('not-ready');
}
function markReady() {
const sec = document.getElementById(SECTION_ID);
if (sec) sec.classList.remove('not-ready');
}
document.addEventListener('DOMContentLoaded', () => {
ensureBasicStyles();
markNotReady();
showPreloader();
bindUI();
});
// Defer initial population until all assets and theme scripts (e.g., sliders) are fully initialized
window.addEventListener('load', () => {
switchGender(currentGender);
});
})();
+2
View File
@@ -0,0 +1,2 @@
/*! elementor - v3.20.0 - 13-03-2024 */
"use strict";(self.webpackChunkelementor=self.webpackChunkelementor||[]).push([[357],{1327:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;class TextEditor extends elementorModules.frontend.handlers.Base{getDefaultSettings(){return{selectors:{paragraph:"p:first"},classes:{dropCap:"elementor-drop-cap",dropCapLetter:"elementor-drop-cap-letter"}}}getDefaultElements(){const e=this.getSettings("selectors"),t=this.getSettings("classes"),r=jQuery("<span>",{class:t.dropCap}),p=jQuery("<span>",{class:t.dropCapLetter});return r.append(p),{$paragraph:this.$element.find(e.paragraph),$dropCap:r,$dropCapLetter:p}}wrapDropCap(){if(!this.getElementSettings("drop_cap"))return void(this.dropCapLetter&&(this.elements.$dropCap.remove(),this.elements.$paragraph.prepend(this.dropCapLetter),this.dropCapLetter=""));const e=this.elements.$paragraph;if(!e.length)return;const t=e.html().replace(/&nbsp;/g," "),r=t.match(/^ *([^ ] ?)/);if(!r)return;const p=r[1],s=p.trim();if("<"===s)return;this.dropCapLetter=p,this.elements.$dropCapLetter.text(s);const a=t.slice(p.length).replace(/^ */,(e=>new Array(e.length+1).join("&nbsp;")));e.html(a).prepend(this.elements.$dropCap)}onInit(){super.onInit(...arguments),this.wrapDropCap()}onElementChange(e){"drop_cap"===e&&this.wrapDropCap()}}t.default=TextEditor}}]);
+11
View File
@@ -0,0 +1,11 @@
/**
* This JS file was auto-generated via Terser.
*
* Contributors should avoid editing this file, but instead edit the associated
* non minified file file. For more information, check out our engineering docs
* on how we handle JS minification in our engineering docs.
*
* @see: https://evnt.is/dev-docs-minification
*/
var tribe_ticket_details=tribe_ticket_details||{};!function($,obj){"use strict";var $document=$(document);obj.init=function(detailsElems){obj.event_listeners()},obj.selectors=[".tribe-tickets__item__details__summary--more",".tribe-tickets__item__details__summary--less"],obj.event_listeners=function(){$document.on("keyup",obj.selectors,(function(event){13===event.keyCode&&obj.toggle_open(event.target)})),$document.on("click",obj.selectors,(function(event){obj.toggle_open(event.target)}))},obj.toggle_open=function(trigger){if(trigger){var $trigger=$(trigger);if($trigger.hasClass("tribe-tickets__item__details__summary--more")||$trigger.hasClass("tribe-tickets__item__details__summary--less")){var $parent=$trigger.closest(".tribe-tickets__item__details__summary"),$target=$("#"+$trigger.attr("aria-controls"));if($target&&$parent){event.preventDefault();var onOff=!$parent.hasClass("tribe__details--open");$parent.toggleClass("tribe__details--open",onOff),$target.toggleClass("tribe__details--open",onOff)}}}},$((function(){var detailsElems=document.querySelectorAll(".tribe-tickets__item__details__summary");detailsElems.length&&obj.init(detailsElems)}))}(jQuery,tribe_ticket_details);
+172
View File
@@ -0,0 +1,172 @@
'use strict';
(function(){
function h(el, attrs={}, children=[]) {
const e = document.createElement(el);
for (const [k,v] of Object.entries(attrs||{})) {
if (k === 'class') e.className = v; else if (k === 'html') e.innerHTML = v; else e.setAttribute(k, v);
}
for (const c of (children||[])) e.appendChild(c);
return e;
}
function ytUrl(videoId){
return 'https://www.youtube.com/watch?v=' + videoId;
}
// Convert common English relative time strings to Czech
function enRelativeToCz(s) {
if (!s || typeof s !== 'string') return s;
const t = s.trim().toLowerCase();
if (t === 'just now') return 'právě teď';
// minutes
let m = t.match(/^(\d+)\s+minute(s)?\s+ago$/);
if (m) {
const n = parseInt(m[1], 10);
return n === 1 ? 'před 1 minutou' : `před ${n} minutami`;
}
// hours
m = t.match(/^(\d+)\s+hour(s)?\s+ago$/);
if (m) {
const n = parseInt(m[1], 10);
return n === 1 ? 'před 1 hodinou' : `před ${n} hodinami`;
}
// days
m = t.match(/^(\d+)\s+day(s)?\s+ago$/);
if (m) {
const n = parseInt(m[1], 10);
return n === 1 ? 'před 1 dnem' : `před ${n} dny`;
}
// weeks
m = t.match(/^(\d+)\s+week(s)?\s+ago$/);
if (m) {
const n = parseInt(m[1], 10);
return n === 1 ? 'před 1 týdnem' : `před ${n} týdny`;
}
// months
m = t.match(/^(\d+)\s+month(s)?\s+ago$/);
if (m) {
const n = parseInt(m[1], 10);
return n === 1 ? 'před 1 měsícem' : `před ${n} měsíci`;
}
// years
m = t.match(/^(\d+)\s+year(s)?\s+ago$/);
if (m) {
const n = parseInt(m[1], 10);
return n === 1 ? 'před 1 rokem' : `před ${n} lety`;
}
return s; // fallback unchanged
}
function renderFeatured(v) {
const article = h('article', {class: 'post format-video has-post-thumbnail hentry'});
const wrap = h('div', {class: 'lte-wrapper'});
const a = h('a', {href: ytUrl(v.video_id), target: '_blank', class: 'lte-photo lte-video-popup swipebox'});
const img = h('img', {loading: 'lazy', decoding: 'async', width: '1600', height: '969', src: v.thumbnail_url, class: 'attachment-full size-full wp-post-image', alt: ''});
const iconWrap = h('span', {class: 'lte-icon-video'});
iconWrap.appendChild(h('ion-icon', {name: 'play-circle-outline', size: 'large'}));
iconWrap.appendChild(h('span', {html: v.length || ''}));
a.appendChild(img);
a.appendChild(iconWrap);
wrap.appendChild(a);
const descr = h('div', {class: 'lte-description'});
const dateTop = h('span', {class: 'lte-date-top'});
const dateA = h('a', {href: '', class: 'lte-date'});
const relText = enRelativeToCz(v.published_text || '') || v.published_date || '';
dateA.appendChild(h('span', {class: 'dt', html: relText}));
dateTop.appendChild(dateA);
const headerA = h('a', {href: ytUrl(v.video_id), class: 'lte-header', target: '_blank'});
headerA.appendChild(h('h3', {html: v.title || ''}));
descr.appendChild(dateTop);
descr.appendChild(headerA);
// keep layout spacing consistent
descr.appendChild(h('div', {class: 'lte-excerpt'}));
article.appendChild(wrap);
article.appendChild(descr);
return article;
}
function renderGridItem(v){
const col = h('div', {class: 'items col-xl-6 col-lg-6 col-md-6 col-sm-6 col-ms-12 col-xs-12'});
const article = h('article', {class: 'post format-video has-post-thumbnail hentry'});
const wrap = h('div', {class: 'lte-wrapper'});
const a = h('a', {href: ytUrl(v.video_id), target: '_blank', class: 'lte-photo lte-video-popup swipebox'});
const img = h('img', {loading: 'lazy', decoding: 'async', width: '1600', height: '969', src: v.thumbnail_url, class: 'attachment-full size-full wp-post-image', alt: ''});
const iconWrap = h('span', {class: 'lte-icon-video'});
iconWrap.appendChild(h('ion-icon', {name: 'play-circle-outline', size: 'large'}));
iconWrap.appendChild(h('span', {html: v.length || ''}));
a.appendChild(img);
a.appendChild(iconWrap);
wrap.appendChild(a);
const descr = h('div', {class: 'lte-description'});
const dateTop = h('span', {class: 'lte-date-top'});
const dateA = h('a', {href: '', class: 'lte-date'});
const relText2 = enRelativeToCz(v.published_text || '') || v.published_date || '';
dateA.appendChild(h('span', {class: 'dt', html: relText2}));
dateTop.appendChild(dateA);
const headerA = h('a', {href: ytUrl(v.video_id), class: 'lte-header', target: '_blank'});
headerA.appendChild(h('h3', {html: v.title || ''}));
descr.appendChild(dateTop);
descr.appendChild(headerA);
// keep layout spacing consistent
descr.appendChild(h('div', {class: 'lte-excerpt'}));
article.appendChild(wrap);
article.appendChild(descr);
col.appendChild(article);
return col;
}
async function loadVideos(){
const featureMount = document.getElementById('latest-video-feature');
const gridMount = document.getElementById('latest-videos-grid');
if (!featureMount && !gridMount) return;
if (featureMount) featureMount.innerHTML = '<div style="width:100%;text-align:center;padding:12px;color:#888;">Načítání…</div>';
if (gridMount) gridMount.innerHTML = '';
try {
// Try fast local JSON first
let data = null;
const tryUrls = ['/data/video.json', '/data/videos.json', '/api/videos/latest'];
for (const u of tryUrls){
try {
const res = await fetch(u, {credentials: 'omit', cache: 'no-store'});
if (res.ok) { data = await res.json(); break; }
} catch (_) {}
}
if (!data) throw new Error('No videos data available');
let items = Array.isArray(data.items) ? data.items : data.Items || [];
// ensure most recent first: sort by published_date or published_text desc
const parseDate = (v) => {
const s = v && (v.published_date || v.published_text || '').trim();
// try ISO/date parsing
const t = Date.parse(s);
return isNaN(t) ? 0 : t;
};
items = items.slice().sort((a,b) => parseDate(b) - parseDate(a));
if (featureMount) featureMount.innerHTML = '';
if (!items || items.length === 0){
if (featureMount) featureMount.innerHTML = '<div style="width:100%;text-align:center;padding:12px;color:#888;">Žádná videa zatím nejsou.</div>';
return;
}
const [first, ...rest] = items;
if (featureMount && first) {
const container = document.createElement('div');
container.className = 'items col-xl-12 col-lg-12 col-md-12 col-sm-12 col-ms-12 col-xs-12';
container.appendChild(renderFeatured(first));
featureMount.appendChild(container);
}
if (gridMount && rest.length){
const frag = document.createDocumentFragment();
rest.forEach(v => frag.appendChild(renderGridItem(v)));
gridMount.appendChild(frag);
}
} catch (e) {
console.error('videos load error', e);
if (featureMount) featureMount.innerHTML = '<div style="width:100%;text-align:center;padding:12px;color:#c00;">Nepodařilo se načíst videa.</div>';
}
}
if (document.readyState === 'loading') {
document.addEventListener('DOMContentLoaded', loadVideos);
} else {
loadVideos();
}
})();
+444
View File
@@ -0,0 +1,444 @@
// Generated by CoffeeScript 1.6.2
/*!
jQuery Waypoints - v2.0.5
Copyright (c) 2011-2014 Caleb Troughton
Licensed under the MIT license.
https://github.com/imakewebthings/jquery-waypoints/blob/master/licenses.txt
*/
(function () {
var t =
[].indexOf ||
function (t) {
for (var e = 0, n = this.length; e < n; e++) {
if (e in this && this[e] === t) return e;
}
return -1;
},
e = [].slice;
(function (t, e) {
if (typeof define === "function" && define.amd) {
return define("waypoints", ["jquery"], function (n) {
return e(n, t);
});
} else {
return e(t.jQuery, t);
}
})(window, function (n, r) {
var i, o, l, s, f, u, c, a, h, d, p, y, v, w, g, m;
i = n(r);
a = t.call(r, "ontouchstart") >= 0;
s = { horizontal: {}, vertical: {} };
f = 1;
c = {};
u = "waypoints-context-id";
p = "resize.waypoints";
y = "scroll.waypoints";
v = 1;
w = "waypoints-waypoint-ids";
g = "waypoint";
m = "waypoints";
o = (function () {
function t(t) {
var e = this;
this.$element = t;
this.element = t[0];
this.didResize = false;
this.didScroll = false;
this.id = "context" + f++;
this.oldScroll = { x: t.scrollLeft(), y: t.scrollTop() };
this.waypoints = { horizontal: {}, vertical: {} };
this.element[u] = this.id;
c[this.id] = this;
t.bind(y, function () {
var t;
if (!(e.didScroll || a)) {
e.didScroll = true;
t = function () {
e.doScroll();
return (e.didScroll = false);
};
return r.setTimeout(t, n[m].settings.scrollThrottle);
}
});
t.bind(p, function () {
var t;
if (!e.didResize) {
e.didResize = true;
t = function () {
n[m]("refresh");
return (e.didResize = false);
};
return r.setTimeout(t, n[m].settings.resizeThrottle);
}
});
}
t.prototype.doScroll = function () {
var t,
e = this;
t = {
horizontal: { newScroll: this.$element.scrollLeft(), oldScroll: this.oldScroll.x, forward: "right", backward: "left" },
vertical: { newScroll: this.$element.scrollTop(), oldScroll: this.oldScroll.y, forward: "down", backward: "up" },
};
if (a && (!t.vertical.oldScroll || !t.vertical.newScroll)) {
n[m]("refresh");
}
n.each(t, function (t, r) {
var i, o, l;
l = [];
o = r.newScroll > r.oldScroll;
i = o ? r.forward : r.backward;
n.each(e.waypoints[t], function (t, e) {
var n, i;
if (r.oldScroll < (n = e.offset) && n <= r.newScroll) {
return l.push(e);
} else if (r.newScroll < (i = e.offset) && i <= r.oldScroll) {
return l.push(e);
}
});
l.sort(function (t, e) {
return t.offset - e.offset;
});
if (!o) {
l.reverse();
}
return n.each(l, function (t, e) {
if (e.options.continuous || t === l.length - 1) {
return e.trigger([i]);
}
});
});
return (this.oldScroll = { x: t.horizontal.newScroll, y: t.vertical.newScroll });
};
t.prototype.refresh = function () {
var t,
e,
r,
i = this;
r = n.isWindow(this.element);
e = this.$element.offset();
this.doScroll();
t = {
horizontal: { contextOffset: r ? 0 : e.left, contextScroll: r ? 0 : this.oldScroll.x, contextDimension: this.$element.width(), oldScroll: this.oldScroll.x, forward: "right", backward: "left", offsetProp: "left" },
vertical: {
contextOffset: r ? 0 : e.top,
contextScroll: r ? 0 : this.oldScroll.y,
contextDimension: r ? n[m]("viewportHeight") : this.$element.height(),
oldScroll: this.oldScroll.y,
forward: "down",
backward: "up",
offsetProp: "top",
},
};
return n.each(t, function (t, e) {
return n.each(i.waypoints[t], function (t, r) {
var i, o, l, s, f;
i = r.options.offset;
l = r.offset;
o = n.isWindow(r.element) ? 0 : r.$element.offset()[e.offsetProp];
if (n.isFunction(i)) {
i = i.apply(r.element);
} else if (typeof i === "string") {
i = parseFloat(i);
if (r.options.offset.indexOf("%") > -1) {
i = Math.ceil((e.contextDimension * i) / 100);
}
}
r.offset = o - e.contextOffset + e.contextScroll - i;
if ((r.options.onlyOnScroll && l != null) || !r.enabled) {
return;
}
if (l !== null && l < (s = e.oldScroll) && s <= r.offset) {
return r.trigger([e.backward]);
} else if (l !== null && l > (f = e.oldScroll) && f >= r.offset) {
return r.trigger([e.forward]);
} else if (l === null && e.oldScroll >= r.offset) {
return r.trigger([e.forward]);
}
});
});
};
t.prototype.checkEmpty = function () {
if (n.isEmptyObject(this.waypoints.horizontal) && n.isEmptyObject(this.waypoints.vertical)) {
this.$element.unbind([p, y].join(" "));
return delete c[this.id];
}
};
return t;
})();
l = (function () {
function t(t, e, r) {
var i, o;
if (r.offset === "bottom-in-view") {
r.offset = function () {
var t;
t = n[m]("viewportHeight");
if (!n.isWindow(e.element)) {
t = e.$element.height();
}
return t - n(this).outerHeight();
};
}
this.$element = t;
this.element = t[0];
this.axis = r.horizontal ? "horizontal" : "vertical";
this.callback = r.handler;
this.context = e;
this.enabled = r.enabled;
this.id = "waypoints" + v++;
this.offset = null;
this.options = r;
e.waypoints[this.axis][this.id] = this;
s[this.axis][this.id] = this;
i = (o = this.element[w]) != null ? o : [];
i.push(this.id);
this.element[w] = i;
}
t.prototype.trigger = function (t) {
if (!this.enabled) {
return;
}
if (this.callback != null) {
this.callback.apply(this.element, t);
}
if (this.options.triggerOnce) {
return this.destroy();
}
};
t.prototype.disable = function () {
return (this.enabled = false);
};
t.prototype.enable = function () {
this.context.refresh();
return (this.enabled = true);
};
t.prototype.destroy = function () {
delete s[this.axis][this.id];
delete this.context.waypoints[this.axis][this.id];
return this.context.checkEmpty();
};
t.getWaypointsByElement = function (t) {
var e, r;
r = t[w];
if (!r) {
return [];
}
e = n.extend({}, s.horizontal, s.vertical);
return n.map(r, function (t) {
return e[t];
});
};
return t;
})();
d = {
init: function (t, e) {
var r;
e = n.extend({}, n.fn[g].defaults, e);
if ((r = e.handler) == null) {
e.handler = t;
}
this.each(function () {
var t, r, i, s;
t = n(this);
i = (s = e.context) != null ? s : n.fn[g].defaults.context;
if (!n.isWindow(i)) {
i = t.closest(i);
}
i = n(i);
r = c[i[0][u]];
if (!r) {
r = new o(i);
}
return new l(t, r, e);
});
n[m]("refresh");
return this;
},
disable: function () {
return d._invoke.call(this, "disable");
},
enable: function () {
return d._invoke.call(this, "enable");
},
destroy: function () {
return d._invoke.call(this, "destroy");
},
prev: function (t, e) {
return d._traverse.call(this, t, e, function (t, e, n) {
if (e > 0) {
return t.push(n[e - 1]);
}
});
},
next: function (t, e) {
return d._traverse.call(this, t, e, function (t, e, n) {
if (e < n.length - 1) {
return t.push(n[e + 1]);
}
});
},
_traverse: function (t, e, i) {
var o, l;
if (t == null) {
t = "vertical";
}
if (e == null) {
e = r;
}
l = h.aggregate(e);
o = [];
this.each(function () {
var e;
e = n.inArray(this, l[t]);
return i(o, e, l[t]);
});
return this.pushStack(o);
},
_invoke: function (t) {
this.each(function () {
var e;
e = l.getWaypointsByElement(this);
return n.each(e, function (e, n) {
n[t]();
return true;
});
});
return this;
},
};
n.fn[g] = function () {
var t, r;
(r = arguments[0]), (t = 2 <= arguments.length ? e.call(arguments, 1) : []);
if (d[r]) {
return d[r].apply(this, t);
} else if (n.isFunction(r)) {
return d.init.apply(this, arguments);
} else if (n.isPlainObject(r)) {
return d.init.apply(this, [null, r]);
} else if (!r) {
return n.error("jQuery Waypoints needs a callback function or handler option.");
} else {
return n.error("The " + r + " method does not exist in jQuery Waypoints.");
}
};
n.fn[g].defaults = { context: r, continuous: true, enabled: true, horizontal: false, offset: 0, triggerOnce: false };
h = {
refresh: function () {
return n.each(c, function (t, e) {
return e.refresh();
});
},
viewportHeight: function () {
var t;
return (t = r.innerHeight) != null ? t : i.height();
},
aggregate: function (t) {
var e, r, i;
e = s;
if (t) {
e = (i = c[n(t)[0][u]]) != null ? i.waypoints : void 0;
}
if (!e) {
return [];
}
r = { horizontal: [], vertical: [] };
n.each(r, function (t, i) {
n.each(e[t], function (t, e) {
return i.push(e);
});
i.sort(function (t, e) {
return t.offset - e.offset;
});
r[t] = n.map(i, function (t) {
return t.element;
});
return (r[t] = n.unique(r[t]));
});
return r;
},
above: function (t) {
if (t == null) {
t = r;
}
return h._filter(t, "vertical", function (t, e) {
return e.offset <= t.oldScroll.y;
});
},
below: function (t) {
if (t == null) {
t = r;
}
return h._filter(t, "vertical", function (t, e) {
return e.offset > t.oldScroll.y;
});
},
left: function (t) {
if (t == null) {
t = r;
}
return h._filter(t, "horizontal", function (t, e) {
return e.offset <= t.oldScroll.x;
});
},
right: function (t) {
if (t == null) {
t = r;
}
return h._filter(t, "horizontal", function (t, e) {
return e.offset > t.oldScroll.x;
});
},
enable: function () {
return h._invoke("enable");
},
disable: function () {
return h._invoke("disable");
},
destroy: function () {
return h._invoke("destroy");
},
extendFn: function (t, e) {
return (d[t] = e);
},
_invoke: function (t) {
var e;
e = n.extend({}, s.vertical, s.horizontal);
return n.each(e, function (e, n) {
n[t]();
return true;
});
},
_filter: function (t, e, r) {
var i, o;
i = c[n(t)[0][u]];
if (!i) {
return [];
}
o = [];
n.each(i.waypoints[e], function (t, e) {
if (r(i, e)) {
return o.push(e);
}
});
o.sort(function (t, e) {
return t.offset - e.offset;
});
return n.map(o, function (t) {
return t.element;
});
},
};
n[m] = function () {
var t, n;
(n = arguments[0]), (t = 2 <= arguments.length ? e.call(arguments, 1) : []);
if (h[n]) {
return h[n].apply(null, t);
} else {
return h.aggregate.call(null, n);
}
};
n[m].settings = { resizeThrottle: 100, scrollThrottle: 30 };
return i.on("load.waypoints", function () {
return n[m]("refresh");
});
});
}.call(this));
+1
View File
File diff suppressed because one or more lines are too long
+2
View File
@@ -0,0 +1,2 @@
/*! elementor - v3.20.0 - 13-03-2024 */
(()=>{"use strict";var e,r,_,t,a,i={},n={};function __webpack_require__(e){var r=n[e];if(void 0!==r)return r.exports;var _=n[e]={exports:{}};return i[e].call(_.exports,_,_.exports,__webpack_require__),_.exports}__webpack_require__.m=i,e=[],__webpack_require__.O=(r,_,t,a)=>{if(!_){var i=1/0;for(u=0;u<e.length;u++){for(var[_,t,a]=e[u],n=!0,c=0;c<_.length;c++)(!1&a||i>=a)&&Object.keys(__webpack_require__.O).every((e=>__webpack_require__.O[e](_[c])))?_.splice(c--,1):(n=!1,a<i&&(i=a));if(n){e.splice(u--,1);var o=t();void 0!==o&&(r=o)}}return r}a=a||0;for(var u=e.length;u>0&&e[u-1][2]>a;u--)e[u]=e[u-1];e[u]=[_,t,a]},_=Object.getPrototypeOf?e=>Object.getPrototypeOf(e):e=>e.__proto__,__webpack_require__.t=function(e,t){if(1&t&&(e=this(e)),8&t)return e;if("object"==typeof e&&e){if(4&t&&e.__esModule)return e;if(16&t&&"function"==typeof e.then)return e}var a=Object.create(null);__webpack_require__.r(a);var i={};r=r||[null,_({}),_([]),_(_)];for(var n=2&t&&e;"object"==typeof n&&!~r.indexOf(n);n=_(n))Object.getOwnPropertyNames(n).forEach((r=>i[r]=()=>e[r]));return i.default=()=>e,__webpack_require__.d(a,i),a},__webpack_require__.d=(e,r)=>{for(var _ in r)__webpack_require__.o(r,_)&&!__webpack_require__.o(e,_)&&Object.defineProperty(e,_,{enumerable:!0,get:r[_]})},__webpack_require__.f={},__webpack_require__.e=e=>Promise.all(Object.keys(__webpack_require__.f).reduce(((r,_)=>(__webpack_require__.f[_](e,r),r)),[])),__webpack_require__.u=e=>723===e?"lightbox.1b6e05e0607040eb8929.bundle.min.js":48===e?"text-path.b50b3e74488a4e302613.bundle.min.js":209===e?"accordion.8799675460c73eb48972.bundle.min.js":745===e?"alert.cbc2a0fee74ee3ed0419.bundle.min.js":120===e?"counter.02cef29c589e742d4c8c.bundle.min.js":192===e?"progress.ca55d33bb06cee4e6f02.bundle.min.js":520===e?"tabs.c2af5be7f9cb3cdcf3d5.bundle.min.js":181===e?"toggle.31881477c45ff5cf9d4d.bundle.min.js":791===e?"video.fea4f8dfdf17262f23e8.bundle.min.js":268===e?"image-carousel.4455c6362492d9067512.bundle.min.js":357===e?"text-editor.2c35aafbe5bf0e127950.bundle.min.js":52===e?"wp-audio.75f0ced143febb8cd31a.bundle.min.js":413===e?"container.c65a2a923085e1120e75.bundle.min.js":void 0,__webpack_require__.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),__webpack_require__.o=(e,r)=>Object.prototype.hasOwnProperty.call(e,r),t={},a="elementor:",__webpack_require__.l=(e,r,_,i)=>{if(t[e])t[e].push(r);else{var n,c;if(void 0!==_)for(var o=document.getElementsByTagName("script"),u=0;u<o.length;u++){var b=o[u];if(b.getAttribute("src")==e||b.getAttribute("data-webpack")==a+_){n=b;break}}n||(c=!0,(n=document.createElement("script")).charset="utf-8",n.timeout=120,__webpack_require__.nc&&n.setAttribute("nonce",__webpack_require__.nc),n.setAttribute("data-webpack",a+_),n.src=e),t[e]=[r];var onScriptComplete=(r,_)=>{n.onerror=n.onload=null,clearTimeout(p);var a=t[e];if(delete t[e],n.parentNode&&n.parentNode.removeChild(n),a&&a.forEach((e=>e(_))),r)return r(_)},p=setTimeout(onScriptComplete.bind(null,void 0,{type:"timeout",target:n}),12e4);n.onerror=onScriptComplete.bind(null,n.onerror),n.onload=onScriptComplete.bind(null,n.onload),c&&document.head.appendChild(n)}},__webpack_require__.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},(()=>{var e;__webpack_require__.g.importScripts&&(e=__webpack_require__.g.location+"");var r=__webpack_require__.g.document;if(!e&&r&&(r.currentScript&&(e=r.currentScript.src),!e)){var _=r.getElementsByTagName("script");if(_.length)for(var t=_.length-1;t>-1&&!e;)e=_[t--].src}if(!e)throw new Error("Automatic publicPath is not supported in this browser");e=e.replace(/#.*$/,"").replace(/\?.*$/,"").replace(/\/[^\/]+$/,"/"),__webpack_require__.p=e})(),(()=>{var e={162:0};__webpack_require__.f.j=(r,_)=>{var t=__webpack_require__.o(e,r)?e[r]:void 0;if(0!==t)if(t)_.push(t[2]);else if(162!=r){var a=new Promise(((_,a)=>t=e[r]=[_,a]));_.push(t[2]=a);var i=__webpack_require__.p+__webpack_require__.u(r),n=new Error;__webpack_require__.l(i,(_=>{if(__webpack_require__.o(e,r)&&(0!==(t=e[r])&&(e[r]=void 0),t)){var a=_&&("load"===_.type?"missing":_.type),i=_&&_.target&&_.target.src;n.message="Loading chunk "+r+" failed.\n("+a+": "+i+")",n.name="ChunkLoadError",n.type=a,n.request=i,t[1](n)}}),"chunk-"+r,r)}else e[r]=0},__webpack_require__.O.j=r=>0===e[r];var webpackJsonpCallback=(r,_)=>{var t,a,[i,n,c]=_,o=0;if(i.some((r=>0!==e[r]))){for(t in n)__webpack_require__.o(n,t)&&(__webpack_require__.m[t]=n[t]);if(c)var u=c(__webpack_require__)}for(r&&r(_);o<i.length;o++)a=i[o],__webpack_require__.o(e,a)&&e[a]&&e[a][0](),e[a]=0;return __webpack_require__.O(u)},r=self.webpackChunkelementor=self.webpackChunkelementor||[];r.forEach(webpackJsonpCallback.bind(null,0)),r.push=webpackJsonpCallback.bind(null,r.push.bind(r))})()})();