Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/will123195/responsive
Simple browser window size checkpoints
https://github.com/will123195/responsive
Last synced: 10 days ago
JSON representation
Simple browser window size checkpoints
- Host: GitHub
- URL: https://github.com/will123195/responsive
- Owner: will123195
- Created: 2015-09-10T01:23:28.000Z (over 9 years ago)
- Default Branch: master
- Last Pushed: 2018-03-25T20:12:13.000Z (over 6 years ago)
- Last Synced: 2024-10-06T08:41:21.574Z (3 months ago)
- Language: JavaScript
- Homepage:
- Size: 2.93 KB
- Stars: 3
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: readme.md
Awesome Lists containing this project
README
# responsive
Simple window size checkpoints in the browser.
## Install
```
npm i -S responsive
```## Usage
```js
import responsive from 'responsive'const opts = {
checkpoints: {
small: {
width: [0, 400]
},
big: {
width: [401, null]
}
}
}
responsive(opts, data => {
// This callback fires immediately and whenever the window size changes
console.log(data)
// {
// width: 824,
// height: 977,
// square: false,
// portrait: true,
// landscape: false,
// matches: ['big']
// }
})
```