GithubHelp home page GithubHelp logo

noahlh / clear_eyes Goto Github PK

View Code? Open in Web Editor NEW

This project forked from superacidjax/clear_eyes

0.0 2.0 0.0 133 KB

Automatic Retina Image Handling for Rails 3.1+

License: MIT License

Ruby 100.00%

clear_eyes's Introduction

Clear Eyes

This makes is super easy to handle Retina images in your Rails 3.1+ apps. It adds r_image_tag that can be used in place of the existing image_tag and it'll automatically serve up Retina images to devices that can handle the resolution and normal images otherwise.

How to Use it

In your Gemfile:

gem 'clear_eyes'

In your application.js:

//= require clear_eyes

Usage

= r_image_tag('[email protected]')

This assumes that [email protected] is sized properly for retina images. Remember, Retina images are double the pixel density of standard images.

Now that you have Retina-ready images and a way to serve them up in your views, what about non-retina machines?

There's a rake for that! You only need to create one image (the Retina one).

Running this: rake clear_eyes:convert will convert create non-retina images from the images in app/assets/images. It's even take care of the file names! Pretty cool right? So, [email protected] will automatically be copied, downsized and named my_awesome_image.jpg.

You can thank me later.

Contributing

Please contribute! The community is much smarter than me and your help would be appreciated!

  1. Fork it
  2. Create your feature branch (git checkout -b my-new-feature)
  3. Commit your changes (git commit -am 'Added some feature')
  4. Push to the branch (git push origin my-new-feature)
  5. Create new Pull Request

clear_eyes's People

Contributors

noahlh avatar superacidjax avatar thedom avatar

Watchers

 avatar  avatar

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.