1jQuery(document).ready(function($) { 2 3 let scrollAmount = 0; 4 const items = $('.event-block').length; // PoÄet akcà 5 6 // ZÃskánà poÄtu akcà na základÄ Å¡ÃÅky obrazovky 7 function getScrollStep() { 8 const windowWidth = $(window).width(); 9 if (windowWidth <= 768) { 10 return 100; // Mobil - posun o 50% (2 akce) 11 } else if (windowWidth <= 1024) { 12 return 33.33; // Tablet - posun o 33.33% (3 akce) 13 } else { 14 return 20; // PC - posun o 20% (5 akcÃ) 15 } 16 } 17 18 let currentSlide = 0; // PoÄáteÄnà pozice 19 const totalSlides = items - visibleItems; // Celkový poÄet posunů // Celkový poÄet posuvů, pokud zobrazujete 5 akcà najednou 20 console.log('Celkem posunu: ' + totalSlides); 21 // Kontrola, zda je otevÅený prvek 22 function isElementOpen() { 23 return $('.event-block.openElement').length > 0; 24 } 25 26 27 function updateShrinkElements() { 28 const visibleStart = currentSlide; // Prvnà viditelný prvek 29 const visibleEnd = currentSlide + getScrollStep(); // Poslednà viditelný prvek 30 31 // Projdeme vÅ¡echny eventy a aplikujeme shrink pouze tÄm, které jsou ve viditelném rozmezà 32 $('.event-block').each(function(index) { 33 if (index >= visibleStart && index < visibleEnd) { 34 // Tento prvek je viditelný, aplikujeme shrinkElement 35 $(this).removeClass('openElement').addClass('shrinkElement'); 36 } else { 37 // Tento prvek je mimo zorné pole, odstranÃme shrinkElement 38 $(this).removeClass('shrinkElement'); 39 } 40 }); 41 } 42 43 // Skrytà šipek pÅi otevÅenà akce 44 function toggleArrows() { 45 if (isElementOpen()) { 46 $('.arrow-left, .arrow-right').hide(); // Skryjeme Å¡ipky, když je prvek otevÅený 47 } else { 48 $('.arrow-left, .arrow-right').show(); // Znovu zobrazÃme Å¡ipky, když je vÅ¡e zavÅené 49 } 50 } 51 52 // Posun doprava 53 $('.arrow-right').click(function() { 54 if (isElementOpen()) return; // Zablokujeme posun, pokud je nÄco otevÅené 55 56 const scrollStep = getScrollStep(); 57 currentSlide++; 58 59 if (currentSlide > totalSlides) { 60 currentSlide = 0; 61 } 62 63 $('.sppb-row').css('left', '-' + (currentSlide * scrollStep) + '%'); 64 }); 65 66 // Posun doleva 67 $('.arrow-left').click(function() { 68 if (isElementOpen()) return; // Zablokujeme posun, pokud je nÄco otevÅené 69 70 const scrollStep = getScrollStep(); 71 currentSlide--; 72 73 if (currentSlide < 0) { 74 currentSlide = totalSlides; 75 } 76 77 $('.sppb-row').css('left', '-' + (currentSlide * scrollStep) + '%'); 78 }); 79/* 80 var windowWidth1 = window.innerWidth; 81 if (windowWidth1 <= 768) { 82 // PÅidánà podpory pro swipe gesta 83 $('.sppb-row').swipe({ 84 swipeLeft: function() { 85 if (isElementOpen()) return; // Zablokujeme posun, pokud je nÄco otevÅené 86 87 const scrollStep = 100; 88 console.log('Swipe left - scrollStep:', scrollStep, 'currentSlide:', currentSlide); 89 currentSlide++; 90 91 if (currentSlide > totalSlides) { 92 currentSlide = 0; 93 } 94 95 $('.sppb-row').css('left', '-' + (currentSlide * scrollStep) + '%'); 96 }, 97 swipeRight: function() { 98 if (isElementOpen()) return; // Zablokujeme posun, pokud je nÄco otevÅené 99 100 const scrollStep = getScrollStep(); 101 console.log('Swipe right - scrollStep:', scrollStep, 'currentSlide:', currentSlide); 102 currentSlide--; 103 104 if (currentSlide < 0) { 105 currentSlide = totalSlides; 106 } 107 108 $('.sppb-row').css('left', '-' + (currentSlide * scrollStep) + '%'); 109 }, 110 threshold: 75 // Nastavenà citlivosti na swipe 111 }); 112 } 113*/ 114 // ZajiÅ¡tÄnà resetovánà pozice pÅi zmÄnÄ velikosti okna 115 $(window).resize(function() { 116 scrollAmount = 0; 117 $('.sppb-row').css('transform', 'translateX(0)'); 118 }); 119 120 // SpustÃme tuto funkci pokaždé, když se nÄco otevÅe nebo se carousel posune 121 $('.event-block').on('click', function() { 122 if (!$(this).hasClass('openElement')) { 123 // Aktualizujeme viditelné prvky 124 updateShrinkElements(); 125 126 // NastavÃme otevÅenà aktuálnÃho prvku 127 $(this).removeClass('shrinkElement').addClass('openElement'); 128 toggleArrows(); 129 } 130 }); 131 132 // Kliknutà na zavÃracà tlaÄÃtko zavÅe detaily 133 $('.close-btn').on('click', function(e) { 134 e.stopPropagation(); // Zabránà kliknutà na celý blok 135 // ZavÅeme otevÅený blok 136 $(this).closest('.event-block').removeClass('openElement').addClass('shrinkElement'); 137 toggleArrows(); 138 139 // OdstranÃme shrinkElement z ostatnÃch bloků a vrátÃme je na původnà velikost 140 $('.event-block').removeClass('shrinkElement'); 141 }); 142 143}); 144 145jQuery(document).ready(function($) { 146 // Funkce, která zjistà výšku obrázku a použije ji jako výšku pro .event-details 147 function updateEventDetailsHeight(block) { 148 var imgHeight = block.find('.images-wrap > img').height(); // ZÃskánà výšky obrázku 149 block.find('.event-details').css('height', imgHeight + 'px'); // Nastavà výšku na event-details 150 } 151 152});
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.