ruby 2.5.7 Rails 5.2.4.3 OS: macOS Catalina
https://scrollrevealjs.org/ This is the official website.
ScrollReveal is a JavaScript library for easily animating elements as they enter/leave the viewport.
ScrollReveal is a JavaScript library that makes it easy to animate an element as it enters and exits the viewport.
* Google translate
# flow
1 Introduce ScrollReveal.js
2 Edit view
3 Edit js file
# Introduce ScrollReveal.js
① When reading with CDN (recommended)
In the head of application.html.erb
#### **`//unpkg.com/scrollreveal">`**
```<script src="https
Add this line to make ScrollReveal.js available.
#### **`erb:app/views/layouts/application.html.erb`**
<%= stylesheet_link_tag 'application', media: 'all', 'data-turbolinks-track': 'reload' %> <%= javascript_include_tag 'application', 'data-turbolinks-track': 'reload' %>
```② When downloading a file https://github.com/jlmakes/scrollreveal Download the zip file from here and download "scrollreveal.min.js" inside. Save it in app / assets / javascripts. After that, ```
Recommended Posts