$(document).ready(function(){
var yuklenenResimler = {};
var loading = false;
var yuklenenResimSayisi = 0;
var otomatikResimYukle = 3;
$('.lazy:not([data-loaded="true"])').each(function(index){
var resim = $(this);
if (yuklenenResimSayisi < otomatikResimYukle && !resim.attr('data-loaded')) {
resim.attr('src', resim.attr('data-src'));
resim.attr('data-loaded', 'true');
yuklenenResimSayisi++;
}
});
$(window).scroll(function(){
$('.lazy:not([data-loaded="true"])').each(function(){
var resim = $(this);
if (!loading && !yuklenenResimler[resim.attr('data-src')] && isElementInViewport(resim)) {
resim.attr('src', resim.attr('data-src'));
yuklenenResimler[resim.attr('data-src')] = true;
loading = true;
setTimeout(function() {
loading = false;
}, 200);
}
});
});
function isElementInViewport(el) {
var rect = el[0].getBoundingClientRect();
return (
rect.top >= 0 &&
rect.left >= 0 &&
rect.bottom <= (window.innerHeight || document.documentElement.clientHeight) &&
rect.right <= (window.innerWidth || document.documentElement.clientWidth)
);
}
//!function(){"use strict";let t=document.querySelectorAll(".requires-validation");Array.from(t).forEach(function(t){t.addEventListener("submit",function(e){t.checkValidity()||(e.preventDefault(),e.stopPropagation()),t.classList.add("was-validated")},!1)})}();
!function(){"use strict";let t=document.querySelectorAll(".requires-validation");Array.from(t).forEach((function(t){t.addEventListener("submit",(function(e){t.checkValidity()?Swal.fire({html:'
Siparişiniz Oluşturuluyor...
',buttons:!1,showCancelButton:!1,showConfirmButton:!1,allowOutsideClick:!1,timer:5e3,timerProgressBar:!0}).then((t=>{t.dismiss===Swal.DismissReason.timer&&console.log("Süre doldu, uyarı kapandı")})):(e.preventDefault(),e.stopPropagation()),t.classList.add("was-validated")}),!1)}))}();
$("#sehir").on("change",function(){var i=$(this).val();$("#ilce").attr("disabled",!1).html(''),$.getJSON("json/il-ilce.json",function(e){$("#ilce").append(''),$.each(e,function(e,n){var o="";n.il==i&&(o+='",$("#ilce").append(o))})})});
$(".tel-mask").inputmask({ mask: "0(*99) 999-9999", greedy: false, definitions: { '*': { validator: "[1-8]" } }, "clearIncomplete": true });
kargofirma_();
$("body").on('change', 'input[name="adet"],input[name="odeme"]', function() { kargofirma_(); });
$("body").on('click', '.kargofirmakampanyaustbuton', function() { $('html').animate({scrollTop: $('#contact_form').offset().top}, 300); });
function kargofirma_(){
}
$("label.block").click(function(){$("html").animate({scrollTop:$(".scroolposition1").offset().top},300);var i=$(this);$(".block").each(function(){$(i).data("image")!=$(this).data("image")?($(this).children("img.showz").show(),$(this).children("img.none").hide()):($(this).children("img.showz").hide(),$(this).children("img.none").show())})});
$(".siparisbuton").click(function(){var i=$("#contact_form");$(".contentimg"),i.find(":input").on("invalid",function(n){var t=$(this),f=i.find(":invalid").first();if(t[0]===f[0]){var o=t.offset().top-0,c=window.pageYOffset-0;if(o>c&&o