loading_screen 0.1.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA1:
3
+ metadata.gz: 8a724111a15093897d49eca0ff2a323d294c44cd
4
+ data.tar.gz: 3cfc72da3ad20140f84eb73ec677968f444bea96
5
+ SHA512:
6
+ metadata.gz: 91a3d1a7bea5602aff3e2bfe9fbfbcd722f0cfc7787a6517add699a932db3dee48da38472bd78075cd104e6595325efe75b46a2ec765b5d20b172ad831f64932
7
+ data.tar.gz: fb9f88c044c882915c9fe9099e2cfe819150276b4a00f5deb9ccf2b986d87f2976cf787c08086347d18c23e008c376bed0b7ef1800dc70d343e35022278520d7
data/.gitignore ADDED
@@ -0,0 +1,13 @@
1
+ /.bundle/
2
+ /.yardoc
3
+ /_yardoc/
4
+ /coverage/
5
+ /doc/
6
+ /pkg/
7
+ /spec/reports/
8
+ /tmp/
9
+
10
+ # rspec failure tracking
11
+ .rspec_status
12
+
13
+ \.idea/
data/.rspec ADDED
@@ -0,0 +1,3 @@
1
+ --format documentation
2
+ --color
3
+ --require spec_helper
data/CHANGELOG.md ADDED
@@ -0,0 +1,7 @@
1
+ ## Releases
2
+ ## 1.0.0
3
+
4
+ ### Basic Initializations
5
+ * Add documentation
6
+ * CSS, JS, function added
7
+ * Helper added for using `loading_screen` tags in view
data/CONTRIBUTORS.md ADDED
@@ -0,0 +1,15 @@
1
+ Nodeunit contributors (sorted alphabetically)
2
+ ============================================
3
+
4
+ * **[Mujadded Al Rabbani Alif](https://github.com/mujadded)**
5
+
6
+ * Gem basic initializations
7
+ * Initializations of basic format of css and js (default reporter)
8
+
9
+ * **[Yeasin Ar Rahman](https://github.com/nibircse)**
10
+
11
+ * Documentation building
12
+ * Code reviewer
13
+
14
+ **[Full contributors list](https://github.com/mujadded/loading_screen/contributors).**
15
+
data/Gemfile ADDED
@@ -0,0 +1,5 @@
1
+ source "https://rubygems.org"
2
+
3
+ git_source(:github) {|repo_name| "https://github.com/#{repo_name}" }
4
+
5
+ gemspec
data/LICENSE.txt ADDED
@@ -0,0 +1,21 @@
1
+ The MIT License (MIT)
2
+
3
+ Copyright (c) 2018 Mujadded Al Rabbani Alif
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in
13
+ all copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
21
+ THE SOFTWARE.
data/README.md ADDED
@@ -0,0 +1,55 @@
1
+ # LoadingScreen
2
+
3
+ This gem allow to load a simple loading screen on any page that you want.
4
+
5
+ ## Installation
6
+
7
+ Add this line to your application's Gemfile:
8
+
9
+ for the latest development branch
10
+ ```ruby
11
+ gem 'loading_screen', git: https://github.com/Mujadded/loading_screen.git
12
+ ```
13
+
14
+ for the stable branch
15
+ ```ruby
16
+ gem 'loading_screen'
17
+ ```
18
+
19
+ And then execute:
20
+
21
+ $ bundle install
22
+
23
+ ## Usage
24
+
25
+ Add this line in application.js
26
+ ```
27
+ //= require loading_screen
28
+ ```
29
+
30
+ Add this line in application.css
31
+ ```
32
+ *= require loading_screen
33
+ ```
34
+
35
+ All now to use it in any view just add in any .erb file inside view
36
+ ```
37
+ <%= loading_screen %>
38
+ ```
39
+
40
+ Or if you want to add custom gif as the loading screen just download a gif and put it inside the assets/images/
41
+ ```
42
+ <%= loading_screen gif: 'your gif file name witout ".gif" ' %>
43
+ ```
44
+ And you are done. Enjoy !
45
+ ## Development
46
+
47
+ Currently only fullscreen loading animation is supported. `Div` based loading animation feature will be added soon.
48
+
49
+ ## Contributing
50
+
51
+ Bug reports and pull requests are welcome. So fork the repo and create a pull :) .
52
+
53
+ ## License
54
+
55
+ The gem is available as open source under the terms of the [MIT License](https://opensource.org/licenses/MIT).
data/Rakefile ADDED
@@ -0,0 +1,6 @@
1
+ require "bundler/gem_tasks"
2
+ require "rspec/core/rake_task"
3
+
4
+ RSpec::Core::RakeTask.new(:spec)
5
+
6
+ task :default => :spec
@@ -0,0 +1,14 @@
1
+ module LoadingScreen::LoadingScreenHelper
2
+
3
+ def loading_screen(options={})
4
+ content_tag :div, '', class: 'loading_screen-spinner' do
5
+ if options[:gif].present?
6
+ content_tag :div do
7
+ image_tag(options[:gif], id: 'loading_screen-spinner-image')
8
+ end
9
+ else
10
+ content_tag :div, '', id: 'loading_screen-spinner-css'
11
+ end
12
+ end
13
+ end
14
+ end
@@ -0,0 +1,3 @@
1
+ module LoadingScreen
2
+ class Engine < ::Rails::Engine; end
3
+ end
@@ -0,0 +1,3 @@
1
+ module LoadingScreen
2
+ VERSION = "0.1.0"
3
+ end
@@ -0,0 +1,4 @@
1
+ require "loading_screen/engine"
2
+
3
+ module LoadingScreen
4
+ end
@@ -0,0 +1,27 @@
1
+
2
+ lib = File.expand_path("../lib", __FILE__)
3
+ $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
4
+ require "loading_screen/version"
5
+
6
+ Gem::Specification.new do |spec|
7
+ spec.name = "loading_screen"
8
+ spec.version = LoadingScreen::VERSION
9
+ spec.authors = ["Mujadded Al Rabbani Alif"]
10
+ spec.email = ["Mujadded.alif@gmail.com"]
11
+
12
+ spec.summary = "Loading screen for time-consuming background task"
13
+ spec.description = "It loads up a animation until the full page a loaded in the browser"
14
+ spec.homepage = "https://github.com/Mujadded/loading_screen"
15
+ spec.license = "MIT"
16
+
17
+ spec.files = `git ls-files -z`.split("\x0").reject do |f|
18
+ f.match(%r{^(test|spec|features)/})
19
+ end
20
+ spec.bindir = "exe"
21
+ spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
22
+ spec.require_paths = ["lib"]
23
+
24
+ spec.add_development_dependency "bundler", "~> 1.16"
25
+ spec.add_development_dependency "rake", "~> 10.0"
26
+ spec.add_development_dependency "rspec", "~> 3.0"
27
+ end
File without changes
@@ -0,0 +1,16 @@
1
+ $( window ).bind('load',function() {
2
+
3
+ // hide spinner
4
+ $(".loading_screen-spinner").fadeOut();
5
+
6
+ // show spinner on AJAX start
7
+ $(document).ajaxStart(function(){
8
+ $(".loading_screen-spinner").show();
9
+ });
10
+
11
+ // hide spinner on AJAX stop
12
+ $(document).ajaxStop(function(){
13
+ $(".loading_screen-spinner").fadeOut();
14
+ });
15
+
16
+ });
@@ -0,0 +1,42 @@
1
+ .loading_screen-spinner{
2
+ position: fixed;
3
+ left: 0px;
4
+ top: 0px;
5
+ width: 100%;
6
+ height: 100%;
7
+ z-index: 9999;
8
+ background: rgb(249,249,249);
9
+ }
10
+ .loading_screen-spinner > div:first-child{
11
+ position: absolute;
12
+ top:40%;
13
+ left:45%;
14
+ }
15
+
16
+ #loading_screen-spinner-css {
17
+ width: 80px;
18
+ height: 80px;
19
+ background-color: orange;
20
+
21
+ -webkit-animation: sk-rotateplane 1.2s infinite ease-in-out;
22
+ animation: sk-rotateplane 1.2s infinite ease-in-out;
23
+ }
24
+
25
+ @-webkit-keyframes sk-rotateplane {
26
+ 0% { -webkit-transform: perspective(120px) }
27
+ 50% { -webkit-transform: perspective(120px) rotateY(180deg) }
28
+ 100% { -webkit-transform: perspective(120px) rotateY(180deg) rotateX(180deg) }
29
+ }
30
+
31
+ @keyframes sk-rotateplane {
32
+ 0% {
33
+ transform: perspective(120px) rotateX(0deg) rotateY(0deg);
34
+ -webkit-transform: perspective(120px) rotateX(0deg) rotateY(0deg)
35
+ } 50% {
36
+ transform: perspective(120px) rotateX(-180.1deg) rotateY(0deg);
37
+ -webkit-transform: perspective(120px) rotateX(-180.1deg) rotateY(0deg)
38
+ } 100% {
39
+ transform: perspective(120px) rotateX(-180deg) rotateY(-179.9deg);
40
+ -webkit-transform: perspective(120px) rotateX(-180deg) rotateY(-179.9deg);
41
+ }
42
+ }
metadata ADDED
@@ -0,0 +1,102 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: loading_screen
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.1.0
5
+ platform: ruby
6
+ authors:
7
+ - Mujadded Al Rabbani Alif
8
+ autorequire:
9
+ bindir: exe
10
+ cert_chain: []
11
+ date: 2018-01-24 00:00:00.000000000 Z
12
+ dependencies:
13
+ - !ruby/object:Gem::Dependency
14
+ name: bundler
15
+ requirement: !ruby/object:Gem::Requirement
16
+ requirements:
17
+ - - "~>"
18
+ - !ruby/object:Gem::Version
19
+ version: '1.16'
20
+ type: :development
21
+ prerelease: false
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - "~>"
25
+ - !ruby/object:Gem::Version
26
+ version: '1.16'
27
+ - !ruby/object:Gem::Dependency
28
+ name: rake
29
+ requirement: !ruby/object:Gem::Requirement
30
+ requirements:
31
+ - - "~>"
32
+ - !ruby/object:Gem::Version
33
+ version: '10.0'
34
+ type: :development
35
+ prerelease: false
36
+ version_requirements: !ruby/object:Gem::Requirement
37
+ requirements:
38
+ - - "~>"
39
+ - !ruby/object:Gem::Version
40
+ version: '10.0'
41
+ - !ruby/object:Gem::Dependency
42
+ name: rspec
43
+ requirement: !ruby/object:Gem::Requirement
44
+ requirements:
45
+ - - "~>"
46
+ - !ruby/object:Gem::Version
47
+ version: '3.0'
48
+ type: :development
49
+ prerelease: false
50
+ version_requirements: !ruby/object:Gem::Requirement
51
+ requirements:
52
+ - - "~>"
53
+ - !ruby/object:Gem::Version
54
+ version: '3.0'
55
+ description: It loads up a animation until the full page a loaded in the browser
56
+ email:
57
+ - Mujadded.alif@gmail.com
58
+ executables: []
59
+ extensions: []
60
+ extra_rdoc_files: []
61
+ files:
62
+ - ".gitignore"
63
+ - ".rspec"
64
+ - CHANGELOG.md
65
+ - CONTRIBUTORS.md
66
+ - Gemfile
67
+ - LICENSE.txt
68
+ - README.md
69
+ - Rakefile
70
+ - app/helpers/loading_screen/loading_screen_helper.rb
71
+ - lib/loading_screen.rb
72
+ - lib/loading_screen/engine.rb
73
+ - lib/loading_screen/version.rb
74
+ - loading_screen.gemspec
75
+ - vendor/assets/images/.keep
76
+ - vendor/assets/javascripts/loading_screen.js
77
+ - vendor/assets/stylesheets/loading_screen.css
78
+ homepage: https://github.com/Mujadded/loading_screen
79
+ licenses:
80
+ - MIT
81
+ metadata: {}
82
+ post_install_message:
83
+ rdoc_options: []
84
+ require_paths:
85
+ - lib
86
+ required_ruby_version: !ruby/object:Gem::Requirement
87
+ requirements:
88
+ - - ">="
89
+ - !ruby/object:Gem::Version
90
+ version: '0'
91
+ required_rubygems_version: !ruby/object:Gem::Requirement
92
+ requirements:
93
+ - - ">="
94
+ - !ruby/object:Gem::Version
95
+ version: '0'
96
+ requirements: []
97
+ rubyforge_project:
98
+ rubygems_version: 2.5.2.1
99
+ signing_key:
100
+ specification_version: 4
101
+ summary: Loading screen for time-consuming background task
102
+ test_files: []