-
-
Notifications
You must be signed in to change notification settings - Fork 86
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
New landing page, prefers-color-scheme, prefers-reduced-motion #343
Conversation
Code Climate has analyzed commit 5ad528f and detected 1 issue on this pull request. Here's the issue category breakdown:
View more on Code Climate. |
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.
First Pass
b4c3cb3
to
e4817f7
Compare
Accidentally upset codeclimate again because stylelint has some issues with |
5c744c3
to
94e0c09
Compare
export function getReducedMotion(): MediaQueryList { | ||
return window.matchMedia('(prefers-reduced-motion: reduce)'); | ||
} | ||
|
||
export function getDarkMode(): MediaQueryList { | ||
return window.matchMedia('(prefers-color-scheme: dark)'); | ||
} | ||
|
||
export function getLightMode(): MediaQueryList { | ||
return window.matchMedia('(prefers-color-scheme: light)'); | ||
} |
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.
What do you think about these names that are a bit more intuitive?
doesUserPreferReducedMotion()
isDarkMode
isLightMode
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.
I originally used a isDarkMode
and isLightMode
but that, to me, implies a boolean response, which right now is inaccurate. I could return .matches
which then gives us a boolean, but makes it so you can't register event handlers on it if you so choose.
@@ -0,0 +1,47 @@ | |||
import 'particles.js'; |
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.
I suggest tsParticles https://github.com/matteobruni/tsparticles instead of this obsolete library. You'll have less CPU usage client-side and tsParticles it's written in TypeScript. You can have also more configurations
…id duplicate id selectors
This will close #340.
I think it's ready for consideration.