0.0.2 • Published 8 years ago

lunch-breakpoints v0.0.2

Weekly downloads
4
License
MIT
Repository
github
Last release
8 years ago

lunch-breakpoints 🍕

💻 📲 Simple and lightweight implementation to run javascript on viewport breakpoints

What

Define functions that run once when viewport enters the breakpoints

new LunchBreakpoints({
  default: function() {
    // any width larger than 1024
  },
  breakpoints: {
    1024: function(){
      // smaller than 1024 and bigger than 768  
    },
    768: function() {
      // smaller than 768
    }
  }
});

Usage

Instantiate with new:

new LunchBreakpoints(options);

where options...

Instalation

Whichever you prefer:

<script src="lunch-breakpoints.js"></script>
npm install --save-dev lunch-breakpoints
var LunchBreakpoints = require('lunch-breakpoints');
import LunchBreakpoints from 'lunch-breakpoints';

Lunch Breakpoints because lunch break and breakpoints