├── .gitattributes
├── .gitignore
├── .npmignore
├── Gruntfile.js
├── LICENSE
├── README.md
├── demo
├── index.css
└── index.html
├── dist
├── lib
│ └── modernizr.touch.js
├── mfb.css
├── mfb.css.map
├── mfb.js
├── mfb.min.css
└── mfb.min.js
├── package.json
├── src
├── _
│ ├── _fountain.scss
│ ├── _slidein-spring.scss
│ ├── _slidein.scss
│ └── _zoomin.scss
├── closure
│ ├── bottom.js
│ └── top.js
├── mfb.css.map
├── mfb.js
└── mfb.scss
└── test
└── unit.js
/.gitattributes:
--------------------------------------------------------------------------------
1 | **/*.css linguist-vendored=true
2 | **/*.scss linguist-vendored=true
3 | **/*.html linguist-vendored=true
4 |
--------------------------------------------------------------------------------
/.gitignore:
--------------------------------------------------------------------------------
1 | .DS_Store
2 | node_modules
3 | .sass-cache/
4 | .grunt
5 | ga.html
6 | gh-pages
7 |
--------------------------------------------------------------------------------
/.npmignore:
--------------------------------------------------------------------------------
1 | test/
2 | index.css
3 | index.html
4 | showcase.html
5 | .sass-cache/
6 | .jshintrc
7 | .gitignore
8 | .grunt
9 | demo
10 | gh-pages
11 | ga.html
12 |
--------------------------------------------------------------------------------
/Gruntfile.js:
--------------------------------------------------------------------------------
1 | module.exports = function(grunt) {
2 |
3 | // Project configuration.
4 | grunt.initConfig({
5 | pkg: grunt.file.readJSON('package.json'),
6 | watch: {
7 | css: {
8 | files: 'src/**/*.scss',
9 | tasks: ['sass:base', 'cssmin']
10 | },
11 | js: {
12 | files: 'src/**/*.js',
13 | tasks: ['copy:js', 'preprocess:closure', 'uglify']
14 | }
15 | },
16 | sass: {
17 | base: {
18 | files: {
19 | 'dist/mfb.css': 'src/mfb.scss'
20 | }
21 | }
22 | },
23 |
24 | clean: {
25 | check: ['.grunt/grunt-gh-pages/gh-pages/check'],
26 | live: ['.grunt/grunt-gh-pages/gh-pages/live']
27 | },
28 |
29 | cssmin: {
30 | main: {
31 | files: [{
32 | expand: true,
33 | cwd: 'src',
34 | src: ['mfb.css', '!*.min.css'],
35 | dest: 'dist',
36 | ext: '.min.css'
37 | }]
38 | }
39 | },
40 |
41 | uglify: {
42 | main: {
43 | files: {
44 | 'dist/mfb.min.js': ['dist/mfb.js']
45 | }
46 | }
47 | },
48 |
49 | preprocess: {
50 | inline : {
51 | src : [ 'gh-pages/index.html' ],
52 | options: {
53 | inline : true,
54 | context : {
55 | DEBUG: false
56 | }
57 | }
58 | },
59 | closure: {
60 | src : [ 'dist/*.js' ],
61 | options: {
62 | inline : true
63 | }
64 | }
65 | },
66 |
67 | copy: {
68 | live: {
69 | files: [{
70 | src: ['demo/*', 'dist/**/*'],
71 | dest: 'gh-pages',
72 | expand: true, flatten: true
73 | }]
74 | },
75 | js: {
76 | src: ['src/*.js'],
77 | dest: 'dist',
78 | expand: true, flatten: true
79 | }
80 | },
81 |
82 | useminPrepare: {
83 | html: 'demo/index.html',
84 | options: {
85 | dest: 'gh-pages/live/'
86 | }
87 | },
88 |
89 | usemin: {
90 | html: ['gh-pages/index.html']
91 | },
92 |
93 | livePages: [
94 | 'index.html',
95 | 'index.css',
96 | '*.css',
97 | '**/*.map',
98 | 'mfb.js',
99 | 'modernizr.touch.js'],
100 | 'gh-pages': {
101 | options: {
102 | base: 'gh-pages',
103 | },
104 | 'live': {
105 | src: ['<%= livePages %>']
106 | },
107 | 'check': {
108 | options: {
109 | push: false
110 | },
111 | src: ['<%= livePages %>']
112 | }
113 | }
114 | });
115 |
116 | grunt.loadNpmTasks('grunt-gh-pages');
117 | grunt.loadNpmTasks('grunt-contrib-watch');
118 | grunt.loadNpmTasks('grunt-contrib-sass');
119 | grunt.loadNpmTasks('grunt-contrib-clean');
120 | grunt.loadNpmTasks('grunt-contrib-cssmin');
121 | grunt.loadNpmTasks('grunt-contrib-uglify');
122 | grunt.loadNpmTasks('grunt-preprocess');
123 | grunt.loadNpmTasks('grunt-usemin');
124 | grunt.loadNpmTasks('grunt-contrib-copy');
125 |
126 | // Publish this to live site
127 | grunt.registerTask('live',
128 | ['clean:live',
129 | 'copy:live',
130 | 'useminPrepare',
131 | 'preprocess:inline',
132 | 'usemin',
133 | 'gh-pages:live']);
134 | // Live site dry run
135 | grunt.registerTask('livecheck', [
136 | 'clean:check',
137 | 'copy:live',
138 | 'useminPrepare',
139 | 'preprocess:inline',
140 | 'usemin',
141 | 'gh-pages:check']);
142 |
143 | grunt.registerTask('build', [
144 | 'sass',
145 | 'cssmin',
146 | 'uglify'
147 | ]);
148 |
149 | grunt.registerTask('watch-css', ['watch:css']);
150 | grunt.registerTask('watch-js', ['watch:js']);
151 | grunt.registerTask('default', []);
152 | };
153 |
--------------------------------------------------------------------------------
/LICENSE:
--------------------------------------------------------------------------------
1 | The MIT License (MIT)
2 |
3 | Copyright Nobitagit https://github.com/nobitagit (c) 2015
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 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | Material Floating Button
2 | ========================
3 |
4 | Material design floating button action implementation.
5 |
6 | Made to be semantic, fast and easy to customize.
7 | ~~Shamelessly~~ inspired by action buttons from Google Inbox, Evernote and Path.
8 |
9 | See a demo [here](http://nobitagit.github.io/material-floating-button/) to see it in action or just take a look at this awesome gif:
10 |
11 |
12 |
13 | Test all the available effects to date in the [demo](http://nobitagit.github.io/material-floating-button/).
14 |
15 | ##Other versions##
16 | Also available as:
17 |
18 | - [Angular directive](https://github.com/nobitagit/ng-material-floating-button)
19 | - [React Component](https://github.com/nobitagit/react-material-floating-button)
20 |
21 | ##How to use##
22 | ###Basic usage###
23 | Clone/download the repo from Github or just use npm:
24 | ```
25 | npm install mfb --save
26 | ```
27 |
28 | (Optionally) run `npm install` to have access to the configured Grunt tasks if you use them, then reference the basic css styles in your `
` like so:
29 |
30 | ```html
31 |
32 | ```
33 |
34 | Use the appropriate html structure (better explained later), for example:
35 |
36 | ```html
37 |
38 |
39 |
40 | ```
41 | Everything should already work fine.
42 |
43 | You may or may not want to include the provided `mfb.js` script depending on the need to support click/touch.
44 |
45 | ```html
46 |
47 | ```
48 |
49 | For a breakdown on why and when you need to include the script please refer to [Toggling options and touch devices support](#toggling-opts).
50 |
51 | ###Customising the component###
52 | ####HTML####
53 | The basic structure of the component is the following (the customisable classes/attributes are in curly braces):
54 |
55 | ```html
56 |
75 | ```
76 |
77 | ####SCSS/CSS####
78 |
79 | Although you can use the provided css as is, it's highly likely that you will want to customise the looks and behavior of the component by changing its underlying css. A number of variables is provided for your convenience in the SASS file.
80 |
81 | The best way to tweak them is leave the `src/mfb.scss` source as is, import it in your own style sheet and define your custom variables before the `@import` statement right there. For example:
82 |
83 | ```scss
84 | // your .scss working file
85 | $main-color: #4991EF;
86 |
87 | @import "path/to/src/mfb.scss";
88 | ```
89 |
90 | This will leave the core files unchanged from the source. You will then be able to keep this repo as upstream and pull in any future changes without having to worry about overwriting your changes.
91 |
92 | Here below is a breakdown of all the variables currently available, along with their defaults.
93 |
94 | #####Basic#####
95 |
96 | Variable name | Default value | Explanation
97 | --- | --- | ---
98 | $main-color | #E40A5D | main/primary color of the component
99 | $bright-text | rgba(255, 255, 255, 0.8) | color of icons and text
100 | $number-of-child-buttons | 4 | how many child buttons the component supports
101 |
102 | #####Effects#####
103 | **n.b.** - set to true to include the effect styles in the compiled .css file. To actually activate the desired effect you need to reference the corresponding class in the markup (see [here](#html))
104 |
105 | Variable name | Default value
106 | --- | ---
107 | $effects-zoomin | true
108 | $effects-slidein | true
109 | $effects-slidein-spring | true
110 | $effects-fountain | true
111 |
112 | As a suggestion, try to only include the animation you're using in production in order to have a much lighter css.
113 |
114 | #####Speeds#####
115 |
116 | Variable name | Default value | Explanation
117 | --- | --- | ---
118 | $delay-staggering-inflate | 0.1s | each child button can appear with a slight, more natural delay (set to 0 for no-delay)
119 | $slide-speed | 0.5s | the child buttons animate at this speed
120 | $label-hover-off | 0.5s | the child buttons labels fade *in* at this speed
121 | $label-hover-on | 0.3s | the child buttons labels fade *out* at this speed
122 |
123 | #####Sizes#####
124 |
125 | Variable name | Default value | Explanation
126 | --- | --- | ---
127 | $main_button_size | 25px | the distance of the main button from the closest corners of the screen
128 | $labels-font-size | 13px |font-size for all labels
129 | $labels-padding-vertical | 4px | top & bottom padding for the labels
130 | $labels-padding-horizontal | 10px | left & right padding for the labels
131 |
132 | You can compile the final css on your own or use the provided, pre-configured Grunt tasks for it. After installing all dependencies (by running `npm install` from the terminal) type `grunt sass` (on time compilation) or `grunt watch-css` (live reload triggered after the scss files are changed).
133 |
134 |
135 | ####Toggling options and touch devices support####
136 | The menu can be customised to be activated either on hover or on click/tap. To assign the desired toggling method the component provides some attributes to add this functionality in a declarative way right from the markup.
137 |
138 | #####Hover toggling#####
139 |
140 | If you're only interested in desktop support and want the menu to be activated on hover you won't need to include any scripts as that animation is CSS-based and included in the stylesheet provided. Just set the `data-mfb-toggle` attribute to `hover` like so:
141 |
142 | ```html
143 |
144 | ```
145 |
146 | #####Click toggling#####
147 |
148 | To add click and touch support (and to support the open/close animation programmatically, more on this later) include the `mfb.js` file and reference it in the page. Finally set the `data-mfb-toggle` attribute to `click`, along with the initial state you want the menu to appear at load time, using the `data-mfb-state` attribute. An example:
149 |
150 | ```html
151 |
152 | ```
153 |
154 | If you want the menu to appear open at load time, do this instead:
155 |
156 | ```html
157 |
158 | ```
159 |
160 | #####Hover toggling along with touch support#####
161 |
162 | If you want the menu to work on hover but need support for touch devices you first need to include Modernizr to detect touch support. If you are alreay using it in your project just make sure that the touch detection is enabled.
163 |
164 | If you're not using Modernizr already, just include the provided `modernizr.touch.js` script (look in the `src/lib/` folder) in your `` or get the latest version of this very script right from [here](http://modernizr.com/download/#-touch-teststyles-prefixes). Note that this is a custom build and will only detect for touch support, it's not the full library.
165 |
166 | Then include the `mfb.js` file, ideally at the bottom of your page.
167 | Once the scripts are in place just set up a normal button with hover toggling like so:
168 |
169 | ```html
170 |
64 | Customizable, semantic Material button implementation.
65 | Shamelessly Openly inspired by Google Inbox, Evernote and Path.
66 |
67 |
68 | To add Material Floating Buttons to any project just download or clone the repo from Github.
69 | Try it yourself by selecting a style here below, or click on the yellow button here above for a code preview and refer to the docs more info.
70 |
71 |
72 |
78 |
79 |
85 |
86 |
87 |
88 |
89 |
90 |
91 | To add Material Floating Buttons to any project just download the files from here below or clone the repo from Github.
92 |
110 | The two classes of the main <ul> tag define the position of the component and its associated animation. The rest of the code always stays the same regardless of position and animation chosen. Refer to the docs or to the showcase for a thorough explanation.
111 |
112 |
113 | The best way to integrate MFB in existing projects is to build the styles directly from the source. The scss file is filled with customizable variables. From there choose your favorite colors and sizes and then compile the css.
114 |
115 |
116 | If you use Grunt and have cloned the repo just run grunt build or grunt watch to have automatic compilation.
117 |
118 |
119 |
120 |
121 |
134 |
135 |
136 |
137 |
138 |
177 |
178 |
179 |
180 |
--------------------------------------------------------------------------------
/dist/lib/modernizr.touch.js:
--------------------------------------------------------------------------------
1 | /* Modernizr 2.8.3 (Custom Build) | MIT & BSD
2 | * Build: http://modernizr.com/download/#-touch-teststyles-prefixes
3 | */
4 | ;window.Modernizr=function(a,b,c){function v(a){i.cssText=a}function w(a,b){return v(l.join(a+";")+(b||""))}function x(a,b){return typeof a===b}function y(a,b){return!!~(""+a).indexOf(b)}function z(a,b,d){for(var e in a){var f=b[a[e]];if(f!==c)return d===!1?a[e]:x(f,"function")?f.bind(d||b):f}return!1}var d="2.8.3",e={},f=b.documentElement,g="modernizr",h=b.createElement(g),i=h.style,j,k={}.toString,l=" -webkit- -moz- -o- -ms- ".split(" "),m={},n={},o={},p=[],q=p.slice,r,s=function(a,c,d,e){var h,i,j,k,l=b.createElement("div"),m=b.body,n=m||b.createElement("body");if(parseInt(d,10))while(d--)j=b.createElement("div"),j.id=e?e[d]:g+(d+1),l.appendChild(j);return h=["",'"].join(""),l.id=g,(m?l:n).innerHTML+=h,n.appendChild(l),m||(n.style.background="",n.style.overflow="hidden",k=f.style.overflow,f.style.overflow="hidden",f.appendChild(n)),i=c(l,a),m?l.parentNode.removeChild(l):(n.parentNode.removeChild(n),f.style.overflow=k),!!i},t={}.hasOwnProperty,u;!x(t,"undefined")&&!x(t.call,"undefined")?u=function(a,b){return t.call(a,b)}:u=function(a,b){return b in a&&x(a.constructor.prototype[b],"undefined")},Function.prototype.bind||(Function.prototype.bind=function(b){var c=this;if(typeof c!="function")throw new TypeError;var d=q.call(arguments,1),e=function(){if(this instanceof e){var a=function(){};a.prototype=c.prototype;var f=new a,g=c.apply(f,d.concat(q.call(arguments)));return Object(g)===g?g:f}return c.apply(b,d.concat(q.call(arguments)))};return e}),m.touch=function(){var c;return"ontouchstart"in a||a.DocumentTouch&&b instanceof DocumentTouch?c=!0:s(["@media (",l.join("touch-enabled),("),g,")","{#modernizr{top:9px;position:absolute}}"].join(""),function(a){c=a.offsetTop===9}),c};for(var A in m)u(m,A)&&(r=A.toLowerCase(),e[r]=m[A](),p.push((e[r]?"":"no-")+r));return e.addTest=function(a,b){if(typeof a=="object")for(var d in a)u(a,d)&&e.addTest(d,a[d]);else{a=a.toLowerCase();if(e[a]!==c)return e;b=typeof b=="function"?b():b,typeof enableClasses!="undefined"&&enableClasses&&(f.className+=" "+(b?"":"no-")+a),e[a]=b}return e},v(""),h=j=null,e._version=d,e._prefixes=l,e.testStyles=s,e}(this,this.document);
--------------------------------------------------------------------------------
/dist/mfb.css:
--------------------------------------------------------------------------------
1 | /**
2 | * CONTENTS
3 | *
4 | * #Introduction........Naming conventions used throughout the code.
5 | *
6 | * #SETTINGS
7 | * Variables............Globally-available variables and config.
8 | *
9 | * #TOOLS
10 | * Mixins...............Useful mixins.
11 | *
12 | * #GENERIC
13 | * Demo styles..........Styles for demo only (consider removing these).
14 | *
15 | * #BASE
16 | * Raw styles...........The very basic component wrapper.
17 | * Modifiers............The basic styles dependant on component placement.
18 | * Debuggers............The basic styles dependant on component placement.
19 | *
20 | * #BUTTONS
21 | * Base..................Wrapping and constraining every button.
22 | * Modifiers.............Styles that depends on state and settings.
23 | * Animations............Main animations of the component.
24 | * Debuggers.............Styles for development.
25 | *
26 | * #LABELS
27 | * Base..................Wrapping and constraining every label.
28 | * Modifiers.............Styles that depends on state and settings.
29 | * Debuggers.............Styles for development.
30 | *
31 | * #DEVELOPMENT
32 | * In development........These styles are in development and not yet finalised
33 | * Debuggers.............Helper styles and flags for development.
34 | */
35 | /*------------------------------------*\
36 | #Introduction
37 | \*------------------------------------*/
38 | /**
39 | * The code AND the comments use naming conventions to refer to each part of
40 | * the UI put in place by this component. If you see that somewhere they are
41 | * not followed please consider a Pull Request. The naming conventions are:
42 | *
43 | * "Component" : the widget itself as a whole. This is the last time it will be
44 | * called anything different than "component". So, stay away from
45 | * "widget", "button" or anything else when referring to the
46 | * Component in general.
47 | *
48 | * "Main Button" : the button that is always in view. Hovering or clicking on it
49 | * will reveal the child buttons.
50 | *
51 | * "Child buttons" : if you've read the previous point you know what they are.
52 | * Did you read the previous point? :)
53 | *
54 | * "Label(s)" : the tooltip that fades in when hovering over a button.
55 |
56 | /*------------------------------------*\
57 | #SETTINGS | Variables
58 | \*------------------------------------*/
59 | /**
60 | * These variables are the default styles that serve as fallback and can be
61 | * easily customised at compile time.
62 | * Consider overriding them in your own style sheets rather than editing them
63 | * here. Refer to the docs for more info.
64 | */
65 | /* COLORS ----------------------------*/
66 | /* EFFECTS ---------------------------*/
67 | /* SPEEDS ----------------------------*/
68 | /* SIZES -----------------------------*/
69 | /* SPACING ---------------------------*/
70 | /* OTHER VARIABLES -------------------*/
71 | /*------------------------------------*\
72 | #BASE | Raw styles
73 | \*------------------------------------*/
74 | /**
75 | * The very core styling of the button.
76 | * These styles are shared by every instance of the button.
77 | * Styles placed here should NOT care about placement in the screen,
78 | * options chosen by the user or state of the button.
79 | */
80 | .mfb-component--tl, .mfb-component--tr, .mfb-component--bl, .mfb-component--br {
81 | box-sizing: border-box;
82 | margin: 25px;
83 | position: fixed;
84 | white-space: nowrap;
85 | z-index: 30;
86 | padding-left: 0;
87 | list-style: none; }
88 | .mfb-component--tl *, .mfb-component--tr *, .mfb-component--bl *, .mfb-component--br *, .mfb-component--tl *:before, .mfb-component--tr *:before, .mfb-component--bl *:before, .mfb-component--br *:before, .mfb-component--tl *:after, .mfb-component--tr *:after, .mfb-component--bl *:after, .mfb-component--br *:after {
89 | box-sizing: inherit; }
90 |
91 | /*------------------------------------*\
92 | #BASE | Modifiers
93 | \*------------------------------------*/
94 | /**
95 | * These styles depends on the placement of the button.
96 | * Styles can be:
97 | * 1. Top-left: modified by the " --tl " suffix.
98 | * 2. Top-right: modified by the " --tr " suffix.
99 | * 3. Bottom-left: modified by the " --bl " suffix.
100 | * 4. Bottom-right: modified by the " --br " suffix.
101 | */
102 | .mfb-component--tl {
103 | left: 0;
104 | top: 0; }
105 |
106 | .mfb-component--tr {
107 | right: 0;
108 | top: 0; }
109 |
110 | .mfb-component--bl {
111 | left: 0;
112 | bottom: 0; }
113 |
114 | .mfb-component--br {
115 | right: 0;
116 | bottom: 0; }
117 |
118 | /*------------------------------------*\
119 | #BUTTONS | Base
120 | \*------------------------------------*/
121 | .mfb-component__button--main, .mfb-component__button--child {
122 | background-color: #E40A5D;
123 | display: inline-block;
124 | position: relative;
125 | border: none;
126 | border-radius: 50%;
127 | box-shadow: 0 0 4px rgba(0, 0, 0, 0.14), 0 4px 8px rgba(0, 0, 0, 0.28);
128 | cursor: pointer;
129 | outline: none;
130 | padding: 0;
131 | position: relative;
132 | -webkit-user-drag: none;
133 | color: #f1f1f1; }
134 |
135 | /**
136 | * This is the unordered list for the list items that contain
137 | * the child buttons.
138 | *
139 | */
140 | .mfb-component__list {
141 | list-style: none;
142 | margin: 0;
143 | padding: 0; }
144 | .mfb-component__list > li {
145 | display: block;
146 | position: absolute;
147 | top: 0;
148 | right: 1px;
149 | padding: 10px 0;
150 | margin: -10px 0; }
151 |
152 | /**
153 | * These are the basic styles for all the icons inside the main button
154 | */
155 | .mfb-component__icon, .mfb-component__main-icon--active,
156 | .mfb-component__main-icon--resting, .mfb-component__child-icon {
157 | position: absolute;
158 | font-size: 18px;
159 | text-align: center;
160 | line-height: 56px;
161 | width: 100%; }
162 |
163 | .mfb-component__wrap {
164 | padding: 25px;
165 | margin: -25px; }
166 |
167 | [data-mfb-toggle="hover"]:hover .mfb-component__icon, [data-mfb-toggle="hover"]:hover .mfb-component__main-icon--active,
168 | [data-mfb-toggle="hover"]:hover .mfb-component__main-icon--resting, [data-mfb-toggle="hover"]:hover .mfb-component__child-icon,
169 | [data-mfb-state="open"] .mfb-component__icon,
170 | [data-mfb-state="open"] .mfb-component__main-icon--active,
171 | [data-mfb-state="open"] .mfb-component__main-icon--resting,
172 | [data-mfb-state="open"] .mfb-component__child-icon {
173 | -webkit-transform: scale(1) rotate(0deg);
174 | transform: scale(1) rotate(0deg); }
175 |
176 | /*------------------------------------*\
177 | #BUTTONS | Modifiers
178 | \*------------------------------------*/
179 | .mfb-component__button--main {
180 | height: 56px;
181 | width: 56px;
182 | z-index: 20; }
183 |
184 | .mfb-component__button--child {
185 | height: 56px;
186 | width: 56px; }
187 |
188 | .mfb-component__main-icon--active,
189 | .mfb-component__main-icon--resting {
190 | -webkit-transform: scale(1) rotate(360deg);
191 | transform: scale(1) rotate(360deg);
192 | -webkit-transition: -webkit-transform 150ms cubic-bezier(0.4, 0, 1, 1);
193 | transition: transform 150ms cubic-bezier(0.4, 0, 1, 1); }
194 |
195 | .mfb-component__child-icon,
196 | .mfb-component__child-icon {
197 | line-height: 56px;
198 | font-size: 18px; }
199 |
200 | .mfb-component__main-icon--active {
201 | opacity: 0; }
202 |
203 | [data-mfb-toggle="hover"]:hover .mfb-component__main-icon,
204 | [data-mfb-state="open"] .mfb-component__main-icon {
205 | -webkit-transform: scale(1) rotate(0deg);
206 | transform: scale(1) rotate(0deg); }
207 | [data-mfb-toggle="hover"]:hover .mfb-component__main-icon--resting,
208 | [data-mfb-state="open"] .mfb-component__main-icon--resting {
209 | opacity: 0;
210 | position: absolute !important; }
211 | [data-mfb-toggle="hover"]:hover .mfb-component__main-icon--active,
212 | [data-mfb-state="open"] .mfb-component__main-icon--active {
213 | opacity: 1; }
214 |
215 | /*------------------------------------*\
216 | #BUTTONS | Animations
217 | \*------------------------------------*/
218 | /**
219 | * SLIDE IN + FADE
220 | * When hovering the main button, the child buttons slide out from beneath
221 | * the main button while transitioning from transparent to opaque.
222 | *
223 | */
224 | .mfb-component--tl.mfb-slidein .mfb-component__list li,
225 | .mfb-component--tr.mfb-slidein .mfb-component__list li {
226 | opacity: 0;
227 | transition: all 0.5s; }
228 | .mfb-component--tl.mfb-slidein[data-mfb-toggle="hover"]:hover .mfb-component__list li, .mfb-component--tl.mfb-slidein[data-mfb-state="open"] .mfb-component__list li,
229 | .mfb-component--tr.mfb-slidein[data-mfb-toggle="hover"]:hover .mfb-component__list li,
230 | .mfb-component--tr.mfb-slidein[data-mfb-state="open"] .mfb-component__list li {
231 | opacity: 1; }
232 | .mfb-component--tl.mfb-slidein[data-mfb-toggle="hover"]:hover .mfb-component__list li:nth-child(1), .mfb-component--tl.mfb-slidein[data-mfb-state="open"] .mfb-component__list li:nth-child(1),
233 | .mfb-component--tr.mfb-slidein[data-mfb-toggle="hover"]:hover .mfb-component__list li:nth-child(1),
234 | .mfb-component--tr.mfb-slidein[data-mfb-state="open"] .mfb-component__list li:nth-child(1) {
235 | -webkit-transform: translateY(70px);
236 | transform: translateY(70px); }
237 | .mfb-component--tl.mfb-slidein[data-mfb-toggle="hover"]:hover .mfb-component__list li:nth-child(2), .mfb-component--tl.mfb-slidein[data-mfb-state="open"] .mfb-component__list li:nth-child(2),
238 | .mfb-component--tr.mfb-slidein[data-mfb-toggle="hover"]:hover .mfb-component__list li:nth-child(2),
239 | .mfb-component--tr.mfb-slidein[data-mfb-state="open"] .mfb-component__list li:nth-child(2) {
240 | -webkit-transform: translateY(140px);
241 | transform: translateY(140px); }
242 | .mfb-component--tl.mfb-slidein[data-mfb-toggle="hover"]:hover .mfb-component__list li:nth-child(3), .mfb-component--tl.mfb-slidein[data-mfb-state="open"] .mfb-component__list li:nth-child(3),
243 | .mfb-component--tr.mfb-slidein[data-mfb-toggle="hover"]:hover .mfb-component__list li:nth-child(3),
244 | .mfb-component--tr.mfb-slidein[data-mfb-state="open"] .mfb-component__list li:nth-child(3) {
245 | -webkit-transform: translateY(210px);
246 | transform: translateY(210px); }
247 | .mfb-component--tl.mfb-slidein[data-mfb-toggle="hover"]:hover .mfb-component__list li:nth-child(4), .mfb-component--tl.mfb-slidein[data-mfb-state="open"] .mfb-component__list li:nth-child(4),
248 | .mfb-component--tr.mfb-slidein[data-mfb-toggle="hover"]:hover .mfb-component__list li:nth-child(4),
249 | .mfb-component--tr.mfb-slidein[data-mfb-state="open"] .mfb-component__list li:nth-child(4) {
250 | -webkit-transform: translateY(280px);
251 | transform: translateY(280px); }
252 |
253 | .mfb-component--bl.mfb-slidein .mfb-component__list li,
254 | .mfb-component--br.mfb-slidein .mfb-component__list li {
255 | opacity: 0;
256 | transition: all 0.5s; }
257 | .mfb-component--bl.mfb-slidein[data-mfb-toggle="hover"]:hover .mfb-component__list li, .mfb-component--bl.mfb-slidein[data-mfb-state="open"] .mfb-component__list li,
258 | .mfb-component--br.mfb-slidein[data-mfb-toggle="hover"]:hover .mfb-component__list li,
259 | .mfb-component--br.mfb-slidein[data-mfb-state="open"] .mfb-component__list li {
260 | opacity: 1; }
261 | .mfb-component--bl.mfb-slidein[data-mfb-toggle="hover"]:hover .mfb-component__list li:nth-child(1), .mfb-component--bl.mfb-slidein[data-mfb-state="open"] .mfb-component__list li:nth-child(1),
262 | .mfb-component--br.mfb-slidein[data-mfb-toggle="hover"]:hover .mfb-component__list li:nth-child(1),
263 | .mfb-component--br.mfb-slidein[data-mfb-state="open"] .mfb-component__list li:nth-child(1) {
264 | -webkit-transform: translateY(-70px);
265 | transform: translateY(-70px); }
266 | .mfb-component--bl.mfb-slidein[data-mfb-toggle="hover"]:hover .mfb-component__list li:nth-child(2), .mfb-component--bl.mfb-slidein[data-mfb-state="open"] .mfb-component__list li:nth-child(2),
267 | .mfb-component--br.mfb-slidein[data-mfb-toggle="hover"]:hover .mfb-component__list li:nth-child(2),
268 | .mfb-component--br.mfb-slidein[data-mfb-state="open"] .mfb-component__list li:nth-child(2) {
269 | -webkit-transform: translateY(-140px);
270 | transform: translateY(-140px); }
271 | .mfb-component--bl.mfb-slidein[data-mfb-toggle="hover"]:hover .mfb-component__list li:nth-child(3), .mfb-component--bl.mfb-slidein[data-mfb-state="open"] .mfb-component__list li:nth-child(3),
272 | .mfb-component--br.mfb-slidein[data-mfb-toggle="hover"]:hover .mfb-component__list li:nth-child(3),
273 | .mfb-component--br.mfb-slidein[data-mfb-state="open"] .mfb-component__list li:nth-child(3) {
274 | -webkit-transform: translateY(-210px);
275 | transform: translateY(-210px); }
276 | .mfb-component--bl.mfb-slidein[data-mfb-toggle="hover"]:hover .mfb-component__list li:nth-child(4), .mfb-component--bl.mfb-slidein[data-mfb-state="open"] .mfb-component__list li:nth-child(4),
277 | .mfb-component--br.mfb-slidein[data-mfb-toggle="hover"]:hover .mfb-component__list li:nth-child(4),
278 | .mfb-component--br.mfb-slidein[data-mfb-state="open"] .mfb-component__list li:nth-child(4) {
279 | -webkit-transform: translateY(-280px);
280 | transform: translateY(-280px); }
281 |
282 | /**
283 | * SLIDE IN SPRING
284 | * Same as slide-in but with a springy animation.
285 | *
286 | */
287 | .mfb-component--tl.mfb-slidein-spring .mfb-component__list li,
288 | .mfb-component--tr.mfb-slidein-spring .mfb-component__list li {
289 | opacity: 0;
290 | transition: all 0.5s;
291 | transition-timing-function: cubic-bezier(0.68, -0.55, 0.265, 1.55); }
292 | .mfb-component--tl.mfb-slidein-spring .mfb-component__list li:nth-child(1),
293 | .mfb-component--tr.mfb-slidein-spring .mfb-component__list li:nth-child(1) {
294 | transition-delay: 0.05s; }
295 | .mfb-component--tl.mfb-slidein-spring .mfb-component__list li:nth-child(2),
296 | .mfb-component--tr.mfb-slidein-spring .mfb-component__list li:nth-child(2) {
297 | transition-delay: 0.1s; }
298 | .mfb-component--tl.mfb-slidein-spring .mfb-component__list li:nth-child(3),
299 | .mfb-component--tr.mfb-slidein-spring .mfb-component__list li:nth-child(3) {
300 | transition-delay: 0.15s; }
301 | .mfb-component--tl.mfb-slidein-spring .mfb-component__list li:nth-child(4),
302 | .mfb-component--tr.mfb-slidein-spring .mfb-component__list li:nth-child(4) {
303 | transition-delay: 0.2s; }
304 | .mfb-component--tl.mfb-slidein-spring[data-mfb-toggle="hover"]:hover .mfb-component__list li, .mfb-component--tl.mfb-slidein-spring[data-mfb-state="open"] .mfb-component__list li,
305 | .mfb-component--tr.mfb-slidein-spring[data-mfb-toggle="hover"]:hover .mfb-component__list li,
306 | .mfb-component--tr.mfb-slidein-spring[data-mfb-state="open"] .mfb-component__list li {
307 | opacity: 1; }
308 | .mfb-component--tl.mfb-slidein-spring[data-mfb-toggle="hover"]:hover .mfb-component__list li:nth-child(1), .mfb-component--tl.mfb-slidein-spring[data-mfb-state="open"] .mfb-component__list li:nth-child(1),
309 | .mfb-component--tr.mfb-slidein-spring[data-mfb-toggle="hover"]:hover .mfb-component__list li:nth-child(1),
310 | .mfb-component--tr.mfb-slidein-spring[data-mfb-state="open"] .mfb-component__list li:nth-child(1) {
311 | transition-delay: 0.05s;
312 | -webkit-transform: translateY(70px);
313 | transform: translateY(70px); }
314 | .mfb-component--tl.mfb-slidein-spring[data-mfb-toggle="hover"]:hover .mfb-component__list li:nth-child(2), .mfb-component--tl.mfb-slidein-spring[data-mfb-state="open"] .mfb-component__list li:nth-child(2),
315 | .mfb-component--tr.mfb-slidein-spring[data-mfb-toggle="hover"]:hover .mfb-component__list li:nth-child(2),
316 | .mfb-component--tr.mfb-slidein-spring[data-mfb-state="open"] .mfb-component__list li:nth-child(2) {
317 | transition-delay: 0.1s;
318 | -webkit-transform: translateY(140px);
319 | transform: translateY(140px); }
320 | .mfb-component--tl.mfb-slidein-spring[data-mfb-toggle="hover"]:hover .mfb-component__list li:nth-child(3), .mfb-component--tl.mfb-slidein-spring[data-mfb-state="open"] .mfb-component__list li:nth-child(3),
321 | .mfb-component--tr.mfb-slidein-spring[data-mfb-toggle="hover"]:hover .mfb-component__list li:nth-child(3),
322 | .mfb-component--tr.mfb-slidein-spring[data-mfb-state="open"] .mfb-component__list li:nth-child(3) {
323 | transition-delay: 0.15s;
324 | -webkit-transform: translateY(210px);
325 | transform: translateY(210px); }
326 | .mfb-component--tl.mfb-slidein-spring[data-mfb-toggle="hover"]:hover .mfb-component__list li:nth-child(4), .mfb-component--tl.mfb-slidein-spring[data-mfb-state="open"] .mfb-component__list li:nth-child(4),
327 | .mfb-component--tr.mfb-slidein-spring[data-mfb-toggle="hover"]:hover .mfb-component__list li:nth-child(4),
328 | .mfb-component--tr.mfb-slidein-spring[data-mfb-state="open"] .mfb-component__list li:nth-child(4) {
329 | transition-delay: 0.2s;
330 | -webkit-transform: translateY(280px);
331 | transform: translateY(280px); }
332 |
333 | .mfb-component--bl.mfb-slidein-spring .mfb-component__list li,
334 | .mfb-component--br.mfb-slidein-spring .mfb-component__list li {
335 | opacity: 0;
336 | transition: all 0.5s;
337 | transition-timing-function: cubic-bezier(0.68, -0.55, 0.265, 1.55); }
338 | .mfb-component--bl.mfb-slidein-spring .mfb-component__list li:nth-child(1),
339 | .mfb-component--br.mfb-slidein-spring .mfb-component__list li:nth-child(1) {
340 | transition-delay: 0.05s; }
341 | .mfb-component--bl.mfb-slidein-spring .mfb-component__list li:nth-child(2),
342 | .mfb-component--br.mfb-slidein-spring .mfb-component__list li:nth-child(2) {
343 | transition-delay: 0.1s; }
344 | .mfb-component--bl.mfb-slidein-spring .mfb-component__list li:nth-child(3),
345 | .mfb-component--br.mfb-slidein-spring .mfb-component__list li:nth-child(3) {
346 | transition-delay: 0.15s; }
347 | .mfb-component--bl.mfb-slidein-spring .mfb-component__list li:nth-child(4),
348 | .mfb-component--br.mfb-slidein-spring .mfb-component__list li:nth-child(4) {
349 | transition-delay: 0.2s; }
350 | .mfb-component--bl.mfb-slidein-spring[data-mfb-toggle="hover"]:hover .mfb-component__list li, .mfb-component--bl.mfb-slidein-spring[data-mfb-state="open"] .mfb-component__list li,
351 | .mfb-component--br.mfb-slidein-spring[data-mfb-toggle="hover"]:hover .mfb-component__list li,
352 | .mfb-component--br.mfb-slidein-spring[data-mfb-state="open"] .mfb-component__list li {
353 | opacity: 1; }
354 | .mfb-component--bl.mfb-slidein-spring[data-mfb-toggle="hover"]:hover .mfb-component__list li:nth-child(1), .mfb-component--bl.mfb-slidein-spring[data-mfb-state="open"] .mfb-component__list li:nth-child(1),
355 | .mfb-component--br.mfb-slidein-spring[data-mfb-toggle="hover"]:hover .mfb-component__list li:nth-child(1),
356 | .mfb-component--br.mfb-slidein-spring[data-mfb-state="open"] .mfb-component__list li:nth-child(1) {
357 | transition-delay: 0.05s;
358 | -webkit-transform: translateY(-70px);
359 | transform: translateY(-70px); }
360 | .mfb-component--bl.mfb-slidein-spring[data-mfb-toggle="hover"]:hover .mfb-component__list li:nth-child(2), .mfb-component--bl.mfb-slidein-spring[data-mfb-state="open"] .mfb-component__list li:nth-child(2),
361 | .mfb-component--br.mfb-slidein-spring[data-mfb-toggle="hover"]:hover .mfb-component__list li:nth-child(2),
362 | .mfb-component--br.mfb-slidein-spring[data-mfb-state="open"] .mfb-component__list li:nth-child(2) {
363 | transition-delay: 0.1s;
364 | -webkit-transform: translateY(-140px);
365 | transform: translateY(-140px); }
366 | .mfb-component--bl.mfb-slidein-spring[data-mfb-toggle="hover"]:hover .mfb-component__list li:nth-child(3), .mfb-component--bl.mfb-slidein-spring[data-mfb-state="open"] .mfb-component__list li:nth-child(3),
367 | .mfb-component--br.mfb-slidein-spring[data-mfb-toggle="hover"]:hover .mfb-component__list li:nth-child(3),
368 | .mfb-component--br.mfb-slidein-spring[data-mfb-state="open"] .mfb-component__list li:nth-child(3) {
369 | transition-delay: 0.15s;
370 | -webkit-transform: translateY(-210px);
371 | transform: translateY(-210px); }
372 | .mfb-component--bl.mfb-slidein-spring[data-mfb-toggle="hover"]:hover .mfb-component__list li:nth-child(4), .mfb-component--bl.mfb-slidein-spring[data-mfb-state="open"] .mfb-component__list li:nth-child(4),
373 | .mfb-component--br.mfb-slidein-spring[data-mfb-toggle="hover"]:hover .mfb-component__list li:nth-child(4),
374 | .mfb-component--br.mfb-slidein-spring[data-mfb-state="open"] .mfb-component__list li:nth-child(4) {
375 | transition-delay: 0.2s;
376 | -webkit-transform: translateY(-280px);
377 | transform: translateY(-280px); }
378 |
379 | /**
380 | * ZOOM-IN
381 | * When hovering the main button, the child buttons grow
382 | * from zero to normal size.
383 | *
384 | */
385 | .mfb-component--tl.mfb-zoomin .mfb-component__list li,
386 | .mfb-component--tr.mfb-zoomin .mfb-component__list li {
387 | -webkit-transform: scale(0);
388 | transform: scale(0); }
389 | .mfb-component--tl.mfb-zoomin .mfb-component__list li:nth-child(1),
390 | .mfb-component--tr.mfb-zoomin .mfb-component__list li:nth-child(1) {
391 | -webkit-transform: translateY(70px) scale(0);
392 | transform: translateY(70px) scale(0);
393 | transition: all 0.5s;
394 | transition-delay: 0.15s; }
395 | .mfb-component--tl.mfb-zoomin .mfb-component__list li:nth-child(2),
396 | .mfb-component--tr.mfb-zoomin .mfb-component__list li:nth-child(2) {
397 | -webkit-transform: translateY(140px) scale(0);
398 | transform: translateY(140px) scale(0);
399 | transition: all 0.5s;
400 | transition-delay: 0.1s; }
401 | .mfb-component--tl.mfb-zoomin .mfb-component__list li:nth-child(3),
402 | .mfb-component--tr.mfb-zoomin .mfb-component__list li:nth-child(3) {
403 | -webkit-transform: translateY(210px) scale(0);
404 | transform: translateY(210px) scale(0);
405 | transition: all 0.5s;
406 | transition-delay: 0.05s; }
407 | .mfb-component--tl.mfb-zoomin .mfb-component__list li:nth-child(4),
408 | .mfb-component--tr.mfb-zoomin .mfb-component__list li:nth-child(4) {
409 | -webkit-transform: translateY(280px) scale(0);
410 | transform: translateY(280px) scale(0);
411 | transition: all 0.5s;
412 | transition-delay: 0s; }
413 | .mfb-component--tl.mfb-zoomin[data-mfb-toggle="hover"]:hover .mfb-component__list li:nth-child(1), .mfb-component--tl.mfb-zoomin[data-mfb-state="open"] .mfb-component__list li:nth-child(1),
414 | .mfb-component--tr.mfb-zoomin[data-mfb-toggle="hover"]:hover .mfb-component__list li:nth-child(1),
415 | .mfb-component--tr.mfb-zoomin[data-mfb-state="open"] .mfb-component__list li:nth-child(1) {
416 | -webkit-transform: translateY(70px) scale(1);
417 | transform: translateY(70px) scale(1);
418 | transition-delay: 0.05s; }
419 | .mfb-component--tl.mfb-zoomin[data-mfb-toggle="hover"]:hover .mfb-component__list li:nth-child(2), .mfb-component--tl.mfb-zoomin[data-mfb-state="open"] .mfb-component__list li:nth-child(2),
420 | .mfb-component--tr.mfb-zoomin[data-mfb-toggle="hover"]:hover .mfb-component__list li:nth-child(2),
421 | .mfb-component--tr.mfb-zoomin[data-mfb-state="open"] .mfb-component__list li:nth-child(2) {
422 | -webkit-transform: translateY(140px) scale(1);
423 | transform: translateY(140px) scale(1);
424 | transition-delay: 0.1s; }
425 | .mfb-component--tl.mfb-zoomin[data-mfb-toggle="hover"]:hover .mfb-component__list li:nth-child(3), .mfb-component--tl.mfb-zoomin[data-mfb-state="open"] .mfb-component__list li:nth-child(3),
426 | .mfb-component--tr.mfb-zoomin[data-mfb-toggle="hover"]:hover .mfb-component__list li:nth-child(3),
427 | .mfb-component--tr.mfb-zoomin[data-mfb-state="open"] .mfb-component__list li:nth-child(3) {
428 | -webkit-transform: translateY(210px) scale(1);
429 | transform: translateY(210px) scale(1);
430 | transition-delay: 0.15s; }
431 | .mfb-component--tl.mfb-zoomin[data-mfb-toggle="hover"]:hover .mfb-component__list li:nth-child(4), .mfb-component--tl.mfb-zoomin[data-mfb-state="open"] .mfb-component__list li:nth-child(4),
432 | .mfb-component--tr.mfb-zoomin[data-mfb-toggle="hover"]:hover .mfb-component__list li:nth-child(4),
433 | .mfb-component--tr.mfb-zoomin[data-mfb-state="open"] .mfb-component__list li:nth-child(4) {
434 | -webkit-transform: translateY(280px) scale(1);
435 | transform: translateY(280px) scale(1);
436 | transition-delay: 0.2s; }
437 |
438 | .mfb-component--bl.mfb-zoomin .mfb-component__list li,
439 | .mfb-component--br.mfb-zoomin .mfb-component__list li {
440 | -webkit-transform: scale(0);
441 | transform: scale(0); }
442 | .mfb-component--bl.mfb-zoomin .mfb-component__list li:nth-child(1),
443 | .mfb-component--br.mfb-zoomin .mfb-component__list li:nth-child(1) {
444 | -webkit-transform: translateY(-70px) scale(0);
445 | transform: translateY(-70px) scale(0);
446 | transition: all 0.5s;
447 | transition-delay: 0.15s; }
448 | .mfb-component--bl.mfb-zoomin .mfb-component__list li:nth-child(2),
449 | .mfb-component--br.mfb-zoomin .mfb-component__list li:nth-child(2) {
450 | -webkit-transform: translateY(-140px) scale(0);
451 | transform: translateY(-140px) scale(0);
452 | transition: all 0.5s;
453 | transition-delay: 0.1s; }
454 | .mfb-component--bl.mfb-zoomin .mfb-component__list li:nth-child(3),
455 | .mfb-component--br.mfb-zoomin .mfb-component__list li:nth-child(3) {
456 | -webkit-transform: translateY(-210px) scale(0);
457 | transform: translateY(-210px) scale(0);
458 | transition: all 0.5s;
459 | transition-delay: 0.05s; }
460 | .mfb-component--bl.mfb-zoomin .mfb-component__list li:nth-child(4),
461 | .mfb-component--br.mfb-zoomin .mfb-component__list li:nth-child(4) {
462 | -webkit-transform: translateY(-280px) scale(0);
463 | transform: translateY(-280px) scale(0);
464 | transition: all 0.5s;
465 | transition-delay: 0s; }
466 | .mfb-component--bl.mfb-zoomin[data-mfb-toggle="hover"]:hover .mfb-component__list li:nth-child(1), .mfb-component--bl.mfb-zoomin[data-mfb-state="open"] .mfb-component__list li:nth-child(1),
467 | .mfb-component--br.mfb-zoomin[data-mfb-toggle="hover"]:hover .mfb-component__list li:nth-child(1),
468 | .mfb-component--br.mfb-zoomin[data-mfb-state="open"] .mfb-component__list li:nth-child(1) {
469 | -webkit-transform: translateY(-70px) scale(1);
470 | transform: translateY(-70px) scale(1);
471 | transition-delay: 0.05s; }
472 | .mfb-component--bl.mfb-zoomin[data-mfb-toggle="hover"]:hover .mfb-component__list li:nth-child(2), .mfb-component--bl.mfb-zoomin[data-mfb-state="open"] .mfb-component__list li:nth-child(2),
473 | .mfb-component--br.mfb-zoomin[data-mfb-toggle="hover"]:hover .mfb-component__list li:nth-child(2),
474 | .mfb-component--br.mfb-zoomin[data-mfb-state="open"] .mfb-component__list li:nth-child(2) {
475 | -webkit-transform: translateY(-140px) scale(1);
476 | transform: translateY(-140px) scale(1);
477 | transition-delay: 0.1s; }
478 | .mfb-component--bl.mfb-zoomin[data-mfb-toggle="hover"]:hover .mfb-component__list li:nth-child(3), .mfb-component--bl.mfb-zoomin[data-mfb-state="open"] .mfb-component__list li:nth-child(3),
479 | .mfb-component--br.mfb-zoomin[data-mfb-toggle="hover"]:hover .mfb-component__list li:nth-child(3),
480 | .mfb-component--br.mfb-zoomin[data-mfb-state="open"] .mfb-component__list li:nth-child(3) {
481 | -webkit-transform: translateY(-210px) scale(1);
482 | transform: translateY(-210px) scale(1);
483 | transition-delay: 0.15s; }
484 | .mfb-component--bl.mfb-zoomin[data-mfb-toggle="hover"]:hover .mfb-component__list li:nth-child(4), .mfb-component--bl.mfb-zoomin[data-mfb-state="open"] .mfb-component__list li:nth-child(4),
485 | .mfb-component--br.mfb-zoomin[data-mfb-toggle="hover"]:hover .mfb-component__list li:nth-child(4),
486 | .mfb-component--br.mfb-zoomin[data-mfb-state="open"] .mfb-component__list li:nth-child(4) {
487 | -webkit-transform: translateY(-280px) scale(1);
488 | transform: translateY(-280px) scale(1);
489 | transition-delay: 0.2s; }
490 |
491 | /**
492 | * FOUNTAIN
493 | * When hovering the main button the child buttons
494 | * jump into view from outside the viewport
495 | */
496 | .mfb-component--tl.mfb-fountain .mfb-component__list li,
497 | .mfb-component--tr.mfb-fountain .mfb-component__list li {
498 | -webkit-transform: scale(0);
499 | transform: scale(0); }
500 | .mfb-component--tl.mfb-fountain .mfb-component__list li:nth-child(1),
501 | .mfb-component--tr.mfb-fountain .mfb-component__list li:nth-child(1) {
502 | -webkit-transform: translateY(-70px) scale(0);
503 | transform: translateY(-70px) scale(0);
504 | transition: all 0.5s;
505 | transition-delay: 0.15s; }
506 | .mfb-component--tl.mfb-fountain .mfb-component__list li:nth-child(2),
507 | .mfb-component--tr.mfb-fountain .mfb-component__list li:nth-child(2) {
508 | -webkit-transform: translateY(-140px) scale(0);
509 | transform: translateY(-140px) scale(0);
510 | transition: all 0.5s;
511 | transition-delay: 0.1s; }
512 | .mfb-component--tl.mfb-fountain .mfb-component__list li:nth-child(3),
513 | .mfb-component--tr.mfb-fountain .mfb-component__list li:nth-child(3) {
514 | -webkit-transform: translateY(-210px) scale(0);
515 | transform: translateY(-210px) scale(0);
516 | transition: all 0.5s;
517 | transition-delay: 0.05s; }
518 | .mfb-component--tl.mfb-fountain .mfb-component__list li:nth-child(4),
519 | .mfb-component--tr.mfb-fountain .mfb-component__list li:nth-child(4) {
520 | -webkit-transform: translateY(-280px) scale(0);
521 | transform: translateY(-280px) scale(0);
522 | transition: all 0.5s;
523 | transition-delay: 0s; }
524 | .mfb-component--tl.mfb-fountain[data-mfb-toggle="hover"]:hover .mfb-component__list li:nth-child(1), .mfb-component--tl.mfb-fountain[data-mfb-state="open"] .mfb-component__list li:nth-child(1),
525 | .mfb-component--tr.mfb-fountain[data-mfb-toggle="hover"]:hover .mfb-component__list li:nth-child(1),
526 | .mfb-component--tr.mfb-fountain[data-mfb-state="open"] .mfb-component__list li:nth-child(1) {
527 | -webkit-transform: translateY(70px) scale(1);
528 | transform: translateY(70px) scale(1);
529 | transition-delay: 0.05s; }
530 | .mfb-component--tl.mfb-fountain[data-mfb-toggle="hover"]:hover .mfb-component__list li:nth-child(2), .mfb-component--tl.mfb-fountain[data-mfb-state="open"] .mfb-component__list li:nth-child(2),
531 | .mfb-component--tr.mfb-fountain[data-mfb-toggle="hover"]:hover .mfb-component__list li:nth-child(2),
532 | .mfb-component--tr.mfb-fountain[data-mfb-state="open"] .mfb-component__list li:nth-child(2) {
533 | -webkit-transform: translateY(140px) scale(1);
534 | transform: translateY(140px) scale(1);
535 | transition-delay: 0.1s; }
536 | .mfb-component--tl.mfb-fountain[data-mfb-toggle="hover"]:hover .mfb-component__list li:nth-child(3), .mfb-component--tl.mfb-fountain[data-mfb-state="open"] .mfb-component__list li:nth-child(3),
537 | .mfb-component--tr.mfb-fountain[data-mfb-toggle="hover"]:hover .mfb-component__list li:nth-child(3),
538 | .mfb-component--tr.mfb-fountain[data-mfb-state="open"] .mfb-component__list li:nth-child(3) {
539 | -webkit-transform: translateY(210px) scale(1);
540 | transform: translateY(210px) scale(1);
541 | transition-delay: 0.15s; }
542 | .mfb-component--tl.mfb-fountain[data-mfb-toggle="hover"]:hover .mfb-component__list li:nth-child(4), .mfb-component--tl.mfb-fountain[data-mfb-state="open"] .mfb-component__list li:nth-child(4),
543 | .mfb-component--tr.mfb-fountain[data-mfb-toggle="hover"]:hover .mfb-component__list li:nth-child(4),
544 | .mfb-component--tr.mfb-fountain[data-mfb-state="open"] .mfb-component__list li:nth-child(4) {
545 | -webkit-transform: translateY(280px) scale(1);
546 | transform: translateY(280px) scale(1);
547 | transition-delay: 0.2s; }
548 |
549 | .mfb-component--bl.mfb-fountain .mfb-component__list li,
550 | .mfb-component--br.mfb-fountain .mfb-component__list li {
551 | -webkit-transform: scale(0);
552 | transform: scale(0); }
553 | .mfb-component--bl.mfb-fountain .mfb-component__list li:nth-child(1),
554 | .mfb-component--br.mfb-fountain .mfb-component__list li:nth-child(1) {
555 | -webkit-transform: translateY(70px) scale(0);
556 | transform: translateY(70px) scale(0);
557 | transition: all 0.5s;
558 | transition-delay: 0.15s; }
559 | .mfb-component--bl.mfb-fountain .mfb-component__list li:nth-child(2),
560 | .mfb-component--br.mfb-fountain .mfb-component__list li:nth-child(2) {
561 | -webkit-transform: translateY(140px) scale(0);
562 | transform: translateY(140px) scale(0);
563 | transition: all 0.5s;
564 | transition-delay: 0.1s; }
565 | .mfb-component--bl.mfb-fountain .mfb-component__list li:nth-child(3),
566 | .mfb-component--br.mfb-fountain .mfb-component__list li:nth-child(3) {
567 | -webkit-transform: translateY(210px) scale(0);
568 | transform: translateY(210px) scale(0);
569 | transition: all 0.5s;
570 | transition-delay: 0.05s; }
571 | .mfb-component--bl.mfb-fountain .mfb-component__list li:nth-child(4),
572 | .mfb-component--br.mfb-fountain .mfb-component__list li:nth-child(4) {
573 | -webkit-transform: translateY(280px) scale(0);
574 | transform: translateY(280px) scale(0);
575 | transition: all 0.5s;
576 | transition-delay: 0s; }
577 | .mfb-component--bl.mfb-fountain[data-mfb-toggle="hover"]:hover .mfb-component__list li:nth-child(1), .mfb-component--bl.mfb-fountain[data-mfb-state="open"] .mfb-component__list li:nth-child(1),
578 | .mfb-component--br.mfb-fountain[data-mfb-toggle="hover"]:hover .mfb-component__list li:nth-child(1),
579 | .mfb-component--br.mfb-fountain[data-mfb-state="open"] .mfb-component__list li:nth-child(1) {
580 | -webkit-transform: translateY(-70px) scale(1);
581 | transform: translateY(-70px) scale(1);
582 | transition-delay: 0.05s; }
583 | .mfb-component--bl.mfb-fountain[data-mfb-toggle="hover"]:hover .mfb-component__list li:nth-child(2), .mfb-component--bl.mfb-fountain[data-mfb-state="open"] .mfb-component__list li:nth-child(2),
584 | .mfb-component--br.mfb-fountain[data-mfb-toggle="hover"]:hover .mfb-component__list li:nth-child(2),
585 | .mfb-component--br.mfb-fountain[data-mfb-state="open"] .mfb-component__list li:nth-child(2) {
586 | -webkit-transform: translateY(-140px) scale(1);
587 | transform: translateY(-140px) scale(1);
588 | transition-delay: 0.1s; }
589 | .mfb-component--bl.mfb-fountain[data-mfb-toggle="hover"]:hover .mfb-component__list li:nth-child(3), .mfb-component--bl.mfb-fountain[data-mfb-state="open"] .mfb-component__list li:nth-child(3),
590 | .mfb-component--br.mfb-fountain[data-mfb-toggle="hover"]:hover .mfb-component__list li:nth-child(3),
591 | .mfb-component--br.mfb-fountain[data-mfb-state="open"] .mfb-component__list li:nth-child(3) {
592 | -webkit-transform: translateY(-210px) scale(1);
593 | transform: translateY(-210px) scale(1);
594 | transition-delay: 0.15s; }
595 | .mfb-component--bl.mfb-fountain[data-mfb-toggle="hover"]:hover .mfb-component__list li:nth-child(4), .mfb-component--bl.mfb-fountain[data-mfb-state="open"] .mfb-component__list li:nth-child(4),
596 | .mfb-component--br.mfb-fountain[data-mfb-toggle="hover"]:hover .mfb-component__list li:nth-child(4),
597 | .mfb-component--br.mfb-fountain[data-mfb-state="open"] .mfb-component__list li:nth-child(4) {
598 | -webkit-transform: translateY(-280px) scale(1);
599 | transform: translateY(-280px) scale(1);
600 | transition-delay: 0.2s; }
601 |
602 | /*------------------------------------*\
603 | #LABELS | base
604 | \*------------------------------------*/
605 | /**
606 | * These are the labels associated to each button,
607 | * exposed only when hovering the related button.
608 | * They are called labels but are in fact data-attributes of
609 | * each button (an anchor tag).
610 | */
611 | [data-mfb-label]:after {
612 | content: attr(data-mfb-label);
613 | opacity: 0;
614 | transition: all 0.5s;
615 | background: rgba(0, 0, 0, 0.4);
616 | padding: 4px 10px;
617 | border-radius: 3px;
618 | color: rgba(255, 255, 255, 0.8);
619 | font-size: 14px;
620 | font-weight: normal;
621 | pointer-events: none;
622 | line-height: normal;
623 | position: absolute;
624 | top: 50%;
625 | margin-top: -11px;
626 | transition: all 0.5s; }
627 |
628 | [data-mfb-toggle="hover"] [data-mfb-label]:hover:after,
629 | [data-mfb-state="open"] [data-mfb-label]:after {
630 | content: attr(data-mfb-label);
631 | opacity: 1;
632 | transition: all 0.3s; }
633 |
634 | /*------------------------------------*\
635 | #LABELS | Modifiers
636 | \*------------------------------------*/
637 | .mfb-component--br [data-mfb-label]:after, .mfb-component--tr [data-mfb-label]:after {
638 | content: attr(data-mfb-label);
639 | right: 70px; }
640 |
641 | .mfb-component--br .mfb-component__list [data-mfb-label]:after, .mfb-component--tr .mfb-component__list [data-mfb-label]:after {
642 | content: attr(data-mfb-label);
643 | right: 70px; }
644 |
645 | .mfb-component--tl [data-mfb-label]:after, .mfb-component--bl [data-mfb-label]:after {
646 | content: attr(data-mfb-label);
647 | left: 70px; }
648 |
649 | .mfb-component--tl .mfb-component__list [data-mfb-label]:after, .mfb-component--bl .mfb-component__list [data-mfb-label]:after {
650 | content: attr(data-mfb-label);
651 | left: 70px; }
652 |
653 | /*------------------------------------*\
654 | #DEVELOPMENT | In development
655 | \*------------------------------------*/
656 | /**
657 | * This part is where unfinished code should stay.
658 | * When a feature is ready(sh) move these styles to their proper place.
659 | */
660 | /*------------------------------------*\
661 | #DEVELOPMENT | Debuggers
662 | \*------------------------------------*/
663 | /**
664 | * These are mainly helpers for development. They do not have to end up
665 | * in production but it's handy to keep them when developing.
666 | */
667 | /**
668 | * Apply this class to the html tag when developing the slide-in button
669 | */
670 |
671 | /*# sourceMappingURL=mfb.css.map */
672 |
--------------------------------------------------------------------------------
/dist/mfb.css.map:
--------------------------------------------------------------------------------
1 | {
2 | "version": 3,
3 | "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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AC7B,KAAK,EAvPY,IAAI;;AA2PvB,8HAAuB;EACrB,OAAO,EAAE,oBAAoB;EAC7B,KAAK,EAAE,IAAkE;;AAI3E,oFAAuB;EACrB,OAAO,EAAE,oBAAoB;EAC7B,IAAI,EAnQa,IAAI;;AAuQvB,8HAAuB;EACrB,OAAO,EAAE,oBAAoB;EAC7B,IAAI,EAAE,IAAkE",
4 | "sources": ["../src/mfb.scss","../src/_/_slidein.scss","../src/_/_slidein-spring.scss","../src/_/_zoomin.scss","../src/_/_fountain.scss"],
5 | "names": [],
6 | "file": "mfb.css"
7 | }
8 |
--------------------------------------------------------------------------------
/dist/mfb.js:
--------------------------------------------------------------------------------
1 | /**
2 | * Material floating button
3 | * By: Nobita
4 | * Repo and docs: https://github.com/nobitagit/material-floating-button
5 | *
6 | * License: MIT
7 | */
8 |
9 | // build script hook - don't remove
10 | ;(function ( window, document, undefined ) {
11 |
12 |
13 | 'use strict';
14 |
15 | /**
16 | * Some defaults
17 | */
18 | var clickOpt = 'click',
19 | hoverOpt = 'hover',
20 | toggleMethod = 'data-mfb-toggle',
21 | menuState = 'data-mfb-state',
22 | isOpen = 'open',
23 | isClosed = 'closed',
24 | mainButtonClass = 'mfb-component__button--main';
25 |
26 | /**
27 | * Internal references
28 | */
29 | var elemsToClick,
30 | elemsToHover,
31 | mainButton,
32 | target,
33 | currentState;
34 |
35 | /**
36 | * For every menu we need to get the main button and attach the appropriate evt.
37 | */
38 | function attachEvt( elems, evt ){
39 | for( var i = 0, len = elems.length; i < len; i++ ){
40 | mainButton = elems[i].querySelector('.' + mainButtonClass);
41 | mainButton.addEventListener( evt , toggleButton, false);
42 | }
43 | }
44 |
45 | /**
46 | * Remove the hover option, set a click toggle and a default,
47 | * initial state of 'closed' to menu that's been targeted.
48 | */
49 | function replaceAttrs( elems ){
50 | for( var i = 0, len = elems.length; i < len; i++ ){
51 | elems[i].setAttribute( toggleMethod, clickOpt );
52 | elems[i].setAttribute( menuState, isClosed );
53 | }
54 | }
55 |
56 | function getElemsByToggleMethod( selector ){
57 | return document.querySelectorAll('[' + toggleMethod + '="' + selector + '"]');
58 | }
59 |
60 | /**
61 | * The open/close action is performed by toggling an attribute
62 | * on the menu main element.
63 | *
64 | * First, check if the target is the menu itself. If it's a child
65 | * keep walking up the tree until we found the main element
66 | * where we can toggle the state.
67 | */
68 | function toggleButton( evt ){
69 |
70 | target = evt.target;
71 | while ( target && !target.getAttribute( toggleMethod ) ){
72 | target = target.parentNode;
73 | if(!target) { return; }
74 | }
75 |
76 | currentState = target.getAttribute( menuState ) === isOpen ? isClosed : isOpen;
77 |
78 | target.setAttribute(menuState, currentState);
79 |
80 | }
81 |
82 | /**
83 | * On touch enabled devices we assume that no hover state is possible.
84 | * So, we get the menu with hover action configured and we set it up
85 | * in order to make it usable with tap/click.
86 | **/
87 | if ( window.Modernizr && Modernizr.touch ){
88 | elemsToHover = getElemsByToggleMethod( hoverOpt );
89 | replaceAttrs( elemsToHover );
90 | }
91 |
92 | elemsToClick = getElemsByToggleMethod( clickOpt );
93 |
94 | attachEvt( elemsToClick, 'click' );
95 |
96 | // build script hook - don't remove
97 | })( window, document );
98 |
99 |
--------------------------------------------------------------------------------
/dist/mfb.min.css:
--------------------------------------------------------------------------------
1 | .mfb-component--bl,.mfb-component--br,.mfb-component--tl,.mfb-component--tr{box-sizing:border-box;margin:25px;position:fixed;white-space:nowrap;z-index:30;padding-left:0;list-style:none}.mfb-component--bl *,.mfb-component--bl :after,.mfb-component--bl :before,.mfb-component--br *,.mfb-component--br :after,.mfb-component--br :before,.mfb-component--tl *,.mfb-component--tl :after,.mfb-component--tl :before,.mfb-component--tr *,.mfb-component--tr :after,.mfb-component--tr :before{box-sizing:inherit}.mfb-component--tl{left:0;top:0}.mfb-component--tr{right:0;top:0}.mfb-component--bl{left:0;bottom:0}.mfb-component--br{right:0;bottom:0}.mfb-component__button--child,.mfb-component__button--main{background-color:#E40A5D;display:inline-block;border:none;border-radius:50%;box-shadow:0 0 4px rgba(0,0,0,.14),0 4px 8px rgba(0,0,0,.28);cursor:pointer;outline:0;padding:0;position:relative;-webkit-user-drag:none;font-weight:700;color:#f1f1f1}.mfb-component__list{list-style:none;margin:0;padding:0}.mfb-component__list>li{display:block;position:absolute;top:0;right:1px;padding:10px 0;margin:-10px 0}.mfb-component__child-icon,.mfb-component__icon,.mfb-component__main-icon--active,.mfb-component__main-icon--resting{position:absolute;font-size:18px;text-align:center;line-height:56px;width:100%}.mfb-component__wrap{padding:25px;margin:-25px}[data-mfb-state=open] .mfb-component__child-icon,[data-mfb-state=open] .mfb-component__icon,[data-mfb-state=open] .mfb-component__main-icon--active,[data-mfb-state=open] .mfb-component__main-icon--resting,[data-mfb-toggle=hover]:hover .mfb-component__child-icon,[data-mfb-toggle=hover]:hover .mfb-component__icon,[data-mfb-toggle=hover]:hover .mfb-component__main-icon--active,[data-mfb-toggle=hover]:hover .mfb-component__main-icon--resting{-webkit-transform:scale(1) rotate(0deg);transform:scale(1) rotate(0deg)}.mfb-component__button--main{height:56px;width:56px;z-index:20}.mfb-component__button--child{height:56px;width:56px}.mfb-component__main-icon--active,.mfb-component__main-icon--resting{-webkit-transform:scale(1) rotate(360deg);transform:scale(1) rotate(360deg);-webkit-transition:-webkit-transform 150ms cubic-bezier(.4,0,1,1);transition:transform 150ms cubic-bezier(.4,0,1,1)}.mfb-component__child-icon{line-height:56px;font-size:18px}.mfb-component__main-icon--active{opacity:0}[data-mfb-state=open] .mfb-component__main-icon,[data-mfb-toggle=hover]:hover .mfb-component__main-icon{-webkit-transform:scale(1) rotate(0deg);transform:scale(1) rotate(0deg)}[data-mfb-state=open] .mfb-component__main-icon--resting,[data-mfb-toggle=hover]:hover .mfb-component__main-icon--resting{opacity:0}[data-mfb-state=open] .mfb-component__main-icon--active,[data-mfb-toggle=hover]:hover .mfb-component__main-icon--active{opacity:1}.mfb-component--tl.mfb-slidein .mfb-component__list li,.mfb-component--tr.mfb-slidein .mfb-component__list li{opacity:0;transition:all .5s}.mfb-component--tl.mfb-slidein[data-mfb-state=open] .mfb-component__list li,.mfb-component--tl.mfb-slidein[data-mfb-toggle=hover]:hover .mfb-component__list li,.mfb-component--tr.mfb-slidein[data-mfb-state=open] .mfb-component__list li,.mfb-component--tr.mfb-slidein[data-mfb-toggle=hover]:hover .mfb-component__list li{opacity:1}.mfb-component--tl.mfb-slidein[data-mfb-state=open] .mfb-component__list li:nth-child(1),.mfb-component--tl.mfb-slidein[data-mfb-toggle=hover]:hover .mfb-component__list li:nth-child(1),.mfb-component--tr.mfb-slidein[data-mfb-state=open] .mfb-component__list li:nth-child(1),.mfb-component--tr.mfb-slidein[data-mfb-toggle=hover]:hover .mfb-component__list li:nth-child(1){-webkit-transform:translateY(70px);transform:translateY(70px)}.mfb-component--tl.mfb-slidein[data-mfb-state=open] .mfb-component__list li:nth-child(2),.mfb-component--tl.mfb-slidein[data-mfb-toggle=hover]:hover .mfb-component__list li:nth-child(2),.mfb-component--tr.mfb-slidein[data-mfb-state=open] .mfb-component__list li:nth-child(2),.mfb-component--tr.mfb-slidein[data-mfb-toggle=hover]:hover .mfb-component__list li:nth-child(2){-webkit-transform:translateY(140px);transform:translateY(140px)}.mfb-component--tl.mfb-slidein[data-mfb-state=open] .mfb-component__list li:nth-child(3),.mfb-component--tl.mfb-slidein[data-mfb-toggle=hover]:hover .mfb-component__list li:nth-child(3),.mfb-component--tr.mfb-slidein[data-mfb-state=open] .mfb-component__list li:nth-child(3),.mfb-component--tr.mfb-slidein[data-mfb-toggle=hover]:hover .mfb-component__list li:nth-child(3){-webkit-transform:translateY(210px);transform:translateY(210px)}.mfb-component--tl.mfb-slidein[data-mfb-state=open] .mfb-component__list li:nth-child(4),.mfb-component--tl.mfb-slidein[data-mfb-toggle=hover]:hover .mfb-component__list li:nth-child(4),.mfb-component--tr.mfb-slidein[data-mfb-state=open] .mfb-component__list li:nth-child(4),.mfb-component--tr.mfb-slidein[data-mfb-toggle=hover]:hover .mfb-component__list li:nth-child(4){-webkit-transform:translateY(280px);transform:translateY(280px)}.mfb-component--bl.mfb-slidein .mfb-component__list li,.mfb-component--br.mfb-slidein .mfb-component__list li{opacity:0;transition:all .5s}.mfb-component--bl.mfb-slidein[data-mfb-state=open] .mfb-component__list li,.mfb-component--bl.mfb-slidein[data-mfb-toggle=hover]:hover .mfb-component__list li,.mfb-component--br.mfb-slidein[data-mfb-state=open] .mfb-component__list li,.mfb-component--br.mfb-slidein[data-mfb-toggle=hover]:hover .mfb-component__list li{opacity:1}.mfb-component--bl.mfb-slidein[data-mfb-state=open] .mfb-component__list li:nth-child(1),.mfb-component--bl.mfb-slidein[data-mfb-toggle=hover]:hover .mfb-component__list li:nth-child(1),.mfb-component--br.mfb-slidein[data-mfb-state=open] .mfb-component__list li:nth-child(1),.mfb-component--br.mfb-slidein[data-mfb-toggle=hover]:hover .mfb-component__list li:nth-child(1){-webkit-transform:translateY(-70px);transform:translateY(-70px)}.mfb-component--bl.mfb-slidein[data-mfb-state=open] .mfb-component__list li:nth-child(2),.mfb-component--bl.mfb-slidein[data-mfb-toggle=hover]:hover .mfb-component__list li:nth-child(2),.mfb-component--br.mfb-slidein[data-mfb-state=open] .mfb-component__list li:nth-child(2),.mfb-component--br.mfb-slidein[data-mfb-toggle=hover]:hover .mfb-component__list li:nth-child(2){-webkit-transform:translateY(-140px);transform:translateY(-140px)}.mfb-component--bl.mfb-slidein[data-mfb-state=open] .mfb-component__list li:nth-child(3),.mfb-component--bl.mfb-slidein[data-mfb-toggle=hover]:hover .mfb-component__list li:nth-child(3),.mfb-component--br.mfb-slidein[data-mfb-state=open] .mfb-component__list li:nth-child(3),.mfb-component--br.mfb-slidein[data-mfb-toggle=hover]:hover .mfb-component__list li:nth-child(3){-webkit-transform:translateY(-210px);transform:translateY(-210px)}.mfb-component--bl.mfb-slidein[data-mfb-state=open] .mfb-component__list li:nth-child(4),.mfb-component--bl.mfb-slidein[data-mfb-toggle=hover]:hover .mfb-component__list li:nth-child(4),.mfb-component--br.mfb-slidein[data-mfb-state=open] .mfb-component__list li:nth-child(4),.mfb-component--br.mfb-slidein[data-mfb-toggle=hover]:hover .mfb-component__list li:nth-child(4){-webkit-transform:translateY(-280px);transform:translateY(-280px)}.mfb-component--tl.mfb-slidein-spring .mfb-component__list li,.mfb-component--tr.mfb-slidein-spring .mfb-component__list li{opacity:0;transition:all .5s;transition-timing-function:cubic-bezier(.68,-.55,.265,1.55)}.mfb-component--tl.mfb-slidein-spring .mfb-component__list li:nth-child(1),.mfb-component--tr.mfb-slidein-spring .mfb-component__list li:nth-child(1){transition-delay:.05s}.mfb-component--tl.mfb-slidein-spring .mfb-component__list li:nth-child(2),.mfb-component--tr.mfb-slidein-spring .mfb-component__list li:nth-child(2){transition-delay:.1s}.mfb-component--tl.mfb-slidein-spring .mfb-component__list li:nth-child(3),.mfb-component--tr.mfb-slidein-spring .mfb-component__list li:nth-child(3){transition-delay:.15s}.mfb-component--tl.mfb-slidein-spring .mfb-component__list li:nth-child(4),.mfb-component--tr.mfb-slidein-spring .mfb-component__list li:nth-child(4){transition-delay:.2s}.mfb-component--tl.mfb-slidein-spring[data-mfb-state=open] .mfb-component__list li,.mfb-component--tl.mfb-slidein-spring[data-mfb-toggle=hover]:hover .mfb-component__list li,.mfb-component--tr.mfb-slidein-spring[data-mfb-state=open] .mfb-component__list li,.mfb-component--tr.mfb-slidein-spring[data-mfb-toggle=hover]:hover .mfb-component__list li{opacity:1}.mfb-component--tl.mfb-slidein-spring[data-mfb-state=open] .mfb-component__list li:nth-child(1),.mfb-component--tl.mfb-slidein-spring[data-mfb-toggle=hover]:hover .mfb-component__list li:nth-child(1),.mfb-component--tr.mfb-slidein-spring[data-mfb-state=open] .mfb-component__list li:nth-child(1),.mfb-component--tr.mfb-slidein-spring[data-mfb-toggle=hover]:hover .mfb-component__list li:nth-child(1){transition-delay:.05s;-webkit-transform:translateY(70px);transform:translateY(70px)}.mfb-component--tl.mfb-slidein-spring[data-mfb-state=open] .mfb-component__list li:nth-child(2),.mfb-component--tl.mfb-slidein-spring[data-mfb-toggle=hover]:hover .mfb-component__list li:nth-child(2),.mfb-component--tr.mfb-slidein-spring[data-mfb-state=open] .mfb-component__list li:nth-child(2),.mfb-component--tr.mfb-slidein-spring[data-mfb-toggle=hover]:hover .mfb-component__list li:nth-child(2){transition-delay:.1s;-webkit-transform:translateY(140px);transform:translateY(140px)}.mfb-component--tl.mfb-slidein-spring[data-mfb-state=open] .mfb-component__list li:nth-child(3),.mfb-component--tl.mfb-slidein-spring[data-mfb-toggle=hover]:hover .mfb-component__list li:nth-child(3),.mfb-component--tr.mfb-slidein-spring[data-mfb-state=open] .mfb-component__list li:nth-child(3),.mfb-component--tr.mfb-slidein-spring[data-mfb-toggle=hover]:hover .mfb-component__list li:nth-child(3){transition-delay:.15s;-webkit-transform:translateY(210px);transform:translateY(210px)}.mfb-component--tl.mfb-slidein-spring[data-mfb-state=open] .mfb-component__list li:nth-child(4),.mfb-component--tl.mfb-slidein-spring[data-mfb-toggle=hover]:hover .mfb-component__list li:nth-child(4),.mfb-component--tr.mfb-slidein-spring[data-mfb-state=open] .mfb-component__list li:nth-child(4),.mfb-component--tr.mfb-slidein-spring[data-mfb-toggle=hover]:hover .mfb-component__list li:nth-child(4){transition-delay:.2s;-webkit-transform:translateY(280px);transform:translateY(280px)}.mfb-component--bl.mfb-slidein-spring .mfb-component__list li,.mfb-component--br.mfb-slidein-spring .mfb-component__list li{opacity:0;transition:all .5s;transition-timing-function:cubic-bezier(.68,-.55,.265,1.55)}.mfb-component--bl.mfb-slidein-spring .mfb-component__list li:nth-child(1),.mfb-component--br.mfb-slidein-spring .mfb-component__list li:nth-child(1){transition-delay:.05s}.mfb-component--bl.mfb-slidein-spring .mfb-component__list li:nth-child(2),.mfb-component--br.mfb-slidein-spring .mfb-component__list li:nth-child(2){transition-delay:.1s}.mfb-component--bl.mfb-slidein-spring .mfb-component__list li:nth-child(3),.mfb-component--br.mfb-slidein-spring .mfb-component__list li:nth-child(3){transition-delay:.15s}.mfb-component--bl.mfb-slidein-spring .mfb-component__list li:nth-child(4),.mfb-component--br.mfb-slidein-spring .mfb-component__list li:nth-child(4){transition-delay:.2s}.mfb-component--bl.mfb-slidein-spring[data-mfb-state=open] .mfb-component__list li,.mfb-component--bl.mfb-slidein-spring[data-mfb-toggle=hover]:hover .mfb-component__list li,.mfb-component--br.mfb-slidein-spring[data-mfb-state=open] .mfb-component__list li,.mfb-component--br.mfb-slidein-spring[data-mfb-toggle=hover]:hover .mfb-component__list li{opacity:1}.mfb-component--bl.mfb-slidein-spring[data-mfb-state=open] .mfb-component__list li:nth-child(1),.mfb-component--bl.mfb-slidein-spring[data-mfb-toggle=hover]:hover .mfb-component__list li:nth-child(1),.mfb-component--br.mfb-slidein-spring[data-mfb-state=open] .mfb-component__list li:nth-child(1),.mfb-component--br.mfb-slidein-spring[data-mfb-toggle=hover]:hover .mfb-component__list li:nth-child(1){transition-delay:.05s;-webkit-transform:translateY(-70px);transform:translateY(-70px)}.mfb-component--bl.mfb-slidein-spring[data-mfb-state=open] .mfb-component__list li:nth-child(2),.mfb-component--bl.mfb-slidein-spring[data-mfb-toggle=hover]:hover .mfb-component__list li:nth-child(2),.mfb-component--br.mfb-slidein-spring[data-mfb-state=open] .mfb-component__list li:nth-child(2),.mfb-component--br.mfb-slidein-spring[data-mfb-toggle=hover]:hover .mfb-component__list li:nth-child(2){transition-delay:.1s;-webkit-transform:translateY(-140px);transform:translateY(-140px)}.mfb-component--bl.mfb-slidein-spring[data-mfb-state=open] .mfb-component__list li:nth-child(3),.mfb-component--bl.mfb-slidein-spring[data-mfb-toggle=hover]:hover .mfb-component__list li:nth-child(3),.mfb-component--br.mfb-slidein-spring[data-mfb-state=open] .mfb-component__list li:nth-child(3),.mfb-component--br.mfb-slidein-spring[data-mfb-toggle=hover]:hover .mfb-component__list li:nth-child(3){transition-delay:.15s;-webkit-transform:translateY(-210px);transform:translateY(-210px)}.mfb-component--bl.mfb-slidein-spring[data-mfb-state=open] .mfb-component__list li:nth-child(4),.mfb-component--bl.mfb-slidein-spring[data-mfb-toggle=hover]:hover .mfb-component__list li:nth-child(4),.mfb-component--br.mfb-slidein-spring[data-mfb-state=open] .mfb-component__list li:nth-child(4),.mfb-component--br.mfb-slidein-spring[data-mfb-toggle=hover]:hover .mfb-component__list li:nth-child(4){transition-delay:.2s;-webkit-transform:translateY(-280px);transform:translateY(-280px)}.mfb-component--tl.mfb-zoomin .mfb-component__list li,.mfb-component--tr.mfb-zoomin .mfb-component__list li{-webkit-transform:scale(0);transform:scale(0)}.mfb-component--tl.mfb-zoomin .mfb-component__list li:nth-child(1),.mfb-component--tr.mfb-zoomin .mfb-component__list li:nth-child(1){-webkit-transform:translateY(70px) scale(0);transform:translateY(70px) scale(0);transition:all .5s;transition-delay:.15s}.mfb-component--tl.mfb-zoomin .mfb-component__list li:nth-child(2),.mfb-component--tr.mfb-zoomin .mfb-component__list li:nth-child(2){-webkit-transform:translateY(140px) scale(0);transform:translateY(140px) scale(0);transition:all .5s;transition-delay:.1s}.mfb-component--tl.mfb-zoomin .mfb-component__list li:nth-child(3),.mfb-component--tr.mfb-zoomin .mfb-component__list li:nth-child(3){-webkit-transform:translateY(210px) scale(0);transform:translateY(210px) scale(0);transition:all .5s;transition-delay:.05s}.mfb-component--tl.mfb-zoomin .mfb-component__list li:nth-child(4),.mfb-component--tr.mfb-zoomin .mfb-component__list li:nth-child(4){-webkit-transform:translateY(280px) scale(0);transform:translateY(280px) scale(0);transition:all .5s;transition-delay:0s}.mfb-component--tl.mfb-zoomin[data-mfb-state=open] .mfb-component__list li:nth-child(1),.mfb-component--tl.mfb-zoomin[data-mfb-toggle=hover]:hover .mfb-component__list li:nth-child(1),.mfb-component--tr.mfb-zoomin[data-mfb-state=open] .mfb-component__list li:nth-child(1),.mfb-component--tr.mfb-zoomin[data-mfb-toggle=hover]:hover .mfb-component__list li:nth-child(1){-webkit-transform:translateY(70px) scale(1);transform:translateY(70px) scale(1);transition-delay:.05s}.mfb-component--tl.mfb-zoomin[data-mfb-state=open] .mfb-component__list li:nth-child(2),.mfb-component--tl.mfb-zoomin[data-mfb-toggle=hover]:hover .mfb-component__list li:nth-child(2),.mfb-component--tr.mfb-zoomin[data-mfb-state=open] .mfb-component__list li:nth-child(2),.mfb-component--tr.mfb-zoomin[data-mfb-toggle=hover]:hover .mfb-component__list li:nth-child(2){-webkit-transform:translateY(140px) scale(1);transform:translateY(140px) scale(1);transition-delay:.1s}.mfb-component--tl.mfb-zoomin[data-mfb-state=open] .mfb-component__list li:nth-child(3),.mfb-component--tl.mfb-zoomin[data-mfb-toggle=hover]:hover .mfb-component__list li:nth-child(3),.mfb-component--tr.mfb-zoomin[data-mfb-state=open] .mfb-component__list li:nth-child(3),.mfb-component--tr.mfb-zoomin[data-mfb-toggle=hover]:hover .mfb-component__list li:nth-child(3){-webkit-transform:translateY(210px) scale(1);transform:translateY(210px) scale(1);transition-delay:.15s}.mfb-component--tl.mfb-zoomin[data-mfb-state=open] .mfb-component__list li:nth-child(4),.mfb-component--tl.mfb-zoomin[data-mfb-toggle=hover]:hover .mfb-component__list li:nth-child(4),.mfb-component--tr.mfb-zoomin[data-mfb-state=open] .mfb-component__list li:nth-child(4),.mfb-component--tr.mfb-zoomin[data-mfb-toggle=hover]:hover .mfb-component__list li:nth-child(4){-webkit-transform:translateY(280px) scale(1);transform:translateY(280px) scale(1);transition-delay:.2s}.mfb-component--bl.mfb-zoomin .mfb-component__list li,.mfb-component--br.mfb-zoomin .mfb-component__list li{-webkit-transform:scale(0);transform:scale(0)}.mfb-component--bl.mfb-zoomin .mfb-component__list li:nth-child(1),.mfb-component--br.mfb-zoomin .mfb-component__list li:nth-child(1){-webkit-transform:translateY(-70px) scale(0);transform:translateY(-70px) scale(0);transition:all .5s;transition-delay:.15s}.mfb-component--bl.mfb-zoomin .mfb-component__list li:nth-child(2),.mfb-component--br.mfb-zoomin .mfb-component__list li:nth-child(2){-webkit-transform:translateY(-140px) scale(0);transform:translateY(-140px) scale(0);transition:all .5s;transition-delay:.1s}.mfb-component--bl.mfb-zoomin .mfb-component__list li:nth-child(3),.mfb-component--br.mfb-zoomin .mfb-component__list li:nth-child(3){-webkit-transform:translateY(-210px) scale(0);transform:translateY(-210px) scale(0);transition:all .5s;transition-delay:.05s}.mfb-component--bl.mfb-zoomin .mfb-component__list li:nth-child(4),.mfb-component--br.mfb-zoomin .mfb-component__list li:nth-child(4){-webkit-transform:translateY(-280px) scale(0);transform:translateY(-280px) scale(0);transition:all .5s;transition-delay:0s}.mfb-component--bl.mfb-zoomin[data-mfb-state=open] .mfb-component__list li:nth-child(1),.mfb-component--bl.mfb-zoomin[data-mfb-toggle=hover]:hover .mfb-component__list li:nth-child(1),.mfb-component--br.mfb-zoomin[data-mfb-state=open] .mfb-component__list li:nth-child(1),.mfb-component--br.mfb-zoomin[data-mfb-toggle=hover]:hover .mfb-component__list li:nth-child(1){-webkit-transform:translateY(-70px) scale(1);transform:translateY(-70px) scale(1);transition-delay:.05s}.mfb-component--bl.mfb-zoomin[data-mfb-state=open] .mfb-component__list li:nth-child(2),.mfb-component--bl.mfb-zoomin[data-mfb-toggle=hover]:hover .mfb-component__list li:nth-child(2),.mfb-component--br.mfb-zoomin[data-mfb-state=open] .mfb-component__list li:nth-child(2),.mfb-component--br.mfb-zoomin[data-mfb-toggle=hover]:hover .mfb-component__list li:nth-child(2){-webkit-transform:translateY(-140px) scale(1);transform:translateY(-140px) scale(1);transition-delay:.1s}.mfb-component--bl.mfb-zoomin[data-mfb-state=open] .mfb-component__list li:nth-child(3),.mfb-component--bl.mfb-zoomin[data-mfb-toggle=hover]:hover .mfb-component__list li:nth-child(3),.mfb-component--br.mfb-zoomin[data-mfb-state=open] .mfb-component__list li:nth-child(3),.mfb-component--br.mfb-zoomin[data-mfb-toggle=hover]:hover .mfb-component__list li:nth-child(3){-webkit-transform:translateY(-210px) scale(1);transform:translateY(-210px) scale(1);transition-delay:.15s}.mfb-component--bl.mfb-zoomin[data-mfb-state=open] .mfb-component__list li:nth-child(4),.mfb-component--bl.mfb-zoomin[data-mfb-toggle=hover]:hover .mfb-component__list li:nth-child(4),.mfb-component--br.mfb-zoomin[data-mfb-state=open] .mfb-component__list li:nth-child(4),.mfb-component--br.mfb-zoomin[data-mfb-toggle=hover]:hover .mfb-component__list li:nth-child(4){-webkit-transform:translateY(-280px) scale(1);transform:translateY(-280px) scale(1);transition-delay:.2s}.mfb-component--tl.mfb-fountain .mfb-component__list li,.mfb-component--tr.mfb-fountain .mfb-component__list li{-webkit-transform:scale(0);transform:scale(0)}.mfb-component--tl.mfb-fountain .mfb-component__list li:nth-child(1),.mfb-component--tr.mfb-fountain .mfb-component__list li:nth-child(1){-webkit-transform:translateY(-70px) scale(0);transform:translateY(-70px) scale(0);transition:all .5s;transition-delay:.15s}.mfb-component--tl.mfb-fountain .mfb-component__list li:nth-child(2),.mfb-component--tr.mfb-fountain .mfb-component__list li:nth-child(2){-webkit-transform:translateY(-140px) scale(0);transform:translateY(-140px) scale(0);transition:all .5s;transition-delay:.1s}.mfb-component--tl.mfb-fountain .mfb-component__list li:nth-child(3),.mfb-component--tr.mfb-fountain .mfb-component__list li:nth-child(3){-webkit-transform:translateY(-210px) scale(0);transform:translateY(-210px) scale(0);transition:all .5s;transition-delay:.05s}.mfb-component--tl.mfb-fountain .mfb-component__list li:nth-child(4),.mfb-component--tr.mfb-fountain .mfb-component__list li:nth-child(4){-webkit-transform:translateY(-280px) scale(0);transform:translateY(-280px) scale(0);transition:all .5s;transition-delay:0s}.mfb-component--tl.mfb-fountain[data-mfb-state=open] .mfb-component__list li:nth-child(1),.mfb-component--tl.mfb-fountain[data-mfb-toggle=hover]:hover .mfb-component__list li:nth-child(1),.mfb-component--tr.mfb-fountain[data-mfb-state=open] .mfb-component__list li:nth-child(1),.mfb-component--tr.mfb-fountain[data-mfb-toggle=hover]:hover .mfb-component__list li:nth-child(1){-webkit-transform:translateY(70px) scale(1);transform:translateY(70px) scale(1);transition-delay:.05s}.mfb-component--tl.mfb-fountain[data-mfb-state=open] .mfb-component__list li:nth-child(2),.mfb-component--tl.mfb-fountain[data-mfb-toggle=hover]:hover .mfb-component__list li:nth-child(2),.mfb-component--tr.mfb-fountain[data-mfb-state=open] .mfb-component__list li:nth-child(2),.mfb-component--tr.mfb-fountain[data-mfb-toggle=hover]:hover .mfb-component__list li:nth-child(2){-webkit-transform:translateY(140px) scale(1);transform:translateY(140px) scale(1);transition-delay:.1s}.mfb-component--tl.mfb-fountain[data-mfb-state=open] .mfb-component__list li:nth-child(3),.mfb-component--tl.mfb-fountain[data-mfb-toggle=hover]:hover .mfb-component__list li:nth-child(3),.mfb-component--tr.mfb-fountain[data-mfb-state=open] .mfb-component__list li:nth-child(3),.mfb-component--tr.mfb-fountain[data-mfb-toggle=hover]:hover .mfb-component__list li:nth-child(3){-webkit-transform:translateY(210px) scale(1);transform:translateY(210px) scale(1);transition-delay:.15s}.mfb-component--tl.mfb-fountain[data-mfb-state=open] .mfb-component__list li:nth-child(4),.mfb-component--tl.mfb-fountain[data-mfb-toggle=hover]:hover .mfb-component__list li:nth-child(4),.mfb-component--tr.mfb-fountain[data-mfb-state=open] .mfb-component__list li:nth-child(4),.mfb-component--tr.mfb-fountain[data-mfb-toggle=hover]:hover .mfb-component__list li:nth-child(4){-webkit-transform:translateY(280px) scale(1);transform:translateY(280px) scale(1);transition-delay:.2s}.mfb-component--bl.mfb-fountain .mfb-component__list li,.mfb-component--br.mfb-fountain .mfb-component__list li{-webkit-transform:scale(0);transform:scale(0)}.mfb-component--bl.mfb-fountain .mfb-component__list li:nth-child(1),.mfb-component--br.mfb-fountain .mfb-component__list li:nth-child(1){-webkit-transform:translateY(70px) scale(0);transform:translateY(70px) scale(0);transition:all .5s;transition-delay:.15s}.mfb-component--bl.mfb-fountain .mfb-component__list li:nth-child(2),.mfb-component--br.mfb-fountain .mfb-component__list li:nth-child(2){-webkit-transform:translateY(140px) scale(0);transform:translateY(140px) scale(0);transition:all .5s;transition-delay:.1s}.mfb-component--bl.mfb-fountain .mfb-component__list li:nth-child(3),.mfb-component--br.mfb-fountain .mfb-component__list li:nth-child(3){-webkit-transform:translateY(210px) scale(0);transform:translateY(210px) scale(0);transition:all .5s;transition-delay:.05s}.mfb-component--bl.mfb-fountain .mfb-component__list li:nth-child(4),.mfb-component--br.mfb-fountain .mfb-component__list li:nth-child(4){-webkit-transform:translateY(280px) scale(0);transform:translateY(280px) scale(0);transition:all .5s;transition-delay:0s}.mfb-component--bl.mfb-fountain[data-mfb-state=open] .mfb-component__list li:nth-child(1),.mfb-component--bl.mfb-fountain[data-mfb-toggle=hover]:hover .mfb-component__list li:nth-child(1),.mfb-component--br.mfb-fountain[data-mfb-state=open] .mfb-component__list li:nth-child(1),.mfb-component--br.mfb-fountain[data-mfb-toggle=hover]:hover .mfb-component__list li:nth-child(1){-webkit-transform:translateY(-70px) scale(1);transform:translateY(-70px) scale(1);transition-delay:.05s}.mfb-component--bl.mfb-fountain[data-mfb-state=open] .mfb-component__list li:nth-child(2),.mfb-component--bl.mfb-fountain[data-mfb-toggle=hover]:hover .mfb-component__list li:nth-child(2),.mfb-component--br.mfb-fountain[data-mfb-state=open] .mfb-component__list li:nth-child(2),.mfb-component--br.mfb-fountain[data-mfb-toggle=hover]:hover .mfb-component__list li:nth-child(2){-webkit-transform:translateY(-140px) scale(1);transform:translateY(-140px) scale(1);transition-delay:.1s}.mfb-component--bl.mfb-fountain[data-mfb-state=open] .mfb-component__list li:nth-child(3),.mfb-component--bl.mfb-fountain[data-mfb-toggle=hover]:hover .mfb-component__list li:nth-child(3),.mfb-component--br.mfb-fountain[data-mfb-state=open] .mfb-component__list li:nth-child(3),.mfb-component--br.mfb-fountain[data-mfb-toggle=hover]:hover .mfb-component__list li:nth-child(3){-webkit-transform:translateY(-210px) scale(1);transform:translateY(-210px) scale(1);transition-delay:.15s}.mfb-component--bl.mfb-fountain[data-mfb-state=open] .mfb-component__list li:nth-child(4),.mfb-component--bl.mfb-fountain[data-mfb-toggle=hover]:hover .mfb-component__list li:nth-child(4),.mfb-component--br.mfb-fountain[data-mfb-state=open] .mfb-component__list li:nth-child(4),.mfb-component--br.mfb-fountain[data-mfb-toggle=hover]:hover .mfb-component__list li:nth-child(4){-webkit-transform:translateY(-280px) scale(1);transform:translateY(-280px) scale(1);transition-delay:.2s}[data-mfb-label]:after{content:attr(data-mfb-label);opacity:0;background:rgba(0,0,0,.4);padding:4px 10px;border-radius:3px;color:rgba(255,255,255,.8);font-size:13px;pointer-events:none;position:absolute;top:50%;margin-top:-10.5px;transition:all .5s}[data-mfb-state=open] [data-mfb-label]:after,[data-mfb-toggle=hover] [data-mfb-label]:hover:after{content:attr(data-mfb-label);opacity:1;transition:all .3s}.mfb-component--br .mfb-component__list [data-mfb-label]:after,.mfb-component--br [data-mfb-label]:after,.mfb-component--tr .mfb-component__list [data-mfb-label]:after,.mfb-component--tr [data-mfb-label]:after{content:attr(data-mfb-label);right:70px}.mfb-component--bl .mfb-component__list [data-mfb-label]:after,.mfb-component--bl [data-mfb-label]:after,.mfb-component--tl .mfb-component__list [data-mfb-label]:after,.mfb-component--tl [data-mfb-label]:after{content:attr(data-mfb-label);left:70px}
--------------------------------------------------------------------------------
/dist/mfb.min.js:
--------------------------------------------------------------------------------
1 | !function(a,b){"use strict";function c(a,b){for(var c=0,d=a.length;d>c;c++)i=a[c].querySelector("."+r),i.addEventListener(b,f,!1)}function d(a){for(var b=0,c=a.length;c>b;b++)a[b].setAttribute(n,l),a[b].setAttribute(o,q)}function e(a){return b.querySelectorAll("["+n+'="'+a+'"]')}function f(a){for(j=a.target;j&&!j.getAttribute(n);)if(j=j.parentNode,!j)return;k=j.getAttribute(o)===p?q:p,j.setAttribute(o,k)}var g,h,i,j,k,l="click",m="hover",n="data-mfb-toggle",o="data-mfb-state",p="open",q="closed",r="mfb-component__button--main";a.Modernizr&&Modernizr.touch&&(h=e(m),d(h)),g=e(l),c(g,"click")}(window,document);
--------------------------------------------------------------------------------
/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "mfb",
3 | "version": "0.12.1",
4 | "description": "html component for a material menu à la Path and Google Inbox",
5 | "main": "index.html",
6 | "repository": "https://github.com/nobitagit/material-floating-button",
7 | "keywords": [
8 | "component",
9 | "material",
10 | "design",
11 | "menu",
12 | "css"
13 | ],
14 | "bugs": "https://github.com/nobitagit/material-floating-button/issues",
15 | "author": "Nobita",
16 | "contributors": [
17 | {
18 | "name": "Maxence Winandy",
19 | "email": "maxence.winandy@gmail.com"
20 | },
21 | {
22 | "name": "Christian Flach",
23 | "email": "cmfcmf.flach@gmail.com"
24 | }
25 | ],
26 | "license": "MIT",
27 | "devDependencies": {
28 | "grunt": "^0.4.5",
29 | "grunt-contrib-clean": "^0.6.0",
30 | "grunt-contrib-copy": "^0.8.0",
31 | "grunt-contrib-cssmin": "^0.12.2",
32 | "grunt-contrib-sass": "^0.8.1",
33 | "grunt-contrib-uglify": "^0.8.0",
34 | "grunt-contrib-watch": "^0.6.1",
35 | "grunt-gh-pages": "^0.9.1",
36 | "grunt-preprocess": "^4.1.0",
37 | "grunt-usemin": "^3.0.0"
38 | }
39 | }
40 |
--------------------------------------------------------------------------------
/src/_/_fountain.scss:
--------------------------------------------------------------------------------
1 | @mixin effects-fountain{
2 |
3 | /**
4 | * FOUNTAIN
5 | * When hovering the main button the child buttons
6 | * jump into view from outside the viewport
7 | */
8 |
9 | .mfb-component--tl.mfb-fountain,
10 | .mfb-component--tr.mfb-fountain{
11 | .mfb-component__list{
12 | li{
13 | -webkit-transform: scale(0);
14 | transform: scale(0);
15 | }
16 | @for $i from 1 through $number-of-child-buttons {
17 | $distance: -1 * $button-space * $i;
18 | li:nth-child( #{$i} ) {
19 | -webkit-transform: translateY($distance) scale(0);
20 | transform: translateY($distance) scale(0);
21 | transition: all $slide-speed;
22 | // this is the delay at which the buttons start disappearing
23 | transition-delay: ( $number-of-child-buttons - $i ) * 0.05s;
24 | }
25 | }
26 | }
27 | &[data-mfb-toggle="hover"]:hover,
28 | &[data-mfb-state="open"]{
29 | .mfb-component__list{
30 | @for $i from 1 through $number-of-child-buttons {
31 | $distance: $button-space * $i;
32 | li:nth-child( #{$i} ) {
33 | -webkit-transform: translateY($distance) scale(1);
34 | transform: translateY($distance) scale(1);
35 | // this is the delay at which the buttons appear
36 | transition-delay: $i * 0.05s;
37 | }
38 | }
39 | }
40 | }
41 | }
42 |
43 | .mfb-component--bl.mfb-fountain,
44 | .mfb-component--br.mfb-fountain{
45 | .mfb-component__list{
46 | li{
47 | -webkit-transform: scale(0);
48 | transform: scale(0);
49 | }
50 | @for $i from 1 through $number-of-child-buttons {
51 | $distance: $button-space * $i;
52 | li:nth-child( #{$i} ) {
53 | -webkit-transform: translateY($distance) scale(0);
54 | transform: translateY($distance) scale(0);
55 | transition: all $slide-speed;
56 | // this is the delay at which the buttons start disappearing
57 | transition-delay: ( $number-of-child-buttons - $i ) * 0.05s;
58 | }
59 | }
60 | }
61 | &[data-mfb-toggle="hover"]:hover,
62 | &[data-mfb-state="open"]{
63 | .mfb-component__list{
64 | @for $i from 1 through $number-of-child-buttons {
65 | $distance: -1 * $button-space * $i;
66 | li:nth-child( #{$i} ) {
67 | -webkit-transform: translateY($distance) scale(1);
68 | transform: translateY($distance) scale(1);
69 | // this is the delay at which the buttons appear
70 | transition-delay: $i * 0.05s;
71 | }
72 | }
73 | }
74 | }
75 | }
76 |
77 | }
78 |
--------------------------------------------------------------------------------
/src/_/_slidein-spring.scss:
--------------------------------------------------------------------------------
1 | @mixin effects-slidein-spring{
2 |
3 | /**
4 | * SLIDE IN SPRING
5 | * Same as slide-in but with a springy animation.
6 | *
7 | */
8 |
9 | .mfb-component--tl.mfb-slidein-spring,
10 | .mfb-component--tr.mfb-slidein-spring{
11 | .mfb-component__list li{
12 | opacity: 0;
13 | transition: all $slide-speed;
14 | transition-timing-function: cubic-bezier(0.68, -0.55, 0.265, 1.55);
15 | }
16 | @for $i from 1 through $number-of-child-buttons {
17 | .mfb-component__list li:nth-child( #{$i} ) {
18 | transition-delay: #{$i * 0.05}s;
19 | }
20 | }
21 | &[data-mfb-toggle="hover"]:hover,
22 | &[data-mfb-state="open"]{
23 | .mfb-component__list{
24 | li{
25 | opacity: 1;
26 | }
27 | @for $i from 1 through $number-of-child-buttons {
28 | $distance: $button-space * $i;
29 | li:nth-child( #{$i} ) {
30 | transition-delay: #{$i * 0.05}s;
31 | -webkit-transform: translateY( $distance );
32 | transform: translateY( $distance ); }
33 | }
34 | }
35 | }
36 | }
37 |
38 | .mfb-component--bl.mfb-slidein-spring,
39 | .mfb-component--br.mfb-slidein-spring{
40 | .mfb-component__list li{
41 | opacity: 0;
42 | transition: all $slide-speed;
43 | transition-timing-function: cubic-bezier(0.68, -0.55, 0.265, 1.55);
44 | }
45 | @for $i from 1 through $number-of-child-buttons {
46 | .mfb-component__list li:nth-child( #{$i} ) {
47 | transition-delay: #{$i * 0.05}s;
48 | }
49 | }
50 | &[data-mfb-toggle="hover"]:hover,
51 | &[data-mfb-state="open"]{
52 | .mfb-component__list{
53 | li{
54 | opacity: 1;
55 | }
56 | @for $i from 1 through $number-of-child-buttons {
57 | $distance: -1 * $button-space * $i;
58 | li:nth-child( #{$i} ) {
59 | transition-delay: #{$i * 0.05}s;
60 | -webkit-transform: translateY( $distance );
61 | transform: translateY( $distance ); }
62 | }
63 | }
64 | }
65 | }
66 |
67 | }
68 |
--------------------------------------------------------------------------------
/src/_/_slidein.scss:
--------------------------------------------------------------------------------
1 | @mixin effects-slidein{
2 |
3 | /**
4 | * SLIDE IN + FADE
5 | * When hovering the main button, the child buttons slide out from beneath
6 | * the main button while transitioning from transparent to opaque.
7 | *
8 | */
9 |
10 | .mfb-component--tl.mfb-slidein,
11 | .mfb-component--tr.mfb-slidein{
12 | .mfb-component__list li{
13 | opacity: 0;
14 | transition: all $slide-speed;
15 | }
16 | &[data-mfb-toggle="hover"]:hover,
17 | &[data-mfb-state="open"]{
18 | .mfb-component__list{
19 | li{
20 | opacity: 1;
21 | }
22 | @for $i from 1 through $number-of-child-buttons {
23 | $distance: $button-space * $i;
24 | li:nth-child( #{$i} ) {
25 | -webkit-transform: translateY( $distance );
26 | transform: translateY( $distance ); }
27 | }
28 | }
29 | }
30 | }
31 |
32 | .mfb-component--bl.mfb-slidein,
33 | .mfb-component--br.mfb-slidein{
34 | .mfb-component__list li{
35 | opacity: 0;
36 | transition: all $slide-speed;
37 | }
38 | &[data-mfb-toggle="hover"]:hover,
39 | &[data-mfb-state="open"]{
40 | .mfb-component__list{
41 | li{
42 | opacity: 1;
43 | }
44 | @for $i from 1 through $number-of-child-buttons {
45 | $distance: -1 * $button-space * $i;
46 | li:nth-child( #{$i} ) { -webkit-transform: translateY( $distance );
47 | transform: translateY( $distance ); }
48 | }
49 | }
50 | }
51 | }
52 |
53 | }
54 |
--------------------------------------------------------------------------------
/src/_/_zoomin.scss:
--------------------------------------------------------------------------------
1 | @mixin effects-zoomin{
2 |
3 | /**
4 | * ZOOM-IN
5 | * When hovering the main button, the child buttons grow
6 | * from zero to normal size.
7 | *
8 | */
9 |
10 | .mfb-component--tl.mfb-zoomin,
11 | .mfb-component--tr.mfb-zoomin{
12 | .mfb-component__list{
13 | li{
14 | -webkit-transform: scale(0);
15 | transform: scale(0);
16 | }
17 | @for $i from 1 through $number-of-child-buttons {
18 | $distance: $button-space * $i;
19 | li:nth-child( #{$i} ) {
20 | -webkit-transform: translateY($distance) scale(0);
21 | transform: translateY($distance) scale(0);
22 | transition: all $slide-speed;
23 | // this is the delay at which the buttons *disappear*
24 | transition-delay: ( $number-of-child-buttons - $i ) * 0.05s;
25 | }
26 | }
27 | }
28 | &[data-mfb-toggle="hover"]:hover,
29 | &[data-mfb-state="open"]{
30 | .mfb-component__list{
31 | @for $i from 1 through $number-of-child-buttons {
32 | $distance: $button-space * $i;
33 | li:nth-child( #{$i} ) {
34 | -webkit-transform: translateY($distance) scale(1);
35 | transform: translateY($distance) scale(1);
36 | // this is the delay at which the buttons *appear*
37 | transition-delay: $i * 0.05s;
38 | }
39 | }
40 | }
41 | }
42 | }
43 |
44 | .mfb-component--bl.mfb-zoomin,
45 | .mfb-component--br.mfb-zoomin{
46 | .mfb-component__list{
47 | li{
48 | -webkit-transform: scale(0);
49 | transform: scale(0);
50 | }
51 | @for $i from 1 through $number-of-child-buttons {
52 | $distance: -1 * $button-space * $i;
53 | li:nth-child( #{$i} ) {
54 | -webkit-transform: translateY($distance) scale(0);
55 | transform: translateY($distance) scale(0);
56 | transition: all $slide-speed;
57 | // this is the delay at which the buttons start disappearing
58 | transition-delay: ( $number-of-child-buttons - $i ) * 0.05s;
59 | }
60 | }
61 | }
62 | &[data-mfb-toggle="hover"]:hover,
63 | &[data-mfb-state="open"]{
64 | .mfb-component__list{
65 | @for $i from 1 through $number-of-child-buttons {
66 | $distance: -1 * $button-space * $i;
67 | li:nth-child( #{$i} ) {
68 | -webkit-transform: translateY($distance) scale(1);
69 | transform: translateY($distance) scale(1);
70 | // this is the delay at which the buttons appear
71 | transition-delay: $i * 0.05s;
72 | }
73 | }
74 | }
75 | }
76 | }
77 |
78 | }
79 |
--------------------------------------------------------------------------------
/src/closure/bottom.js:
--------------------------------------------------------------------------------
1 | })( window, document );
2 |
--------------------------------------------------------------------------------
/src/closure/top.js:
--------------------------------------------------------------------------------
1 | ;(function ( window, document, undefined ) {
2 |
--------------------------------------------------------------------------------
/src/mfb.css.map:
--------------------------------------------------------------------------------
1 | {
2 | "version": 3,
3 | "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAmIA,8EAAc;EACZ,UAAU,EAAE,UAAU;EACtB,MAAM,EAlCU,IAAI;EAmCpB,QAAQ,EAAE,KAAK;EACf,WAAW,EAAE,MAAM;EACnB,OAAO,EAAE,EAAE;EAGX,YAAY,EAAE,CAAC;EACf,UAAU,EAAE,IAAI;EAIhB,0TAAqB;IACnB,UAAU,EAAE,OAAO;;;;;;;;;;;;;AAiBvB,kBAAkB;EAEhB,IAAI,EAAE,CAAC;EAAE,GAAG,EAAE,CAAC;;AAEjB,k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8B;EACzC,SAAS,EAAE,0BAA8B;EAEjD,gBAAgB,EAAE,KAAU;AAJ9B;;2FAAsB;EACpB,iBAAiB,EAAE,2BAA8B;EACzC,SAAS,EAAE,2BAA8B;EAEjD,gBAAgB,EAAE,IAAU;AAJ9B;;2FAAsB;EACpB,iBAAiB,EAAE,2BAA8B;EACzC,SAAS,EAAE,2BAA8B;EAEjD,gBAAgB,EAAE,KAAU;AAJ9B;;2FAAsB;EACpB,iBAAiB,EAAE,2BAA8B;EACzC,SAAS,EAAE,2BAA8B;EAEjD,gBAAgB,EAAE,IAAU;;;;;;;;;;;AJuQxC,sBAAuB;EACrB,OAAO,EAAE,oBAAoB;EAC7B,OAAO,EAAE,CAAC;EACV,UAAU,EAAE,QAAoB;EAChC,UAAU,EAAE,kBAAe;EAC3B,OAAO,EAAE,QAAmD;EAC5D,aAAa,EAAE,GAAG;EAClB,KAAK,EA3QO,wBAAwB;EA4QpC,SAAS,EA/OQ,IAAI;EAgPrB,cAAc,EAAE,IAAI;EACpB,QAAQ,EAAE,QAAQ;EAClB,GAAG,EAAE,GAAG;EACR,UAAU,EAAE,OAAoD;EAChE,UAAU,EAAE,QAAoB;;AAElC;8CAC8C;EAC5C,OAAO,EAAE,oBAAoB;EAC7B,OAAO,EAAE,CAAC;EACV,UAAU,EAAE,QAAmB;;;;;AAM/B,oFAAuB;EACrB,OAAO,EAAE,oBAAoB;EAC7B,KAAK,EAtPY,IAAI;;AA0PvB,8HAAuB;EACrB,OAAO,EAAE,oBAAoB;EAC7B,KAAK,EAAE,IAAkE;;AAI3E,oFAAuB;EACrB,OAAO,EAAE,oBAAoB;EAC7B,IAAI,EAlQa,IAAI;;AAsQvB,8HAAuB;EACrB,OAAO,EAAE,oBAAoB;EAC7B,IAAI,EAAE,IAAkE",
4 | "sources": ["mfb.scss","_/_slidein.scss","_/_slidein-spring.scss","_/_zoomin.scss","_/_fountain.scss"],
5 | "names": [],
6 | "file": "mfb.css"
7 | }
8 |
--------------------------------------------------------------------------------
/src/mfb.js:
--------------------------------------------------------------------------------
1 | /**
2 | * Material floating button
3 | * By: Nobita
4 | * Repo and docs: https://github.com/nobitagit/material-floating-button
5 | *
6 | * License: MIT
7 | */
8 |
9 | // build script hook - don't remove
10 | // @include ../src/closure/top.js
11 |
12 | 'use strict';
13 |
14 | /**
15 | * Some defaults
16 | */
17 | var clickOpt = 'click',
18 | hoverOpt = 'hover',
19 | toggleMethod = 'data-mfb-toggle',
20 | menuState = 'data-mfb-state',
21 | isOpen = 'open',
22 | isClosed = 'closed',
23 | mainButtonClass = 'mfb-component__button--main';
24 |
25 | /**
26 | * Internal references
27 | */
28 | var elemsToClick,
29 | elemsToHover,
30 | mainButton,
31 | target,
32 | currentState;
33 |
34 | /**
35 | * For every menu we need to get the main button and attach the appropriate evt.
36 | */
37 | function attachEvt( elems, evt ){
38 | for( var i = 0, len = elems.length; i < len; i++ ){
39 | mainButton = elems[i].querySelector('.' + mainButtonClass);
40 | mainButton.addEventListener( evt , toggleButton, false);
41 | }
42 | }
43 |
44 | /**
45 | * Remove the hover option, set a click toggle and a default,
46 | * initial state of 'closed' to menu that's been targeted.
47 | */
48 | function replaceAttrs( elems ){
49 | for( var i = 0, len = elems.length; i < len; i++ ){
50 | elems[i].setAttribute( toggleMethod, clickOpt );
51 | elems[i].setAttribute( menuState, isClosed );
52 | }
53 | }
54 |
55 | function getElemsByToggleMethod( selector ){
56 | return document.querySelectorAll('[' + toggleMethod + '="' + selector + '"]');
57 | }
58 |
59 | /**
60 | * The open/close action is performed by toggling an attribute
61 | * on the menu main element.
62 | *
63 | * First, check if the target is the menu itself. If it's a child
64 | * keep walking up the tree until we found the main element
65 | * where we can toggle the state.
66 | */
67 | function toggleButton( evt ){
68 |
69 | target = evt.target;
70 | while ( target && !target.getAttribute( toggleMethod ) ){
71 | target = target.parentNode;
72 | if(!target) { return; }
73 | }
74 |
75 | currentState = target.getAttribute( menuState ) === isOpen ? isClosed : isOpen;
76 |
77 | target.setAttribute(menuState, currentState);
78 |
79 | }
80 |
81 | /**
82 | * On touch enabled devices we assume that no hover state is possible.
83 | * So, we get the menu with hover action configured and we set it up
84 | * in order to make it usable with tap/click.
85 | **/
86 | if ( window.Modernizr && Modernizr.touch ){
87 | elemsToHover = getElemsByToggleMethod( hoverOpt );
88 | replaceAttrs( elemsToHover );
89 | }
90 |
91 | elemsToClick = getElemsByToggleMethod( clickOpt );
92 |
93 | attachEvt( elemsToClick, 'click' );
94 |
95 | // build script hook - don't remove
96 | // @include ../src/closure/bottom.js
97 |
--------------------------------------------------------------------------------
/src/mfb.scss:
--------------------------------------------------------------------------------
1 | /**
2 | * CONTENTS
3 | *
4 | * #Introduction........Naming conventions used throughout the code.
5 | *
6 | * #SETTINGS
7 | * Variables............Globally-available variables and config.
8 | *
9 | * #TOOLS
10 | * Mixins...............Useful mixins.
11 | *
12 | * #GENERIC
13 | * Demo styles..........Styles for demo only (consider removing these).
14 | *
15 | * #BASE
16 | * Raw styles...........The very basic component wrapper.
17 | * Modifiers............The basic styles dependant on component placement.
18 | * Debuggers............The basic styles dependant on component placement.
19 | *
20 | * #BUTTONS
21 | * Base..................Wrapping and constraining every button.
22 | * Modifiers.............Styles that depends on state and settings.
23 | * Animations............Main animations of the component.
24 | * Debuggers.............Styles for development.
25 | *
26 | * #LABELS
27 | * Base..................Wrapping and constraining every label.
28 | * Modifiers.............Styles that depends on state and settings.
29 | * Debuggers.............Styles for development.
30 | *
31 | * #DEVELOPMENT
32 | * In development........These styles are in development and not yet finalised
33 | * Debuggers.............Helper styles and flags for development.
34 | */
35 |
36 | /*------------------------------------*\
37 | #Introduction
38 | \*------------------------------------*/
39 | /**
40 | * The code AND the comments use naming conventions to refer to each part of
41 | * the UI put in place by this component. If you see that somewhere they are
42 | * not followed please consider a Pull Request. The naming conventions are:
43 | *
44 | * "Component" : the widget itself as a whole. This is the last time it will be
45 | * called anything different than "component". So, stay away from
46 | * "widget", "button" or anything else when referring to the
47 | * Component in general.
48 | *
49 | * "Main Button" : the button that is always in view. Hovering or clicking on it
50 | * will reveal the child buttons.
51 | *
52 | * "Child buttons" : if you've read the previous point you know what they are.
53 | * Did you read the previous point? :)
54 | *
55 | * "Label(s)" : the tooltip that fades in when hovering over a button.
56 |
57 | /*------------------------------------*\
58 | #SETTINGS | Variables
59 | \*------------------------------------*/
60 |
61 | /**
62 | * These variables are the default styles that serve as fallback and can be
63 | * easily customised at compile time.
64 | * Consider overriding them in your own style sheets rather than editing them
65 | * here. Refer to the docs for more info.
66 | */
67 |
68 | /* COLORS ----------------------------*/
69 |
70 | // the main/primary color
71 | $main-color: #E40A5D !default;
72 | // button colors
73 | $button-text-color: #f1f1f1;
74 | $button-box-shadow: 0 0 4px rgba(0,0,0,.14),0 4px 8px rgba(0,0,0,.28) !default;
75 | // labels colors
76 | $label-text-color: rgba(255, 255, 255, 0.8) !default;
77 | // labels background
78 | $label-background-color: rgba(0,0,0, .4);
79 | /* EFFECTS ---------------------------*/
80 |
81 | // which effects must be made available in the css
82 | $effects-zoomin: true !default;
83 | $effects-slidein: true !default;
84 | $effects-fountain: true !default;
85 |
86 | /* SPEEDS ----------------------------*/
87 |
88 | // the speed of the inflation of each button after hovering on the main button
89 | $delay-staggering-inflate: 0.1s !default;
90 | // when hovering on the main button the child buttons slide into view
91 | $slide-speed: .5s !default;
92 | // the labels disappear at this speed on mouse out
93 | $label-hover-off: .5s !default;
94 | // the labels appear at this speed on mouse over
95 | $label-hover-on: .3s !default;
96 |
97 | /* SIZES -----------------------------*/
98 |
99 | // main button diameter
100 | $main-button-size: 56px !default;
101 | // main button diameter
102 | $child_button_size: 56px !default;
103 | // the distance of the main button from the closest corners of the screen
104 | $border-distance: 25px !default;
105 | // font-size for the icons
106 | $icons-font-size: 18px !default;
107 | // font-size for labels
108 | $labels-font-size: 14px !default;
109 | // font-weight for labels
110 | $labels-font-weight: normal !default;
111 | // top & bottom padding for the labels
112 | $labels-padding-vertical: 4px !default;
113 | // left & right padding for the labels
114 | $labels-padding-horizontal: 10px !default;
115 |
116 | /* SPACING ---------------------------*/
117 |
118 | // space between buttons
119 | $button-space: 70px !default;
120 | // space between button and label
121 | $button-label-space: 70px !default;
122 |
123 | /* OTHER VARIABLES -------------------*/
124 |
125 | // how many child buttons does the component have
126 | $number-of-child-buttons: 4 !default;
127 |
128 | /*------------------------------------*\
129 | #BASE | Raw styles
130 | \*------------------------------------*/
131 |
132 | /**
133 | * The very core styling of the button.
134 | * These styles are shared by every instance of the button.
135 | * Styles placed here should NOT care about placement in the screen,
136 | * options chosen by the user or state of the button.
137 | */
138 |
139 | %mfb-component{
140 | box-sizing: border-box; // A better box-sizing
141 | margin: $border-distance;
142 | position: fixed;
143 | white-space: nowrap;
144 | z-index: 30;
145 | // this padding is really needed only if the element is an
146 | // otherwise it can probably be ditched.
147 | padding-left: 0;
148 | list-style: none;
149 |
150 | // make sure that everything inside this component
151 | // inherits the same box-sizing
152 | *, *:before, *:after {
153 | box-sizing: inherit;
154 | }
155 | }
156 |
157 |
158 | /*------------------------------------*\
159 | #BASE | Modifiers
160 | \*------------------------------------*/
161 | /**
162 | * These styles depends on the placement of the button.
163 | * Styles can be:
164 | * 1. Top-left: modified by the " --tl " suffix.
165 | * 2. Top-right: modified by the " --tr " suffix.
166 | * 3. Bottom-left: modified by the " --bl " suffix.
167 | * 4. Bottom-right: modified by the " --br " suffix.
168 | */
169 |
170 | .mfb-component--tl{
171 | @extend %mfb-component;
172 | left: 0; top: 0;
173 | }
174 | .mfb-component--tr{
175 | @extend %mfb-component;
176 | right: 0; top: 0;
177 | }
178 | .mfb-component--bl{
179 | @extend %mfb-component;
180 | left: 0; bottom: 0;
181 | }
182 | .mfb-component--br{
183 | @extend %mfb-component;
184 | right: 0; bottom: 0;
185 | }
186 |
187 |
188 | /*------------------------------------*\
189 | #BUTTONS | Base
190 | \*------------------------------------*/
191 |
192 | %mfb-component__button{
193 | background-color: $main-color;
194 | display: inline-block;
195 | position: relative;
196 | border: none;
197 | border-radius: 50%;
198 | box-shadow: $button-box-shadow;
199 | cursor: pointer;
200 | outline: none;
201 | padding: 0;
202 | position: relative;
203 | -webkit-user-drag: none;
204 | color: $button-text-color;
205 | }
206 |
207 | /**
208 | * This is the unordered list for the list items that contain
209 | * the child buttons.
210 | *
211 | */
212 | .mfb-component__list{
213 | list-style: none;
214 | margin: 0;
215 | padding: 0;
216 | &>li{
217 | display: block;
218 | position: absolute;
219 | top: 0;
220 | right: ($main-button-size - $child_button_size + 2) / 2;
221 | padding: 10px + ($main-button-size - $child_button_size) / 2 0;
222 | margin: -(10px + ($main-button-size - $child_button_size) / 2) 0;
223 | }
224 | }
225 |
226 | /**
227 | * These are the basic styles for all the icons inside the main button
228 | */
229 | .mfb-component__icon{
230 | position: absolute;
231 | font-size: $icons-font-size;
232 | text-align: center;
233 | line-height: $main-button-size;
234 | width: 100%;
235 | }
236 |
237 | .mfb-component__wrap{
238 | // this double declaration adds some padding to the main button
239 | // to expand the area that triggers the hover state. The equal, negative
240 | // margin evens out the distance form the borders so that the button
241 | // does not shift out of position.
242 | padding: $border-distance;
243 | margin: -$border-distance;
244 | }
245 |
246 | [data-mfb-toggle="hover"]:hover,
247 | [data-mfb-state="open"]{
248 | .mfb-component__icon {
249 | -webkit-transform: scale(1) rotate(0deg);
250 | transform: scale(1) rotate(0deg);
251 | }
252 | }
253 |
254 |
255 | /*------------------------------------*\
256 | #BUTTONS | Modifiers
257 | \*------------------------------------*/
258 |
259 | .mfb-component__button--main{
260 | @extend %mfb-component__button;
261 | height: $main-button-size;
262 | width: $main-button-size;
263 | z-index: 20;
264 | }
265 | .mfb-component__button--child{
266 | @extend %mfb-component__button;
267 | height: $child_button_size;
268 | width: $child_button_size;
269 | }
270 | // the icons for the main button
271 | .mfb-component__main-icon--active,
272 | .mfb-component__main-icon--resting{
273 | @extend .mfb-component__icon;
274 | -webkit-transform: scale(1) rotate(360deg);
275 | transform: scale(1) rotate(360deg);
276 | -webkit-transition: -webkit-transform 150ms cubic-bezier(.4,0,1,1);
277 | transition: transform 150ms cubic-bezier(.4,0,1,1);
278 | }
279 | // the icons for the main button
280 | .mfb-component__child-icon,
281 | .mfb-component__child-icon{
282 | @extend .mfb-component__icon;
283 | line-height: $child_button_size;
284 | font-size: 18 / 56 * $child_button_size;
285 | }
286 | .mfb-component__main-icon--active{
287 | opacity: 0;
288 | }
289 | [data-mfb-toggle="hover"]:hover,
290 | [data-mfb-state="open"]{
291 | .mfb-component__main-icon{
292 | -webkit-transform: scale(1) rotate(0deg);
293 | transform: scale(1) rotate(0deg);
294 | }
295 | .mfb-component__main-icon--resting{
296 | opacity: 0;
297 | // don't remove this, needed for ng-mfb downstream repo!
298 | position: absolute !important;
299 | }
300 | .mfb-component__main-icon--active{
301 | opacity: 1;
302 | }
303 | }
304 |
305 | /*------------------------------------*\
306 | #BUTTONS | Animations
307 | \*------------------------------------*/
308 |
309 | @import "_/_slidein";
310 | @import "_/_slidein-spring";
311 | @import "_/_zoomin";
312 | @import "_/_fountain";
313 |
314 | // Ugly work-around for this https://github.com/sass/sass/issues/451
315 | @if $effects-slidein == true {
316 | @include effects-slidein;
317 | }
318 | @if $effects-slidein == true {
319 | @include effects-slidein-spring;
320 | }
321 | @if $effects-zoomin == true {
322 | @include effects-zoomin;
323 | }
324 | @if $effects-fountain == true {
325 | @include effects-fountain;
326 | }
327 |
328 | /*------------------------------------*\
329 | #LABELS | base
330 | \*------------------------------------*/
331 |
332 | /**
333 | * These are the labels associated to each button,
334 | * exposed only when hovering the related button.
335 | * They are called labels but are in fact data-attributes of
336 | * each button (an anchor tag).
337 | */
338 |
339 | [data-mfb-label]:after {
340 | content: attr(data-mfb-label);
341 | opacity: 0;
342 | transition: all $label-hover-off;
343 | background: $label-background-color;
344 | padding: $labels-padding-vertical $labels-padding-horizontal;
345 | border-radius: 3px;
346 | color: $label-text-color;
347 | font-size: $labels-font-size;
348 | font-weight: $labels-font-weight;
349 | pointer-events: none;
350 | line-height: normal;
351 | position: absolute;
352 | top: 50%;
353 | margin-top: - ($labels-padding-vertical + $labels-font-size / 2);
354 | transition: all $label-hover-off; // the label disappears at this speed
355 | }
356 | [data-mfb-toggle="hover"] [data-mfb-label]:hover:after,
357 | [data-mfb-state="open"] [data-mfb-label]:after{
358 | content: attr(data-mfb-label);
359 | opacity: 1;
360 | transition: all $label-hover-on; // the label appears at this speed
361 | }
362 | /*------------------------------------*\
363 | #LABELS | Modifiers
364 | \*------------------------------------*/
365 | .mfb-component--br, .mfb-component--tr{
366 | [data-mfb-label]:after {
367 | content: attr(data-mfb-label);
368 | right: $button-label-space;
369 | }
370 | }
371 | .mfb-component--br .mfb-component__list, .mfb-component--tr .mfb-component__list {
372 | [data-mfb-label]:after {
373 | content: attr(data-mfb-label);
374 | right: $button-label-space - ($main-button-size - $child_button_size) / 2;
375 | }
376 | }
377 | .mfb-component--tl, .mfb-component--bl{
378 | [data-mfb-label]:after {
379 | content: attr(data-mfb-label);
380 | left: $button-label-space;
381 | }
382 | }
383 | .mfb-component--tl .mfb-component__list, .mfb-component--bl .mfb-component__list{
384 | [data-mfb-label]:after {
385 | content: attr(data-mfb-label);
386 | left: $button-label-space - ($main-button-size - $child_button_size) / 2;
387 | }
388 | }
389 | /*------------------------------------*\
390 | #DEVELOPMENT | In development
391 | \*------------------------------------*/
392 | /**
393 | * This part is where unfinished code should stay.
394 | * When a feature is ready(sh) move these styles to their proper place.
395 | */
396 |
397 |
398 |
399 | /*------------------------------------*\
400 | #DEVELOPMENT | Debuggers
401 | \*------------------------------------*/
402 |
403 | /**
404 | * These are mainly helpers for development. They do not have to end up
405 | * in production but it's handy to keep them when developing.
406 | */
407 |
408 |
409 | /**
410 | * Apply this class to the html tag when developing the slide-in button
411 | */
412 |
--------------------------------------------------------------------------------
/test/unit.js:
--------------------------------------------------------------------------------
1 | /**
2 | * Currently there are no scripts along with this repo so no need to test anything.
3 | *
4 | **/
5 |
--------------------------------------------------------------------------------