https://github.com/mujadded/loading_screen
Loading screen for ruby and rails apps
https://github.com/mujadded/loading_screen
loading-spinner ruby-gem
Last synced: over 1 year ago
JSON representation
Loading screen for ruby and rails apps
- Host: GitHub
- URL: https://github.com/mujadded/loading_screen
- Owner: Mujadded
- License: mit
- Created: 2018-01-19T16:20:00.000Z (over 8 years ago)
- Default Branch: master
- Last Pushed: 2018-03-10T14:18:50.000Z (over 8 years ago)
- Last Synced: 2025-03-01T05:11:37.972Z (over 1 year ago)
- Topics: loading-spinner, ruby-gem
- Language: Ruby
- Size: 69.3 KB
- Stars: 9
- Watchers: 4
- Forks: 4
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE.txt
Awesome Lists containing this project
README
# LoadingScreen
[](https://badge.fury.io/rb/loading_screen)
This gem allow to load a simple loading screen on any page that you want.
## Installation
Add this line to your application's Gemfile:
for the latest development branch
```ruby
gem 'loading_screen', git: https://github.com/Mujadded/loading_screen.git
```
for the stable branch
```ruby
gem 'loading_screen', '~> 0.2.3'
```
And then execute:
$ bundle install
## Usage
Gem has dependency on jquery so if not already added, please add
```
//= require jquery
```
and then this line in application.js
```
//= require loading_screen
```
After that add this line in application.css
```
*= require loading_screen
```
### Using available CSS animations
We are all set, to use it with default `rotating_square` animation in any view file ( for e.g.: index.html.erb) just add:
```
<%= loading_screen %>
```
or
```
<%= loading_screen style: :default %>
```
There are also other loading animation available for you to choose from just add `style` option, like:
```
<%= loading_screen style: :double_bounce %>
```
```
<%= loading_screen style: :rectangle_bounce %>
```
```
<%= loading_screen style: :wandering_cubes %>
```
```
<%= loading_screen style: :cube_grid %>
```
```
<%= loading_screen style: :dotted_spinner %>
```
```
<%= loading_screen style: :dotted_line %>
```
Other animations will be available shortly...
### Using custom gif images
if you want to add custom gif as the loading screen just download a gif and put it inside the `assets/images/` and add `gif` option:
```
<%= loading_screen gif: 'your gif file name witout ".gif" ' %>
```
And you are done. Enjoy
### Using custom colors
You can change the background color and the loader color ( color for only css animation loader, gif's color depends on the image ) by adding `background` option and `color` option:
```
<%= loading_screen color: 'red', background: 'green' %>
```
Color format like `hash`, `rgb`, `rgba`, etc all css color format are acceptable
## Development
Currently only fullscreen loading animation is supported. `Div` based loading animation feature will be added soon.
## Contributing
Bug reports and pull requests are welcome. So fork the repo and create a pull :).
## License
The gem is available as open source under the terms of the [MIT License](https://opensource.org/licenses/MIT).