Skip to content

Instantly share code, notes, and snippets.

@brandonjp
Created May 22, 2025 01:54
Show Gist options
  • Save brandonjp/8fd171b4b53d8b93f55f0d51dd5e5876 to your computer and use it in GitHub Desktop.
Save brandonjp/8fd171b4b53d8b93f55f0d51dd5e5876 to your computer and use it in GitHub Desktop.
<!--
THEATER MENU CUSTOMIZER - COMPLETE SOLUTION
Instructions for partner theaters:
1. Copy this entire code block below
2. Paste it into your website before the closing </body> tag or directly in the custom code section of you Theatre Details
Page
3. Change ONLY these two lines below:
- Line 15: Change 'Performances' to your desired text for Shows
- Line 16: Change 'Workshops' to your desired text for Classes
-->
<script>
// ============= CHANGE THESE TWO LINES ONLY =============
var showsNewText = 'Performances'; // What to replace "Shows" with
var classesNewText = 'Workshops'; // What to replace "Classes" with
// ========================================================
// Add CSS to hide menu initially
var style = document.createElement('style');
style.innerHTML = `
.theater-menu-hidden {
opacity: 0 !important;
transition: opacity 0.3s ease;
}
.theater-menu-visible {
opacity: 1 !important;
}
`;
document.head.appendChild(style);
// Run when page loads
function initTheaterMenu() {
// Hide navigation immediately
var navs = document.querySelectorAll('.navbar-collapse, .navbar-nav, nav, .menu, .navigation');
for (var i = 0; i < navs.length; i++) {
navs[i].classList.add('theater-menu-hidden');
}
// Find and update the specific menu links
var allLinks = document.querySelectorAll('a[href]');
var updatedCount = 0;
for (var i = 0; i < allLinks.length; i++) {
var link = allLinks[i];
var href = link.getAttribute('href');
var text = link.textContent.trim();
// Update Shows → Custom Text
if (href === '/shows' && text === 'Shows') {
link.textContent = showsNewText;
updatedCount++;
}
// Update Classes → Custom Text
if (href === '/classes' && text === 'Classes') {
link.textContent = classesNewText;
updatedCount++;
}
}
// Show navigation after updates
setTimeout(function() {
for (var i = 0; i < navs.length; i++) {
navs[i].classList.remove('theater-menu-hidden');
navs[i].classList.add('theater-menu-visible');
}
}, 100);
}
// Start when page is ready
if (document.readyState === 'loading') {
document.addEventListener('DOMContentLoaded', initTheaterMenu);
} else {
initTheaterMenu();
}
</script>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment