modified build compile process

This commit is contained in:
Alicia Sykes
2017-03-05 12:44:51 +00:00
parent 9812f12a8a
commit fa8951171d
274 changed files with 3 additions and 71627 deletions

View File

@@ -8,6 +8,7 @@ var concat = require('gulp-concat');
var uglify = require('gulp-uglify');
var sass = require('gulp-sass');
var cleanCSS= require('gulp-clean-css');
var bower = require('gulp-bower');
// Compile Jade views into HTML
gulp.task('views', function() {
@@ -65,12 +66,13 @@ gulp.task('test', function(){
// Delete production files
gulp.task('clean', function () {
return del([ 'production/*.html', 'production/css/**/*', 'production/js/**/*', 'production/assets/**/*' ]);
return del([ 'production' ]);
});
// Build complete project
gulp.task('build', ['clean'], function(){
bower('./production/bower_components');
gulp.start('views', 'coffee', 'sass', 'assets');
gutil.beep(); // Delete this line if you don't like the sound effects!
});

Binary file not shown.

Before

Width:  |  Height:  |  Size: 467 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.2 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 70 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 111 KiB

View File

@@ -1,56 +0,0 @@
{
"name": "materialize",
"description": "A modern responsive front-end framework based on Material Design",
"keywords": [
"css",
"js",
"sass",
"mobile-first",
"responsive",
"front-end",
"framework",
"ux",
"material",
"design"
],
"main": [
"bin/materialize.css",
"bin/materialize.js"
],
"ignore": [
"jade/",
".gitignore",
"CNAME",
"css/",
"bower.json",
"README.md",
"images/",
"js/jquery.timeago.js",
"js/init.js",
"js/prism.js",
"res/",
"sass/style.scss",
"sass/ghpages-materialize.scss",
"**/*.html",
"**/*.zip",
"**/*.txt",
"sitemap.xml",
"package.json",
"Gruntfile.js"
],
"dependencies": {
"jquery": ">=2.1.1"
},
"devDependencies": {},
"homepage": "https://github.com/Dogfalo/materialize",
"version": "0.97.7",
"_release": "0.97.7",
"_resolution": {
"type": "version",
"tag": "v0.97.7",
"commit": "2e1dc18181c44dcef1058368a5fd4fb50216339a"
},
"_source": "https://github.com/Dogfalo/materialize.git",
"_target": "~0.97.6",
"_originalSource": "materialize"
}

View File

@@ -1,12 +0,0 @@
root = true
[*.{js,scss}]
indent_style = space
indent_size = 2
end_of_line = lf
charset = utf-8
trim_trailing_whitespace = true
insert_final_newline = true
[*.md]
trim_trailing_whitespace = false

View File

@@ -1,6 +0,0 @@
* text=auto
**/*.html linguist-documentation
js/velocity.min.js linguist-vendored
js/hammer.min.js linguist-vendored
js/jquery.easing.1.3.js linguist-vendored
js/jquery.timeago.min.js linguist-vendored

View File

@@ -1,8 +0,0 @@
images/
.sass-cache/
.grunt/
.DS_Store
prepros.cfg
Thumbs.db
.projectile
**/*.log

View File

@@ -1,7 +0,0 @@
language: node_js
node_js:
- "0.12"
before_install:
- npm install -g grunt-cli
git:
depth: 10

View File

@@ -1,152 +0,0 @@
## v0.97.3 (Nov 15, 2015)
- Meteor font issues fixed
- Select rendering issue fixed
- Added Push and Pull to grid
- Dynamic accordion appends fixed
## v0.97.2 (Nov 8, 2015)
- Image support inside select
- Optgroup supported in select
- Multiple select added
- Card styling fixes
- Breadcrumbs added
- Scrollable tabs
- Tooltips and dropdowns position themselves more intelligently inside the window
- FAB menu is click-toggleable
- Horizontal FAB support added
## v0.97.1 (Sep 13, 2015)
- Added new range slider with uses noUiSlider to provide powerful options
- Added CSS for Chips
- Toasts support adding of html elements
- Fixed select destroy/creation bug
- Bugfixes for dropdown, badges, collections, scrollfire
- Added default preloader color variable
- File input now supports multiple files and dynamically loaded elements
## v0.97.0 (June 21, 2015)
- **Documentation changed to use Official Google Icon web font**
- **Input errors added**
- Flicker on Firefox on dropdowns fixed
- Pagination made more responsive
- Modal now prevents scrolling
- Modal animation added
- Support for multiple modals added
- Programmatic control of FAB to open/close added
- Programmatic control of slider to play/pause added
- Plus many more bug fixes
## v0.96.0 (April 1, 2015)
- Toasts, transitions, scrollfire added under Materialize namespace
- Dropdown is now created as a child of its parent
- Collapsibles supports nesting
- Modal Bottom Sheet added
- Indeterminate Checkboxes added
- New Checkbox Style added
- Text Inputs supports placeholder/readonly
- Google Inbox-like Collapsible added
- Text Character Counter added
- Waves no longer breaks on SVGs
## v0.95.3 (Feb 25, 2015)
- Parallax image loading / responsiveness fixes
- Date picker supports month/year as dropdown
- Dismissable collection items
- Avatar collection items
- Pagination Added
- ScrollFire fixes
## v0.95.2 (Feb 10, 2015)
- Switches added
- Transition animation functions added
- ScrollFire Plugin added (fires functions dependent on scroll position)
- Responsive Video tag added
- Custom File Input Button added
- Modals has a fixed footer option
- SideNav implementation changed (needs 2 UL menus)
- Slider Responsive Fixes
## v0.95.1 (Jan 26, 2015)
- Sidenav Fixes
- Dropdown alignment/gutter options added
- Parallax fixes
- JavaScript Initialization no longer needed for many components
- HTML options through data-attributes
- Site colors can be defined through Primary and Secondary color in Sass
- Tables no longer resonsive by default
## v0.95.0 (Jan 17, 2015)
- Drag Out Menu fixed with Touch Interactions
- Toasts minor bugfix
- OL element has default styling
- Fullscreen Slider added
- Footer requires page-footer class
- Progress Bars added
- Form autofill support added
- Responsive Tables support added
- Scrollspy Plugin released
- Waves events are now delegated / behavior enhanced
## v0.94.0 (Dec 30, 2014)
- Sidenav supports right edge positioning
- Responsive Embeds
- Image Vertical align classes
- border-box added
- Variable file created
- Pushpin added
- Tooltips support all directions
- Layout helper classes added
- Materialbox Fixes
- Form Element Enhancements
- Navbar supports search bar
- Waves fixes
- Materialbox Captions
- Image Slider Fixes
## v0.93.1 (Dec 20, 2014)
- Flexbox Sticky Footer removed due to IE incompatibility
## v0.93.0 (Dec 19, 2014)
- Card Reveal
- Image Slider
- Dynamically loaded forms work correctly
- Badges added
- Circular Image
- Waves Fixes
- Footer Added
- Toast support Custom HTML
- Modals support programmatic opening/closing
- Responsive Image support
## v0.92.1 (Dec 14, 2014)
- Bower semver fix
- Added new radio button style
## v0.92.0 (Dec 13, 2014)
- Clicking icon in dropdown in navbar no longer closes dropdown immediately
- Multiple select inputs now work properly
- Mobile navbar no longer extends past screen width
- Parallax improved
- Modal restructured / can be opened programmatically
- Callbacks added to modals
- Added dist folder to repo
- Cards restructured
## v0.91 (Dec 3, 2014)
- bug fixes to forms
- added waves color classes
- toast thickened to look better on mobile
- many other bug fixes
## v0.9 (Nov 30, 2014)
- Touch interactions added
- tons more...

View File

@@ -1,93 +0,0 @@
## Contributing
- Compiling Files
- `npm install`
- `grunt monitor`, this will compile .scss, .js., .jade files
- Documentation
- If you notice an error in the documentation, please edit the corresponding .html page under jade/page-contents/.
- Issues
- If you have an issue please make sure you document the problems in depth.
- Create screenshots of your issue and include a [Codepen](http://codepen.io/Dogfalo/pen/xbzPQV) of the problem where applicable
- Unclear issues with little explanations will be closed.
- Issues without a Codepen (where applicable) will be closed or ignored.
- Feature Requests
- We like feature requests but make sure that it can be seen within the goals of the project and not just something you need individually. Also you should try and give as much examples and details about the new feature as possible.
- Code Examples
- Use this [Codepen](http://codepen.io/Dogfalo/pen/xbzPQV) to illustrate your problem.
## Contribution 101
- Fork this repo to your own git
- Make your changes
- Submit a pull request with full remarks documenting your changes
- Pull request MAY then be accepted by project creators
## Jasmine Testing Guide
**References:**
- [Jasmine Documentation](http://jasmine.github.io/2.0/introduction.html)
- [Grunt Jasmine Plugin](https://github.com/gruntjs/grunt-contrib-jasmine)
- [Example Jasmine Tests](https://github.com/Dogfalo/materialize/tree/master/tests/spec)
- [Travis CI](https://travis-ci.org/Dogfalo/materialize)
Before you start, make sure you install grunt and all its dependencies. To verify you have all the correct dependencies you can run `grunt travis` and it will run the tests. If you get an errors and have not made any changes, it means you have not installed the proper dependencies.
Materialize uses Jasmine as the testing framework. We also include a jQuery library which allows you to write tests using jQuery syntax.
### Starting Out
First to familiarize yourself with how the tests are structured, you can take a look inside the `tests/` directory. Each component should have its own folder. Follow the file-naming conventions that are used in the existing tests.
Before writing tests, make sure you are working off of a clean git branch of your fork. This will greatly simplify the Pull Request process.
### Writing Tests
Before writing tests, make sure you understand what the expected-behavior of the component actually is. Reading over the component code and documentation will greatly aid you in this regard.
Use `describe` blocks to section disparate portions of tests and `it` blocks inside those to further break up tests into features. Inside `it` blocks, you can have multiple except statements. As a general testing principle, be sure to try and test both the case and its “inverse” to lessen the chance for false positives.
Example:
```javascript
expect(toast.first('span').text()).toBe('I am toast content');
expect(toast.first('span').text()).not.toBe('I am toast');
```
You can use beforeEach, and afterEach in either block to designate code that will execute before or after each item. This is useful if you need to setup some scenario for each test, or reset some things after each test.
When writing expect statements (Jasmines form of assert), it is very important to write an expected behavior string so in the event of an error, the test that failed is very clear.
Example:
```javascript
expect(toast.length).toBe(0, 'because toast should be removed by now');
```
When this expect statement fails it will list the reason as “because toast should be removed by now”.
Because our components are very front end heavy, familiarize yourself with jQuery ways of interacting with the dom and our components. You can use methods like [trigger](http://api.jquery.com/trigger/), to simulate certain events like the user clicking a button.
We also understand that testing CSS properties is pretty tough so youll have to be creative when writing good tests that ensure the styling is still working. Try and cover as many cases as you can but dont worry if there are some edge cases. You can add comments describing some problematic edge cases in TODOs so we know about them.
### Submitting Your Pull Request
Try and keep your commit history clean and concise. Once you submit your pull request, [Travis CI](https://travis-ci.org/Dogfalo/materialize) will automatically run your tests and will show a checkmark to show that all the tests have passed. Once this is done, well review your tests and code and make comments if there are issues or things we think could be improved. Then once everything looks good well merge the code in!
### Useful Jasmine Tips
1. To only run a specific spec at a time, to avoid wasting your time running all our other tests, you can set the flag `--filter`. For example:
```
`grunt travis --filter=tabs`
```
This would only run specs with tabs in its name.
2. If you need a timeout in your test (waiting for some animation or action to be executed) you need to use the done callback. In your `it()` behavior function set done as an argument to your anonymous function. Then you can use javascripts window `setTimeout`s normally. And when you want the test to finish just call the `done()` function. For example:
```javascript
it ('should wait for a timeout', function(done) {
// Execute action
timeout(setTimeout(function() {
// Wait a second
// Test for result
done();
}, 1000);
});
```
**Note:** If you add done as a callback, and you dont call the `done()` function, it will stall forever and error after a max limit of around 5 seconds.

View File

@@ -1,21 +0,0 @@
The MIT License (MIT)
Copyright (c) 2014-2016 Materialize
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.

File diff suppressed because it is too large Load Diff

File diff suppressed because one or more lines are too long

View File

@@ -1,46 +0,0 @@
{
"name": "materialize",
"description": "A modern responsive front-end framework based on Material Design",
"keywords": [
"css",
"js",
"sass",
"mobile-first",
"responsive",
"front-end",
"framework",
"ux",
"material",
"design"
],
"main": [
"bin/materialize.css",
"bin/materialize.js"
],
"ignore": [
"jade/",
".gitignore",
"CNAME",
"css/",
"bower.json",
"README.md",
"images/",
"js/jquery.timeago.js",
"js/init.js",
"js/prism.js",
"res/",
"sass/style.scss",
"sass/ghpages-materialize.scss",
"**/*.html",
"**/*.zip",
"**/*.txt",
"sitemap.xml",
"package.json",
"Gruntfile.js"
],
"dependencies": {
"jquery": ">=2.1.1"
},
"devDependencies": {
}
}

File diff suppressed because it is too large Load Diff

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@@ -1,259 +0,0 @@
/*!
* Materialize v0.97.6 (http://materializecss.com)
* Copyright 2014-2015 Materialize
* MIT License (https://raw.githubusercontent.com/Dogfalo/materialize/master/LICENSE)
*/
/* Functional styling;
* These styles are required for noUiSlider to function.
* You don't need to change these rules to apply your design.
*/
.noUi-target,
.noUi-target * {
-webkit-touch-callout: none;
-webkit-user-select: none;
-ms-touch-action: none;
-ms-user-select: none;
-moz-user-select: none;
-moz-box-sizing: border-box;
box-sizing: border-box;
}
.noUi-target {
position: relative;
direction: ltr;
}
.noUi-base {
width: 100%;
height: 100%;
position: relative;
z-index: 1; /* Fix 401 */
}
.noUi-origin {
position: absolute;
right: 0;
top: 6px;
left: 0;
bottom: 0;
}
.noUi-handle {
position: relative;
z-index: 1;
}
.noUi-stacking .noUi-handle {
/* This class is applied to the lower origin when
its values is > 50%. */
z-index: 10;
}
.noUi-state-tap .noUi-origin {
-webkit-transition: left 0.25s, top 0.25s;
transition: left 0.25s, top 0.25s;
}
.noUi-state-drag * {
cursor: inherit !important;
}
/* Painting and performance;
* Browsers can paint handles in their own layer.
*/
.noUi-base {
-webkit-transform: translate3d(0,0,0);
transform: translate3d(0,0,0);
}
/* Slider size and handle placement;
*/
.noUi-horizontal {
height: 18px;
}
.noUi-horizontal .noUi-handle {
width: 34px;
height: 28px;
left: -17px;
top: -6px;
}
.noUi-vertical {
width: 18px;
}
.noUi-vertical .noUi-handle {
width: 28px;
height: 34px;
left: -6px;
top: -17px;
}
/* Styling;
*/
.noUi-background {
background: #FAFAFA;
box-shadow: inset 0 1px 1px #f0f0f0;
}
.noUi-connect {
background: #3FB8AF;
box-shadow: inset 0 0 3px rgba(51,51,51,0.45);
-webkit-transition: background 450ms;
transition: background 450ms;
}
.noUi-origin {
border-radius: 2px;
}
.noUi-target {
border-radius: 4px;
border: 1px solid #D3D3D3;
box-shadow: inset 0 1px 1px #F0F0F0, 0 3px 6px -5px #BBB;
}
.noUi-target.noUi-connect {
box-shadow: inset 0 0 3px rgba(51,51,51,0.45), 0 3px 6px -5px #BBB;
}
/* Handles and cursors;
*/
.noUi-dragable {
cursor: w-resize;
}
.noUi-vertical .noUi-dragable {
cursor: n-resize;
}
.noUi-handle {
border: 1px solid #D9D9D9;
border-radius: 3px;
background: #FFF;
cursor: default;
box-shadow: inset 0 0 1px #FFF,
inset 0 1px 7px #EBEBEB,
0 3px 6px -3px #BBB;
}
.noUi-active {
box-shadow: inset 0 0 1px #FFF,
inset 0 1px 7px #DDD,
0 3px 6px -3px #BBB;
}
/* Handle stripes;
*/
.noUi-handle:before,
.noUi-handle:after {
content: "";
display: block;
position: absolute;
height: 14px;
width: 1px;
background: #E8E7E6;
left: 14px;
top: 6px;
}
.noUi-handle:after {
left: 17px;
}
.noUi-vertical .noUi-handle:before,
.noUi-vertical .noUi-handle:after {
width: 14px;
height: 1px;
left: 6px;
top: 14px;
}
.noUi-vertical .noUi-handle:after {
top: 17px;
}
/* Disabled state;
*/
[disabled].noUi-connect,
[disabled] .noUi-connect {
background: #B8B8B8;
}
[disabled].noUi-origin,
[disabled] .noUi-handle {
cursor: not-allowed;
}
/*Materialize Theming*/
.noUi-target {
box-shadow: none;
border: none;
}
.noUi-base {
height: 15px;
top: -6px;
}
.noUi-background {
height: 3px;
top: 6px;
background-color: #bfbfbf;
box-shadow: none;
}
.noUi-horizontal {
height: 3px;
}
.noUi-connect {
height: 3px;
top: 6px;
background-color: #26A69A;
box-shadow: none;
}
/*Handle*/
.noUi-horizontal .noUi-handle {
width: 15px;
height: 15px;
border-radius: 50%;
box-shadow: none;
background-color: #26A69A;
border: none;
left: -5px;
top: -6px;
transition: width .2s cubic-bezier(0.215, 0.610, 0.355, 1.000),
height .2s cubic-bezier(0.215, 0.610, 0.355, 1.000),
left .2s cubic-bezier(0.215, 0.610, 0.355, 1.000),
top .2s cubic-bezier(0.215, 0.610, 0.355, 1.000);
}
.noUi-handle:before {
content: none;
}
.noUi-handle:after {
content: none;
}
/*Handle on Drag*/
.noUi-target .noUi-active.noUi-handle {
width: 3px;
height: 3px;
left: 0;
top: 0;
}
.noUi-target .noUi-active .range-label span {
}
.noUi-target .range-label {
position: absolute;
height: 30px;
width: 30px;
top: -17px;
left: -2px;
background-color: #26A69A;
border-radius: 50%;
transition: border-radius .25s cubic-bezier(0.215, 0.610, 0.355, 1.000),
transform .25s cubic-bezier(0.215, 0.610, 0.355, 1.000);
transform: scale(.5) rotate(-45deg);
transform-origin: 50% 100%;
}
.noUi-target .noUi-active .range-label {
border-radius: 15px 15px 15px 0;
transform: rotate(-45deg) translate(23px, -25px);
}
.range-label span {
width: 100%;
text-align: center;
color: #fff;
font-size: 12px;
transform: rotate(45deg);
opacity: 0;
position: absolute;
top: 7px;
left: -1px;
transition: opacity .25s cubic-bezier(0.215, 0.610, 0.355, 1.000);
}
.noUi-active .range-label span {
opacity: 1;
}

File diff suppressed because it is too large Load Diff

File diff suppressed because one or more lines are too long

View File

@@ -1,9 +0,0 @@
// Custom Easing
jQuery.extend( jQuery.easing,
{
easeInOutMaterial: function (x, t, b, c, d) {
if ((t/=d/2) < 1) return c/2*t*t + b;
return c/4*((t-=2)*t*t + 2) + b;
}
});

View File

@@ -1,91 +0,0 @@
(function ($) {
$(document).ready(function() {
// jQuery reverse
$.fn.reverse = [].reverse;
// Hover behaviour: make sure this doesn't work on .click-to-toggle FABs!
$(document).on('mouseenter.fixedActionBtn', '.fixed-action-btn:not(.click-to-toggle)', function(e) {
var $this = $(this);
openFABMenu($this);
});
$(document).on('mouseleave.fixedActionBtn', '.fixed-action-btn:not(.click-to-toggle)', function(e) {
var $this = $(this);
closeFABMenu($this);
});
// Toggle-on-click behaviour.
$(document).on('click.fixedActionBtn', '.fixed-action-btn.click-to-toggle > a', function(e) {
var $this = $(this);
var $menu = $this.parent();
if ($menu.hasClass('active')) {
closeFABMenu($menu);
} else {
openFABMenu($menu);
}
});
});
$.fn.extend({
openFAB: function() {
openFABMenu($(this));
},
closeFAB: function() {
closeFABMenu($(this));
}
});
var openFABMenu = function (btn) {
$this = btn;
if ($this.hasClass('active') === false) {
// Get direction option
var horizontal = $this.hasClass('horizontal');
var offsetY, offsetX;
if (horizontal === true) {
offsetX = 40;
} else {
offsetY = 40;
}
$this.addClass('active');
$this.find('ul .btn-floating').velocity(
{ scaleY: ".4", scaleX: ".4", translateY: offsetY + 'px', translateX: offsetX + 'px'},
{ duration: 0 });
var time = 0;
$this.find('ul .btn-floating').reverse().each( function () {
$(this).velocity(
{ opacity: "1", scaleX: "1", scaleY: "1", translateY: "0", translateX: '0'},
{ duration: 80, delay: time });
time += 40;
});
}
};
var closeFABMenu = function (btn) {
$this = btn;
// Get direction option
var horizontal = $this.hasClass('horizontal');
var offsetY, offsetX;
if (horizontal === true) {
offsetX = 40;
} else {
offsetY = 40;
}
$this.removeClass('active');
var time = 0;
$this.find('ul .btn-floating').velocity("stop", true);
$this.find('ul .btn-floating').velocity(
{ opacity: "0", scaleX: ".4", scaleY: ".4", translateY: offsetY + 'px', translateX: offsetX + 'px'},
{ duration: 80 }
);
};
}( jQuery ));

View File

@@ -1,26 +0,0 @@
(function ($) {
$(document).ready(function() {
$(document).on('click.card', '.card', function (e) {
if ($(this).find('> .card-reveal').length) {
if ($(e.target).is($('.card-reveal .card-title')) || $(e.target).is($('.card-reveal .card-title i'))) {
// Make Reveal animate down and display none
$(this).find('.card-reveal').velocity(
{translateY: 0}, {
duration: 225,
queue: false,
easing: 'easeInOutQuad',
complete: function() { $(this).css({ display: 'none'}); }
}
);
}
else if ($(e.target).is($('.card .activator')) ||
$(e.target).is($('.card .activator i')) ) {
$(e.target).closest('.card').css('overflow', 'hidden');
$(this).find('.card-reveal').css({ display: 'block'}).velocity("stop", false).velocity({translateY: '-100%'}, {duration: 300, queue: false, easing: 'easeInOutQuad'});
}
}
});
});
}( jQuery ));

View File

@@ -1,454 +0,0 @@
(function ($) {
var methods = {
init : function(options) {
var defaults = {
time_constant: 200, // ms
dist: -100, // zoom scale TODO: make this more intuitive as an option
shift: 0, // spacing for center image
padding: 0, // Padding between non center items
full_width: false, // Change to full width styles
indicators: false, // Toggle indicators
no_wrap: false // Don't wrap around and cycle through items.
};
options = $.extend(defaults, options);
return this.each(function() {
var images, offset, center, pressed, dim, count,
reference, referenceY, amplitude, target, velocity,
xform, frame, timestamp, ticker, dragged, vertical_dragged;
var $indicators = $('<ul class="indicators"></ul>');
// Initialize
var view = $(this);
var showIndicators = view.attr('data-indicators') || options.indicators;
// Don't double initialize.
if (view.hasClass('initialized')) {
// Redraw carousel.
$(this).trigger('carouselNext', [0.000001]);
return true;
}
// Options
if (options.full_width) {
options.dist = 0;
var firstImage = view.find('.carousel-item img').first();
if (firstImage.length) {
imageHeight = firstImage.load(function(){
view.css('height', $(this).height());
});
} else {
imageHeight = view.find('.carousel-item').first().height();
view.css('height', imageHeight);
}
// Offset fixed items when indicators.
if (showIndicators) {
view.find('.carousel-fixed-item').addClass('with-indicators');
}
}
view.addClass('initialized');
pressed = false;
offset = target = 0;
images = [];
item_width = view.find('.carousel-item').first().innerWidth();
dim = item_width * 2 + options.padding;
view.find('.carousel-item').each(function (i) {
images.push($(this)[0]);
if (showIndicators) {
var $indicator = $('<li class="indicator-item"></li>');
// Add active to first by default.
if (i === 0) {
$indicator.addClass('active');
}
// Handle clicks on indicators.
$indicator.click(function () {
var index = $(this).index();
cycleTo(index);
});
$indicators.append($indicator);
}
});
if (showIndicators) {
view.append($indicators);
}
count = images.length;
function setupEvents() {
if (typeof window.ontouchstart !== 'undefined') {
view[0].addEventListener('touchstart', tap);
view[0].addEventListener('touchmove', drag);
view[0].addEventListener('touchend', release);
}
view[0].addEventListener('mousedown', tap);
view[0].addEventListener('mousemove', drag);
view[0].addEventListener('mouseup', release);
view[0].addEventListener('mouseleave', release);
view[0].addEventListener('click', click);
}
function xpos(e) {
// touch event
if (e.targetTouches && (e.targetTouches.length >= 1)) {
return e.targetTouches[0].clientX;
}
// mouse event
return e.clientX;
}
function ypos(e) {
// touch event
if (e.targetTouches && (e.targetTouches.length >= 1)) {
return e.targetTouches[0].clientY;
}
// mouse event
return e.clientY;
}
function wrap(x) {
return (x >= count) ? (x % count) : (x < 0) ? wrap(count + (x % count)) : x;
}
function scroll(x) {
var i, half, delta, dir, tween, el, alignment, xTranslation;
offset = (typeof x === 'number') ? x : offset;
center = Math.floor((offset + dim / 2) / dim);
delta = offset - center * dim;
dir = (delta < 0) ? 1 : -1;
tween = -dir * delta * 2 / dim;
half = count >> 1;
if (!options.full_width) {
alignment = 'translateX(' + (view[0].clientWidth - item_width) / 2 + 'px) ';
alignment += 'translateY(' + (view[0].clientHeight - item_width) / 2 + 'px)';
} else {
alignment = 'translateX(0)';
}
// Set indicator active
if (showIndicators) {
var diff = (center % count);
var activeIndicator = $indicators.find('.indicator-item.active');
if (activeIndicator.index() !== diff) {
activeIndicator.removeClass('active');
$indicators.find('.indicator-item').eq(diff).addClass('active');
}
}
// center
// Don't show wrapped items.
if (!options.no_wrap || (center >= 0 && center < count)) {
el = images[wrap(center)];
el.style[xform] = alignment +
' translateX(' + (-delta / 2) + 'px)' +
' translateX(' + (dir * options.shift * tween * i) + 'px)' +
' translateZ(' + (options.dist * tween) + 'px)';
el.style.zIndex = 0;
if (options.full_width) { tweenedOpacity = 1; }
else { tweenedOpacity = 1 - 0.2 * tween; }
el.style.opacity = tweenedOpacity;
el.style.display = 'block';
}
for (i = 1; i <= half; ++i) {
// right side
if (options.full_width) {
zTranslation = options.dist;
tweenedOpacity = (i === half && delta < 0) ? 1 - tween : 1;
} else {
zTranslation = options.dist * (i * 2 + tween * dir);
tweenedOpacity = 1 - 0.2 * (i * 2 + tween * dir);
}
// Don't show wrapped items.
if (!options.no_wrap || center + i < count) {
el = images[wrap(center + i)];
el.style[xform] = alignment +
' translateX(' + (options.shift + (dim * i - delta) / 2) + 'px)' +
' translateZ(' + zTranslation + 'px)';
el.style.zIndex = -i;
el.style.opacity = tweenedOpacity;
el.style.display = 'block';
}
// left side
if (options.full_width) {
zTranslation = options.dist;
tweenedOpacity = (i === half && delta > 0) ? 1 - tween : 1;
} else {
zTranslation = options.dist * (i * 2 - tween * dir);
tweenedOpacity = 1 - 0.2 * (i * 2 - tween * dir);
}
// Don't show wrapped items.
if (!options.no_wrap || center - i >= 0) {
el = images[wrap(center - i)];
el.style[xform] = alignment +
' translateX(' + (-options.shift + (-dim * i - delta) / 2) + 'px)' +
' translateZ(' + zTranslation + 'px)';
el.style.zIndex = -i;
el.style.opacity = tweenedOpacity;
el.style.display = 'block';
}
}
// center
// Don't show wrapped items.
if (!options.no_wrap || (center >= 0 && center < count)) {
el = images[wrap(center)];
el.style[xform] = alignment +
' translateX(' + (-delta / 2) + 'px)' +
' translateX(' + (dir * options.shift * tween) + 'px)' +
' translateZ(' + (options.dist * tween) + 'px)';
el.style.zIndex = 0;
if (options.full_width) { tweenedOpacity = 1; }
else { tweenedOpacity = 1 - 0.2 * tween; }
el.style.opacity = tweenedOpacity;
el.style.display = 'block';
}
}
function track() {
var now, elapsed, delta, v;
now = Date.now();
elapsed = now - timestamp;
timestamp = now;
delta = offset - frame;
frame = offset;
v = 1000 * delta / (1 + elapsed);
velocity = 0.8 * v + 0.2 * velocity;
}
function autoScroll() {
var elapsed, delta;
if (amplitude) {
elapsed = Date.now() - timestamp;
delta = amplitude * Math.exp(-elapsed / options.time_constant);
if (delta > 2 || delta < -2) {
scroll(target - delta);
requestAnimationFrame(autoScroll);
} else {
scroll(target);
}
}
}
function click(e) {
// Disable clicks if carousel was dragged.
if (dragged) {
e.preventDefault();
e.stopPropagation();
return false;
} else if (!options.full_width) {
var clickedIndex = $(e.target).closest('.carousel-item').index();
var diff = (center % count) - clickedIndex;
// Disable clicks if carousel was shifted by click
if (diff !== 0) {
e.preventDefault();
e.stopPropagation();
}
cycleTo(clickedIndex);
}
}
function cycleTo(n) {
var diff = (center % count) - n;
// Account for wraparound.
if (!options.no_wrap) {
if (diff < 0) {
if (Math.abs(diff + count) < Math.abs(diff)) { diff += count; }
} else if (diff > 0) {
if (Math.abs(diff - count) < diff) { diff -= count; }
}
}
// Call prev or next accordingly.
if (diff < 0) {
view.trigger('carouselNext', [Math.abs(diff)]);
} else if (diff > 0) {
view.trigger('carouselPrev', [diff]);
}
}
function tap(e) {
pressed = true;
dragged = false;
vertical_dragged = false;
reference = xpos(e);
referenceY = ypos(e);
velocity = amplitude = 0;
frame = offset;
timestamp = Date.now();
clearInterval(ticker);
ticker = setInterval(track, 100);
}
function drag(e) {
var x, delta, deltaY;
if (pressed) {
x = xpos(e);
y = ypos(e);
delta = reference - x;
deltaY = Math.abs(referenceY - y);
if (deltaY < 30 && !vertical_dragged) {
// If vertical scrolling don't allow dragging.
if (delta > 2 || delta < -2) {
dragged = true;
reference = x;
scroll(offset + delta);
}
} else if (dragged) {
// If dragging don't allow vertical scroll.
e.preventDefault();
e.stopPropagation();
return false;
} else {
// Vertical scrolling.
vertical_dragged = true;
}
}
if (dragged) {
// If dragging don't allow vertical scroll.
e.preventDefault();
e.stopPropagation();
return false;
}
}
function release(e) {
if (pressed) {
pressed = false;
} else {
return;
}
clearInterval(ticker);
target = offset;
if (velocity > 10 || velocity < -10) {
amplitude = 0.9 * velocity;
target = offset + amplitude;
}
target = Math.round(target / dim) * dim;
// No wrap of items.
if (options.no_wrap) {
if (target >= dim * (count - 1)) {
target = dim * (count - 1);
} else if (target < 0) {
target = 0;
}
}
amplitude = target - offset;
timestamp = Date.now();
requestAnimationFrame(autoScroll);
if (dragged) {
e.preventDefault();
e.stopPropagation();
}
return false;
}
xform = 'transform';
['webkit', 'Moz', 'O', 'ms'].every(function (prefix) {
var e = prefix + 'Transform';
if (typeof document.body.style[e] !== 'undefined') {
xform = e;
return false;
}
return true;
});
window.onresize = scroll;
setupEvents();
scroll(offset);
$(this).on('carouselNext', function(e, n) {
if (n === undefined) {
n = 1;
}
target = offset + dim * n;
if (offset !== target) {
amplitude = target - offset;
timestamp = Date.now();
requestAnimationFrame(autoScroll);
}
});
$(this).on('carouselPrev', function(e, n) {
if (n === undefined) {
n = 1;
}
target = offset - dim * n;
if (offset !== target) {
amplitude = target - offset;
timestamp = Date.now();
requestAnimationFrame(autoScroll);
}
});
$(this).on('carouselSet', function(e, n) {
if (n === undefined) {
n = 0;
}
cycleTo(n);
});
});
},
next : function(n) {
$(this).trigger('carouselNext', [n]);
},
prev : function(n) {
$(this).trigger('carouselPrev', [n]);
},
set : function(n) {
$(this).trigger('carouselSet', [n]);
}
};
$.fn.carousel = function(methodOrOptions) {
if ( methods[methodOrOptions] ) {
return methods[ methodOrOptions ].apply( this, Array.prototype.slice.call( arguments, 1 ));
} else if ( typeof methodOrOptions === 'object' || ! methodOrOptions ) {
// Default to "init"
return methods.init.apply( this, arguments );
} else {
$.error( 'Method ' + methodOrOptions + ' does not exist on jQuery.carousel' );
}
}; // Plugin end
}( jQuery ));

View File

@@ -1,72 +0,0 @@
(function ($) {
$.fn.characterCounter = function(){
return this.each(function(){
var $input = $(this);
var $counterElement = $input.parent().find('span[class="character-counter"]');
// character counter has already been added appended to the parent container
if ($counterElement.length) {
return;
}
var itHasLengthAttribute = $input.attr('length') !== undefined;
if(itHasLengthAttribute){
$input.on('input', updateCounter);
$input.on('focus', updateCounter);
$input.on('blur', removeCounterElement);
addCounterElement($input);
}
});
};
function updateCounter(){
var maxLength = +$(this).attr('length'),
actualLength = +$(this).val().length,
isValidLength = actualLength <= maxLength;
$(this).parent().find('span[class="character-counter"]')
.html( actualLength + '/' + maxLength);
addInputStyle(isValidLength, $(this));
}
function addCounterElement($input) {
var $counterElement = $input.parent().find('span[class="character-counter"]');
if ($counterElement.length) {
return;
}
$counterElement = $('<span/>')
.addClass('character-counter')
.css('float','right')
.css('font-size','12px')
.css('height', 1);
$input.parent().append($counterElement);
}
function removeCounterElement(){
$(this).parent().find('span[class="character-counter"]').html('');
}
function addInputStyle(isValidLength, $input){
var inputHasInvalidClass = $input.hasClass('invalid');
if (isValidLength && inputHasInvalidClass) {
$input.removeClass('invalid');
}
else if(!isValidLength && !inputHasInvalidClass){
$input.removeClass('valid');
$input.addClass('invalid');
}
}
$(document).ready(function(){
$('input, textarea').characterCounter();
});
}( jQuery ));

View File

@@ -1,267 +0,0 @@
(function ($) {
var chipsHandleEvents = false;
var materialChipsDefaults = {
data: [],
placeholder: '',
secondaryPlaceholder: '',
};
$(document).ready(function(){
// Handle removal of static chips.
$(document).on('click', '.chip .close', function(e){
var $chips = $(this).closest('.chips');
if ($chips.data('initialized')) {
return;
}
$(this).closest('.chip').remove();
});
});
$.fn.material_chip = function (options) {
var self = this;
this.$el = $(this);
this.$document = $(document);
this.SELS = {
CHIPS: '.chips',
CHIP: '.chip',
INPUT: 'input',
DELETE: '.material-icons',
SELECTED_CHIP: '.selected',
};
if ('data' === options) {
return this.$el.data('chips');
}
if ('options' === options) {
return this.$el.data('options');
}
this.$el.data('options', $.extend({}, materialChipsDefaults, options));
// Initialize
this.init = function() {
var i = 0;
var chips;
self.$el.each(function(){
var $chips = $(this);
if ($chips.data('initialized')) {
// Prevent double initialization.
return;
}
var options = $chips.data('options');
if (!options.data || !options.data instanceof Array) {
options.data = [];
}
$chips.data('chips', options.data);
$chips.data('index', i);
$chips.data('initialized', true);
if (!$chips.hasClass(self.SELS.CHIPS)) {
$chips.addClass('chips');
}
self.chips($chips);
i++;
});
};
this.handleEvents = function(){
var SELS = self.SELS;
self.$document.on('click', SELS.CHIPS, function(e){
$(e.target).find(SELS.INPUT).focus();
});
self.$document.on('click', SELS.CHIP, function(e){
$(SELS.CHIP).removeClass('selected');
$(this).toggleClass('selected');
});
self.$document.on('keydown', function(e){
if ($(e.target).is('input, textarea')) {
return;
}
// delete
var $chip = self.$document.find(SELS.CHIP + SELS.SELECTED_CHIP);
var $chips = $chip.closest(SELS.CHIPS);
var length = $chip.siblings(SELS.CHIP).length;
var index;
if (!$chip.length) {
return;
}
if (e.which === 8 || e.which === 46) {
e.preventDefault();
var chipsIndex = $chips.data('index');
index = $chip.index();
self.deleteChip(chipsIndex, index, $chips);
var selectIndex = null;
if ((index + 1) < length) {
selectIndex = index;
} else if (index === length || (index + 1) === length) {
selectIndex = length - 1;
}
if (selectIndex < 0) selectIndex = null;
if (null !== selectIndex) {
self.selectChip(chipsIndex, selectIndex, $chips);
}
if (!length) $chips.find('input').focus();
// left
} else if (e.which === 37) {
index = $chip.index() - 1;
if (index < 0) {
return;
}
$(SELS.CHIP).removeClass('selected');
self.selectChip($chips.data('index'), index, $chips);
// right
} else if (e.which === 39) {
index = $chip.index() + 1;
$(SELS.CHIP).removeClass('selected');
if (index > length) {
$chips.find('input').focus();
return;
}
self.selectChip($chips.data('index'), index, $chips);
}
});
self.$document.on('focusin', SELS.CHIPS + ' ' + SELS.INPUT, function(e){
$(e.target).closest(SELS.CHIPS).addClass('focus');
$(SELS.CHIP).removeClass('selected');
});
self.$document.on('focusout', SELS.CHIPS + ' ' + SELS.INPUT, function(e){
$(e.target).closest(SELS.CHIPS).removeClass('focus');
});
self.$document.on('keydown', SELS.CHIPS + ' ' + SELS.INPUT, function(e){
var $target = $(e.target);
var $chips = $target.closest(SELS.CHIPS);
var chipsIndex = $chips.data('index');
var chipsLength = $chips.children(SELS.CHIP).length;
// enter
if (13 === e.which) {
e.preventDefault();
self.addChip(chipsIndex, {tag: $target.val()}, $chips);
$target.val('');
return;
}
// delete or left
if ((8 === e.keyCode || 37 === e.keyCode) && '' === $target.val() && chipsLength) {
self.selectChip(chipsIndex, chipsLength - 1, $chips);
$target.blur();
return;
}
});
self.$document.on('click', SELS.CHIPS + ' ' + SELS.DELETE, function(e) {
var $target = $(e.target);
var $chips = $target.closest(SELS.CHIPS);
var $chip = $target.closest(SELS.CHIP);
e.stopPropagation();
self.deleteChip(
$chips.data('index'),
$chip.index(),
$chips
);
$chips.find('input').focus();
});
};
this.chips = function($chips) {
var html = '';
var options = $chips.data('options');
$chips.data('chips').forEach(function(elem){
html += self.renderChip(elem);
});
html += '<input class="input" placeholder="">';
$chips.html(html);
self.setPlaceholder($chips);
};
this.renderChip = function(elem) {
if (!elem.tag) return;
var html = '<div class="chip">' + elem.tag;
if (elem.image) {
html += ' <img src="' + elem.image + '"> ';
}
html += '<i class="material-icons close">close</i>';
html += '</div>';
return html;
};
this.setPlaceholder = function($chips) {
var options = $chips.data('options');
if ($chips.data('chips').length && options.placeholder) {
$chips.find('input').prop('placeholder', options.placeholder);
} else if (!$chips.data('chips').length && options.secondaryPlaceholder) {
$chips.find('input').prop('placeholder', options.secondaryPlaceholder);
}
};
this.isValid = function($chips, elem) {
var chips = $chips.data('chips');
var exists = false;
for (var i=0; i < chips.length; i++) {
if (chips[i].tag === elem.tag) {
exists = true;
return;
}
}
return '' !== elem.tag && !exists;
};
this.addChip = function(chipsIndex, elem, $chips) {
if (!self.isValid($chips, elem)) {
return;
}
var options = $chips.data('options');
var chipHtml = self.renderChip(elem);
$chips.data('chips').push(elem);
$(chipHtml).insertBefore($chips.find('input'));
$chips.trigger('chip.add', elem);
self.setPlaceholder($chips);
};
this.deleteChip = function(chipsIndex, chipIndex, $chips) {
var chip = $chips.data('chips')[chipIndex];
$chips.find('.chip').eq(chipIndex).remove();
$chips.data('chips').splice(chipIndex, 1);
$chips.trigger('chip.delete', chip);
self.setPlaceholder($chips);
};
this.selectChip = function(chipsIndex, chipIndex, $chips) {
var $chip = $chips.find('.chip').eq(chipIndex);
if ($chip && false === $chip.hasClass('selected')) {
$chip.addClass('selected');
$chips.trigger('chip.select', $chips.data('chips')[chipIndex]);
}
};
this.getChipsElement = function(index, $chips) {
return $chips.eq(index);
};
// init
this.init();
if (!chipsHandleEvents) {
this.handleEvents();
chipsHandleEvents = true;
}
};
}( jQuery ));

View File

@@ -1,137 +0,0 @@
(function ($) {
$.fn.collapsible = function(options) {
var defaults = {
accordion: undefined
};
options = $.extend(defaults, options);
return this.each(function() {
var $this = $(this);
var $panel_headers = $(this).find('> li > .collapsible-header');
var collapsible_type = $this.data("collapsible");
// Turn off any existing event handlers
$this.off('click.collapse', '> li > .collapsible-header');
$panel_headers.off('click.collapse');
/****************
Helper Functions
****************/
// Accordion Open
function accordionOpen(object) {
$panel_headers = $this.find('> li > .collapsible-header');
if (object.hasClass('active')) {
object.parent().addClass('active');
}
else {
object.parent().removeClass('active');
}
if (object.parent().hasClass('active')){
object.siblings('.collapsible-body').stop(true,false).slideDown({ duration: 350, easing: "easeOutQuart", queue: false, complete: function() {$(this).css('height', '');}});
}
else{
object.siblings('.collapsible-body').stop(true,false).slideUp({ duration: 350, easing: "easeOutQuart", queue: false, complete: function() {$(this).css('height', '');}});
}
$panel_headers.not(object).removeClass('active').parent().removeClass('active');
$panel_headers.not(object).parent().children('.collapsible-body').stop(true,false).slideUp(
{
duration: 350,
easing: "easeOutQuart",
queue: false,
complete:
function() {
$(this).css('height', '');
}
});
}
// Expandable Open
function expandableOpen(object) {
if (object.hasClass('active')) {
object.parent().addClass('active');
}
else {
object.parent().removeClass('active');
}
if (object.parent().hasClass('active')){
object.siblings('.collapsible-body').stop(true,false).slideDown({ duration: 350, easing: "easeOutQuart", queue: false, complete: function() {$(this).css('height', '');}});
}
else{
object.siblings('.collapsible-body').stop(true,false).slideUp({ duration: 350, easing: "easeOutQuart", queue: false, complete: function() {$(this).css('height', '');}});
}
}
/**
* Check if object is children of panel header
* @param {Object} object Jquery object
* @return {Boolean} true if it is children
*/
function isChildrenOfPanelHeader(object) {
var panelHeader = getPanelHeader(object);
return panelHeader.length > 0;
}
/**
* Get panel header from a children element
* @param {Object} object Jquery object
* @return {Object} panel header object
*/
function getPanelHeader(object) {
return object.closest('li > .collapsible-header');
}
/***** End Helper Functions *****/
// Add click handler to only direct collapsible header children
$this.on('click.collapse', '> li > .collapsible-header', function(e) {
var $header = $(this),
element = $(e.target);
if (isChildrenOfPanelHeader(element)) {
element = getPanelHeader(element);
}
element.toggleClass('active');
if (options.accordion || collapsible_type === "accordion" || collapsible_type === undefined) { // Handle Accordion
accordionOpen(element);
} else { // Handle Expandables
expandableOpen(element);
if ($header.hasClass('active')) {
expandableOpen($header);
}
}
});
// Open first active
var $panel_headers = $this.find('> li > .collapsible-header');
if (options.accordion || collapsible_type === "accordion" || collapsible_type === undefined) { // Handle Accordion
accordionOpen($panel_headers.filter('.active').first());
}
else { // Handle Expandables
$panel_headers.filter('.active').each(function() {
expandableOpen($(this));
});
}
});
};
$(document).ready(function(){
$('.collapsible').collapsible();
});
}( jQuery ));

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@@ -1,265 +0,0 @@
(function ($) {
// Add posibility to scroll to selected option
// usefull for select for example
$.fn.scrollTo = function(elem) {
$(this).scrollTop($(this).scrollTop() - $(this).offset().top + $(elem).offset().top);
return this;
};
$.fn.dropdown = function (options) {
var defaults = {
inDuration: 300,
outDuration: 225,
constrain_width: true, // Constrains width of dropdown to the activator
hover: false,
gutter: 0, // Spacing from edge
belowOrigin: false,
alignment: 'left',
stopPropagation: false
};
// Open dropdown.
if (options === "open") {
this.each(function() {
$(this).trigger('open');
});
return false;
}
// Close dropdown.
if (options === "close") {
this.each(function() {
$(this).trigger('close');
});
return false;
}
this.each(function(){
var origin = $(this);
var options = $.extend({}, defaults, options);
var isFocused = false;
// Dropdown menu
var activates = $("#"+ origin.attr('data-activates'));
function updateOptions() {
if (origin.data('induration') !== undefined)
options.inDuration = origin.data('induration');
if (origin.data('outduration') !== undefined)
options.outDuration = origin.data('outduration');
if (origin.data('constrainwidth') !== undefined)
options.constrain_width = origin.data('constrainwidth');
if (origin.data('hover') !== undefined)
options.hover = origin.data('hover');
if (origin.data('gutter') !== undefined)
options.gutter = origin.data('gutter');
if (origin.data('beloworigin') !== undefined)
options.belowOrigin = origin.data('beloworigin');
if (origin.data('alignment') !== undefined)
options.alignment = origin.data('alignment');
if (origin.data('stoppropagation') !== undefined)
options.stopPropagation = origin.data('stoppropagation');
}
updateOptions();
// Attach dropdown to its activator
origin.after(activates);
/*
Helper function to position and resize dropdown.
Used in hover and click handler.
*/
function placeDropdown(eventType) {
// Check for simultaneous focus and click events.
if (eventType === 'focus') {
isFocused = true;
}
// Check html data attributes
updateOptions();
// Set Dropdown state
activates.addClass('active');
origin.addClass('active');
// Constrain width
if (options.constrain_width === true) {
activates.css('width', origin.outerWidth());
} else {
activates.css('white-space', 'nowrap');
}
// Offscreen detection
var windowHeight = window.innerHeight;
var originHeight = origin.innerHeight();
var offsetLeft = origin.offset().left;
var offsetTop = origin.offset().top - $(window).scrollTop();
var currAlignment = options.alignment;
var gutterSpacing = 0;
var leftPosition = 0;
// Below Origin
var verticalOffset = 0;
if (options.belowOrigin === true) {
verticalOffset = originHeight;
}
// Check for scrolling positioned container.
var scrollYOffset = 0;
var scrollXOffset = 0;
var wrapper = origin.parent();
if (!wrapper.is('body')) {
if (wrapper[0].scrollHeight > wrapper[0].clientHeight) {
scrollYOffset = wrapper[0].scrollTop;
}
if (wrapper[0].scrollWidth > wrapper[0].clientWidth) {
scrollXOffset = wrapper[0].scrollLeft;
}
}
if (offsetLeft + activates.innerWidth() > $(window).width()) {
// Dropdown goes past screen on right, force right alignment
currAlignment = 'right';
} else if (offsetLeft - activates.innerWidth() + origin.innerWidth() < 0) {
// Dropdown goes past screen on left, force left alignment
currAlignment = 'left';
}
// Vertical bottom offscreen detection
if (offsetTop + activates.innerHeight() > windowHeight) {
// If going upwards still goes offscreen, just crop height of dropdown.
if (offsetTop + originHeight - activates.innerHeight() < 0) {
var adjustedHeight = windowHeight - offsetTop - verticalOffset;
activates.css('max-height', adjustedHeight);
} else {
// Flow upwards.
if (!verticalOffset) {
verticalOffset += originHeight;
}
verticalOffset -= activates.innerHeight();
}
}
// Handle edge alignment
if (currAlignment === 'left') {
gutterSpacing = options.gutter;
leftPosition = origin.position().left + gutterSpacing;
}
else if (currAlignment === 'right') {
var offsetRight = origin.position().left + origin.outerWidth() - activates.outerWidth();
gutterSpacing = -options.gutter;
leftPosition = offsetRight + gutterSpacing;
}
// Position dropdown
activates.css({
position: 'absolute',
top: origin.position().top + verticalOffset + scrollYOffset,
left: leftPosition + scrollXOffset
});
// Show dropdown
activates.stop(true, true).css('opacity', 0)
.slideDown({
queue: false,
duration: options.inDuration,
easing: 'easeOutCubic',
complete: function() {
$(this).css('height', '');
}
})
.animate( {opacity: 1}, {queue: false, duration: options.inDuration, easing: 'easeOutSine'});
}
function hideDropdown() {
// Check for simultaneous focus and click events.
isFocused = false;
activates.fadeOut(options.outDuration);
activates.removeClass('active');
origin.removeClass('active');
setTimeout(function() { activates.css('max-height', ''); }, options.outDuration);
}
// Hover
if (options.hover) {
var open = false;
origin.unbind('click.' + origin.attr('id'));
// Hover handler to show dropdown
origin.on('mouseenter', function(e){ // Mouse over
if (open === false) {
placeDropdown();
open = true;
}
});
origin.on('mouseleave', function(e){
// If hover on origin then to something other than dropdown content, then close
var toEl = e.toElement || e.relatedTarget; // added browser compatibility for target element
if(!$(toEl).closest('.dropdown-content').is(activates)) {
activates.stop(true, true);
hideDropdown();
open = false;
}
});
activates.on('mouseleave', function(e){ // Mouse out
var toEl = e.toElement || e.relatedTarget;
if(!$(toEl).closest('.dropdown-button').is(origin)) {
activates.stop(true, true);
hideDropdown();
open = false;
}
});
// Click
} else {
// Click handler to show dropdown
origin.unbind('click.' + origin.attr('id'));
origin.bind('click.'+origin.attr('id'), function(e){
if (!isFocused) {
if ( origin[0] == e.currentTarget &&
!origin.hasClass('active') &&
($(e.target).closest('.dropdown-content').length === 0)) {
e.preventDefault(); // Prevents button click from moving window
if (options.stopPropagation) {
e.stopPropagation();
}
placeDropdown('click');
}
// If origin is clicked and menu is open, close menu
else if (origin.hasClass('active')) {
hideDropdown();
$(document).unbind('click.'+ activates.attr('id') + ' touchstart.' + activates.attr('id'));
}
// If menu open, add click close handler to document
if (activates.hasClass('active')) {
$(document).bind('click.'+ activates.attr('id') + ' touchstart.' + activates.attr('id'), function (e) {
if (!activates.is(e.target) && !origin.is(e.target) && (!origin.find(e.target).length) ) {
hideDropdown();
$(document).unbind('click.'+ activates.attr('id') + ' touchstart.' + activates.attr('id'));
}
});
}
}
});
} // End else
// Listen to open and close event - useful for select component
origin.on('open', function(e, eventType) {
placeDropdown(eventType);
});
origin.on('close', hideDropdown);
});
}; // End dropdown plugin
$(document).ready(function(){
$('.dropdown-button').dropdown();
});
}( jQuery ));

View File

@@ -1,681 +0,0 @@
(function ($) {
$(document).ready(function() {
// Function to update labels of text fields
Materialize.updateTextFields = function() {
var input_selector = 'input[type=text], input[type=password], input[type=email], input[type=url], input[type=tel], input[type=number], input[type=search], textarea';
$(input_selector).each(function(index, element) {
if ($(element).val().length > 0 || element.autofocus ||$(this).attr('placeholder') !== undefined || $(element)[0].validity.badInput === true) {
$(this).siblings('label').addClass('active');
}
else {
$(this).siblings('label').removeClass('active');
}
});
};
// Text based inputs
var input_selector = 'input[type=text], input[type=password], input[type=email], input[type=url], input[type=tel], input[type=number], input[type=search], textarea';
// Add active if form auto complete
$(document).on('change', input_selector, function () {
if($(this).val().length !== 0 || $(this).attr('placeholder') !== undefined) {
$(this).siblings('label').addClass('active');
}
validate_field($(this));
});
// Add active if input element has been pre-populated on document ready
$(document).ready(function() {
Materialize.updateTextFields();
});
// HTML DOM FORM RESET handling
$(document).on('reset', function(e) {
var formReset = $(e.target);
if (formReset.is('form')) {
formReset.find(input_selector).removeClass('valid').removeClass('invalid');
formReset.find(input_selector).each(function () {
if ($(this).attr('value') === '') {
$(this).siblings('label').removeClass('active');
}
});
// Reset select
formReset.find('select.initialized').each(function () {
var reset_text = formReset.find('option[selected]').text();
formReset.siblings('input.select-dropdown').val(reset_text);
});
}
});
// Add active when element has focus
$(document).on('focus', input_selector, function () {
$(this).siblings('label, .prefix').addClass('active');
});
$(document).on('blur', input_selector, function () {
var $inputElement = $(this);
var selector = ".prefix";
if ($inputElement.val().length === 0 && $inputElement[0].validity.badInput !== true && $inputElement.attr('placeholder') === undefined) {
selector += ", label";
}
$inputElement.siblings(selector).removeClass('active');
validate_field($inputElement);
});
window.validate_field = function(object) {
var hasLength = object.attr('length') !== undefined;
var lenAttr = parseInt(object.attr('length'));
var len = object.val().length;
if (object.val().length === 0 && object[0].validity.badInput === false) {
if (object.hasClass('validate')) {
object.removeClass('valid');
object.removeClass('invalid');
}
}
else {
if (object.hasClass('validate')) {
// Check for character counter attributes
if ((object.is(':valid') && hasLength && (len <= lenAttr)) || (object.is(':valid') && !hasLength)) {
object.removeClass('invalid');
object.addClass('valid');
}
else {
object.removeClass('valid');
object.addClass('invalid');
}
}
}
};
// Radio and Checkbox focus class
var radio_checkbox = 'input[type=radio], input[type=checkbox]';
$(document).on('keyup.radio', radio_checkbox, function(e) {
// TAB, check if tabbing to radio or checkbox.
if (e.which === 9) {
$(this).addClass('tabbed');
var $this = $(this);
$this.one('blur', function(e) {
$(this).removeClass('tabbed');
});
return;
}
});
// Textarea Auto Resize
var hiddenDiv = $('.hiddendiv').first();
if (!hiddenDiv.length) {
hiddenDiv = $('<div class="hiddendiv common"></div>');
$('body').append(hiddenDiv);
}
var text_area_selector = '.materialize-textarea';
function textareaAutoResize($textarea) {
// Set font properties of hiddenDiv
var fontFamily = $textarea.css('font-family');
var fontSize = $textarea.css('font-size');
var lineHeight = $textarea.css('line-height');
if (fontSize) { hiddenDiv.css('font-size', fontSize); }
if (fontFamily) { hiddenDiv.css('font-family', fontFamily); }
if (lineHeight) { hiddenDiv.css('line-height', lineHeight); }
if ($textarea.attr('wrap') === "off") {
hiddenDiv.css('overflow-wrap', "normal")
.css('white-space', "pre");
}
hiddenDiv.text($textarea.val() + '\n');
var content = hiddenDiv.html().replace(/\n/g, '<br>');
hiddenDiv.html(content);
// When textarea is hidden, width goes crazy.
// Approximate with half of window size
if ($textarea.is(':visible')) {
hiddenDiv.css('width', $textarea.width());
}
else {
hiddenDiv.css('width', $(window).width()/2);
}
$textarea.css('height', hiddenDiv.height());
}
$(text_area_selector).each(function () {
var $textarea = $(this);
if ($textarea.val().length) {
textareaAutoResize($textarea);
}
});
$('body').on('keyup keydown autoresize', text_area_selector, function () {
textareaAutoResize($(this));
});
// File Input Path
$(document).on('change', '.file-field input[type="file"]', function () {
var file_field = $(this).closest('.file-field');
var path_input = file_field.find('input.file-path');
var files = $(this)[0].files;
var file_names = [];
for (var i = 0; i < files.length; i++) {
file_names.push(files[i].name);
}
path_input.val(file_names.join(", "));
path_input.trigger('change');
});
/****************
* Range Input *
****************/
var range_type = 'input[type=range]';
var range_mousedown = false;
var left;
$(range_type).each(function () {
var thumb = $('<span class="thumb"><span class="value"></span></span>');
$(this).after(thumb);
});
var range_wrapper = '.range-field';
$(document).on('change', range_type, function(e) {
var thumb = $(this).siblings('.thumb');
thumb.find('.value').html($(this).val());
});
$(document).on('input mousedown touchstart', range_type, function(e) {
var thumb = $(this).siblings('.thumb');
var width = $(this).outerWidth();
// If thumb indicator does not exist yet, create it
if (thumb.length <= 0) {
thumb = $('<span class="thumb"><span class="value"></span></span>');
$(this).after(thumb);
}
// Set indicator value
thumb.find('.value').html($(this).val());
range_mousedown = true;
$(this).addClass('active');
if (!thumb.hasClass('active')) {
thumb.velocity({ height: "30px", width: "30px", top: "-20px", marginLeft: "-15px"}, { duration: 300, easing: 'easeOutExpo' });
}
if (e.type !== 'input') {
if(e.pageX === undefined || e.pageX === null){//mobile
left = e.originalEvent.touches[0].pageX - $(this).offset().left;
}
else{ // desktop
left = e.pageX - $(this).offset().left;
}
if (left < 0) {
left = 0;
}
else if (left > width) {
left = width;
}
thumb.addClass('active').css('left', left);
}
thumb.find('.value').html($(this).val());
});
$(document).on('mouseup touchend', range_wrapper, function() {
range_mousedown = false;
$(this).removeClass('active');
});
$(document).on('mousemove touchmove', range_wrapper, function(e) {
var thumb = $(this).children('.thumb');
var left;
if (range_mousedown) {
if (!thumb.hasClass('active')) {
thumb.velocity({ height: '30px', width: '30px', top: '-20px', marginLeft: '-15px'}, { duration: 300, easing: 'easeOutExpo' });
}
if (e.pageX === undefined || e.pageX === null) { //mobile
left = e.originalEvent.touches[0].pageX - $(this).offset().left;
}
else{ // desktop
left = e.pageX - $(this).offset().left;
}
var width = $(this).outerWidth();
if (left < 0) {
left = 0;
}
else if (left > width) {
left = width;
}
thumb.addClass('active').css('left', left);
thumb.find('.value').html(thumb.siblings(range_type).val());
}
});
$(document).on('mouseout touchleave', range_wrapper, function() {
if (!range_mousedown) {
var thumb = $(this).children('.thumb');
if (thumb.hasClass('active')) {
thumb.velocity({ height: '0', width: '0', top: '10px', marginLeft: '-6px'}, { duration: 100 });
}
thumb.removeClass('active');
}
});
/**************************
* Auto complete plugin *
*************************/
$.fn.autocomplete = function (options) {
// Defaults
var defaults = {
data: {}
};
options = $.extend(defaults, options);
return this.each(function() {
var $input = $(this);
var data = options.data,
$inputDiv = $input.closest('.input-field'); // Div to append on
// Check if data isn't empty
if (!$.isEmptyObject(data)) {
// Create autocomplete element
var $autocomplete = $('<ul class="autocomplete-content dropdown-content"></ul>');
// Append autocomplete element
if ($inputDiv.length) {
$inputDiv.append($autocomplete); // Set ul in body
} else {
$input.after($autocomplete);
}
var highlight = function(string, $el) {
var img = $el.find('img');
var matchStart = $el.text().toLowerCase().indexOf("" + string.toLowerCase() + ""),
matchEnd = matchStart + string.length - 1,
beforeMatch = $el.text().slice(0, matchStart),
matchText = $el.text().slice(matchStart, matchEnd + 1),
afterMatch = $el.text().slice(matchEnd + 1);
$el.html("<span>" + beforeMatch + "<span class='highlight'>" + matchText + "</span>" + afterMatch + "</span>");
if (img.length) {
$el.prepend(img);
}
};
// Perform search
$input.on('keyup', function (e) {
// Capture Enter
if (e.which === 13) {
$autocomplete.find('li').first().click();
return;
}
var val = $input.val().toLowerCase();
$autocomplete.empty();
// Check if the input isn't empty
if (val !== '') {
for(var key in data) {
if (data.hasOwnProperty(key) &&
key.toLowerCase().indexOf(val) !== -1 &&
key.toLowerCase() !== val) {
var autocompleteOption = $('<li></li>');
if(!!data[key]) {
autocompleteOption.append('<img src="'+ data[key] +'" class="right circle"><span>'+ key +'</span>');
} else {
autocompleteOption.append('<span>'+ key +'</span>');
}
$autocomplete.append(autocompleteOption);
highlight(val, autocompleteOption);
}
}
}
});
// Set input value
$autocomplete.on('click', 'li', function () {
$input.val($(this).text().trim());
$autocomplete.empty();
});
}
});
};
}); // End of $(document).ready
/*******************
* Select Plugin *
******************/
$.fn.material_select = function (callback) {
$(this).each(function(){
var $select = $(this);
if ($select.hasClass('browser-default')) {
return; // Continue to next (return false breaks out of entire loop)
}
var multiple = $select.attr('multiple') ? true : false,
lastID = $select.data('select-id'); // Tear down structure if Select needs to be rebuilt
if (lastID) {
$select.parent().find('span.caret').remove();
$select.parent().find('input').remove();
$select.unwrap();
$('ul#select-options-'+lastID).remove();
}
// If destroying the select, remove the selelct-id and reset it to it's uninitialized state.
if(callback === 'destroy') {
$select.data('select-id', null).removeClass('initialized');
return;
}
var uniqueID = Materialize.guid();
$select.data('select-id', uniqueID);
var wrapper = $('<div class="select-wrapper"></div>');
wrapper.addClass($select.attr('class'));
var options = $('<ul id="select-options-' + uniqueID +'" class="dropdown-content select-dropdown ' + (multiple ? 'multiple-select-dropdown' : '') + '"></ul>'),
selectChildren = $select.children('option, optgroup'),
valuesSelected = [],
optionsHover = false;
var label = $select.find('option:selected').html() || $select.find('option:first').html() || "";
// Function that renders and appends the option taking into
// account type and possible image icon.
var appendOptionWithIcon = function(select, option, type) {
// Add disabled attr if disabled
var disabledClass = (option.is(':disabled')) ? 'disabled ' : '';
var optgroupClass = (type === 'optgroup-option') ? 'optgroup-option ' : '';
// add icons
var icon_url = option.data('icon');
var classes = option.attr('class');
if (!!icon_url) {
var classString = '';
if (!!classes) classString = ' class="' + classes + '"';
// Check for multiple type.
if (type === 'multiple') {
options.append($('<li class="' + disabledClass + '"><img src="' + icon_url + '"' + classString + '><span><input type="checkbox"' + disabledClass + '/><label></label>' + option.html() + '</span></li>'));
} else {
options.append($('<li class="' + disabledClass + optgroupClass + '"><img src="' + icon_url + '"' + classString + '><span>' + option.html() + '</span></li>'));
}
return true;
}
// Check for multiple type.
if (type === 'multiple') {
options.append($('<li class="' + disabledClass + '"><span><input type="checkbox"' + disabledClass + '/><label></label>' + option.html() + '</span></li>'));
} else {
options.append($('<li class="' + disabledClass + optgroupClass + '"><span>' + option.html() + '</span></li>'));
}
};
/* Create dropdown structure. */
if (selectChildren.length) {
selectChildren.each(function() {
if ($(this).is('option')) {
// Direct descendant option.
if (multiple) {
appendOptionWithIcon($select, $(this), 'multiple');
} else {
appendOptionWithIcon($select, $(this));
}
} else if ($(this).is('optgroup')) {
// Optgroup.
var selectOptions = $(this).children('option');
options.append($('<li class="optgroup"><span>' + $(this).attr('label') + '</span></li>'));
selectOptions.each(function() {
appendOptionWithIcon($select, $(this), 'optgroup-option');
});
}
});
}
options.find('li:not(.optgroup)').each(function (i) {
$(this).click(function (e) {
// Check if option element is disabled
if (!$(this).hasClass('disabled') && !$(this).hasClass('optgroup')) {
var selected = true;
if (multiple) {
$('input[type="checkbox"]', this).prop('checked', function(i, v) { return !v; });
selected = toggleEntryFromArray(valuesSelected, $(this).index(), $select);
$newSelect.trigger('focus');
} else {
options.find('li').removeClass('active');
$(this).toggleClass('active');
$newSelect.val($(this).text());
}
activateOption(options, $(this));
$select.find('option').eq(i).prop('selected', selected);
// Trigger onchange() event
$select.trigger('change');
if (typeof callback !== 'undefined') callback();
}
e.stopPropagation();
});
});
// Wrap Elements
$select.wrap(wrapper);
// Add Select Display Element
var dropdownIcon = $('<span class="caret">&#9660;</span>');
if ($select.is(':disabled'))
dropdownIcon.addClass('disabled');
// escape double quotes
var sanitizedLabelHtml = label.replace(/"/g, '&quot;');
var $newSelect = $('<input type="text" class="select-dropdown" readonly="true" ' + (($select.is(':disabled')) ? 'disabled' : '') + ' data-activates="select-options-' + uniqueID +'" value="'+ sanitizedLabelHtml +'"/>');
$select.before($newSelect);
$newSelect.before(dropdownIcon);
$newSelect.after(options);
// Check if section element is disabled
if (!$select.is(':disabled')) {
$newSelect.dropdown({'hover': false, 'closeOnClick': false});
}
// Copy tabindex
if ($select.attr('tabindex')) {
$($newSelect[0]).attr('tabindex', $select.attr('tabindex'));
}
$select.addClass('initialized');
$newSelect.on({
'focus': function (){
if ($('ul.select-dropdown').not(options[0]).is(':visible')) {
$('input.select-dropdown').trigger('close');
}
if (!options.is(':visible')) {
$(this).trigger('open', ['focus']);
var label = $(this).val();
var selectedOption = options.find('li').filter(function() {
return $(this).text().toLowerCase() === label.toLowerCase();
})[0];
activateOption(options, selectedOption);
}
},
'click': function (e){
e.stopPropagation();
}
});
$newSelect.on('blur', function() {
if (!multiple) {
$(this).trigger('close');
}
options.find('li.selected').removeClass('selected');
});
options.hover(function() {
optionsHover = true;
}, function () {
optionsHover = false;
});
$(window).on({
'click': function () {
multiple && (optionsHover || $newSelect.trigger('close'));
}
});
// Add initial multiple selections.
if (multiple) {
$select.find("option:selected:not(:disabled)").each(function () {
var index = $(this).index();
toggleEntryFromArray(valuesSelected, index, $select);
options.find("li").eq(index).find(":checkbox").prop("checked", true);
});
}
// Make option as selected and scroll to selected position
var activateOption = function(collection, newOption) {
if (newOption) {
collection.find('li.selected').removeClass('selected');
var option = $(newOption);
option.addClass('selected');
options.scrollTo(option);
}
};
// Allow user to search by typing
// this array is cleared after 1 second
var filterQuery = [],
onKeyDown = function(e){
// TAB - switch to another input
if(e.which == 9){
$newSelect.trigger('close');
return;
}
// ARROW DOWN WHEN SELECT IS CLOSED - open select options
if(e.which == 40 && !options.is(':visible')){
$newSelect.trigger('open');
return;
}
// ENTER WHEN SELECT IS CLOSED - submit form
if(e.which == 13 && !options.is(':visible')){
return;
}
e.preventDefault();
// CASE WHEN USER TYPE LETTERS
var letter = String.fromCharCode(e.which).toLowerCase(),
nonLetters = [9,13,27,38,40];
if (letter && (nonLetters.indexOf(e.which) === -1)) {
filterQuery.push(letter);
var string = filterQuery.join(''),
newOption = options.find('li').filter(function() {
return $(this).text().toLowerCase().indexOf(string) === 0;
})[0];
if (newOption) {
activateOption(options, newOption);
}
}
// ENTER - select option and close when select options are opened
if (e.which == 13) {
var activeOption = options.find('li.selected:not(.disabled)')[0];
if(activeOption){
$(activeOption).trigger('click');
if (!multiple) {
$newSelect.trigger('close');
}
}
}
// ARROW DOWN - move to next not disabled option
if (e.which == 40) {
if (options.find('li.selected').length) {
newOption = options.find('li.selected').next('li:not(.disabled)')[0];
} else {
newOption = options.find('li:not(.disabled)')[0];
}
activateOption(options, newOption);
}
// ESC - close options
if (e.which == 27) {
$newSelect.trigger('close');
}
// ARROW UP - move to previous not disabled option
if (e.which == 38) {
newOption = options.find('li.selected').prev('li:not(.disabled)')[0];
if(newOption)
activateOption(options, newOption);
}
// Automaticaly clean filter query so user can search again by starting letters
setTimeout(function(){ filterQuery = []; }, 1000);
};
$newSelect.on('keydown', onKeyDown);
});
function toggleEntryFromArray(entriesArray, entryIndex, select) {
var index = entriesArray.indexOf(entryIndex),
notAdded = index === -1;
if (notAdded) {
entriesArray.push(entryIndex);
} else {
entriesArray.splice(index, 1);
}
select.siblings('ul.dropdown-content').find('li').eq(entryIndex).toggleClass('active');
// use notAdded instead of true (to detect if the option is selected or not)
select.find('option').eq(entryIndex).prop('selected', notAdded);
setValueToInput(entriesArray, select);
return notAdded;
}
function setValueToInput(entriesArray, select) {
var value = '';
for (var i = 0, count = entriesArray.length; i < count; i++) {
var text = select.find('option').eq(entriesArray[i]).text();
i === 0 ? value += text : value += ', ' + text;
}
if (value === '') {
value = select.find('option:disabled').eq(0).text();
}
select.siblings('input.select-dropdown').val(value);
}
};
}( jQuery ));

View File

@@ -1,45 +0,0 @@
// Required for Meteor package, the use of window prevents export by Meteor
(function(window){
if(window.Package){
Materialize = {};
} else {
window.Materialize = {};
}
})(window);
// Unique ID
Materialize.guid = (function() {
function s4() {
return Math.floor((1 + Math.random()) * 0x10000)
.toString(16)
.substring(1);
}
return function() {
return s4() + s4() + '-' + s4() + '-' + s4() + '-' +
s4() + '-' + s4() + s4() + s4();
};
})();
Materialize.elementOrParentIsFixed = function(element) {
var $element = $(element);
var $checkElements = $element.add($element.parents());
var isFixed = false;
$checkElements.each(function(){
if ($(this).css("position") === "fixed") {
isFixed = true;
return false;
}
});
return isFixed;
};
// Velocity has conflicts when loaded with jQuery, this will check for it
var Vel;
if ($) {
Vel = $.Velocity;
} else if (jQuery) {
Vel = jQuery.Velocity;
} else {
Vel = Velocity;
}

File diff suppressed because one or more lines are too long

View File

@@ -1,11 +0,0 @@
// Check for jQuery.
if (typeof(jQuery) === 'undefined') {
var jQuery;
// Check if require is a defined function.
if (typeof(require) === 'function') {
jQuery = $ = require('jquery');
// Else use the dollar sign alias.
} else {
jQuery = $;
}
}

View File

@@ -1,205 +0,0 @@
/*
* jQuery Easing v1.3 - http://gsgd.co.uk/sandbox/jquery/easing/
*
* Uses the built in easing capabilities added In jQuery 1.1
* to offer multiple easing options
*
* TERMS OF USE - jQuery Easing
*
* Open source under the BSD License.
*
* Copyright © 2008 George McGinley Smith
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without modification,
* are permitted provided that the following conditions are met:
*
* Redistributions of source code must retain the above copyright notice, this list of
* conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above copyright notice, this list
* of conditions and the following disclaimer in the documentation and/or other materials
* provided with the distribution.
*
* Neither the name of the author nor the names of contributors may be used to endorse
* or promote products derived from this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY
* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
* MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
* COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
* EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
* GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
* AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
* OF THE POSSIBILITY OF SUCH DAMAGE.
*
*/
// t: current time, b: begInnIng value, c: change In value, d: duration
jQuery.easing['jswing'] = jQuery.easing['swing'];
jQuery.extend( jQuery.easing,
{
def: 'easeOutQuad',
swing: function (x, t, b, c, d) {
//alert(jQuery.easing.default);
return jQuery.easing[jQuery.easing.def](x, t, b, c, d);
},
easeInQuad: function (x, t, b, c, d) {
return c*(t/=d)*t + b;
},
easeOutQuad: function (x, t, b, c, d) {
return -c *(t/=d)*(t-2) + b;
},
easeInOutQuad: function (x, t, b, c, d) {
if ((t/=d/2) < 1) return c/2*t*t + b;
return -c/2 * ((--t)*(t-2) - 1) + b;
},
easeInCubic: function (x, t, b, c, d) {
return c*(t/=d)*t*t + b;
},
easeOutCubic: function (x, t, b, c, d) {
return c*((t=t/d-1)*t*t + 1) + b;
},
easeInOutCubic: function (x, t, b, c, d) {
if ((t/=d/2) < 1) return c/2*t*t*t + b;
return c/2*((t-=2)*t*t + 2) + b;
},
easeInQuart: function (x, t, b, c, d) {
return c*(t/=d)*t*t*t + b;
},
easeOutQuart: function (x, t, b, c, d) {
return -c * ((t=t/d-1)*t*t*t - 1) + b;
},
easeInOutQuart: function (x, t, b, c, d) {
if ((t/=d/2) < 1) return c/2*t*t*t*t + b;
return -c/2 * ((t-=2)*t*t*t - 2) + b;
},
easeInQuint: function (x, t, b, c, d) {
return c*(t/=d)*t*t*t*t + b;
},
easeOutQuint: function (x, t, b, c, d) {
return c*((t=t/d-1)*t*t*t*t + 1) + b;
},
easeInOutQuint: function (x, t, b, c, d) {
if ((t/=d/2) < 1) return c/2*t*t*t*t*t + b;
return c/2*((t-=2)*t*t*t*t + 2) + b;
},
easeInSine: function (x, t, b, c, d) {
return -c * Math.cos(t/d * (Math.PI/2)) + c + b;
},
easeOutSine: function (x, t, b, c, d) {
return c * Math.sin(t/d * (Math.PI/2)) + b;
},
easeInOutSine: function (x, t, b, c, d) {
return -c/2 * (Math.cos(Math.PI*t/d) - 1) + b;
},
easeInExpo: function (x, t, b, c, d) {
return (t==0) ? b : c * Math.pow(2, 10 * (t/d - 1)) + b;
},
easeOutExpo: function (x, t, b, c, d) {
return (t==d) ? b+c : c * (-Math.pow(2, -10 * t/d) + 1) + b;
},
easeInOutExpo: function (x, t, b, c, d) {
if (t==0) return b;
if (t==d) return b+c;
if ((t/=d/2) < 1) return c/2 * Math.pow(2, 10 * (t - 1)) + b;
return c/2 * (-Math.pow(2, -10 * --t) + 2) + b;
},
easeInCirc: function (x, t, b, c, d) {
return -c * (Math.sqrt(1 - (t/=d)*t) - 1) + b;
},
easeOutCirc: function (x, t, b, c, d) {
return c * Math.sqrt(1 - (t=t/d-1)*t) + b;
},
easeInOutCirc: function (x, t, b, c, d) {
if ((t/=d/2) < 1) return -c/2 * (Math.sqrt(1 - t*t) - 1) + b;
return c/2 * (Math.sqrt(1 - (t-=2)*t) + 1) + b;
},
easeInElastic: function (x, t, b, c, d) {
var s=1.70158;var p=0;var a=c;
if (t==0) return b; if ((t/=d)==1) return b+c; if (!p) p=d*.3;
if (a < Math.abs(c)) { a=c; var s=p/4; }
else var s = p/(2*Math.PI) * Math.asin (c/a);
return -(a*Math.pow(2,10*(t-=1)) * Math.sin( (t*d-s)*(2*Math.PI)/p )) + b;
},
easeOutElastic: function (x, t, b, c, d) {
var s=1.70158;var p=0;var a=c;
if (t==0) return b; if ((t/=d)==1) return b+c; if (!p) p=d*.3;
if (a < Math.abs(c)) { a=c; var s=p/4; }
else var s = p/(2*Math.PI) * Math.asin (c/a);
return a*Math.pow(2,-10*t) * Math.sin( (t*d-s)*(2*Math.PI)/p ) + c + b;
},
easeInOutElastic: function (x, t, b, c, d) {
var s=1.70158;var p=0;var a=c;
if (t==0) return b; if ((t/=d/2)==2) return b+c; if (!p) p=d*(.3*1.5);
if (a < Math.abs(c)) { a=c; var s=p/4; }
else var s = p/(2*Math.PI) * Math.asin (c/a);
if (t < 1) return -.5*(a*Math.pow(2,10*(t-=1)) * Math.sin( (t*d-s)*(2*Math.PI)/p )) + b;
return a*Math.pow(2,-10*(t-=1)) * Math.sin( (t*d-s)*(2*Math.PI)/p )*.5 + c + b;
},
easeInBack: function (x, t, b, c, d, s) {
if (s == undefined) s = 1.70158;
return c*(t/=d)*t*((s+1)*t - s) + b;
},
easeOutBack: function (x, t, b, c, d, s) {
if (s == undefined) s = 1.70158;
return c*((t=t/d-1)*t*((s+1)*t + s) + 1) + b;
},
easeInOutBack: function (x, t, b, c, d, s) {
if (s == undefined) s = 1.70158;
if ((t/=d/2) < 1) return c/2*(t*t*(((s*=(1.525))+1)*t - s)) + b;
return c/2*((t-=2)*t*(((s*=(1.525))+1)*t + s) + 2) + b;
},
easeInBounce: function (x, t, b, c, d) {
return c - jQuery.easing.easeOutBounce (x, d-t, 0, c, d) + b;
},
easeOutBounce: function (x, t, b, c, d) {
if ((t/=d) < (1/2.75)) {
return c*(7.5625*t*t) + b;
} else if (t < (2/2.75)) {
return c*(7.5625*(t-=(1.5/2.75))*t + .75) + b;
} else if (t < (2.5/2.75)) {
return c*(7.5625*(t-=(2.25/2.75))*t + .9375) + b;
} else {
return c*(7.5625*(t-=(2.625/2.75))*t + .984375) + b;
}
},
easeInOutBounce: function (x, t, b, c, d) {
if (t < d/2) return jQuery.easing.easeInBounce (x, t*2, 0, c, d) * .5 + b;
return jQuery.easing.easeOutBounce (x, t*2-d, 0, c, d) * .5 + c*.5 + b;
}
});
/*
*
* TERMS OF USE - EASING EQUATIONS
*
* Open source under the BSD License.
*
* Copyright © 2001 Robert Penner
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without modification,
* are permitted provided that the following conditions are met:
*
* Redistributions of source code must retain the above copyright notice, this list of
* conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above copyright notice, this list
* of conditions and the following disclaimer in the documentation and/or other materials
* provided with the distribution.
*
* Neither the name of the author nor the names of contributors may be used to endorse
* or promote products derived from this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY
* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
* MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
* COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
* EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
* GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
* AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
* OF THE POSSIBILITY OF SUCH DAMAGE.
*
*/

View File

@@ -1,33 +0,0 @@
(function(factory) {
if (typeof define === 'function' && define.amd) {
define(['jquery', 'hammerjs'], factory);
} else if (typeof exports === 'object') {
factory(require('jquery'), require('hammerjs'));
} else {
factory(jQuery, Hammer);
}
}(function($, Hammer) {
function hammerify(el, options) {
var $el = $(el);
if(!$el.data("hammer")) {
$el.data("hammer", new Hammer($el[0], options));
}
}
$.fn.hammer = function(options) {
return this.each(function() {
hammerify(this, options);
});
};
// extend the emit method to also trigger jQuery events
Hammer.Manager.prototype.emit = (function(originalEmit) {
return function(type, data) {
originalEmit.call(this, type, data);
$(this.element).trigger({
type: type,
gesture: data
});
};
})(Hammer.Manager.prototype.emit);
}));

View File

@@ -1 +0,0 @@
!function(t){"function"==typeof define&&define.amd?define(["jquery"],t):t(jQuery)}(function(t){function e(){var e=a(this),o=r.settings;return isNaN(e.datetime)||(0==o.cutoff||Math.abs(n(e.datetime))<o.cutoff)&&t(this).text(i(e.datetime)),this}function a(e){if(e=t(e),!e.data("timeago")){e.data("timeago",{datetime:r.datetime(e)});var a=t.trim(e.text());r.settings.localeTitle?e.attr("title",e.data("timeago").datetime.toLocaleString()):!(a.length>0)||r.isTime(e)&&e.attr("title")||e.attr("title",a)}return e.data("timeago")}function i(t){return r.inWords(n(t))}function n(t){return(new Date).getTime()-t.getTime()}t.timeago=function(e){return i(e instanceof Date?e:"string"==typeof e?t.timeago.parse(e):"number"==typeof e?new Date(e):t.timeago.datetime(e))};var r=t.timeago;t.extend(t.timeago,{settings:{refreshMillis:6e4,allowPast:!0,allowFuture:!1,localeTitle:!1,cutoff:0,strings:{prefixAgo:null,prefixFromNow:null,suffixAgo:"ago",suffixFromNow:"from now",inPast:"any moment now",seconds:"less than a minute",minute:"about a minute",minutes:"%d minutes",hour:"about an hour",hours:"about %d hours",day:"a day",days:"%d days",month:"about a month",months:"%d months",year:"about a year",years:"%d years",wordSeparator:" ",numbers:[]}},inWords:function(e){function a(a,n){var r=t.isFunction(a)?a(n,e):a,o=i.numbers&&i.numbers[n]||n;return r.replace(/%d/i,o)}if(!this.settings.allowPast&&!this.settings.allowFuture)throw"timeago allowPast and allowFuture settings can not both be set to false.";var i=this.settings.strings,n=i.prefixAgo,r=i.suffixAgo;if(this.settings.allowFuture&&0>e&&(n=i.prefixFromNow,r=i.suffixFromNow),!this.settings.allowPast&&e>=0)return this.settings.strings.inPast;var o=Math.abs(e)/1e3,s=o/60,u=s/60,m=u/24,l=m/365,d=45>o&&a(i.seconds,Math.round(o))||90>o&&a(i.minute,1)||45>s&&a(i.minutes,Math.round(s))||90>s&&a(i.hour,1)||24>u&&a(i.hours,Math.round(u))||42>u&&a(i.day,1)||30>m&&a(i.days,Math.round(m))||45>m&&a(i.month,1)||365>m&&a(i.months,Math.round(m/30))||1.5>l&&a(i.year,1)||a(i.years,Math.round(l)),f=i.wordSeparator||"";return void 0===i.wordSeparator&&(f=" "),t.trim([n,d,r].join(f))},parse:function(e){var a=t.trim(e);return a=a.replace(/\.\d+/,""),a=a.replace(/-/,"/").replace(/-/,"/"),a=a.replace(/T/," ").replace(/Z/," UTC"),a=a.replace(/([\+\-]\d\d)\:?(\d\d)/," $1$2"),a=a.replace(/([\+\-]\d\d)$/," $100"),new Date(a)},datetime:function(e){var a=t(e).attr(r.isTime(e)?"datetime":"title");return r.parse(a)},isTime:function(e){return"time"===t(e).get(0).tagName.toLowerCase()}});var o={init:function(){var a=t.proxy(e,this);a();var i=r.settings;i.refreshMillis>0&&(this._timeagoInterval=setInterval(a,i.refreshMillis))},update:function(a){var i=r.parse(a);t(this).data("timeago",{datetime:i}),r.settings.localeTitle&&t(this).attr("title",i.toLocaleString()),e.apply(this)},updateFromDOM:function(){t(this).data("timeago",{datetime:r.parse(t(this).attr(r.isTime(this)?"datetime":"title"))}),e.apply(this)},dispose:function(){this._timeagoInterval&&(window.clearInterval(this._timeagoInterval),this._timeagoInterval=null)}};t.fn.timeago=function(t,e){var a=t?o[t]:o.init;if(!a)throw new Error("Unknown function name '"+t+"' for timeago");return this.each(function(){a.call(this,e)}),this},document.createElement("abbr"),document.createElement("time")});

View File

@@ -1,269 +0,0 @@
(function ($) {
$.fn.materialbox = function () {
return this.each(function() {
if ($(this).hasClass('initialized')) {
return;
}
$(this).addClass('initialized');
var overlayActive = false;
var doneAnimating = true;
var inDuration = 275;
var outDuration = 200;
var origin = $(this);
var placeholder = $('<div></div>').addClass('material-placeholder');
var originalWidth = 0;
var originalHeight = 0;
var ancestorsChanged;
var ancestor;
origin.wrap(placeholder);
origin.on('click', function(){
var placeholder = origin.parent('.material-placeholder');
var windowWidth = window.innerWidth;
var windowHeight = window.innerHeight;
var originalWidth = origin.width();
var originalHeight = origin.height();
// If already modal, return to original
if (doneAnimating === false) {
returnToOriginal();
return false;
}
else if (overlayActive && doneAnimating===true) {
returnToOriginal();
return false;
}
// Set states
doneAnimating = false;
origin.addClass('active');
overlayActive = true;
// Set positioning for placeholder
placeholder.css({
width: placeholder[0].getBoundingClientRect().width,
height: placeholder[0].getBoundingClientRect().height,
position: 'relative',
top: 0,
left: 0
});
// Find ancestor with overflow: hidden; and remove it
ancestorsChanged = undefined;
ancestor = placeholder[0].parentNode;
var count = 0;
while (ancestor !== null && !$(ancestor).is(document)) {
var curr = $(ancestor);
if (curr.css('overflow') !== 'visible') {
curr.css('overflow', 'visible');
if (ancestorsChanged === undefined) {
ancestorsChanged = curr;
}
else {
ancestorsChanged = ancestorsChanged.add(curr);
}
}
ancestor = ancestor.parentNode;
}
// Set css on origin
origin.css({position: 'absolute', 'z-index': 1000})
.data('width', originalWidth)
.data('height', originalHeight);
// Add overlay
var overlay = $('<div id="materialbox-overlay"></div>')
.css({
opacity: 0
})
.click(function(){
if (doneAnimating === true)
returnToOriginal();
});
// Animate Overlay
// Put before in origin image to preserve z-index layering.
origin.before(overlay);
overlay.velocity({opacity: 1},
{duration: inDuration, queue: false, easing: 'easeOutQuad'} );
// Add and animate caption if it exists
if (origin.data('caption') !== "") {
var $photo_caption = $('<div class="materialbox-caption"></div>');
$photo_caption.text(origin.data('caption'));
$('body').append($photo_caption);
$photo_caption.css({ "display": "inline" });
$photo_caption.velocity({opacity: 1}, {duration: inDuration, queue: false, easing: 'easeOutQuad'});
}
// Resize Image
var ratio = 0;
var widthPercent = originalWidth / windowWidth;
var heightPercent = originalHeight / windowHeight;
var newWidth = 0;
var newHeight = 0;
if (widthPercent > heightPercent) {
ratio = originalHeight / originalWidth;
newWidth = windowWidth * 0.9;
newHeight = windowWidth * 0.9 * ratio;
}
else {
ratio = originalWidth / originalHeight;
newWidth = (windowHeight * 0.9) * ratio;
newHeight = windowHeight * 0.9;
}
// Animate image + set z-index
if(origin.hasClass('responsive-img')) {
origin.velocity({'max-width': newWidth, 'width': originalWidth}, {duration: 0, queue: false,
complete: function(){
origin.css({left: 0, top: 0})
.velocity(
{
height: newHeight,
width: newWidth,
left: $(document).scrollLeft() + windowWidth/2 - origin.parent('.material-placeholder').offset().left - newWidth/2,
top: $(document).scrollTop() + windowHeight/2 - origin.parent('.material-placeholder').offset().top - newHeight/ 2
},
{
duration: inDuration,
queue: false,
easing: 'easeOutQuad',
complete: function(){doneAnimating = true;}
}
);
} // End Complete
}); // End Velocity
}
else {
origin.css('left', 0)
.css('top', 0)
.velocity(
{
height: newHeight,
width: newWidth,
left: $(document).scrollLeft() + windowWidth/2 - origin.parent('.material-placeholder').offset().left - newWidth/2,
top: $(document).scrollTop() + windowHeight/2 - origin.parent('.material-placeholder').offset().top - newHeight/ 2
},
{
duration: inDuration,
queue: false,
easing: 'easeOutQuad',
complete: function(){doneAnimating = true;}
}
); // End Velocity
}
}); // End origin on click
// Return on scroll
$(window).scroll(function() {
if (overlayActive) {
returnToOriginal();
}
});
// Return on ESC
$(document).keyup(function(e) {
if (e.keyCode === 27 && doneAnimating === true) { // ESC key
if (overlayActive) {
returnToOriginal();
}
}
});
// This function returns the modaled image to the original spot
function returnToOriginal() {
doneAnimating = false;
var placeholder = origin.parent('.material-placeholder');
var windowWidth = window.innerWidth;
var windowHeight = window.innerHeight;
var originalWidth = origin.data('width');
var originalHeight = origin.data('height');
origin.velocity("stop", true);
$('#materialbox-overlay').velocity("stop", true);
$('.materialbox-caption').velocity("stop", true);
$('#materialbox-overlay').velocity({opacity: 0}, {
duration: outDuration, // Delay prevents animation overlapping
queue: false, easing: 'easeOutQuad',
complete: function(){
// Remove Overlay
overlayActive = false;
$(this).remove();
}
});
// Resize Image
origin.velocity(
{
width: originalWidth,
height: originalHeight,
left: 0,
top: 0
},
{
duration: outDuration,
queue: false, easing: 'easeOutQuad'
}
);
// Remove Caption + reset css settings on image
$('.materialbox-caption').velocity({opacity: 0}, {
duration: outDuration, // Delay prevents animation overlapping
queue: false, easing: 'easeOutQuad',
complete: function(){
placeholder.css({
height: '',
width: '',
position: '',
top: '',
left: ''
});
origin.css({
height: '',
top: '',
left: '',
width: '',
'max-width': '',
position: '',
'z-index': ''
});
// Remove class
origin.removeClass('active');
doneAnimating = true;
$(this).remove();
// Remove overflow overrides on ancestors
if (ancestorsChanged) {
ancestorsChanged.css('overflow', '');
}
}
});
}
});
};
$(document).ready(function(){
$('.materialboxed').materialbox();
});
}( jQuery ));

View File

@@ -1,58 +0,0 @@
(function ($) {
$.fn.parallax = function () {
var window_width = $(window).width();
// Parallax Scripts
return this.each(function(i) {
var $this = $(this);
$this.addClass('parallax');
function updateParallax(initial) {
var container_height;
if (window_width < 601) {
container_height = ($this.height() > 0) ? $this.height() : $this.children("img").height();
}
else {
container_height = ($this.height() > 0) ? $this.height() : 500;
}
var $img = $this.children("img").first();
var img_height = $img.height();
var parallax_dist = img_height - container_height;
var bottom = $this.offset().top + container_height;
var top = $this.offset().top;
var scrollTop = $(window).scrollTop();
var windowHeight = window.innerHeight;
var windowBottom = scrollTop + windowHeight;
var percentScrolled = (windowBottom - top) / (container_height + windowHeight);
var parallax = Math.round((parallax_dist * percentScrolled));
if (initial) {
$img.css('display', 'block');
}
if ((bottom > scrollTop) && (top < (scrollTop + windowHeight))) {
$img.css('transform', "translate3D(-50%," + parallax + "px, 0)");
}
}
// Wait for image load
$this.children("img").one("load", function() {
updateParallax(true);
}).each(function() {
if(this.complete) $(this).load();
});
$(window).scroll(function() {
window_width = $(window).width();
updateParallax(false);
});
$(window).resize(function() {
window_width = $(window).width();
updateParallax(false);
});
});
};
}( jQuery ));

View File

@@ -1,71 +0,0 @@
(function ($) {
$.fn.pushpin = function (options) {
// Defaults
var defaults = {
top: 0,
bottom: Infinity,
offset: 0
};
// Remove pushpin event and classes
if (options === "remove") {
this.each(function () {
if (id = $(this).data('pushpin-id')) {
$(window).off('scroll.' + id);
$(this).removeData('pushpin-id').removeClass('pin-top pinned pin-bottom').removeAttr('style');
}
});
return false;
}
options = $.extend(defaults, options);
$index = 0;
return this.each(function() {
var $uniqueId = Materialize.guid(),
$this = $(this),
$original_offset = $(this).offset().top;
function removePinClasses(object) {
object.removeClass('pin-top');
object.removeClass('pinned');
object.removeClass('pin-bottom');
}
function updateElements(objects, scrolled) {
objects.each(function () {
// Add position fixed (because its between top and bottom)
if (options.top <= scrolled && options.bottom >= scrolled && !$(this).hasClass('pinned')) {
removePinClasses($(this));
$(this).css('top', options.offset);
$(this).addClass('pinned');
}
// Add pin-top (when scrolled position is above top)
if (scrolled < options.top && !$(this).hasClass('pin-top')) {
removePinClasses($(this));
$(this).css('top', 0);
$(this).addClass('pin-top');
}
// Add pin-bottom (when scrolled position is below bottom)
if (scrolled > options.bottom && !$(this).hasClass('pin-bottom')) {
removePinClasses($(this));
$(this).addClass('pin-bottom');
$(this).css('top', options.bottom - $original_offset);
}
});
}
$(this).data('pushpin-id', $uniqueId);
updateElements($this, $(window).scrollTop());
$(window).on('scroll.' + $uniqueId, function () {
var $scrolled = $(window).scrollTop() + options.offset;
updateElements($this, $scrolled);
});
});
};
}( jQuery ));

View File

@@ -1,48 +0,0 @@
(function($) {
// Input: Array of JSON objects {selector, offset, callback}
Materialize.scrollFire = function(options) {
var didScroll = false;
window.addEventListener("scroll", function() {
didScroll = true;
});
// Rate limit to 100ms
setInterval(function() {
if(didScroll) {
didScroll = false;
var windowScroll = window.pageYOffset + window.innerHeight;
for (var i = 0 ; i < options.length; i++) {
// Get options from each line
var value = options[i];
var selector = value.selector,
offset = value.offset,
callback = value.callback;
var currentElement = document.querySelector(selector);
if ( currentElement !== null) {
var elementOffset = currentElement.getBoundingClientRect().top + window.pageYOffset;
if (windowScroll > (elementOffset + offset)) {
if (value.done !== true) {
if (typeof(callback) === 'function') {
callback.call(this, currentElement);
} else if (typeof(callback) === 'string') {
var callbackFunc = new Function(callback);
callbackFunc(currentElement);
}
value.done = true;
}
}
}
}
}
}, 100);
};
})(jQuery);

View File

@@ -1,283 +0,0 @@
/**
* Extend jquery with a scrollspy plugin.
* This watches the window scroll and fires events when elements are scrolled into viewport.
*
* throttle() and getTime() taken from Underscore.js
* https://github.com/jashkenas/underscore
*
* @author Copyright 2013 John Smart
* @license https://raw.github.com/thesmart/jquery-scrollspy/master/LICENSE
* @see https://github.com/thesmart
* @version 0.1.2
*/
(function($) {
var jWindow = $(window);
var elements = [];
var elementsInView = [];
var isSpying = false;
var ticks = 0;
var unique_id = 1;
var offset = {
top : 0,
right : 0,
bottom : 0,
left : 0,
}
/**
* Find elements that are within the boundary
* @param {number} top
* @param {number} right
* @param {number} bottom
* @param {number} left
* @return {jQuery} A collection of elements
*/
function findElements(top, right, bottom, left) {
var hits = $();
$.each(elements, function(i, element) {
if (element.height() > 0) {
var elTop = element.offset().top,
elLeft = element.offset().left,
elRight = elLeft + element.width(),
elBottom = elTop + element.height();
var isIntersect = !(elLeft > right ||
elRight < left ||
elTop > bottom ||
elBottom < top);
if (isIntersect) {
hits.push(element);
}
}
});
return hits;
}
/**
* Called when the user scrolls the window
*/
function onScroll() {
// unique tick id
++ticks;
// viewport rectangle
var top = jWindow.scrollTop(),
left = jWindow.scrollLeft(),
right = left + jWindow.width(),
bottom = top + jWindow.height();
// determine which elements are in view
// + 60 accounts for fixed nav
var intersections = findElements(top+offset.top + 200, right+offset.right, bottom+offset.bottom, left+offset.left);
$.each(intersections, function(i, element) {
var lastTick = element.data('scrollSpy:ticks');
if (typeof lastTick != 'number') {
// entered into view
element.triggerHandler('scrollSpy:enter');
}
// update tick id
element.data('scrollSpy:ticks', ticks);
});
// determine which elements are no longer in view
$.each(elementsInView, function(i, element) {
var lastTick = element.data('scrollSpy:ticks');
if (typeof lastTick == 'number' && lastTick !== ticks) {
// exited from view
element.triggerHandler('scrollSpy:exit');
element.data('scrollSpy:ticks', null);
}
});
// remember elements in view for next tick
elementsInView = intersections;
}
/**
* Called when window is resized
*/
function onWinSize() {
jWindow.trigger('scrollSpy:winSize');
}
/**
* Get time in ms
* @license https://raw.github.com/jashkenas/underscore/master/LICENSE
* @type {function}
* @return {number}
*/
var getTime = (Date.now || function () {
return new Date().getTime();
});
/**
* Returns a function, that, when invoked, will only be triggered at most once
* during a given window of time. Normally, the throttled function will run
* as much as it can, without ever going more than once per `wait` duration;
* but if you'd like to disable the execution on the leading edge, pass
* `{leading: false}`. To disable execution on the trailing edge, ditto.
* @license https://raw.github.com/jashkenas/underscore/master/LICENSE
* @param {function} func
* @param {number} wait
* @param {Object=} options
* @returns {Function}
*/
function throttle(func, wait, options) {
var context, args, result;
var timeout = null;
var previous = 0;
options || (options = {});
var later = function () {
previous = options.leading === false ? 0 : getTime();
timeout = null;
result = func.apply(context, args);
context = args = null;
};
return function () {
var now = getTime();
if (!previous && options.leading === false) previous = now;
var remaining = wait - (now - previous);
context = this;
args = arguments;
if (remaining <= 0) {
clearTimeout(timeout);
timeout = null;
previous = now;
result = func.apply(context, args);
context = args = null;
} else if (!timeout && options.trailing !== false) {
timeout = setTimeout(later, remaining);
}
return result;
};
};
/**
* Enables ScrollSpy using a selector
* @param {jQuery|string} selector The elements collection, or a selector
* @param {Object=} options Optional.
throttle : number -> scrollspy throttling. Default: 100 ms
offsetTop : number -> offset from top. Default: 0
offsetRight : number -> offset from right. Default: 0
offsetBottom : number -> offset from bottom. Default: 0
offsetLeft : number -> offset from left. Default: 0
* @returns {jQuery}
*/
$.scrollSpy = function(selector, options) {
var defaults = {
throttle: 100,
scrollOffset: 200 // offset - 200 allows elements near bottom of page to scroll
};
options = $.extend(defaults, options);
var visible = [];
selector = $(selector);
selector.each(function(i, element) {
elements.push($(element));
$(element).data("scrollSpy:id", i);
// Smooth scroll to section
$('a[href="#' + $(element).attr('id') + '"]').click(function(e) {
e.preventDefault();
var offset = $(this.hash).offset().top + 1;
$('html, body').animate({ scrollTop: offset - options.scrollOffset }, {duration: 400, queue: false, easing: 'easeOutCubic'});
});
});
offset.top = options.offsetTop || 0;
offset.right = options.offsetRight || 0;
offset.bottom = options.offsetBottom || 0;
offset.left = options.offsetLeft || 0;
var throttledScroll = throttle(onScroll, options.throttle || 100);
var readyScroll = function(){
$(document).ready(throttledScroll);
};
if (!isSpying) {
jWindow.on('scroll', readyScroll);
jWindow.on('resize', readyScroll);
isSpying = true;
}
// perform a scan once, after current execution context, and after dom is ready
setTimeout(readyScroll, 0);
selector.on('scrollSpy:enter', function() {
visible = $.grep(visible, function(value) {
return value.height() != 0;
});
var $this = $(this);
if (visible[0]) {
$('a[href="#' + visible[0].attr('id') + '"]').removeClass('active');
if ($this.data('scrollSpy:id') < visible[0].data('scrollSpy:id')) {
visible.unshift($(this));
}
else {
visible.push($(this));
}
}
else {
visible.push($(this));
}
$('a[href="#' + visible[0].attr('id') + '"]').addClass('active');
});
selector.on('scrollSpy:exit', function() {
visible = $.grep(visible, function(value) {
return value.height() != 0;
});
if (visible[0]) {
$('a[href="#' + visible[0].attr('id') + '"]').removeClass('active');
var $this = $(this);
visible = $.grep(visible, function(value) {
return value.attr('id') != $this.attr('id');
});
if (visible[0]) { // Check if empty
$('a[href="#' + visible[0].attr('id') + '"]').addClass('active');
}
}
});
return selector;
};
/**
* Listen for window resize events
* @param {Object=} options Optional. Set { throttle: number } to change throttling. Default: 100 ms
* @returns {jQuery} $(window)
*/
$.winSizeSpy = function(options) {
$.winSizeSpy = function() { return jWindow; }; // lock from multiple calls
options = options || {
throttle: 100
};
return jWindow.on('resize', throttle(onWinSize, options.throttle || 100));
};
/**
* Enables ScrollSpy on a collection of elements
* e.g. $('.scrollSpy').scrollSpy()
* @param {Object=} options Optional.
throttle : number -> scrollspy throttling. Default: 100 ms
offsetTop : number -> offset from top. Default: 0
offsetRight : number -> offset from right. Default: 0
offsetBottom : number -> offset from bottom. Default: 0
offsetLeft : number -> offset from left. Default: 0
* @returns {jQuery}
*/
$.fn.scrollSpy = function(options) {
return $.scrollSpy($(this), options);
};
})(jQuery);

View File

@@ -1,352 +0,0 @@
(function ($) {
var methods = {
init : function(options) {
var defaults = {
menuWidth: 300,
edge: 'left',
closeOnClick: false
};
options = $.extend(defaults, options);
$(this).each(function(){
var $this = $(this);
var menu_id = $("#"+ $this.attr('data-activates'));
// Set to width
if (options.menuWidth != 300) {
menu_id.css('width', options.menuWidth);
}
// Add Touch Area
var dragTarget = $('<div class="drag-target"></div>');
$('body').append(dragTarget);
if (options.edge == 'left') {
menu_id.css('transform', 'translateX(-100%)');
dragTarget.css({'left': 0}); // Add Touch Area
}
else {
menu_id.addClass('right-aligned') // Change text-alignment to right
.css('transform', 'translateX(100%)');
dragTarget.css({'right': 0}); // Add Touch Area
}
// If fixed sidenav, bring menu out
if (menu_id.hasClass('fixed')) {
if (window.innerWidth > 992) {
menu_id.css('transform', 'translateX(0)');
}
}
// Window resize to reset on large screens fixed
if (menu_id.hasClass('fixed')) {
$(window).resize( function() {
if (window.innerWidth > 992) {
// Close menu if window is resized bigger than 992 and user has fixed sidenav
if ($('#sidenav-overlay').length !== 0 && menuOut) {
removeMenu(true);
}
else {
// menu_id.removeAttr('style');
menu_id.css('transform', 'translateX(0%)');
// menu_id.css('width', options.menuWidth);
}
}
else if (menuOut === false){
if (options.edge === 'left') {
menu_id.css('transform', 'translateX(-100%)');
} else {
menu_id.css('transform', 'translateX(100%)');
}
}
});
}
// if closeOnClick, then add close event for all a tags in side sideNav
if (options.closeOnClick === true) {
menu_id.on("click.itemclick", "a:not(.collapsible-header)", function(){
removeMenu();
});
}
function removeMenu(restoreNav) {
panning = false;
menuOut = false;
// Reenable scrolling
$('body').css({
overflow: '',
width: ''
});
$('#sidenav-overlay').velocity({opacity: 0}, {duration: 200,
queue: false, easing: 'easeOutQuad',
complete: function() {
$(this).remove();
} });
if (options.edge === 'left') {
// Reset phantom div
dragTarget.css({width: '', right: '', left: '0'});
menu_id.velocity(
{'translateX': '-100%'},
{ duration: 200,
queue: false,
easing: 'easeOutCubic',
complete: function() {
if (restoreNav === true) {
// Restore Fixed sidenav
menu_id.removeAttr('style');
menu_id.css('width', options.menuWidth);
}
}
});
}
else {
// Reset phantom div
dragTarget.css({width: '', right: '0', left: ''});
menu_id.velocity(
{'translateX': '100%'},
{ duration: 200,
queue: false,
easing: 'easeOutCubic',
complete: function() {
if (restoreNav === true) {
// Restore Fixed sidenav
menu_id.removeAttr('style');
menu_id.css('width', options.menuWidth);
}
}
});
}
}
// Touch Event
var panning = false;
var menuOut = false;
dragTarget.on('click', function(){
if (menuOut) {
removeMenu();
}
});
dragTarget.hammer({
prevent_default: false
}).bind('pan', function(e) {
if (e.gesture.pointerType == "touch") {
var direction = e.gesture.direction;
var x = e.gesture.center.x;
var y = e.gesture.center.y;
var velocityX = e.gesture.velocityX;
// Disable Scrolling
var $body = $('body');
var oldWidth = $body.innerWidth();
$body.css('overflow', 'hidden');
$body.width(oldWidth);
// If overlay does not exist, create one and if it is clicked, close menu
if ($('#sidenav-overlay').length === 0) {
var overlay = $('<div id="sidenav-overlay"></div>');
overlay.css('opacity', 0).click( function(){
removeMenu();
});
$('body').append(overlay);
}
// Keep within boundaries
if (options.edge === 'left') {
if (x > options.menuWidth) { x = options.menuWidth; }
else if (x < 0) { x = 0; }
}
if (options.edge === 'left') {
// Left Direction
if (x < (options.menuWidth / 2)) { menuOut = false; }
// Right Direction
else if (x >= (options.menuWidth / 2)) { menuOut = true; }
menu_id.css('transform', 'translateX(' + (x - options.menuWidth) + 'px)');
}
else {
// Left Direction
if (x < (window.innerWidth - options.menuWidth / 2)) {
menuOut = true;
}
// Right Direction
else if (x >= (window.innerWidth - options.menuWidth / 2)) {
menuOut = false;
}
var rightPos = (x - options.menuWidth / 2);
if (rightPos < 0) {
rightPos = 0;
}
menu_id.css('transform', 'translateX(' + rightPos + 'px)');
}
// Percentage overlay
var overlayPerc;
if (options.edge === 'left') {
overlayPerc = x / options.menuWidth;
$('#sidenav-overlay').velocity({opacity: overlayPerc }, {duration: 10, queue: false, easing: 'easeOutQuad'});
}
else {
overlayPerc = Math.abs((x - window.innerWidth) / options.menuWidth);
$('#sidenav-overlay').velocity({opacity: overlayPerc }, {duration: 10, queue: false, easing: 'easeOutQuad'});
}
}
}).bind('panend', function(e) {
if (e.gesture.pointerType == "touch") {
var velocityX = e.gesture.velocityX;
var x = e.gesture.center.x;
var leftPos = x - options.menuWidth;
var rightPos = x - options.menuWidth / 2;
if (leftPos > 0 ) {
leftPos = 0;
}
if (rightPos < 0) {
rightPos = 0;
}
panning = false;
if (options.edge === 'left') {
// If velocityX <= 0.3 then the user is flinging the menu closed so ignore menuOut
if ((menuOut && velocityX <= 0.3) || velocityX < -0.5) {
// Return menu to open
if (leftPos !== 0) {
menu_id.velocity({'translateX': [0, leftPos]}, {duration: 300, queue: false, easing: 'easeOutQuad'});
}
$('#sidenav-overlay').velocity({opacity: 1 }, {duration: 50, queue: false, easing: 'easeOutQuad'});
dragTarget.css({width: '50%', right: 0, left: ''});
menuOut = true;
}
else if (!menuOut || velocityX > 0.3) {
// Enable Scrolling
$('body').css({
overflow: '',
width: ''
});
// Slide menu closed
menu_id.velocity({'translateX': [-1 * options.menuWidth - 10, leftPos]}, {duration: 200, queue: false, easing: 'easeOutQuad'});
$('#sidenav-overlay').velocity({opacity: 0 }, {duration: 200, queue: false, easing: 'easeOutQuad',
complete: function () {
$(this).remove();
}});
dragTarget.css({width: '10px', right: '', left: 0});
}
}
else {
if ((menuOut && velocityX >= -0.3) || velocityX > 0.5) {
// Return menu to open
if (rightPos !== 0) {
menu_id.velocity({'translateX': [0, rightPos]}, {duration: 300, queue: false, easing: 'easeOutQuad'});
}
$('#sidenav-overlay').velocity({opacity: 1 }, {duration: 50, queue: false, easing: 'easeOutQuad'});
dragTarget.css({width: '50%', right: '', left: 0});
menuOut = true;
}
else if (!menuOut || velocityX < -0.3) {
// Enable Scrolling
$('body').css({
overflow: '',
width: ''
});
// Slide menu closed
menu_id.velocity({'translateX': [options.menuWidth + 10, rightPos]}, {duration: 200, queue: false, easing: 'easeOutQuad'});
$('#sidenav-overlay').velocity({opacity: 0 }, {duration: 200, queue: false, easing: 'easeOutQuad',
complete: function () {
$(this).remove();
}});
dragTarget.css({width: '10px', right: 0, left: ''});
}
}
}
});
$this.click(function() {
if (menuOut === true) {
menuOut = false;
panning = false;
removeMenu();
}
else {
// Disable Scrolling
var $body = $('body');
var oldWidth = $body.innerWidth();
$body.css('overflow', 'hidden');
$body.width(oldWidth);
// Push current drag target on top of DOM tree
$('body').append(dragTarget);
if (options.edge === 'left') {
dragTarget.css({width: '50%', right: 0, left: ''});
menu_id.velocity({'translateX': [0, -1 * options.menuWidth]}, {duration: 300, queue: false, easing: 'easeOutQuad'});
}
else {
dragTarget.css({width: '50%', right: '', left: 0});
menu_id.velocity({'translateX': [0, options.menuWidth]}, {duration: 300, queue: false, easing: 'easeOutQuad'});
}
var overlay = $('<div id="sidenav-overlay"></div>');
overlay.css('opacity', 0)
.click(function(){
menuOut = false;
panning = false;
removeMenu();
overlay.velocity({opacity: 0}, {duration: 300, queue: false, easing: 'easeOutQuad',
complete: function() {
$(this).remove();
} });
});
$('body').append(overlay);
overlay.velocity({opacity: 1}, {duration: 300, queue: false, easing: 'easeOutQuad',
complete: function () {
menuOut = true;
panning = false;
}
});
}
return false;
});
});
},
show : function() {
this.trigger('click');
},
hide : function() {
$('#sidenav-overlay').trigger('click');
}
};
$.fn.sideNav = function(methodOrOptions) {
if ( methods[methodOrOptions] ) {
return methods[ methodOrOptions ].apply( this, Array.prototype.slice.call( arguments, 1 ));
} else if ( typeof methodOrOptions === 'object' || ! methodOrOptions ) {
// Default to "init"
return methods.init.apply( this, arguments );
} else {
$.error( 'Method ' + methodOrOptions + ' does not exist on jQuery.sideNav' );
}
}; // Plugin end
}( jQuery ));

View File

@@ -1,321 +0,0 @@
(function ($) {
var methods = {
init : function(options) {
var defaults = {
indicators: true,
height: 400,
transition: 500,
interval: 6000
};
options = $.extend(defaults, options);
return this.each(function() {
// For each slider, we want to keep track of
// which slide is active and its associated content
var $this = $(this);
var $slider = $this.find('ul.slides').first();
var $slides = $slider.find('> li');
var $active_index = $slider.find('.active').index();
var $active, $indicators, $interval;
if ($active_index != -1) { $active = $slides.eq($active_index); }
// Transitions the caption depending on alignment
function captionTransition(caption, duration) {
if (caption.hasClass("center-align")) {
caption.velocity({opacity: 0, translateY: -100}, {duration: duration, queue: false});
}
else if (caption.hasClass("right-align")) {
caption.velocity({opacity: 0, translateX: 100}, {duration: duration, queue: false});
}
else if (caption.hasClass("left-align")) {
caption.velocity({opacity: 0, translateX: -100}, {duration: duration, queue: false});
}
}
// This function will transition the slide to any index of the next slide
function moveToSlide(index) {
// Wrap around indices.
if (index >= $slides.length) index = 0;
else if (index < 0) index = $slides.length -1;
$active_index = $slider.find('.active').index();
// Only do if index changes
if ($active_index != index) {
$active = $slides.eq($active_index);
$caption = $active.find('.caption');
$active.removeClass('active');
$active.velocity({opacity: 0}, {duration: options.transition, queue: false, easing: 'easeOutQuad',
complete: function() {
$slides.not('.active').velocity({opacity: 0, translateX: 0, translateY: 0}, {duration: 0, queue: false});
} });
captionTransition($caption, options.transition);
// Update indicators
if (options.indicators) {
$indicators.eq($active_index).removeClass('active');
}
$slides.eq(index).velocity({opacity: 1}, {duration: options.transition, queue: false, easing: 'easeOutQuad'});
$slides.eq(index).find('.caption').velocity({opacity: 1, translateX: 0, translateY: 0}, {duration: options.transition, delay: options.transition, queue: false, easing: 'easeOutQuad'});
$slides.eq(index).addClass('active');
// Update indicators
if (options.indicators) {
$indicators.eq(index).addClass('active');
}
}
}
// Set height of slider
// If fullscreen, do nothing
if (!$this.hasClass('fullscreen')) {
if (options.indicators) {
// Add height if indicators are present
$this.height(options.height + 40);
}
else {
$this.height(options.height);
}
$slider.height(options.height);
}
// Set initial positions of captions
$slides.find('.caption').each(function () {
captionTransition($(this), 0);
});
// Move img src into background-image
$slides.find('img').each(function () {
var placeholderBase64 = 'data:image/gif;base64,R0lGODlhAQABAIABAP///wAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw==';
if ($(this).attr('src') !== placeholderBase64) {
$(this).css('background-image', 'url(' + $(this).attr('src') + ')' );
$(this).attr('src', placeholderBase64);
}
});
// dynamically add indicators
if (options.indicators) {
$indicators = $('<ul class="indicators"></ul>');
$slides.each(function( index ) {
var $indicator = $('<li class="indicator-item"></li>');
// Handle clicks on indicators
$indicator.click(function () {
var $parent = $slider.parent();
var curr_index = $parent.find($(this)).index();
moveToSlide(curr_index);
// reset interval
clearInterval($interval);
$interval = setInterval(
function(){
$active_index = $slider.find('.active').index();
if ($slides.length == $active_index + 1) $active_index = 0; // loop to start
else $active_index += 1;
moveToSlide($active_index);
}, options.transition + options.interval
);
});
$indicators.append($indicator);
});
$this.append($indicators);
$indicators = $this.find('ul.indicators').find('li.indicator-item');
}
if ($active) {
$active.show();
}
else {
$slides.first().addClass('active').velocity({opacity: 1}, {duration: options.transition, queue: false, easing: 'easeOutQuad'});
$active_index = 0;
$active = $slides.eq($active_index);
// Update indicators
if (options.indicators) {
$indicators.eq($active_index).addClass('active');
}
}
// Adjust height to current slide
$active.find('img').each(function() {
$active.find('.caption').velocity({opacity: 1, translateX: 0, translateY: 0}, {duration: options.transition, queue: false, easing: 'easeOutQuad'});
});
// auto scroll
$interval = setInterval(
function(){
$active_index = $slider.find('.active').index();
moveToSlide($active_index + 1);
}, options.transition + options.interval
);
// HammerJS, Swipe navigation
// Touch Event
var panning = false;
var swipeLeft = false;
var swipeRight = false;
$this.hammer({
prevent_default: false
}).bind('pan', function(e) {
if (e.gesture.pointerType === "touch") {
// reset interval
clearInterval($interval);
var direction = e.gesture.direction;
var x = e.gesture.deltaX;
var velocityX = e.gesture.velocityX;
$curr_slide = $slider.find('.active');
$curr_slide.velocity({ translateX: x
}, {duration: 50, queue: false, easing: 'easeOutQuad'});
// Swipe Left
if (direction === 4 && (x > ($this.innerWidth() / 2) || velocityX < -0.65)) {
swipeRight = true;
}
// Swipe Right
else if (direction === 2 && (x < (-1 * $this.innerWidth() / 2) || velocityX > 0.65)) {
swipeLeft = true;
}
// Make Slide Behind active slide visible
var next_slide;
if (swipeLeft) {
next_slide = $curr_slide.next();
if (next_slide.length === 0) {
next_slide = $slides.first();
}
next_slide.velocity({ opacity: 1
}, {duration: 300, queue: false, easing: 'easeOutQuad'});
}
if (swipeRight) {
next_slide = $curr_slide.prev();
if (next_slide.length === 0) {
next_slide = $slides.last();
}
next_slide.velocity({ opacity: 1
}, {duration: 300, queue: false, easing: 'easeOutQuad'});
}
}
}).bind('panend', function(e) {
if (e.gesture.pointerType === "touch") {
$curr_slide = $slider.find('.active');
panning = false;
curr_index = $slider.find('.active').index();
if (!swipeRight && !swipeLeft || $slides.length <=1) {
// Return to original spot
$curr_slide.velocity({ translateX: 0
}, {duration: 300, queue: false, easing: 'easeOutQuad'});
}
else if (swipeLeft) {
moveToSlide(curr_index + 1);
$curr_slide.velocity({translateX: -1 * $this.innerWidth() }, {duration: 300, queue: false, easing: 'easeOutQuad',
complete: function() {
$curr_slide.velocity({opacity: 0, translateX: 0}, {duration: 0, queue: false});
} });
}
else if (swipeRight) {
moveToSlide(curr_index - 1);
$curr_slide.velocity({translateX: $this.innerWidth() }, {duration: 300, queue: false, easing: 'easeOutQuad',
complete: function() {
$curr_slide.velocity({opacity: 0, translateX: 0}, {duration: 0, queue: false});
} });
}
swipeLeft = false;
swipeRight = false;
// Restart interval
clearInterval($interval);
$interval = setInterval(
function(){
$active_index = $slider.find('.active').index();
if ($slides.length == $active_index + 1) $active_index = 0; // loop to start
else $active_index += 1;
moveToSlide($active_index);
}, options.transition + options.interval
);
}
});
$this.on('sliderPause', function() {
clearInterval($interval);
});
$this.on('sliderStart', function() {
clearInterval($interval);
$interval = setInterval(
function(){
$active_index = $slider.find('.active').index();
if ($slides.length == $active_index + 1) $active_index = 0; // loop to start
else $active_index += 1;
moveToSlide($active_index);
}, options.transition + options.interval
);
});
$this.on('sliderNext', function() {
$active_index = $slider.find('.active').index();
moveToSlide($active_index + 1);
});
$this.on('sliderPrev', function() {
$active_index = $slider.find('.active').index();
moveToSlide($active_index - 1);
});
});
},
pause : function() {
$(this).trigger('sliderPause');
},
start : function() {
$(this).trigger('sliderStart');
},
next : function() {
$(this).trigger('sliderNext');
},
prev : function() {
$(this).trigger('sliderPrev');
}
};
$.fn.slider = function(methodOrOptions) {
if ( methods[methodOrOptions] ) {
return methods[ methodOrOptions ].apply( this, Array.prototype.slice.call( arguments, 1 ));
} else if ( typeof methodOrOptions === 'object' || ! methodOrOptions ) {
// Default to "init"
return methods.init.apply( this, arguments );
} else {
$.error( 'Method ' + methodOrOptions + ' does not exist on jQuery.tooltip' );
}
}; // Plugin end
}( jQuery ));

View File

@@ -1,148 +0,0 @@
(function ($) {
var methods = {
init : function(options) {
var defaults = {
onShow: null
};
options = $.extend(defaults, options);
return this.each(function() {
// For each set of tabs, we want to keep track of
// which tab is active and its associated content
var $this = $(this),
window_width = $(window).width();
$this.width('100%');
var $active, $content, $links = $this.find('li.tab a'),
$tabs_width = $this.width(),
$tab_width = Math.max($tabs_width, $this[0].scrollWidth) / $links.length,
$index = 0;
// If the location.hash matches one of the links, use that as the active tab.
$active = $($links.filter('[href="'+location.hash+'"]'));
// If no match is found, use the first link or any with class 'active' as the initial active tab.
if ($active.length === 0) {
$active = $(this).find('li.tab a.active').first();
}
if ($active.length === 0) {
$active = $(this).find('li.tab a').first();
}
$active.addClass('active');
$index = $links.index($active);
if ($index < 0) {
$index = 0;
}
if ($active[0] !== undefined) {
$content = $($active[0].hash);
}
// append indicator then set indicator width to tab width
$this.append('<div class="indicator"></div>');
var $indicator = $this.find('.indicator');
if ($this.is(":visible")) {
$indicator.css({"right": $tabs_width - (($index + 1) * $tab_width)});
$indicator.css({"left": $index * $tab_width});
}
$(window).resize(function () {
$tabs_width = $this.width();
$tab_width = Math.max($tabs_width, $this[0].scrollWidth) / $links.length;
if ($index < 0) {
$index = 0;
}
if ($tab_width !== 0 && $tabs_width !== 0) {
$indicator.css({"right": $tabs_width - (($index + 1) * $tab_width)});
$indicator.css({"left": $index * $tab_width});
}
});
// Hide the remaining content
$links.not($active).each(function () {
$(this.hash).hide();
});
// Bind the click event handler
$this.on('click', 'a', function(e) {
if ($(this).parent().hasClass('disabled')) {
e.preventDefault();
return;
}
// Act as regular link if target attribute is specified.
if (!!$(this).attr("target")) {
return;
}
$tabs_width = $this.width();
$tab_width = Math.max($tabs_width, $this[0].scrollWidth) / $links.length;
// Make the old tab inactive.
$active.removeClass('active');
if ($content !== undefined) {
$content.hide();
}
// Update the variables with the new link and content
$active = $(this);
$content = $(this.hash);
$links = $this.find('li.tab a');
// Make the tab active.
$active.addClass('active');
var $prev_index = $index;
$index = $links.index($(this));
if ($index < 0) {
$index = 0;
}
// Change url to current tab
// window.location.hash = $active.attr('href');
if ($content !== undefined) {
$content.show();
if (typeof(options.onShow) === "function") {
options.onShow.call(this, $content);
}
}
// Update indicator
if (($index - $prev_index) >= 0) {
$indicator.velocity({"right": $tabs_width - (($index + 1) * $tab_width)}, { duration: 300, queue: false, easing: 'easeOutQuad'});
$indicator.velocity({"left": $index * $tab_width}, {duration: 300, queue: false, easing: 'easeOutQuad', delay: 90});
}
else {
$indicator.velocity({"left": $index * $tab_width}, { duration: 300, queue: false, easing: 'easeOutQuad'});
$indicator.velocity({"right": $tabs_width - (($index + 1) * $tab_width)}, {duration: 300, queue: false, easing: 'easeOutQuad', delay: 90});
}
// Prevent the anchor's default click action
e.preventDefault();
});
});
},
select_tab : function( id ) {
this.find('a[href="#' + id + '"]').trigger('click');
}
};
$.fn.tabs = function(methodOrOptions) {
if ( methods[methodOrOptions] ) {
return methods[ methodOrOptions ].apply( this, Array.prototype.slice.call( arguments, 1 ));
} else if ( typeof methodOrOptions === 'object' || ! methodOrOptions ) {
// Default to "init"
return methods.init.apply( this, arguments );
} else {
$.error( 'Method ' + methodOrOptions + ' does not exist on jQuery.tooltip' );
}
};
$(document).ready(function(){
$('ul.tabs').tabs();
});
}( jQuery ));

View File

@@ -1,136 +0,0 @@
Materialize.toast = function (message, displayLength, className, completeCallback) {
className = className || "";
var container = document.getElementById('toast-container');
// Create toast container if it does not exist
if (container === null) {
// create notification container
container = document.createElement('div');
container.id = 'toast-container';
document.body.appendChild(container);
}
// Select and append toast
var newToast = createToast(message);
// only append toast if message is not undefined
if(message){
container.appendChild(newToast);
}
newToast.style.top = '35px';
newToast.style.opacity = 0;
// Animate toast in
Vel(newToast, { "top" : "0px", opacity: 1 }, {duration: 300,
easing: 'easeOutCubic',
queue: false});
// Allows timer to be pause while being panned
var timeLeft = displayLength;
var counterInterval = setInterval (function(){
if (newToast.parentNode === null)
window.clearInterval(counterInterval);
// If toast is not being dragged, decrease its time remaining
if (!newToast.classList.contains('panning')) {
timeLeft -= 20;
}
if (timeLeft <= 0) {
// Animate toast out
Vel(newToast, {"opacity": 0, marginTop: '-40px'}, { duration: 375,
easing: 'easeOutExpo',
queue: false,
complete: function(){
// Call the optional callback
if(typeof(completeCallback) === "function")
completeCallback();
// Remove toast after it times out
this[0].parentNode.removeChild(this[0]);
}
});
window.clearInterval(counterInterval);
}
}, 20);
function createToast(html) {
// Create toast
var toast = document.createElement('div');
toast.classList.add('toast');
if (className) {
var classes = className.split(' ');
for (var i = 0, count = classes.length; i < count; i++) {
toast.classList.add(classes[i]);
}
}
// If type of parameter is HTML Element
if ( typeof HTMLElement === "object" ? html instanceof HTMLElement : html && typeof html === "object" && html !== null && html.nodeType === 1 && typeof html.nodeName==="string"
) {
toast.appendChild(html);
}
else if (html instanceof jQuery) {
// Check if it is jQuery object
toast.appendChild(html[0]);
}
else {
// Insert as text;
toast.innerHTML = html;
}
// Bind hammer
var hammerHandler = new Hammer(toast, {prevent_default: false});
hammerHandler.on('pan', function(e) {
var deltaX = e.deltaX;
var activationDistance = 80;
// Change toast state
if (!toast.classList.contains('panning')){
toast.classList.add('panning');
}
var opacityPercent = 1-Math.abs(deltaX / activationDistance);
if (opacityPercent < 0)
opacityPercent = 0;
Vel(toast, {left: deltaX, opacity: opacityPercent }, {duration: 50, queue: false, easing: 'easeOutQuad'});
});
hammerHandler.on('panend', function(e) {
var deltaX = e.deltaX;
var activationDistance = 80;
// If toast dragged past activation point
if (Math.abs(deltaX) > activationDistance) {
Vel(toast, {marginTop: '-40px'}, { duration: 375,
easing: 'easeOutExpo',
queue: false,
complete: function(){
if(typeof(completeCallback) === "function") {
completeCallback();
}
toast.parentNode.removeChild(toast);
}
});
} else {
toast.classList.remove('panning');
// Put toast back into original position
Vel(toast, { left: 0, opacity: 1 }, { duration: 300,
easing: 'easeOutExpo',
queue: false
});
}
});
return toast;
}
};

View File

@@ -1,230 +0,0 @@
(function ($) {
$.fn.tooltip = function (options) {
var timeout = null,
margin = 5;
// Defaults
var defaults = {
delay: 350,
tooltip: '',
position: 'bottom',
html: false
};
// Remove tooltip from the activator
if (options === "remove") {
this.each(function() {
$('#' + $(this).attr('data-tooltip-id')).remove();
$(this).off('mouseenter.tooltip mouseleave.tooltip');
});
return false;
}
options = $.extend(defaults, options);
return this.each(function() {
var tooltipId = Materialize.guid();
var origin = $(this);
origin.attr('data-tooltip-id', tooltipId);
// Get attributes.
var allowHtml,
tooltipDelay,
tooltipPosition,
tooltipText,
tooltipEl,
backdrop;
var setAttributes = function() {
allowHtml = origin.attr('data-html') ? origin.attr('data-html') === 'true' : options.html;
tooltipDelay = origin.attr('data-delay');
tooltipDelay = (tooltipDelay === undefined || tooltipDelay === '') ?
options.delay : tooltipDelay;
tooltipPosition = origin.attr('data-position');
tooltipPosition = (tooltipPosition === undefined || tooltipPosition === '') ?
options.position : tooltipPosition;
tooltipText = origin.attr('data-tooltip');
tooltipText = (tooltipText === undefined || tooltipText === '') ?
options.tooltip : tooltipText;
};
setAttributes();
var renderTooltipEl = function() {
var tooltip = $('<div class="material-tooltip"></div>');
// Create Text span
if (allowHtml) {
tooltipText = $('<span></span>').html(tooltipText);
} else{
tooltipText = $('<span></span>').text(tooltipText);
}
// Create tooltip
tooltip.append(tooltipText)
.appendTo($('body'))
.attr('id', tooltipId);
// Create backdrop
backdrop = $('<div class="backdrop"></div>');
backdrop.appendTo(tooltip);
return tooltip;
};
tooltipEl = renderTooltipEl();
// Destroy previously binded events
origin.off('mouseenter.tooltip mouseleave.tooltip');
// Mouse In
var started = false, timeoutRef;
origin.on({'mouseenter.tooltip': function(e) {
var showTooltip = function() {
setAttributes();
started = true;
tooltipEl.velocity('stop');
backdrop.velocity('stop');
tooltipEl.css({ display: 'block', left: '0px', top: '0px' });
// Tooltip positioning
var originWidth = origin.outerWidth();
var originHeight = origin.outerHeight();
var tooltipHeight = tooltipEl.outerHeight();
var tooltipWidth = tooltipEl.outerWidth();
var tooltipVerticalMovement = '0px';
var tooltipHorizontalMovement = '0px';
var scaleXFactor = 8;
var scaleYFactor = 8;
var targetTop, targetLeft, newCoordinates;
if (tooltipPosition === "top") {
// Top Position
targetTop = origin.offset().top - tooltipHeight - margin;
targetLeft = origin.offset().left + originWidth/2 - tooltipWidth/2;
newCoordinates = repositionWithinScreen(targetLeft, targetTop, tooltipWidth, tooltipHeight);
tooltipVerticalMovement = '-10px';
backdrop.css({
bottom: 0,
left: 0,
borderRadius: '14px 14px 0 0',
transformOrigin: '50% 100%',
marginTop: tooltipHeight,
marginLeft: (tooltipWidth/2) - (backdrop.width()/2)
});
}
// Left Position
else if (tooltipPosition === "left") {
targetTop = origin.offset().top + originHeight/2 - tooltipHeight/2;
targetLeft = origin.offset().left - tooltipWidth - margin;
newCoordinates = repositionWithinScreen(targetLeft, targetTop, tooltipWidth, tooltipHeight);
tooltipHorizontalMovement = '-10px';
backdrop.css({
top: '-7px',
right: 0,
width: '14px',
height: '14px',
borderRadius: '14px 0 0 14px',
transformOrigin: '95% 50%',
marginTop: tooltipHeight/2,
marginLeft: tooltipWidth
});
}
// Right Position
else if (tooltipPosition === "right") {
targetTop = origin.offset().top + originHeight/2 - tooltipHeight/2;
targetLeft = origin.offset().left + originWidth + margin;
newCoordinates = repositionWithinScreen(targetLeft, targetTop, tooltipWidth, tooltipHeight);
tooltipHorizontalMovement = '+10px';
backdrop.css({
top: '-7px',
left: 0,
width: '14px',
height: '14px',
borderRadius: '0 14px 14px 0',
transformOrigin: '5% 50%',
marginTop: tooltipHeight/2,
marginLeft: '0px'
});
}
else {
// Bottom Position
targetTop = origin.offset().top + origin.outerHeight() + margin;
targetLeft = origin.offset().left + originWidth/2 - tooltipWidth/2;
newCoordinates = repositionWithinScreen(targetLeft, targetTop, tooltipWidth, tooltipHeight);
tooltipVerticalMovement = '+10px';
backdrop.css({
top: 0,
left: 0,
marginLeft: (tooltipWidth/2) - (backdrop.width()/2)
});
}
// Set tooptip css placement
tooltipEl.css({
top: newCoordinates.y,
left: newCoordinates.x
});
// Calculate Scale to fill
scaleXFactor = Math.SQRT2 * tooltipWidth / parseInt(backdrop.css('width'));
scaleYFactor = Math.SQRT2 * tooltipHeight / parseInt(backdrop.css('height'));
tooltipEl.velocity({ marginTop: tooltipVerticalMovement, marginLeft: tooltipHorizontalMovement}, { duration: 350, queue: false })
.velocity({opacity: 1}, {duration: 300, delay: 50, queue: false});
backdrop.css({ display: 'block' })
.velocity({opacity:1},{duration: 55, delay: 0, queue: false})
.velocity({scaleX: scaleXFactor, scaleY: scaleYFactor}, {duration: 300, delay: 0, queue: false, easing: 'easeInOutQuad'});
};
timeoutRef = setTimeout(showTooltip, tooltipDelay); // End Interval
// Mouse Out
},
'mouseleave.tooltip': function(){
// Reset State
started = false;
clearTimeout(timeoutRef);
// Animate back
setTimeout(function() {
if (started !== true) {
tooltipEl.velocity({
opacity: 0, marginTop: 0, marginLeft: 0}, { duration: 225, queue: false});
backdrop.velocity({opacity: 0, scaleX: 1, scaleY: 1}, {
duration:225,
queue: false,
complete: function(){
backdrop.css('display', 'none');
tooltipEl.css('display', 'none');
started = false;}
});
}
},225);
}
});
});
};
var repositionWithinScreen = function(x, y, width, height) {
var newX = x;
var newY = y;
if (newX < 0) {
newX = 4;
} else if (newX + width > window.innerWidth) {
newX -= newX + width - window.innerWidth;
}
if (newY < 0) {
newY = 4;
} else if (newY + height > window.innerHeight + $(window).scrollTop) {
newY -= newY + height - window.innerHeight;
}
return {x: newX, y: newY};
};
$(document).ready(function(){
$('.tooltipped').tooltip();
});
}( jQuery ));

View File

@@ -1,169 +0,0 @@
(function ($) {
// Image transition function
Materialize.fadeInImage = function(selectorOrEl) {
var element;
if (typeof(selectorOrEl) === 'string') {
element = $(selectorOrEl);
} else if (typeof(selectorOrEl) === 'object') {
element = selectorOrEl;
} else {
return;
}
element.css({opacity: 0});
$(element).velocity({opacity: 1}, {
duration: 650,
queue: false,
easing: 'easeOutSine'
});
$(element).velocity({opacity: 1}, {
duration: 1300,
queue: false,
easing: 'swing',
step: function(now, fx) {
fx.start = 100;
var grayscale_setting = now/100;
var brightness_setting = 150 - (100 - now)/1.75;
if (brightness_setting < 100) {
brightness_setting = 100;
}
if (now >= 0) {
$(this).css({
"-webkit-filter": "grayscale("+grayscale_setting+")" + "brightness("+brightness_setting+"%)",
"filter": "grayscale("+grayscale_setting+")" + "brightness("+brightness_setting+"%)"
});
}
}
});
};
// Horizontal staggered list
Materialize.showStaggeredList = function(selectorOrEl) {
var element;
if (typeof(selectorOrEl) === 'string') {
element = $(selectorOrEl);
} else if (typeof(selectorOrEl) === 'object') {
element = selectorOrEl;
} else {
return;
}
var time = 0;
element.find('li').velocity(
{ translateX: "-100px"},
{ duration: 0 });
element.find('li').each(function() {
$(this).velocity(
{ opacity: "1", translateX: "0"},
{ duration: 800, delay: time, easing: [60, 10] });
time += 120;
});
};
$(document).ready(function() {
// Hardcoded .staggered-list scrollFire
// var staggeredListOptions = [];
// $('ul.staggered-list').each(function (i) {
// var label = 'scrollFire-' + i;
// $(this).addClass(label);
// staggeredListOptions.push(
// {selector: 'ul.staggered-list.' + label,
// offset: 200,
// callback: 'showStaggeredList("ul.staggered-list.' + label + '")'});
// });
// scrollFire(staggeredListOptions);
// HammerJS, Swipe navigation
// Touch Event
var swipeLeft = false;
var swipeRight = false;
// Dismissible Collections
$('.dismissable').each(function() {
$(this).hammer({
prevent_default: false
}).bind('pan', function(e) {
if (e.gesture.pointerType === "touch") {
var $this = $(this);
var direction = e.gesture.direction;
var x = e.gesture.deltaX;
var velocityX = e.gesture.velocityX;
$this.velocity({ translateX: x
}, {duration: 50, queue: false, easing: 'easeOutQuad'});
// Swipe Left
if (direction === 4 && (x > ($this.innerWidth() / 2) || velocityX < -0.75)) {
swipeLeft = true;
}
// Swipe Right
if (direction === 2 && (x < (-1 * $this.innerWidth() / 2) || velocityX > 0.75)) {
swipeRight = true;
}
}
}).bind('panend', function(e) {
// Reset if collection is moved back into original position
if (Math.abs(e.gesture.deltaX) < ($(this).innerWidth() / 2)) {
swipeRight = false;
swipeLeft = false;
}
if (e.gesture.pointerType === "touch") {
var $this = $(this);
if (swipeLeft || swipeRight) {
var fullWidth;
if (swipeLeft) { fullWidth = $this.innerWidth(); }
else { fullWidth = -1 * $this.innerWidth(); }
$this.velocity({ translateX: fullWidth,
}, {duration: 100, queue: false, easing: 'easeOutQuad', complete:
function() {
$this.css('border', 'none');
$this.velocity({ height: 0, padding: 0,
}, {duration: 200, queue: false, easing: 'easeOutQuad', complete:
function() { $this.remove(); }
});
}
});
}
else {
$this.velocity({ translateX: 0,
}, {duration: 100, queue: false, easing: 'easeOutQuad'});
}
swipeLeft = false;
swipeRight = false;
}
});
});
// time = 0
// // Vertical Staggered list
// $('ul.staggered-list.vertical li').velocity(
// { translateY: "100px"},
// { duration: 0 });
// $('ul.staggered-list.vertical li').each(function() {
// $(this).velocity(
// { opacity: "1", translateY: "0"},
// { duration: 800, delay: time, easing: [60, 25] });
// time += 120;
// });
// // Fade in and Scale
// $('.fade-in.scale').velocity(
// { scaleX: .4, scaleY: .4, translateX: -600},
// { duration: 0});
// $('.fade-in').each(function() {
// $(this).velocity(
// { opacity: "1", scaleX: 1, scaleY: 1, translateX: 0},
// { duration: 800, easing: [60, 10] });
// });
});
}( jQuery ));

File diff suppressed because one or more lines are too long

View File

@@ -1,338 +0,0 @@
/*!
* Waves v0.6.4
* http://fian.my.id/Waves
*
* Copyright 2014 Alfiana E. Sibuea and other contributors
* Released under the MIT license
* https://github.com/fians/Waves/blob/master/LICENSE
*/
;(function(window) {
'use strict';
var Waves = Waves || {};
var $$ = document.querySelectorAll.bind(document);
// Find exact position of element
function isWindow(obj) {
return obj !== null && obj === obj.window;
}
function getWindow(elem) {
return isWindow(elem) ? elem : elem.nodeType === 9 && elem.defaultView;
}
function offset(elem) {
var docElem, win,
box = {top: 0, left: 0},
doc = elem && elem.ownerDocument;
docElem = doc.documentElement;
if (typeof elem.getBoundingClientRect !== typeof undefined) {
box = elem.getBoundingClientRect();
}
win = getWindow(doc);
return {
top: box.top + win.pageYOffset - docElem.clientTop,
left: box.left + win.pageXOffset - docElem.clientLeft
};
}
function convertStyle(obj) {
var style = '';
for (var a in obj) {
if (obj.hasOwnProperty(a)) {
style += (a + ':' + obj[a] + ';');
}
}
return style;
}
var Effect = {
// Effect delay
duration: 750,
show: function(e, element) {
// Disable right click
if (e.button === 2) {
return false;
}
var el = element || this;
// Create ripple
var ripple = document.createElement('div');
ripple.className = 'waves-ripple';
el.appendChild(ripple);
// Get click coordinate and element witdh
var pos = offset(el);
var relativeY = (e.pageY - pos.top);
var relativeX = (e.pageX - pos.left);
var scale = 'scale('+((el.clientWidth / 100) * 10)+')';
// Support for touch devices
if ('touches' in e) {
relativeY = (e.touches[0].pageY - pos.top);
relativeX = (e.touches[0].pageX - pos.left);
}
// Attach data to element
ripple.setAttribute('data-hold', Date.now());
ripple.setAttribute('data-scale', scale);
ripple.setAttribute('data-x', relativeX);
ripple.setAttribute('data-y', relativeY);
// Set ripple position
var rippleStyle = {
'top': relativeY+'px',
'left': relativeX+'px'
};
ripple.className = ripple.className + ' waves-notransition';
ripple.setAttribute('style', convertStyle(rippleStyle));
ripple.className = ripple.className.replace('waves-notransition', '');
// Scale the ripple
rippleStyle['-webkit-transform'] = scale;
rippleStyle['-moz-transform'] = scale;
rippleStyle['-ms-transform'] = scale;
rippleStyle['-o-transform'] = scale;
rippleStyle.transform = scale;
rippleStyle.opacity = '1';
rippleStyle['-webkit-transition-duration'] = Effect.duration + 'ms';
rippleStyle['-moz-transition-duration'] = Effect.duration + 'ms';
rippleStyle['-o-transition-duration'] = Effect.duration + 'ms';
rippleStyle['transition-duration'] = Effect.duration + 'ms';
rippleStyle['-webkit-transition-timing-function'] = 'cubic-bezier(0.250, 0.460, 0.450, 0.940)';
rippleStyle['-moz-transition-timing-function'] = 'cubic-bezier(0.250, 0.460, 0.450, 0.940)';
rippleStyle['-o-transition-timing-function'] = 'cubic-bezier(0.250, 0.460, 0.450, 0.940)';
rippleStyle['transition-timing-function'] = 'cubic-bezier(0.250, 0.460, 0.450, 0.940)';
ripple.setAttribute('style', convertStyle(rippleStyle));
},
hide: function(e) {
TouchHandler.touchup(e);
var el = this;
var width = el.clientWidth * 1.4;
// Get first ripple
var ripple = null;
var ripples = el.getElementsByClassName('waves-ripple');
if (ripples.length > 0) {
ripple = ripples[ripples.length - 1];
} else {
return false;
}
var relativeX = ripple.getAttribute('data-x');
var relativeY = ripple.getAttribute('data-y');
var scale = ripple.getAttribute('data-scale');
// Get delay beetween mousedown and mouse leave
var diff = Date.now() - Number(ripple.getAttribute('data-hold'));
var delay = 350 - diff;
if (delay < 0) {
delay = 0;
}
// Fade out ripple after delay
setTimeout(function() {
var style = {
'top': relativeY+'px',
'left': relativeX+'px',
'opacity': '0',
// Duration
'-webkit-transition-duration': Effect.duration + 'ms',
'-moz-transition-duration': Effect.duration + 'ms',
'-o-transition-duration': Effect.duration + 'ms',
'transition-duration': Effect.duration + 'ms',
'-webkit-transform': scale,
'-moz-transform': scale,
'-ms-transform': scale,
'-o-transform': scale,
'transform': scale,
};
ripple.setAttribute('style', convertStyle(style));
setTimeout(function() {
try {
el.removeChild(ripple);
} catch(e) {
return false;
}
}, Effect.duration);
}, delay);
},
// Little hack to make <input> can perform waves effect
wrapInput: function(elements) {
for (var a = 0; a < elements.length; a++) {
var el = elements[a];
if (el.tagName.toLowerCase() === 'input') {
var parent = el.parentNode;
// If input already have parent just pass through
if (parent.tagName.toLowerCase() === 'i' && parent.className.indexOf('waves-effect') !== -1) {
continue;
}
// Put element class and style to the specified parent
var wrapper = document.createElement('i');
wrapper.className = el.className + ' waves-input-wrapper';
var elementStyle = el.getAttribute('style');
if (!elementStyle) {
elementStyle = '';
}
wrapper.setAttribute('style', elementStyle);
el.className = 'waves-button-input';
el.removeAttribute('style');
// Put element as child
parent.replaceChild(wrapper, el);
wrapper.appendChild(el);
}
}
}
};
/**
* Disable mousedown event for 500ms during and after touch
*/
var TouchHandler = {
/* uses an integer rather than bool so there's no issues with
* needing to clear timeouts if another touch event occurred
* within the 500ms. Cannot mouseup between touchstart and
* touchend, nor in the 500ms after touchend. */
touches: 0,
allowEvent: function(e) {
var allow = true;
if (e.type === 'touchstart') {
TouchHandler.touches += 1; //push
} else if (e.type === 'touchend' || e.type === 'touchcancel') {
setTimeout(function() {
if (TouchHandler.touches > 0) {
TouchHandler.touches -= 1; //pop after 500ms
}
}, 500);
} else if (e.type === 'mousedown' && TouchHandler.touches > 0) {
allow = false;
}
return allow;
},
touchup: function(e) {
TouchHandler.allowEvent(e);
}
};
/**
* Delegated click handler for .waves-effect element.
* returns null when .waves-effect element not in "click tree"
*/
function getWavesEffectElement(e) {
if (TouchHandler.allowEvent(e) === false) {
return null;
}
var element = null;
var target = e.target || e.srcElement;
while (target.parentElement !== null) {
if (!(target instanceof SVGElement) && target.className.indexOf('waves-effect') !== -1) {
element = target;
break;
} else if (target.classList.contains('waves-effect')) {
element = target;
break;
}
target = target.parentElement;
}
return element;
}
/**
* Bubble the click and show effect if .waves-effect elem was found
*/
function showEffect(e) {
var element = getWavesEffectElement(e);
if (element !== null) {
Effect.show(e, element);
if ('ontouchstart' in window) {
element.addEventListener('touchend', Effect.hide, false);
element.addEventListener('touchcancel', Effect.hide, false);
}
element.addEventListener('mouseup', Effect.hide, false);
element.addEventListener('mouseleave', Effect.hide, false);
}
}
Waves.displayEffect = function(options) {
options = options || {};
if ('duration' in options) {
Effect.duration = options.duration;
}
//Wrap input inside <i> tag
Effect.wrapInput($$('.waves-effect'));
if ('ontouchstart' in window) {
document.body.addEventListener('touchstart', showEffect, false);
}
document.body.addEventListener('mousedown', showEffect, false);
};
/**
* Attach Waves to an input element (or any element which doesn't
* bubble mouseup/mousedown events).
* Intended to be used with dynamically loaded forms/inputs, or
* where the user doesn't want a delegated click handler.
*/
Waves.attach = function(element) {
//FUTURE: automatically add waves classes and allow users
// to specify them with an options param? Eg. light/classic/button
if (element.tagName.toLowerCase() === 'input') {
Effect.wrapInput([element]);
element = element.parentElement;
}
if ('ontouchstart' in window) {
element.addEventListener('touchstart', showEffect, false);
}
element.addEventListener('mousedown', showEffect, false);
};
window.Waves = Waves;
document.addEventListener('DOMContentLoaded', function() {
Waves.displayEffect();
}, false);
})(window);

View File

@@ -1,97 +0,0 @@
// package metadata file for Meteor.js
Package.describe({
name: 'materialize:materialize', // http://atmospherejs.com/materialize/materialize
summary: 'Materialize (official): A modern responsive front-end framework based on Material Design',
version: '0.97.7',
git: 'https://github.com/Dogfalo/materialize.git'
});
Package.onUse(function (api) {
api.versionsFrom('METEOR@1.0');
api.use('fourseven:scss@3.2.0');
api.use('jquery', 'client');
api.imply('jquery', 'client');
var assets = [
'dist/fonts/roboto/Roboto-Bold.ttf',
'dist/fonts/roboto/Roboto-Bold.woff',
'dist/fonts/roboto/Roboto-Bold.woff2',
'dist/fonts/roboto/Roboto-Light.ttf',
'dist/fonts/roboto/Roboto-Light.woff',
'dist/fonts/roboto/Roboto-Light.woff2',
'dist/fonts/roboto/Roboto-Medium.ttf',
'dist/fonts/roboto/Roboto-Medium.woff',
'dist/fonts/roboto/Roboto-Medium.woff2',
'dist/fonts/roboto/Roboto-Regular.ttf',
'dist/fonts/roboto/Roboto-Regular.woff',
'dist/fonts/roboto/Roboto-Regular.woff2',
'dist/fonts/roboto/Roboto-Thin.ttf',
'dist/fonts/roboto/Roboto-Thin.woff',
'dist/fonts/roboto/Roboto-Thin.woff2',
];
addAssets(api, assets);
api.addFiles([
'dist/js/materialize.js'
], 'client');
var scssFiles = [
'sass/components/date_picker/_default.date.scss',
'sass/components/date_picker/_default.scss',
'sass/components/date_picker/_default.time.scss',
'sass/components/forms/_checkboxes.scss',
'sass/components/forms/_file-input.scss',
'sass/components/forms/_forms.scss',
'sass/components/forms/_input-fields.scss',
'sass/components/forms/_radio-buttons.scss',
'sass/components/forms/_range.scss',
'sass/components/forms/_select.scss',
'sass/components/forms/_switches.scss',
'sass/components/_buttons.scss',
'sass/components/_cards.scss',
'sass/components/_carousel.scss',
'sass/components/_chips.scss',
'sass/components/_collapsible.scss',
'sass/components/_color.scss',
'sass/components/_dropdown.scss',
'sass/components/_global.scss',
'sass/components/_grid.scss',
'sass/components/_icons-material-design.scss',
'sass/components/_materialbox.scss',
'sass/components/_mixins.scss',
'sass/components/_modal.scss',
'sass/components/_navbar.scss',
'sass/components/_normalize.scss',
'sass/components/_prefixer.scss',
'sass/components/_preloader.scss',
'sass/components/_roboto.scss',
'sass/components/_sideNav.scss',
'sass/components/_slider.scss',
'sass/components/_table_of_contents.scss',
'sass/components/_tabs.scss',
'sass/components/_toast.scss',
'sass/components/_tooltip.scss',
'sass/components/_typography.scss',
'sass/components/_variables.scss',
'sass/components/_waves.scss',
'sass/materialize.scss'
];
api.addFiles(scssFiles, 'client');
api.export('Materialize', 'client');
});
function addAssets(api, assets){
if(api.addAssets){
api.addAssets(assets, 'client');
} else {
api.addFiles(assets, 'client', {isAsset: true});
}
}

View File

@@ -1,211 +0,0 @@
// shared styles
.btn,
.btn-flat {
border: $button-border;
border-radius: $button-radius;
display: inline-block;
height: $button-height;
line-height: $button-height;
outline: 0;
padding: $button-padding;
text-transform: uppercase;
vertical-align: middle;
// Gets rid of tap active state
-webkit-tap-highlight-color: transparent;
}
// Disabled shared style
.btn.disabled,
.btn-floating.disabled,
.btn-large.disabled,
.btn:disabled,
.btn-large:disabled,
.btn-floating:disabled,
.btn[disabled],
.btn-large[disabled],
.btn-floating[disabled] {
background-color: $button-disabled-background !important;
box-shadow: none;
color: $button-disabled-color !important;
cursor: default;
* {
pointer-events: none;
}
&:hover {
background-color: $button-disabled-background !important;
color: $button-disabled-color !important;
}
}
// Shared icon styles
.btn,
.btn-floating,
.btn-large,
.btn-flat {
i {
font-size: $button-font-size;
line-height: inherit;
}
}
// Raised Button
.btn {
text-decoration: none;
color: $button-raised-color;
background-color: $button-raised-background;
text-align: center;
letter-spacing: .5px;
@extend .z-depth-1;
transition: .2s ease-out;
cursor: pointer;
&:hover {
background-color: $button-raised-background-hover;
@extend .z-depth-1-half;
}
}
// Floating button
.btn-floating {
display: inline-block;
color: $button-floating-color;
position: relative;
overflow: hidden;
z-index: 1;
width: $button-floating-size;
height: $button-floating-size;
line-height: $button-floating-size;
padding: 0;
background-color: $button-floating-background;
border-radius: $button-floating-radius;
@extend .z-depth-1;
transition: .3s;
cursor: pointer;
vertical-align: middle;
i {
width: inherit;
display: inline-block;
text-align: center;
color: $button-floating-color;
font-size: $button-large-icon-font-size;
line-height: $button-floating-size;
}
&:hover {
background-color: $button-floating-background-hover;
@extend .z-depth-1-half;
}
&:before {
border-radius: 0;
}
&.btn-large {
width: $button-floating-large-size;
height: $button-floating-large-size;
i {
line-height: $button-floating-large-size;
}
}
}
// button fix
button.btn-floating {
border: $button-border;
}
// Fixed Action Button
.fixed-action-btn {
&.active {
ul {
visibility: visible;
}
}
&.horizontal {
padding: 0 0 0 15px;
ul {
text-align: right;
right: 64px;
top: 50%;
transform: translateY(-50%);
height: 100%;
left: auto;
width: 500px; /*width 100% only goes to width of button container */
li {
display: inline-block;
margin: 15px 15px 0 0;
}
}
}
position: fixed;
right: 23px;
bottom: 23px;
padding-top: 15px;
margin-bottom: 0;
z-index: 998;
ul {
left: 0;
right: 0;
text-align: center;
position: absolute;
bottom: 64px;
margin: 0;
visibility: hidden;
li {
margin-bottom: 15px;
}
a.btn-floating {
opacity: 0;
}
}
}
// Flat button
.btn-flat {
box-shadow: none;
background-color: transparent;
color: $button-flat-color;
cursor: pointer;
transition: background-color .2s;
&:focus,
&:active {
background-color: transparent;
}
&:hover {
background-color: rgba(0,0,0,.1);
box-shadow: none;
}
&.disabled {
color: $button-flat-disabled-color;
cursor: default;
}
}
// Large button
.btn-large {
@extend .btn;
height: $button-large-height;
line-height: $button-large-height;
i {
font-size: $button-large-icon-font-size;
}
}
// Block button
.btn-block {
display: block;
}

View File

@@ -1,185 +0,0 @@
.card-panel {
transition: box-shadow .25s;
padding: $card-padding;
margin: $element-top-margin 0 $element-bottom-margin 0;
border-radius: 2px;
@extend .z-depth-1;
background-color: $card-bg-color;
}
.card {
position: relative;
margin: $element-top-margin 0 $element-bottom-margin 0;
background-color: $card-bg-color;
transition: box-shadow .25s;
border-radius: 2px;
@extend .z-depth-1;
.card-title {
font-size: 24px;
font-weight: 300;
&.activator {
cursor: pointer;
}
}
// Card Sizes
&.small, &.medium, &.large {
position: relative;
.card-image {
max-height: 60%;
overflow: hidden;
}
.card-image + .card-content {
max-height: 40%;
}
.card-content {
max-height: 100%;
overflow: hidden;
}
.card-action {
position: absolute;
bottom: 0;
left: 0;
right: 0;
}
}
&.small {
height: 300px;
}
&.medium {
height: 400px;
}
&.large {
height: 500px;
}
// Horizontal Cards
&.horizontal {
&.small, &.medium, &.large {
.card-image {
height: 100%;
max-height: none;
overflow: visible;
img {
height: 100%;
}
}
}
display: flex;
.card-image {
max-width: 50%;
img {
max-width: 100%;
width: auto;
}
}
.card-stacked {
display: flex;
flex-direction: column;
flex: 1;
position: relative;
.card-content {
flex-grow: 1;
}
}
}
// Sticky Action Section
&.sticky-action {
.card-action {
z-index: 2;
}
.card-reveal {
z-index: 1;
padding-bottom: 64px;
}
}
.card-image {
position: relative;
// Image background for content
img {
display: block;
border-radius: 2px 2px 0 0;
position: relative;
left: 0;
right: 0;
top: 0;
bottom: 0;
width: 100%;
}
.card-title {
color: $card-bg-color;
position: absolute;
bottom: 0;
left: 0;
padding: $card-padding;
}
}
.card-content {
padding: $card-padding;
border-radius: 0 0 2px 2px;
p {
margin: 0;
color: inherit;
}
.card-title {
line-height: 48px;
}
}
.card-action {
position: relative;
background-color: inherit;
border-top: 1px solid rgba(160,160,160,.2);
padding: $card-padding;
a:not(.btn):not(.btn-large):not(.btn-floating) {
color: $card-link-color;
margin-right: $card-padding;
transition: color .3s ease;
text-transform: uppercase;
&:hover { color: $card-link-color-light; }
}
}
.card-reveal {
padding: $card-padding;
position: absolute;
background-color: $card-bg-color;
width: 100%;
overflow-y: auto;
top: 100%;
height: 100%;
z-index: 3;
display: none;
.card-title {
cursor: pointer;
display: block;
}
}
}

View File

@@ -1,85 +0,0 @@
.carousel {
&.carousel-slider {
top: 0;
left: 0;
height: 0;
.carousel-fixed-item {
&.with-indicators {
bottom: 68px;
}
position: absolute;
left: 0;
right: 0;
bottom: 20px;
z-index: 1;
}
.carousel-item {
width: 100%;
height: 100%;
min-height: 400px;
position: absolute;
top: 0;
left: 0;
h2 {
font-size: 24px;
font-weight: 500;
line-height: 32px;
}
p {
font-size: 15px;
}
}
}
overflow: hidden;
position: relative;
width: 100%;
height: 400px;
perspective: 500px;
transform-style: preserve-3d;
transform-origin: 0% 50%;
.carousel-item {
display: none;
width: 200px;
height: 400px;
position: absolute;
top: 0;
left: 0;
img {
width: 100%;
}
}
.indicators {
position: absolute;
text-align: center;
left: 0;
right: 0;
bottom: 0;
margin: 0;
.indicator-item {
&.active {
background-color: #fff;
}
display: inline-block;
position: relative;
cursor: pointer;
height: 8px;
width: 8px;
margin: 24px 4px;
background-color: rgba(255,255,255,.5);
transition: background-color .3s;
border-radius: 50%;
}
}
}

View File

@@ -1,74 +0,0 @@
.chip {
display: inline-block;
height: 32px;
font-size: 13px;
font-weight: 500;
color: rgba(0,0,0,.6);
line-height: 32px;
padding: 0 12px;
border-radius: 16px;
background-color: $chip-bg-color;
margin-bottom: $chip-margin;
margin-right: $chip-margin;
img {
float: left;
margin: 0 8px 0 -12px;
height: 32px;
width: 32px;
border-radius: 50%;
}
.close {
cursor: pointer;
float: right;
font-size: 16px;
line-height: 32px;
padding-left: 8px;
}
}
.chips {
border: none;
border-bottom: 1px solid $chip-border-color;
box-shadow: none;
margin-bottom: 30px;
min-height: 45px;
outline: none;
padding-bottom: $chip-margin;
transition: all .3s;
&.focus {
border-bottom: 1px solid $chip-selected-color;
box-shadow: 0 1px 0 0 $chip-selected-color;
}
&:hover {
cursor: text;
}
.chip.selected {
background-color: $chip-selected-color;
color: #fff;
}
.input {
background: none;
border: 0;
color: rgba(0,0,0,.6);
display: inline-block;
font-size: 13px;
font-weight: 500;
height: 32px;
margin-right: 20px;
line-height: 32px;
outline: 0;
padding: 0 !important;
width: 120px !important;
}
.input:focus {
border: 0 !important;
box-shadow: none !important;
}
}

View File

@@ -1,90 +0,0 @@
.collapsible {
border-top: 1px solid $collapsible-border-color;
border-right: 1px solid $collapsible-border-color;
border-left: 1px solid $collapsible-border-color;
margin: $element-top-margin 0 $element-bottom-margin 0;
@extend .z-depth-1;
}
.collapsible-header {
display: block;
cursor: pointer;
min-height: $collapsible-height;
line-height: $collapsible-height;
padding: 0 1rem;
background-color: $collapsible-header-color;
border-bottom: 1px solid $collapsible-border-color;
i {
width: 2rem;
font-size: 1.6rem;
line-height: $collapsible-height;
display: block;
float: left;
text-align: center;
margin-right: 1rem;
}
}
.collapsible-body {
display: none;
border-bottom: 1px solid $collapsible-border-color;
box-sizing: border-box;
p {
margin: 0;
padding: 2rem;
}
}
// sideNav collapsible styling
.side-nav,
.side-nav.fixed {
.collapsible {
border: none;
box-shadow: none;
li { padding: 0; }
}
.collapsible-header {
background-color: transparent;
border: none;
line-height: inherit;
height: inherit;
padding: 0 $sidenav-padding;
&:hover { background-color: rgba(0,0,0,.05); }
i { line-height: inherit; }
}
.collapsible-body {
border: 0;
background-color: $collapsible-header-color;
li a {
padding: 0 (7.5px + $sidenav-padding)
0 (15px + $sidenav-padding);
}
}
}
// Popout Collapsible
.collapsible.popout {
border: none;
box-shadow: none;
> li {
box-shadow: 0 2px 5px 0 rgba(0, 0, 0, 0.16), 0 2px 10px 0 rgba(0, 0, 0, 0.12);
// transform: scaleX(.92);
margin: 0 24px;
transition: margin .35s cubic-bezier(0.250, 0.460, 0.450, 0.940);
}
> li.active {
box-shadow: 0 5px 11px 0 rgba(0, 0, 0, 0.18), 0 4px 15px 0 rgba(0, 0, 0, 0.15);
margin: 16px 0;
// transform: scaleX(1);
}
}

View File

@@ -1,412 +0,0 @@
// Utility Color Classes
//.success {
//
//}
// Google Color Palette defined: http://www.google.com/design/spec/style/color.html
$materialize-red: (
"base": #e51c23,
"lighten-5": #fdeaeb,
"lighten-4": #f8c1c3,
"lighten-3": #f3989b,
"lighten-2": #ee6e73,
"lighten-1": #ea454b,
"darken-1": #d0181e,
"darken-2": #b9151b,
"darken-3": #a21318,
"darken-4": #8b1014,
);
$red: (
"base": #F44336,
"lighten-5": #FFEBEE,
"lighten-4": #FFCDD2,
"lighten-3": #EF9A9A,
"lighten-2": #E57373,
"lighten-1": #EF5350,
"darken-1": #E53935,
"darken-2": #D32F2F,
"darken-3": #C62828,
"darken-4": #B71C1C,
"accent-1": #FF8A80,
"accent-2": #FF5252,
"accent-3": #FF1744,
"accent-4": #D50000
);
$pink: (
"base": #e91e63,
"lighten-5": #fce4ec,
"lighten-4": #f8bbd0,
"lighten-3": #f48fb1,
"lighten-2": #f06292,
"lighten-1": #ec407a,
"darken-1": #d81b60,
"darken-2": #c2185b,
"darken-3": #ad1457,
"darken-4": #880e4f,
"accent-1": #ff80ab,
"accent-2": #ff4081,
"accent-3": #f50057,
"accent-4": #c51162
);
$purple: (
"base": #9c27b0,
"lighten-5": #f3e5f5,
"lighten-4": #e1bee7,
"lighten-3": #ce93d8,
"lighten-2": #ba68c8,
"lighten-1": #ab47bc,
"darken-1": #8e24aa,
"darken-2": #7b1fa2,
"darken-3": #6a1b9a,
"darken-4": #4a148c,
"accent-1": #ea80fc,
"accent-2": #e040fb,
"accent-3": #d500f9,
"accent-4": #aa00ff
);
$deep-purple: (
"base": #673ab7,
"lighten-5": #ede7f6,
"lighten-4": #d1c4e9,
"lighten-3": #b39ddb,
"lighten-2": #9575cd,
"lighten-1": #7e57c2,
"darken-1": #5e35b1,
"darken-2": #512da8,
"darken-3": #4527a0,
"darken-4": #311b92,
"accent-1": #b388ff,
"accent-2": #7c4dff,
"accent-3": #651fff,
"accent-4": #6200ea
);
$indigo: (
"base": #3f51b5,
"lighten-5": #e8eaf6,
"lighten-4": #c5cae9,
"lighten-3": #9fa8da,
"lighten-2": #7986cb,
"lighten-1": #5c6bc0,
"darken-1": #3949ab,
"darken-2": #303f9f,
"darken-3": #283593,
"darken-4": #1a237e,
"accent-1": #8c9eff,
"accent-2": #536dfe,
"accent-3": #3d5afe,
"accent-4": #304ffe
);
$blue: (
"base": #2196F3,
"lighten-5": #E3F2FD,
"lighten-4": #BBDEFB,
"lighten-3": #90CAF9,
"lighten-2": #64B5F6,
"lighten-1": #42A5F5,
"darken-1": #1E88E5,
"darken-2": #1976D2,
"darken-3": #1565C0,
"darken-4": #0D47A1,
"accent-1": #82B1FF,
"accent-2": #448AFF,
"accent-3": #2979FF,
"accent-4": #2962FF
);
$light-blue: (
"base": #03a9f4,
"lighten-5": #e1f5fe,
"lighten-4": #b3e5fc,
"lighten-3": #81d4fa,
"lighten-2": #4fc3f7,
"lighten-1": #29b6f6,
"darken-1": #039be5,
"darken-2": #0288d1,
"darken-3": #0277bd,
"darken-4": #01579b,
"accent-1": #80d8ff,
"accent-2": #40c4ff,
"accent-3": #00b0ff,
"accent-4": #0091ea
);
$cyan: (
"base": #00bcd4,
"lighten-5": #e0f7fa,
"lighten-4": #b2ebf2,
"lighten-3": #80deea,
"lighten-2": #4dd0e1,
"lighten-1": #26c6da,
"darken-1": #00acc1,
"darken-2": #0097a7,
"darken-3": #00838f,
"darken-4": #006064,
"accent-1": #84ffff,
"accent-2": #18ffff,
"accent-3": #00e5ff,
"accent-4": #00b8d4
);
$teal: (
"base": #009688,
"lighten-5": #e0f2f1,
"lighten-4": #b2dfdb,
"lighten-3": #80cbc4,
"lighten-2": #4db6ac,
"lighten-1": #26a69a,
"darken-1": #00897b,
"darken-2": #00796b,
"darken-3": #00695c,
"darken-4": #004d40,
"accent-1": #a7ffeb,
"accent-2": #64ffda,
"accent-3": #1de9b6,
"accent-4": #00bfa5
);
$green: (
"base": #4CAF50,
"lighten-5": #E8F5E9,
"lighten-4": #C8E6C9,
"lighten-3": #A5D6A7,
"lighten-2": #81C784,
"lighten-1": #66BB6A,
"darken-1": #43A047,
"darken-2": #388E3C,
"darken-3": #2E7D32,
"darken-4": #1B5E20,
"accent-1": #B9F6CA,
"accent-2": #69F0AE,
"accent-3": #00E676,
"accent-4": #00C853
);
$light-green: (
"base": #8bc34a,
"lighten-5": #f1f8e9,
"lighten-4": #dcedc8,
"lighten-3": #c5e1a5,
"lighten-2": #aed581,
"lighten-1": #9ccc65,
"darken-1": #7cb342,
"darken-2": #689f38,
"darken-3": #558b2f,
"darken-4": #33691e,
"accent-1": #ccff90,
"accent-2": #b2ff59,
"accent-3": #76ff03,
"accent-4": #64dd17
);
$lime: (
"base": #cddc39,
"lighten-5": #f9fbe7,
"lighten-4": #f0f4c3,
"lighten-3": #e6ee9c,
"lighten-2": #dce775,
"lighten-1": #d4e157,
"darken-1": #c0ca33,
"darken-2": #afb42b,
"darken-3": #9e9d24,
"darken-4": #827717,
"accent-1": #f4ff81,
"accent-2": #eeff41,
"accent-3": #c6ff00,
"accent-4": #aeea00
);
$yellow: (
"base": #ffeb3b,
"lighten-5": #fffde7,
"lighten-4": #fff9c4,
"lighten-3": #fff59d,
"lighten-2": #fff176,
"lighten-1": #ffee58,
"darken-1": #fdd835,
"darken-2": #fbc02d,
"darken-3": #f9a825,
"darken-4": #f57f17,
"accent-1": #ffff8d,
"accent-2": #ffff00,
"accent-3": #ffea00,
"accent-4": #ffd600
);
$amber: (
"base": #ffc107,
"lighten-5": #fff8e1,
"lighten-4": #ffecb3,
"lighten-3": #ffe082,
"lighten-2": #ffd54f,
"lighten-1": #ffca28,
"darken-1": #ffb300,
"darken-2": #ffa000,
"darken-3": #ff8f00,
"darken-4": #ff6f00,
"accent-1": #ffe57f,
"accent-2": #ffd740,
"accent-3": #ffc400,
"accent-4": #ffab00
);
$orange: (
"base": #ff9800,
"lighten-5": #fff3e0,
"lighten-4": #ffe0b2,
"lighten-3": #ffcc80,
"lighten-2": #ffb74d,
"lighten-1": #ffa726,
"darken-1": #fb8c00,
"darken-2": #f57c00,
"darken-3": #ef6c00,
"darken-4": #e65100,
"accent-1": #ffd180,
"accent-2": #ffab40,
"accent-3": #ff9100,
"accent-4": #ff6d00
);
$deep-orange: (
"base": #ff5722,
"lighten-5": #fbe9e7,
"lighten-4": #ffccbc,
"lighten-3": #ffab91,
"lighten-2": #ff8a65,
"lighten-1": #ff7043,
"darken-1": #f4511e,
"darken-2": #e64a19,
"darken-3": #d84315,
"darken-4": #bf360c,
"accent-1": #ff9e80,
"accent-2": #ff6e40,
"accent-3": #ff3d00,
"accent-4": #dd2c00
);
$brown: (
"base": #795548,
"lighten-5": #efebe9,
"lighten-4": #d7ccc8,
"lighten-3": #bcaaa4,
"lighten-2": #a1887f,
"lighten-1": #8d6e63,
"darken-1": #6d4c41,
"darken-2": #5d4037,
"darken-3": #4e342e,
"darken-4": #3e2723
);
$blue-grey: (
"base": #607d8b,
"lighten-5": #eceff1,
"lighten-4": #cfd8dc,
"lighten-3": #b0bec5,
"lighten-2": #90a4ae,
"lighten-1": #78909c,
"darken-1": #546e7a,
"darken-2": #455a64,
"darken-3": #37474f,
"darken-4": #263238
);
$grey: (
"base": #9e9e9e,
"lighten-5": #fafafa,
"lighten-4": #f5f5f5,
"lighten-3": #eeeeee,
"lighten-2": #e0e0e0,
"lighten-1": #bdbdbd,
"darken-1": #757575,
"darken-2": #616161,
"darken-3": #424242,
"darken-4": #212121
);
$shades: (
"black": #000000,
"white": #FFFFFF,
"transparent": transparent
);
$colors: (
"materialize-red": $materialize-red,
"red": $red,
"pink": $pink,
"purple": $purple,
"deep-purple": $deep-purple,
"indigo": $indigo,
"blue": $blue,
"light-blue": $light-blue,
"cyan": $cyan,
"teal": $teal,
"green": $green,
"light-green": $light-green,
"lime": $lime,
"yellow": $yellow,
"amber": $amber,
"orange": $orange,
"deep-orange": $deep-orange,
"brown": $brown,
"blue-grey": $blue-grey,
"grey": $grey,
"shades": $shades
);
// Color Classes
@each $color_name, $color in $colors {
@each $color_type, $color_value in $color {
@if $color_type == "base" {
.#{$color_name} {
background-color: $color_value !important;
}
.#{$color_name}-text {
color: $color_value !important;
}
}
@else if $color_name != "shades" {
.#{$color_name}.#{$color_type} {
background-color: $color_value !important;
}
.#{$color_name}-text.text-#{$color_type} {
color: $color_value !important;
}
}
}
}
// Shade classes
@each $color, $color_value in $shades {
.#{$color} {
background-color: $color_value !important;
}
.#{$color}-text {
color: $color_value !important;
}
}
// usage: color("name_of_color", "type_of_color")
// to avoid to repeating map-get($colors, ...)
@function color($color, $type) {
@if map-has-key($colors, $color) {
$curr_color: map-get($colors, $color);
@if map-has-key($curr_color, $type) {
@return map-get($curr_color, $type);
}
}
@warn "Unknown `#{name}` in $colors.";
@return null;
}

Some files were not shown because too many files have changed in this diff Show More