Below is an example of a self-contained HTML/CSS/JavaScript "Mario Golf Overlay" widget. You can copy this code into an HTML file and open it in your browser to see the widget in action. (For your stream or YouTube overlay, you can include this in your broadcasting/streaming software as a browser source.) The widget displays:
- Current course and weather (simulated data that rotates every 10 seconds)
- Current time (updates every second)
- Upcoming courses in the rotation
- The current character being played (randomly selected each rotation)
- A creative “Power-Up” message to add some flair!
Feel free to customize the styling, data, and behavior as desired.
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Mario Golf Overlay Widget</title>
<meta name="viewport" content="width=device-width, initial-scale=1">
<style>
/* Reset some default styling */
body, html {
margin: 0;
padding: 0;
overflow: hidden;
font-family: Arial, sans-serif;
background: transparent;
}
/* Widget container styling */
.widget-container {
width: 350px;
background: rgba(255, 255, 255, 0.8);
border: 2px solid #000;
border-radius: 10px;
padding: 15px;
box-shadow: 3px 3px 10px rgba(0, 0, 0, 0.3);
}
.header {
text-align: center;
font-weight: bold;
font-size: 24px;
margin-bottom: 10px;
text-shadow: 2px 2px 4px #aaa;
}
.section {
margin-bottom: 12px;
}
.section h3 {
margin: 0 0 5px;
font-size: 18px;
border-bottom: 1px solid #ccc;
padding-bottom: 3px;
}
.section p, .section li {
margin: 4px 0;
font-size: 16px;
}
#courseRotation {
list-style-type: disc;
padding-left: 20px;
}
/* Creative flair: a subtle animated border */
@keyframes borderPulse {
0% { border-color: #f39c12; }
50% { border-color: #e74c3c; }
100% { border-color: #f39c12; }
}
.widget-container {
animation: borderPulse 4s infinite;
}
</style>
</head>
<body>
<div class="widget-container" id="overlayWidget">
<div class="header">Mario Golf</div>
<div class="section" id="courseWeather">
<h3>Current Course & Weather</h3>
<p id="currentCourse">Course: Tropical Greens</p>
<p id="currentWeather">Weather: Sunny</p>
</div>
<div class="section" id="timeSection">
<h3>Current Time</h3>
<p id="currentTime"></p>
</div>
<div class="section" id="upcomingCourses">
<h3>Upcoming Courses</h3>
<ul id="courseRotation">
<li>Cloud Nine</li>
<li>Sunny Shores</li>
<li>Misty Mountains</li>
</ul>
</div>
<div class="section" id="characterSection">
<h3>Current Character</h3>
<p id="currentCharacter">Luigi</p>
</div>
<div class="section" id="creativeSection">
<h3>Power-Up!</h3>
<p>Hit the bonus for an extra wind boost!</p>
</div>
</div>
<script>
// Update the current time every second
function updateTime(){
const now = new Date();
const timeString = now.toLocaleTimeString();
document.getElementById('currentTime').textContent = timeString;
}
setInterval(updateTime, 1000);
updateTime(); // initial call
// Sample courses array with course name and weather
const courses = [
{course: "Tropical Greens", weather: "Sunny"},
{course: "Cloud Nine", weather: "Cloudy"},
{course: "Sunny Shores", weather: "Windy"},
{course: "Misty Mountains", weather: "Foggy"}
];
let currentIndex = 0;
// Function to cycle course, weather, upcoming courses, and character
function cycleCourse() {
// Update the current course and weather
const currentData = courses[currentIndex];
document.getElementById('currentCourse').textContent = "Course: " + currentData.course;
document.getElementById('currentWeather').textContent = "Weather: " + currentData.weather;
// Update upcoming courses (next three in rotation)
const upcomingList = document.getElementById('courseRotation');
upcomingList.innerHTML = "";
for (let i = 1; i < 4; i++){
const index = (currentIndex + i) % courses.length;
const li = document.createElement('li');
li.textContent = courses[index].course;
upcomingList.appendChild(li);
}
// Randomly select the current character
const characters = ["Mario", "Luigi", "Peach", "Yoshi", "Donkey Kong"];
const randomChar = characters[Math.floor(Math.random() * characters.length)];
document.getElementById('currentCharacter').textContent = randomChar;
// Move to the next course in the rotation
currentIndex = (currentIndex + 1) % courses.length;
}
// Cycle the course info every 10 seconds (adjust as needed)
setInterval(cycleCourse, 10000);
cycleCourse(); // initial update
</script>
</body>
</html>
Instructions to View the Widget
-
Copy the Code: Copy the above code into a file named, for example, mario-golf-overlay.html.
-
Open in Browser: Open the file in your favorite browser. You should see the widget with the current course, weather, time, upcoming courses, the current character, and a creative power-up message.
-
Use as Overlay: In your streaming software (OBS, Streamlabs, etc.) or as a browser source for your YouTube stream, add this HTML file to overlay it on your stream.
Feel free to tweak the styles, animation, or data arrays to best suit your needs. Enjoy your overlay, and have fun with your Mario Golf content!