BATMAN DAY 2023 - BATMAN #608 FOIL VAR SPECIAL EDITION
$9.99
SKU: BDAY2023-608FOIL
= 2 && pathParts[0] === 'collections') {
var collectionHandle = pathParts[1];
// Store in sessionStorage
sessionStorage.setItem('lastCollectionHandle', collectionHandle);
sessionStorage.setItem('lastCollectionUrl', referrerUrl.pathname);
} else {
// Referrer is not a collection page, clear stored collection
sessionStorage.removeItem('lastCollectionHandle');
sessionStorage.removeItem('lastCollectionUrl');
}
} else {
// External referrer, clear stored collection
sessionStorage.removeItem('lastCollectionHandle');
sessionStorage.removeItem('lastCollectionUrl');
}
} catch (e) {
// Invalid referrer URL, clear stored collection
sessionStorage.removeItem('lastCollectionHandle');
sessionStorage.removeItem('lastCollectionUrl');
}
} else {
// No referrer (direct navigation, bookmark, etc.), clear stored collection
sessionStorage.removeItem('lastCollectionHandle');
sessionStorage.removeItem('lastCollectionUrl');
}
}
// Display collection in breadcrumb if available
if (breadcrumbNav) {
var lastCollectionHandle = sessionStorage.getItem('lastCollectionHandle');
var lastCollectionUrl = sessionStorage.getItem('lastCollectionUrl');
if (lastCollectionHandle && lastCollectionUrl) {
// Format collection name (replace hyphens with spaces, capitalize words)
var collectionTitle = lastCollectionHandle
.split('-')
.map(function(word) { return word.charAt(0).toUpperCase() + word.slice(1); })
.join(' ');
var homeLink = breadcrumbNav.querySelector('a[href="/"]');
if (homeLink) {
var separator = homeLink.nextElementSibling;
if (separator && separator.classList.contains('cc-product-details__breadcrumbs-separator')) {
var collectionLink = document.createElement('a');
collectionLink.href = lastCollectionUrl;
collectionLink.textContent = collectionTitle;
var collectionSeparator = document.createElement('span');
collectionSeparator.className = 'cc-product-details__breadcrumbs-separator';
collectionSeparator.textContent = '/';
separator.parentNode.insertBefore(collectionLink, separator.nextSibling);
separator.parentNode.insertBefore(collectionSeparator, separator.nextSibling.nextSibling);
}
}
}
}
var readMoreBtn = section.querySelector('[data-read-more]');
if (readMoreBtn) {
var contentDiv = section.querySelector('.cc-product-details__description-content');
var isExpanded = false;
readMoreBtn.addEventListener('click', function() {
isExpanded = !isExpanded;
if (isExpanded) {
contentDiv.innerHTML = contentDiv.dataset.full;
readMoreBtn.textContent = 'Read less';
} else {
contentDiv.innerHTML = contentDiv.dataset.short;
readMoreBtn.textContent = 'Read more';
// Scroll back to the description section
var descriptionText = section.querySelector('.cc-product-details__description-text');
if (descriptionText) {
descriptionText.scrollIntoView({ behavior: 'smooth', block: 'start' });
}
}
});
}
var tabButtons = section.querySelectorAll('.cc-product-details__tab-button');
var tabContents = section.querySelectorAll('.cc-product-details__tab-content');
tabButtons.forEach(function(button) {
button.addEventListener('click', function() {
var tabName = this.getAttribute('data-tab');
tabButtons.forEach(function(btn) {
btn.classList.remove('active');
btn.setAttribute('aria-selected', 'false');
btn.setAttribute('tabindex', '-1');
});
tabContents.forEach(function(content) {
content.classList.remove('active');
});
this.classList.add('active');
this.setAttribute('aria-selected', 'true');
this.setAttribute('tabindex', '0');
var activeContent = section.querySelector('[data-tab-content="' + tabName + '"]');
if (activeContent) {
activeContent.classList.add('active');
}
});
button.addEventListener('keydown', function(e) {
var buttonsArray = Array.from(tabButtons);
var currentIndex = buttonsArray.indexOf(this);
var nextIndex;
if (e.key === 'ArrowRight') {
e.preventDefault();
nextIndex = currentIndex + 1 < tabButtons.length ? currentIndex + 1 : 0;
tabButtons[nextIndex].focus();
tabButtons[nextIndex].click();
} else if (e.key === 'ArrowLeft') {
e.preventDefault();
nextIndex = currentIndex - 1 >= 0 ? currentIndex - 1 : tabButtons.length - 1;
tabButtons[nextIndex].focus();
tabButtons[nextIndex].click();
}
});
});
var modalTriggers = section.querySelectorAll('[data-modal-trigger]');
var modals = document.querySelectorAll('.cc-product-details__modal[data-section-id="' + sectionId + '"]');
var lastFocusedElement;
modalTriggers.forEach(function(trigger) {
trigger.addEventListener('click', function() {
var modalNum = this.getAttribute('data-modal-trigger');
if (!modalNum) return;
// Skip modal for button 1 (wishlist)
if (modalNum === '1') return;
var modal = document.querySelector('.cc-product-details__modal[data-modal="' + modalNum + '"][data-section-id="' + sectionId + '"]');
if (modal) {
lastFocusedElement = document.activeElement;
modal.classList.add('active');
var closeBtn = modal.querySelector('[data-modal-close]');
if (closeBtn) {
closeBtn.focus();
}
document.body.style.overflow = 'hidden';
}
});
});
// Handle custom JS buttons
var customJsButtons = section.querySelectorAll('[data-btn-action="custom_js"]');
customJsButtons.forEach(function(button) {
button.addEventListener('click', function() {
var selector = this.getAttribute('data-click-selector');
if (!selector) return;
var targetElement = document.querySelector(selector);
if (targetElement && targetElement.offsetParent !== null) {
targetElement.click();
}
});
});
function closeModal(modal) {
modal.classList.remove('active');
document.body.style.overflow = '';
if (lastFocusedElement) {
lastFocusedElement.focus();
}
}
modals.forEach(function(modal) {
var closeBtn = modal.querySelector('[data-modal-close]');
if (closeBtn) {
closeBtn.addEventListener('click', function() {
closeModal(modal);
});
}
modal.addEventListener('click', function(e) {
if (e.target === this) {
closeModal(this);
}
});
modal.addEventListener('keydown', function(e) {
if (e.key === 'Escape') {
closeModal(this);
}
});
var modalContent = modal.querySelector('.cc-product-details__modal-content');
if (modalContent) {
modal.addEventListener('keydown', function(e) {
if (e.key !== 'Tab') return;
var focusableElements = modalContent.querySelectorAll(
'button, [href], input, select, textarea, [tabindex]:not([tabindex="-1"])'
);
var firstElement = focusableElements[0];
var lastElement = focusableElements[focusableElements.length - 1];
if (e.shiftKey) {
if (document.activeElement === firstElement) {
e.preventDefault();
lastElement.focus();
}
} else {
if (document.activeElement === lastElement) {
e.preventDefault();
firstElement.focus();
}
}
});
}
});
// AJAX Add to Cart
var form = section.querySelector('.cc-ajax-form');
if (form) {
form.addEventListener('submit', function(e) {
e.preventDefault();
var submitBtn = form.querySelector('button[type="submit"]');
var originalText = submitBtn.textContent;
submitBtn.disabled = true;
submitBtn.textContent = 'Adding...';
var formData = new FormData(form);
fetch('/cart/add.js', {
method: 'POST',
body: formData
})
.then(function(response) {
return response.json();
})
.then(function(data) {
submitBtn.textContent = 'Added!';
// Trigger Shopify cart update event
if (typeof Shopify !== 'undefined' && Shopify.theme && Shopify.theme.publish) {
Shopify.theme.publish('cart:updated', { cart: data });
}
// Trigger cart drawer if it exists
document.dispatchEvent(new CustomEvent('cart:refresh'));
setTimeout(function() {
submitBtn.disabled = false;
submitBtn.textContent = originalText;
}, 2000);
})
.catch(function(error) {
console.error('Add to cart error:', error);
submitBtn.textContent = 'Error - Try Again';
setTimeout(function() {
submitBtn.disabled = false;
submitBtn.textContent = originalText;
}, 2000);
});
});
}
// Variant selector and price update
var variantSelect = section.querySelector('#variant-select-' + sectionId);
var priceDisplay = section.querySelector('#product-price-' + sectionId);
var skuDisplay = section.querySelector('#product-sku-' + sectionId);
var skuValue = section.querySelector('#sku-value-' + sectionId);
var sezzleWidget = section.querySelector('#sezzle-widget-' + sectionId);
var atcButton = section.querySelector('#atc-button-' + sectionId);
if (variantSelect) {
variantSelect.addEventListener('change', function() {
var selectedOption = this.options[this.selectedIndex];
var price = selectedOption.getAttribute('data-price');
var sku = selectedOption.getAttribute('data-sku');
var available = selectedOption.getAttribute('data-available') === 'true';
// Update price
if (priceDisplay && price) {
var formattedPrice = (parseFloat(price) / 100).toFixed(2);
priceDisplay.textContent = '$' + formattedPrice;
}
// Update SKU
if (sku && sku !== '') {
if (skuValue) skuValue.textContent = sku;
if (skuDisplay) skuDisplay.style.display = 'block';
} else {
if (skuDisplay) skuDisplay.style.display = 'none';
}
// Update Sezzle widget
if (sezzleWidget && price) {
sezzleWidget.setAttribute('data-amount', price);
// Re-render Sezzle widget if available
if (typeof document.sezzle !== 'undefined' && document.sezzle.renderByFunction) {
document.sezzle.renderByFunction();
}
}
// Update button state
if (atcButton) {
atcButton.disabled = !available;
}
});
}
// Initialize Sezzle Widget - Deferred
function initSezzle() {
if (typeof document.sezzle !== 'undefined' && document.sezzle.renderByFunction) {
document.sezzle.renderByFunction();
}
}
// Only init after a delay to not block main thread
setTimeout(initSezzle, 2000);
// Lightbox Zoom Functionality
var lightbox = document.querySelector('.cc-product-details__lightbox[data-section-id="' + sectionId + '"]');
var lightboxImage = lightbox.querySelector('.cc-product-details__lightbox-image');
var lightboxLoading = lightbox.querySelector('.cc-product-details__lightbox-loading');
var lightboxClose = lightbox.querySelector('.cc-product-details__lightbox-close');
var zoomTriggers = section.querySelectorAll('.cc-product-details__zoom-trigger, .cc-product-details__main-img');
var scale = 1;
var translateX = 0;
var translateY = 0;
var isDragging = false;
var startX = 0;
var startY = 0;
var currentImageIndex = 0;
var allImages = [];
// Collect all image data
var thumbnailButtons = section.querySelectorAll('.cc-product-details__thumbnail-btn');
if (thumbnailButtons.length > 0) {
thumbnailButtons.forEach(function(btn) {
allImages.push({
src: btn.getAttribute('data-image-src'),
zoomSrc: btn.getAttribute('data-zoom-src'),
alt: btn.getAttribute('data-image-alt'),
index: parseInt(btn.getAttribute('data-image-index'))
});
});
} else {
var mainImg = section.querySelector('.cc-product-details__main-img');
if (mainImg) {
allImages.push({
src: mainImg.src,
zoomSrc: mainImg.getAttribute('data-zoom-src'),
alt: mainImg.alt,
index: 0
});
}
}
function openLightbox(imageIndex) {
currentImageIndex = imageIndex;
lightboxLoading.style.display = 'block';
lightboxImage.style.display = 'none';
lightbox.classList.add('active');
document.body.style.overflow = 'hidden';
loadLightboxImage(currentImageIndex);
updateNavButtons();
}
function loadLightboxImage(index) {
if (!allImages[index]) return;
scale = 1;
translateX = 0;
translateY = 0;
updateImageTransform();
lightboxLoading.style.display = 'block';
lightboxImage.style.display = 'none';
var img = new Image();
img.onload = function() {
lightboxImage.src = allImages[index].zoomSrc;
lightboxImage.alt = allImages[index].alt;
lightboxLoading.style.display = 'none';
lightboxImage.style.display = 'block';
};
img.src = allImages[index].zoomSrc;
}
function updateNavButtons() {
var prevBtn = lightbox.querySelector('[data-action="prev"]');
var nextBtn = lightbox.querySelector('[data-action="next"]');
if (prevBtn) {
prevBtn.disabled = currentImageIndex === 0;
}
if (nextBtn) {
nextBtn.disabled = currentImageIndex >= allImages.length - 1;
}
}
function navigatePrev() {
if (currentImageIndex > 0) {
currentImageIndex--;
loadLightboxImage(currentImageIndex);
updateNavButtons();
}
}
function navigateNext() {
if (currentImageIndex < allImages.length - 1) {
currentImageIndex++;
loadLightboxImage(currentImageIndex);
updateNavButtons();
}
}
function closeLightbox() {
lightbox.classList.remove('active');
document.body.style.overflow = '';
scale = 1;
translateX = 0;
translateY = 0;
lightboxImage.classList.remove('zoomed');
}
function updateImageTransform() {
var transform = 'translate(' + translateX + 'px, ' + translateY + 'px) scale(' + scale + ')';
lightboxImage.style.transform = transform;
lightboxImage.style.webkitTransform = transform;
if (scale > 1) {
lightboxImage.classList.add('zoomed');
} else {
lightboxImage.classList.remove('zoomed');
translateX = 0;
translateY = 0;
}
}
function zoomIn() {
scale = Math.min(scale * 1.5, 5);
updateImageTransform();
}
function zoomOut() {
scale = Math.max(scale / 1.5, 1);
updateImageTransform();
}
function resetZoom() {
scale = 1;
translateX = 0;
translateY = 0;
updateImageTransform();
}
// Open lightbox on image/trigger click
zoomTriggers.forEach(function(trigger) {
trigger.addEventListener('click', function(e) {
e.preventDefault();
e.stopPropagation();
var mainImg = section.querySelector('.cc-product-details__main-img');
var imageIndex = mainImg ? parseInt(mainImg.getAttribute('data-image-index')) : 0;
openLightbox(imageIndex);
});
});
// Thumbnail switching
thumbnailButtons.forEach(function(btn) {
btn.addEventListener('click', function(e) {
e.preventDefault();
var imageSrc = this.getAttribute('data-image-src');
var zoomSrc = this.getAttribute('data-zoom-src');
var imageAlt = this.getAttribute('data-image-alt');
var imageIndex = this.getAttribute('data-image-index');
var mainImg = section.querySelector('.cc-product-details__main-img');
if (mainImg) {
mainImg.src = imageSrc;
mainImg.alt = imageAlt;
mainImg.setAttribute('data-zoom-src', zoomSrc);
mainImg.setAttribute('data-image-index', imageIndex);
}
thumbnailButtons.forEach(function(b) { b.classList.remove('active'); });
this.classList.add('active');
});
});
// Close lightbox
lightboxClose.addEventListener('click', closeLightbox);
lightbox.addEventListener('click', function(e) {
if (e.target === this) {
closeLightbox();
}
});
// Keyboard controls
document.addEventListener('keydown', function(e) {
if (!lightbox.classList.contains('active')) return;
if (e.key === 'Escape') {
closeLightbox();
} else if (e.key === 'ArrowLeft') {
navigatePrev();
} else if (e.key === 'ArrowRight') {
navigateNext();
} else if (e.key === '+' || e.key === '=') {
zoomIn();
} else if (e.key === '-' || e.key === '_') {
zoomOut();
} else if (e.key === '0') {
resetZoom();
}
});
// Zoom controls
var zoomInBtn = lightbox.querySelector('[data-action="zoom-in"]');
var zoomOutBtn = lightbox.querySelector('[data-action="zoom-out"]');
var resetBtn = lightbox.querySelector('[data-action="reset"]');
var prevBtn = lightbox.querySelector('[data-action="prev"]');
var nextBtn = lightbox.querySelector('[data-action="next"]');
zoomInBtn.addEventListener('click', zoomIn);
zoomOutBtn.addEventListener('click', zoomOut);
resetBtn.addEventListener('click', resetZoom);
if (prevBtn) prevBtn.addEventListener('click', navigatePrev);
if (nextBtn) nextBtn.addEventListener('click', navigateNext);
// Click to zoom
lightboxImage.addEventListener('click', function(e) {
if (scale === 1) {
zoomIn();
}
});
// Double click to reset
lightboxImage.addEventListener('dblclick', function(e) {
e.preventDefault();
if (scale > 1) {
resetZoom();
} else {
zoomIn();
}
});
// Mouse wheel zoom
lightboxImage.addEventListener('wheel', function(e) {
if (!lightbox.classList.contains('active')) return;
e.preventDefault();
if (e.deltaY < 0) {
zoomIn();
} else {
zoomOut();
}
});
// Drag to pan when zoomed
lightboxImage.addEventListener('mousedown', function(e) {
if (scale <= 1) return;
isDragging = true;
startX = e.clientX - translateX;
startY = e.clientY - translateY;
lightboxImage.classList.add('dragging');
e.preventDefault();
});
document.addEventListener('mousemove', function(e) {
if (!isDragging) return;
e.preventDefault();
translateX = e.clientX - startX;
translateY = e.clientY - startY;
var transform = 'translate(' + translateX + 'px, ' + translateY + 'px) scale(' + scale + ')';
lightboxImage.style.transform = transform;
lightboxImage.style.webkitTransform = transform;
});
document.addEventListener('mouseup', function() {
if (isDragging) {
isDragging = false;
lightboxImage.classList.remove('dragging');
}
});
// Touch support for mobile
var touchStartDistance = 0;
var touchStartScale = 1;
var touches = [];
lightboxImage.addEventListener('touchstart', function(e) {
touches = Array.from(e.touches);
if (touches.length === 2) {
e.preventDefault();
var touch1 = touches[0];
var touch2 = touches[1];
touchStartDistance = Math.hypot(
touch2.clientX - touch1.clientX,
touch2.clientY - touch1.clientY
);
touchStartScale = scale;
} else if (touches.length === 1 && scale > 1) {
isDragging = true;
startX = touches[0].clientX - translateX;
startY = touches[0].clientY - translateY;
}
});
lightboxImage.addEventListener('touchmove', function(e) {
touches = Array.from(e.touches);
if (touches.length === 2) {
e.preventDefault();
var touch1 = touches[0];
var touch2 = touches[1];
var currentDistance = Math.hypot(
touch2.clientX - touch1.clientX,
touch2.clientY - touch1.clientY
);
scale = Math.max(1, Math.min(5, touchStartScale * (currentDistance / touchStartDistance)));
updateImageTransform();
} else if (touches.length === 1 && isDragging) {
e.preventDefault();
translateX = touches[0].clientX - startX;
translateY = touches[0].clientY - startY;
updateImageTransform();
}
});
lightboxImage.addEventListener('touchend', function(e) {
if (e.touches.length === 0) {
isDragging = false;
touches = [];
}
});
})();
CANADA'S LARGEST INVENTORY
With over half a million books online and thousands more added every week, CaptCan Comics offers the largest comic selection in Canada.
PRE-SALES & REWARD POINTS
Lock in the hottest new releases with our free pre-sales program. Earn CaptCan Cash on every order — the best preorder deal in the country.
ACCURATE GRADING - EVERY TIME
Every comic is evaluated with precision and consistency — thoroughly inspected, properly represented, and ready to buy with confidence.
Added to your cart:
** total_quantity ** | ** unit_price ** / ** unit_measure **