├── css
└── eskju.jquery.scrollflow.css
├── CHANGELOG.md
├── examples
├── demo1.jpg
├── style.css
└── index.html
├── LICENSE
├── scrollflow.jquery.json
├── README.md
└── js
├── eskju.jquery.scrollflow.min.js
└── eskju.jquery.scrollflow.js
/css/eskju.jquery.scrollflow.css:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/CHANGELOG.md:
--------------------------------------------------------------------------------
1 | # Changelog
2 |
3 | ## Version 1.0.0
4 |
5 | + Basic plugin
--------------------------------------------------------------------------------
/examples/demo1.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/eskju/eskju-jquery-scrollflow/HEAD/examples/demo1.jpg
--------------------------------------------------------------------------------
/LICENSE:
--------------------------------------------------------------------------------
1 | The MIT License (MIT)
2 |
3 | Copyright (c) 2015 Christian Witte
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 all
13 | 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 THE
21 | SOFTWARE.
22 |
23 |
--------------------------------------------------------------------------------
/scrollflow.jquery.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "scrollflow",
3 | "title": "esKju's ScrollFlow Plugin",
4 | "description": "Enhance your website by fancy effects based on the user's scroll index. Pop-in, pop-out, sliding, sticky notes and much more. The plugin supports mobile devices and eldered browsers.",
5 | "keywords": [
6 | "index",
7 | "directory",
8 | "contents",
9 | "table"
10 | ],
11 | "version": "1.0.0",
12 | "author": {
13 | "name": "Chris Witte",
14 | "url": "https://www.facebook.com/chris.witte.design"
15 | },
16 | "maintainers": [
17 | {
18 | "name": "Chris Witte",
19 | "email": "jquery@cwdesigns.de",
20 | "url": "http://www.cwdesigns.de"
21 | }
22 | ],
23 | "licenses": [
24 | {
25 | "type": "MIT",
26 | "url": "https://github.com/eskju/eskju-jquery-scrollflow/blob/master/LICENSE"
27 | }
28 | ],
29 | "bugs": "https://github.com/eskju/eskju-jquery-scrollflow/issues",
30 | "homepage": "http://www.cwdesigns.de/eskju-jquery-scrollflow.html",
31 | "docs": "http://www.cwdesigns.de/eskju-jquery-scrollflow.html",
32 | "download": "https://github.com/eskju/eskju-jquery-scrollflow",
33 | "dependencies": {
34 | "jquery": ">=1.5"
35 | }
36 | }
--------------------------------------------------------------------------------
/examples/style.css:
--------------------------------------------------------------------------------
1 |
2 | html, body
3 | {
4 | height: 100%;
5 | }
6 |
7 | body
8 | {
9 | font-family: "Raleway", Arial, Helvetica, sans-serif;
10 | font-weight: 300;
11 | font-size: 14px;
12 | line-height: 20px;
13 | margin: 0px;
14 | -webkit-overflow-scrolling: none;
15 | }
16 |
17 | section
18 | {
19 | margin: 0px;
20 | padding: 0px;
21 | position: relative;
22 | overflow: hidden;
23 | }
24 |
25 | section article
26 | {
27 | width: 500px;
28 | margin: 0 auto;
29 | padding: 150px 0px 150px 0px;
30 | max-width: 80%;
31 | text-align: center;
32 | }
33 |
34 | section article h1,
35 | section article h2,
36 | section article h3
37 | {
38 | font-weight: 200;
39 | font-size: 30px;
40 | line-height: 40px;
41 | }
42 |
43 | section article strong
44 | {
45 | text-transform: uppercase;
46 | font-weight: 400;
47 | }
48 |
49 | section article a
50 | {
51 | color: #fff;
52 | }
53 |
54 | section article div
55 | {
56 | font-size: 100px;
57 | line-height: 100px;
58 | }
59 |
60 | section:first-child,
61 | section:last-child
62 | {
63 | background-color: #99bbbf;
64 | color: #fff;
65 | min-height: 100%;
66 | }
67 |
68 | section:first-child article,
69 | section:last-child article
70 | {
71 | position: absolute;
72 | top: 50%;
73 | width: 80%;
74 | max-width: 80%;
75 | margin-left: 10%;
76 | margin-top: -274px;
77 | }
78 |
79 | section:nth-child(2)
80 | {
81 | background-color: #D27459;
82 | color: #fff;
83 | }
84 |
85 | section:nth-child(3)
86 | {
87 | background-color: #f2f2f0;
88 | }
89 |
90 | section:nth-child(4)
91 | {
92 | background-color: #fff;
93 | }
94 |
95 | section:nth-child(5) h2
96 | {
97 | color: #fff;
98 | text-shadow: 1px 1px 3px rgba( 0, 0, 0, 0.25 );
99 | font-weight: 400;
100 | }
101 |
102 | section:nth-child(5) div
103 | {
104 | position: absolute;
105 | top: -25%;
106 | left: 0px;
107 | height: 150%;
108 | width: 150%;
109 | background-image: url("demo1.jpg");
110 | background-size: 100% 100%;
111 | }
112 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | # esKju's jQuery ScrollFlow Plugin
2 |
3 | ## What is it?
4 |
5 | Enhance your website by fancy effects based on the user's scroll index. Pop-in, pop-out, sliding, sticky notes and much more. The plugin supports mobile devices and eldered browsers.
6 | It was built using the jQuery library. Licensed under MIT and GPL licenses.
7 |
8 | ## Features
9 |
10 | + Eased animations for incremental mouse scroll-wheels
11 | + Adds fancy effects to your homepage
12 | + Customizable trough settings and CSS
13 | + Highly compatible
14 | + Highly customizable
15 | + Uses CSS3 transitions by default
16 |
17 | ## How to use
18 |
19 | ### 1. doctype
20 |
21 | Make sure you are using valid DOCTYPE. This is required for ScrollFlow to look and function correctly.
22 |
23 | ```
24 |
25 | ```
26 |
27 | ### 2. include files
28 |
29 | Loading jQuery from CDN (Content Delivery Network) is recommended.
30 | Include all ScrollFlow JavaScript files in addition.
31 |
32 | ```
33 |
34 |
35 | ```
36 |
37 | ### 3. html markup
38 |
39 | Add "scrollflow" and at least one of the following CSS classes to the desired object(s): slide-top, slide-left, slide-right, slide-bottom, -pop, -opacity
40 |
41 | ```
42 |
Slide-Top with opacity fading
43 |
Pop-Effect
44 | ```
45 |
46 | ### 4. fire plugin
47 |
48 | If you are not familiar with jQuery, please, read this tutorial for beginners.
49 |
50 | ```
51 | $( document ).ready( function( )
52 | {
53 | new ScrollFlow();
54 | } );
55 | ```
56 |
57 |
58 | ## Options
59 |
60 | Easy plugin, easy life. Configure things just to taste :)
61 |
62 | ```
63 | $( document ).ready( function( )
64 | {
65 | ScrollFlow( {
66 | your: "option",
67 | will: "be",
68 | the: "best"
69 | });
70 | } );
71 | ```
72 |
73 | | Option | Type | Default | Description |
74 | |---------------------|---------|-------|---------------------------------------------------|
75 | | durationOnLoad | int | 0 | Easing duration onLoad (important for page refresh) |
76 | | durationOnResize | int | 250 | Easing duration on window resize |
77 | | durationOnScroll | int | 500 | Easing duration on scroll |
78 |
79 |
80 | ## HTML Attributes
81 |
82 | Customize single HTML objects
83 |
84 | | Option | Type | Default | Description |
85 | |---------------------|---------|-------|---------------------------------------------------|
86 | | data-scrollflow-start | int | 25 | Define the scroll amount (in % of screen height) once the object is visible to start the animation |
87 | | data-scrollflow-distance | int| 50 | Define the scroll amount (in % of screen height) once the object is visible to end the animation |
88 |
89 |
90 | ## Author & Help
91 |
92 | For more information visit the author's page:
93 |
94 | + esKju's Playground
95 | + esKju's ScrollFlow Project Page
96 |
--------------------------------------------------------------------------------
/js/eskju.jquery.scrollflow.min.js:
--------------------------------------------------------------------------------
1 | /*
2 | * jQuery ScrollFlow plugin
3 | *
4 | * Copyright (c) 2015 Christian Witte
5 | * licensed under MIT license.
6 | *
7 | * https://github.com/eskju/eskju-jquery-scrollflow
8 | *
9 | * Version: 1.0.0
10 | *
11 | * Licensed under MIT license.
12 | * Permission is hereby granted, free of charge, to any person obtaining a copy of this software
13 | * and associated documentation files (the "Software"), to deal in the Software without restriction,
14 | * including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense,
15 | * and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so,
16 | * subject to the following conditions:
17 | * The above copyright notice and this permission notice shall be included in all copies or substantial
18 | * portions of the Software.
19 | *
20 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT
21 | * LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
22 | * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
23 | * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
24 | * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
25 | */
26 |
27 | $(document).ready(function(){new ScrollFlow}),$.fn.ScrollFlow=function(t){new ScrollFlow(t)},ScrollFlow=function(t){this.init(t)},$.extend(ScrollFlow.prototype,{init:function(t){this.options=$.extend({useMobileTimeouts:!0,mobileTimeout:100,durationOnLoad:0,durationOnResize:250,durationOnScroll:500},t),this.lastScrollTop=0,this.bindScroll(),this.bindResize(),this.update(this.options.durationOnLoad)},bindScroll:function(){var t=this;$(window).scroll(function(){t.update()}),$(window).bind("gesturechange",function(){t.update()})},bindResize:function(){var t=this;$(window).resize(function(){t.update(t.options.durationOnResize)})},update:function(t){var o=this;winHeight=$(window).height(),scrollTop=$(window).scrollTop(),$(".scrollflow").each(function(a,s){objOffset=$(s).offset(),objOffsetTop=parseInt(objOffset.top),effectDuration=o.options.durationOnScroll,effectDuration="undefined"!=typeof t?t:effectDuration,effectiveFromPercentage=isNaN(parseInt($(s).attr("data-scrollflow-start")/100))?-.25:parseInt($(s).attr("data-scrollflow-start"))/100,scrollDistancePercentage=isNaN(parseInt($(s).attr("data-scrollflow-distance")/100))?.5:parseInt($(s).attr("data-scrollflow-distance"))/100,effectiveFrom=objOffsetTop-winHeight*(1-effectiveFromPercentage),effectiveTo=objOffsetTop-winHeight*(1-scrollDistancePercentage),parallaxScale=.8,parallaxOpacity=0,parallaxOffset=-100,factor=0,scrollTop>effectiveFrom&&(factor=(scrollTop-effectiveFrom)/(effectiveTo-effectiveFrom),factor=factor>1?1:factor),options={opacity:1,scale:1,translateX:0,translateY:0},$(s).hasClass("-opacity")&&(options.opacity=0+factor),$(s).hasClass("-pop")&&(options.scale=.8+.2*factor),$(s).hasClass("-slide-left")&&(options.translateX=-1*(-100+100*factor)),$(s).hasClass("-slide-right")&&(options.translateX=-100+100*factor),$(s).hasClass("-slide-top")&&(options.translateY=-1*(-100+100*factor)),$(s).hasClass("-slide-bottom")&&(options.translateY=-100+100*factor),$(s).css({webkitFilter:"opacity("+options.opacity+")",mozFilter:"opacity("+options.opacity+")",oFilter:"opacity("+options.opacity+")",msFilter:"opacity("+options.opacity+")",filter:"opacity("+options.opacity+")",webkitTransform:"translate3d( "+parseInt(options.translateX)+"px, "+parseInt(options.translateY)+"px, 0px ) scale("+options.scale+")",mozTransform:"translate3d( "+parseInt(options.translateX)+"px, "+parseInt(options.translateY)+"px, 0px ) scale("+options.scale+")",oTransform:"translate3d( "+parseInt(options.translateX)+"px, "+parseInt(options.translateY)+"px, 0px ) scale("+options.scale+")",msTransform:"translate3d( "+parseInt(options.translateX)+"px, "+parseInt(options.translateY)+"px, 0px ) scale("+options.scale+")",transform:"translate3d( "+parseInt(options.translateX)+"px, "+parseInt(options.translateY)+"px, 0px ) scale("+options.scale+")",transition:"all "+effectDuration+"ms ease-out"})})}});
--------------------------------------------------------------------------------
/examples/index.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | esKju's jQuery ScrollFlow plugin
6 |
7 |
8 |
9 |
10 |
11 |
33 |
34 |
35 |
36 |
37 |
38 |
39 |
40 |
41 |
42 |
43 |
44 |
esKju's ScrollFlow
45 |
AVAILABLE SOON (www.cwdesigns.de)
46 |
This is an example page for esKju's jQuery ScrollFlow plugin.
47 |
Scroll down
48 |
↓
49 |
50 |
51 |
52 |
53 |
54 |
55 |
56 |
Pop-In
57 |
Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum. Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet. Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum. Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet.
58 |
59 |
60 |
61 |
62 |
63 |
64 |
65 |
66 |
67 |
68 |
Slide-Right
69 |
Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua.
70 |
71 |
72 |
73 |
Slide-Left
74 |
Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua.
75 |
76 |
77 |
78 |
79 |
80 |
81 |
82 |
83 |
84 |
85 |
86 |
87 |
88 |
Slide-Top
89 |
Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua.
90 |
91 |
92 |
93 |
Slide-Bottom
94 |
Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua.