Coffeebox

This is an opinionated rewrite of Facebox.

Features

  1. Everything is converted to coffescript
  2. Shipped as a Rails 3.2/4.0 asset pipeline compatible gem
  3. Includes spin.js instead of a gif preloader
  4. Preloads images with imgpreload
  5. Built-in support for turbolinks
  6. Support for fully custom popup HTML
  7. Does not stay in DOM when closed

Installation

Add this line to your application's Gemfile:

gem 'coffeebox'

And then execute:

$ bundle

Or install it yourself as:

$ gem install coffeebox

Usage

require it in application.js

//= require coffeebox

Or require it in application.js.coffe

#= require coffeebox

and in application.css.sass:

//= require coffeebox

or (sass\scss only)

// Set some options
$facebox-background: #fff
$facebox-close-color: #000
$facebox-close-hover: #333
$facebox-close-size: 25px
$facebox-border: 3px solid rgba(0, 0, 0, 0)
$facebox-border-radius: 25px

// Then import
@import coffeebox

Contributing

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