Coffeebox
This is an opinionated rewrite of Facebox.
Features
- Everything is converted to coffescript
- Shipped as a Rails 3.2/4.0 asset pipeline compatible gem
- Includes spin.js instead of a gif preloader
- Preloads images with imgpreload
- Built-in support for turbolinks
- Support for fully custom popup HTML
- 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
$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
- Fork it
- Create your feature branch (
git checkout -b my-new-feature) - Commit your changes (
git commit -am 'Add some feature') - Push to the branch (
git push origin my-new-feature) - Create new Pull Request