Skip to content

Customizable scroll up for rails monolith projects.

License

Notifications You must be signed in to change notification settings

sOM2H/my_scroll_up

Repository files navigation

MyScrollUp

codeclimate

Customizable scroll up for monolith projects

ScrollUp examples

Preview: https://myscrollup.herokuapp.com/

Installation

Add this line to your application's Gemfile:

gem 'jquery-rails'
gem 'my_scroll_up'

And then execute:

$ bundle install
$ rails g my_scroll_up:install

If you don't use bootstrap, then add this line to your head:

...
<link href="//netdna.bootstrapcdn.com/font-awesome/3.2.1/css/font-awesome.css" rel="stylesheet">
...

Add this code to your body:

app/views/layouts/application.html.erb

  ...
  <%= MyScrollUp.render.html_safe %>
  ...

Add requirements to js and css:

app/assets/javascripts/application.js

  ...
  //= require jquery
  //= require my_scroll_up
  ...

app/assets/stylesheets/application.css

  ...
  *= require my_scroll_up
  ...

Usage:

You can customize your icon style:

You can choose an icon from https://fontawesome.com/v3.2.1/icons/

(Default 'icon-chevron-up')

app/config/initializers/my_scroll_up.rb

MyScrollUp.configure do |config|
  # Set icon style example
  # config.icon = 'icon-chevron-up'
end

License

The MIT License

Contributing

  1. Fork it ( https://github.com/sOM2H/my_scroll_up/fork )
  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 a new Pull Request

About

Customizable scroll up for rails monolith projects.

Resources

License

Code of conduct

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published