A universal fullscreen button that appears in the lower-right corner of the canvas for every Nova64 demo. This allows users to quickly toggle fullscreen mode with a single click.
✅ Universal: Appears for all demos automatically
✅ Stylish UI: Neon cyan button with hover effects matching Nova64 theme
✅ Smooth Transitions: Animated hover and fullscreen transitions
✅ Keyboard Support: ESC key exits fullscreen mode
✅ Cross-browser: Works in Chrome, Firefox, Safari, Edge
✅ Icon Changes: Shows expand icon (⛶) normally, compress icon (⛉) in fullscreen
✅ Transparent Background: Blurred backdrop for modern glass effect
Enter Fullscreen:
Exit Fullscreen:
The fullscreen button is automatically created when the Nova64 runtime initializes. No setup needed in individual demos!
// In main.js - already configured!
import { createFullscreenButton } from '../runtime/fullscreen-button.js';
const canvas = document.getElementById('screen');
globalThis.fullscreenButton = createFullscreenButton(canvas);
runtime/fullscreen-button.jsThe fullscreen button:
bottom: 20px, right: 20pxPosition: Fixed (lower-right corner)
Size: 48px × 48px
Border: 2px solid cyan (#00ffff)
Background: Semi-transparent dark with blur effect
Shadow: Neon cyan glow
Z-index: 9999 (always on top)
Uses standard Fullscreen API with fallbacks:
requestFullscreen() - StandardwebkitRequestFullscreen() - SafarimozRequestFullScreen() - FirefoxmsRequestFullscreen() - IE11class FullscreenButton {
constructor(canvas)
createButton() // Creates DOM element with styles
attachListeners() // Sets up click and keyboard handlers
toggleFullscreen() // Toggles between fullscreen/normal
enterFullscreen() // Enters fullscreen mode
exitFullscreen() // Exits fullscreen mode
handleFullscreenChange() // Syncs state with browser
updateButton() // Updates icon based on state
destroy() // Cleanup (if needed)
}
this.isFullscreen = false; // Tracks current state
State is automatically synchronized when:
If you need to customize the button appearance, edit runtime/fullscreen-button.js:
// Change position
bottom: '20px', // Distance from bottom
right: '20px', // Distance from right
// Change size
width: '48px',
height: '48px',
// Change colors
border: '2px solid #00ffff', // Cyan border
color: '#00ffff', // Cyan icon
// Change background
background: 'rgba(21, 24, 34, 0.9)', // Dark semi-transparent
The ESC key is handled at two levels:
exitFullscreen()Both work together to ensure ESC always exits fullscreen mode.
Normal Mode:
┌──────────────────┐
│ ⛶ │ ← Expand icon
└──────────────────┘
Fullscreen Mode:
┌──────────────────┐
│ ⛉ │ ← Compress icon
└──────────────────┘
Test in:
When entering fullscreen:
fullscreen-button.js is loadedPotential additions:
No changes needed in individual demos! The button is globally available.
// In your demo's init()
if (globalThis.fullscreenButton) {
globalThis.fullscreenButton.destroy();
}
// Access the button instance
const fsBtn = globalThis.fullscreenButton;
// Check state
if (fsBtn.isFullscreen) {
console.log('Currently in fullscreen');
}
// Programmatically toggle
fsBtn.toggleFullscreen();
Created: runtime/fullscreen-button.js
Modified: src/main.js
✅ Universal fullscreen button added to all Nova64 demos
✅ ESC key support for easy exit
✅ Modern UI with neon effects matching Nova64 theme
✅ Zero configuration needed in individual demos
✅ Cross-browser compatible with fallbacks
✅ Performance optimized with minimal overhead
Status: ✅ Production Ready
Last Updated: October 26, 2025
Version: 1.0