1(function ($) { 2 3 "use strict"; 4 5 //sticky menu 6 //--------------------------------------------------------------------------- 7 var wind = $(window); 8 var sticky = $("#header-sticky"); 9 wind.on('scroll', function () { 10 var scroll = $(wind).scrollTop(); 11 if (scroll < 50) { 12 sticky.removeClass("sticky-menu"); 13 } else { 14 $("#header-sticky").addClass("sticky-menu"); 15 } 16 }); 17 18 19 // mobile-menu-sidebar 20 //--------------------------------------------------------------------------- 21 $(".mobile-menubar").on("click", function () { 22 $(".side-mobile-menu").addClass('open-menubar'); 23 $(".body-overlay").addClass("opened"); 24 }); 25 $(".close-icon").click(function () { 26 $(".side-mobile-menu").removeClass('open-menubar'); 27 $(".body-overlay").removeClass("opened"); 28 }); 29 30 $(".body-overlay").on("click", function () { 31 $(".side-mobile-menu").removeClass('open-menubar'); 32 $(".body-overlay").removeClass("opened"); 33 }); 34 35 36 // background image 37 //--------------------------------------------------------------------------- 38 $("[data-background]").each(function () { 39 $(this).css("background-image", "url('" + $(this).attr("data-background") + "')"); 40 }); 41 42 // Countdown 43 //--------------------------------------------------------------------------- 44 $('[data-countdown]').each(function () { 45 var $this = $(this), finalDate = $(this).data('countdown'); 46 $this.countdown(finalDate, function (event) { 47 $this.html(event.strftime('<span class="cdown days"><span class="time-count">%-D</span> <p>Days</p></span> <span class="cdown hour"><span class="time-count">%-H</span> <p>Hour</p></span> <span class="cdown minutes"><span class="time-count">%M</span> <p>Min</p></span> <span class="cdown second"> <span><span class="time-count">%S</span> <p>Sec</p></span>')); 48 }); 49 }); 50 51 // back top 52 //--------------------------------------------------------------------------- 53 $(window).on("scroll", function () { 54 $(window).scrollTop() > 350 ? $(".top").fadeIn(650) : $(".top").fadeOut(550); 55 }), $(".top").on("click", function () { 56 $("html,body").animate({ 57 scrollTop: 0 58 }); 59 }); 60 //--------------------------------------------------------------------------- 61 62 $(window).load(function () { 63 // for show menu---------- 64 $('.mean-nav ul:first-child').css('display', 'block'); 65 // $('.mean-nav ul:first-child').show(); 66 }) 67 68 69 //questa funzione serve a vedere se si entra in una sezione specifica in maniera tale da poter avviare un'eventuale animazione 70 function isOnScreen(elem) { 71 // if the element doesn't exist, abort 72 if (elem.length == 0) { 73 return; 74 } 75 var $window = $(window) 76 var viewport_top = $window.scrollTop() 77 var viewport_height = $window.height() 78 var viewport_bottom = viewport_top + viewport_height 79 var $elem = $(elem) 80 var top = $elem.offset().top 81 var height = $elem.height() 82 var bottom = top + height 83 84 //console.log(top, bottom, height, viewport_top, viewport_bottom, viewport_height) 85 86 //console.log((top >= viewport_top && top < viewport_bottom), 87 // (bottom > viewport_top && bottom <= viewport_bottom), 88 // (height > viewport_height && top <= viewport_top && bottom >= viewport_bottom)) 89 90 return (top >= viewport_top && top < viewport_bottom) || 91 (bottom > viewport_top && bottom <= viewport_bottom) || 92 (height > viewport_height && top <= viewport_top && bottom >= viewport_bottom) 93 } 94 95 var i; 96 for (i = 1; i <= 6; i++) { 97 $('#box-valori-' + i).hide(); 98 } 99 100 var z; 101 for (z = 1; z <= 4; z++) { 102 $('.igold-mobile-' + z).hide().css('margin-left', '-30px'); 103 } 104 105 if (isOnScreen($('.primo-fuoricampo'))) { 106 setTimeout(function () { 107 $('.level_1').fadeTo(2000, 1) 108 }, 0 109 ); 110 setTimeout(function () { 111 $('.level_2').fadeTo(2000, 1) 112 }, 750 113 ); 114 setTimeout(function () { 115 $('.introduzione').fadeTo(2000, 1) 116 }, 1500 117 ); 118 } 119 120 if (isOnScreen($('.zero-fuoricampo'))) { 121 console.log('zero-fuoricampo on screen'); 122 setTimeout(function () { 123 $('.level_1').fadeTo(2000, 1) 124 }, 1500 125 ); 126 setTimeout(function () { 127 $('.level_2').fadeTo(2000, 1) 128 }, 2000 129 ); 130 setTimeout(function () { 131 $('.introduzione').fadeTo(2000, 1) 132 }, 3000 133 ); 134 } 135 136 137 window.addEventListener('scroll', function (e) { 138 139 if (isOnScreen($('#container-valori'))) { 140 var timeout = 1500, i; 141 for (i = 1; i <= 6; i++) { 142 $('#box-valori-' + i).fadeIn(timeout); 143 timeout += 1500; 144 } 145 } 146 147 if (isOnScreen($('#container-mobile'))) { 148 var timeout = 1000, z; 149 for (z = 1; z <= 4; z++) { 150 $('.igold-mobile-' + z).fadeIn(timeout).css('margin-left', '0px');; 151 timeout += 2500; 152 } 153 } 154 155 });
156 157 $('a[href^="#"]').bind('click.smoothscroll', function (e) { 158 e.preventDefault(); 159 var target = this.hash, 160 $target = $(target); 161 162 $('html, body').stop().animate({ 163 'scrollTop': $target.offset().top - 100 164 }, 900, 'swing', function () { 165 window.location.hash = target; 166 }); 167 }); 168 169 $('.accordion-filter-title').on('click', function () { 170 if ($(this).hasClass('collapsed')) { 171 console.log('collapsed'); 172 if ($(this).find('i').hasClass('fa-chevron-up')) { 173 console.log('fa-chevron-up'); 174 $(this).find('i').css('transform', 'rotate(0deg)'); 175 } else { 176 console.log('fa-chevron-down'); 177 $(this).find('i').css('transform', 'rotate(180deg)'); 178 } 179 } else { 180 console.log('not collapsed'); 181 if ($(this).find('i').hasClass('fa-chevron-up')) { 182 console.log('fa-chevron-up'); 183 $(this).find('i').css('transform', 'rotate(180deg)'); 184 } else { 185 console.log('fa-chevron-down'); 186 $(this).find('i').css('transform', 'rotate(0deg)'); 187 } 188 } 189 }); 190 191 function formatOption(option) { 192 if (!option.id) { 193 return option.text; // Se non c'è ID, restituisci solo il testo 194 } 195 var imgSrc = $(option.element).data('img-src'); // Ottieni l'URL dell'immagine 196 // console.log(imgSrc); 197 var $option = $( 198 '<span style="display: flex; align-items: center; width: auto; justify-content: left; font-size: 0.8rem;">' + 199 '<img src="' + imgSrc + '" style="width: 35px; margin-right: 10px;" />' + 200 option.text + 201 '</span>' 202 ); 203 return $option; // Restituisci l'elemento HTML 204 } 205 206 $('.counter').each(function () { 207 var $this = $(this), 208 countTo = $this.attr('data-count'), 209 countTime = $this.attr('data-time'); 210 211 $({ 212 countNum: $this.text() 213 }).animate({ 214 countNum: countTo 215 }, { 216 duration: 3500, 217 easing: 'linear', 218 step: function () { 219 $this.text(Math.floor(this.countNum)); 220 }, 221 complete: function () { 222 $this.text(this.countNum); 223 } 224 }); 225 }); 226 227 $('.marquee').marquee({ 228 speed: (window.innerWidth > 768 ? 300 : 100), 229 gap: 0, 230 delayBeforeStart: 0, 231 direction: 'left', 232 duplicated: true, 233 pauseOnHover: false, 234 startVisible: true 235 }); 236 237 $('#container_home').slick({ 238 centerMode: true, 239 centerPadding: '60px', 240 dots: false, 241 arrows: true, 242 infinite: false, 243 speed: 300, 244 slidesToShow: 1, 245 slidesToScroll: 2, 246 prevArrow: '<b><i class="l-a"><img src="' + baseurl + 'assets/images/slider/prev-gold.png" alt=""></i></b>', 247 nextArrow: '<b><i class="r-a"><img src="' + baseurl + 'assets/images/slider/next-gold.png" alt=""></i></b>' 248 }); 249 250})(jQuery); 251 252// Funzione per aggiornare il parametro di una query string 253function updateQueryStringParameter(uri, key, value) { 254 var re = new RegExp("([?&])" + key + "=.*?(&|$)", "i"); 255 var separator = uri.indexOf('?') !== -1 ? "&" : "?"; 256 if (uri.match(re)) { 257 return uri.replace(re, '$1' + key + "=" + value + '$2'); 258 } else { 259 return uri + separator + key + "=" + value; 260 } 261} 262 263// Funzione per ottenere tutti i parametri GET dall'URL 264function removeGetParameters(urlString, name) { 265 var url = new URL(urlString); 266 var urlParams = url.searchParams; 267 268 urlParams.delete(name); 269 270 return url.origin + url.pathname + (urlParams.toString() ? '?' + urlParams.toString() : ''); 271} 272 273 274$(document).ready(function () { 275 var alertHtml = '<div class="alert"><p class="mb-0"></p></div>'; 276 var alertDissHtml = '<div class="alert alert-dismissible fade show" role="alert"><p class="mb-0"></p><button type="button" class="btn-close" data-bs-dismiss="alert" aria-label="Close"></button></div>'; 277 278 279 // Form Contatti 280 if ($("#contact_form").length > 0) { 281 282 $("#contact_form").validate({ 283 284 rules: { 285 name: { required: true }, 286 email: { required: true, email: true }, 287 privacy: { required: true } 288 }, 289 messages: { 290 name: { required: msg["campo-obbligatorio"] }, 291 email: { required: msg["campo-obbligatorio"], email: msg["mail-obbligatoria"] }, 292 privacy: { required: msg["campo-obbligatorio"] }, 293 }, 294 submitHandler: function (form) { 295 var $form = $(form); 296 var action = $(form).attr('action'); 297 298 if ($form.valid()) { 299 /********** IUBENDA CONSENT SOLUTION *******/ 300 _iub.cons_instructions.push(["load", 301 { 302 form: { 303 selector: $form, 304 map: { 305 subject: { 306 email: "email", 307 full_name: "name" 308 }, 309 exclude: ['key', 'botcheck'] 310 } 311 }, 312 consent: { 313 legal_notices: [ 314 { 315 identifier: 'privacy_policy' 316 }, 317 { 318 identifier: 'term' 319 } 320 ] 321 } 322 } 323 ]); 324 _iub.cons.sendData(); 325 } 326 327 $form.find('.alert').remove(); 328 329 //$form.block(); 330 331 //e.preventDefault(); 332 333 $.post(action + "?load=1&lang=" + lang, 334 $form.serialize(), 335 function (data) { 336 var $alertDiv = $(alertDissHtml); 337 $alertDiv.addClass(data.alert).find('p').html(data.message); 338 $alertDiv.hide().appendTo(form).fadeIn(); 339 //$form.unblock(); 340 341 $form.find('input, textarea').each(function (i, e) { 342 var $element = $(e) 343 344 if ($element.attr('type') == 'checkbox') { 345 $element.prop("checked", false); 346 } else { 347 $element.val(''); 348 } 349 }); 350 351 setTimeout(function () { 352 $alertDiv.fadeOut(function () { 353 $(this).remove(); 354 }); 355 }, 2000); 356 357 }, "json"); 358 359 return false; 360 } 361 }); 362 } 363 364 // mobile-menu-sidebar 365 //--------------------------------------------------------------------------- 366 $(".mobile-menubar").on("click", function () { 367 $(".side-mobile-menu").addClass('open-menubar'); 368 $(".body-overlay").addClass("opened"); 369 });
370 $(".close-icon").click(function () { 371 $(".side-mobile-menu").removeClass('open-menubar'); 372 $(".body-overlay").removeClass("opened"); 373 }); 374 375 $(".body-overlay").on("click", function () { 376 $(".side-mobile-menu").removeClass('open-menubar'); 377 $(".body-overlay").removeClass("opened"); 378 }); 379 //mean menu -- mobile menu 380 $("#mobile-menu").meanmenu({ 381 meanMenuContainer: ".mobile-menu", 382 meanScreenWidth: 991 383 }); 384 385 $('body').on('change', '.card-input-element', function () { 386 387 console.log('change'); 388 // Ottieni il valore selezionato 389 //var selectedValue = $(this).val(); 390 391 //if $(this) is checked 392 if ($(this).is(':checked')) { 393 selectedValue = $(this).val(); 394 } else { 395 selectedValue = ''; 396 } 397 398 // Ottieni il nome del select 399 var selectName = $(this).attr('name'); 400 401 // Aggiorna il parametro nella barra degli indirizzi 402 var currentUrl = window.location.href; 403 404 if (selectName === 'prezzo') { 405 //remove order=price from url 406 currentUrl = removeGetParameters(currentUrl, 'order'); 407 } 408 // Se il valore è vuoto, rimuovi il parametro dall'URL 409 if (selectedValue === '') { 410 currentUrl = removeGetParameters(currentUrl, selectName); 411 } else { 412 // Altrimenti, aggiorna il parametro 413 currentUrl = updateQueryStringParameter(currentUrl, selectName, selectedValue); 414 if (selectName === 'prezzo' && selectedValue != '') { 415 console.log('prezzo2'); 416 currentUrl = updateQueryStringParameter(currentUrl, 'order', 'price'); 417 } 418 } 419 420 // Aggiorna la pagina 421 window.location.href = currentUrl; 422 }); 423 424 // $('.animate-txt-1').css('opacity', 0).animate({opacity: 1}, 2000, function () { 425 // $('.animate-txt-2').css('opacity', 0).animate({opacity: 1}, 2000); 426 // }); 427 428});
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.