Skip to content
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

[RFC] Halloween easter egg! #157

Merged
merged 15 commits into from
Apr 28, 2022
Merged

[RFC] Halloween easter egg! #157

merged 15 commits into from
Apr 28, 2022

Conversation

seshrs
Copy link
Member

@seshrs seshrs commented Feb 28, 2022

TLDR: This PR introduces a set of temporary "Halloween" easter eggs that are only enabled between Oct. 25 and Nov. 5. (The easter egg can be activated any time via a URL "hack".)

Context

I've been meaning to insert a couple of easter eggs in Primer Spec for a while now. While it's probably too late to do something for April 1, 2022, I thought I'd start by adding a few Halloween easter eggs (including a new limited-edition "Spooky" theme!)

My design goals:

  • Easter eggs should not change the appearance of the page without user consent. (After all, Primer Spec is used to render project specs, which are typically a significant part of the course grade — that responsibility shouldn't be taken lightly.)
    • Exception: Only the icons in the Topbar (sidebar-toggle, settings-toggle) may be modified to improve the discoverability of the Easter egg.
    • Currently, I think the best way for users to opt-in to the Easter egg is by registering a new subtheme.
  • The easter egg business logic (even determining whether the easter egg should be displayed) should not block the page load and should not complicate the logic of the core Primer Spec components.
    • Hence, easter eggs are lazily-loaded via a new "conditional plugins" framework that is downloaded and executed separately.
  • It should be possible to enable the easter egg any time.
    • The new "conditional plugin" framework allows enabling the plugins via URL query params. For instance, the halloween plugin can be enabled by adding ?enable_halloween=1 to any Primer Spec page.
    • Just after Halloween, a message is displayed in the browser's dev console about the URL trick above. That way, curious students can discover the hack!

Validation

Check out the new Halloween Easter egg by adding ?enable_halloween=1 to any Primer Spec page in the preview website for this PR. For instance: https://preview.sesh.rs/previews/eecs485staff/primer-spec/157/?enable_halloween=1

Here are some screenshots:

  • On page load, the Topbar icons are modified.

    image

  • New temporary subtheme in the Settings pane

  • 'Spooky' theme (dark-only theme, and it includes some spooky fonts!)

    Screen Shot 2022-04-25 at 11 07 04 PM
  • Double-clicking on the page causes a ghost to appear!

    Screen.Recording.2022-04-25.at.11.08.23.PM.mov
  • Every few seconds, a ghostly emoji peaks from the left/right margin of the page. Clicking on it causes it to randomly fly across the page!

    Screen.Recording.2022-04-25.at.11.09.46.PM.mov

Feedback welcome

I'd welcome any feedback about the Halloween easter egg (or any easter egg idea really):

  • Do you think the icon-changes are too distracting?
  • Do you have ideas for other colors we could change in the 'Spooky' subtheme?
  • ...any other ideas?

@seshrs seshrs added the semver/minor Pull Request proposes "minor" change label Feb 28, 2022
@seshrs seshrs added this to the SP/SU 22 milestone Feb 28, 2022
@github-actions
Copy link
Contributor

github-actions bot commented Feb 28, 2022

The spec from this PR is available at https://preview.sesh.rs/previews/eecs485staff/primer-spec/157/.

(Available until Sat May 28 2022.)

@seshrs seshrs marked this pull request as ready for review February 28, 2022 21:18
@awdeorio
Copy link
Contributor

awdeorio commented Mar 1, 2022

Super cool idea! What are your thoughts about making this opt-in vs. opt-out?

@seshrs
Copy link
Member Author

seshrs commented Mar 1, 2022

Super cool idea! What are your thoughts about making this opt-in vs. opt-out?

Most of the Easter-eggs in this PR are opt-in (you have to choose the “Spooky” theme). The only auto-opt-in Easter egg is updating the icons at the top of the page. I personally think it’s not intrusive, but I’m open to hearing your thoughts on if it’s too distracting.

If those icon-changes are too distracting, I’m wondering how else the “Spooky” theme will be discovered. How would students know that the temporary theme is available?

@awdeorio
Copy link
Contributor

awdeorio commented Mar 3, 2022

I don't think this is too distracting at all. If you'd like, you could create issues in the relevant EECS 485 repos to opt-in to all easter eggs!

@seshrs
Copy link
Member Author

seshrs commented Mar 3, 2022

I don't think this is too distracting at all. If you'd like, you could create issues in the relevant EECS 485 repos to opt-in to all easter eggs!

OH you meant that repos should opt-in to the Easter eggs?

I initially thought that I could automatically enable this entire Easter egg on all Primer Spec pages. Do you think that’s a bit heavy-handed, and that courses should opt-in to Easter eggs? (I’m beginning to subscribe to the opt-in idea too, but I need to give it more thought.)

@awdeorio
Copy link
Contributor

awdeorio commented Mar 7, 2022

I think that it's totally fine to enable easter eggs automatically!

@seshrs
Copy link
Member Author

seshrs commented Apr 26, 2022

I changed the spooky body font to something more readable. It isn't really spooky any more, but I think that's okay. (Thanks for the suggestion for legibility @bellakiminsun!)

I also added a new easter egg animation with ghostly emoji peaking out of the margins. If you click it, it will randomly fly across the page!

seshrs added 3 commits April 25, 2022 23:20
When opening and closing the settings pane, it's possible for the Halloween plugin to be inited multiple times. We need to ensure that we don't insert more than one emoji at a time.
@seshrs
Copy link
Member Author

seshrs commented Apr 27, 2022

When testing on a Windows machine, it looks like the theme preview for the spooky theme looks wonky. I'll need to tinker around with this more.

@seshrs
Copy link
Member Author

seshrs commented Apr 28, 2022

With 44328ae, the theme preview now looks correct (tested on Chrome 100 on Windows 11 via Browserstack):

image

@seshrs seshrs merged commit 4220ae4 into develop Apr 28, 2022
@seshrs seshrs deleted the halloween branch April 28, 2022 04:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
semver/minor Pull Request proposes "minor" change
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants