✦ Verified product
Support Our Work
GBP 1.00
Sulaiman Unfiltered
Verified independent store
→
Have your message read live during our live stream. Select a Gift Amount: £1 £5 £10 £25 £50 £100 Or enter a custom amount: .donate-btn { background-color: #000; color: white; borde
r: none; padding: 16px 24px; border-radius: 10px; cursor: pointer; font-size: 16px; min-width: 80px; transition: background-color 0.3s ease, transform 0.2s ease; } .donate-btn:hover { background-color: #222; } .donate-btn.active { background-color: #007aff; color: white; transform: scale(1.05); } @media (max-width: 600px) { .donate-btn { flex: 1 1 100%; } } document.addEventListener("DOMContentLoaded", function () { const qtyInput = document.querySelector('input[name="quantity"]'); const buttons = document.querySelectorAll(".donate-btn"); const customInput = document.getElementById("custom-donation"); const selectedAmountText = document.getElementById("selected-amount"); const currencySymbol = window.Shopify?.currency?.active || '£'; function updateAmountDisplay(amount) { selectedAmountText.textContent = `You’ve selected: ${currencySymbol}${amount}`; } function clearActiveButtons() { buttons.forEach(btn => btn.classList.remove('active')); } buttons.forEach(btn => { btn.addEventListener("click", () => { const qty = btn.getAttribute("data-qty"); if (qtyInput) qtyInput.value = qty; customInput.value = ''; clearActiveButtons(); btn.classList.add("active"); updateAmountDisplay(qty); }); }); customInput.addEventListener("input", () => { let value = customInput.value; // Remove all non-digit characters value = value.replace(/[^\d]/g, ''); // Prevent leading zeros value = value.replace(/^0+/, ''); customInput.value = value; const parsed = parseInt(value, 10); if (!isNaN(parsed) && parsed >= 1) { qtyInput.value = parsed; qtyInput.dispatchEvent(new Event('input', { bubbles: true })); qtyInput.dispatchEvent(new Event('change', { bubbles: true })); clearActiveButtons(); updateAmountDisplay(parsed); } else { qtyInput.value = ''; selectedAmountText.textContent = ''; } }); });