my_scroll_up 0.1.2 → 0.1.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.gitignore +9 -0
- data/.rspec +2 -0
- data/.travis.yml +4 -0
- data/CODE_OF_CONDUCT.md +49 -0
- data/Gemfile +4 -0
- data/LICENSE.txt +21 -0
- data/README.md +36 -0
- data/Rakefile +6 -0
- data/bin/console +14 -0
- data/bin/setup +8 -0
- data/lib/my_scroll_up/version.rb +3 -0
- data/lib/my_scroll_up.rb +5 -0
- data/my_scroll_up.gemspec +25 -0
- data/vendor/assets/javascripts/my_scroll_up.js +16 -0
- data/vendor/assets/stylesheets/my_scroll_up.css +42 -0
- metadata +18 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: d8b1832630399cb17ae9f9301fe9801935408485e891d06ebeb35514d8ae0572
|
4
|
+
data.tar.gz: a303d3ab8cead740354ae016147bd816c725c5374770fd375f39dae703ba59ab
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 9899a61d49dad2f8a81b530328672a794bca61b7c3e8e5cda31ef9405e90a2cbbb7319b4523aed61b7ae5ca13e675a35243865fd821ab4346fc40f051dff459d
|
7
|
+
data.tar.gz: cb316aa06c5d61c26974a0bf00514ab40b98332adfdc96ddcfe896a92b54a726a50271ee1ba5b4534b729e175bc7dc773c3eb3ce5c9c7503602e069c4a0a1535
|
data/.gitignore
ADDED
data/.rspec
ADDED
data/.travis.yml
ADDED
data/CODE_OF_CONDUCT.md
ADDED
@@ -0,0 +1,49 @@
|
|
1
|
+
# Contributor Code of Conduct
|
2
|
+
|
3
|
+
As contributors and maintainers of this project, and in the interest of
|
4
|
+
fostering an open and welcoming community, we pledge to respect all people who
|
5
|
+
contribute through reporting issues, posting feature requests, updating
|
6
|
+
documentation, submitting pull requests or patches, and other activities.
|
7
|
+
|
8
|
+
We are committed to making participation in this project a harassment-free
|
9
|
+
experience for everyone, regardless of level of experience, gender, gender
|
10
|
+
identity and expression, sexual orientation, disability, personal appearance,
|
11
|
+
body size, race, ethnicity, age, religion, or nationality.
|
12
|
+
|
13
|
+
Examples of unacceptable behavior by participants include:
|
14
|
+
|
15
|
+
* The use of sexualized language or imagery
|
16
|
+
* Personal attacks
|
17
|
+
* Trolling or insulting/derogatory comments
|
18
|
+
* Public or private harassment
|
19
|
+
* Publishing other's private information, such as physical or electronic
|
20
|
+
addresses, without explicit permission
|
21
|
+
* Other unethical or unprofessional conduct
|
22
|
+
|
23
|
+
Project maintainers have the right and responsibility to remove, edit, or
|
24
|
+
reject comments, commits, code, wiki edits, issues, and other contributions
|
25
|
+
that are not aligned to this Code of Conduct, or to ban temporarily or
|
26
|
+
permanently any contributor for other behaviors that they deem inappropriate,
|
27
|
+
threatening, offensive, or harmful.
|
28
|
+
|
29
|
+
By adopting this Code of Conduct, project maintainers commit themselves to
|
30
|
+
fairly and consistently applying these principles to every aspect of managing
|
31
|
+
this project. Project maintainers who do not follow or enforce the Code of
|
32
|
+
Conduct may be permanently removed from the project team.
|
33
|
+
|
34
|
+
This code of conduct applies both within project spaces and in public spaces
|
35
|
+
when an individual is representing the project or its community.
|
36
|
+
|
37
|
+
Instances of abusive, harassing, or otherwise unacceptable behavior may be
|
38
|
+
reported by contacting a project maintainer at m1kh41l.melnyk@gmail.com. All
|
39
|
+
complaints will be reviewed and investigated and will result in a response that
|
40
|
+
is deemed necessary and appropriate to the circumstances. Maintainers are
|
41
|
+
obligated to maintain confidentiality with regard to the reporter of an
|
42
|
+
incident.
|
43
|
+
|
44
|
+
This Code of Conduct is adapted from the [Contributor Covenant][homepage],
|
45
|
+
version 1.3.0, available at
|
46
|
+
[http://contributor-covenant.org/version/1/3/0/][version]
|
47
|
+
|
48
|
+
[homepage]: http://contributor-covenant.org
|
49
|
+
[version]: http://contributor-covenant.org/version/1/3/0/
|
data/Gemfile
ADDED
data/LICENSE.txt
ADDED
@@ -0,0 +1,21 @@
|
|
1
|
+
The MIT License (MIT)
|
2
|
+
|
3
|
+
Copyright (c) 2019 Mikhail Melnyk
|
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,36 @@
|
|
1
|
+
# MyScrollUp
|
2
|
+
Primitive scroll up for monolith projects.
|
3
|
+
## Installation
|
4
|
+
|
5
|
+
Add this line to your application's Gemfile:
|
6
|
+
|
7
|
+
```ruby
|
8
|
+
gem 'my_scroll_up'
|
9
|
+
gem 'jquery-rails'
|
10
|
+
```
|
11
|
+
|
12
|
+
And then execute:
|
13
|
+
|
14
|
+
$ bundle
|
15
|
+
|
16
|
+
`app/views/layouts/application.html.erb`
|
17
|
+
|
18
|
+
Haml:
|
19
|
+
```haml
|
20
|
+
%a#scroll-up{:href => "javascript:"}
|
21
|
+
%i.icon-chevron-up
|
22
|
+
```
|
23
|
+
Erb:
|
24
|
+
```erb
|
25
|
+
<a id="scroll-up" href="javascript:">
|
26
|
+
<i class="icon-chevron-up"></i>
|
27
|
+
</a>
|
28
|
+
```
|
29
|
+
`app/assets/javascripts/application.js`
|
30
|
+
|
31
|
+
``` js
|
32
|
+
...
|
33
|
+
//= require jquery
|
34
|
+
//= require my_scroll_up
|
35
|
+
...
|
36
|
+
```
|
data/Rakefile
ADDED
data/bin/console
ADDED
@@ -0,0 +1,14 @@
|
|
1
|
+
#!/usr/bin/env ruby
|
2
|
+
|
3
|
+
require "bundler/setup"
|
4
|
+
require "my_scroll_up"
|
5
|
+
|
6
|
+
# You can add fixtures and/or initialization code here to make experimenting
|
7
|
+
# with your gem easier. You can also use a different console, if you like.
|
8
|
+
|
9
|
+
# (If you use this, don't forget to add pry to your Gemfile!)
|
10
|
+
# require "pry"
|
11
|
+
# Pry.start
|
12
|
+
|
13
|
+
require "irb"
|
14
|
+
IRB.start
|
data/bin/setup
ADDED
data/lib/my_scroll_up.rb
ADDED
@@ -0,0 +1,25 @@
|
|
1
|
+
# coding: utf-8
|
2
|
+
lib = File.expand_path('../lib', __FILE__)
|
3
|
+
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
|
4
|
+
require 'my_scroll_up/version'
|
5
|
+
|
6
|
+
Gem::Specification.new do |spec|
|
7
|
+
spec.name = "my_scroll_up"
|
8
|
+
spec.version = MyScrollUp::VERSION
|
9
|
+
spec.authors = ["Mikhail Melnyk"]
|
10
|
+
spec.email = ["m1kh41l.melnyk@gmail.com"]
|
11
|
+
|
12
|
+
spec.summary = %q{Primitive scroll up for monolith projects.}
|
13
|
+
spec.description = %q{Primitive scroll up for monolith projects.}
|
14
|
+
spec.homepage = "https://github.com/sOM2H/my_scroll_up"
|
15
|
+
spec.license = "MIT"
|
16
|
+
|
17
|
+
spec.files = `git ls-files -z`.split("\x0").reject { |f| f.match(%r{^(test|spec|features)/}) }
|
18
|
+
spec.bindir = "exe"
|
19
|
+
spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
|
20
|
+
spec.require_paths = ["lib"]
|
21
|
+
|
22
|
+
spec.add_development_dependency "bundler", "~> 1.11"
|
23
|
+
spec.add_development_dependency "rake", "~> 10.0"
|
24
|
+
spec.add_development_dependency "rspec", "~> 3.0"
|
25
|
+
end
|
@@ -0,0 +1,16 @@
|
|
1
|
+
$(window).scroll(function() {
|
2
|
+
if ($(this).scrollTop() >= 50) { // If page is scrolled more than 50px
|
3
|
+
$('#scroll-up').fadeIn(200); // Fade in the arrow
|
4
|
+
} else {
|
5
|
+
$('#scroll-up').fadeOut(200); // Else fade out the arrow
|
6
|
+
}
|
7
|
+
});
|
8
|
+
|
9
|
+
$( document ).ready(function() {
|
10
|
+
$( document.body ).click(function(e) {
|
11
|
+
if (e.target.id == "scroll-up" || e.target.className == "icon-chevron-up"){
|
12
|
+
$('html, body').animate({scrollTop : 0}, 500);
|
13
|
+
event.preventDefault();
|
14
|
+
}
|
15
|
+
});
|
16
|
+
});
|
@@ -0,0 +1,42 @@
|
|
1
|
+
#scroll-up {
|
2
|
+
position: fixed;
|
3
|
+
bottom: 20px;
|
4
|
+
right: 20px;
|
5
|
+
background: rgb(0, 0, 0);
|
6
|
+
background: rgba(0, 0, 0, 0.7);
|
7
|
+
width: 50px;
|
8
|
+
height: 50px;
|
9
|
+
display: block;
|
10
|
+
text-decoration: none;
|
11
|
+
-webkit-border-radius: 35px;
|
12
|
+
-moz-border-radius: 35px;
|
13
|
+
border-radius: 35px;
|
14
|
+
display: none;
|
15
|
+
-webkit-transition: all 0.3s linear;
|
16
|
+
-moz-transition: all 0.3s ease;
|
17
|
+
-ms-transition: all 0.3s ease;
|
18
|
+
-o-transition: all 0.3s ease;
|
19
|
+
transition: all 0.3s ease;
|
20
|
+
z-index: 999999;
|
21
|
+
}
|
22
|
+
#scroll-up i {
|
23
|
+
color: #fff;
|
24
|
+
margin: 0;
|
25
|
+
position: relative;
|
26
|
+
left: 16px;
|
27
|
+
top: 13px;
|
28
|
+
font-size: 19px;
|
29
|
+
-webkit-transition: all 0.3s ease;
|
30
|
+
-moz-transition: all 0.3s ease;
|
31
|
+
-ms-transition: all 0.3s ease;
|
32
|
+
-o-transition: all 0.3s ease;
|
33
|
+
transition: all 0.3s ease;
|
34
|
+
z-index: 999998;
|
35
|
+
}
|
36
|
+
#scroll-up:hover {
|
37
|
+
background: rgba(0, 0, 0, 0.9);
|
38
|
+
}
|
39
|
+
#scroll-up:hover i {
|
40
|
+
color: #fff;
|
41
|
+
top: 5px;
|
42
|
+
}
|
metadata
CHANGED
@@ -1,12 +1,12 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: my_scroll_up
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Mikhail Melnyk
|
8
8
|
autorequire:
|
9
|
-
bindir:
|
9
|
+
bindir: exe
|
10
10
|
cert_chain: []
|
11
11
|
date: 2019-04-21 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
@@ -58,7 +58,22 @@ email:
|
|
58
58
|
executables: []
|
59
59
|
extensions: []
|
60
60
|
extra_rdoc_files: []
|
61
|
-
files:
|
61
|
+
files:
|
62
|
+
- ".gitignore"
|
63
|
+
- ".rspec"
|
64
|
+
- ".travis.yml"
|
65
|
+
- CODE_OF_CONDUCT.md
|
66
|
+
- Gemfile
|
67
|
+
- LICENSE.txt
|
68
|
+
- README.md
|
69
|
+
- Rakefile
|
70
|
+
- bin/console
|
71
|
+
- bin/setup
|
72
|
+
- lib/my_scroll_up.rb
|
73
|
+
- lib/my_scroll_up/version.rb
|
74
|
+
- my_scroll_up.gemspec
|
75
|
+
- vendor/assets/javascripts/my_scroll_up.js
|
76
|
+
- vendor/assets/stylesheets/my_scroll_up.css
|
62
77
|
homepage: https://github.com/sOM2H/my_scroll_up
|
63
78
|
licenses:
|
64
79
|
- MIT
|