README.md in turbolinks-animate-1.0.0 vs README.md in turbolinks-animate-1.1.0

- old
+ new

@@ -43,16 +43,31 @@ gem 'turbolinks-animate', github: 'jonhue/turbolinks-animate' ``` ## Usage -The javascript files will be added to the asset pipeline and available for you to use: +The javascript and CSS files will be added to the asset pipeline and are available for you to use: ```js //= require turbolinks-animate + +$(document).on( 'turbolinks:load', function() { + $('body').turbolinksAnimate(); + turbolinksAnimateAppear(); +}); +$(document).on( 'turbolinks:request-start', function() { + turbolinksAnimateDisappear(); +}); +$(window).on( 'popstate beforeunload', function(event) { + turbolinksAnimateDisappear(); +}); ``` +```scss +@import "animate" +``` + To use turbolinks-animate, replace the `body` tag in your layout with the `turbolinks_animate_body` view helper: ```ruby = turbolinks_animate_body class: 'custom-class' do = yield @@ -67,10 +82,10 @@ def index turbolinks_animate 'fadein' end def more - turbolinks_animate { desktop: 'fadein', mobile: 'fadeinright' } + turbolinks_animate({ desktop: 'fadein', mobile: 'fadeinright' }) end end ``` [Here](https://github.com/jonhue/turbolinks-animate.js) are more details about the usage of turbolinks-animate.js.