// JavaScript to show the hidden message and play the Spotify song function showMessage() { const box = document.querySelector('.hidden-box'); box.classList.toggle('clicked'); // Toggle the hidden class to hide/show the back of the box const back = document.querySelector('.box-back'); back.classList.toggle('hidden'); // Play the Spotify song const audio = document.getElementById('spotifyAudio'); audio.play(); }
Preview:
downloadDownload PNG
downloadDownload JPEG
downloadDownload SVG
Tip: You can change the style, width & colours of the snippet with the inspect tool before clicking Download!
Click to optimize width for Twitter