Breakpoints
Glaze features a deep integration with GSAPs matchMedia functionality, which allows you to define breakpoints and create responsive animations.
Setup
To use breakpoints, you need to define them inside the configuration object.
The default
breakpoint will be used if no other breakpoint is defined. In the
example above, all animations will be applied from 640px
and up. If no default
is defined, (min-width: 1px)
will be used.
Usage
Breakpoints are defined at the start of the animation string.
This will animate all the set properties when the screen width is 640px or more.
You can also define multiple breakpoints:
In this example, the animation will be applied when the screen width is 768px
or more. If the screen width is 1024px
or more, the background color will
change in addition to the other animations.