diff --git a/zenitPlatformAtmosSet2/src/Resources/app/storefront/dist/storefront/js/zenit-platform-atmos-set2.js b/zenitPlatformAtmosSet2/src/Resources/app/storefront/dist/storefront/js/zenit-platform-atmos-set2.js index e7b231f..6d251a7 100644 --- a/zenitPlatformAtmosSet2/src/Resources/app/storefront/dist/storefront/js/zenit-platform-atmos-set2.js +++ b/zenitPlatformAtmosSet2/src/Resources/app/storefront/dist/storefront/js/zenit-platform-atmos-set2.js @@ -18,7 +18,7 @@ $(document).ready(function() { fp.config.onChange.push(function() { manipulateDateInputValue(); }); - + // If Austria and same day delivery is checked change to DPD if ($(".confirm-address-shipping").data("iso") === "AT") { inputDPD.attr('checked', true).trigger("click"); @@ -27,13 +27,21 @@ $(document).ready(function() { // No shop inputShopPickup.parents(".shipping-method").hide(); } - + // Call changeDelivery $("[name='shippingMethodId']").on('change', () => { changeDelivery(fp); }); changeDelivery(fp); } + + var sticky = $(".thumbnail-container"), + parentContainer = sticky.parents(".aku-cms-factory-element"), + stickyTop = sticky.offset().top; + tagBar(sticky, parentContainer, stickyTop); + $(window).on('resize scroll', function() { + tagBar(sticky, parentContainer, stickyTop); + }); }); function manipulateDateInputValue() { @@ -50,7 +58,7 @@ function changeDelivery(fp) { $(this).addClass("active"); $(".confirm-delivery-date #dtgs-datepicker-inputfield").val(spawnDateInputValue + " " + $(this).text()); }); - + if ($(".confirm-address-shipping").data("iso") !== "AT") { if (inputShopPickup.is(':checked')) { // Abholung im Ladengeschäft @@ -87,16 +95,16 @@ function changeDelivery(fp) { function setIncludedDays(delivery, fp, addDays) { let spwnDateTemp = new Date(); spwnDateTemp.setDate(spwnDateTemp.getDate() + addDays); - + let spwnTime = parseInt(spwnDateTemp.getHours() + "" + spwnDateTemp.getMinutes()); if (delivery === "evening" && spwnTime > 1300) { spwnDateTemp.setDate(spwnDateTemp.getDate() + 1); } else if (delivery === "dpd" && spwnTime > 1400) { - spwnDateTemp.setDate(spwnDateTemp.getDate() + 1); + spwnDateTemp.setDate(spwnDateTemp.getDate() + 1); } let spwnDate = fp.formatDate(spwnDateTemp, "d.m.Y"); fp.set("minDate", spwnDate); - + fp.set("enable", [ function(date) { let day = date.getDate(); @@ -116,3 +124,49 @@ function setIncludedDays(delivery, fp, addDays) { } ]); } + +$.fn.isInViewport = function() { + var elementTop = $(this).offset().top + 50; + var elementBottom = elementTop + $(this).outerHeight(); + + var viewportTop = $(window).scrollTop(); + var viewportBottom = viewportTop + $(window).height(); + + return elementBottom > viewportTop && elementTop < viewportBottom; +}; + +function tagBar(sticky, parentContainer, stickyTop) { + var headerHeight = $(".header-inner").outerHeight() + 13, + windowTop = $(window).scrollTop() + headerHeight; + if (stickyTop < windowTop && parentContainer.height() + parentContainer.offset().top - sticky.height() > windowTop) { + sticky.css('position', 'fixed').css('top', headerHeight + 'px'); + } else { + sticky.css('position', 'absolute').css('top', 0); + } + + sticky.find("figure").removeClass("active"); + if ($("#day1").isInViewport() && !$("#day2").isInViewport() && + !$("#day3").isInViewport() && !$("#day4").isInViewport() && + !$("#day5").isInViewport() && !$("#day6").isInViewport()) { + sticky.find(".day1Image").addClass("active"); + } + if ($("#day2").isInViewport() && + !$("#day3").isInViewport() && !$("#day4").isInViewport() && + !$("#day5").isInViewport() && !$("#day6").isInViewport()) { + sticky.find(".day2Image").addClass("active"); + } + if ($("#day3").isInViewport() && !$("#day4").isInViewport() && + !$("#day5").isInViewport() && !$("#day6").isInViewport()) { + sticky.find(".day3Image").addClass("active"); + } + if ($("#day4").isInViewport() && + !$("#day5").isInViewport() && !$("#day6").isInViewport()) { + sticky.find(".day4Image").addClass("active"); + } + if ($("#day5").isInViewport() && !$("#day6").isInViewport()) { + sticky.find(".day5Image").addClass("active"); + } + if ($("#day6").isInViewport()) { + sticky.find(".day6Image").addClass("active"); + } +} \ No newline at end of file diff --git a/zenitPlatformAtmosSet2/src/Resources/views/.DS_Store b/zenitPlatformAtmosSet2/src/Resources/views/.DS_Store new file mode 100644 index 0000000..0e32f84 Binary files /dev/null and b/zenitPlatformAtmosSet2/src/Resources/views/.DS_Store differ diff --git a/zenitPlatformAtmosSet2/src/Resources/views/storefront/.DS_Store b/zenitPlatformAtmosSet2/src/Resources/views/storefront/.DS_Store new file mode 100644 index 0000000..d364215 Binary files /dev/null and b/zenitPlatformAtmosSet2/src/Resources/views/storefront/.DS_Store differ diff --git a/zenitPlatformAtmosSet2/src/Resources/views/storefront/component/.DS_Store b/zenitPlatformAtmosSet2/src/Resources/views/storefront/component/.DS_Store new file mode 100644 index 0000000..427625d Binary files /dev/null and b/zenitPlatformAtmosSet2/src/Resources/views/storefront/component/.DS_Store differ diff --git a/zenitPlatformAtmosSet2/src/Resources/views/storefront/component/account/register.html.twig b/zenitPlatformAtmosSet2/src/Resources/views/storefront/component/account/register.html.twig new file mode 100644 index 0000000..92fa73c --- /dev/null +++ b/zenitPlatformAtmosSet2/src/Resources/views/storefront/component/account/register.html.twig @@ -0,0 +1,10 @@ +{% sw_extends '@Storefront/storefront/component/account/register.html.twig' %} + +{% block component_account_register_submit %} +