
Parallax
23 |Parallax is an effect where the background content or image in this case, is moved at a different speed than the foreground content while scrolling.
24 |Parallax Demo HTML
27 |
28 | <div class="parallax-container">
29 | <div class="parallax"><img src="images/parallax1.jpg"></div>
30 | </div>
31 | <div class="section white">
32 | <div class="row container">
33 | <h2 class="header">Parallax</h2>
34 | <p class="grey-text text-darken-3 lighten-3">Parallax is an effect where the background content or image in this case, is moved at a different speed than the foreground content while scrolling.</p>
35 | </div>
36 | </div>
37 | <div class="parallax-container">
38 | <div class="parallax"><img src="images/parallax2.jpg"></div>
39 | </div>
40 |
41 | 
Breadcrumbs are a good way to display your current location. This is usually used when you have multiple layers of content.
12 |Basic
13 | 14 | 23 | 24 |25 |
26 | <nav>
27 | <div class="nav-wrapper">
28 | <div class="col s12">
29 | <a href="#!" class="breadcrumb">First</a>
30 | <a href="#!" class="breadcrumb">Second</a>
31 | <a href="#!" class="breadcrumb">Third</a>
32 | </div>
33 | </div>
34 | </nav>
35 |
36 | 37 |
Introduction
8 |9 | Chips can be used to represent small blocks of information. They are most commonly used either for contacts or for tags. 10 |
11 |
13 | Jane Doe
14 | Contacts
23 |24 | To create a contact chip just add an img inside. 25 |
26 |
27 | <div class="chip">
28 | <img src="images/yuna.jpg" alt="Contact Person">
29 | Jane Doe
30 | </div>
31 |
32 | Tags
36 |37 | To create a tag chip just add an close icon inside. 38 |
39 |
40 | <div class="chip">
41 | Tag
42 | <i class="material-icons">close</i>
43 | </div>
44 |
45 | 
Parallax
28 |Parallax is an effect where the background content or image in this case, is moved at a different speed than the foreground content while scrolling.
29 |Parallax Demo HTML
32 |
33 | <div class="parallax-container">
34 | <div class="parallax"><img src="images/parallax1.jpg"></div>
35 | </div>
36 | <div class="section white">
37 | <div class="row container">
38 | <h2 class="header">Parallax</h2>
39 | <p class="grey-text text-darken-3 lighten-3">Parallax is an effect where the background content or image in this case, is moved at a different speed than the foreground content while scrolling.</p>
40 | </div>
41 | </div>
42 | <div class="parallax-container">
43 | <div class="parallax"><img src="images/parallax2.jpg"></div>
44 | </div>
45 |
46 | 
Introduction
8 |Pushpin is our fixed positioning plugin. You can check out our live examples: the fixed Table of Contents on the right.
9 |jQuery Plugin Initialization
15 |
16 | $(document).ready(function(){
17 | $('.tabs-wrapper .row').pushpin({ top: $('.tabs-wrapper').offset().top });
18 | });
19 |
20 | jQuery Plugin Options
26 || Option Name | 30 |Description | 31 |
|---|---|
| Top | 37 |The distance in pixels from the top of the page where the element becomes fixed. (Default: 0) | 38 |
| Bottom | 41 |The distance in pixels from the top of the page where the elements stops being fixed. (Default: Infinity) | 42 |
| Offset | 45 |The offset from the top the element will be fixed at. (Default: 0) | 46 |
Introduction
9 |Parallax is an effect where the background content or image in this case, is moved at a different speed than the foreground content while scrolling. Check out the demo to get a better idea of it.
10 | Open Demo 11 |Parallax HTML Structure
17 |
18 | <div class="parallax-container">
19 | <div class="parallax"><img src="images/parallax1.jpg"></div>
20 | </div>
21 |
22 | Initialization
28 |
29 | $(document).ready(function(){
30 | $('.parallax').parallax();
31 | });
32 |
33 | Parallax Customization
39 |The parallax container height is what defines how much of the image can be seen. This is set to a default of 500px. You can add your own style to override this.
40 |
41 | .parallax-container {
42 | height: "your height here";
43 | }
44 |
45 | Introduction
8 |Scrollspy is a jQuery plugin that tracks certain elements and which element the user's screen is currently centered on. Our main demo of this is our table of contents on every documentation page to the right. Clicking on these links will also scroll the page to that element.
9 |Table of Contents Structure
13 |
14 | <div class="row">
15 | <div class="col s12 m9 l10">
16 | <div id="introduction" class="section scrollspy">
17 | <p>Content </p>
18 | </div>
19 |
20 | <div id="structure" class="section scrollspy">
21 | <p>Content </p>
22 | </div>
23 |
24 | <div id="initialization" class="section scrollspy">
25 | <p>Content </p>
26 | </div>
27 | </div>
28 | <div class="col hide-on-small-only m3 l2">
29 | <ul class="section table-of-contents">
30 | <li><a href="#introduction">Introduction</a></li>
31 | <li><a href="#structure">Structure</a></li>
32 | <li><a href="#initialization">Intialization</a></li>
33 | </ul>
34 | </div>
35 | </div>
36 |
37 | jQuery Plugin Initialization
43 |
44 | $(document).ready(function(){
45 | $('.scrollspy').scrollSpy();
46 | });
47 |
48 | In material design, everything should have a certain z-depth that determines how far raised or close to the page the element is.
8 |You can easily apply this shadow effect by adding a class="z-depth-2" to an HTML tag. Alternatively you can extend any of these shadows with Sass using @extend .z-depth-2. A z-depth-0 can be used to remove shadows from elements that have z-depths by default.
30 | <div class="col s12 m2">
31 | <p class="z-depth-1">z-depth-1</p>
32 | </div>
33 | <div class="col s12 m2">
34 | <p class="z-depth-2">z-depth-2</p>
35 | </div>
36 | <div class="col s12 m2">
37 | <p class="z-depth-3">z-depth-3</p>
38 | </div>
39 | <div class="col s12 m2">
40 | <p class="z-depth-4">z-depth-4</p>
41 | </div>
42 | <div class="col s12 m2">
43 | <p class="z-depth-5">z-depth-5</p>
44 | </div>
45 |
46 | Add pagination links to help split up your long content into shorter, easier to understand blocks.
12 |Basic
13 |-
14 |
- chevron_left 15 |
- 1 16 |
- 2 17 |
- 3 18 |
- 4 19 |
- 5 20 |
- 6 21 |
- 7 22 |
- 8 23 |
- 9 24 |
- chevron_right 25 |
27 |
28 | <ul class="pagination">
29 | <li class="disabled"><a href="#!"><i class="material-icons">chevron_left</i></a></li>
30 | <li class="active"><a href="#!">1</a></li>
31 | <li class="waves-effect"><a href="#!">2</a></li>
32 | <li class="waves-effect"><a href="#!">3</a></li>
33 | <li class="waves-effect"><a href="#!">4</a></li>
34 | <li class="waves-effect"><a href="#!">5</a></li>
35 | <li class="waves-effect"><a href="#!"><i class="material-icons">chevron_right</i></a></li>
36 | </ul>
37 |
38 | 39 |
We've made some custom animation functions that will transition your content. It's recommended to use this with our ScrollFire Plugin to make your content transition in as you scroll.
8 | 9 | 10 |showStaggeredList
11 |Use this to create a staggered reveal effect for any UL Tag with list items. Just make sure the list items in the UL are opacity: 0; to ensure the animation works correctly.
14 | <a href="#!" class="btn" onclick="Materialize.showStaggeredList('#staggered-test')">Click Me</a>
15 |
16 |
38 | fadeInImage
42 |Use this to fade in images. It also animates grayscale and brightness to give it a unique effect.
43 | Click Me 44 |
45 | <a href="#!" class="btn" onclick="Materialize.fadeInImage('#image-test')">Click Me</a>
46 |
47 |
48 |
6 | Here is some more information about this product that is only revealed once clicked on.
14 |
21 | Card Title
22 | I am a very simple card. I am good at containing small bits of information. 25 | I am convenient because I require little markup to use effectively.
26 |
39 | Card Title
40 | I am a very simple card. I am good at containing small bits of information. I am convenient because I require little markup to use effectively.
43 |
54 | Card Title
55 | I am a very simple card. I am good at containing small bits of information. I am convenient because I require little markup to use effectively.
58 |
69 | Card Title
70 | I am a very simple card. I am good at containing small bits of information. I am convenient because I require little markup to use effectively.
73 |2 | Filling up some content to enable scrolling 3 |
4 |5 | Lorem ipsum dolor sit amet, 6 | consectetur adipisicing elit, 7 | sed do eiusmod tempor incididunt 8 | ut labore et dolore magna aliqua. 9 | Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. 10 | Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum. 11 |
12 |13 | Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. 14 | Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. 15 | Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. 16 | Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum. 17 |
18 |-
19 |
-
20 |
List Item
21 |This is a description
22 |
23 | -
24 |
List Item
25 |This is a description
26 |
27 | -
28 |
List Item
29 |This is a description
30 |
31 | -
32 |
List Item
33 |This is a description
34 |
35 | -
36 |
List Item
37 |This is a description
38 |
39 | -
40 |
List Item
41 |This is a description
42 |
43 | -
44 |
List Item
45 |This is a description
46 |
47 | -
48 |
List Item
49 |This is a description
50 |
51 | -
52 |
List Item
53 |This is a description
54 |
55 | -
56 |
List Item
57 |This is a description
58 |
59 | -
60 |
List Item
61 |This is a description
62 |
63 | -
64 |
List Item
65 |This is a description
66 |
67 | -
68 |
List Item
69 |This is a description
70 |
71 | -
72 |
List Item
73 |This is a description
74 |
75 | -
76 |
List Item
77 |This is a description
78 |
79 | -
80 |
List Item
81 |This is a description
82 |
83 | -
84 |
List Item
85 |This is the element right above the scroll zone
86 |
87 |
-
89 |
-
90 |
Test List Item
91 |This is a description
92 |
93 | -
94 |
Test List Item
95 |This is a description
96 |
97 | -
98 |
Test List Item
99 |This is a description
100 |
101 | -
102 |
Test List Item
103 |This is a description
104 |
105 | -
106 |
Test List Item
107 |This is a description
108 |
109 |
Testing
32 |33 |
Testing
34 |35 |
Testing
36 |37 |
Testing
38 |39 |
Testing
40 |41 |
Testing
42 |43 |
Testing
44 |45 |
Testing
46 |47 |
Testing
48 |49 |
Testing
50 |51 |
Testing
52 |53 |
Testing
54 |55 |
Testing
56 |57 |
Testing
58 |59 |
Testing
60 |61 |
Testing
62 |63 |
Testing
64 |65 |
Testing
66 |67 |
Testing
68 |69 |
Testing
70 |71 |
Testing
72 |73 |
Testing
74 |75 |
Testing
76 |77 |
Testing
78 |79 |
Testing
80 |81 |
Testing
82 |83 |
Testing
84 |85 |
Testing
86 |87 |
Testing
88 |89 |
Testing
90 |91 |
Testing
92 |93 |
Testing
94 |95 |
Testing
96 |97 |
Testing
98 |99 |
Testing
100 |101 |
Testing
102 |103 | 104 | 105 | 106 | 107 | 108 | 109 | 120 | 121 | 122 | 123 | 124 | 125 | 138 | 139 | -------------------------------------------------------------------------------- /sass/components/forms/_range.scss: -------------------------------------------------------------------------------- 1 | /* Range 2 | ========================================================================== */ 3 | 4 | .range-field { 5 | position: relative; 6 | } 7 | 8 | input[type=range], 9 | input[type=range] + .thumb { 10 | @extend .no-select; 11 | cursor: pointer; 12 | } 13 | 14 | input[type=range] { 15 | position: relative; 16 | background-color: transparent; 17 | border: none; 18 | outline: none; 19 | width: 100%; 20 | margin: 15px 0; 21 | padding: 0; 22 | 23 | &:focus { 24 | outline: none; 25 | } 26 | } 27 | 28 | input[type=range] + .thumb { 29 | position: absolute; 30 | border: none; 31 | height: 0; 32 | width: 0; 33 | border-radius: 50%; 34 | background-color: $radio-fill-color; 35 | top: 10px; 36 | margin-left: -6px; 37 | 38 | transform-origin: 50% 50%; 39 | transform: rotate(-45deg); 40 | 41 | .value { 42 | display: block; 43 | width: 30px; 44 | text-align: center; 45 | color: $radio-fill-color; 46 | font-size: 0; 47 | transform: rotate(45deg); 48 | } 49 | 50 | &.active { 51 | border-radius: 50% 50% 50% 0; 52 | 53 | .value { 54 | color: $input-background; 55 | margin-left: -1px; 56 | margin-top: 8px; 57 | font-size: 10px; 58 | } 59 | } 60 | } 61 | 62 | // WebKit 63 | input[type=range] { 64 | -webkit-appearance: none; 65 | } 66 | 67 | input[type=range]::-webkit-slider-runnable-track { 68 | height: $track-height; 69 | background: #c2c0c2; 70 | border: none; 71 | } 72 | 73 | input[type=range]::-webkit-slider-thumb { 74 | -webkit-appearance: none; 75 | border: none; 76 | height: $range-height; 77 | width: $range-width; 78 | border-radius: 50%; 79 | background-color: $radio-fill-color; 80 | transform-origin: 50% 50%; 81 | margin: -5px 0 0 0; 82 | transition: .3s; 83 | } 84 | 85 | input[type=range]:focus::-webkit-slider-runnable-track { 86 | background: #ccc; 87 | } 88 | 89 | // FireFox 90 | input[type=range] { 91 | /* fix for FF unable to apply focus style bug */ 92 | border: 1px solid white; 93 | 94 | /*required for proper track sizing in FF*/ 95 | } 96 | 97 | input[type=range]::-moz-range-track { 98 | height: $track-height; 99 | background: #ddd; 100 | border: none; 101 | } 102 | 103 | input[type=range]::-moz-range-thumb { 104 | border: none; 105 | height: $range-height; 106 | width: $range-width; 107 | border-radius: 50%; 108 | background: $radio-fill-color; 109 | margin-top: -5px; 110 | } 111 | 112 | // hide the outline behind the border 113 | input[type=range]:-moz-focusring { 114 | outline: 1px solid #fff; 115 | outline-offset: -1px; 116 | } 117 | 118 | input[type=range]:focus::-moz-range-track { 119 | background: #ccc; 120 | } 121 | 122 | // IE 10+ 123 | input[type=range]::-ms-track { 124 | height: $track-height; 125 | 126 | // remove bg colour from the track, we'll use ms-fill-lower and ms-fill-upper instead 127 | background: transparent; 128 | 129 | // leave room for the larger thumb to overflow with a transparent border */ 130 | border-color: transparent; 131 | border-width: 6px 0; 132 | 133 | /*remove default tick marks*/ 134 | color: transparent; 135 | } 136 | 137 | input[type=range]::-ms-fill-lower { 138 | background: #777; 139 | } 140 | 141 | input[type=range]::-ms-fill-upper { 142 | background: #ddd; 143 | } 144 | 145 | input[type=range]::-ms-thumb { 146 | border: none; 147 | height: $range-height; 148 | width: $range-width; 149 | border-radius: 50%; 150 | background: $radio-fill-color; 151 | } 152 | 153 | input[type=range]:focus::-ms-fill-lower { 154 | background: #888; 155 | } 156 | 157 | input[type=range]:focus::-ms-fill-upper { 158 | background: #ccc; 159 | } 160 | -------------------------------------------------------------------------------- /sass/components/_navbar.scss: -------------------------------------------------------------------------------- 1 | nav { 2 | color: $navbar-font-color; 3 | @extend .z-depth-1; 4 | background-color: $primary-color; 5 | width: 100%; 6 | height: $navbar-height-mobile; 7 | line-height: $navbar-height-mobile; 8 | 9 | a { color: $navbar-font-color; } 10 | 11 | i, 12 | [class^="mdi-"], [class*="mdi-"], 13 | i.material-icons { 14 | display: block; 15 | font-size: 2rem; 16 | height: $navbar-height-mobile; 17 | line-height: $navbar-height-mobile; 18 | } 19 | 20 | .nav-wrapper { 21 | position: relative; 22 | height: 100%; 23 | } 24 | 25 | @media #{$large-and-up} { 26 | a.button-collapse { display: none; } 27 | } 28 | 29 | 30 | // Collapse button 31 | .button-collapse { 32 | float: left; 33 | position: relative; 34 | z-index: 1; 35 | height: $navbar-height-mobile; 36 | 37 | i { 38 | font-size: 2.7rem; 39 | height: $navbar-height-mobile; 40 | line-height: $navbar-height-mobile; 41 | } 42 | } 43 | 44 | 45 | // Logo 46 | .brand-logo { 47 | position: absolute; 48 | color: $navbar-font-color; 49 | display: inline-block; 50 | font-size: $navbar-brand-font-size; 51 | padding: 0; 52 | white-space: nowrap; 53 | 54 | &.center { 55 | left: 50%; 56 | transform: translateX(-50%); 57 | } 58 | 59 | @media #{$medium-and-down} { 60 | left: 50%; 61 | transform: translateX(-50%); 62 | 63 | &.left, &.right { 64 | padding: 0; 65 | transform: none; 66 | } 67 | 68 | &.left { left: 0.5rem; } 69 | &.right { 70 | right: 0.5rem; 71 | left: auto; 72 | } 73 | } 74 | 75 | &.right { 76 | right: 0.5rem; 77 | padding: 0; 78 | } 79 | } 80 | 81 | 82 | // Navbar Links 83 | ul { 84 | margin: 0; 85 | 86 | li { 87 | transition: background-color .3s; 88 | float: left; 89 | padding: 0; 90 | 91 | &.active { 92 | background-color: rgba(0,0,0,.1); 93 | } 94 | } 95 | a { 96 | transition: background-color .3s; 97 | font-size: 1rem; 98 | color: $navbar-font-color; 99 | display: inline-block; 100 | padding: 0 15px; 101 | cursor: pointer; 102 | 103 | &.btn, &.btn-large, &.btn-flat, &.btn-floating { 104 | margin-top: -2px; 105 | margin-left: 15px; 106 | margin-right: 15px; 107 | } 108 | 109 | &:hover { 110 | background-color: rgba(0,0,0,.1); 111 | } 112 | } 113 | 114 | &.left { 115 | float: left; 116 | } 117 | } 118 | 119 | // Navbar Search Form 120 | .input-field { 121 | margin: 0; 122 | 123 | input { 124 | height: 100%; 125 | font-size: 1.2rem; 126 | border: none; 127 | padding-left: 2rem; 128 | 129 | &:focus, &[type=text]:valid, &[type=password]:valid, 130 | &[type=email]:valid, &[type=url]:valid, &[type=date]:valid { 131 | border: none; 132 | box-shadow: none; 133 | } 134 | } 135 | label { 136 | top: 0; 137 | left: 0; 138 | 139 | i { 140 | color: rgba(255,255,255,.7); 141 | transition: color .3s; 142 | } 143 | &.active i { color: $navbar-font-color; } 144 | &.active { 145 | transform: translateY(0); 146 | } 147 | } 148 | 149 | } 150 | 151 | } 152 | 153 | // Fixed Navbar 154 | .navbar-fixed { 155 | position: relative; 156 | height: $navbar-height-mobile; 157 | z-index: 998; 158 | 159 | nav { 160 | position: fixed; 161 | } 162 | } 163 | @media #{$medium-and-up} { 164 | nav, nav .nav-wrapper i, nav a.button-collapse, nav a.button-collapse i { 165 | height: $navbar-height; 166 | line-height: $navbar-height; 167 | } 168 | .navbar-fixed { 169 | height: $navbar-height; 170 | } 171 | } 172 | -------------------------------------------------------------------------------- /tests/spec/collapsible/collapsibleSpec.js: -------------------------------------------------------------------------------- 1 | describe( "Collapsible Plugin", function () { 2 | var collapsible, accordion; 3 | 4 | beforeEach(function() { 5 | loadFixtures('collapsible/collapsible.html'); 6 | collapsible = $('.collapsible'); 7 | accordion = $('.accordion'); 8 | popout = $('.popout'); 9 | collapsible.collapsible(); 10 | }); 11 | 12 | describe( "collapsible", function () { 13 | 14 | it("should open all items, keeping all open", function () { 15 | // Collapsible body height should be 0 on start when hidden. 16 | var headers = collapsible.find('.collapsible-header'); 17 | var bodies = collapsible.find('.collapsible-body'); 18 | 19 | bodies.each(function() { 20 | expect($(this)).toBeHidden('because collapsible bodies should be hidden initially.'); 21 | }); 22 | 23 | // Collapsible body height should be > 0 after being opened. 24 | headers.each(function() { 25 | $(this).click(); 26 | }); 27 | bodies.each(function() { 28 | expect($(this)).toBeVisible('because collapsible bodies not visible after being opened.'); 29 | }); 30 | }); 31 | }); 32 | 33 | describe( "accordion", function () { 34 | 35 | it("should open first and second items, keeping only second open", function (done) { 36 | // Collapsible body height should be 0 on start when hidden. 37 | var firstHeader = accordion.find('.collapsible-header').first(); 38 | var firstBody = accordion.find('.collapsible-body').first(); 39 | var secondHeader = accordion.find('.collapsible-header').eq(1); 40 | var secondBody = accordion.find('.collapsible-body').eq(1); 41 | expect(firstBody).toBeHidden('because accordion bodies should be hidden initially.'); 42 | expect(secondBody).toBeHidden('because accordion bodies should be hidden initially.'); 43 | 44 | // Collapsible body height should be > 0 after being opened. 45 | firstHeader.click(); 46 | 47 | setTimeout(function() { 48 | expect(firstBody).toBeVisible('because accordion bodies not visible after being opened.'); 49 | secondHeader.click(); 50 | 51 | setTimeout(function() { 52 | expect(firstBody).toBeHidden('because accordion bodies should be hidden when another item is opened.'); 53 | expect(secondBody).toBeVisible('because accordion bodies not visible after being opened.'); 54 | done(); 55 | }, 400); 56 | }, 200); 57 | 58 | }); 59 | }); 60 | 61 | describe( "popout", function () { 62 | 63 | it("should open first and popout", function (done) { 64 | // Collapsible body height should be 0 on start when hidden. 65 | var firstLi = popout.find('li').first(); 66 | var firstHeader = popout.find('.collapsible-header').first(); 67 | var firstBody = popout.find('.collapsible-body').first(); 68 | expect(firstBody).toBeHidden('because accordion bodies should be hidden initially.'); 69 | 70 | // Expect margin to be > 0 because not popped out. 71 | popout.find('li').each(function () { 72 | var marginLeft = parseInt($(this).css('margin-left')); 73 | var marginRight = parseInt($(this).css('margin-right')); 74 | expect(marginLeft).toBeGreaterThan(0, 'because closed popout items should have horizontal margins.'); 75 | expect(marginRight).toBeGreaterThan(0, 'because closed popout items should have horizontal margins.'); 76 | }); 77 | 78 | // expect margin to be 0 because popped out. 79 | firstHeader.click(); 80 | setTimeout(function() { 81 | var firstMarginLeft = parseInt(firstLi.css('margin-left')); 82 | var firstMarginRight = parseInt(firstLi.css('margin-right')); 83 | expect(firstMarginLeft).toEqual(0, 'because opened popout items should have no horizontal margins.'); 84 | expect(firstMarginRight).toEqual(0, 'because opened popout items should have no horizontal margins.'); 85 | expect(firstBody).toBeVisible('because accordion bodies not visible after being opened.'); 86 | 87 | done(); 88 | }, 400); 89 | 90 | }); 91 | }); 92 | }); 93 | --------------------------------------------------------------------------------
13 |
14 |
22 |
23 | 