}
.date-under strong {
font-size: 24px;
}
#scratch {
position: absolute;
inset: 0;
width: 100%;
height: 100%;
touch-action: none;
border-radius: 50%;
}
.hint {
font:
12px Arial,
sans-serif;
color: #e8c98c;
}
.detail {
<p id="venue">Your Wedding Hall Name<br />Your City</p>
<a id="mapLink" href="https://maps.google.com/" target="_blank" rel="noopener">
<button>📍 Open Google Maps</button>
</a>
</div>
<div class="divider">✦ ✧ ✦</div>
<div class="detail">
<p class="eyebrow">THE WEDDING LOOK</p>
<h3>Our Wedding Theme</h3>
<!-- EDIT THE THEME HERE -->
<p>Royal Elegance</p>
<p class="gold">Maroon · Gold · Ivory</p>
<p>Traditional attire encouraged</p>
</div>
<div class="panel">
<p class="gold">Your presence is our greatest gift.</p>
<p>We can't wait to celebrate with you!</p>
</div>
</section>
<footer>MADE WITH LOVE ♥</footer>
</main>
<script>
const start = document.getElementById("start");
const invitation = document.getElementById("invitation");
const envelope = document.getElementById("envelope");
const openBtn = document.getElementById("openBtn");
const canvas = document.getElementById("scratch");
const ctx = canvas.getContext("2d");
const hint = document.getElementById("scratchHint");
function openInvitation() {
envelope.classList.add("open");
openBtn.disabled = true;
openBtn.textContent = "Opening...";
setTimeout(() => {
start.classList.add("hidden");
invitation.classList.remove("hidden");
setupScratch();
}, 650);
}
openBtn.addEventListener("click", openInvitation);
envelope.addEventListener("click", openInvitation);
envelope.addEventListener("keydown", (e) => {
if (e.key === "Enter" || e.key === " ") openInvitation();
});
let scratched = false;
function setupScratch() {
const rect = canvas.getBoundingClientRect();
const scale = window.devicePixelRatio || 1;
canvas.width = rect.width * scale;
canvas.height = rect.heig