blanche-toile.com/web/javascri...
#Webdev #JavaScript #matchMedia #Design #WebDesign #デザイン #Webデザイン #Web制作 #ホームページ制作
blanche-toile.com/web/javascri...
#Webdev #JavaScript #matchMedia #Design #WebDesign #デザイン #Webデザイン #Web制作 #ホームページ制作
Libraries like react-responsive provide React-friendly APIs for breakpoints.
💡 No need to handle matchMedia manually.
🛠️ Ideal for React-heavy projects.
But requires adding another dependency.
Libraries like react-responsive provide React-friendly APIs for breakpoints.
💡 No need to handle matchMedia manually.
🛠️ Ideal for React-heavy projects.
But requires adding another dependency.
✨ It includes:
• Built with GSAP Flip & ScrollTrigger
• Responsive design with GSAP matchMedia
• Flip animation on desktop & tablet
• Static layout on smaller screens
#GSAP #ScrollTrigger #Flip
🎬 youtu.be/-LE3aUVU608
✨ It includes:
• Built with GSAP Flip & ScrollTrigger
• Responsive design with GSAP matchMedia
• Flip animation on desktop & tablet
• Static layout on smaller screens
#GSAP #ScrollTrigger #Flip
🎬 youtu.be/-LE3aUVU608
(Firefox can't do HDR yet 🥺)
(Firefox can't do HDR yet 🥺)
Built it so the video takes over the full screen on page load, then transitions smoothly into the hero section. GSAP for the animation, matchMedia to handle mobile.
Clean way to give the video attention.
#WebflowDevelopment #GSAP
Built it so the video takes over the full screen on page load, then transitions smoothly into the hero section. GSAP for the animation, matchMedia to handle mobile.
Clean way to give the video attention.
#WebflowDevelopment #GSAP
I did use the matchMedia API because I wanted to render a completely separate component for results on mobile, but still
developer.mozilla.org/en-US/docs/W...
I did use the matchMedia API because I wanted to render a completely separate component for results on mobile, but still
developer.mozilla.org/en-US/docs/W...
~20 LoC including a matchMedia check 🤙
~20 LoC including a matchMedia check 🤙
It is very useful when you want to give your user to change his theme only on your website.
`matchMedia` can also be used for every media query you want.
#techtweets #day75
It is very useful when you want to give your user to change his theme only on your website.
`matchMedia` can also be used for every media query you want.
#techtweets #day75
The API doesn't exist but it seems like it will in the future: github.com/w3c/csswg-dr...
There is even a super light polyfill!
github.com/teetotum/mat...
The API doesn't exist but it seems like it will in the future: github.com/w3c/csswg-dr...
There is even a super light polyfill!
github.com/teetotum/mat...
Poucos dinossauros sabem, mas também dá para usar as media queries com a API matchMedia do próprio Javascript:
Isso é útil quando esconder a renderização de algum componente é mais benéfico do que esconder ele só com CSS
cc @sseraphini.bsky.social
Poucos dinossauros sabem, mas também dá para usar as media queries com a API matchMedia do próprio Javascript:
Isso é útil quando esconder a renderização de algum componente é mais benéfico do que esconder ele só com CSS
cc @sseraphini.bsky.social
matchMediaメソッドはかなり使える。
【JavaScriptでダークモードやライトモードのテーマカラーを判別する】
blanche-toile.com/web/javascri...
#Webdev #JavaScript
matchMediaメソッドはかなり使える。
【JavaScriptでダークモードやライトモードのテーマカラーを判別する】
blanche-toile.com/web/javascri...
#Webdev #JavaScript
blanche-toile.com/web/javascri...
#Webdev #JavaScript #matchMedia #Design #WebDesign #デザイン #Webデザイン
blanche-toile.com/web/javascri...
#Webdev #JavaScript #matchMedia #Design #WebDesign #デザイン #Webデザイン
t.d. í browser / js:
window?.matchMedia?.("(prefers-color-scheme:dark)")?.matches ? "dark" : "light"
eða browser / css:
@media (prefers-color-scheme: dark)
t.d. í browser / js:
window?.matchMedia?.("(prefers-color-scheme:dark)")?.matches ? "dark" : "light"
eða browser / css:
@media (prefers-color-scheme: dark)
- addEventListener on matchMedia queries is not supported on mobile safari - only desktop (the non-standard addListener works though)
- The MediaSource api for video sources isn't supported on mobile safari - only desktop.
- addEventListener on matchMedia queries is not supported on mobile safari - only desktop (the non-standard addListener works though)
- The MediaSource api for video sources isn't supported on mobile safari - only desktop.
blanche-toile.com/web/javascri...
#Webdev #JavaScript #DarkMode #LightMode
blanche-toile.com/web/javascri...
#Webdev #JavaScript #DarkMode #LightMode