Repository navigation
feat(app): hidden CRT mode, unlocked by the secret code in preferences #3704
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
Merged
+615
−1
Merged
Changes from all commits
Commits
Show all changes
5 commits
Select commit
Hold shift + click to select a range
29e3d75
feat(app): hidden CRT mode, unlocked by the Konami code in preferences
jordan-simonovski a73bb75
fix(app): pass style lint in the CRT stylesheets, ignore keydown even…
jordan-simonovski 405ce55
chore: keep the easter egg out of the changeset
jordan-simonovski 2a9a134
fix(app): scope the CRT text glow with a module class so the producti…
jordan-simonovski a6d7ba6
fix(app): address CRT mode review findings
jordan-simonovski File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,5 @@ | ||
| --- | ||
| '@hyperdx/app': patch | ||
| --- | ||
|
|
||
| feat: small addition to user preferences |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,99 @@ | ||
| // Above modals and notifications; it never takes pointer events. | ||
| .overlay { | ||
| position: fixed; | ||
| inset: 0; | ||
| z-index: 2147483647; | ||
| pointer-events: none; | ||
|
|
||
| // Rounded screen corners plus edge shading read as a curved tube. | ||
| border-radius: 3vmin / 4vmin; | ||
| box-shadow: | ||
| 0 0 0 10vmin #000, | ||
| inset 0 0 10vmin rgb(0 0 0 / 55%); | ||
| background: radial-gradient( | ||
| ellipse at center, | ||
| rgb(255 255 255 / 3%) 0%, | ||
| transparent 55%, | ||
| rgb(0 0 0 / 35%) 100% | ||
| ); | ||
|
|
||
| &::before, | ||
| &::after { | ||
| content: ''; | ||
| position: absolute; | ||
| inset: 0; | ||
| } | ||
|
|
||
| // The light half keeps the lines visible on the dark theme. | ||
| &::before { | ||
| background: repeating-linear-gradient( | ||
| to bottom, | ||
| rgb(0 0 0 / 30%) 0, | ||
| rgb(0 0 0 / 30%) 2px, | ||
| rgb(255 255 255 / 3%) 2px, | ||
| rgb(255 255 255 / 3%) 4px | ||
| ); | ||
| } | ||
|
|
||
| // RGB phosphor mask; this layer also carries the flicker. | ||
| &::after { | ||
| background: repeating-linear-gradient( | ||
| to right, | ||
| rgb(255 0 0 / 5%) 0, | ||
| rgb(255 0 0 / 5%) 1px, | ||
| rgb(0 255 0 / 4%) 1px, | ||
| rgb(0 255 0 / 4%) 2px, | ||
| rgb(0 0 255 / 5%) 2px, | ||
| rgb(0 0 255 / 5%) 3px | ||
| ); | ||
| will-change: opacity; | ||
| animation: flicker 0.15s steps(1) infinite; | ||
|
|
||
| @media (prefers-reduced-motion: reduce) { | ||
| animation: none; | ||
| } | ||
| } | ||
| } | ||
|
|
||
| .roll { | ||
| position: absolute; | ||
| inset: 0 0 auto; | ||
| height: 15vh; | ||
| background: linear-gradient( | ||
| to bottom, | ||
| transparent, | ||
| rgb(255 255 255 / 7%), | ||
| transparent | ||
| ); | ||
| transform: translateY(-15vh); | ||
| will-change: transform; | ||
| animation: roll 8s linear infinite; | ||
|
|
||
| @media (prefers-reduced-motion: reduce) { | ||
| display: none; | ||
| } | ||
| } | ||
|
|
||
| @keyframes roll { | ||
| to { | ||
| transform: translateY(100vh); | ||
| } | ||
| } | ||
|
|
||
| @keyframes flicker { | ||
| 0% { | ||
| opacity: 0.7; | ||
| } | ||
|
|
||
| 50% { | ||
| opacity: 1; | ||
| } | ||
| } | ||
|
|
||
| // Chromatic aberration and phosphor glow on all text. `.root` goes on <html>. | ||
| .root body { | ||
| text-shadow: | ||
| 0.6px 0 rgb(255 0 80 / 35%), | ||
| -0.6px 0 rgb(0 200 255 / 35%), | ||
| 0 0 2px color-mix(in srgb, currentcolor 60%, transparent); | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,18 @@ | ||
| import { useEffect } from 'react'; | ||
|
|
||
| import styles from './CrtOverlay.module.scss'; | ||
|
|
||
| /** Full-viewport CRT effect. Mount only while the preference is on. */ | ||
| export function CrtOverlay() { | ||
| useEffect(() => { | ||
| // A module class, not a global selector: the production build rejects those. | ||
| document.documentElement.classList.add(styles.root); | ||
| return () => document.documentElement.classList.remove(styles.root); | ||
| }, []); | ||
|
|
||
| return ( | ||
| <div className={styles.overlay} aria-hidden data-testid="crt-overlay"> | ||
| <div className={styles.roll} /> | ||
| </div> | ||
| ); | ||
| } |
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
🟡 P2 — The CRT mode switch has no accessible name
SettingContainerrenders "CRT mode" as plain text in a sibling div that is not linked to theSwitch, so a screen reader announces only "switch, off". Give the switch a name: passaria-label="CRT mode", or use the Switch's ownlabelprop.Advisory. Fix if it is a small defect in code this PR changes; otherwise reply in the thread. Do not widen the PR or touch files it did not already change. How to respond