ratchet_design 0.1.10 → 0.1.11
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/app/assets/javascripts/ratchet/base/form.js +8 -117
- data/app/assets/javascripts/ratchet/base/mobilemenu.js +12 -50
- data/app/assets/javascripts/ratchet/base/sync-input-value.js +30 -0
- data/app/assets/javascripts/ratchet/core.js +55 -78
- data/app/assets/javascripts/ratchet/enhancement/lightbox.js +9 -8
- data/app/assets/javascripts/ratchet/enhancement/notice.js +8 -3
- data/app/assets/javascripts/ratchet/enhancement/sticky.js +18 -35
- data/app/assets/javascripts/ratchet/enhancement/waypoints.js +125 -162
- data/app/assets/javascripts/ratchet/utility/loader.js +4 -2
- data/app/assets/stylesheets/ratchet/_core.scss +2 -1
- data/app/assets/stylesheets/ratchet/base/_form.scss +4 -13
- data/app/assets/stylesheets/ratchet/base/_multistep-form.scss +62 -0
- data/app/assets/stylesheets/ratchet/utility/_global.scss +1 -10
- data/app/helpers/ratchet/application_helper.rb +23 -2
- data/app/views/layouts/ratchet/default.html.slim +2 -2
- data/app/views/shared/ratchet/_footer.html.slim +3 -2
- data/app/views/shared/ratchet/_header.html.slim +1 -1
- data/lib/ratchet_design/version.rb +1 -1
- data/public/assets/ratchet/core-0.1.11.js +133 -0
- data/public/assets/ratchet/core-0.1.11.js.gz +0 -0
- data/public/assets/ratchet/core-0.1.11.map.json +1 -0
- data/public/assets/ratchet/{fonts-woff-0.1.10.css → fonts-woff-0.1.11.css} +0 -0
- data/public/assets/ratchet/{fonts-woff-0.1.10.css.gz → fonts-woff-0.1.11.css.gz} +0 -0
- data/public/assets/ratchet/{fonts-woff2-0.1.10.css → fonts-woff2-0.1.11.css} +0 -0
- data/public/assets/ratchet/{fonts-woff2-0.1.10.css.gz → fonts-woff2-0.1.11.css.gz} +0 -0
- metadata +11 -23
- data/app/assets/javascripts/ratchet/base/validation.js +0 -263
- data/app/assets/javascripts/ratchet/shim/classlist.js +0 -234
- data/app/assets/javascripts/ratchet/shim/object.assign.js +0 -30
- data/app/assets/javascripts/ratchet/utility/compile_data.js +0 -40
- data/app/assets/javascripts/ratchet/utility/from_top.js +0 -14
- data/app/assets/javascripts/ratchet/utility/full_stop.js +0 -55
- data/app/assets/javascripts/ratchet/utility/get_closest.js +0 -20
- data/app/assets/javascripts/ratchet/utility/get_next.js +0 -17
- data/app/assets/javascripts/ratchet/utility/matches.js +0 -15
- data/app/assets/javascripts/ratchet/utility/scroll_to.js +0 -74
- data/app/assets/javascripts/ratchet/utility/throttle.js +0 -25
- data/app/assets/javascripts/ratchet/utility/timeout.js +0 -45
- data/app/assets/javascripts/ratchet/utility/unhover.js +0 -56
- data/app/assets/javascripts/ratchet/utility/word_count.js +0 -15
- data/public/assets/ratchet/core-0.1.10.js +0 -115
- data/public/assets/ratchet/core-0.1.10.js.gz +0 -0
- data/public/assets/ratchet/core-0.1.10.map.json +0 -1
@@ -1,55 +0,0 @@
|
|
1
|
-
/**
|
2
|
-
* FullStop 0.0.2
|
3
|
-
* Prevent CSS transitions from occurring during a window resize
|
4
|
-
* @author Kyle Foster (@hkfoster)
|
5
|
-
* @license MIT
|
6
|
-
**/
|
7
|
-
|
8
|
-
// Dependencies
|
9
|
-
var throttle = require( '../utility/throttle' ),
|
10
|
-
timeout = require( '../utility/timeout' );
|
11
|
-
|
12
|
-
// Public API function
|
13
|
-
var fullStop = function( settings ) {
|
14
|
-
|
15
|
-
// Overridable defaults
|
16
|
-
var defaults = {
|
17
|
-
resizeDelay : 250,
|
18
|
-
resizeClass : 'no-transitions'
|
19
|
-
};
|
20
|
-
|
21
|
-
// Scoped variables
|
22
|
-
var options = Object.assign( {}, defaults, settings ),
|
23
|
-
docBody = document.body,
|
24
|
-
resizeTimer;
|
25
|
-
|
26
|
-
// Resize handler function
|
27
|
-
function resizeHandler() {
|
28
|
-
|
29
|
-
// Clear timer (if it exists)
|
30
|
-
if ( resizeTimer ) timeout.clear( resizeTimer );
|
31
|
-
|
32
|
-
// Add body class while resizing
|
33
|
-
docBody.classList.add( options.resizeClass );
|
34
|
-
|
35
|
-
// Check to see if resize is over
|
36
|
-
resizeTimer = timeout.set( function() {
|
37
|
-
|
38
|
-
// And remove body class upon completion
|
39
|
-
docBody.classList.remove( options.resizeClass );
|
40
|
-
|
41
|
-
// Delay firing function based on argument passed
|
42
|
-
}, options.resizeDelay );
|
43
|
-
|
44
|
-
}
|
45
|
-
|
46
|
-
// Resize throttle function init
|
47
|
-
throttle( 'resize', 'optimizedResize' );
|
48
|
-
|
49
|
-
// Resize function listener
|
50
|
-
window.addEventListener( 'optimizedResize', resizeHandler, false );
|
51
|
-
|
52
|
-
};
|
53
|
-
|
54
|
-
// Public API
|
55
|
-
module.exports = fullStop;
|
@@ -1,20 +0,0 @@
|
|
1
|
-
/**
|
2
|
-
* GetClosest 0.0.1
|
3
|
-
* Get closest DOM element up the tree that matches a given selector
|
4
|
-
* @author Kyle Foster (@hkfoster)
|
5
|
-
* @license MIT
|
6
|
-
**/
|
7
|
-
|
8
|
-
// Dependencies
|
9
|
-
var matches = require( './matches' );
|
10
|
-
|
11
|
-
// Public API function
|
12
|
-
var getClosest = function ( elem, selector ) {
|
13
|
-
for ( ; elem && elem !== document; elem = elem.parentNode ) {
|
14
|
-
if ( matches( elem, selector ) ) return elem;
|
15
|
-
}
|
16
|
-
return false;
|
17
|
-
};
|
18
|
-
|
19
|
-
// Public API
|
20
|
-
module.exports = getClosest;
|
@@ -1,17 +0,0 @@
|
|
1
|
-
/**
|
2
|
-
* GetNext 0.0.1
|
3
|
-
* Get next DOM element that matches a given selector
|
4
|
-
* @author Kyle Foster (@hkfoster)
|
5
|
-
* @license MIT
|
6
|
-
**/
|
7
|
-
|
8
|
-
// Public API function
|
9
|
-
var getNext = function( elem, selector ) {
|
10
|
-
for ( ; elem && elem !== document; elem = elem.parentNode ) {
|
11
|
-
if ( elem.querySelector( selector ) ) return elem.querySelector( selector );
|
12
|
-
}
|
13
|
-
return false;
|
14
|
-
};
|
15
|
-
|
16
|
-
// Public API
|
17
|
-
module.exports = getNext;
|
@@ -1,15 +0,0 @@
|
|
1
|
-
/**
|
2
|
-
* Matches 0.0.1
|
3
|
-
* Matches selector function
|
4
|
-
* @author Kyle Foster (@hkfoster)
|
5
|
-
* @reference https://developer.mozilla.org/en-US/docs/Web/API/Element/matches
|
6
|
-
* @license MIT
|
7
|
-
**/
|
8
|
-
|
9
|
-
// Public API function
|
10
|
-
var matches = function ( el, selector ) {
|
11
|
-
return ( el.matches || el.matchesSelector || el.msMatchesSelector || el.mozMatchesSelector || el.webkitMatchesSelector || el.oMatchesSelector ).call( el, selector );
|
12
|
-
};
|
13
|
-
|
14
|
-
// Public API
|
15
|
-
module.exports = matches;
|
@@ -1,74 +0,0 @@
|
|
1
|
-
/**
|
2
|
-
* ScrollTo 0.0.1
|
3
|
-
* Scroll to element function
|
4
|
-
* @author James Doyle (@james2doyle) & Kyle Foster (@hkfoster)
|
5
|
-
* @source https://goo.gl/CeY8fY
|
6
|
-
* @license MIT
|
7
|
-
**/
|
8
|
-
|
9
|
-
// Public API function
|
10
|
-
var scrollTo = function( to, callback, duration ) {
|
11
|
-
|
12
|
-
// Scoped variables
|
13
|
-
var start = position(),
|
14
|
-
change = to - start,
|
15
|
-
currTime = 0,
|
16
|
-
increment = 20;
|
17
|
-
duration = ( typeof( duration ) === 'undefined' ) ? 500 : duration;
|
18
|
-
|
19
|
-
// Kick off scroll animation
|
20
|
-
animateScroll();
|
21
|
-
|
22
|
-
// Easing function - http://goo.gl/5HLl8
|
23
|
-
function easeInOutQuad( t, b, c, d ) {
|
24
|
-
t /= d / 2;
|
25
|
-
if ( t < 1 ) {
|
26
|
-
return c / 2 * t * t + b;
|
27
|
-
}
|
28
|
-
t--;
|
29
|
-
return -c / 2 * ( t * ( t - 2 ) - 1 ) + b;
|
30
|
-
}
|
31
|
-
|
32
|
-
// Get current scroll position
|
33
|
-
function position() {
|
34
|
-
return document.documentElement.scrollTop ||
|
35
|
-
document.body.parentNode.scrollTop ||
|
36
|
-
document.body.scrollTop;
|
37
|
-
}
|
38
|
-
|
39
|
-
// Move scroll position
|
40
|
-
function move( amount ) {
|
41
|
-
document.documentElement.scrollTop = amount;
|
42
|
-
document.body.parentNode.scrollTop = amount;
|
43
|
-
document.body.scrollTop = amount;
|
44
|
-
}
|
45
|
-
|
46
|
-
// Scroll animation function
|
47
|
-
function animateScroll() {
|
48
|
-
|
49
|
-
// Increment the time
|
50
|
-
currTime += increment;
|
51
|
-
|
52
|
-
// Find the value with the quadratic in-out easing function
|
53
|
-
var val = easeInOutQuad( currTime, start, change, duration );
|
54
|
-
|
55
|
-
// Move the document.body
|
56
|
-
move( val );
|
57
|
-
|
58
|
-
// Do the animation unless its over
|
59
|
-
if ( currTime < duration ) {
|
60
|
-
requestAnimationFrame( animateScroll );
|
61
|
-
}
|
62
|
-
|
63
|
-
// The animation is done so let’s callback
|
64
|
-
else {
|
65
|
-
if ( callback && typeof( callback ) === 'function' ) {
|
66
|
-
callback();
|
67
|
-
}
|
68
|
-
}
|
69
|
-
}
|
70
|
-
|
71
|
-
};
|
72
|
-
|
73
|
-
// Public API
|
74
|
-
module.exports = scrollTo;
|
@@ -1,25 +0,0 @@
|
|
1
|
-
/**
|
2
|
-
* Throttle 0.0.1
|
3
|
-
* Event throttle function
|
4
|
-
* @author Kyle Foster (@hkfoster)
|
5
|
-
* @reference http://www.html5rocks.com/en/tutorials/speed/animations/
|
6
|
-
* @license MIT
|
7
|
-
**/
|
8
|
-
|
9
|
-
// Public API function
|
10
|
-
var throttle = function ( type, name, obj ) {
|
11
|
-
obj = obj || window;
|
12
|
-
var running = false;
|
13
|
-
var func = function () {
|
14
|
-
if ( running ) { return; }
|
15
|
-
running = true;
|
16
|
-
requestAnimationFrame( function () {
|
17
|
-
obj.dispatchEvent( new CustomEvent( name ) );
|
18
|
-
running = false;
|
19
|
-
});
|
20
|
-
};
|
21
|
-
obj.addEventListener( type, func );
|
22
|
-
};
|
23
|
-
|
24
|
-
// Public API
|
25
|
-
module.exports = throttle;
|
@@ -1,45 +0,0 @@
|
|
1
|
-
/**
|
2
|
-
* Timeout 0.0.1
|
3
|
-
* Just like setTimeout & clearTimeout, but with requestAnimationFrame()
|
4
|
-
* @author Joe Lambert (@joelambert) & Kyle Foster (@hkfoster)
|
5
|
-
* @source https://gist.github.com/joelambert/1002116#file-requesttimeout-js
|
6
|
-
* @license MIT
|
7
|
-
**/
|
8
|
-
|
9
|
-
// Public API object
|
10
|
-
var timeout = {
|
11
|
-
|
12
|
-
// Set timeout function
|
13
|
-
set : function( fn, delay, args ) {
|
14
|
-
|
15
|
-
var start = Date.now(),
|
16
|
-
handle = {};
|
17
|
-
|
18
|
-
function loop() {
|
19
|
-
|
20
|
-
var current = Date.now(),
|
21
|
-
delta = current - start;
|
22
|
-
|
23
|
-
if ( delta >= delay ) {
|
24
|
-
if ( args !== undefined ) {
|
25
|
-
fn.call( fn, args );
|
26
|
-
} else {
|
27
|
-
fn.call( fn );
|
28
|
-
}
|
29
|
-
} else {
|
30
|
-
handle.value = requestAnimationFrame( loop );
|
31
|
-
}
|
32
|
-
}
|
33
|
-
|
34
|
-
handle.value = requestAnimationFrame( loop );
|
35
|
-
return handle;
|
36
|
-
},
|
37
|
-
|
38
|
-
// Clear timeout function
|
39
|
-
clear : function( handle ) {
|
40
|
-
window.cancelAnimationFrame( handle.value );
|
41
|
-
}
|
42
|
-
};
|
43
|
-
|
44
|
-
// Public API
|
45
|
-
module.exports = timeout;
|
@@ -1,56 +0,0 @@
|
|
1
|
-
/**
|
2
|
-
* Unhover 0.0.1
|
3
|
-
* Disable hover events on scroll
|
4
|
-
* @author Kyle Foster (@hkfoster)
|
5
|
-
* @license MIT
|
6
|
-
**/
|
7
|
-
|
8
|
-
// Dependencies
|
9
|
-
var throttle = require( '../utility/throttle' ),
|
10
|
-
timeout = require( '../utility/timeout' );
|
11
|
-
|
12
|
-
// Public API function
|
13
|
-
var unhover = function( settings ) {
|
14
|
-
|
15
|
-
// Overridable defaults
|
16
|
-
var defaults = {
|
17
|
-
scrollDelay : 150
|
18
|
-
};
|
19
|
-
|
20
|
-
// Scoped variables
|
21
|
-
var options = Object.assign( {}, defaults, settings ),
|
22
|
-
docElem = document.documentElement,
|
23
|
-
scrollTimer;
|
24
|
-
|
25
|
-
// Scroll handler function
|
26
|
-
function scrollHandler() {
|
27
|
-
|
28
|
-
// Clear timer (if it exists)
|
29
|
-
if ( scrollTimer ) timeout.clear( scrollTimer );
|
30
|
-
|
31
|
-
// Turn off pointer events
|
32
|
-
if ( !docElem.style.pointerEvents ) {
|
33
|
-
docElem.style.pointerEvents = 'none';
|
34
|
-
}
|
35
|
-
|
36
|
-
// Check to see if scroll is over
|
37
|
-
scrollTimer = timeout.set( function() {
|
38
|
-
|
39
|
-
// And reset pointer events upon completion
|
40
|
-
docElem.style.pointerEvents = '';
|
41
|
-
|
42
|
-
// Delay firing function based on argument passed
|
43
|
-
}, options.scrollDelay );
|
44
|
-
|
45
|
-
}
|
46
|
-
|
47
|
-
// Scroll throttle function init
|
48
|
-
throttle( 'scroll', 'optimizedscroll' );
|
49
|
-
|
50
|
-
// Scroll function listener
|
51
|
-
window.addEventListener( 'optimizedscroll', scrollHandler, false );
|
52
|
-
|
53
|
-
};
|
54
|
-
|
55
|
-
// Public API
|
56
|
-
module.exports = unhover;
|
@@ -1,15 +0,0 @@
|
|
1
|
-
/**
|
2
|
-
* WordCount 0.0.1
|
3
|
-
* Word counter function
|
4
|
-
* @author Kyle Foster (@hkfoster)
|
5
|
-
* @license MIT
|
6
|
-
**/
|
7
|
-
|
8
|
-
// Public API function
|
9
|
-
var wordCount = function( str ) {
|
10
|
-
var matches = str.match( /\S+/g );
|
11
|
-
return matches ? matches.length : 0;
|
12
|
-
};
|
13
|
-
|
14
|
-
// Public API
|
15
|
-
module.exports = wordCount;
|