:: **Zploit** v1.0 | Current Path: **/home/kreativepixelz/finartindia.com/temp/**
:: Editing File: single1.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: none; /* Remove max-width so it adheres strictly to col-md-5 width */ } .main-image img { width: 100%; height: auto; display: block; object-fit: contain; cursor: crosshair; } /* Zoom result box */ .zoom-result { /* ... existing styles ... */ border: 1px solid #ccc; background-repeat: no-repeat; background-size: 200%; display: none; position: absolute; top: 0; z-index: 1000; background-color: #fff; box-shadow: 0 2px 10px rgba(0,0,0,0.2); /* MODIFIED - Match the col-md-7 space */ left: calc(100% + 20px); /* 100% is the image column width, 20px is the gap */ width: calc(7/5 * 100%); /* This calculation is a relative approximation for a 5:7 column split. */ /* A safer value if using col-md-5 and col-md-7 in a 12-column grid is to use an explicit width matching the 7-column grid size. */ /* Given your structure, a simpler, slightly less precise change is: */ width: 140%; /* 7/5 * 100 = 140. This assumes .product-view is taking the full col-md-5 width. */ 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; /*display: flex;*/ 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 */ table { width: 100%; border-collapse: collapse; background: #fff; box-shadow: 0 2px 8px rgba(0,0,0,0.08); font-size: 1.05em; } th, td { padding: 12px 15px; border: 1px solid #e6e6e6; text-align: left; } th { background: #f8f8f8; width: 220px; font-weight: 600; } /* 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/5.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-gem"></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 --> </div> </div> </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"; ?>