:: **Zploit** v1.0 | Current Path: **/home/kreativepixelz/finartindia.com/**
:: Editing File: zoom.php
<?php include "header.php"; ?> <style> /* Layout */ .product-view { display: flex; gap: 20px; flex-wrap: nowrap; align-items: flex-start; position: relative; /* used by absolute zoom box */ } /* Main image box */ .main-image { border: 1px solid #ddd; overflow: hidden; position: relative; background: #fff; width: 100%; max-width: 560px; /* optional cap */ } .main-image img { width: 100%; height: auto; display: block; object-fit: contain; cursor: crosshair; } /* Zoom result box */ .zoom-result { border: 1px solid #ccc; background-repeat: no-repeat; background-size: 200%; display: none; position: absolute; top: 0; left: 105%; z-index: 1000; background-color: #fff; box-shadow: 0 2px 10px rgba(0,0,0,0.2); /* NEW */ width: 100%; height: 100%; } /* Mobile overlay style (when .overlay class applied) */ .zoom-result.overlay { position: fixed !important; width: 90% !important; height: 90% !important; top: 5% !important; left: 5% !important; right: 5% !important; background-color: #fff; border: 2px solid #333; box-shadow: 0 10px 40px rgba(0,0,0,0.45); border-radius: 6px; } /* Close button (mobile overlay) */ .zoom-result .close-zoom { position: absolute; top: 8px; right: 8px; z-index: 1200; background: rgba(0,0,0,0.6); color: #fff; border: none; width: 36px; height: 36px; border-radius: 50%; font-size: 18px; line-height: 1; cursor: pointer; } /* Thumbnails */ .thumbnail-images { margin-top: 15px; gap: 10px; flex-wrap: wrap; justify-content: flex-start; } .thumbnail-images img { width: 60px; height: 60px; border: 2px solid #ddd; cursor: pointer; object-fit: cover; display: inline-block; } .thumbnail-images img.active, .thumbnail-images img:hover { border: 2px solid #ff6600; } /* Specs Table */ .dec-container table { width: 100%; border-collapse: collapse; background: #fff; box-shadow: 0 2px 8px rgba(0,0,0,0.1); font-size: 1.2em; } th, td { padding: 12px 15px; border: 1px solid #a1a1a1; text-align: left; font-size: 1.2em; } th { background: #f4f4f4; width: 200px; font-weight: bold; font-size: 1.2em; } tr:nth-child(even) { background: #fdfdfd; } tr:hover { background: #f1f1f1; } /* Responsive tweaks */ @media (max-width: 992px) { .product-view { flex-wrap: wrap; } .zoom-result { left: 0; top: calc(100% + 12px); position: relative; width: 100%; height: 300px; } } @media (max-width: 768px) { .thumbnail-images img { width: 48px; height: 48px; } .zoom-result { display: none; } /* default hidden on mobile until overlay toggled */ } </style> <script src="https://code.jquery.com/jquery-3.6.0.min.js"></script> <div class="header-overlay close_cart-init"></div> <!-- header end --> <!-- section --> <div class="content-section parallax-section hero-section hidden-section" data-scrollax-parent="true"> <div class="bg par-elem " data-bg="images/bg/1.jpg" data-scrollax="properties: { translateY: '30%' }"></div> <div class="overlay"></div> <div class="container"> <div class="section-title"> <h4>1</h4> <h2>2</h2> <div class="section-separator"><span><i class="fa-thin fa-paint-brush"></i></span></div> </div> </div> <div class="hero-section-scroll"> <div class="mousey"> <div class="scroller"></div> </div> </div> <div class="dec-corner dc_lb"></div> <div class="dec-corner dc_rb"></div> <div class="dec-corner dc_rt"></div> <div class="dec-corner dc_lt"></div> </div> <!-- section end --> <div class="content"> <div class="breadcrumbs-wrap"> <div class="container"> <a href="#">Home</a> <a href="#">Categories</a> <span>Painting</span> </div> </div> <div class="content-section" style="padding: 20px 0;"> <div class="container"> <div class="row"> <!-- Product Image Column --> <div class="col-md-5"> <div class="product-view"> <div class="main-image" id="mainImageBox"> <img id="mainProductImage" src="logo/CanvasPainting/1/01.jpg" data-large="logo/CanvasPainting/1/01.jpg" alt="Product"> </div> <!-- Zoom box (initially hidden). It's positioned absolutely to the right of .product-view. --> <div class="zoom-result" id="zoomResult" aria-hidden="true"></div> </div> <!-- Thumbnails --> <center><div class="thumbnail-images mt-3"> <img src="logo/CanvasPainting/1/01.jpg" class="active" data-large="logo/CanvasPainting/1/01.jpg" alt="thumb1"> <img src="logo/CanvasPainting/1/02.png" data-large="logo/CanvasPainting/1/02.png" alt="thumb2"> <img src="logo/CanvasPainting/1/03.png" data-large="logo/CanvasPainting/1/03.png" alt="thumb3"> <img src="logo/CanvasPainting/1/04.png" data-large="logo/CanvasPainting/1/04.png" alt="thumb4"> </div></center> </div> <!-- Details Column --> <div class="col-md-7"> <div class="dec-container"> <div class="text-block"> <div class="text-block-title"> <h4>Joyful Ride – Hand-Painted Canvas</h4> </div> <br> <p class="has-drop-cap text-justify"> This vibrant painting captures the carefree spirit of childhood, featuring a young boy pedaling barefoot through splashing water. Expressive brushstrokes and lively colors bring movement and joy to life. A perfect piece to add warmth, nostalgia, and playful energy to any living space. </p> <div class="tbc_subtitle">Specification</div> <div class="row"> <table class="table table-bordered table-striped"> <tbody> <tr><th scope="row">Material</th><td>Canvas Painting Mix Media</td></tr> <tr><th scope="row">Size</th><td>1 x 2 Feet</td></tr> <tr><th scope="row">Painting Type</th><td>Canvas Painting Mix Media</td></tr> <tr><th scope="row">Shape</th><td>Square</td></tr> <tr><th scope="row">Homemade</th><td>Artist Made</td></tr> <tr><th scope="row">Country of Origin</th><td>Made in India</td></tr> <tr><th scope="row">Availability</th><td>In Stock</td></tr> </tbody> </table> </div> </div> </div> </div> <!-- end col-md-7 --> </div> <!-- end row --> <!--post-related--> <div class="post-related"> <div class="post-related_title"> <h4 style="font-size: 30px;color: #c4a676;">Other Canvas Images</h4> <div class="section-separator"><span><i class="fa-thin fa-paint-brush"></i></span></div> </div> <!-- post-related --> <div class=" row"> <!-- 1 --> <div class="item-related col-lg-3"> <a href="2.php" class="item-related_img"> <img src="logo/CanvasPainting/2.jpg" class="respimg" alt=""> <div class="overlay"></div> <span>View Details</span> </a> <h3><a href="room-single.html">Premium Panorama Room</a></h3> </div> <!-- 1 end--> <!-- 1 --> <div class="item-related col-lg-3"> <a href="3.php" class="item-related_img"> <img src="logo/CanvasPainting/2.jpg" class="respimg" alt=""> <div class="overlay"></div> <span>View Details</span> </a> <h3><a href="room-single.html">Premium Panorama Room</a></h3> </div> <!-- 1 --> <div class="item-related col-lg-3"> <a href="3.php" class="item-related_img"> <img src="logo/CanvasPainting/2.jpg" class="respimg" alt=""> <div class="overlay"></div> <span>View Details</span> </a> <h3><a href="room-single.html">Premium Panorama Room</a></h3> </div> <!-- 1 --> <div class="item-related col-lg-3"> <a href="4.php" class="item-related_img"> <img src="logo/CanvasPainting/2.jpg" class="respimg" alt=""> <div class="overlay"></div> <span>View Details</span> </a> <h3><a href="room-single.html">Premium Panorama Room</a></h3> </div> </div> </div> <!-- post-related end--> <br><br><br> </div> </div> <!-- Features Section --> <div class="features-section"> <div class="container"> <div class="row justify-content-center"> <!-- Free Shipping --> <div class="col-md-3 col-sm-6"> <div class="feature-box"> <i class="fa fa-truck-fast"></i> <div> <h6>Free Shipping</h6> <p>Enjoy free shipping on all orders</p> </div> </div> </div> <!-- Flexible Payment --> <div class="col-md-3 col-sm-6"> <div class="feature-box"> <i class="fa fa-credit-card"></i> <div> <h6>Flexible Payment</h6> <p>Pay with Multiple Credit Cards</p> </div> </div> </div> <!-- 14-Days Return --> <div class="col-md-3 col-sm-6"> <div class="feature-box"> <i class="fa fa-box-open"></i> <div> <h6>14 - Days Return</h6> <p>Free return/exchange within 30 days</p> </div> </div> </div> <!-- Premium Support --> <div class="col-md-3 col-sm-6"> <div class="feature-box"> <i class="fa fa-headset"></i> <div> <h6>Premium Support</h6> <p>Enjoy our premium support</p> </div> </div> </div> </div> </div> </div> <!-- section -- <div class="content-section parallax-section hidden-section dark-bg" data-scrollax-parent="true"> <div class="bg par-elem" data-bg="images/bg/14.jpg" data-scrollax="properties: { translateY: '30%' }"></div> <div class="overlay overlay-bold"></div> <div class="container"> <!-- inline-facts -- <div class="inline-facts-wrap"> <div class="inline-facts two-col-mobile"> <div class="milestone-counter"> <div class="stats animaper"> <div class="num1"><i class="fa fa-truck-fast"></i></div> </div> </div> <h6>Free Shipping</h6> </div> <div class="inline-facts two-col-mobile"> <div class="milestone-counter"> <div class="stats animaper"> <div class="num1"><i class="fa fa-credit-card"></i></div> </div> </div> <h6>Flexible Payment</h6> </div> <div class="inline-facts two-col-mobile"> <div class="milestone-counter"> <div class="stats animaper"> <div class="num1"><i class="fa fa-box-open"></i></div> </div> </div> <h6>14-Days Return</h6> </div> <div class="inline-facts two-col-mobile"> <div class="milestone-counter"> <div class="stats animaper"> <div class="num1"><i class="fa fa-headset"></i></div> </div> </div> <h6>Premium Support</h6> </div> </div> <!-- inline-facts end -- </div> <div class="dec-corner dc_lb"></div> <div class="dec-corner dc_rb"></div> <div class="dec-corner dc_rt"></div> <div class="dec-corner dc_lt"></div> <div class="features-section"> <div class="container"> <div class="row justify-content-center"> <!-- Free Shipping -- <div class="col-md-3 col-sm-6"> <div class="feature-box"> <i class="fa fa-envelope"></i> <div> <h6>Free Shipping</h6> <p>Enjoy free shipping on all orders</p> </div> </div> </div> <!-- Flexible Payment -- <div class="col-md-3 col-sm-6"> <div class="feature-box"> <i class="fa fa-envelope"></i> <div> <h6>Flexible Payment</h6> <p>Pay with Multiple Credit Cards</p> </div> </div> </div> <!-- 14-Days Return -- <div class="col-md-3 col-sm-6"> <div class="feature-box"> <i class="fa fa-envelope"></i> <div> <h6>14 - Days Return</h6> <p>Free return/exchange within 30 days</p> </div> </div> </div> <!-- Premium Support -- <div class="col-md-3 col-sm-6"> <div class="feature-box"> <i class="fa fa-envelope"></i> <div> <h6>Premium Support</h6> <p>Enjoy our premium support</p> </div> </div> </div> </div> </div> </div> <!-- section end --> </div> <script> $(document).ready(function () { const $main = $('#mainProductImage'); const $box = $('#mainImageBox'); const $zoom = $('#zoomResult'); let largeNaturalWidth = 0; let largeNaturalHeight = 0; let currentLargeSrc = $main.attr('data-large') || $main.attr('src'); // Append close button (used when overlay on mobile) if ($zoom.find('.close-zoom').length === 0) { $zoom.append('<button class="close-zoom" aria-label="Close zoom">✕</button>'); } const $closeBtn = $zoom.find('.close-zoom'); // Preload large image and compute scale function loadLargeImage(src) { return new Promise((resolve, reject) => { const img = new Image(); img.onload = function () { largeNaturalWidth = this.naturalWidth; largeNaturalHeight = this.naturalHeight; currentLargeSrc = src; $zoom.css('background-image', "url('" + src + "')"); updateBackgroundSize(); resolve(); }; img.onerror = function () { reject(); }; img.src = src; }); } function updateBackgroundSize() { const mainW = $main.width(); const mainH = $main.height(); if (!mainW || !mainH || !largeNaturalWidth || !largeNaturalHeight) return; // factor percent = how much larger the large image is compared to displayed image const factorX = (largeNaturalWidth / mainW) * 100; const factorY = (largeNaturalHeight / mainH) * 100; // choose the larger factor so the zoom doesn't show empty areas const percent = Math.max(factorX, factorY); $zoom.css('background-size', percent + '% ' + percent + '%'); } // Initialize loadLargeImage(currentLargeSrc).catch(function () { // fallback — use displayed image $zoom.css('background-image', "url('" + ($main.attr('src') || '') + "')"); updateBackgroundSize(); }); // Thumbnail click handler $('.thumbnail-images img').on('click', function () { const small = $(this).attr('src'); const large = $(this).data('large') || small; $main.attr('src', small).attr('data-large', large); $('.thumbnail-images img').removeClass('active'); $(this).addClass('active'); loadLargeImage(large).catch(function () { // ignore error }); }); // Update sizes on window resize $(window).on('resize', function () { updateBackgroundSize(); }); const isTouch = ('ontouchstart' in window) || navigator.maxTouchPoints > 0; // Desktop: hover/mousemove if (!isTouch) { $box.on('mouseenter', function () { $zoom.show(); $zoom.attr('aria-hidden', 'false'); updateBackgroundSize(); }); $box.on('mousemove', function (e) { const offset = $box.offset(); const x = e.pageX - offset.left; const y = e.pageY - offset.top; const w = $box.width(); const h = $box.height(); // keep percent between 0 and 100 const xPercent = Math.max(0, Math.min(100, (x / w) * 100)); const yPercent = Math.max(0, Math.min(100, (y / h) * 100)); $zoom.css('background-position', xPercent + '% ' + yPercent + '%'); }); $box.on('mouseleave', function () { $zoom.hide(); $zoom.attr('aria-hidden', 'true'); }); } else { // Mobile: tap to open overlay; tap close or background to close $box.on('click touchstart', function (e) { // Toggle overlay zoom if (!$zoom.hasClass('overlay')) { $zoom.addClass('overlay').show().attr('aria-hidden', 'false'); $('body').css('overflow', 'hidden'); // prevent background scroll updateBackgroundSize(); } else { $zoom.removeClass('overlay').hide().attr('aria-hidden', 'true'); $('body').css('overflow', ''); } // prevent the click from triggering other handlers e.preventDefault(); e.stopPropagation(); }); // Update background-position on touchmove (while overlay active) $box.on('touchmove', function (e) { const touch = e.originalEvent.touches[0]; if (!touch) return; const offset = $box.offset(); const x = touch.pageX - offset.left; const y = touch.pageY - offset.top; const w = $box.width(); const h = $box.height(); const xPercent = Math.max(0, Math.min(100, (x / w) * 100)); const yPercent = Math.max(0, Math.min(100, (y / h) * 100)); $zoom.css('background-position', xPercent + '% ' + yPercent + '%'); }); // close button $closeBtn.on('click', function (e) { e.stopPropagation(); $zoom.removeClass('overlay').hide().attr('aria-hidden', 'true'); $('body').css('overflow', ''); }); // also allow clicking outside (on zoomResult background) to close overlay $zoom.on('click', function (e) { // if clicked the close button, let that handler run if ($(e.target).is('.close-zoom')) return; // close overlay when clicking the zoom area (makes it easy to close) if ($zoom.hasClass('overlay')) { $zoom.removeClass('overlay').hide().attr('aria-hidden', 'true'); $('body').css('overflow', ''); } }); } }); </script> <?php include "footer.php"; ?>