Professional UI with separate About page and smooth loading experience
Stage 10 โ 10a
The Stage 10 series transformed the application from a single-page experience into a professional multi-page web application with proper navigation and loading feedback.
Evolution Summary:
Request: "In version 10 (movieCreditsSim10.html) lets move the 'Welcome to Computer Science' and 'Current Features' to a page, aboutMCreditsApp10.html and link that page to the sim file in a nav bar scenario. This way, we can see the beautiful app and read about it elsewhere. Link the 'about' page to the sim page."
Key Requirements Identified:
Design Goal: Separate the interactive experience from educational content, allowing users to enjoy the full-screen animation without clutter.
Core Approach: Create Bootstrap navigation bar, move educational content to separate page, maintain bi-directional links.
Key Changes to movieCreditsSim10.html:
/* Stage 10: Navigation bar styling */
.navbar {
background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
padding: 15px 30px;
box-shadow: 0 4px 6px rgba(0, 0, 0, 0.3);
}
.navbar-brand {
color: white !important;
font-size: 24px;
font-weight: bold;
text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3);
}
.nav-link {
color: rgba(255, 255, 255, 0.9) !important;
font-size: 18px;
margin: 0 10px;
transition: all 0.3s ease;
}
.nav-link:hover {
color: white !important;
text-shadow: 0 0 10px rgba(255, 255, 255, 0.5);
}
<!-- Stage 10: Navigation Bar -->
<nav class="navbar navbar-expand-lg">
<div class="container-fluid">
<a class="navbar-brand" href="#">๐ฌ Movie Credits Simulator</a>
<div class="collapse navbar-collapse">
<ul class="navbar-nav ms-auto">
<li class="nav-item">
<a class="nav-link active" href="movieCreditsSim10.html">Simulator</a>
</li>
<li class="nav-item">
<a class="nav-link" href="aboutMCreditsApp10.html">About</a>
</li>
</ul>
</div>
</div>
</nav>
Key Features of aboutMCreditsApp10.html:
1. Separation of Concerns:
2. Navigation Patterns:
3. User Experience:
4. CSS Gradients:
Feedback: "This is perfect! I notice that it takes some time for the canvas to load, meanwhile the two buttons are below. Let's create a 'Loading' message in the middle of the page and hide the buttons until the canvas is loaded. Then, we can remove the 'Loading' message. Let's do this in a 10a version"
Design Goal: Provide visual feedback during loading, prevent premature interaction, smooth transition when ready.
Solution: Add loading message with animated spinner, hide controls until setup() completes, fade transitions for polish.
HTML Structure Changes:
<!-- Stage 10a: Loading message -->
<div id="loading-message">
<h2>Loading...</h2>
<div class="spinner"></div>
</div>
<!-- Stage 9: Control buttons -->
<div id="controls">
<button id="startPauseBtn">START</button>
<button id="muteBtn">๐</button>
</div>
CSS for Loading Indicator:
/* Stage 10a: Loading message styling */
#loading-message {
position: absolute;
top: 50%;
left: 50%;
transform: translate(-50%, -50%);
text-align: center;
z-index: 200;
}
#loading-message h2 {
font-size: 36px;
background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
-webkit-background-clip: text;
-webkit-text-fill-color: transparent;
background-clip: text;
animation: pulse 1.5s ease-in-out infinite;
}
.spinner {
border: 4px solid rgba(255, 255, 255, 0.1);
border-top: 4px solid #667eea;
border-radius: 50%;
width: 50px;
height: 50px;
animation: spin 1s linear infinite;
margin: 0 auto;
}
@keyframes spin {
0% { transform: rotate(0deg); }
100% { transform: rotate(360deg); }
}
@keyframes pulse {
0%, 100% { opacity: 1; }
50% { opacity: 0.5; }
}
JavaScript State Management:
/**
* STAGE 10a: Hides the loading message and shows the control buttons
* Called after setup() completes
*/
function hideLoadingMessage() {
// Get the loading message element
let loadingMessage = document.getElementById('loading-message');
// Get the controls element
let controls = document.getElementById('controls');
// Hide loading message with fade effect
if (loadingMessage) {
loadingMessage.style.transition = 'opacity 0.5s ease-out';
loadingMessage.style.opacity = '0';
// Remove from DOM after fade completes
setTimeout(() => {
loadingMessage.style.display = 'none';
}, 500);
}
// Show controls with fade-in effect
if (controls) {
controls.style.display = 'flex';
controls.style.opacity = '0';
// Trigger fade-in after a brief delay
setTimeout(() => {
controls.style.transition = 'opacity 0.5s ease-in';
controls.style.opacity = '1';
}, 100);
}
console.log("๐ฌ Loading complete! Controls now visible.");
}
function setup() {
// ... existing setup code ...
// *** STAGE 10a: Hide loading message and show controls ***
hideLoadingMessage();
console.log("โ
Setup complete! Canvas is ready.");
}
1. Loading State Management:
2. CSS Animations:
3. CSS Gradient Text:
4. Smooth Transitions:
5. DOM Manipulation:
| Feature | Stage 9b | Stage 10 | Stage 10a |
|---|---|---|---|
| Page Layout | Single page with info panels | โ Multi-page with navigation | โ Multi-page with navigation |
| Navigation Bar | โ None | โ Bootstrap navbar | โ Bootstrap navbar |
| About Page | โ None | โ Separate page | โ Separate page |
| Canvas View | Partial (info panels above/below) | โ Full-screen immersive | โ Full-screen immersive |
| Loading State | โ No feedback | โ No feedback | โ Animated spinner |
| Button Visibility | Always visible | Always visible | โ Hidden until ready |
| Transitions | Basic button hover | Basic button hover | โ Smooth fade effects |
| User Experience | Functional but cluttered | Clean and professional | โ Polished with feedback |
1. Multi-Page Architecture:
2. Bootstrap Framework:
3. Loading State Patterns:
4. CSS Advanced Techniques:
5. User Experience Principles:
1. Iterative Refinement:
2. Separation of Concerns:
3. Responsive Design:
Modify the loading spinner and text:
Challenge: Create a multi-colored spinner using multiple border colors!
Replace spinner with a progress bar:
Question: How would you actually track real loading progress (audio + canvas)?
Customize the navbar appearance:
Challenge: Create an animated gradient that shifts colors!
Adjust fade transition speeds:
Question: Which timing feels most professional and why?
Create footer with additional links:
Challenge: Make footer stick to bottom even with scrolling!
What We Built:
Technical Skills Demonstrated:
User Experience Improvements:
From Stage 1 to Stage 10a:
Final Feature Set:
This project demonstrates professional full-stack web development from start to finish! ๐