locomotivecms_wagon 2.2.0.beta1 → 2.2.0.rc1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile +2 -1
- data/generators/blank/config/metafields_schema.yml +1 -1
- data/generators/bootstrap/config/metafields_schema.yml +1 -1
- data/generators/{foundation5 → foundation}/Gemfile.tt +1 -1
- data/generators/{foundation5 → foundation}/Guardfile +0 -0
- data/generators/foundation/app/content_types/.gitkeep +0 -0
- data/generators/foundation/app/views/pages/404.liquid +11 -0
- data/generators/{foundation5 → foundation}/app/views/pages/404.liquid.haml +4 -3
- data/generators/{foundation5 → foundation}/app/views/pages/index.liquid +54 -78
- data/generators/foundation/app/views/pages/index.liquid.haml +144 -0
- data/generators/foundation/app/views/snippets/.gitkeep +0 -0
- data/generators/{foundation5 → foundation}/config/deploy.yml +2 -1
- data/generators/{foundation5 → foundation}/config/metafields_schema.yml +1 -1
- data/generators/{foundation5/config/site.yml.tt → foundation/config/site.yml} +2 -2
- data/generators/{foundation5 → foundation}/config/translations.yml +0 -0
- data/generators/foundation/data/.gitkeep +0 -0
- data/generators/foundation/log/.gitkeep +0 -0
- data/generators/foundation/public/images/.gitkeep +0 -0
- data/generators/foundation/public/javascripts/app.js +1 -0
- data/generators/foundation/public/javascripts/vendor/foundation.js +7472 -0
- data/generators/foundation/public/javascripts/vendor/foundation.min.js +3 -0
- data/generators/foundation/public/javascripts/vendor/what-input.js +212 -0
- data/generators/foundation/public/javascripts/vendor/what-input.min.js +1 -0
- data/generators/foundation/public/stylesheets/_settings.scss +529 -0
- data/generators/foundation/public/stylesheets/app.css +3 -0
- data/generators/foundation/public/stylesheets/app.scss +43 -0
- data/generators/foundation/public/stylesheets/foundation.css +3499 -0
- data/generators/foundation/public/stylesheets/foundation6/_global.scss +197 -0
- data/generators/foundation/public/stylesheets/foundation6/components/_accordion-menu.scss +28 -0
- data/generators/foundation/public/stylesheets/foundation6/components/_accordion.scss +112 -0
- data/generators/foundation/public/stylesheets/foundation6/components/_badge.scss +55 -0
- data/generators/foundation/public/stylesheets/foundation6/components/_breadcrumbs.scss +94 -0
- data/generators/foundation/public/stylesheets/foundation6/components/_button-group.scss +115 -0
- data/generators/foundation/public/stylesheets/foundation6/components/_button.scss +264 -0
- data/generators/foundation/public/stylesheets/foundation6/components/_callout.scss +115 -0
- data/generators/foundation/public/stylesheets/foundation6/components/_close-button.scss +61 -0
- data/generators/foundation/public/stylesheets/foundation6/components/_drilldown.scss +67 -0
- data/generators/foundation/public/stylesheets/foundation6/components/_dropdown-menu.scss +123 -0
- data/generators/foundation/public/stylesheets/foundation6/components/_dropdown.scss +64 -0
- data/generators/foundation/public/stylesheets/foundation6/components/_flex-video.scss +68 -0
- data/generators/foundation/public/stylesheets/foundation6/components/_float.scss +27 -0
- data/generators/foundation/public/stylesheets/foundation6/components/_label.scss +56 -0
- data/generators/foundation/public/stylesheets/foundation6/components/_media-object.scss +74 -0
- data/generators/foundation/public/stylesheets/foundation6/components/_menu.scss +213 -0
- data/generators/foundation/public/stylesheets/foundation6/components/_off-canvas.scss +170 -0
- data/generators/foundation/public/stylesheets/foundation6/components/_orbit.scss +186 -0
- data/generators/foundation/public/stylesheets/foundation6/components/_pagination.scss +161 -0
- data/generators/foundation/public/stylesheets/foundation6/components/_progress-bar.scss +83 -0
- data/generators/foundation/public/stylesheets/foundation6/components/_reveal.scss +155 -0
- data/generators/foundation/public/stylesheets/foundation6/components/_slider.scss +158 -0
- data/generators/foundation/public/stylesheets/foundation6/components/_sticky.scss +38 -0
- data/generators/foundation/public/stylesheets/foundation6/components/_switch.scss +231 -0
- data/generators/foundation/public/stylesheets/foundation6/components/_table.scss +212 -0
- data/generators/foundation/public/stylesheets/foundation6/components/_tabs.scss +137 -0
- data/generators/foundation/public/stylesheets/foundation6/components/_thumbnail.scss +54 -0
- data/generators/foundation/public/stylesheets/foundation6/components/_title-bar.scss +44 -0
- data/generators/foundation/public/stylesheets/foundation6/components/_tooltip.scss +110 -0
- data/generators/foundation/public/stylesheets/foundation6/components/_top-bar.scss +57 -0
- data/generators/foundation/public/stylesheets/foundation6/components/_visibility.scss +131 -0
- data/generators/foundation/public/stylesheets/foundation6/forms/_checkbox.scss +36 -0
- data/generators/foundation/public/stylesheets/foundation6/forms/_error.scss +81 -0
- data/generators/foundation/public/stylesheets/foundation6/forms/_fieldset.scss +53 -0
- data/generators/foundation/public/stylesheets/foundation6/forms/_forms.scss +32 -0
- data/generators/foundation/public/stylesheets/foundation6/forms/_help-text.scss +30 -0
- data/generators/foundation/public/stylesheets/foundation6/forms/_input-group.scss +70 -0
- data/generators/foundation/public/stylesheets/foundation6/forms/_label.scss +48 -0
- data/generators/foundation/public/stylesheets/foundation6/forms/_select.scss +64 -0
- data/generators/foundation/public/stylesheets/foundation6/forms/_text.scss +153 -0
- data/generators/foundation/public/stylesheets/foundation6/foundation.scss +91 -0
- data/generators/foundation/public/stylesheets/foundation6/grid/_classes.scss +132 -0
- data/generators/foundation/public/stylesheets/foundation6/grid/_column.scss +112 -0
- data/generators/foundation/public/stylesheets/foundation6/grid/_flex-grid.scss +191 -0
- data/generators/foundation/public/stylesheets/foundation6/grid/_grid.scss +33 -0
- data/generators/foundation/public/stylesheets/foundation6/grid/_gutter.scss +31 -0
- data/generators/foundation/public/stylesheets/foundation6/grid/_layout.scss +32 -0
- data/generators/foundation/public/stylesheets/foundation6/grid/_position.scss +71 -0
- data/generators/foundation/public/stylesheets/foundation6/grid/_row.scss +72 -0
- data/generators/foundation/public/stylesheets/foundation6/grid/_size.scss +24 -0
- data/generators/foundation/public/stylesheets/foundation6/motion-ui/_classes.scss +102 -0
- data/generators/foundation/public/stylesheets/foundation6/motion-ui/_settings.scss +61 -0
- data/generators/foundation/public/stylesheets/foundation6/motion-ui/effects/_fade.scss +29 -0
- data/generators/foundation/public/stylesheets/foundation6/motion-ui/effects/_hinge.scss +65 -0
- data/generators/foundation/public/stylesheets/foundation6/motion-ui/effects/_shake.scss +15 -0
- data/generators/foundation/public/stylesheets/foundation6/motion-ui/effects/_slide.scss +41 -0
- data/generators/foundation/public/stylesheets/foundation6/motion-ui/effects/_spin.scss +28 -0
- data/generators/foundation/public/stylesheets/foundation6/motion-ui/effects/_wiggle.scss +13 -0
- data/generators/foundation/public/stylesheets/foundation6/motion-ui/effects/_zoom.scss +15 -0
- data/generators/foundation/public/stylesheets/foundation6/motion-ui/motion-ui.scss +29 -0
- data/generators/foundation/public/stylesheets/foundation6/motion-ui/transitions/_fade.scss +28 -0
- data/generators/foundation/public/stylesheets/foundation6/motion-ui/transitions/_hinge.scss +43 -0
- data/generators/foundation/public/stylesheets/foundation6/motion-ui/transitions/_slide.scss +42 -0
- data/generators/foundation/public/stylesheets/foundation6/motion-ui/transitions/_spin.scss +39 -0
- data/generators/foundation/public/stylesheets/foundation6/motion-ui/transitions/_zoom.scss +39 -0
- data/generators/foundation/public/stylesheets/foundation6/motion-ui/util/_animation.scss +7 -0
- data/generators/foundation/public/stylesheets/foundation6/motion-ui/util/_args.scss +15 -0
- data/generators/foundation/public/stylesheets/foundation6/motion-ui/util/_keyframe.scss +136 -0
- data/generators/foundation/public/stylesheets/foundation6/motion-ui/util/_selector.scss +23 -0
- data/generators/foundation/public/stylesheets/foundation6/motion-ui/util/_series.scss +54 -0
- data/generators/foundation/public/stylesheets/foundation6/motion-ui/util/_transition.scss +45 -0
- data/generators/foundation/public/stylesheets/foundation6/motion-ui/util/_unit.scss +7 -0
- data/generators/foundation/public/stylesheets/foundation6/motion-ui.scss +4 -0
- data/generators/foundation/public/stylesheets/foundation6/settings/_settings.scss +531 -0
- data/generators/foundation/public/stylesheets/foundation6/typography/_alignment.scss +21 -0
- data/generators/foundation/public/stylesheets/foundation6/typography/_base.scss +436 -0
- data/generators/foundation/public/stylesheets/foundation6/typography/_helpers.scss +77 -0
- data/generators/foundation/public/stylesheets/foundation6/typography/_print.scss +73 -0
- data/generators/foundation/public/stylesheets/foundation6/typography/_typography.scss +28 -0
- data/generators/foundation/public/stylesheets/foundation6/util/_breakpoint.scss +182 -0
- data/generators/foundation/public/stylesheets/foundation6/util/_color.scss +41 -0
- data/generators/foundation/public/stylesheets/foundation6/util/_mixins.scss +190 -0
- data/generators/foundation/public/stylesheets/foundation6/util/_selector.scss +39 -0
- data/generators/foundation/public/stylesheets/foundation6/util/_unit.scss +69 -0
- data/generators/foundation/public/stylesheets/foundation6/util/_util.scss +15 -0
- data/generators/foundation/public/stylesheets/foundation6/util/_value.scss +117 -0
- data/generators/{foundation5/public/stylesheets/normalize.css.scss → foundation/public/stylesheets/foundation6/vendor/normalize.scss} +8 -11
- data/generators/site_metafields/schema.yml.tt +1 -1
- data/lib/locomotive/wagon/commands/push_command.rb +1 -0
- data/lib/locomotive/wagon/commands/serve_command.rb +1 -0
- data/lib/locomotive/wagon/decorators/concerns/persist_assets_concern.rb +3 -3
- data/lib/locomotive/wagon/decorators/content_type_decorator.rb +5 -1
- data/lib/locomotive/wagon/generators/site/{foundation5.rb → foundation.rb} +8 -12
- data/lib/locomotive/wagon/generators/site.rb +1 -1
- data/lib/locomotive/wagon/version.rb +1 -1
- data/locomotivecms_wagon.gemspec +3 -2
- data/spec/fixtures/cassettes/authenticate.yml +38 -38
- data/spec/fixtures/cassettes/delete.yml +211 -211
- data/spec/fixtures/cassettes/push.yml +1333 -1374
- data/spec/integration/cli_spec.rb +1 -1
- data/spec/unit/decorators/content_entry_decorator_spec.rb +23 -0
- metadata +133 -104
- data/generators/foundation5/app/content_types/.empty_directory +0 -1
- data/generators/foundation5/app/views/pages/404.liquid +0 -10
- data/generators/foundation5/app/views/pages/index.liquid.haml +0 -157
- data/generators/foundation5/data/.empty_directory +0 -1
- data/generators/foundation5/icon.png +0 -0
- data/generators/foundation5/public/fonts/.empty_directory +0 -1
- data/generators/foundation5/public/images/.empty_directory +0 -1
- data/generators/foundation5/public/javascripts/foundation/foundation.abide.js +0 -299
- data/generators/foundation5/public/javascripts/foundation/foundation.accordion.js +0 -59
- data/generators/foundation5/public/javascripts/foundation/foundation.alert.js +0 -43
- data/generators/foundation5/public/javascripts/foundation/foundation.clearing.js +0 -534
- data/generators/foundation5/public/javascripts/foundation/foundation.dropdown.js +0 -311
- data/generators/foundation5/public/javascripts/foundation/foundation.equalizer.js +0 -74
- data/generators/foundation5/public/javascripts/foundation/foundation.interchange.js +0 -331
- data/generators/foundation5/public/javascripts/foundation/foundation.joyride.js +0 -843
- data/generators/foundation5/public/javascripts/foundation/foundation.js +0 -611
- data/generators/foundation5/public/javascripts/foundation/foundation.magellan.js +0 -178
- data/generators/foundation5/public/javascripts/foundation/foundation.offcanvas.js +0 -108
- data/generators/foundation5/public/javascripts/foundation/foundation.orbit.js +0 -610
- data/generators/foundation5/public/javascripts/foundation/foundation.reveal.js +0 -437
- data/generators/foundation5/public/javascripts/foundation/foundation.slider.js +0 -199
- data/generators/foundation5/public/javascripts/foundation/foundation.tab.js +0 -167
- data/generators/foundation5/public/javascripts/foundation/foundation.tooltip.js +0 -298
- data/generators/foundation5/public/javascripts/foundation/foundation.topbar.js +0 -425
- data/generators/foundation5/public/javascripts/foundation.js +0 -4161
- data/generators/foundation5/public/javascripts/foundation.min.js +0 -10
- data/generators/foundation5/public/javascripts/vendor/custom.modernizr.js +0 -4
- data/generators/foundation5/public/javascripts/vendor/custom.modernizr.min.js +0 -1
- data/generators/foundation5/public/javascripts/vendor/fastclick.js +0 -9
- data/generators/foundation5/public/javascripts/vendor/fastclick.min.js +0 -11
- data/generators/foundation5/public/javascripts/vendor/jquery.autocomplete.js +0 -645
- data/generators/foundation5/public/javascripts/vendor/jquery.autocomplete.min.js +0 -1
- data/generators/foundation5/public/javascripts/vendor/jquery.cookie.js +0 -8
- data/generators/foundation5/public/javascripts/vendor/jquery.cookie.min.js +0 -8
- data/generators/foundation5/public/javascripts/vendor/jquery.js +0 -26
- data/generators/foundation5/public/javascripts/vendor/jquery.min.js +0 -27
- data/generators/foundation5/public/javascripts/vendor/modernizr.js +0 -8
- data/generators/foundation5/public/javascripts/vendor/modernizr.min.js +0 -1
- data/generators/foundation5/public/javascripts/vendor/placeholder.js +0 -2
- data/generators/foundation5/public/javascripts/vendor/placeholder.min.js +0 -1
- data/generators/foundation5/public/samples/.empty_directory +0 -1
- data/generators/foundation5/public/stylesheets/application.css +0 -2
- data/generators/foundation5/public/stylesheets/application.css.scss +0 -3
- data/generators/foundation5/public/stylesheets/foundation/_functions.scss +0 -102
- data/generators/foundation5/public/stylesheets/foundation/_settings.scss +0 -1441
- data/generators/foundation5/public/stylesheets/foundation/components/_accordion.scss +0 -157
- data/generators/foundation5/public/stylesheets/foundation/components/_alert-boxes.scss +0 -128
- data/generators/foundation5/public/stylesheets/foundation/components/_block-grid.scss +0 -132
- data/generators/foundation5/public/stylesheets/foundation/components/_breadcrumbs.scss +0 -132
- data/generators/foundation5/public/stylesheets/foundation/components/_button-groups.scss +0 -197
- data/generators/foundation5/public/stylesheets/foundation/components/_buttons.scss +0 -259
- data/generators/foundation5/public/stylesheets/foundation/components/_clearing.scss +0 -247
- data/generators/foundation5/public/stylesheets/foundation/components/_dropdown-buttons.scss +0 -130
- data/generators/foundation5/public/stylesheets/foundation/components/_dropdown.scss +0 -262
- data/generators/foundation5/public/stylesheets/foundation/components/_flex-video.scss +0 -51
- data/generators/foundation5/public/stylesheets/foundation/components/_forms.scss +0 -585
- data/generators/foundation5/public/stylesheets/foundation/components/_global.scss +0 -460
- data/generators/foundation5/public/stylesheets/foundation/components/_grid.scss +0 -275
- data/generators/foundation5/public/stylesheets/foundation/components/_icon-bar.scss +0 -293
- data/generators/foundation5/public/stylesheets/foundation/components/_inline-lists.scss +0 -57
- data/generators/foundation5/public/stylesheets/foundation/components/_joyride.scss +0 -222
- data/generators/foundation5/public/stylesheets/foundation/components/_keystrokes.scss +0 -61
- data/generators/foundation5/public/stylesheets/foundation/components/_labels.scss +0 -106
- data/generators/foundation5/public/stylesheets/foundation/components/_magellan.scss +0 -34
- data/generators/foundation5/public/stylesheets/foundation/components/_offcanvas.scss +0 -513
- data/generators/foundation5/public/stylesheets/foundation/components/_orbit.scss +0 -368
- data/generators/foundation5/public/stylesheets/foundation/components/_pagination.scss +0 -162
- data/generators/foundation5/public/stylesheets/foundation/components/_panels.scss +0 -95
- data/generators/foundation5/public/stylesheets/foundation/components/_pricing-tables.scss +0 -150
- data/generators/foundation5/public/stylesheets/foundation/components/_progress-bars.scss +0 -79
- data/generators/foundation5/public/stylesheets/foundation/components/_range-slider.scss +0 -168
- data/generators/foundation5/public/stylesheets/foundation/components/_reveal.scss +0 -222
- data/generators/foundation5/public/stylesheets/foundation/components/_side-nav.scss +0 -116
- data/generators/foundation5/public/stylesheets/foundation/components/_split-buttons.scss +0 -191
- data/generators/foundation5/public/stylesheets/foundation/components/_sub-nav.scss +0 -123
- data/generators/foundation5/public/stylesheets/foundation/components/_switches.scss +0 -230
- data/generators/foundation5/public/stylesheets/foundation/components/_tables.scss +0 -135
- data/generators/foundation5/public/stylesheets/foundation/components/_tabs.scss +0 -123
- data/generators/foundation5/public/stylesheets/foundation/components/_thumbs.scss +0 -66
- data/generators/foundation5/public/stylesheets/foundation/components/_toolbar.scss +0 -70
- data/generators/foundation5/public/stylesheets/foundation/components/_tooltips.scss +0 -142
- data/generators/foundation5/public/stylesheets/foundation/components/_top-bar.scss +0 -685
- data/generators/foundation5/public/stylesheets/foundation/components/_type.scss +0 -525
- data/generators/foundation5/public/stylesheets/foundation/components/_visibility.scss +0 -408
- data/generators/foundation5/public/stylesheets/foundation.css +0 -6138
- data/generators/foundation5/public/stylesheets/foundation.css.scss +0 -45
- data/generators/foundation5/public/stylesheets/normalize.css +0 -357
- data/lib/locomotive/wagon/generators/site/foundation4.rb +0 -34
@@ -0,0 +1,61 @@
|
|
1
|
+
/// Format for CSS classes created with Motion UI.
|
2
|
+
/// @type Map
|
3
|
+
/// @prop {Boolean} append [true] - Defines if selectors are chained to the selector (`.class.enter`), or appended as a new class (`.class-enter`).
|
4
|
+
/// @prop {String} prefix ['mui-'] - Prefix to add before the state of a class. Enter an empty string to use no prefix.
|
5
|
+
/// @prop {String} prefix ['-active'] - Suffix to add to the active state class.
|
6
|
+
$motion-ui-classes: (
|
7
|
+
chain: true,
|
8
|
+
prefix: 'mui-',
|
9
|
+
active: '-active',
|
10
|
+
) !default;
|
11
|
+
|
12
|
+
/// State names to reference when writing motion classes. To use multiple class names for one state, enter a list of strings instead of one string.
|
13
|
+
/// @type Map
|
14
|
+
$motion-ui-states: (
|
15
|
+
in: 'enter',
|
16
|
+
out: 'leave',
|
17
|
+
) !default;
|
18
|
+
|
19
|
+
/// Default speed that transitions and animations play at, along with values for modifier classes to change the speed.
|
20
|
+
/// @type Map
|
21
|
+
$motion-ui-speeds: (
|
22
|
+
default: 500ms,
|
23
|
+
slow: 750ms,
|
24
|
+
fast: 250ms,
|
25
|
+
) !default;
|
26
|
+
|
27
|
+
/// Default delay to add before motion, along with values for modifier classes to change the delay.
|
28
|
+
/// @type Map
|
29
|
+
$motion-ui-delays: (
|
30
|
+
default: 0,
|
31
|
+
short: 300ms,
|
32
|
+
long: 700ms,
|
33
|
+
) !default;
|
34
|
+
|
35
|
+
/// Default easing for transitions and animations, along with values for modifier classes to change the easing.
|
36
|
+
/// @type Map
|
37
|
+
$motion-ui-easings: (
|
38
|
+
default: linear,
|
39
|
+
linear: linear,
|
40
|
+
ease: ease,
|
41
|
+
ease-in: ease-in,
|
42
|
+
ease-out: ease-out,
|
43
|
+
ease-in-out: ease-in-out,
|
44
|
+
bounce-in: cubic-bezier(0.485, 0.155, 0.24, 1.245),
|
45
|
+
bounce-out: cubic-bezier(0.485, 0.155, 0.515, 0.845),
|
46
|
+
bounce-in-out: cubic-bezier(0.76, -0.245, 0.24, 1.245),
|
47
|
+
) !default;
|
48
|
+
|
49
|
+
/// Miscellaneous settings related to Motion UI.
|
50
|
+
/// @type Map
|
51
|
+
/// @prop {Boolean} slide-and-fade [false] - Defines if slide motions should also fade in/out.
|
52
|
+
/// @prop {Boolean} slide-and-fade [true] - Defines if hinge motions should also fade in/out.
|
53
|
+
/// @prop {Boolean} slide-and-fade [true] - Defines if scale motions should also fade in/out.
|
54
|
+
/// @prop {Boolean} slide-and-fade [true] - Defines if spin motions should also fade in/out.
|
55
|
+
$motion-ui-settings: (
|
56
|
+
slide-and-fade: false,
|
57
|
+
hinge-and-fade: true,
|
58
|
+
scale-and-fade: true,
|
59
|
+
spin-and-fade: true,
|
60
|
+
activate-queue-class: 'is-animating',
|
61
|
+
) !default;
|
@@ -0,0 +1,29 @@
|
|
1
|
+
/// Creates a fading animation.
|
2
|
+
/// @param {Number} $from [0] - Opacity to start at.
|
3
|
+
/// @param {Number} $to [1] - Opacity to end at.
|
4
|
+
/// @return {Map} A keyframes map that can be used with the `generate-keyframes()` mixin.
|
5
|
+
@function fade(
|
6
|
+
$from: 0,
|
7
|
+
$to: 1
|
8
|
+
) {
|
9
|
+
$type: type-of($from);
|
10
|
+
$keyframes: ();
|
11
|
+
|
12
|
+
@if $type == 'string' {
|
13
|
+
@if $from == in {
|
14
|
+
$from: 0;
|
15
|
+
$to: 1;
|
16
|
+
} @else if $from == out {
|
17
|
+
$from: 1;
|
18
|
+
$to: 0;
|
19
|
+
}
|
20
|
+
}
|
21
|
+
|
22
|
+
$keyframes: (
|
23
|
+
name: 'fade-#{$from}-to-#{$to}',
|
24
|
+
0: (opacity: $from),
|
25
|
+
100: (opacity: $to),
|
26
|
+
);
|
27
|
+
|
28
|
+
@return $keyframes;
|
29
|
+
}
|
@@ -0,0 +1,65 @@
|
|
1
|
+
/// Creates a hinge effect by rotating the element.
|
2
|
+
/// @param {Keyword} $state [in] - State to transition to.
|
3
|
+
/// @param {Keyword} $from [left] - Edge of the element to rotate from. Can be `top`, `right`, `bottom`, or `left`.
|
4
|
+
/// @param {Keyword} $axis [edge] - Axis of the element to rotate on. Can be `edge` or `center`.
|
5
|
+
/// @param {Number} $perspective [2000px] - Perceived distance between the viewer and the element. A higher number will make the rotation effect more pronounced.
|
6
|
+
/// @param {Keyword} $turn-origin [from-back] - Side of the element to start the rotation from. Can be `from-back` or `from-front`.
|
7
|
+
@function hinge (
|
8
|
+
$state: in,
|
9
|
+
$from: left,
|
10
|
+
$axis: edge,
|
11
|
+
$perspective: 2000px,
|
12
|
+
$turn-origin: from-back
|
13
|
+
) {
|
14
|
+
// Rotation directions when hinging from back vs. front
|
15
|
+
$rotation-amount: 90deg;
|
16
|
+
$rotations-back: (
|
17
|
+
top: rotateX($rotation-amount * -1),
|
18
|
+
right: rotateY($rotation-amount * -1),
|
19
|
+
bottom: rotateX($rotation-amount),
|
20
|
+
left: rotateY($rotation-amount),
|
21
|
+
);
|
22
|
+
$rotations-from: (
|
23
|
+
top: rotateX($rotation-amount),
|
24
|
+
right: rotateY($rotation-amount),
|
25
|
+
bottom: rotateX($rotation-amount * -1),
|
26
|
+
left: rotateY($rotation-amount * -1),
|
27
|
+
);
|
28
|
+
|
29
|
+
// Rotation origin
|
30
|
+
$rotation: '';
|
31
|
+
@if $turn-origin == from-front {
|
32
|
+
$rotation: map-get($rotations-from, $from);
|
33
|
+
} @else if $turn-origin == from-back {
|
34
|
+
$rotation: map-get($rotations-back, $from);
|
35
|
+
} @else {
|
36
|
+
@warn '$turn-origin must be either "from-back" or "from-front"';
|
37
|
+
}
|
38
|
+
|
39
|
+
// Start and end state
|
40
|
+
$start: '';
|
41
|
+
$end: '';
|
42
|
+
@if $state == in {
|
43
|
+
$start: perspective($perspective) $rotation;
|
44
|
+
$end: perspective($perspective) rotate(0deg);
|
45
|
+
} @else {
|
46
|
+
$start: perspective($perspective) rotate(0deg);
|
47
|
+
$end: perspective($perspective) $rotation;
|
48
|
+
}
|
49
|
+
|
50
|
+
// Turn axis
|
51
|
+
$origin: '';
|
52
|
+
@if $axis == edge {
|
53
|
+
$origin: $from;
|
54
|
+
} @else {
|
55
|
+
$origin: center;
|
56
|
+
}
|
57
|
+
|
58
|
+
$keyframes: (
|
59
|
+
name: 'hinge-#{$state}-#{$from}-#{$axis}-#{$turn-origin}',
|
60
|
+
0: (transform: $start, transform-origin: $origin),
|
61
|
+
100: (transform: $end),
|
62
|
+
);
|
63
|
+
|
64
|
+
@return $keyframes;
|
65
|
+
}
|
@@ -0,0 +1,15 @@
|
|
1
|
+
/// Creates a shaking animation.
|
2
|
+
/// @param {Percentage} $intensity [7%] - Intensity of the shake, as a percentage value.
|
3
|
+
/// @return {Map} A keyframes map that can be used with the `generate-keyframes()` mixin.
|
4
|
+
@function shake($intensity: 7%) {
|
5
|
+
$right: (0, 10, 20, 30, 40, 50, 60, 70, 80, 90);
|
6
|
+
$left: (5, 15, 25, 35, 45, 55, 65, 75, 85, 95);
|
7
|
+
|
8
|
+
$keyframes: (
|
9
|
+
name: 'shake-#{($intensity / 1%)}',
|
10
|
+
$right: (transform: translateX($intensity)),
|
11
|
+
$left: (transform: translateX(-$intensity)),
|
12
|
+
);
|
13
|
+
|
14
|
+
@return $keyframes;
|
15
|
+
}
|
@@ -0,0 +1,41 @@
|
|
1
|
+
/// Creates a sliding animation.
|
2
|
+
/// @param {Keyword} $state [in] - Whether to move to (`in`) or from (`out`) the element's default position.
|
3
|
+
/// @param {Keyword} $direction [up] - Direction to move. Can be `up`, `down`, `left`, or `right`.
|
4
|
+
/// @param {Number} $amount [100%] - Distance to move. Can be any CSS length unit.
|
5
|
+
/// @return {Map} A keyframes map that can be used with the `generate-keyframes()` mixin.
|
6
|
+
@function slide(
|
7
|
+
$state: in,
|
8
|
+
$direction: up,
|
9
|
+
$amount: 100%
|
10
|
+
) {
|
11
|
+
$from: $amount;
|
12
|
+
$to: 0;
|
13
|
+
$func: 'translateY';
|
14
|
+
|
15
|
+
@if $direction == left or $direction == right {
|
16
|
+
$func: 'translateX';
|
17
|
+
}
|
18
|
+
|
19
|
+
@if $state == out {
|
20
|
+
$from: 0;
|
21
|
+
$to: $amount;
|
22
|
+
}
|
23
|
+
|
24
|
+
@if $direction == down or $direction == right {
|
25
|
+
@if $state == in {
|
26
|
+
$from: -$from;
|
27
|
+
}
|
28
|
+
} @else {
|
29
|
+
@if $state == out {
|
30
|
+
$to: -$to;
|
31
|
+
}
|
32
|
+
}
|
33
|
+
|
34
|
+
$keyframes: (
|
35
|
+
name: 'slide-#{$state}-#{$direction}-#{strip-unit($amount)}',
|
36
|
+
0: (transform: '#{$func}(#{$from})'),
|
37
|
+
100: (transform: '#{$func}(#{$to})'),
|
38
|
+
);
|
39
|
+
|
40
|
+
@return $keyframes;
|
41
|
+
}
|
@@ -0,0 +1,28 @@
|
|
1
|
+
/// Creates a spinning animation.
|
2
|
+
/// @param {Keyword} $direction [cw] - Direction to spin. Should be `cw` (clockwise) or `ccw` (counterclockwise).
|
3
|
+
/// @param {Number} $amount [360deg] - Amount to spin. Can be any CSS angle unit.
|
4
|
+
/// @return {Map} A keyframes map that can be used with the `generate-keyframes()` mixin.
|
5
|
+
@function spin(
|
6
|
+
$state: in,
|
7
|
+
$direction: cw,
|
8
|
+
$amount: 1turn
|
9
|
+
) {
|
10
|
+
$start: 0;
|
11
|
+
$end: 0;
|
12
|
+
|
13
|
+
@if $state == in {
|
14
|
+
$start: if($direction == ccw, $amount, $amount * -1);
|
15
|
+
$end: 0;
|
16
|
+
} @else {
|
17
|
+
$start: 0;
|
18
|
+
$end: if($direction == ccw, $amount * -1, $amount);
|
19
|
+
}
|
20
|
+
|
21
|
+
$keyframes: (
|
22
|
+
name: 'spin-#{$direction}-#{$amount}',
|
23
|
+
0: (transform: rotate($start)),
|
24
|
+
100: (transform: rotate($end)),
|
25
|
+
);
|
26
|
+
|
27
|
+
@return $keyframes;
|
28
|
+
}
|
@@ -0,0 +1,13 @@
|
|
1
|
+
/// Creates a wiggling animation.
|
2
|
+
/// @param {Number} $intensity [7deg] - Intensity of the wiggle. Can be any CSS angle unit.
|
3
|
+
/// @return {Map} A keyframes map that can be used with the `generate-keyframes()` mixin.
|
4
|
+
@function wiggle($intensity: 7deg) {
|
5
|
+
$keyframes: (
|
6
|
+
name: 'wiggle-#{$intensity}',
|
7
|
+
(40, 50, 60): (transform: rotate($intensity)),
|
8
|
+
(35, 45, 55, 65): (transform: rotate(-$intensity)),
|
9
|
+
(0, 30, 70, 100): (transform: rotate(0)),
|
10
|
+
);
|
11
|
+
|
12
|
+
@return $keyframes;
|
13
|
+
}
|
@@ -0,0 +1,15 @@
|
|
1
|
+
/// Creates a scaling transition. A scale of `1` means the element is the same size. Larger numbers make the element bigger, while numbers less than 1 make the element smaller.
|
2
|
+
/// @param {Number} $from [1.5] - Size to start at.
|
3
|
+
/// @param {Number} $from [1] - Size to end at.
|
4
|
+
@function zoom(
|
5
|
+
$from: 0,
|
6
|
+
$to: 1
|
7
|
+
) {
|
8
|
+
$keyframes: (
|
9
|
+
name: 'scale-#{$to}-to-#{$from}',
|
10
|
+
0: (transform: scale($from)),
|
11
|
+
100: (transform: scale($to)),
|
12
|
+
);
|
13
|
+
|
14
|
+
@return $keyframes;
|
15
|
+
}
|
@@ -0,0 +1,29 @@
|
|
1
|
+
// Motion UI by ZURB
|
2
|
+
// foundation.zurb.com/motion-ui
|
3
|
+
// Licensed under MIT Open Source
|
4
|
+
|
5
|
+
@import 'settings';
|
6
|
+
|
7
|
+
@import 'util/animation';
|
8
|
+
@import 'util/args';
|
9
|
+
@import 'util/keyframe';
|
10
|
+
@import 'util/selector';
|
11
|
+
@import 'util/series';
|
12
|
+
@import 'util/transition';
|
13
|
+
@import 'util/unit';
|
14
|
+
|
15
|
+
@import 'effects/fade';
|
16
|
+
@import 'effects/hinge';
|
17
|
+
@import 'effects/spin';
|
18
|
+
@import 'effects/zoom';
|
19
|
+
@import 'effects/shake';
|
20
|
+
@import 'effects/slide';
|
21
|
+
@import 'effects/wiggle';
|
22
|
+
|
23
|
+
@import 'transitions/fade';
|
24
|
+
@import 'transitions/hinge';
|
25
|
+
@import 'transitions/zoom';
|
26
|
+
@import 'transitions/slide';
|
27
|
+
@import 'transitions/spin';
|
28
|
+
|
29
|
+
@import 'classes';
|
@@ -0,0 +1,28 @@
|
|
1
|
+
/// Creates a fade transition by adjusting the opacity of the element.
|
2
|
+
/// @param {Keyword} $state [in] - State to transition to.
|
3
|
+
/// @param {Number} $from [0] - Opacity to start at. Must be a number between 0 and 1.
|
4
|
+
/// @param {Number} $to [1] - Opacity to end on.
|
5
|
+
/// @param {Keyword} $duration [null] - Length (speed) of the transition.
|
6
|
+
/// @param {Keyword|Function} $timing [null] - Easing of the transition.
|
7
|
+
/// @param {Duration} $delay [null] - Delay in seconds or milliseconds before the transition starts.
|
8
|
+
@mixin mui-fade(
|
9
|
+
$state: in,
|
10
|
+
$from: 0,
|
11
|
+
$to: 1,
|
12
|
+
$duration: null,
|
13
|
+
$timing: null,
|
14
|
+
$delay: null
|
15
|
+
) {
|
16
|
+
$fade: fade($from, $to);
|
17
|
+
|
18
|
+
@include transition-start($state) {
|
19
|
+
@include transition-basics($duration, $timing, $delay);
|
20
|
+
@include -mui-keyframe-get($fade, 0);
|
21
|
+
|
22
|
+
transition-property: opacity;
|
23
|
+
}
|
24
|
+
|
25
|
+
@include transition-end($state) {
|
26
|
+
@include -mui-keyframe-get($fade, 100);
|
27
|
+
}
|
28
|
+
}
|
@@ -0,0 +1,43 @@
|
|
1
|
+
/// Creates a hinge transition by rotating the element.
|
2
|
+
/// @param {Keyword} $state [in] - State to transition to.
|
3
|
+
/// @param {Keyword} $from [left] - Edge of the element to rotate from. Can be `top`, `right`, `bottom`, or `left`.
|
4
|
+
/// @param {Keyword} $axis [edge] - Axis of the element to rotate on. Can be `edge` or `center`.
|
5
|
+
/// @param {Length} $perspective [2000px] - Perceived distance between the viewer and the element. A higher number will make the rotation effect more pronounced.
|
6
|
+
/// @param {Keyword} $turn-origin [from-back] - Side of the element to start the rotation from. Can be `from-back` or `from-front`.
|
7
|
+
/// @param {Boolean} $fade [true] - Set to `true` to fade the element in or out simultaneously.
|
8
|
+
/// @param {Duration} $duration [null] - Length (speed) of the transition.
|
9
|
+
/// @param {Keyword|Function} $timing [null] - Easing of the transition.
|
10
|
+
/// @param {Duration} $delay [null] - Delay in seconds or milliseconds before the transition starts.
|
11
|
+
@mixin mui-hinge (
|
12
|
+
$state: in,
|
13
|
+
$from: left,
|
14
|
+
$axis: edge,
|
15
|
+
$perspective: 2000px,
|
16
|
+
$turn-origin: from-back,
|
17
|
+
$fade: map-get($motion-ui-settings, hinge-and-fade),
|
18
|
+
$duration: null,
|
19
|
+
$timing: null,
|
20
|
+
$delay: null
|
21
|
+
) {
|
22
|
+
$hinge: hinge($state, $from, $axis, $perspective, $turn-origin);
|
23
|
+
|
24
|
+
@include transition-start($state) {
|
25
|
+
@include transition-basics($duration, $timing, $delay);
|
26
|
+
@include -mui-keyframe-get($hinge, 0);
|
27
|
+
|
28
|
+
@if $fade {
|
29
|
+
transition-property: transform, opacity;
|
30
|
+
opacity: if($state == in, 0, 1);
|
31
|
+
} @else {
|
32
|
+
transition-property: transform, opacity;
|
33
|
+
}
|
34
|
+
}
|
35
|
+
|
36
|
+
@include transition-end($state) {
|
37
|
+
@include -mui-keyframe-get($hinge, 100);
|
38
|
+
|
39
|
+
@if $fade {
|
40
|
+
opacity: if($state == in, 1, 0);
|
41
|
+
}
|
42
|
+
}
|
43
|
+
}
|
@@ -0,0 +1,42 @@
|
|
1
|
+
/// Creates a sliding transition by translating the element horizontally or vertically.
|
2
|
+
/// @param {Keyword} $state [in] - State to transition to.
|
3
|
+
/// @param {Keyword} $direction [left] - Side of the element to slide from. Can be `top`, `right`, `bottom`, or `left`.
|
4
|
+
/// @param {Length} $amount [100%] - Length of the slide as a percentage value.
|
5
|
+
/// @param {Boolean} $fade [false] - Set to `true` to fade the element in or out simultaneously.
|
6
|
+
/// @param {Duration} $duration [null] - Length (speed) of the transition.
|
7
|
+
/// @param {Keyword|Function} $timing [null] - Easing of the transition.
|
8
|
+
/// @param {Duration} $delay [null] - Delay in seconds or milliseconds before the transition starts.
|
9
|
+
@mixin mui-slide (
|
10
|
+
$state: in,
|
11
|
+
$direction: left,
|
12
|
+
$amount: 100%,
|
13
|
+
$fade: map-get($motion-ui-settings, slide-and-fade),
|
14
|
+
$duration: null,
|
15
|
+
$timing: null,
|
16
|
+
$delay: null
|
17
|
+
) {
|
18
|
+
$slide: slide($state, $direction, $amount);
|
19
|
+
|
20
|
+
// CSS Output
|
21
|
+
@include transition-start($state) {
|
22
|
+
@include transition-basics($duration, $timing, $delay);
|
23
|
+
@include -mui-keyframe-get($slide, 0);
|
24
|
+
|
25
|
+
@if $fade {
|
26
|
+
transition-property: transform, opacity;
|
27
|
+
opacity: if($state == in, 0, 1);
|
28
|
+
} @else {
|
29
|
+
transition-property: transform, opacity;
|
30
|
+
}
|
31
|
+
|
32
|
+
backface-visibility: hidden;
|
33
|
+
}
|
34
|
+
|
35
|
+
@include transition-end($state) {
|
36
|
+
@include -mui-keyframe-get($slide, 100);
|
37
|
+
|
38
|
+
@if $fade {
|
39
|
+
opacity: if($state == in, 1, 0);
|
40
|
+
}
|
41
|
+
}
|
42
|
+
}
|
@@ -0,0 +1,39 @@
|
|
1
|
+
/// Creates a spinning transition by rotating the element. The `turn` unit is used to specify how far to rotate. `1turn` is equal to a 360-degree spin.
|
2
|
+
/// @param {Keyword} $state [in] - State to transition to.
|
3
|
+
/// @param {Boolean} $direction [cw] - Direction to spin. Should be `cw` (clockwise) or `ccw` (counterclockwise).
|
4
|
+
/// @param {Number} $amount [0.75turn] - Amount to element the element.
|
5
|
+
/// @param {Boolean} $fade [false] - Set to `true` to fade the element in or out simultaneously.
|
6
|
+
/// @param {Duration} $duration [null] - Length (speed) of the transition.
|
7
|
+
/// @param {Keyword|Function} $timing [null] - Easing of the transition.
|
8
|
+
/// @param {Duration} $delay [null] - Delay in seconds or milliseconds before the transition starts.
|
9
|
+
@mixin mui-spin(
|
10
|
+
$state: in,
|
11
|
+
$direction: cw,
|
12
|
+
$amount: 0.75turn,
|
13
|
+
$fade: map-get($motion-ui-settings, spin-and-fade),
|
14
|
+
$duration: null,
|
15
|
+
$timing: null,
|
16
|
+
$delay: null
|
17
|
+
) {
|
18
|
+
$spin: spin($state, $direction, $amount);
|
19
|
+
|
20
|
+
@include transition-start($state) {
|
21
|
+
@include transition-basics($duration, $timing, $delay);
|
22
|
+
@include -mui-keyframe-get($spin, 0);
|
23
|
+
|
24
|
+
@if $fade {
|
25
|
+
transition-property: transform, opacity;
|
26
|
+
opacity: if($state == in, 0, 1);
|
27
|
+
} @else {
|
28
|
+
transition-property: transform, opacity;
|
29
|
+
}
|
30
|
+
}
|
31
|
+
|
32
|
+
@include transition-end($state) {
|
33
|
+
@include -mui-keyframe-get($spin, 100);
|
34
|
+
|
35
|
+
@if $fade {
|
36
|
+
opacity: if($state == in, 1, 0);
|
37
|
+
}
|
38
|
+
}
|
39
|
+
}
|
@@ -0,0 +1,39 @@
|
|
1
|
+
/// Creates a scaling transition. A scale of `1` means the element is the same size. Larger numbers make the element bigger, while numbers less than 1 make the element smaller.
|
2
|
+
/// @param {Keyword} $state [in] - State to transition to.
|
3
|
+
/// @param {Number} $from [1.5] - Size to start at.
|
4
|
+
/// @param {Number} $from [1] - Size to end at.
|
5
|
+
/// @param {Boolean} $fade [true] - Set to `true` to fade the element in or out simultaneously.
|
6
|
+
/// @param {Duration} $duration [null] - Length (speed) of the transition.
|
7
|
+
/// @param {Keyword|Function} $timing [null] - Easing of the transition.
|
8
|
+
/// @param {Duration} $delay [null] - Delay in seconds or milliseconds before the transition starts.
|
9
|
+
@mixin mui-zoom(
|
10
|
+
$state: in,
|
11
|
+
$from: 1.5,
|
12
|
+
$to: 1,
|
13
|
+
$fade: map-get($motion-ui-settings, scale-and-fade),
|
14
|
+
$duration: null,
|
15
|
+
$timing: null,
|
16
|
+
$delay: null
|
17
|
+
) {
|
18
|
+
$scale: zoom($from, $to);
|
19
|
+
|
20
|
+
@include transition-start($state) {
|
21
|
+
@include transition-basics($duration, $timing, $delay);
|
22
|
+
@include -mui-keyframe-get($scale, 0);
|
23
|
+
|
24
|
+
@if $fade {
|
25
|
+
transition-property: transform, opacity;
|
26
|
+
opacity: if($state == in, 0, 1);
|
27
|
+
} @else {
|
28
|
+
transition-property: transform, opacity;
|
29
|
+
}
|
30
|
+
}
|
31
|
+
|
32
|
+
@include transition-end($state) {
|
33
|
+
@include -mui-keyframe-get($scale, 100);
|
34
|
+
|
35
|
+
@if $fade {
|
36
|
+
opacity: if($state == in, 1, 0);
|
37
|
+
}
|
38
|
+
}
|
39
|
+
}
|
@@ -0,0 +1,7 @@
|
|
1
|
+
/// Creates a keyframe from one or more effect functions and assigns it to the element by adding the `animation-name` property.
|
2
|
+
/// @param {Function} $effects... - One or more effect functions to build the keyframe with.
|
3
|
+
@mixin mui-animation($args...) {
|
4
|
+
$name: map-get(-mui-process-args($args...), name);
|
5
|
+
@include mui-keyframes($name, $args...);
|
6
|
+
animation-name: unquote($name);
|
7
|
+
}
|
@@ -0,0 +1,15 @@
|
|
1
|
+
/// Processes a series of keyframe function arguments.
|
2
|
+
/// @access private
|
3
|
+
@function -mui-process-args($args...) {
|
4
|
+
@if length($args) == 1 {
|
5
|
+
$arg: nth($args, 1);
|
6
|
+
|
7
|
+
@if type-of($arg) == 'string' {
|
8
|
+
@return call($arg);
|
9
|
+
} @else if type-of($arg) == 'map' {
|
10
|
+
@return $arg;
|
11
|
+
}
|
12
|
+
}
|
13
|
+
|
14
|
+
@return -mui-keyframe-combine($args...);
|
15
|
+
}
|
@@ -0,0 +1,136 @@
|
|
1
|
+
// Internal counter for creating unique keyframe names
|
2
|
+
$-mui-custom: 0;
|
3
|
+
|
4
|
+
/// Creates a keyframe from one or more effect functions. Use this function instead of `mui-animation` if you want to create a keyframe animation *without* automatically assigning it to the element.
|
5
|
+
/// @param {String} $name - Name of the keyframe.
|
6
|
+
/// @param {Function} $effects... - One or more effect functions to build the keyframe with.
|
7
|
+
@mixin mui-keyframes($name, $effects...) {
|
8
|
+
$obj: -mui-process-args($effects...);
|
9
|
+
$obj: map-remove($obj, name);
|
10
|
+
|
11
|
+
@keyframes #{$name} {
|
12
|
+
// Now iterate through each keyframe percentage
|
13
|
+
@each $pct, $props in $obj {
|
14
|
+
#{-mui-keyframe-pct($pct)} {
|
15
|
+
// Lastly, iterate through each CSS property within a percentage and print it out
|
16
|
+
@each $prop, $value in $props {
|
17
|
+
#{$prop}: #{$value};
|
18
|
+
}
|
19
|
+
}
|
20
|
+
}
|
21
|
+
}
|
22
|
+
}
|
23
|
+
|
24
|
+
/// Creates a string for a CSS keyframe, by converting a list of numbers to a comma-separated list of percentage values.
|
25
|
+
/// @param {Number|List} $input - List of numbers to use.
|
26
|
+
/// @return {String} A set of comma-separated percentage values.
|
27
|
+
/// @access private
|
28
|
+
@function -mui-keyframe-pct($input) {
|
29
|
+
$output: ();
|
30
|
+
|
31
|
+
@if type-of($input) == 'number' {
|
32
|
+
$output: ($input * 1%);
|
33
|
+
} @else if type-of($input) == 'list' {
|
34
|
+
@each $i in $input {
|
35
|
+
$output: append($output, ($i * 1%), comma);
|
36
|
+
}
|
37
|
+
}
|
38
|
+
|
39
|
+
@return $output;
|
40
|
+
}
|
41
|
+
|
42
|
+
/// Prints the CSS properties from a specific key in a keyframes map. Used to borrow CSS from keyframe functions for use in transitions.
|
43
|
+
/// @param {Map} $kf - Keyframe map to extract from.
|
44
|
+
/// @param {Number} $key - Key in the map to print the CSS of.
|
45
|
+
/// @access private
|
46
|
+
@mixin -mui-keyframe-get($kf, $key) {
|
47
|
+
$map: map-get($kf, $key);
|
48
|
+
|
49
|
+
@each $prop, $value in $map or () {
|
50
|
+
// Some keyframe maps store transforms as quoted strings
|
51
|
+
@if type-of($value) == 'string' {
|
52
|
+
$value: unquote($value);
|
53
|
+
}
|
54
|
+
#{$prop}: $value;
|
55
|
+
}
|
56
|
+
}
|
57
|
+
|
58
|
+
/// Reformats a map containing keys with a list of values, so that each key is a single value.
|
59
|
+
/// @param {Map} $map - Map to split up.
|
60
|
+
/// @return {Map} A reformatted map.
|
61
|
+
/// @access private
|
62
|
+
@function -mui-keyframe-split($map) {
|
63
|
+
$new-map: ();
|
64
|
+
|
65
|
+
// Split keys with multiple values into individual keys
|
66
|
+
@each $key, $item in $map {
|
67
|
+
$key-type: type-of($key);
|
68
|
+
|
69
|
+
@if $key-type == 'number' {
|
70
|
+
$new-map: map-merge($new-map, ($key: $item));
|
71
|
+
} @else if $key-type == 'list' {
|
72
|
+
@each $k in $key {
|
73
|
+
$new-map: map-merge($new-map, ($k: $item));
|
74
|
+
}
|
75
|
+
}
|
76
|
+
}
|
77
|
+
|
78
|
+
@return $new-map;
|
79
|
+
}
|
80
|
+
|
81
|
+
/// Combines a series of keyframe objects into one.
|
82
|
+
/// @param {Map} $maps... - A series of maps to merge, as individual parameters.
|
83
|
+
/// @return {Map} A combined keyframe object.
|
84
|
+
/// @access private
|
85
|
+
@function -mui-keyframe-combine($maps...) {
|
86
|
+
$new-map: ();
|
87
|
+
|
88
|
+
// Iterate through each map passed in
|
89
|
+
@each $map in $maps {
|
90
|
+
@if type-of($map) == 'string' {
|
91
|
+
$map: call($map);
|
92
|
+
}
|
93
|
+
|
94
|
+
$map: -mui-keyframe-split($map);
|
95
|
+
|
96
|
+
// Iterate through each keyframe in the map
|
97
|
+
// $key is the keyframe percentage
|
98
|
+
// $value is a map of CSS properties
|
99
|
+
@each $key, $value in $map {
|
100
|
+
$new-value: ();
|
101
|
+
|
102
|
+
@if map-has-key($new-map, $key) {
|
103
|
+
// If the map already has the keyframe %, append the new property
|
104
|
+
$new-value: -mui-merge-properties(map-get($new-map, $key), $value);
|
105
|
+
} @else {
|
106
|
+
// Otherwise, create a new map with the new property
|
107
|
+
$new-value: $value;
|
108
|
+
}
|
109
|
+
|
110
|
+
// Finally, merge the modified keyframe value into the output map
|
111
|
+
$new-map: map-merge($new-map, ($key: $new-value));
|
112
|
+
}
|
113
|
+
}
|
114
|
+
|
115
|
+
// Make a name for the keyframes
|
116
|
+
$-mui-custom: $-mui-custom + 1 !global;
|
117
|
+
$map-name: (name: 'custom-#{$-mui-custom}');
|
118
|
+
$new-map: map-merge($new-map, $map-name);
|
119
|
+
|
120
|
+
@return $new-map;
|
121
|
+
}
|
122
|
+
|
123
|
+
/// Combines two maps of CSS properties into one map. If both maps have a transform property, the values from each will be combined into one property.
|
124
|
+
/// @param {Map} $one - First map to merge.
|
125
|
+
/// @param {Map} $two - Second map to merge.
|
126
|
+
/// @return {Map} A combined map.
|
127
|
+
/// @access private
|
128
|
+
@function -mui-merge-properties($one, $two) {
|
129
|
+
@if map-has-key($one, transform) and map-has-key($two, transform) {
|
130
|
+
$transform: join(map-get($one, transform), map-get($two, transform));
|
131
|
+
$one: map-merge($one, (transform: $transform));
|
132
|
+
$two: map-remove($two, transform);
|
133
|
+
}
|
134
|
+
|
135
|
+
@return map-merge($one, $two);
|
136
|
+
}
|