Spicon
Cool feature that makes any element on your Rails application spin on mouseover.
Supports
Rails 2.3+
Installation
Add this line to your application's Gemfile
:
gem 'spicon'
And then run:
$ bundle install
Or install it yourself by executing:
$ gem install spicon
Once done, include the below line to application's assets/stylesheets/application.css
file
*= require spicon
Usage
Just include the class .spicon
to the element you want to apply the spin feature on. For example
%a.fa.fa-twitter.fa-2x.spicon{href: "https://twitter.com/"}
As simple as that!
By using .spicon
class by default the element will spin for 2 secs(2000ms)
, infinitely
and in alternate
direction. You can also customize these by given values of your own choice
Customization
When using customized classes make sure you use it in the following format :
.spicon-{duration of the spin}-{number of spins}-{direction of the spin}
for instance,
.spicon-4s-2-alternate_reverse
The first attribute represents the
duration of the spin
in seconds. Accordigly you can specify a number of your choice ranging from1s(fastest) to 10s(slowest)
The second attribute represents the
number of spins
ranging from1 to 6
. You can also useinfinite
instead of a number for infinite spins.The third attribute represents the
direction of spin
, various options arenormal
- Spins in clockwise directionreverse
- Spins in anti-clockwise directionalternate
- Spins in clockwise direction first and then anticlockwise alternatelyalternate_reverse
- Spins in anti-clockwise direction first and then clockwise alternately
Contributing
- Fork it
- Create your feature branch -
git checkout -b my-new-feature
- Commit your changes -
git commit -m 'Add some feature'
- Push to the branch -
git push origin my-new-feature
- Create new Pull Request