Add files via upload

This commit is contained in:
mrmarcus007
2022-03-21 15:19:40 +00:00
committed by GitHub
parent f5ae135250
commit 65ca4a78df
9 changed files with 9 additions and 570 deletions
+1
View File
@@ -0,0 +1 @@
.vanilla-zoom{width:100%}.vanilla-zoom .sidebar{width:100%;display:flex}.vanilla-zoom .sidebar img.small-preview{width:60px;margin-right:5px;cursor:pointer;opacity:.5}.vanilla-zoom .sidebar img.small-preview.active,.vanilla-zoom .sidebar img.small-preview:hover{opacity:1}.vanilla-zoom .sidebar img.small-preview:last-child{margin-right:0}.vanilla-zoom .zoomed-image{width:100%;height:300px;flex:1;background-repeat:no-repeat;background-position:left center;background-size:contain;margin-bottom:5px}
+1
View File
@@ -0,0 +1 @@
!function(e){"undefined"==typeof vanillaZoom?e.vanillaZoom={init:function(e){var t=document.querySelector(e);if(t){var n=t.querySelector(".small-preview"),o=t.querySelector(".zoomed-image");o?n?(o.style.backgroundImage="url("+n.src+")",n.classList.add("active"),t.addEventListener("click",(function(e){var n=e.target;if(n.classList.contains("small-preview")){t.querySelectorAll(".small-preview").forEach((function(e){e.classList.remove("active")})),n.classList.add("active");var a=n.src;o.style.backgroundImage="url("+a+")"}})),o.addEventListener("mouseenter",(function(e){this.style.backgroundSize="250%"}),!1),o.addEventListener("mousemove",(function(e){var t=this.getBoundingClientRect(),n=e.clientX-t.left,o=e.clientY-t.top,a=Math.round(100/(t.width/n)),i=Math.round(100/(t.height/o));this.style.backgroundPosition=a+"% "+i+"%"}),!1),o.addEventListener("mouseleave",(function(e){this.style.backgroundSize="contain",this.style.backgroundPosition="left center"}),!1)):console.error("No preview images on page. Please make sure you are using the right markup."):console.error("No zoomed image element. Please make sure you are using the right markup.")}else console.error("No container element. Please make sure you are using the right markup.")}}:console.log("Library already defined.")}(window),document.getElementsByClassName("clean-gallery").length>0&&baguetteBox.run(".clean-gallery",{animation:"slideIn"}),document.getElementsByClassName("clean-product").length>0&&(window.onload=function(){vanillaZoom.init("#product-preview")});