Giter Club home page Giter Club logo

rig's Introduction

rig Build Status

Responsive image generator.

Generates media queries and srcset attributes. Resizes images using imgflo.

Usage

rig = require 'rig-up'

Running tests

Set environment variables for IMGFLO_KEY and IMGFLO_SECRET then run npm test.

rig's People

Contributors

paulyoung avatar jonnor avatar greenkeeperio-bot avatar bergie avatar jemgold avatar

Stargazers

JohnsonB avatar  avatar João Pedro Netto avatar Michael Anthony avatar Hao avatar  avatar

Watchers

Forrest O. avatar James Cloos avatar Nick Velloff avatar  avatar Michael Anthony avatar  avatar  avatar  avatar

Forkers

jdrew1303

rig's Issues

Convenience methods

The API is pretty clunky at the moment, but necessarily so.

For specific graphs, the API could be simplified to something like:

css = rig.passthrough block, config, [{
  selector: '#background'
  query: '(max-width: 503px)'
  width: 400
}]
  • specific graphs

For simple media query breakpoints with the same selector, the API could be something like:

css = rig.breakpoints block, config, graph, params,
  selector: '#background'
  breakpoints: [504, 1008]
  widths: [500, 1000, 1200] # or heights

This means that the 500px width image would be used for the media queries like so:

@media (min-width: 503px) { /* 500px wide image */ }
@media (min-width: 504px) and (max-width: 1007px)  { /* 1000px wide image */ }
@media (min-width: 1008px)  { /* 1200px wide image */ }

Any number of breakpoints could be supported as long as breakpoints.length == widths.length + 1.

  • breakpoints

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.