Skip to content

Commit

Permalink
Adjusted the welcome message for first timers
Browse files Browse the repository at this point in the history
  • Loading branch information
profvjreddi committed Jun 3, 2024
1 parent 533e89e commit b09025d
Showing 1 changed file with 15 additions and 5 deletions.
20 changes: 15 additions & 5 deletions scripts/welcome/confetti.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,32 +4,42 @@ document.addEventListener("DOMContentLoaded", function() {
// Check if it's the user's first visit
if (!localStorage.getItem('firstVisit')) {
// Set the first visit flag in local storage
localStorage.setItem('firstVisit', 'false');
localStorage.setItem('firstVisit', 'true');

// Display a welcome message
const welcomeMessage = document.createElement('div');
welcomeMessage.innerText = "Welcome!";
welcomeMessage.innerHTML = `
<div style="color: white; font-size: 3em; font-weight: bold;">
Welcome to the ML Systems Book!
</div>
<div style="color: white; font-size: 1.5em; margin-top: 20px;">
A collaborative resource for learning about machine learning systems.
</div>
<div style="color: white; font-size: 1.2em; margin-top: 30px;">
Prof. Vijay Janapa Reddi, Harvard University.
</div>
`;
welcomeMessage.style.position = 'fixed';
welcomeMessage.style.top = '0';
welcomeMessage.style.left = '0';
welcomeMessage.style.width = '100%';
welcomeMessage.style.height = '100%';
welcomeMessage.style.display = 'flex';
welcomeMessage.style.flexDirection = 'column';
welcomeMessage.style.justifyContent = 'center';
welcomeMessage.style.alignItems = 'center';
welcomeMessage.style.backgroundColor = 'rgba(0, 0, 0, 0.5)'; // Semi-opaque background
welcomeMessage.style.color = 'white';
welcomeMessage.style.fontSize = '5em';
welcomeMessage.style.textAlign = 'center';
welcomeMessage.style.zIndex = '1000';
welcomeMessage.style.opacity = '1';
welcomeMessage.style.transition = 'opacity 2s'; // Add transition for opacity
welcomeMessage.style.transition = 'opacity 12s'; // Add transition for opacity
document.body.appendChild(welcomeMessage);

// Trigger the confetti script
const script = document.createElement('script');
script.src = "https://run.confettipage.com/here.js";
script.setAttribute('data-confetticode', 'U2FsdGVkX19H2OWLrooaDFegLFthmLw91OrLhii6zjU20bEELdqOM8ZxlWHaher3attSQq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Sd0wiuMBsJ5iY9YamkrYuAoHgo0GBClOTXMSek4VgRSbNUkAQt8Gc/KLyhKrkMCuv+a1YiDazuHEZ8T9x70YLI1r52Kd/z4MP4ROCgqrpI17CnjyOs3Dk7pj1/i93Hd6U56W/E/6eMn2EF8IQFPaUmmmulnGD62UhzcgRF+c9fbO/oTtoCH0804Nmm23iaxWjq7rVZAzteziBgBF25ACDPjFwxXHESnYfDs3MWyquqwcLSR5j9SuMlF97reG+g4qXJdbVr5gnR/RaVMXAhd8+yZkv');
document.body.appendChild(script);

// Fade out the welcome message after a few seconds
Expand Down

0 comments on commit b09025d

Please sign in to comment.