-
Notifications
You must be signed in to change notification settings - Fork 4
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add homepage confetti effect for 50th Remote Hack celebration #216
base: main
Are you sure you want to change the base?
Conversation
setInterval(createConfetti, 100); | ||
|
||
// Stop creating confettis after 5 seconds | ||
setTimeout(() => { | ||
clearInterval(createConfetti); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There's no interval id being stored, so it'll never stop 🤔
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If you can limit it easily to just the homepage then I think this is fine
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yep I guess it is fine! I thought it was worth noting that the code from Copilot Workspace Preview has syntax issues 😓
confetti.y += confetti.speed; | ||
confetti.x += Math.cos(confetti.angle) * confetti.speed; | ||
|
||
// Remove confetti that are out of the screen |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If we don't do this, it is basically just a memory leak?
@lpmi-13 I generated this PR using the Copilot Workspace Preview 😎 . It took me a few attempts to get this PR, and I think there's still some issues with it! Will try and fix it up and merge if I get a chance. ![]() |
Adds a celebratory confetti effect to the homepage for the 50th Remote Hack event, respecting user preferences for reduced motion and only triggering under specific conditions.
assets/confetti.js
that creates a falling confetti effect using plain JavaScript. This effect respects the "prefers-reduced-motion" media query and automatically stops generating new confetti after 5 seconds._hacks/50.md
to includecelebrate: true
in the front matter, which is used to conditionally trigger the confetti effect._layouts/default.html
to conditionally include theconfetti.js
script based on thecelebrate: true
condition in the front matter of the event page.For more details, open the Copilot Workspace session.