document.addEventListener("DOMContentLoaded", function () {
const volumeCount = 10;
const select = document.getElementById('volumeSelect');
const showVideoBtn = document.getElementById('showVideoBtn');
const buyVolumeBtn = document.getElementById('buyVolumeBtn');
const videoContainer = document.getElementById('videoContainer');
const videoSource = document.getElementById('videoSource');
const videoPlayer = document.getElementById('videoPlayer');
// Populate dropdown
for (let i = 1; i <= volumeCount; i++) {
const option = document.createElement('option');
option.value = i;
option.textContent = `Volume ${i}`;
select.appendChild(option);
}
// Show Video button click
showVideoBtn.addEventListener('click', function () {
const selectedVolume = select.value;
const videoUrl = `/wp-content/uploads/2025/05/Vol-10.mp4`; // Adjust path if needed
videoSource.src = videoUrl;
videoPlayer.load();
videoContainer.style.display = 'block';
videoPlayer.play();
});
// Buy Volume button click
buyVolumeBtn.addEventListener('click', function () {
const selectedVolume = select.value;
const buyUrl = `/buy/volume${selectedVolume}`; // Adjust this to your actual product URLs
window.location.href = buyUrl;
});
});