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

[Plugin] April Fools Languages joke #197

Merged
merged 15 commits into from
Jul 16, 2022
Merged

[Plugin] April Fools Languages joke #197

merged 15 commits into from
Jul 16, 2022

Conversation

seshrs
Copy link
Member

@seshrs seshrs commented Jul 10, 2022

Context

I've been meaning to include something like this in Primer Spec for years now 😅 (It started with a small "Project 6" prank on eecs485.org, and then expanded to a Halloween-themed prank on eecs485.org.)

In #157, I introduced a limited-edition spooky theme that will only appear around Halloween. My design goals:

  • The pranks/jokes that are not vital for loading the page should be lazy-loaded and executed asynchronously. (They should not impact the page load experience.)
  • Students need to opt-in for the pranks/jokes to take effect. Even after opting in, there should be a clear and easy way to opt out.

This PR introduces an April Fools gag using the same design goals. This PR also introduces a way for website admins to opt-out of showing these jokes if they really don't want them 😛

April Fools Languages

This PR adds a "Language selector" popover to all Primer Spec pages around April Fools, from March 29 until April 3.

The language popover appears next to the settings icon:

April Fools Language selector appears next to settings toggle

Clicking the toggle button opens a popover with a language-dropdown. We assume that the page's language is in English:

April Fools language dropdown, currently set to English

The language-dropdown provides three other options: Pig Latin, Pirate, and Upside Down:

April fools language selector dropdown

Here's what the page looks like after selecting "Upside Down":

Primer Spec page in 'upside down' language

Notice how the language-selection only affects the main content. Website viewers can easily revert the changes either by clicking "English" in the language-selector or by refreshing the page. (The "language" setting isn't persisted.)

Validation

PR Preview website: https://preview.sesh.rs/previews/eecs485staff/primer-spec/197/

Visit any page in the PR preview website above, then add ?enable_april_fools_languages=1 to the end of the URL. For example:

Future plans

I would ideally like to introduce three more April Fools jokes with different premises. Then, we could cycle between the jokes each year — students in 4-year university programs would get to see a different joke each year!

@seshrs seshrs added the semver/minor Pull Request proposes "minor" change label Jul 10, 2022
@seshrs seshrs added this to the FA 2022 milestone Jul 10, 2022
@github-actions
Copy link
Contributor

github-actions bot commented Jul 10, 2022

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

(Available until Mon Aug 15 2022.)

@seshrs seshrs marked this pull request as ready for review July 10, 2022 17:07
@seshrs
Copy link
Member Author

seshrs commented Jul 10, 2022

@noah-weingarden if you are interested and have bandwidth, I'd appreciate if you could check out this PR! Feel free to comment with other ideas and suggestions too :)

@seshrs seshrs merged commit af1aeb0 into develop Jul 16, 2022
@seshrs seshrs deleted the april-fools-languages branch July 16, 2022 01:06
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.

1 participant