<style>
.hello-popup-overlay {
position: fixed;
inset: 0;
background: rgba(0,0,0,0.5);
display: none;
align-items: center;
justify-content: center;
z-index: 999999;
}
.hello-popup {
background: #fff;
padding: 32px 36px;
border-radius: 12px;
font-size: 20px;
font-family: system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
box-shadow: 0 20px 60px rgba(0,0,0,0.25);
text-align: center;
}
</style>
<div class="hello-popup-overlay" id="helloPopup">
<div class="hello-popup">
Hello!!
</div>
</div>
<script>
(function () {
const popup = document.getElementById('helloPopup');
function showPopup() {
popup.style.display = 'flex';
}
function hidePopup() {
popup.style.display = 'none';
}
// Close popup when clicking outside the box
popup.addEventListener('click', hidePopup);
document.addEventListener('click', function (e) {
const addToCartBtn = e.target.closest('.sqs-add-to-cart-button');
if (!addToCartBtn) return;
// Do NOT prevent default — let Squarespace add the item
setTimeout(showPopup, 200);
}, true);
})();
</script>