ratchet_design 0.1.10 → 0.1.11
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- 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
@@ -6,129 +6,93 @@
|
|
6
6
|
**/
|
7
7
|
|
8
8
|
// Dependencies
|
9
|
-
var
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
9
|
+
var toolbox = require( 'compose-toolbox' ),
|
10
|
+
Event = toolbox.event,
|
11
|
+
matches = toolbox.matches,
|
12
|
+
fromTop = toolbox.fromTop,
|
13
|
+
scrollTo = toolbox.scrollTo,
|
14
|
+
getClosest = toolbox.getClosest,
|
15
|
+
callback = Event.callback;
|
14
16
|
|
15
17
|
// Public API function
|
16
|
-
var waypoints = function(
|
18
|
+
var waypoints = function( settings ) {
|
17
19
|
|
18
20
|
// Overridable defaults
|
19
21
|
var defaults = {
|
20
|
-
initWidth : '
|
21
|
-
|
22
|
-
|
23
|
-
showLandmarks : false,
|
24
|
-
landmarkSelector : '.landmark',
|
25
|
-
activeLandmark : 'pinned',
|
26
|
-
};
|
27
|
-
|
28
|
-
// Scoped variables
|
29
|
-
var options = Object.assign( {}, defaults, settings ),
|
30
|
-
selectors = document.querySelectorAll( elements );
|
31
|
-
|
32
|
-
// If selectors are not present
|
33
|
-
if ( !selectors.length ) {
|
34
|
-
|
35
|
-
// Abort
|
36
|
-
return false;
|
37
|
-
|
38
|
-
// Otherwise attach listeners
|
39
|
-
} else {
|
22
|
+
initWidth : '0px',
|
23
|
+
elemOffset : 0
|
24
|
+
}
|
40
25
|
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
docBody = document.body,
|
45
|
-
coordinates = [],
|
46
|
-
oldActiveItem,
|
47
|
-
windowHash,
|
48
|
-
docHeight,
|
49
|
-
winHeight;
|
26
|
+
function slice( obj, count ) {
|
27
|
+
return Array.prototype.slice.call( obj, count )
|
28
|
+
}
|
50
29
|
|
51
|
-
|
52
|
-
|
30
|
+
// Scoped variables
|
31
|
+
var options = toolbox.merge( defaults, settings ),
|
32
|
+
activeAnchor = 'active',
|
33
|
+
landmarkSelector = 'dl',
|
34
|
+
activeLandmark = 'pinned',
|
35
|
+
nav = document.querySelector('.waypoint-nav'),
|
36
|
+
elements = [];
|
53
37
|
|
54
|
-
|
55
|
-
windowHash = window.location.hash.replace( '#', '' );
|
38
|
+
if ( nav ) slice( nav.querySelectorAll( "a[href^='#']" ) ).forEach( function( el ) {
|
56
39
|
|
57
|
-
|
58
|
-
|
40
|
+
// Find all elements matching links in the waypoints nav
|
41
|
+
var section = document.querySelector( el.getAttribute('href') )
|
59
42
|
|
60
|
-
|
61
|
-
|
43
|
+
// If found, add them to the elements list
|
44
|
+
if ( section ) elements.push( section )
|
62
45
|
|
63
|
-
|
46
|
+
})
|
64
47
|
|
65
|
-
|
66
|
-
throttle( 'resize', 'optimizedResize' );
|
48
|
+
if ( !nav || elements.length < 1 ) { return false }
|
67
49
|
|
68
|
-
|
69
|
-
|
50
|
+
// Scoped variables
|
51
|
+
var docBody = document.body,
|
52
|
+
coordinates = [],
|
53
|
+
oldActiveItem,
|
54
|
+
windowHash,
|
55
|
+
docHeight,
|
56
|
+
winHeight;
|
70
57
|
|
71
|
-
|
72
|
-
|
58
|
+
// If hash is present
|
59
|
+
if ( window.location.hash ) {
|
73
60
|
|
74
|
-
|
75
|
-
|
61
|
+
// Cache it
|
62
|
+
windowHash = window.location.hash.replace( '#', '' );
|
76
63
|
|
77
|
-
|
78
|
-
|
64
|
+
// Then delete it to prevent default page scroll
|
65
|
+
window.location.hash = '';
|
79
66
|
|
80
|
-
|
67
|
+
// And replace it
|
68
|
+
history.replaceState( null, '', '#' + windowHash );
|
81
69
|
|
82
70
|
}
|
83
71
|
|
84
|
-
//
|
85
|
-
|
86
|
-
|
87
|
-
// If media query matches
|
88
|
-
if ( condition.matches ) {
|
72
|
+
// Only run once the window is loaded
|
73
|
+
Event.on( window, 'load', function() {
|
89
74
|
|
90
|
-
|
91
|
-
|
75
|
+
// Media query handler function
|
76
|
+
Event.media.minWidth( options.initWidth, function( condition ) {
|
92
77
|
|
93
|
-
//
|
94
|
-
|
78
|
+
// Set up resize listener
|
79
|
+
resize.toggle( condition.matches )
|
80
|
+
resize()
|
95
81
|
|
96
|
-
//
|
97
|
-
|
82
|
+
// Set up scroll listener
|
83
|
+
scroll.toggle( condition.matches )
|
84
|
+
scroll()
|
85
|
+
|
86
|
+
// Set up hash change listener
|
87
|
+
hashChange.toggle( condition.matches )
|
88
|
+
hashChange()
|
98
89
|
|
99
|
-
|
100
|
-
window.addEventListener( 'optimizedScroll', scrollHandler, false );
|
90
|
+
})
|
101
91
|
|
102
|
-
|
103
|
-
docBody.addEventListener( 'click', clickHandler, false );
|
104
|
-
|
105
|
-
// Call hash change listener function explicitly at run time
|
106
|
-
hashHandler();
|
107
|
-
|
108
|
-
// Hash change function listener
|
109
|
-
window.addEventListener( 'hashchange', hashHandler, false );
|
110
|
-
|
111
|
-
// Otherwise…
|
112
|
-
} else {
|
113
|
-
|
114
|
-
// Remove resize listener
|
115
|
-
window.removeEventListener( 'optimizedResize', resizeHandler, false );
|
116
|
-
|
117
|
-
// Remove scroll listener
|
118
|
-
window.removeEventListener( 'optimizedScroll', scrollHandler, false );
|
119
|
-
|
120
|
-
// Remove click listener
|
121
|
-
docBody.removeEventListener( 'click', clickHandler, false );
|
122
|
-
|
123
|
-
// Remove hash change listener
|
124
|
-
window.removeEventListener( 'hashchange', hashHandler, false );
|
125
|
-
|
126
|
-
}
|
127
|
-
|
128
|
-
}
|
92
|
+
})
|
129
93
|
|
130
94
|
// Resize handler function
|
131
|
-
|
95
|
+
var resize = callback.new( function() {
|
132
96
|
|
133
97
|
// Update document height variable
|
134
98
|
docHeight = docBody.scrollHeight;
|
@@ -137,23 +101,22 @@ var waypoints = function( elements, settings ) {
|
|
137
101
|
winHeight = window.innerHeight;
|
138
102
|
|
139
103
|
// Loop through waypoints
|
140
|
-
|
141
|
-
|
142
|
-
// Construct coordinate object
|
143
|
-
var coordinate = {
|
144
|
-
elem : selectors[ i ],
|
145
|
-
offset : fromTop( selectors[ i ] )
|
146
|
-
};
|
104
|
+
setCoordinates()
|
147
105
|
|
148
|
-
|
149
|
-
coordinates[ i ] = coordinate;
|
150
|
-
|
151
|
-
}
|
106
|
+
})
|
152
107
|
|
108
|
+
// Store coordinates to elements
|
109
|
+
var setCoordinates = function() {
|
110
|
+
elements.forEach( function( element, i ) {
|
111
|
+
coordinates[ i ] = {
|
112
|
+
elem : elements[ i ],
|
113
|
+
offset : fromTop( elements[ i ] )
|
114
|
+
}
|
115
|
+
})
|
153
116
|
}
|
154
117
|
|
155
118
|
// Scroll handler function
|
156
|
-
|
119
|
+
var scroll = callback.new( function() {
|
157
120
|
|
158
121
|
// Scoped variables
|
159
122
|
var newScrollY = window.pageYOffset,
|
@@ -163,11 +126,10 @@ var waypoints = function( elements, settings ) {
|
|
163
126
|
landmark;
|
164
127
|
|
165
128
|
// Loop through coordinates
|
166
|
-
|
129
|
+
coordinates.forEach( function( currWaypoint, i ) {
|
167
130
|
|
168
131
|
// Scoped variables
|
169
132
|
var firstWaypoint = coordinates[ 0 ],
|
170
|
-
currWaypoint = coordinates[ i ],
|
171
133
|
nextWaypoint = coordinates[ i + 1 ],
|
172
134
|
lastWaypoint = coordinates[ coordinates.length - 1 ];
|
173
135
|
|
@@ -191,76 +153,65 @@ var waypoints = function( elements, settings ) {
|
|
191
153
|
|
192
154
|
}
|
193
155
|
|
194
|
-
}
|
156
|
+
})
|
195
157
|
|
196
158
|
// If active item exists
|
197
159
|
if ( newActiveItem ) {
|
198
160
|
|
199
161
|
// Only run when new active item is triggered
|
200
|
-
if ( newActiveItem === oldActiveItem ) return false
|
162
|
+
if ( newActiveItem === oldActiveItem ) return false
|
201
163
|
|
202
164
|
// Update active link
|
203
|
-
activeLink =
|
165
|
+
activeLink = nav.querySelector( 'a[href="#' + newActiveItem + '"]' )
|
204
166
|
|
205
167
|
// If no active link is found, abort
|
206
|
-
if ( !activeLink ) return false
|
168
|
+
if ( !activeLink ) return false
|
207
169
|
|
208
170
|
// And enable navigation item
|
209
|
-
|
210
|
-
|
211
|
-
// If landmarks are turned on
|
212
|
-
if ( options.showLandmarks === true ) {
|
213
|
-
|
214
|
-
// Set active landmark to active link’s parent
|
215
|
-
landmark = getClosest( activeLink, options.landmarkSelector );
|
216
|
-
|
217
|
-
// Enable active landmark
|
218
|
-
activate( landmark, options.activeLandmark );
|
219
|
-
|
220
|
-
}
|
171
|
+
activateLink( activeLink )
|
221
172
|
|
222
173
|
// Update old active item variable
|
223
|
-
oldActiveItem = newActiveItem
|
174
|
+
oldActiveItem = newActiveItem
|
224
175
|
|
225
176
|
}
|
226
177
|
|
227
|
-
}
|
178
|
+
})
|
228
179
|
|
229
180
|
// Click handler function
|
230
|
-
|
181
|
+
var click = callback.new( function( event ) {
|
231
182
|
|
232
183
|
// Matches selector function init
|
233
184
|
if ( matches( event.target, 'a[href^="#"]' ) ) {
|
234
185
|
|
235
186
|
// Prevent default behavior
|
236
|
-
event.preventDefault()
|
187
|
+
event.preventDefault()
|
237
188
|
|
238
189
|
// Travel to clicked target
|
239
|
-
travel( event.target,
|
190
|
+
travel( event.target, true )
|
240
191
|
|
241
192
|
}
|
242
|
-
}
|
193
|
+
})
|
243
194
|
|
244
195
|
// Hash change handler function
|
245
|
-
|
196
|
+
var hashChange = callback.new( function() {
|
246
197
|
|
247
198
|
// Only run when a hash is present
|
248
|
-
if ( !window.location.hash ) return false
|
199
|
+
if ( !window.location.hash ) return false
|
249
200
|
|
250
201
|
// Find the hash’s relevant navigation item
|
251
|
-
var hashAnchor = document.querySelector( 'a[href="' + window.location.hash + '"]' )
|
202
|
+
var hashAnchor = document.querySelector( 'a[href="' + window.location.hash + '"]' )
|
252
203
|
|
253
204
|
// And travel to its target
|
254
|
-
travel( hashAnchor
|
205
|
+
travel( hashAnchor )
|
255
206
|
|
256
|
-
}
|
207
|
+
})
|
257
208
|
|
258
209
|
// Window scroll travel function
|
259
|
-
|
210
|
+
var travel = function( destination, animateScroll ) {
|
260
211
|
|
261
212
|
// Define scoped variable(s)
|
262
|
-
var targetAnchor = destination.
|
263
|
-
targetElement = document.querySelector(
|
213
|
+
var targetAnchor = destination.getAttribute('href'),
|
214
|
+
targetElement = document.querySelector( targetAnchor ),
|
264
215
|
targetOffset,
|
265
216
|
travelTime;
|
266
217
|
|
@@ -268,10 +219,10 @@ var waypoints = function( elements, settings ) {
|
|
268
219
|
if ( targetElement ) {
|
269
220
|
|
270
221
|
// Enable new active navigation item
|
271
|
-
|
222
|
+
activateLink( destination, activeAnchor )
|
272
223
|
|
273
224
|
// Loop through coordinates
|
274
|
-
|
225
|
+
coordinates.forEach( function( current, i ) {
|
275
226
|
|
276
227
|
// If coordinate element matches target element
|
277
228
|
if ( coordinates[ i ].elem === targetElement ) {
|
@@ -279,49 +230,61 @@ var waypoints = function( elements, settings ) {
|
|
279
230
|
// Assign its coordinates to target offset variable
|
280
231
|
targetOffset = coordinates[ i ].offset;
|
281
232
|
}
|
282
|
-
}
|
233
|
+
})
|
283
234
|
|
284
235
|
// If trigger was a click
|
285
|
-
if (
|
236
|
+
if ( animateScroll ) {
|
286
237
|
|
287
238
|
// Temporarily remove scroll listener function
|
288
|
-
|
239
|
+
scroll.stop()
|
289
240
|
|
290
241
|
// Update the hash
|
291
|
-
history.pushState( null, '',
|
292
|
-
|
293
|
-
// Animate scroll to appropriate element
|
294
|
-
scrollTo( targetOffset - options.elemOffset + 1, function() {
|
295
|
-
|
296
|
-
// Once scroll is complete, enable scroll listener
|
297
|
-
window.addEventListener( 'optimizedScroll', scrollHandler, false );
|
242
|
+
history.pushState( null, '', targetAnchor );
|
298
243
|
|
299
|
-
|
244
|
+
// Animate scroll to appropriate element then renable scroll listener
|
245
|
+
scrollTo( targetElement, scroll.start )
|
300
246
|
|
301
|
-
|
302
|
-
} else if ( trigger === 'hash' ) {
|
247
|
+
} else {
|
303
248
|
|
304
249
|
// Skip the scroll animation
|
305
|
-
window.scrollTo( 0,
|
250
|
+
window.scrollTo( 0, fromTop( targetElement ) );
|
306
251
|
|
307
252
|
}
|
308
253
|
}
|
309
254
|
}
|
310
255
|
|
311
|
-
|
312
|
-
function activate( selector, cls ) {
|
256
|
+
function activate( el, classname ) {
|
313
257
|
|
314
258
|
// Find currently active link
|
315
|
-
var
|
259
|
+
var activeEl = nav.querySelector( '.' + classname )
|
260
|
+
|
261
|
+
if ( activeEl == el ) return
|
316
262
|
|
317
|
-
//
|
318
|
-
if (
|
263
|
+
// remove active class from existing element
|
264
|
+
if ( activeEl ) activeEl.classList.remove( classname )
|
319
265
|
|
320
266
|
// Then enable the passed selector
|
321
|
-
|
267
|
+
el.classList.add( classname )
|
268
|
+
|
269
|
+
}
|
270
|
+
|
271
|
+
// Link activation function
|
272
|
+
function activateLink( el ) {
|
273
|
+
activate( el, activeAnchor )
|
322
274
|
|
275
|
+
// Set active landmark to active link’s parent
|
276
|
+
activateLandmark( getClosest( el, landmarkSelector ) )
|
323
277
|
}
|
324
278
|
|
279
|
+
function activateLandmark( el ) {
|
280
|
+
if ( el ) activate( el, activeLandmark )
|
281
|
+
}
|
282
|
+
|
283
|
+
Event.resize.stop( resize )
|
284
|
+
Event.scroll( scroll )
|
285
|
+
Event.on( document, 'click', click )
|
286
|
+
Event.on( window, 'hashchange', hashChange )
|
287
|
+
|
325
288
|
};
|
326
289
|
|
327
290
|
// Public API
|
@@ -5,6 +5,8 @@
|
|
5
5
|
* @license MIT
|
6
6
|
**/
|
7
7
|
|
8
|
+
var toolbox = require( 'compose-toolbox' )
|
9
|
+
|
8
10
|
// Public API function
|
9
11
|
var loader = function( settings ) {
|
10
12
|
|
@@ -21,7 +23,7 @@ var loader = function( settings ) {
|
|
21
23
|
};
|
22
24
|
|
23
25
|
// Extend defaults
|
24
|
-
var options =
|
26
|
+
var options = toolbox.merge( defaults, settings );
|
25
27
|
|
26
28
|
// If it doesn’t already exist
|
27
29
|
if ( !document.querySelector( 'div.' + options.loaderClass ) ) {
|
@@ -79,4 +81,4 @@ var loader = function( settings ) {
|
|
79
81
|
};
|
80
82
|
|
81
83
|
// Public API
|
82
|
-
module.exports = loader;
|
84
|
+
module.exports = loader;
|
@@ -9,6 +9,7 @@
|
|
9
9
|
@import 'base/button';
|
10
10
|
@import 'base/media';
|
11
11
|
@import 'base/form';
|
12
|
+
@import 'base/multistep-form';
|
12
13
|
@import 'base/table';
|
13
14
|
@import 'base/document';
|
14
15
|
|
@@ -19,4 +20,4 @@
|
|
19
20
|
@import 'enhancement/hero';
|
20
21
|
@import 'enhancement/contrast-section';
|
21
22
|
@import 'enhancement/tooltip';
|
22
|
-
@import 'enhancement/lightbox';
|
23
|
+
@import 'enhancement/lightbox';
|
@@ -63,11 +63,6 @@ $text-inputs: 'textarea, input[type=url], input[type=tel], input[type=text], inp
|
|
63
63
|
textarea,
|
64
64
|
#{$text-inputs} {
|
65
65
|
|
66
|
-
// Active state
|
67
|
-
+ span {
|
68
|
-
@extend %active;
|
69
|
-
}
|
70
|
-
|
71
66
|
// Non-required active color
|
72
67
|
&:not(:required):focus + span,
|
73
68
|
&:not(:required):active + span {
|
@@ -86,11 +81,6 @@ $text-inputs: 'textarea, input[type=url], input[type=tel], input[type=text], inp
|
|
86
81
|
textarea,
|
87
82
|
#{$text-inputs} {
|
88
83
|
|
89
|
-
// Active state
|
90
|
-
+ span {
|
91
|
-
@extend %active;
|
92
|
-
}
|
93
|
-
|
94
84
|
// Non-required active color
|
95
85
|
&:not(:required):focus + span,
|
96
86
|
&:not(:required):active + span {
|
@@ -149,9 +139,10 @@ $text-inputs: 'textarea, input[type=url], input[type=tel], input[type=text], inp
|
|
149
139
|
transform .2s;
|
150
140
|
}
|
151
141
|
|
152
|
-
// Move labels out of the way on focus
|
142
|
+
// Move labels out of the way on focus and empty
|
153
143
|
&:focus + span,
|
154
|
-
&:active + span
|
144
|
+
&:active + span,
|
145
|
+
&:not([value=""]) + span, {
|
155
146
|
@extend %active;
|
156
147
|
}
|
157
148
|
}
|
@@ -540,7 +531,7 @@ button[type=submit] {
|
|
540
531
|
* ------------------------------------- */
|
541
532
|
|
542
533
|
// Apply validation styles to inputs & textareas
|
543
|
-
textarea, #{$text-inputs} {
|
534
|
+
textarea, #{$text-inputs}, select {
|
544
535
|
|
545
536
|
// Strip default styling
|
546
537
|
&:invalid {
|
@@ -0,0 +1,62 @@
|
|
1
|
+
fieldset.form-step {
|
2
|
+
left: 0;
|
3
|
+
right: 0;
|
4
|
+
|
5
|
+
&[disabled] {
|
6
|
+
display: none;
|
7
|
+
}
|
8
|
+
|
9
|
+
|
10
|
+
// Transition to form step
|
11
|
+
&.arrived { animation: fade-in-right .5s forwards; }
|
12
|
+
|
13
|
+
// Revisit form step
|
14
|
+
&.revisted, &.step-visited.arrived { animation: .5s fade-in-left forwards; }
|
15
|
+
|
16
|
+
// Transition away from form step
|
17
|
+
&.departed { animation: fade-out-left .5s forwards; }
|
18
|
+
}
|
19
|
+
|
20
|
+
// Transition to form step
|
21
|
+
@keyframes fade-in-right {
|
22
|
+
0% {
|
23
|
+
opacity: 0;
|
24
|
+
transform: perspective(1px) translate3d(200px, 0, 0);
|
25
|
+
}
|
26
|
+
|
27
|
+
100% {
|
28
|
+
opacity: 1;
|
29
|
+
transform: perspective(1px) translate3d(0, 0, 0);
|
30
|
+
}
|
31
|
+
}
|
32
|
+
|
33
|
+
// Transition away from form step
|
34
|
+
@keyframes fade-out-left {
|
35
|
+
0% {
|
36
|
+
opacity: 1;
|
37
|
+
transform: perspective(1px) translate3d(0, 0, 0);
|
38
|
+
}
|
39
|
+
|
40
|
+
99% {
|
41
|
+
opacity: 0;
|
42
|
+
transform: perspective(1px) translate3d(-200px, 0, 0);
|
43
|
+
}
|
44
|
+
|
45
|
+
100% {
|
46
|
+
opacity: 0;
|
47
|
+
transform: perspective(1px) translate3d(-9999px, 0, 0);
|
48
|
+
}
|
49
|
+
}
|
50
|
+
|
51
|
+
// Return to previous form step
|
52
|
+
@keyframes fade-in-left {
|
53
|
+
0% {
|
54
|
+
opacity: 0;
|
55
|
+
transform: perspective(1px) translate3d(-200px, 0, 0);
|
56
|
+
}
|
57
|
+
|
58
|
+
100% {
|
59
|
+
opacity: 1;
|
60
|
+
transform: perspective(1px) translate3d(0, 0, 0);
|
61
|
+
}
|
62
|
+
}
|
@@ -96,15 +96,6 @@ $mono-font: 'Nitti', Consolas, 'Liberation Mono', Menlo, Courier, monospace;
|
|
96
96
|
// Transition duration
|
97
97
|
$duration: .2s;
|
98
98
|
|
99
|
-
// Class to prevent transitions
|
100
|
-
.no-transitions * {
|
101
|
-
&,
|
102
|
-
&:after,
|
103
|
-
&:before {
|
104
|
-
transition: none !important;
|
105
|
-
}
|
106
|
-
}
|
107
|
-
|
108
99
|
/* ===================================== *
|
109
100
|
* iv. Layout
|
110
101
|
* ------------------------------------- */
|
@@ -251,4 +242,4 @@ $content-padding: vr(2); // 30px
|
|
251
242
|
// Visually shown placeholder
|
252
243
|
%shown {
|
253
244
|
@include shown;
|
254
|
-
}
|
245
|
+
}
|
@@ -21,6 +21,11 @@ module Ratchet
|
|
21
21
|
content_for :blank, &block
|
22
22
|
end
|
23
23
|
|
24
|
+
# Blank slate layout
|
25
|
+
def footer(&block)
|
26
|
+
content_for :footer, &block
|
27
|
+
end
|
28
|
+
|
24
29
|
# Set custom page title
|
25
30
|
def title(title = nil)
|
26
31
|
title ? content_for(:title) { title + " | " + Site.name } : content_for(:title).presence
|
@@ -42,9 +47,25 @@ module Ratchet
|
|
42
47
|
end
|
43
48
|
|
44
49
|
# Consolidated page class output
|
45
|
-
def
|
46
|
-
|
50
|
+
def page_class( classnames = nil )
|
51
|
+
if ( classnames )
|
52
|
+
@page_classes ||= ''
|
53
|
+
@page_classes = @page_classes + ' ' + classnames
|
54
|
+
@page_classes.strip!
|
55
|
+
else
|
56
|
+
@page_classes || ''
|
57
|
+
end
|
47
58
|
end
|
48
59
|
|
60
|
+
# Consolidated page class output
|
61
|
+
def main_class( classnames = nil )
|
62
|
+
if ( classnames )
|
63
|
+
@main_classes ||= ''
|
64
|
+
@main_classes = @main_classes + ' ' + classnames
|
65
|
+
@main_classes.strip!
|
66
|
+
else
|
67
|
+
@main_classes || ''
|
68
|
+
end
|
69
|
+
end
|
49
70
|
end
|
50
71
|
end
|
@@ -41,7 +41,7 @@ html
|
|
41
41
|
/ Head
|
42
42
|
= yield :head
|
43
43
|
|
44
|
-
body class=
|
44
|
+
body class=page_class
|
45
45
|
|
46
46
|
/ Icon inclusion
|
47
47
|
= render "shared/ratchet/icons"
|
@@ -56,7 +56,7 @@ html
|
|
56
56
|
= render "shared/ratchet/header"
|
57
57
|
|
58
58
|
/ Document main
|
59
|
-
main role="main"= yield
|
59
|
+
main class=main_class role="main"= yield
|
60
60
|
|
61
61
|
/ Document footer
|
62
62
|
= render "shared/ratchet/footer"
|
@@ -1,2 +1,3 @@
|
|
1
|
-
footer
|
2
|
-
|
1
|
+
- if content_for?(:footer)
|
2
|
+
footer role="contentinfo"
|
3
|
+
= yield :footer
|