Building a 21-Glass Musical Champagne Tower Time Capsule With Vanilla JS & Web Audio
1. A 21-Slot Art Deco Time Capsule
I built Midnight With Friends, a New Year 2027 time capsule styled as an Art Deco champagne tower. The pyramid contains 21 glass slots arranged across 6 tiers, where friends can pour up to 3 sealed notes that remain locked until 00:00 on January 1, 2027.
2. Tower Layout & Vanilla JS State
Keeping the implementation in vanilla JavaScript and CSS made it straightforward to render the 6-tier triangle (1 through 6 glasses per row) cleanly across desktop and mobile viewports. Each glass tracks whether it is empty, filled, or sealed, while enforcing the 3-note limit per friend before locking the messages for the 2027 countdown.
3. Web Audio Auld Lang Syne Chime Mapping
Rather than loading external audio files, each of the 6 tiers maps to frequencies from Auld Lang Syne synthesized on the fly with the Web Audio API. Interacting with or pouring into a glass triggers a crystal-like oscillator tone with a fast attack and smooth decay, turning the tower into a playable instrument.
4. Midnight Cork Pop Mini-Game
Alongside the time capsule, I put together the Midnight Cork Pop mini-game using the same Art Deco visual system and vanilla JS animation loop. Both the 21-glass tower and the mini-game are live at Midnight With Friends.