- Copy text to clipboard
- Format datetime
- Check is valid URL
- Responsive Object
- Sort array of object by value
- String to slug
- Time Since
- Generate unique ID
Responsive Object v1.0.1 - demo
Return the correct setting object based on the current breakpoint using matchMedia()
const config = {
screen: 'desktop',
color: 'white',
responsive: [
{
breakpoint: 1280,
settings: {
screen: '1280',
color: 'blue',
isTablet: true
}
},
{
breakpoint: 768,
settings: {
screen: '768',
}
}
]
};
new ResponsiveObject({
object: config,
onMatched: (data) => {
// do something
console.log('onMatched', data);
}
});