1
0
Fork 0
mirror of https://github.com/jellyfin/jellyfin-web synced 2025-03-30 19:56:21 +00:00

use shared slideshow

This commit is contained in:
Luke Pulverenti 2016-01-31 01:03:40 -05:00
parent c959aa01a2
commit 3eec24c917
86 changed files with 18787 additions and 2233 deletions

View file

@ -0,0 +1,58 @@
{
"name": "Swiper",
"repository": {
"type": "git",
"url": "https://github.com/nolimits4web/Swiper.git"
},
"description": "Most modern mobile touch slider and framework with hardware accelerated transitions",
"version": "3.3.0",
"author": "Vladimir Kharlampidi",
"homepage": "http://www.idangero.us/swiper/",
"keywords": [
"swiper",
"swipe",
"slider",
"touch",
"ios",
"mobile",
"cordova",
"phonegap",
"app",
"framework",
"carousel",
"gallery"
],
"dependencies": {},
"scripts": [
"dist/js/swiper.js"
],
"main": [
"dist/js/swiper.js",
"dist/css/swiper.css"
],
"styles": [
"dist/css/swiper.css"
],
"license": [
"MIT"
],
"ignore": [
".*",
"demos",
"gulpfile",
"build",
"node_modules",
"playground",
"package.json"
],
"_release": "3.3.0",
"_resolution": {
"type": "version",
"tag": "v3.3.0",
"commit": "d1b5b19c872068ebb14bfb854af838c30285cecd"
},
"_source": "git://github.com/nolimits4web/Swiper.git",
"_target": "~3.3.0",
"_originalSource": "swiper",
"_direct": true
}

View file

@ -0,0 +1,227 @@
# Change Log
## Swiper 3.3.0 - Released on January 10, 2016
* New 3D Flip effect. Can be enabled with `effect: 'flip' parameter
* New types of pagination with new parameters:
* `paginationType` - type of pagination. Can be `'bullets'` (default) or `'fraction'` or `'progress'` or `'custom'`
* `paginationFractionRender(swiper, currentClass, totalClass)` - custom function to render "fraction" type pagination
* `paginationProgressRender(swiper, progressbarClass)` - custom function to render "progress" type pagination
* `paginationCustomRender(swiper, current, total)` - custom function to render "custom" type pagination
* New `lazyLoadingInPrevNextAmount` parameter allows to lazy load images in specified amount of next/prev slides
* New `autoplayStopOnLast` parameter (`true` by default) tells to autoplay should it stop on last slide or start from first slide
* New `onAutoplay(swiper)` callback
* Minor fixes
## Swiper 3.2.7 - Released on December 7, 2015
* Fixed issue with using HTMLElements for next/prevButton parameters with breakpoints
* Fixed issue with not working Auto Height when using Controller
## Swiper 3.2.6 - Released on November 28, 2015
* Fixed issue in RTL layout using `mousewheelControl`
* Fixed issue in RTL layout using Parallax
## Swiper 3.2.5 - Released on November 21, 2015
* New "Auto Height" mode when container/wrapper adopts to the height of currently active slide. Can be enabled with `autoHeight: true` parameter
* Fixed issue with break points in FireFox
* Fixed issue with wrong slides position when using effects
* Fixed issue with none-updated scroll bar after using `setWrapperTranslate`
* Minor fixes
## Swiper 3.2.0 - Released on November 7, 2015
* Added responsive breakpoints support using new `breakpoints` parameter. Now you can specify different `slidesPerView` and other similar parameters for different sizes:
```js
slidesPerView: 5,
spaceBetween: 50,
breakpoints: {
1024: {
slidesPerView: 4,
spaceBetween: 40
},
768: {
slidesPerView: 3,
spaceBetween: 30
},
320: {
slidesPerView: 1,
spaceBetween: 10
}
}
```
* New callbacks: `onSlideNextStart`, `onSlideNextEnd`, `onSlidePrevStart`, `onSlidePrevEnd`
* Added Meteor package `meteor add nolimits4web:swiper`
* Fixed issue with mouse touchMove/End callbacks firing all the time
* Fixed issue with mousewheel in Chrome
* Minor fixes
## Swiper 3.1.7 - Released on October 10, 2015
* Fixed issue with lazy loading trying to download `undefined`-src images
* Fixed lazy loading on slides using jQuery version
* Fixed issue with `slideToClickedSlide` with `loop` and `centeredSlides`
* Fixed issue with wrong slides fill when number of slides less than `slidesPerView * slidesPerColumn` with `slidesPerColumnFill: 'row'`
* Minor fixes
## Swiper 3.1.5 - Released on September 28, 2015
* Added support for images `srcset` with lazy loading using `data-srcset` attribute
* Fixed new Chrome errors with `WebkitCSSMatrix`
* Fixed issue with `slideToClickedSlide` with `loop` and `centeredSlides`
* New `freeModeMinimumVelocity` parameter to set minimum required touch velocity to trigger free mode momentum
* Ability to make the Scrollbar draggable using new paramaters:
* `scrollbarDraggable` - (boolean) by default is `false`. Allows to enable draggable scrollbar
* `scrollbarSnapOnRelease` - (boolean) by default is `false`. Control slider snap on scrollbar release
* Minor fixes
## Swiper 3.1.2 - Released on August 22, 2015
* Fixed issues with loop and mousewheel when swiper stopped on last slide
* Imporved mouse wheel behavior in latest Chrome
* Fixed issue with `slidesPerView: 'auto'` and enabled `loop:true` mode to set `loopedSlides` to the amount of slides by default (if not specified)
* New `mousewheelSensitivity: 1` parameter allows to tweak mouse wheel sensitivity
* Fixed issue with updating swiper when swiping is locked (with `allowSwipeToNext`/`allowSwipeToPrev`)
* Fixed issue with wrong calculating of "visible" slides with enabled `centeredSlides`
* CSS fixes for 3D effects
* New options to release Swiper events for swipe-to-go-back work in iOS UIWebView with two options:
* `iOSEdgeSwipeDetection` (by default is `false`) - enable ios edge detection and release Swiper events
* `iOSEdgeSwipeThreshold` (default value is `20`) - area in `px` from left edge of screen to release events
* Improved source maps
* Minor fixes
## Swiper 3.1.0 - Released on July 14, 2015
* Accessibility (a11y)
* Fixed issue with wrong buttons labels
* Added support for pagination bullets
* New accessibility parameter for pagination label `paginationBulletMessage: 'Go to slide {{index}}'`
* Controler
* New parameter `controlBy` which can be 'slide' (by default) or 'container'. Defines a way how to control another slider: slide by slide or depending on all slides/container (like before)
* Now controllers in `controlBy: 'slide'` (default) mode will respect grid of each other
* Pagination
* New `paginationElement` parameter defines which HTML tag will be use to represent single pagination bullet. By default it is `span`
* New `roundLengths` parameter (by default is `false`) to round values of slides width and height to prevent blurry texts on usual resolution screens
* New `slidesOffsetBefore: 0` and `slidesOffsetAfter: 0` (in px) parameters to add additional slide offset within a container
* Correct calculation for slides size when use CSS padding on `.swiper-container`
* Fixed issue with not working onResize handler when swipes are locked
* Fixed issue with "jumping" effect when you disable `onlyExternal` during touchmove
* Fixed issue when slider goes to previos slide from last slide after window resize
* Added new `swiper.jquery.umd.js` version for the environment where both Swiper and jQuery included as modules
* Minor fixes
## Swiper 3.0.8 - Released on June 14, 2015
* Fixed issue with wrong active index and callbacks in Fade effect
* New mousewheel parameters:
* `mousewheelReleaseOnEdges` - will release mousewheel event and allow page scrolling when swiper is on edge positions (in the beginning or in the end)
* `mousewheelInvert` - option to invert mousewheel slides
* Fixed issue with lazy loading in next slides when `slidesPerView` > 1
* Fixed issue with resistance bounds when swiping is locked
* Fixed issue with wrong slides order in multi-row mode (when `slidesPerColumn` > 1)
* Fixed issue with not working keyboard control in RTL mode
* Fixed issue with nested fade-effect swipers
* Minor fixes
## Swiper 3.0.7 - Released on April 25, 2015
* New `width` and `height` parameters to force Swiper size, useful when it is hidden on intialization
* Better support for "Scroll Container". So now Swiper can be used as a scroll container with one single "scrollable"/"swipeable" slide
* Added lazy loading for background images with `data-background` attribute on required elements
* New "Sticky Free Mode" (with `freeModeSticky` parameter) which will snap to slides positions in free mode
* Fixed issues with lazy loading
* Fixed slide removing when loop mode is enabled
* Fixed issues with Autoplay and Fade effect
* Minor fixes
## Swiper 3.0.6 - Released on March 27, 2015
* Fixed sometimes wrong slides position when using "Fade" effect
* `.destroy(deleteInstance, cleanupStyles)` method now has second `cleanupStyles` argument, when passed - all custom styles will be removed from slides, wrapper and container. Useful if you need to destroy Swiper and to init again with new options or in different direction
* Minor fixes
## Swiper 3.0.5 - Released on March 21, 2015
* New Keyboard accessibility module to provide foucsable navigation buttons and basic ARIA for screen readers with new parameters:
* `a11y: false` - enable accessibility
* `prevSlideMessage: 'Previous slide'` - message for screen readers for previous button
* `nextSlideMessage: 'Next slide'` - message for screen readers for next button
* `firstSlideMessage: 'This is the first slide'` - message for screen readers for previous button when swiper is on first slide
* `lastSlideMessage: 'This is the last slide'` - message for screen readers for next button when swiper is on last slide
* New Emitter module. It allows to work with callbacks like with events, even adding them after initialization with new methods:
* `.on(event, handler)` - add event/callback
* `.off(event, handler)` - remove this event/callback
* `.once(event, handler)` - add event/callback that will be executed only once
* Plugins API is back. It allows to write custom Swiper plugins
* Better support for browser that don't support flexbox layout
* New parameter `setWrapperSize` (be default it is `false`) to provide better compatibility with browser without flexbox support. Enabled this option and plugin will set width/height on swiper wrapper equal to total size of all slides
* New `virtualTranslate` parameter. When it is enabled swiper will be operated as usual except it will not move. Useful when you may need to create custom slide transition
* Added support for multiple Pagination containers
* Fixed `onLazyImage...` callbacks
* Fixed issue with not accessible links inside of Slides on Android < 4.4
* Fixed pagination bullets behavior in loop mode with specified `slidesPerGroup`
* Fixed issues with clicks on IE 10+ touch devices
* Fixed issues with Coverflow support on IE 10+
* Hashnav now will update document hash after transition to prevent browsers UI lags, not in the beginning like before
* Super basic support for IE 9 with swiper.jquery version. No animation and transitions, but basic stuff like switching slides/pagination/scrollbars works
## Swiper 3.0.4 - Released on March 6, 2015
* New Images Lazy Load component
* With new parameters `lazyLoading`, `lazyLoadingInPrevNext`, `lazyLoadingOnTransitionStart` (all disabled by default)
* With new callbacks `onLazyImageLoad` and `onLazyImageReady`
* `updateOnImages` ready split into 2 parameters:
* `preloadImages` (by default is true) - to preload all images on swiper init
* `updateOnImages` (by default is true) - update swiper when all images loaded
* Fixed issues with touchmove on fouces form elements
* New `onObserverUpdate` callback function to be called after updates by ovserver
* Fixed issue with not working inputs with keyboard control for jQuery version
* New `paginationBulletRender` parameter that accepts function which allow custom pagination elements layout
* Hash Navigation will run callback dpending on `runCallbacksOnInit` parameter
* `watchVisibility` parameter renamed to `watchSlidesVisibility`
## Swiper 3.0.3 - Released on March 1, 2015
* Fixed issue with not firing onSlideChangeEnd callback after calling .slideTo with
runCallbacks=false
* Fixed values of isBeginning/isEnd when there is only one slide
* New `crossFade` option for fade effect
* Improved support for devices with both touch and mouse inputs, not yet on IE
* Fixed not correctly working mousewheel and keyobard control in swiper.jquery version
* New parallax module for transitions with parallax effects on internal elements
* Improved .update and .onResize methods
* Minor fixes
## Swiper 3.0.2 - Released on February 22, 2015
* Fixed issue with keyboard events not cleaned up with Swiper.destroy
* Encoded inline SVG images for IE support
* New callbacks
* onInit (swiper)
* onTouchMoveOpposite (swiper, e)
* Fixed free mode momentum in RTL layout
* `.update` method improved to fully cover what `onResize` do for full and correct update
* Exposed `swiper.touches` object with the following properties: `startX`, `startY`, `currentX`, `currentY`, `diff`
* New methods to remove slides
* `.removeSlide(index)` or `.removeSlide([indexes])` - to remove selected slides
* `.removeAllSlides()` - to remove all slides
## Swiper 3.0.1 - Released on February 13, 2015
* Fixed issue with navigation buttons in Firefox in loop mode
* Fixed issue with image dragging in IE 10+
## Swiper 3.0.0 - Released on February 11, 2015
* Initial release of all new Swiper 3
* Removed features
* Dropped support for old browsers. Now it is compatible with:
* iOS 7+
* Android 4+ (multirow mode only for Android 4.4+)
* Latest Chrome, Safari, Firefox and Opera desktop browsers
* WP 8+, IE 10+ (3D effects may not work correctly on IE because of wrong nested 3D transform support)
* Scroll Container. Removed in favor of pure CSS `overflow: auto` with `-webkit-overflow-scrolling: touch`
* New features
* Swiper now uses modern flexbox layout, which by itself give more features and advantages
* Such Swiper 2.x plugins as Hash Navigation, Smooth Progress, 3D Flow and Scrollbar are now incoroporated into Swiper 3.x core
* Full RTL support
* Built-in navigation buttons/arrows
* Controller. Now one Swiper could be controlled (or control itself) by another Swiper
* Multi row slides layout with `slidesPerColumn` option
* Better support for nested Swipers, now it is possible to use same-direction nested Swipers, like horizontal in horizontal
* Space between slides
* New transition effects: 3D Coverflow, 3D Cube and Fade transitions
* Slides are `border-box` now, so it is possible to use borders and paddings directly on slides
* Auto layout mode (`slidesPerView: 'auto'`) now gives more freedom, you can even specify slides sizes in % and use margins on them
* Mutation Observers. If enabled, Swiper will watch for changes in Dom and update its layout automatically
* Better clicks prevention during swiping
* Many of API methods, parameters and callbacks are changed
* Added a bit lightweight jQuery/Zepto version of Swiper that can be used if you use jQuery/Zepto in your project

View file

@ -0,0 +1,20 @@
The MIT License (MIT)
Copyright (c) 2014 Vladimir Kharlampidi
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.

View file

@ -0,0 +1,35 @@
{
"name": "Swiper",
"repository": {
"type": "git",
"url": "https://github.com/nolimits4web/Swiper.git"
},
"description": "Most modern mobile touch slider and framework with hardware accelerated transitions",
"version": "3.3.0",
"author": "Vladimir Kharlampidi",
"homepage": "http://www.idangero.us/swiper/",
"keywords": ["swiper", "swipe", "slider", "touch", "ios", "mobile", "cordova", "phonegap", "app", "framework", "carousel", "gallery"],
"dependencies": {
},
"scripts": [
"dist/js/swiper.js"
],
"main": [
"dist/js/swiper.js",
"dist/css/swiper.css"
],
"styles": [
"dist/css/swiper.css"
],
"license": ["MIT"],
"dependencies": {},
"ignore": [
".*",
"demos",
"gulpfile",
"build",
"node_modules",
"playground",
"package.json"
]
}

View file

@ -0,0 +1,17 @@
{
"name": "swiper",
"repo": "https://github.com/nolimits4web/Swiper.git",
"description": "Most modern mobile touch slider and framework with hardware accelerated transitions",
"version": "3.3.0",
"keywords": ["swiper", "swipe", "slider", "touch", "ios", "mobile", "cordova", "phonegap", "app", "framework", "carousel", "gallery"],
"dependencies": {
},
"scripts": [
"dist/js/swiper.js"
],
"main": "dist/js/swiper.js",
"styles": [
"dist/css/swiper.css"
],
"license": ["MIT"]
}

View file

@ -0,0 +1,547 @@
/**
* Swiper 3.3.0
* Most modern mobile touch slider and framework with hardware accelerated transitions
*
* http://www.idangero.us/swiper/
*
* Copyright 2016, Vladimir Kharlampidi
* The iDangero.us
* http://www.idangero.us/
*
* Licensed under MIT
*
* Released on: January 10, 2016
*/
.swiper-container {
margin: 0 auto;
position: relative;
overflow: hidden;
/* Fix of Webkit flickering */
z-index: 1;
}
.swiper-container-no-flexbox .swiper-slide {
float: left;
}
.swiper-container-vertical > .swiper-wrapper {
-webkit-box-orient: vertical;
-moz-box-orient: vertical;
-ms-flex-direction: column;
-webkit-flex-direction: column;
flex-direction: column;
}
.swiper-wrapper {
position: relative;
width: 100%;
height: 100%;
z-index: 1;
display: -webkit-box;
display: -moz-box;
display: -ms-flexbox;
display: -webkit-flex;
display: flex;
-webkit-transition-property: -webkit-transform;
-moz-transition-property: -moz-transform;
-o-transition-property: -o-transform;
-ms-transition-property: -ms-transform;
transition-property: transform;
-webkit-box-sizing: content-box;
-moz-box-sizing: content-box;
box-sizing: content-box;
}
.swiper-container-android .swiper-slide,
.swiper-wrapper {
-webkit-transform: translate3d(0px, 0, 0);
-moz-transform: translate3d(0px, 0, 0);
-o-transform: translate(0px, 0px);
-ms-transform: translate3d(0px, 0, 0);
transform: translate3d(0px, 0, 0);
}
.swiper-container-multirow > .swiper-wrapper {
-webkit-box-lines: multiple;
-moz-box-lines: multiple;
-ms-flex-wrap: wrap;
-webkit-flex-wrap: wrap;
flex-wrap: wrap;
}
.swiper-container-free-mode > .swiper-wrapper {
-webkit-transition-timing-function: ease-out;
-moz-transition-timing-function: ease-out;
-ms-transition-timing-function: ease-out;
-o-transition-timing-function: ease-out;
transition-timing-function: ease-out;
margin: 0 auto;
}
.swiper-slide {
-webkit-flex-shrink: 0;
-ms-flex: 0 0 auto;
flex-shrink: 0;
width: 100%;
height: 100%;
position: relative;
}
/* Auto Height */
.swiper-container-autoheight,
.swiper-container-autoheight .swiper-slide {
height: auto;
}
.swiper-container-autoheight .swiper-wrapper {
-webkit-box-align: start;
-ms-flex-align: start;
-webkit-align-items: flex-start;
align-items: flex-start;
-webkit-transition-property: -webkit-transform, height;
-moz-transition-property: -moz-transform;
-o-transition-property: -o-transform;
-ms-transition-property: -ms-transform;
transition-property: transform, height;
}
/* a11y */
.swiper-container .swiper-notification {
position: absolute;
left: 0;
top: 0;
pointer-events: none;
opacity: 0;
z-index: -1000;
}
/* IE10 Windows Phone 8 Fixes */
.swiper-wp8-horizontal {
-ms-touch-action: pan-y;
touch-action: pan-y;
}
.swiper-wp8-vertical {
-ms-touch-action: pan-x;
touch-action: pan-x;
}
/* Arrows */
.swiper-button-prev,
.swiper-button-next {
position: absolute;
top: 50%;
width: 27px;
height: 44px;
margin-top: -22px;
z-index: 10;
cursor: pointer;
-moz-background-size: 27px 44px;
-webkit-background-size: 27px 44px;
background-size: 27px 44px;
background-position: center;
background-repeat: no-repeat;
}
.swiper-button-prev.swiper-button-disabled,
.swiper-button-next.swiper-button-disabled {
opacity: 0.35;
cursor: auto;
pointer-events: none;
}
.swiper-button-prev,
.swiper-container-rtl .swiper-button-next {
background-image: url("data:image/svg+xml;charset=utf-8,%3Csvg%20xmlns%3D'http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg'%20viewBox%3D'0%200%2027%2044'%3E%3Cpath%20d%3D'M0%2C22L22%2C0l2.1%2C2.1L4.2%2C22l19.9%2C19.9L22%2C44L0%2C22L0%2C22L0%2C22z'%20fill%3D'%23007aff'%2F%3E%3C%2Fsvg%3E");
left: 10px;
right: auto;
}
.swiper-button-prev.swiper-button-black,
.swiper-container-rtl .swiper-button-next.swiper-button-black {
background-image: url("data:image/svg+xml;charset=utf-8,%3Csvg%20xmlns%3D'http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg'%20viewBox%3D'0%200%2027%2044'%3E%3Cpath%20d%3D'M0%2C22L22%2C0l2.1%2C2.1L4.2%2C22l19.9%2C19.9L22%2C44L0%2C22L0%2C22L0%2C22z'%20fill%3D'%23000000'%2F%3E%3C%2Fsvg%3E");
}
.swiper-button-prev.swiper-button-white,
.swiper-container-rtl .swiper-button-next.swiper-button-white {
background-image: url("data:image/svg+xml;charset=utf-8,%3Csvg%20xmlns%3D'http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg'%20viewBox%3D'0%200%2027%2044'%3E%3Cpath%20d%3D'M0%2C22L22%2C0l2.1%2C2.1L4.2%2C22l19.9%2C19.9L22%2C44L0%2C22L0%2C22L0%2C22z'%20fill%3D'%23ffffff'%2F%3E%3C%2Fsvg%3E");
}
.swiper-button-next,
.swiper-container-rtl .swiper-button-prev {
background-image: url("data:image/svg+xml;charset=utf-8,%3Csvg%20xmlns%3D'http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg'%20viewBox%3D'0%200%2027%2044'%3E%3Cpath%20d%3D'M27%2C22L27%2C22L5%2C44l-2.1-2.1L22.8%2C22L2.9%2C2.1L5%2C0L27%2C22L27%2C22z'%20fill%3D'%23007aff'%2F%3E%3C%2Fsvg%3E");
right: 10px;
left: auto;
}
.swiper-button-next.swiper-button-black,
.swiper-container-rtl .swiper-button-prev.swiper-button-black {
background-image: url("data:image/svg+xml;charset=utf-8,%3Csvg%20xmlns%3D'http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg'%20viewBox%3D'0%200%2027%2044'%3E%3Cpath%20d%3D'M27%2C22L27%2C22L5%2C44l-2.1-2.1L22.8%2C22L2.9%2C2.1L5%2C0L27%2C22L27%2C22z'%20fill%3D'%23000000'%2F%3E%3C%2Fsvg%3E");
}
.swiper-button-next.swiper-button-white,
.swiper-container-rtl .swiper-button-prev.swiper-button-white {
background-image: url("data:image/svg+xml;charset=utf-8,%3Csvg%20xmlns%3D'http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg'%20viewBox%3D'0%200%2027%2044'%3E%3Cpath%20d%3D'M27%2C22L27%2C22L5%2C44l-2.1-2.1L22.8%2C22L2.9%2C2.1L5%2C0L27%2C22L27%2C22z'%20fill%3D'%23ffffff'%2F%3E%3C%2Fsvg%3E");
}
/* Pagination Styles */
.swiper-pagination {
position: absolute;
text-align: center;
-webkit-transition: 300ms;
-moz-transition: 300ms;
-o-transition: 300ms;
transition: 300ms;
-webkit-transform: translate3d(0, 0, 0);
-ms-transform: translate3d(0, 0, 0);
-o-transform: translate3d(0, 0, 0);
transform: translate3d(0, 0, 0);
z-index: 10;
}
.swiper-pagination.swiper-pagination-hidden {
opacity: 0;
}
/* Common Styles */
.swiper-pagination-fraction,
.swiper-pagination-custom,
.swiper-container-horizontal > .swiper-pagination-bullets {
bottom: 10px;
left: 0;
width: 100%;
}
/* Bullets */
.swiper-pagination-bullet {
width: 8px;
height: 8px;
display: inline-block;
border-radius: 100%;
background: #000;
opacity: 0.2;
}
button.swiper-pagination-bullet {
border: none;
margin: 0;
padding: 0;
box-shadow: none;
-moz-appearance: none;
-ms-appearance: none;
-webkit-appearance: none;
appearance: none;
}
.swiper-pagination-clickable .swiper-pagination-bullet {
cursor: pointer;
}
.swiper-pagination-white .swiper-pagination-bullet {
background: #fff;
}
.swiper-pagination-bullet-active {
opacity: 1;
background: #007aff;
}
.swiper-pagination-white .swiper-pagination-bullet-active {
background: #fff;
}
.swiper-pagination-black .swiper-pagination-bullet-active {
background: #000;
}
.swiper-container-vertical > .swiper-pagination-bullets {
right: 10px;
top: 50%;
-webkit-transform: translate3d(0px, -50%, 0);
-moz-transform: translate3d(0px, -50%, 0);
-o-transform: translate(0px, -50%);
-ms-transform: translate3d(0px, -50%, 0);
transform: translate3d(0px, -50%, 0);
}
.swiper-container-vertical > .swiper-pagination-bullets .swiper-pagination-bullet {
margin: 5px 0;
display: block;
}
.swiper-container-horizontal > .swiper-pagination-bullets .swiper-pagination-bullet {
margin: 0 5px;
}
/* Progress */
.swiper-pagination-progress {
background: rgba(0, 0, 0, 0.25);
position: absolute;
}
.swiper-pagination-progress .swiper-pagination-progressbar {
background: #007aff;
position: absolute;
left: 0;
top: 0;
width: 100%;
height: 100%;
-webkit-transform: scale(0);
-ms-transform: scale(0);
-o-transform: scale(0);
transform: scale(0);
-webkit-transform-origin: left top;
-moz-transform-origin: left top;
-ms-transform-origin: left top;
-o-transform-origin: left top;
transform-origin: left top;
}
.swiper-container-rtl .swiper-pagination-progress .swiper-pagination-progressbar {
-webkit-transform-origin: right top;
-moz-transform-origin: right top;
-ms-transform-origin: right top;
-o-transform-origin: right top;
transform-origin: right top;
}
.swiper-container-horizontal > .swiper-pagination-progress {
width: 100%;
height: 4px;
left: 0;
top: 0;
}
.swiper-container-vertical > .swiper-pagination-progress {
width: 4px;
height: 100%;
left: 0;
top: 0;
}
.swiper-pagination-progress.swiper-pagination-white {
background: rgba(255, 255, 255, 0.5);
}
.swiper-pagination-progress.swiper-pagination-white .swiper-pagination-progressbar {
background: #fff;
}
.swiper-pagination-progress.swiper-pagination-black .swiper-pagination-progressbar {
background: #000;
}
/* 3D Container */
.swiper-container-3d {
-webkit-perspective: 1200px;
-moz-perspective: 1200px;
-o-perspective: 1200px;
perspective: 1200px;
}
.swiper-container-3d .swiper-wrapper,
.swiper-container-3d .swiper-slide,
.swiper-container-3d .swiper-slide-shadow-left,
.swiper-container-3d .swiper-slide-shadow-right,
.swiper-container-3d .swiper-slide-shadow-top,
.swiper-container-3d .swiper-slide-shadow-bottom,
.swiper-container-3d .swiper-cube-shadow {
-webkit-transform-style: preserve-3d;
-moz-transform-style: preserve-3d;
-ms-transform-style: preserve-3d;
transform-style: preserve-3d;
}
.swiper-container-3d .swiper-slide-shadow-left,
.swiper-container-3d .swiper-slide-shadow-right,
.swiper-container-3d .swiper-slide-shadow-top,
.swiper-container-3d .swiper-slide-shadow-bottom {
position: absolute;
left: 0;
top: 0;
width: 100%;
height: 100%;
pointer-events: none;
z-index: 10;
}
.swiper-container-3d .swiper-slide-shadow-left {
background-image: -webkit-gradient(linear, left top, right top, from(rgba(0, 0, 0, 0.5)), to(rgba(0, 0, 0, 0)));
/* Safari 4+, Chrome */
background-image: -webkit-linear-gradient(right, rgba(0, 0, 0, 0.5), rgba(0, 0, 0, 0));
/* Chrome 10+, Safari 5.1+, iOS 5+ */
background-image: -moz-linear-gradient(right, rgba(0, 0, 0, 0.5), rgba(0, 0, 0, 0));
/* Firefox 3.6-15 */
background-image: -o-linear-gradient(right, rgba(0, 0, 0, 0.5), rgba(0, 0, 0, 0));
/* Opera 11.10-12.00 */
background-image: linear-gradient(to left, rgba(0, 0, 0, 0.5), rgba(0, 0, 0, 0));
/* Firefox 16+, IE10, Opera 12.50+ */
}
.swiper-container-3d .swiper-slide-shadow-right {
background-image: -webkit-gradient(linear, right top, left top, from(rgba(0, 0, 0, 0.5)), to(rgba(0, 0, 0, 0)));
/* Safari 4+, Chrome */
background-image: -webkit-linear-gradient(left, rgba(0, 0, 0, 0.5), rgba(0, 0, 0, 0));
/* Chrome 10+, Safari 5.1+, iOS 5+ */
background-image: -moz-linear-gradient(left, rgba(0, 0, 0, 0.5), rgba(0, 0, 0, 0));
/* Firefox 3.6-15 */
background-image: -o-linear-gradient(left, rgba(0, 0, 0, 0.5), rgba(0, 0, 0, 0));
/* Opera 11.10-12.00 */
background-image: linear-gradient(to right, rgba(0, 0, 0, 0.5), rgba(0, 0, 0, 0));
/* Firefox 16+, IE10, Opera 12.50+ */
}
.swiper-container-3d .swiper-slide-shadow-top {
background-image: -webkit-gradient(linear, left top, left bottom, from(rgba(0, 0, 0, 0.5)), to(rgba(0, 0, 0, 0)));
/* Safari 4+, Chrome */
background-image: -webkit-linear-gradient(bottom, rgba(0, 0, 0, 0.5), rgba(0, 0, 0, 0));
/* Chrome 10+, Safari 5.1+, iOS 5+ */
background-image: -moz-linear-gradient(bottom, rgba(0, 0, 0, 0.5), rgba(0, 0, 0, 0));
/* Firefox 3.6-15 */
background-image: -o-linear-gradient(bottom, rgba(0, 0, 0, 0.5), rgba(0, 0, 0, 0));
/* Opera 11.10-12.00 */
background-image: linear-gradient(to top, rgba(0, 0, 0, 0.5), rgba(0, 0, 0, 0));
/* Firefox 16+, IE10, Opera 12.50+ */
}
.swiper-container-3d .swiper-slide-shadow-bottom {
background-image: -webkit-gradient(linear, left bottom, left top, from(rgba(0, 0, 0, 0.5)), to(rgba(0, 0, 0, 0)));
/* Safari 4+, Chrome */
background-image: -webkit-linear-gradient(top, rgba(0, 0, 0, 0.5), rgba(0, 0, 0, 0));
/* Chrome 10+, Safari 5.1+, iOS 5+ */
background-image: -moz-linear-gradient(top, rgba(0, 0, 0, 0.5), rgba(0, 0, 0, 0));
/* Firefox 3.6-15 */
background-image: -o-linear-gradient(top, rgba(0, 0, 0, 0.5), rgba(0, 0, 0, 0));
/* Opera 11.10-12.00 */
background-image: linear-gradient(to bottom, rgba(0, 0, 0, 0.5), rgba(0, 0, 0, 0));
/* Firefox 16+, IE10, Opera 12.50+ */
}
/* Coverflow */
.swiper-container-coverflow .swiper-wrapper,
.swiper-container-flip .swiper-wrapper {
/* Windows 8 IE 10 fix */
-ms-perspective: 1200px;
}
/* Cube + Flip */
.swiper-container-cube,
.swiper-container-flip {
overflow: visible;
}
.swiper-container-cube .swiper-slide,
.swiper-container-flip .swiper-slide {
pointer-events: none;
-webkit-backface-visibility: hidden;
-moz-backface-visibility: hidden;
-ms-backface-visibility: hidden;
backface-visibility: hidden;
z-index: 1;
}
.swiper-container-cube .swiper-slide .swiper-slide,
.swiper-container-flip .swiper-slide .swiper-slide {
pointer-events: none;
}
.swiper-container-cube .swiper-slide-active,
.swiper-container-flip .swiper-slide-active,
.swiper-container-cube .swiper-slide-active .swiper-slide-active,
.swiper-container-flip .swiper-slide-active .swiper-slide-active {
pointer-events: auto;
}
.swiper-container-cube .swiper-slide-shadow-top,
.swiper-container-flip .swiper-slide-shadow-top,
.swiper-container-cube .swiper-slide-shadow-bottom,
.swiper-container-flip .swiper-slide-shadow-bottom,
.swiper-container-cube .swiper-slide-shadow-left,
.swiper-container-flip .swiper-slide-shadow-left,
.swiper-container-cube .swiper-slide-shadow-right,
.swiper-container-flip .swiper-slide-shadow-right {
z-index: 0;
-webkit-backface-visibility: hidden;
-moz-backface-visibility: hidden;
-ms-backface-visibility: hidden;
backface-visibility: hidden;
}
/* Cube */
.swiper-container-cube .swiper-slide {
visibility: hidden;
-webkit-transform-origin: 0 0;
-moz-transform-origin: 0 0;
-ms-transform-origin: 0 0;
transform-origin: 0 0;
width: 100%;
height: 100%;
}
.swiper-container-cube.swiper-container-rtl .swiper-slide {
-webkit-transform-origin: 100% 0;
-moz-transform-origin: 100% 0;
-ms-transform-origin: 100% 0;
transform-origin: 100% 0;
}
.swiper-container-cube .swiper-slide-active,
.swiper-container-cube .swiper-slide-next,
.swiper-container-cube .swiper-slide-prev,
.swiper-container-cube .swiper-slide-next + .swiper-slide {
pointer-events: auto;
visibility: visible;
}
.swiper-container-cube .swiper-cube-shadow {
position: absolute;
left: 0;
bottom: 0px;
width: 100%;
height: 100%;
background: #000;
opacity: 0.6;
-webkit-filter: blur(50px);
filter: blur(50px);
z-index: 0;
}
/* Fade */
.swiper-container-fade.swiper-container-free-mode .swiper-slide {
-webkit-transition-timing-function: ease-out;
-moz-transition-timing-function: ease-out;
-ms-transition-timing-function: ease-out;
-o-transition-timing-function: ease-out;
transition-timing-function: ease-out;
}
.swiper-container-fade .swiper-slide {
pointer-events: none;
-webkit-transition-property: opacity;
-moz-transition-property: opacity;
-o-transition-property: opacity;
transition-property: opacity;
}
.swiper-container-fade .swiper-slide .swiper-slide {
pointer-events: none;
}
.swiper-container-fade .swiper-slide-active,
.swiper-container-fade .swiper-slide-active .swiper-slide-active {
pointer-events: auto;
}
/* Scrollbar */
.swiper-scrollbar {
border-radius: 10px;
position: relative;
-ms-touch-action: none;
background: rgba(0, 0, 0, 0.1);
}
.swiper-container-horizontal > .swiper-scrollbar {
position: absolute;
left: 1%;
bottom: 3px;
z-index: 50;
height: 5px;
width: 98%;
}
.swiper-container-vertical > .swiper-scrollbar {
position: absolute;
right: 3px;
top: 1%;
z-index: 50;
width: 5px;
height: 98%;
}
.swiper-scrollbar-drag {
height: 100%;
width: 100%;
position: relative;
background: rgba(0, 0, 0, 0.5);
border-radius: 10px;
left: 0;
top: 0;
}
.swiper-scrollbar-cursor-drag {
cursor: move;
}
/* Preloader */
.swiper-lazy-preloader {
width: 42px;
height: 42px;
position: absolute;
left: 50%;
top: 50%;
margin-left: -21px;
margin-top: -21px;
z-index: 10;
-webkit-transform-origin: 50%;
-moz-transform-origin: 50%;
transform-origin: 50%;
-webkit-animation: swiper-preloader-spin 1s steps(12, end) infinite;
-moz-animation: swiper-preloader-spin 1s steps(12, end) infinite;
animation: swiper-preloader-spin 1s steps(12, end) infinite;
}
.swiper-lazy-preloader:after {
display: block;
content: "";
width: 100%;
height: 100%;
background-image: url("data:image/svg+xml;charset=utf-8,%3Csvg%20viewBox%3D'0%200%20120%20120'%20xmlns%3D'http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg'%20xmlns%3Axlink%3D'http%3A%2F%2Fwww.w3.org%2F1999%2Fxlink'%3E%3Cdefs%3E%3Cline%20id%3D'l'%20x1%3D'60'%20x2%3D'60'%20y1%3D'7'%20y2%3D'27'%20stroke%3D'%236c6c6c'%20stroke-width%3D'11'%20stroke-linecap%3D'round'%2F%3E%3C%2Fdefs%3E%3Cg%3E%3Cuse%20xlink%3Ahref%3D'%23l'%20opacity%3D'.27'%2F%3E%3Cuse%20xlink%3Ahref%3D'%23l'%20opacity%3D'.27'%20transform%3D'rotate(30%2060%2C60)'%2F%3E%3Cuse%20xlink%3Ahref%3D'%23l'%20opacity%3D'.27'%20transform%3D'rotate(60%2060%2C60)'%2F%3E%3Cuse%20xlink%3Ahref%3D'%23l'%20opacity%3D'.27'%20transform%3D'rotate(90%2060%2C60)'%2F%3E%3Cuse%20xlink%3Ahref%3D'%23l'%20opacity%3D'.27'%20transform%3D'rotate(120%2060%2C60)'%2F%3E%3Cuse%20xlink%3Ahref%3D'%23l'%20opacity%3D'.27'%20transform%3D'rotate(150%2060%2C60)'%2F%3E%3Cuse%20xlink%3Ahref%3D'%23l'%20opacity%3D'.37'%20transform%3D'rotate(180%2060%2C60)'%2F%3E%3Cuse%20xlink%3Ahref%3D'%23l'%20opacity%3D'.46'%20transform%3D'rotate(210%2060%2C60)'%2F%3E%3Cuse%20xlink%3Ahref%3D'%23l'%20opacity%3D'.56'%20transform%3D'rotate(240%2060%2C60)'%2F%3E%3Cuse%20xlink%3Ahref%3D'%23l'%20opacity%3D'.66'%20transform%3D'rotate(270%2060%2C60)'%2F%3E%3Cuse%20xlink%3Ahref%3D'%23l'%20opacity%3D'.75'%20transform%3D'rotate(300%2060%2C60)'%2F%3E%3Cuse%20xlink%3Ahref%3D'%23l'%20opacity%3D'.85'%20transform%3D'rotate(330%2060%2C60)'%2F%3E%3C%2Fg%3E%3C%2Fsvg%3E");
background-position: 50%;
-webkit-background-size: 100%;
background-size: 100%;
background-repeat: no-repeat;
}
.swiper-lazy-preloader-white:after {
background-image: url("data:image/svg+xml;charset=utf-8,%3Csvg%20viewBox%3D'0%200%20120%20120'%20xmlns%3D'http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg'%20xmlns%3Axlink%3D'http%3A%2F%2Fwww.w3.org%2F1999%2Fxlink'%3E%3Cdefs%3E%3Cline%20id%3D'l'%20x1%3D'60'%20x2%3D'60'%20y1%3D'7'%20y2%3D'27'%20stroke%3D'%23fff'%20stroke-width%3D'11'%20stroke-linecap%3D'round'%2F%3E%3C%2Fdefs%3E%3Cg%3E%3Cuse%20xlink%3Ahref%3D'%23l'%20opacity%3D'.27'%2F%3E%3Cuse%20xlink%3Ahref%3D'%23l'%20opacity%3D'.27'%20transform%3D'rotate(30%2060%2C60)'%2F%3E%3Cuse%20xlink%3Ahref%3D'%23l'%20opacity%3D'.27'%20transform%3D'rotate(60%2060%2C60)'%2F%3E%3Cuse%20xlink%3Ahref%3D'%23l'%20opacity%3D'.27'%20transform%3D'rotate(90%2060%2C60)'%2F%3E%3Cuse%20xlink%3Ahref%3D'%23l'%20opacity%3D'.27'%20transform%3D'rotate(120%2060%2C60)'%2F%3E%3Cuse%20xlink%3Ahref%3D'%23l'%20opacity%3D'.27'%20transform%3D'rotate(150%2060%2C60)'%2F%3E%3Cuse%20xlink%3Ahref%3D'%23l'%20opacity%3D'.37'%20transform%3D'rotate(180%2060%2C60)'%2F%3E%3Cuse%20xlink%3Ahref%3D'%23l'%20opacity%3D'.46'%20transform%3D'rotate(210%2060%2C60)'%2F%3E%3Cuse%20xlink%3Ahref%3D'%23l'%20opacity%3D'.56'%20transform%3D'rotate(240%2060%2C60)'%2F%3E%3Cuse%20xlink%3Ahref%3D'%23l'%20opacity%3D'.66'%20transform%3D'rotate(270%2060%2C60)'%2F%3E%3Cuse%20xlink%3Ahref%3D'%23l'%20opacity%3D'.75'%20transform%3D'rotate(300%2060%2C60)'%2F%3E%3Cuse%20xlink%3Ahref%3D'%23l'%20opacity%3D'.85'%20transform%3D'rotate(330%2060%2C60)'%2F%3E%3C%2Fg%3E%3C%2Fsvg%3E");
}
@-webkit-keyframes swiper-preloader-spin {
100% {
-webkit-transform: rotate(360deg);
}
}
@keyframes swiper-preloader-spin {
100% {
transform: rotate(360deg);
}
}

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

File diff suppressed because one or more lines are too long

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 it is too large Load diff

File diff suppressed because one or more lines are too long

File diff suppressed because it is too large Load diff

File diff suppressed because one or more lines are too long

View file

@ -0,0 +1,299 @@
(function(){
'use strict';
var gulp = require('gulp'),
connect = require('gulp-connect'),
open = require('gulp-open'),
less = require('gulp-less'),
rename = require('gulp-rename'),
header = require('gulp-header'),
path = require('path'),
uglify = require('gulp-uglify'),
sourcemaps = require('gulp-sourcemaps'),
minifyCSS = require('gulp-minify-css'),
tap = require('gulp-tap'),
concat = require('gulp-concat'),
jshint = require('gulp-jshint'),
stylish = require('jshint-stylish'),
fs = require('fs'),
paths = {
root: './',
build: {
root: 'build/',
styles: 'build/css/',
scripts: 'build/js/'
},
dist: {
root: 'dist/',
styles: 'dist/css/',
scripts: 'dist/js/'
},
playground: {
root: 'playground/'
},
source: {
root: 'src/',
styles: 'src/less/',
scripts: 'src/js/*.js'
},
},
swiper = {
filename: 'swiper',
jsFiles: [
'src/js/wrap-start.js',
'src/js/swiper-intro.js',
'src/js/core.js',
'src/js/effects.js',
'src/js/lazy-load.js',
'src/js/scrollbar.js',
'src/js/controller.js',
'src/js/hashnav.js',
'src/js/keyboard.js',
'src/js/mousewheel.js',
'src/js/parallax.js',
'src/js/plugins.js',
'src/js/emitter.js',
'src/js/a11y.js',
'src/js/init.js',
'src/js/swiper-outro.js',
'src/js/swiper-proto.js',
'src/js/dom.js',
'src/js/get-dom-lib.js',
'src/js/dom-plugins.js',
'src/js/wrap-end.js',
'src/js/amd.js'
],
jQueryFiles : [
'src/js/wrap-start.js',
'src/js/swiper-intro.js',
'src/js/core.js',
'src/js/effects.js',
'src/js/lazy-load.js',
'src/js/scrollbar.js',
'src/js/controller.js',
'src/js/hashnav.js',
'src/js/keyboard.js',
'src/js/mousewheel.js',
'src/js/parallax.js',
'src/js/plugins.js',
'src/js/emitter.js',
'src/js/a11y.js',
'src/js/init.js',
'src/js/swiper-outro.js',
'src/js/swiper-proto.js',
'src/js/get-dom-lib.js',
'src/js/dom-plugins.js',
'src/js/wrap-end.js',
'src/js/amd.js'
],
jQueryUMDFiles : [
'src/js/wrap-start-umd.js',
'src/js/swiper-intro.js',
'src/js/core.js',
'src/js/effects.js',
'src/js/lazy-load.js',
'src/js/scrollbar.js',
'src/js/controller.js',
'src/js/hashnav.js',
'src/js/keyboard.js',
'src/js/mousewheel.js',
'src/js/parallax.js',
'src/js/plugins.js',
'src/js/emitter.js',
'src/js/a11y.js',
'src/js/init.js',
'src/js/swiper-outro.js',
'src/js/swiper-proto.js',
'src/js/get-jquery.js',
'src/js/dom-plugins.js',
'src/js/wrap-end-umd.js',
],
Framework7Files : [
'src/js/swiper-intro-f7.js',
'src/js/core.js',
'src/js/effects.js',
'src/js/lazy-load.js',
'src/js/scrollbar.js',
'src/js/controller.js',
'src/js/parallax.js',
'src/js/plugins.js',
'src/js/emitter.js',
'src/js/a11y.js',
'src/js/init.js',
'src/js/swiper-outro.js',
'src/js/swiper-proto.js',
],
pkg: require('./bower.json'),
banner: [
'/**',
' * Swiper <%= pkg.version %>',
' * <%= pkg.description %>',
' * ',
' * <%= pkg.homepage %>',
' * ',
' * Copyright <%= date.year %>, <%= pkg.author %>',
' * The iDangero.us',
' * http://www.idangero.us/',
' * ',
' * Licensed under <%= pkg.license.join(" & ") %>',
' * ',
' * Released on: <%= date.month %> <%= date.day %>, <%= date.year %>',
' */',
''].join('\n'),
date: {
year: new Date().getFullYear(),
month: ('January February March April May June July August September October November December').split(' ')[new Date().getMonth()],
day: new Date().getDate()
}
};
function addJSIndent (file, t, minusIndent) {
var addIndent = ' ';
var filename = file.path.split('src/js/')[1];
if (['wrap-start.js', 'wrap-start-umd.js', 'wrap-end.js', 'wrap-end-umd.js', 'amd.js'].indexOf(filename) !== -1) {
addIndent = '';
}
if (filename === 'swiper-intro.js' || filename === 'swiper-intro-f7.js' || filename === 'swiper-outro.js' || filename === 'dom.js' || filename === 'get-dom-lib.js' || filename === 'get-jquery.js' || filename === 'dom-plugins.js' || filename === 'swiper-proto.js') addIndent = ' ';
if (minusIndent) {
addIndent = addIndent.substring(4);
}
if (addIndent !== '') {
var fileLines = fs.readFileSync(file.path).toString().split('\n');
var newFileContents = '';
for (var i = 0; i < fileLines.length; i++) {
newFileContents += addIndent + fileLines[i] + (i === fileLines.length ? '' : '\n');
}
file.contents = new Buffer(newFileContents);
}
}
gulp.task('scripts', function (cb) {
gulp.src(swiper.jsFiles)
.pipe(tap(function (file, t){
addJSIndent (file, t);
}))
.pipe(concat(swiper.filename + '.js'))
.pipe(header(swiper.banner, { pkg : swiper.pkg, date: swiper.date } ))
.pipe(gulp.dest(paths.build.scripts))
.pipe(jshint())
.pipe(jshint.reporter(stylish));
gulp.src(swiper.jQueryFiles)
.pipe(tap(function (file, t){
addJSIndent (file, t);
}))
.pipe(concat(swiper.filename + '.jquery.js'))
.pipe(header(swiper.banner, { pkg : swiper.pkg, date: swiper.date } ))
.pipe(gulp.dest(paths.build.scripts));
gulp.src(swiper.jQueryUMDFiles)
.pipe(tap(function (file, t){
addJSIndent (file, t);
}))
.pipe(concat(swiper.filename + '.jquery.umd.js'))
.pipe(header(swiper.banner, { pkg : swiper.pkg, date: swiper.date } ))
.pipe(gulp.dest(paths.build.scripts));
gulp.src(swiper.Framework7Files)
.pipe(tap(function (file, t){
addJSIndent (file, t, true);
}))
.pipe(concat(swiper.filename + '.framework7.js'))
.pipe(header(swiper.banner, { pkg : swiper.pkg, date: swiper.date } ))
.pipe(gulp.dest(paths.build.scripts))
.pipe(connect.reload());
cb();
});
gulp.task('styles', function (cb) {
gulp.src(paths.source.styles + 'swiper.less')
.pipe(less({
paths: [ path.join(__dirname, 'less', 'includes') ]
}))
.pipe(header(swiper.banner, { pkg : swiper.pkg, date: swiper.date }))
.pipe(rename(function(path) {
path.basename = swiper.filename;
}))
.pipe(gulp.dest(paths.build.styles))
.pipe(connect.reload());
gulp.src([
paths.source.styles + 'core.less',
paths.source.styles + 'navigation-f7.less',
paths.source.styles + 'effects.less',
paths.source.styles + 'scrollbar.less',
paths.source.styles + 'preloader-f7.less',
])
.pipe(concat(swiper.filename + '.framework7.less'))
.pipe(header('/* === Swiper === */\n'))
.pipe(gulp.dest(paths.build.styles));
cb();
});
gulp.task('build', ['scripts', 'styles'], function (cb) {
cb();
});
gulp.task('dist', function () {
gulp.src([paths.build.scripts + swiper.filename + '.js'])
.pipe(gulp.dest(paths.dist.scripts))
.pipe(sourcemaps.init())
.pipe(uglify())
.pipe(header(swiper.banner, { pkg : swiper.pkg, date: swiper.date }))
.pipe(rename(function(path) {
path.basename = swiper.filename + '.min';
}))
.pipe(sourcemaps.write('./maps'))
.pipe(gulp.dest(paths.dist.scripts));
gulp.src([paths.build.scripts + swiper.filename + '.jquery.js'])
.pipe(gulp.dest(paths.dist.scripts))
.pipe(sourcemaps.init())
.pipe(uglify())
.pipe(header(swiper.banner, { pkg : swiper.pkg, date: swiper.date } ))
.pipe(rename(function(path) {
path.basename = swiper.filename + '.jquery.min';
}))
.pipe(sourcemaps.write('./maps'))
.pipe(gulp.dest(paths.dist.scripts));
gulp.src([paths.build.scripts + swiper.filename + '.jquery.umd.js'])
.pipe(gulp.dest(paths.dist.scripts))
.pipe(sourcemaps.init())
.pipe(uglify())
.pipe(header(swiper.banner, { pkg : swiper.pkg, date: swiper.date } ))
.pipe(rename(function(path) {
path.basename = swiper.filename + '.jquery.umd.min';
}))
.pipe(sourcemaps.write('./maps'))
.pipe(gulp.dest(paths.dist.scripts));
gulp.src(paths.build.styles + '*.css')
.pipe(gulp.dest(paths.dist.styles))
.pipe(minifyCSS({
advanced: false,
aggressiveMerging: false,
}))
.pipe(header(swiper.banner, { pkg : swiper.pkg, date: swiper.date }))
.pipe(rename(function(path) {
path.basename = swiper.filename + '.min';
}))
.pipe(gulp.dest(paths.dist.styles));
});
gulp.task('watch', function () {
gulp.watch(paths.source.scripts, [ 'scripts' ]);
gulp.watch(paths.source.styles + '*.less', [ 'styles' ]);
});
gulp.task('connect', function () {
return connect.server({
root: [ paths.root ],
livereload: true,
port:'3000'
});
});
gulp.task('open', function () {
return gulp.src(paths.playground.root + 'index.html').pipe(open({ uri: 'http://localhost:3000/' + paths.playground.root + 'index.html'}));
});
gulp.task('server', [ 'watch', 'connect', 'open' ]);
gulp.task('default', [ 'server' ]);
})();

View file

@ -0,0 +1,24 @@
var version = '3.3.0';
Package.describe({
name: 'nolimits4web:swiper',
summary: 'iDangero.us Swiper - mobile touch slider with hardware accelerated transitions and native behavior',
version: version,
git: 'https://github.com/nolimits4web/Swiper'
});
Package.onUse(function (api) {
api.versionsFrom('1.1.0.2');
api.addFiles([
'dist/css/swiper.min.css',
'dist/js/swiper.js'
], ['client']
);
// Since swiper is attached to window, we do not need to export Swiper
// api.export('Swiper');
});
Package.onTest(function (api) {
});

View file

@ -0,0 +1,90 @@
// Accessibility tools
s.a11y = {
makeFocusable: function ($el) {
$el.attr('tabIndex', '0');
return $el;
},
addRole: function ($el, role) {
$el.attr('role', role);
return $el;
},
addLabel: function ($el, label) {
$el.attr('aria-label', label);
return $el;
},
disable: function ($el) {
$el.attr('aria-disabled', true);
return $el;
},
enable: function ($el) {
$el.attr('aria-disabled', false);
return $el;
},
onEnterKey: function (event) {
if (event.keyCode !== 13) return;
if ($(event.target).is(s.params.nextButton)) {
s.onClickNext(event);
if (s.isEnd) {
s.a11y.notify(s.params.lastSlideMessage);
}
else {
s.a11y.notify(s.params.nextSlideMessage);
}
}
else if ($(event.target).is(s.params.prevButton)) {
s.onClickPrev(event);
if (s.isBeginning) {
s.a11y.notify(s.params.firstSlideMessage);
}
else {
s.a11y.notify(s.params.prevSlideMessage);
}
}
if ($(event.target).is('.' + s.params.bulletClass)) {
$(event.target)[0].click();
}
},
liveRegion: $('<span class="swiper-notification" aria-live="assertive" aria-atomic="true"></span>'),
notify: function (message) {
var notification = s.a11y.liveRegion;
if (notification.length === 0) return;
notification.html('');
notification.html(message);
},
init: function () {
// Setup accessibility
if (s.params.nextButton) {
var nextButton = $(s.params.nextButton);
s.a11y.makeFocusable(nextButton);
s.a11y.addRole(nextButton, 'button');
s.a11y.addLabel(nextButton, s.params.nextSlideMessage);
}
if (s.params.prevButton) {
var prevButton = $(s.params.prevButton);
s.a11y.makeFocusable(prevButton);
s.a11y.addRole(prevButton, 'button');
s.a11y.addLabel(prevButton, s.params.prevSlideMessage);
}
$(s.container).append(s.a11y.liveRegion);
},
initPagination: function () {
if (s.params.pagination && s.params.paginationClickable && s.bullets && s.bullets.length) {
s.bullets.each(function () {
var bullet = $(this);
s.a11y.makeFocusable(bullet);
s.a11y.addRole(bullet, 'button');
s.a11y.addLabel(bullet, s.params.paginationBulletMessage.replace(/{{index}}/, bullet.index() + 1));
});
}
},
destroy: function () {
if (s.a11y.liveRegion && s.a11y.liveRegion.length > 0) s.a11y.liveRegion.remove();
}
};

View file

@ -0,0 +1,13 @@
/*===========================
Swiper AMD Export
===========================*/
if (typeof(module) !== 'undefined')
{
module.exports = window.Swiper;
}
else if (typeof define === 'function' && define.amd) {
define([], function () {
'use strict';
return window.Swiper;
});
}

View file

@ -0,0 +1,116 @@
/*=========================
Controller
===========================*/
s.controller = {
LinearSpline: function (x, y) {
this.x = x;
this.y = y;
this.lastIndex = x.length - 1;
// Given an x value (x2), return the expected y2 value:
// (x1,y1) is the known point before given value,
// (x3,y3) is the known point after given value.
var i1, i3;
var l = this.x.length;
this.interpolate = function (x2) {
if (!x2) return 0;
// Get the indexes of x1 and x3 (the array indexes before and after given x2):
i3 = binarySearch(this.x, x2);
i1 = i3 - 1;
// We have our indexes i1 & i3, so we can calculate already:
// y2 := ((x2x1) × (y3y1)) ÷ (x3x1) + y1
return ((x2 - this.x[i1]) * (this.y[i3] - this.y[i1])) / (this.x[i3] - this.x[i1]) + this.y[i1];
};
var binarySearch = (function() {
var maxIndex, minIndex, guess;
return function(array, val) {
minIndex = -1;
maxIndex = array.length;
while (maxIndex - minIndex > 1)
if (array[guess = maxIndex + minIndex >> 1] <= val) {
minIndex = guess;
} else {
maxIndex = guess;
}
return maxIndex;
};
})();
},
//xxx: for now i will just save one spline function to to
getInterpolateFunction: function(c){
if(!s.controller.spline) s.controller.spline = s.params.loop ?
new s.controller.LinearSpline(s.slidesGrid, c.slidesGrid) :
new s.controller.LinearSpline(s.snapGrid, c.snapGrid);
},
setTranslate: function (translate, byController) {
var controlled = s.params.control;
var multiplier, controlledTranslate;
function setControlledTranslate(c) {
// this will create an Interpolate function based on the snapGrids
// x is the Grid of the scrolled scroller and y will be the controlled scroller
// it makes sense to create this only once and recall it for the interpolation
// the function does a lot of value caching for performance
translate = c.rtl && c.params.direction === 'horizontal' ? -s.translate : s.translate;
if (s.params.controlBy === 'slide') {
s.controller.getInterpolateFunction(c);
// i am not sure why the values have to be multiplicated this way, tried to invert the snapGrid
// but it did not work out
controlledTranslate = -s.controller.spline.interpolate(-translate);
}
if(!controlledTranslate || s.params.controlBy === 'container'){
multiplier = (c.maxTranslate() - c.minTranslate()) / (s.maxTranslate() - s.minTranslate());
controlledTranslate = (translate - s.minTranslate()) * multiplier + c.minTranslate();
}
if (s.params.controlInverse) {
controlledTranslate = c.maxTranslate() - controlledTranslate;
}
c.updateProgress(controlledTranslate);
c.setWrapperTranslate(controlledTranslate, false, s);
c.updateActiveIndex();
}
if (s.isArray(controlled)) {
for (var i = 0; i < controlled.length; i++) {
if (controlled[i] !== byController && controlled[i] instanceof Swiper) {
setControlledTranslate(controlled[i]);
}
}
}
else if (controlled instanceof Swiper && byController !== controlled) {
setControlledTranslate(controlled);
}
},
setTransition: function (duration, byController) {
var controlled = s.params.control;
var i;
function setControlledTransition(c) {
c.setWrapperTransition(duration, s);
if (duration !== 0) {
c.onTransitionStart();
c.wrapper.transitionEnd(function(){
if (!controlled) return;
if (c.params.loop && s.params.controlBy === 'slide') {
c.fixLoop();
}
c.onTransitionEnd();
});
}
}
if (s.isArray(controlled)) {
for (i = 0; i < controlled.length; i++) {
if (controlled[i] !== byController && controlled[i] instanceof Swiper) {
setControlledTransition(controlled[i]);
}
}
}
else if (controlled instanceof Swiper && byController !== controlled) {
setControlledTransition(controlled);
}
}
};

File diff suppressed because it is too large Load diff

View file

@ -0,0 +1,57 @@
/*===========================
Add .swiper plugin from Dom libraries
===========================*/
function addLibraryPlugin(lib) {
lib.fn.swiper = function (params) {
var firstInstance;
lib(this).each(function () {
var s = new Swiper(this, params);
if (!firstInstance) firstInstance = s;
});
return firstInstance;
};
}
if (domLib) {
if (!('transitionEnd' in domLib.fn)) {
domLib.fn.transitionEnd = function (callback) {
var events = ['webkitTransitionEnd', 'transitionend', 'oTransitionEnd', 'MSTransitionEnd', 'msTransitionEnd'],
i, j, dom = this;
function fireCallBack(e) {
/*jshint validthis:true */
if (e.target !== this) return;
callback.call(this, e);
for (i = 0; i < events.length; i++) {
dom.off(events[i], fireCallBack);
}
}
if (callback) {
for (i = 0; i < events.length; i++) {
dom.on(events[i], fireCallBack);
}
}
return this;
};
}
if (!('transform' in domLib.fn)) {
domLib.fn.transform = function (transform) {
for (var i = 0; i < this.length; i++) {
var elStyle = this[i].style;
elStyle.webkitTransform = elStyle.MsTransform = elStyle.msTransform = elStyle.MozTransform = elStyle.OTransform = elStyle.transform = transform;
}
return this;
};
}
if (!('transition' in domLib.fn)) {
domLib.fn.transition = function (duration) {
if (typeof duration !== 'string') {
duration = duration + 'ms';
}
for (var i = 0; i < this.length; i++) {
var elStyle = this[i].style;
elStyle.webkitTransitionDuration = elStyle.MsTransitionDuration = elStyle.msTransitionDuration = elStyle.MozTransitionDuration = elStyle.OTransitionDuration = elStyle.transitionDuration = duration;
}
return this;
};
}
}

View file

@ -0,0 +1,664 @@
/*===========================
Dom7 Library
===========================*/
var Dom7 = (function () {
var Dom7 = function (arr) {
var _this = this, i = 0;
// Create array-like object
for (i = 0; i < arr.length; i++) {
_this[i] = arr[i];
}
_this.length = arr.length;
// Return collection with methods
return this;
};
var $ = function (selector, context) {
var arr = [], i = 0;
if (selector && !context) {
if (selector instanceof Dom7) {
return selector;
}
}
if (selector) {
// String
if (typeof selector === 'string') {
var els, tempParent, html = selector.trim();
if (html.indexOf('<') >= 0 && html.indexOf('>') >= 0) {
var toCreate = 'div';
if (html.indexOf('<li') === 0) toCreate = 'ul';
if (html.indexOf('<tr') === 0) toCreate = 'tbody';
if (html.indexOf('<td') === 0 || html.indexOf('<th') === 0) toCreate = 'tr';
if (html.indexOf('<tbody') === 0) toCreate = 'table';
if (html.indexOf('<option') === 0) toCreate = 'select';
tempParent = document.createElement(toCreate);
tempParent.innerHTML = selector;
for (i = 0; i < tempParent.childNodes.length; i++) {
arr.push(tempParent.childNodes[i]);
}
}
else {
if (!context && selector[0] === '#' && !selector.match(/[ .<>:~]/)) {
// Pure ID selector
els = [document.getElementById(selector.split('#')[1])];
}
else {
// Other selectors
els = (context || document).querySelectorAll(selector);
}
for (i = 0; i < els.length; i++) {
if (els[i]) arr.push(els[i]);
}
}
}
// Node/element
else if (selector.nodeType || selector === window || selector === document) {
arr.push(selector);
}
//Array of elements or instance of Dom
else if (selector.length > 0 && selector[0].nodeType) {
for (i = 0; i < selector.length; i++) {
arr.push(selector[i]);
}
}
}
return new Dom7(arr);
};
Dom7.prototype = {
// Classes and attriutes
addClass: function (className) {
if (typeof className === 'undefined') {
return this;
}
var classes = className.split(' ');
for (var i = 0; i < classes.length; i++) {
for (var j = 0; j < this.length; j++) {
this[j].classList.add(classes[i]);
}
}
return this;
},
removeClass: function (className) {
var classes = className.split(' ');
for (var i = 0; i < classes.length; i++) {
for (var j = 0; j < this.length; j++) {
this[j].classList.remove(classes[i]);
}
}
return this;
},
hasClass: function (className) {
if (!this[0]) return false;
else return this[0].classList.contains(className);
},
toggleClass: function (className) {
var classes = className.split(' ');
for (var i = 0; i < classes.length; i++) {
for (var j = 0; j < this.length; j++) {
this[j].classList.toggle(classes[i]);
}
}
return this;
},
attr: function (attrs, value) {
if (arguments.length === 1 && typeof attrs === 'string') {
// Get attr
if (this[0]) return this[0].getAttribute(attrs);
else return undefined;
}
else {
// Set attrs
for (var i = 0; i < this.length; i++) {
if (arguments.length === 2) {
// String
this[i].setAttribute(attrs, value);
}
else {
// Object
for (var attrName in attrs) {
this[i][attrName] = attrs[attrName];
this[i].setAttribute(attrName, attrs[attrName]);
}
}
}
return this;
}
},
removeAttr: function (attr) {
for (var i = 0; i < this.length; i++) {
this[i].removeAttribute(attr);
}
return this;
},
data: function (key, value) {
if (typeof value === 'undefined') {
// Get value
if (this[0]) {
var dataKey = this[0].getAttribute('data-' + key);
if (dataKey) return dataKey;
else if (this[0].dom7ElementDataStorage && (key in this[0].dom7ElementDataStorage)) return this[0].dom7ElementDataStorage[key];
else return undefined;
}
else return undefined;
}
else {
// Set value
for (var i = 0; i < this.length; i++) {
var el = this[i];
if (!el.dom7ElementDataStorage) el.dom7ElementDataStorage = {};
el.dom7ElementDataStorage[key] = value;
}
return this;
}
},
// Transforms
transform : function (transform) {
for (var i = 0; i < this.length; i++) {
var elStyle = this[i].style;
elStyle.webkitTransform = elStyle.MsTransform = elStyle.msTransform = elStyle.MozTransform = elStyle.OTransform = elStyle.transform = transform;
}
return this;
},
transition: function (duration) {
if (typeof duration !== 'string') {
duration = duration + 'ms';
}
for (var i = 0; i < this.length; i++) {
var elStyle = this[i].style;
elStyle.webkitTransitionDuration = elStyle.MsTransitionDuration = elStyle.msTransitionDuration = elStyle.MozTransitionDuration = elStyle.OTransitionDuration = elStyle.transitionDuration = duration;
}
return this;
},
//Events
on: function (eventName, targetSelector, listener, capture) {
function handleLiveEvent(e) {
var target = e.target;
if ($(target).is(targetSelector)) listener.call(target, e);
else {
var parents = $(target).parents();
for (var k = 0; k < parents.length; k++) {
if ($(parents[k]).is(targetSelector)) listener.call(parents[k], e);
}
}
}
var events = eventName.split(' ');
var i, j;
for (i = 0; i < this.length; i++) {
if (typeof targetSelector === 'function' || targetSelector === false) {
// Usual events
if (typeof targetSelector === 'function') {
listener = arguments[1];
capture = arguments[2] || false;
}
for (j = 0; j < events.length; j++) {
this[i].addEventListener(events[j], listener, capture);
}
}
else {
//Live events
for (j = 0; j < events.length; j++) {
if (!this[i].dom7LiveListeners) this[i].dom7LiveListeners = [];
this[i].dom7LiveListeners.push({listener: listener, liveListener: handleLiveEvent});
this[i].addEventListener(events[j], handleLiveEvent, capture);
}
}
}
return this;
},
off: function (eventName, targetSelector, listener, capture) {
var events = eventName.split(' ');
for (var i = 0; i < events.length; i++) {
for (var j = 0; j < this.length; j++) {
if (typeof targetSelector === 'function' || targetSelector === false) {
// Usual events
if (typeof targetSelector === 'function') {
listener = arguments[1];
capture = arguments[2] || false;
}
this[j].removeEventListener(events[i], listener, capture);
}
else {
// Live event
if (this[j].dom7LiveListeners) {
for (var k = 0; k < this[j].dom7LiveListeners.length; k++) {
if (this[j].dom7LiveListeners[k].listener === listener) {
this[j].removeEventListener(events[i], this[j].dom7LiveListeners[k].liveListener, capture);
}
}
}
}
}
}
return this;
},
once: function (eventName, targetSelector, listener, capture) {
var dom = this;
if (typeof targetSelector === 'function') {
targetSelector = false;
listener = arguments[1];
capture = arguments[2];
}
function proxy(e) {
listener(e);
dom.off(eventName, targetSelector, proxy, capture);
}
dom.on(eventName, targetSelector, proxy, capture);
},
trigger: function (eventName, eventData) {
for (var i = 0; i < this.length; i++) {
var evt;
try {
evt = new window.CustomEvent(eventName, {detail: eventData, bubbles: true, cancelable: true});
}
catch (e) {
evt = document.createEvent('Event');
evt.initEvent(eventName, true, true);
evt.detail = eventData;
}
this[i].dispatchEvent(evt);
}
return this;
},
transitionEnd: function (callback) {
var events = ['webkitTransitionEnd', 'transitionend', 'oTransitionEnd', 'MSTransitionEnd', 'msTransitionEnd'],
i, j, dom = this;
function fireCallBack(e) {
/*jshint validthis:true */
if (e.target !== this) return;
callback.call(this, e);
for (i = 0; i < events.length; i++) {
dom.off(events[i], fireCallBack);
}
}
if (callback) {
for (i = 0; i < events.length; i++) {
dom.on(events[i], fireCallBack);
}
}
return this;
},
// Sizing/Styles
width: function () {
if (this[0] === window) {
return window.innerWidth;
}
else {
if (this.length > 0) {
return parseFloat(this.css('width'));
}
else {
return null;
}
}
},
outerWidth: function (includeMargins) {
if (this.length > 0) {
if (includeMargins)
return this[0].offsetWidth + parseFloat(this.css('margin-right')) + parseFloat(this.css('margin-left'));
else
return this[0].offsetWidth;
}
else return null;
},
height: function () {
if (this[0] === window) {
return window.innerHeight;
}
else {
if (this.length > 0) {
return parseFloat(this.css('height'));
}
else {
return null;
}
}
},
outerHeight: function (includeMargins) {
if (this.length > 0) {
if (includeMargins)
return this[0].offsetHeight + parseFloat(this.css('margin-top')) + parseFloat(this.css('margin-bottom'));
else
return this[0].offsetHeight;
}
else return null;
},
offset: function () {
if (this.length > 0) {
var el = this[0];
var box = el.getBoundingClientRect();
var body = document.body;
var clientTop = el.clientTop || body.clientTop || 0;
var clientLeft = el.clientLeft || body.clientLeft || 0;
var scrollTop = window.pageYOffset || el.scrollTop;
var scrollLeft = window.pageXOffset || el.scrollLeft;
return {
top: box.top + scrollTop - clientTop,
left: box.left + scrollLeft - clientLeft
};
}
else {
return null;
}
},
css: function (props, value) {
var i;
if (arguments.length === 1) {
if (typeof props === 'string') {
if (this[0]) return window.getComputedStyle(this[0], null).getPropertyValue(props);
}
else {
for (i = 0; i < this.length; i++) {
for (var prop in props) {
this[i].style[prop] = props[prop];
}
}
return this;
}
}
if (arguments.length === 2 && typeof props === 'string') {
for (i = 0; i < this.length; i++) {
this[i].style[props] = value;
}
return this;
}
return this;
},
//Dom manipulation
each: function (callback) {
for (var i = 0; i < this.length; i++) {
callback.call(this[i], i, this[i]);
}
return this;
},
html: function (html) {
if (typeof html === 'undefined') {
return this[0] ? this[0].innerHTML : undefined;
}
else {
for (var i = 0; i < this.length; i++) {
this[i].innerHTML = html;
}
return this;
}
},
text: function (text) {
if (typeof text === 'undefined') {
if (this[0]) {
return this[0].textContent.trim();
}
else return null;
}
else {
for (var i = 0; i < this.length; i++) {
this[i].textContent = text;
}
return this;
}
},
is: function (selector) {
if (!this[0]) return false;
var compareWith, i;
if (typeof selector === 'string') {
var el = this[0];
if (el === document) return selector === document;
if (el === window) return selector === window;
if (el.matches) return el.matches(selector);
else if (el.webkitMatchesSelector) return el.webkitMatchesSelector(selector);
else if (el.mozMatchesSelector) return el.mozMatchesSelector(selector);
else if (el.msMatchesSelector) return el.msMatchesSelector(selector);
else {
compareWith = $(selector);
for (i = 0; i < compareWith.length; i++) {
if (compareWith[i] === this[0]) return true;
}
return false;
}
}
else if (selector === document) return this[0] === document;
else if (selector === window) return this[0] === window;
else {
if (selector.nodeType || selector instanceof Dom7) {
compareWith = selector.nodeType ? [selector] : selector;
for (i = 0; i < compareWith.length; i++) {
if (compareWith[i] === this[0]) return true;
}
return false;
}
return false;
}
},
index: function () {
if (this[0]) {
var child = this[0];
var i = 0;
while ((child = child.previousSibling) !== null) {
if (child.nodeType === 1) i++;
}
return i;
}
else return undefined;
},
eq: function (index) {
if (typeof index === 'undefined') return this;
var length = this.length;
var returnIndex;
if (index > length - 1) {
return new Dom7([]);
}
if (index < 0) {
returnIndex = length + index;
if (returnIndex < 0) return new Dom7([]);
else return new Dom7([this[returnIndex]]);
}
return new Dom7([this[index]]);
},
append: function (newChild) {
var i, j;
for (i = 0; i < this.length; i++) {
if (typeof newChild === 'string') {
var tempDiv = document.createElement('div');
tempDiv.innerHTML = newChild;
while (tempDiv.firstChild) {
this[i].appendChild(tempDiv.firstChild);
}
}
else if (newChild instanceof Dom7) {
for (j = 0; j < newChild.length; j++) {
this[i].appendChild(newChild[j]);
}
}
else {
this[i].appendChild(newChild);
}
}
return this;
},
prepend: function (newChild) {
var i, j;
for (i = 0; i < this.length; i++) {
if (typeof newChild === 'string') {
var tempDiv = document.createElement('div');
tempDiv.innerHTML = newChild;
for (j = tempDiv.childNodes.length - 1; j >= 0; j--) {
this[i].insertBefore(tempDiv.childNodes[j], this[i].childNodes[0]);
}
// this[i].insertAdjacentHTML('afterbegin', newChild);
}
else if (newChild instanceof Dom7) {
for (j = 0; j < newChild.length; j++) {
this[i].insertBefore(newChild[j], this[i].childNodes[0]);
}
}
else {
this[i].insertBefore(newChild, this[i].childNodes[0]);
}
}
return this;
},
insertBefore: function (selector) {
var before = $(selector);
for (var i = 0; i < this.length; i++) {
if (before.length === 1) {
before[0].parentNode.insertBefore(this[i], before[0]);
}
else if (before.length > 1) {
for (var j = 0; j < before.length; j++) {
before[j].parentNode.insertBefore(this[i].cloneNode(true), before[j]);
}
}
}
},
insertAfter: function (selector) {
var after = $(selector);
for (var i = 0; i < this.length; i++) {
if (after.length === 1) {
after[0].parentNode.insertBefore(this[i], after[0].nextSibling);
}
else if (after.length > 1) {
for (var j = 0; j < after.length; j++) {
after[j].parentNode.insertBefore(this[i].cloneNode(true), after[j].nextSibling);
}
}
}
},
next: function (selector) {
if (this.length > 0) {
if (selector) {
if (this[0].nextElementSibling && $(this[0].nextElementSibling).is(selector)) return new Dom7([this[0].nextElementSibling]);
else return new Dom7([]);
}
else {
if (this[0].nextElementSibling) return new Dom7([this[0].nextElementSibling]);
else return new Dom7([]);
}
}
else return new Dom7([]);
},
nextAll: function (selector) {
var nextEls = [];
var el = this[0];
if (!el) return new Dom7([]);
while (el.nextElementSibling) {
var next = el.nextElementSibling;
if (selector) {
if($(next).is(selector)) nextEls.push(next);
}
else nextEls.push(next);
el = next;
}
return new Dom7(nextEls);
},
prev: function (selector) {
if (this.length > 0) {
if (selector) {
if (this[0].previousElementSibling && $(this[0].previousElementSibling).is(selector)) return new Dom7([this[0].previousElementSibling]);
else return new Dom7([]);
}
else {
if (this[0].previousElementSibling) return new Dom7([this[0].previousElementSibling]);
else return new Dom7([]);
}
}
else return new Dom7([]);
},
prevAll: function (selector) {
var prevEls = [];
var el = this[0];
if (!el) return new Dom7([]);
while (el.previousElementSibling) {
var prev = el.previousElementSibling;
if (selector) {
if($(prev).is(selector)) prevEls.push(prev);
}
else prevEls.push(prev);
el = prev;
}
return new Dom7(prevEls);
},
parent: function (selector) {
var parents = [];
for (var i = 0; i < this.length; i++) {
if (selector) {
if ($(this[i].parentNode).is(selector)) parents.push(this[i].parentNode);
}
else {
parents.push(this[i].parentNode);
}
}
return $($.unique(parents));
},
parents: function (selector) {
var parents = [];
for (var i = 0; i < this.length; i++) {
var parent = this[i].parentNode;
while (parent) {
if (selector) {
if ($(parent).is(selector)) parents.push(parent);
}
else {
parents.push(parent);
}
parent = parent.parentNode;
}
}
return $($.unique(parents));
},
find : function (selector) {
var foundElements = [];
for (var i = 0; i < this.length; i++) {
var found = this[i].querySelectorAll(selector);
for (var j = 0; j < found.length; j++) {
foundElements.push(found[j]);
}
}
return new Dom7(foundElements);
},
children: function (selector) {
var children = [];
for (var i = 0; i < this.length; i++) {
var childNodes = this[i].childNodes;
for (var j = 0; j < childNodes.length; j++) {
if (!selector) {
if (childNodes[j].nodeType === 1) children.push(childNodes[j]);
}
else {
if (childNodes[j].nodeType === 1 && $(childNodes[j]).is(selector)) children.push(childNodes[j]);
}
}
}
return new Dom7($.unique(children));
},
remove: function () {
for (var i = 0; i < this.length; i++) {
if (this[i].parentNode) this[i].parentNode.removeChild(this[i]);
}
return this;
},
add: function () {
var dom = this;
var i, j;
for (i = 0; i < arguments.length; i++) {
var toAdd = $(arguments[i]);
for (j = 0; j < toAdd.length; j++) {
dom[dom.length] = toAdd[j];
dom.length++;
}
}
return dom;
}
};
$.fn = Dom7.prototype;
$.unique = function (arr) {
var unique = [];
for (var i = 0; i < arr.length; i++) {
if (unique.indexOf(arr[i]) === -1) unique.push(arr[i]);
}
return unique;
};
return $;
})();

View file

@ -0,0 +1,276 @@
/*=========================
Effects
===========================*/
s.effects = {
fade: {
setTranslate: function () {
for (var i = 0; i < s.slides.length; i++) {
var slide = s.slides.eq(i);
var offset = slide[0].swiperSlideOffset;
var tx = -offset;
if (!s.params.virtualTranslate) tx = tx - s.translate;
var ty = 0;
if (!s.isHorizontal()) {
ty = tx;
tx = 0;
}
var slideOpacity = s.params.fade.crossFade ?
Math.max(1 - Math.abs(slide[0].progress), 0) :
1 + Math.min(Math.max(slide[0].progress, -1), 0);
slide
.css({
opacity: slideOpacity
})
.transform('translate3d(' + tx + 'px, ' + ty + 'px, 0px)');
}
},
setTransition: function (duration) {
s.slides.transition(duration);
if (s.params.virtualTranslate && duration !== 0) {
var eventTriggered = false;
s.slides.transitionEnd(function () {
if (eventTriggered) return;
if (!s) return;
eventTriggered = true;
s.animating = false;
var triggerEvents = ['webkitTransitionEnd', 'transitionend', 'oTransitionEnd', 'MSTransitionEnd', 'msTransitionEnd'];
for (var i = 0; i < triggerEvents.length; i++) {
s.wrapper.trigger(triggerEvents[i]);
}
});
}
}
},
flip: {
setTranslate: function () {
for (var i = 0; i < s.slides.length; i++) {
var slide = s.slides.eq(i);
var progress = slide[0].progress;
if (s.params.flip.limitRotation) {
progress = Math.max(Math.min(slide[0].progress, 1), -1);
}
var offset = slide[0].swiperSlideOffset;
var rotate = -180 * progress,
rotateY = rotate,
rotateX = 0,
tx = -offset,
ty = 0;
if (!s.isHorizontal()) {
ty = tx;
tx = 0;
rotateX = -rotateY;
rotateY = 0;
}
else if (s.rtl) {
rotateY = -rotateY;
}
slide[0].style.zIndex = -Math.abs(Math.round(progress)) + s.slides.length;
if (s.params.flip.slideShadows) {
//Set shadows
var shadowBefore = s.isHorizontal() ? slide.find('.swiper-slide-shadow-left') : slide.find('.swiper-slide-shadow-top');
var shadowAfter = s.isHorizontal() ? slide.find('.swiper-slide-shadow-right') : slide.find('.swiper-slide-shadow-bottom');
if (shadowBefore.length === 0) {
shadowBefore = $('<div class="swiper-slide-shadow-' + (s.isHorizontal() ? 'left' : 'top') + '"></div>');
slide.append(shadowBefore);
}
if (shadowAfter.length === 0) {
shadowAfter = $('<div class="swiper-slide-shadow-' + (s.isHorizontal() ? 'right' : 'bottom') + '"></div>');
slide.append(shadowAfter);
}
if (shadowBefore.length) shadowBefore[0].style.opacity = Math.max(-progress, 0);
if (shadowAfter.length) shadowAfter[0].style.opacity = Math.max(progress, 0);
}
slide
.transform('translate3d(' + tx + 'px, ' + ty + 'px, 0px) rotateX(' + rotateX + 'deg) rotateY(' + rotateY + 'deg)');
}
},
setTransition: function (duration) {
s.slides.transition(duration).find('.swiper-slide-shadow-top, .swiper-slide-shadow-right, .swiper-slide-shadow-bottom, .swiper-slide-shadow-left').transition(duration);
if (s.params.virtualTranslate && duration !== 0) {
var eventTriggered = false;
s.slides.eq(s.activeIndex).transitionEnd(function () {
if (eventTriggered) return;
if (!s) return;
if (!$(this).hasClass(s.params.slideActiveClass)) return;
eventTriggered = true;
s.animating = false;
var triggerEvents = ['webkitTransitionEnd', 'transitionend', 'oTransitionEnd', 'MSTransitionEnd', 'msTransitionEnd'];
for (var i = 0; i < triggerEvents.length; i++) {
s.wrapper.trigger(triggerEvents[i]);
}
});
}
}
},
cube: {
setTranslate: function () {
var wrapperRotate = 0, cubeShadow;
if (s.params.cube.shadow) {
if (s.isHorizontal()) {
cubeShadow = s.wrapper.find('.swiper-cube-shadow');
if (cubeShadow.length === 0) {
cubeShadow = $('<div class="swiper-cube-shadow"></div>');
s.wrapper.append(cubeShadow);
}
cubeShadow.css({height: s.width + 'px'});
}
else {
cubeShadow = s.container.find('.swiper-cube-shadow');
if (cubeShadow.length === 0) {
cubeShadow = $('<div class="swiper-cube-shadow"></div>');
s.container.append(cubeShadow);
}
}
}
for (var i = 0; i < s.slides.length; i++) {
var slide = s.slides.eq(i);
var slideAngle = i * 90;
var round = Math.floor(slideAngle / 360);
if (s.rtl) {
slideAngle = -slideAngle;
round = Math.floor(-slideAngle / 360);
}
var progress = Math.max(Math.min(slide[0].progress, 1), -1);
var tx = 0, ty = 0, tz = 0;
if (i % 4 === 0) {
tx = - round * 4 * s.size;
tz = 0;
}
else if ((i - 1) % 4 === 0) {
tx = 0;
tz = - round * 4 * s.size;
}
else if ((i - 2) % 4 === 0) {
tx = s.size + round * 4 * s.size;
tz = s.size;
}
else if ((i - 3) % 4 === 0) {
tx = - s.size;
tz = 3 * s.size + s.size * 4 * round;
}
if (s.rtl) {
tx = -tx;
}
if (!s.isHorizontal()) {
ty = tx;
tx = 0;
}
var transform = 'rotateX(' + (s.isHorizontal() ? 0 : -slideAngle) + 'deg) rotateY(' + (s.isHorizontal() ? slideAngle : 0) + 'deg) translate3d(' + tx + 'px, ' + ty + 'px, ' + tz + 'px)';
if (progress <= 1 && progress > -1) {
wrapperRotate = i * 90 + progress * 90;
if (s.rtl) wrapperRotate = -i * 90 - progress * 90;
}
slide.transform(transform);
if (s.params.cube.slideShadows) {
//Set shadows
var shadowBefore = s.isHorizontal() ? slide.find('.swiper-slide-shadow-left') : slide.find('.swiper-slide-shadow-top');
var shadowAfter = s.isHorizontal() ? slide.find('.swiper-slide-shadow-right') : slide.find('.swiper-slide-shadow-bottom');
if (shadowBefore.length === 0) {
shadowBefore = $('<div class="swiper-slide-shadow-' + (s.isHorizontal() ? 'left' : 'top') + '"></div>');
slide.append(shadowBefore);
}
if (shadowAfter.length === 0) {
shadowAfter = $('<div class="swiper-slide-shadow-' + (s.isHorizontal() ? 'right' : 'bottom') + '"></div>');
slide.append(shadowAfter);
}
if (shadowBefore.length) shadowBefore[0].style.opacity = Math.max(-progress, 0);
if (shadowAfter.length) shadowAfter[0].style.opacity = Math.max(progress, 0);
}
}
s.wrapper.css({
'-webkit-transform-origin': '50% 50% -' + (s.size / 2) + 'px',
'-moz-transform-origin': '50% 50% -' + (s.size / 2) + 'px',
'-ms-transform-origin': '50% 50% -' + (s.size / 2) + 'px',
'transform-origin': '50% 50% -' + (s.size / 2) + 'px'
});
if (s.params.cube.shadow) {
if (s.isHorizontal()) {
cubeShadow.transform('translate3d(0px, ' + (s.width / 2 + s.params.cube.shadowOffset) + 'px, ' + (-s.width / 2) + 'px) rotateX(90deg) rotateZ(0deg) scale(' + (s.params.cube.shadowScale) + ')');
}
else {
var shadowAngle = Math.abs(wrapperRotate) - Math.floor(Math.abs(wrapperRotate) / 90) * 90;
var multiplier = 1.5 - (Math.sin(shadowAngle * 2 * Math.PI / 360) / 2 + Math.cos(shadowAngle * 2 * Math.PI / 360) / 2);
var scale1 = s.params.cube.shadowScale,
scale2 = s.params.cube.shadowScale / multiplier,
offset = s.params.cube.shadowOffset;
cubeShadow.transform('scale3d(' + scale1 + ', 1, ' + scale2 + ') translate3d(0px, ' + (s.height / 2 + offset) + 'px, ' + (-s.height / 2 / scale2) + 'px) rotateX(-90deg)');
}
}
var zFactor = (s.isSafari || s.isUiWebView) ? (-s.size / 2) : 0;
s.wrapper.transform('translate3d(0px,0,' + zFactor + 'px) rotateX(' + (s.isHorizontal() ? 0 : wrapperRotate) + 'deg) rotateY(' + (s.isHorizontal() ? -wrapperRotate : 0) + 'deg)');
},
setTransition: function (duration) {
s.slides.transition(duration).find('.swiper-slide-shadow-top, .swiper-slide-shadow-right, .swiper-slide-shadow-bottom, .swiper-slide-shadow-left').transition(duration);
if (s.params.cube.shadow && !s.isHorizontal()) {
s.container.find('.swiper-cube-shadow').transition(duration);
}
}
},
coverflow: {
setTranslate: function () {
var transform = s.translate;
var center = s.isHorizontal() ? -transform + s.width / 2 : -transform + s.height / 2;
var rotate = s.isHorizontal() ? s.params.coverflow.rotate: -s.params.coverflow.rotate;
var translate = s.params.coverflow.depth;
//Each slide offset from center
for (var i = 0, length = s.slides.length; i < length; i++) {
var slide = s.slides.eq(i);
var slideSize = s.slidesSizesGrid[i];
var slideOffset = slide[0].swiperSlideOffset;
var offsetMultiplier = (center - slideOffset - slideSize / 2) / slideSize * s.params.coverflow.modifier;
var rotateY = s.isHorizontal() ? rotate * offsetMultiplier : 0;
var rotateX = s.isHorizontal() ? 0 : rotate * offsetMultiplier;
// var rotateZ = 0
var translateZ = -translate * Math.abs(offsetMultiplier);
var translateY = s.isHorizontal() ? 0 : s.params.coverflow.stretch * (offsetMultiplier);
var translateX = s.isHorizontal() ? s.params.coverflow.stretch * (offsetMultiplier) : 0;
//Fix for ultra small values
if (Math.abs(translateX) < 0.001) translateX = 0;
if (Math.abs(translateY) < 0.001) translateY = 0;
if (Math.abs(translateZ) < 0.001) translateZ = 0;
if (Math.abs(rotateY) < 0.001) rotateY = 0;
if (Math.abs(rotateX) < 0.001) rotateX = 0;
var slideTransform = 'translate3d(' + translateX + 'px,' + translateY + 'px,' + translateZ + 'px) rotateX(' + rotateX + 'deg) rotateY(' + rotateY + 'deg)';
slide.transform(slideTransform);
slide[0].style.zIndex = -Math.abs(Math.round(offsetMultiplier)) + 1;
if (s.params.coverflow.slideShadows) {
//Set shadows
var shadowBefore = s.isHorizontal() ? slide.find('.swiper-slide-shadow-left') : slide.find('.swiper-slide-shadow-top');
var shadowAfter = s.isHorizontal() ? slide.find('.swiper-slide-shadow-right') : slide.find('.swiper-slide-shadow-bottom');
if (shadowBefore.length === 0) {
shadowBefore = $('<div class="swiper-slide-shadow-' + (s.isHorizontal() ? 'left' : 'top') + '"></div>');
slide.append(shadowBefore);
}
if (shadowAfter.length === 0) {
shadowAfter = $('<div class="swiper-slide-shadow-' + (s.isHorizontal() ? 'right' : 'bottom') + '"></div>');
slide.append(shadowAfter);
}
if (shadowBefore.length) shadowBefore[0].style.opacity = offsetMultiplier > 0 ? offsetMultiplier : 0;
if (shadowAfter.length) shadowAfter[0].style.opacity = (-offsetMultiplier) > 0 ? -offsetMultiplier : 0;
}
}
//Set correct perspective for IE10
if (s.browser.ie) {
var ws = s.wrapper[0].style;
ws.perspectiveOrigin = center + 'px 50%';
}
},
setTransition: function (duration) {
s.slides.transition(duration).find('.swiper-slide-shadow-top, .swiper-slide-shadow-right, .swiper-slide-shadow-bottom, .swiper-slide-shadow-left').transition(duration);
}
}
};

View file

@ -0,0 +1,61 @@
/*=========================
Events/Callbacks/Plugins Emitter
===========================*/
function normalizeEventName (eventName) {
if (eventName.indexOf('on') !== 0) {
if (eventName[0] !== eventName[0].toUpperCase()) {
eventName = 'on' + eventName[0].toUpperCase() + eventName.substring(1);
}
else {
eventName = 'on' + eventName;
}
}
return eventName;
}
s.emitterEventListeners = {
};
s.emit = function (eventName) {
// Trigger callbacks
if (s.params[eventName]) {
s.params[eventName](arguments[1], arguments[2], arguments[3], arguments[4], arguments[5]);
}
var i;
// Trigger events
if (s.emitterEventListeners[eventName]) {
for (i = 0; i < s.emitterEventListeners[eventName].length; i++) {
s.emitterEventListeners[eventName][i](arguments[1], arguments[2], arguments[3], arguments[4], arguments[5]);
}
}
// Trigger plugins
if (s.callPlugins) s.callPlugins(eventName, arguments[1], arguments[2], arguments[3], arguments[4], arguments[5]);
};
s.on = function (eventName, handler) {
eventName = normalizeEventName(eventName);
if (!s.emitterEventListeners[eventName]) s.emitterEventListeners[eventName] = [];
s.emitterEventListeners[eventName].push(handler);
return s;
};
s.off = function (eventName, handler) {
var i;
eventName = normalizeEventName(eventName);
if (typeof handler === 'undefined') {
// Remove all handlers for such event
s.emitterEventListeners[eventName] = [];
return s;
}
if (!s.emitterEventListeners[eventName] || s.emitterEventListeners[eventName].length === 0) return;
for (i = 0; i < s.emitterEventListeners[eventName].length; i++) {
if(s.emitterEventListeners[eventName][i] === handler) s.emitterEventListeners[eventName].splice(i, 1);
}
return s;
};
s.once = function (eventName, handler) {
eventName = normalizeEventName(eventName);
var _handler = function () {
handler(arguments[0], arguments[1], arguments[2], arguments[3], arguments[4]);
s.off(eventName, _handler);
};
s.on(eventName, _handler);
return s;
};

View file

@ -0,0 +1,17 @@
/*===========================
Get Dom libraries
===========================*/
var swiperDomPlugins = ['jQuery', 'Zepto', 'Dom7'];
for (var i = 0; i < swiperDomPlugins.length; i++) {
if (window[swiperDomPlugins[i]]) {
addLibraryPlugin(window[swiperDomPlugins[i]]);
}
}
// Required DOM Plugins
var domLib;
if (typeof Dom7 === 'undefined') {
domLib = window.Dom7 || window.Zepto || window.jQuery;
}
else {
domLib = Dom7;
}

View file

@ -0,0 +1,7 @@
/*===========================
Get jQuery
===========================*/
addLibraryPlugin($);
var domLib = $;

View file

@ -0,0 +1,24 @@
/*=========================
Hash Navigation
===========================*/
s.hashnav = {
init: function () {
if (!s.params.hashnav) return;
s.hashnav.initialized = true;
var hash = document.location.hash.replace('#', '');
if (!hash) return;
var speed = 0;
for (var i = 0, length = s.slides.length; i < length; i++) {
var slide = s.slides.eq(i);
var slideHash = slide.attr('data-hash');
if (slideHash === hash && !slide.hasClass(s.params.slideDuplicateClass)) {
var index = slide.index();
s.slideTo(index, speed, s.params.runCallbacksOnInit, true);
}
}
},
setHash: function () {
if (!s.hashnav.initialized || !s.params.hashnav) return;
document.location.hash = s.slides.eq(s.activeIndex).attr('data-hash') || '';
}
};

View file

@ -0,0 +1,133 @@
/*=========================
Init/Destroy
===========================*/
s.init = function () {
if (s.params.loop) s.createLoop();
s.updateContainerSize();
s.updateSlidesSize();
s.updatePagination();
if (s.params.scrollbar && s.scrollbar) {
s.scrollbar.set();
if (s.params.scrollbarDraggable) {
s.scrollbar.enableDraggable();
}
}
if (s.params.effect !== 'slide' && s.effects[s.params.effect]) {
if (!s.params.loop) s.updateProgress();
s.effects[s.params.effect].setTranslate();
}
if (s.params.loop) {
s.slideTo(s.params.initialSlide + s.loopedSlides, 0, s.params.runCallbacksOnInit);
}
else {
s.slideTo(s.params.initialSlide, 0, s.params.runCallbacksOnInit);
if (s.params.initialSlide === 0) {
if (s.parallax && s.params.parallax) s.parallax.setTranslate();
if (s.lazy && s.params.lazyLoading) {
s.lazy.load();
s.lazy.initialImageLoaded = true;
}
}
}
s.attachEvents();
if (s.params.observer && s.support.observer) {
s.initObservers();
}
if (s.params.preloadImages && !s.params.lazyLoading) {
s.preloadImages();
}
if (s.params.autoplay) {
s.startAutoplay();
}
if (s.params.keyboardControl) {
if (s.enableKeyboardControl) s.enableKeyboardControl();
}
if (s.params.mousewheelControl) {
if (s.enableMousewheelControl) s.enableMousewheelControl();
}
if (s.params.hashnav) {
if (s.hashnav) s.hashnav.init();
}
if (s.params.a11y && s.a11y) s.a11y.init();
s.emit('onInit', s);
};
// Cleanup dynamic styles
s.cleanupStyles = function () {
// Container
s.container.removeClass(s.classNames.join(' ')).removeAttr('style');
// Wrapper
s.wrapper.removeAttr('style');
// Slides
if (s.slides && s.slides.length) {
s.slides
.removeClass([
s.params.slideVisibleClass,
s.params.slideActiveClass,
s.params.slideNextClass,
s.params.slidePrevClass
].join(' '))
.removeAttr('style')
.removeAttr('data-swiper-column')
.removeAttr('data-swiper-row');
}
// Pagination/Bullets
if (s.paginationContainer && s.paginationContainer.length) {
s.paginationContainer.removeClass(s.params.paginationHiddenClass);
}
if (s.bullets && s.bullets.length) {
s.bullets.removeClass(s.params.bulletActiveClass);
}
// Buttons
if (s.params.prevButton) $(s.params.prevButton).removeClass(s.params.buttonDisabledClass);
if (s.params.nextButton) $(s.params.nextButton).removeClass(s.params.buttonDisabledClass);
// Scrollbar
if (s.params.scrollbar && s.scrollbar) {
if (s.scrollbar.track && s.scrollbar.track.length) s.scrollbar.track.removeAttr('style');
if (s.scrollbar.drag && s.scrollbar.drag.length) s.scrollbar.drag.removeAttr('style');
}
};
// Destroy
s.destroy = function (deleteInstance, cleanupStyles) {
// Detach evebts
s.detachEvents();
// Stop autoplay
s.stopAutoplay();
// Disable draggable
if (s.params.scrollbar && s.scrollbar) {
if (s.params.scrollbarDraggable) {
s.scrollbar.disableDraggable();
}
}
// Destroy loop
if (s.params.loop) {
s.destroyLoop();
}
// Cleanup styles
if (cleanupStyles) {
s.cleanupStyles();
}
// Disconnect observer
s.disconnectObservers();
// Disable keyboard/mousewheel
if (s.params.keyboardControl) {
if (s.disableKeyboardControl) s.disableKeyboardControl();
}
if (s.params.mousewheelControl) {
if (s.disableMousewheelControl) s.disableMousewheelControl();
}
// Disable a11y
if (s.params.a11y && s.a11y) s.a11y.destroy();
// Destroy callback
s.emit('onDestroy');
// Delete instance
if (deleteInstance !== false) s = null;
};
s.init();

View file

@ -0,0 +1,76 @@
/*=========================
Keyboard Control
===========================*/
function handleKeyboard(e) {
if (e.originalEvent) e = e.originalEvent; //jquery fix
var kc = e.keyCode || e.charCode;
// Directions locks
if (!s.params.allowSwipeToNext && (s.isHorizontal() && kc === 39 || !s.isHorizontal() && kc === 40)) {
return false;
}
if (!s.params.allowSwipeToPrev && (s.isHorizontal() && kc === 37 || !s.isHorizontal() && kc === 38)) {
return false;
}
if (e.shiftKey || e.altKey || e.ctrlKey || e.metaKey) {
return;
}
if (document.activeElement && document.activeElement.nodeName && (document.activeElement.nodeName.toLowerCase() === 'input' || document.activeElement.nodeName.toLowerCase() === 'textarea')) {
return;
}
if (kc === 37 || kc === 39 || kc === 38 || kc === 40) {
var inView = false;
//Check that swiper should be inside of visible area of window
if (s.container.parents('.swiper-slide').length > 0 && s.container.parents('.swiper-slide-active').length === 0) {
return;
}
var windowScroll = {
left: window.pageXOffset,
top: window.pageYOffset
};
var windowWidth = window.innerWidth;
var windowHeight = window.innerHeight;
var swiperOffset = s.container.offset();
if (s.rtl) swiperOffset.left = swiperOffset.left - s.container[0].scrollLeft;
var swiperCoord = [
[swiperOffset.left, swiperOffset.top],
[swiperOffset.left + s.width, swiperOffset.top],
[swiperOffset.left, swiperOffset.top + s.height],
[swiperOffset.left + s.width, swiperOffset.top + s.height]
];
for (var i = 0; i < swiperCoord.length; i++) {
var point = swiperCoord[i];
if (
point[0] >= windowScroll.left && point[0] <= windowScroll.left + windowWidth &&
point[1] >= windowScroll.top && point[1] <= windowScroll.top + windowHeight
) {
inView = true;
}
}
if (!inView) return;
}
if (s.isHorizontal()) {
if (kc === 37 || kc === 39) {
if (e.preventDefault) e.preventDefault();
else e.returnValue = false;
}
if ((kc === 39 && !s.rtl) || (kc === 37 && s.rtl)) s.slideNext();
if ((kc === 37 && !s.rtl) || (kc === 39 && s.rtl)) s.slidePrev();
}
else {
if (kc === 38 || kc === 40) {
if (e.preventDefault) e.preventDefault();
else e.returnValue = false;
}
if (kc === 40) s.slideNext();
if (kc === 38) s.slidePrev();
}
}
s.disableKeyboardControl = function () {
s.params.keyboardControl = false;
$(document).off('keydown', handleKeyboard);
};
s.enableKeyboardControl = function () {
s.params.keyboardControl = true;
$(document).on('keydown', handleKeyboard);
};

View file

@ -0,0 +1,114 @@
/*=========================
Images Lazy Loading
===========================*/
s.lazy = {
initialImageLoaded: false,
loadImageInSlide: function (index, loadInDuplicate) {
if (typeof index === 'undefined') return;
if (typeof loadInDuplicate === 'undefined') loadInDuplicate = true;
if (s.slides.length === 0) return;
var slide = s.slides.eq(index);
var img = slide.find('.swiper-lazy:not(.swiper-lazy-loaded):not(.swiper-lazy-loading)');
if (slide.hasClass('swiper-lazy') && !slide.hasClass('swiper-lazy-loaded') && !slide.hasClass('swiper-lazy-loading')) {
img = img.add(slide[0]);
}
if (img.length === 0) return;
img.each(function () {
var _img = $(this);
_img.addClass('swiper-lazy-loading');
var background = _img.attr('data-background');
var src = _img.attr('data-src'),
srcset = _img.attr('data-srcset');
s.loadImage(_img[0], (src || background), srcset, false, function () {
if (background) {
_img.css('background-image', 'url(' + background + ')');
_img.removeAttr('data-background');
}
else {
if (srcset) {
_img.attr('srcset', srcset);
_img.removeAttr('data-srcset');
}
if (src) {
_img.attr('src', src);
_img.removeAttr('data-src');
}
}
_img.addClass('swiper-lazy-loaded').removeClass('swiper-lazy-loading');
slide.find('.swiper-lazy-preloader, .preloader').remove();
if (s.params.loop && loadInDuplicate) {
var slideOriginalIndex = slide.attr('data-swiper-slide-index');
if (slide.hasClass(s.params.slideDuplicateClass)) {
var originalSlide = s.wrapper.children('[data-swiper-slide-index="' + slideOriginalIndex + '"]:not(.' + s.params.slideDuplicateClass + ')');
s.lazy.loadImageInSlide(originalSlide.index(), false);
}
else {
var duplicatedSlide = s.wrapper.children('.' + s.params.slideDuplicateClass + '[data-swiper-slide-index="' + slideOriginalIndex + '"]');
s.lazy.loadImageInSlide(duplicatedSlide.index(), false);
}
}
s.emit('onLazyImageReady', s, slide[0], _img[0]);
});
s.emit('onLazyImageLoad', s, slide[0], _img[0]);
});
},
load: function () {
var i;
if (s.params.watchSlidesVisibility) {
s.wrapper.children('.' + s.params.slideVisibleClass).each(function () {
s.lazy.loadImageInSlide($(this).index());
});
}
else {
if (s.params.slidesPerView > 1) {
for (i = s.activeIndex; i < s.activeIndex + s.params.slidesPerView ; i++) {
if (s.slides[i]) s.lazy.loadImageInSlide(i);
}
}
else {
s.lazy.loadImageInSlide(s.activeIndex);
}
}
if (s.params.lazyLoadingInPrevNext) {
if (s.params.slidesPerView > 1 || (s.params.lazyLoadingInPrevNextAmount && s.params.lazyLoadingInPrevNextAmount > 1)) {
var amount = s.params.lazyLoadingInPrevNextAmount;
var spv = s.params.slidesPerView;
var maxIndex = Math.min(s.activeIndex + spv + Math.max(amount, spv), s.slides.length);
var minIndex = Math.max(s.activeIndex - Math.max(spv, amount), 0);
// Next Slides
for (i = s.activeIndex + s.params.slidesPerView; i < maxIndex; i++) {
if (s.slides[i]) s.lazy.loadImageInSlide(i);
}
// Prev Slides
for (i = minIndex; i < s.activeIndex ; i++) {
if (s.slides[i]) s.lazy.loadImageInSlide(i);
}
}
else {
var nextSlide = s.wrapper.children('.' + s.params.slideNextClass);
if (nextSlide.length > 0) s.lazy.loadImageInSlide(nextSlide.index());
var prevSlide = s.wrapper.children('.' + s.params.slidePrevClass);
if (prevSlide.length > 0) s.lazy.loadImageInSlide(prevSlide.index());
}
}
},
onTransitionStart: function () {
if (s.params.lazyLoading) {
if (s.params.lazyLoadingOnTransitionStart || (!s.params.lazyLoadingOnTransitionStart && !s.lazy.initialImageLoaded)) {
s.lazy.load();
}
}
},
onTransitionEnd: function () {
if (s.params.lazyLoading && !s.params.lazyLoadingOnTransitionStart) {
s.lazy.load();
}
}
};

View file

@ -0,0 +1,129 @@
/*=========================
Mousewheel Control
===========================*/
s.mousewheel = {
event: false,
lastScrollTime: (new window.Date()).getTime()
};
if (s.params.mousewheelControl) {
try {
new window.WheelEvent('wheel');
s.mousewheel.event = 'wheel';
} catch (e) {}
if (!s.mousewheel.event && document.onmousewheel !== undefined) {
s.mousewheel.event = 'mousewheel';
}
if (!s.mousewheel.event) {
s.mousewheel.event = 'DOMMouseScroll';
}
}
function handleMousewheel(e) {
if (e.originalEvent) e = e.originalEvent; //jquery fix
var we = s.mousewheel.event;
var delta = 0;
var rtlFactor = s.rtl ? -1 : 1;
//Opera & IE
if (e.detail) delta = -e.detail;
//WebKits
else if (we === 'mousewheel') {
if (s.params.mousewheelForceToAxis) {
if (s.isHorizontal()) {
if (Math.abs(e.wheelDeltaX) > Math.abs(e.wheelDeltaY)) delta = e.wheelDeltaX * rtlFactor;
else return;
}
else {
if (Math.abs(e.wheelDeltaY) > Math.abs(e.wheelDeltaX)) delta = e.wheelDeltaY;
else return;
}
}
else {
delta = Math.abs(e.wheelDeltaX) > Math.abs(e.wheelDeltaY) ? - e.wheelDeltaX * rtlFactor : - e.wheelDeltaY;
}
}
//Old FireFox
else if (we === 'DOMMouseScroll') delta = -e.detail;
//New FireFox
else if (we === 'wheel') {
if (s.params.mousewheelForceToAxis) {
if (s.isHorizontal()) {
if (Math.abs(e.deltaX) > Math.abs(e.deltaY)) delta = -e.deltaX * rtlFactor;
else return;
}
else {
if (Math.abs(e.deltaY) > Math.abs(e.deltaX)) delta = -e.deltaY;
else return;
}
}
else {
delta = Math.abs(e.deltaX) > Math.abs(e.deltaY) ? - e.deltaX * rtlFactor : - e.deltaY;
}
}
if (delta === 0) return;
if (s.params.mousewheelInvert) delta = -delta;
if (!s.params.freeMode) {
if ((new window.Date()).getTime() - s.mousewheel.lastScrollTime > 60) {
if (delta < 0) {
if ((!s.isEnd || s.params.loop) && !s.animating) s.slideNext();
else if (s.params.mousewheelReleaseOnEdges) return true;
}
else {
if ((!s.isBeginning || s.params.loop) && !s.animating) s.slidePrev();
else if (s.params.mousewheelReleaseOnEdges) return true;
}
}
s.mousewheel.lastScrollTime = (new window.Date()).getTime();
}
else {
//Freemode or scrollContainer:
var position = s.getWrapperTranslate() + delta * s.params.mousewheelSensitivity;
var wasBeginning = s.isBeginning,
wasEnd = s.isEnd;
if (position >= s.minTranslate()) position = s.minTranslate();
if (position <= s.maxTranslate()) position = s.maxTranslate();
s.setWrapperTransition(0);
s.setWrapperTranslate(position);
s.updateProgress();
s.updateActiveIndex();
if (!wasBeginning && s.isBeginning || !wasEnd && s.isEnd) {
s.updateClasses();
}
if (s.params.freeModeSticky) {
clearTimeout(s.mousewheel.timeout);
s.mousewheel.timeout = setTimeout(function () {
s.slideReset();
}, 300);
}
else {
if (s.params.lazyLoading && s.lazy) {
s.lazy.load();
}
}
// Return page scroll on edge positions
if (position === 0 || position === s.maxTranslate()) return;
}
if (s.params.autoplay) s.stopAutoplay();
if (e.preventDefault) e.preventDefault();
else e.returnValue = false;
return false;
}
s.disableMousewheelControl = function () {
if (!s.mousewheel.event) return false;
s.container.off(s.mousewheel.event, handleMousewheel);
return true;
};
s.enableMousewheelControl = function () {
if (!s.mousewheel.event) return false;
s.container.on(s.mousewheel.event, handleMousewheel);
return true;
};

View file

@ -0,0 +1,65 @@
/*=========================
Parallax
===========================*/
function setParallaxTransform(el, progress) {
el = $(el);
var p, pX, pY;
var rtlFactor = s.rtl ? -1 : 1;
p = el.attr('data-swiper-parallax') || '0';
pX = el.attr('data-swiper-parallax-x');
pY = el.attr('data-swiper-parallax-y');
if (pX || pY) {
pX = pX || '0';
pY = pY || '0';
}
else {
if (s.isHorizontal()) {
pX = p;
pY = '0';
}
else {
pY = p;
pX = '0';
}
}
if ((pX).indexOf('%') >= 0) {
pX = parseInt(pX, 10) * progress * rtlFactor + '%';
}
else {
pX = pX * progress * rtlFactor + 'px' ;
}
if ((pY).indexOf('%') >= 0) {
pY = parseInt(pY, 10) * progress + '%';
}
else {
pY = pY * progress + 'px' ;
}
el.transform('translate3d(' + pX + ', ' + pY + ',0px)');
}
s.parallax = {
setTranslate: function () {
s.container.children('[data-swiper-parallax], [data-swiper-parallax-x], [data-swiper-parallax-y]').each(function(){
setParallaxTransform(this, s.progress);
});
s.slides.each(function () {
var slide = $(this);
slide.find('[data-swiper-parallax], [data-swiper-parallax-x], [data-swiper-parallax-y]').each(function () {
var progress = Math.min(Math.max(slide[0].progress, -1), 1);
setParallaxTransform(this, progress);
});
});
},
setTransition: function (duration) {
if (typeof duration === 'undefined') duration = s.params.speed;
s.container.find('[data-swiper-parallax], [data-swiper-parallax-x], [data-swiper-parallax-y]').each(function(){
var el = $(this);
var parallaxDuration = parseInt(el.attr('data-swiper-parallax-duration'), 10) || duration;
if (duration === 0) parallaxDuration = 0;
el.transition(parallaxDuration);
});
}
};

View file

@ -0,0 +1,16 @@
/*=========================
Plugins API. Collect all and init all plugins
===========================*/
s._plugins = [];
for (var plugin in s.plugins) {
var p = s.plugins[plugin](s, s.params[plugin]);
if (p) s._plugins.push(p);
}
// Method to call all plugins event/method
s.callPlugins = function (eventName) {
for (var i = 0; i < s._plugins.length; i++) {
if (eventName in s._plugins[i]) {
s._plugins[i][eventName](arguments[1], arguments[2], arguments[3], arguments[4], arguments[5]);
}
}
};

View file

@ -0,0 +1,178 @@
/*=========================
Scrollbar
===========================*/
s.scrollbar = {
isTouched: false,
setDragPosition: function (e) {
var sb = s.scrollbar;
var x = 0, y = 0;
var translate;
var pointerPosition = s.isHorizontal() ?
((e.type === 'touchstart' || e.type === 'touchmove') ? e.targetTouches[0].pageX : e.pageX || e.clientX) :
((e.type === 'touchstart' || e.type === 'touchmove') ? e.targetTouches[0].pageY : e.pageY || e.clientY) ;
var position = (pointerPosition) - sb.track.offset()[s.isHorizontal() ? 'left' : 'top'] - sb.dragSize / 2;
var positionMin = -s.minTranslate() * sb.moveDivider;
var positionMax = -s.maxTranslate() * sb.moveDivider;
if (position < positionMin) {
position = positionMin;
}
else if (position > positionMax) {
position = positionMax;
}
position = -position / sb.moveDivider;
s.updateProgress(position);
s.setWrapperTranslate(position, true);
},
dragStart: function (e) {
var sb = s.scrollbar;
sb.isTouched = true;
e.preventDefault();
e.stopPropagation();
sb.setDragPosition(e);
clearTimeout(sb.dragTimeout);
sb.track.transition(0);
if (s.params.scrollbarHide) {
sb.track.css('opacity', 1);
}
s.wrapper.transition(100);
sb.drag.transition(100);
s.emit('onScrollbarDragStart', s);
},
dragMove: function (e) {
var sb = s.scrollbar;
if (!sb.isTouched) return;
if (e.preventDefault) e.preventDefault();
else e.returnValue = false;
sb.setDragPosition(e);
s.wrapper.transition(0);
sb.track.transition(0);
sb.drag.transition(0);
s.emit('onScrollbarDragMove', s);
},
dragEnd: function (e) {
var sb = s.scrollbar;
if (!sb.isTouched) return;
sb.isTouched = false;
if (s.params.scrollbarHide) {
clearTimeout(sb.dragTimeout);
sb.dragTimeout = setTimeout(function () {
sb.track.css('opacity', 0);
sb.track.transition(400);
}, 1000);
}
s.emit('onScrollbarDragEnd', s);
if (s.params.scrollbarSnapOnRelease) {
s.slideReset();
}
},
enableDraggable: function () {
var sb = s.scrollbar;
var target = s.support.touch ? sb.track : document;
$(sb.track).on(s.touchEvents.start, sb.dragStart);
$(target).on(s.touchEvents.move, sb.dragMove);
$(target).on(s.touchEvents.end, sb.dragEnd);
},
disableDraggable: function () {
var sb = s.scrollbar;
var target = s.support.touch ? sb.track : document;
$(sb.track).off(s.touchEvents.start, sb.dragStart);
$(target).off(s.touchEvents.move, sb.dragMove);
$(target).off(s.touchEvents.end, sb.dragEnd);
},
set: function () {
if (!s.params.scrollbar) return;
var sb = s.scrollbar;
sb.track = $(s.params.scrollbar);
sb.drag = sb.track.find('.swiper-scrollbar-drag');
if (sb.drag.length === 0) {
sb.drag = $('<div class="swiper-scrollbar-drag"></div>');
sb.track.append(sb.drag);
}
sb.drag[0].style.width = '';
sb.drag[0].style.height = '';
sb.trackSize = s.isHorizontal() ? sb.track[0].offsetWidth : sb.track[0].offsetHeight;
sb.divider = s.size / s.virtualSize;
sb.moveDivider = sb.divider * (sb.trackSize / s.size);
sb.dragSize = sb.trackSize * sb.divider;
if (s.isHorizontal()) {
sb.drag[0].style.width = sb.dragSize + 'px';
}
else {
sb.drag[0].style.height = sb.dragSize + 'px';
}
if (sb.divider >= 1) {
sb.track[0].style.display = 'none';
}
else {
sb.track[0].style.display = '';
}
if (s.params.scrollbarHide) {
sb.track[0].style.opacity = 0;
}
},
setTranslate: function () {
if (!s.params.scrollbar) return;
var diff;
var sb = s.scrollbar;
var translate = s.translate || 0;
var newPos;
var newSize = sb.dragSize;
newPos = (sb.trackSize - sb.dragSize) * s.progress;
if (s.rtl && s.isHorizontal()) {
newPos = -newPos;
if (newPos > 0) {
newSize = sb.dragSize - newPos;
newPos = 0;
}
else if (-newPos + sb.dragSize > sb.trackSize) {
newSize = sb.trackSize + newPos;
}
}
else {
if (newPos < 0) {
newSize = sb.dragSize + newPos;
newPos = 0;
}
else if (newPos + sb.dragSize > sb.trackSize) {
newSize = sb.trackSize - newPos;
}
}
if (s.isHorizontal()) {
if (s.support.transforms3d) {
sb.drag.transform('translate3d(' + (newPos) + 'px, 0, 0)');
}
else {
sb.drag.transform('translateX(' + (newPos) + 'px)');
}
sb.drag[0].style.width = newSize + 'px';
}
else {
if (s.support.transforms3d) {
sb.drag.transform('translate3d(0px, ' + (newPos) + 'px, 0)');
}
else {
sb.drag.transform('translateY(' + (newPos) + 'px)');
}
sb.drag[0].style.height = newSize + 'px';
}
if (s.params.scrollbarHide) {
clearTimeout(sb.timeout);
sb.track[0].style.opacity = 1;
sb.timeout = setTimeout(function () {
sb.track[0].style.opacity = 0;
sb.track.transition(400);
}, 1000);
}
},
setTransition: function (duration) {
if (!s.params.scrollbar) return;
s.scrollbar.drag.transition(duration);
}
};

View file

@ -0,0 +1,5 @@
/*===========================
Swiper
===========================*/
window.Swiper = function (container, params) {
if (!(this instanceof Swiper)) return new Swiper(container, params);

View file

@ -0,0 +1,5 @@
/*===========================
Swiper
===========================*/
var Swiper = function (container, params) {
if (!(this instanceof Swiper)) return new Swiper(container, params);

View file

@ -0,0 +1,4 @@
// Return swiper instance
return s;
};

View file

@ -0,0 +1,63 @@
/*==================================================
Prototype
====================================================*/
Swiper.prototype = {
isSafari: (function () {
var ua = navigator.userAgent.toLowerCase();
return (ua.indexOf('safari') >= 0 && ua.indexOf('chrome') < 0 && ua.indexOf('android') < 0);
})(),
isUiWebView: /(iPhone|iPod|iPad).*AppleWebKit(?!.*Safari)/i.test(navigator.userAgent),
isArray: function (arr) {
return Object.prototype.toString.apply(arr) === '[object Array]';
},
/*==================================================
Browser
====================================================*/
browser: {
ie: window.navigator.pointerEnabled || window.navigator.msPointerEnabled,
ieTouch: (window.navigator.msPointerEnabled && window.navigator.msMaxTouchPoints > 1) || (window.navigator.pointerEnabled && window.navigator.maxTouchPoints > 1)
},
/*==================================================
Devices
====================================================*/
device: (function () {
var ua = navigator.userAgent;
var android = ua.match(/(Android);?[\s\/]+([\d.]+)?/);
var ipad = ua.match(/(iPad).*OS\s([\d_]+)/);
var ipod = ua.match(/(iPod)(.*OS\s([\d_]+))?/);
var iphone = !ipad && ua.match(/(iPhone\sOS)\s([\d_]+)/);
return {
ios: ipad || iphone || ipod,
android: android
};
})(),
/*==================================================
Feature Detection
====================================================*/
support: {
touch : (window.Modernizr && Modernizr.touch === true) || (function () {
return !!(('ontouchstart' in window) || window.DocumentTouch && document instanceof DocumentTouch);
})(),
transforms3d : (window.Modernizr && Modernizr.csstransforms3d === true) || (function () {
var div = document.createElement('div').style;
return ('webkitPerspective' in div || 'MozPerspective' in div || 'OPerspective' in div || 'MsPerspective' in div || 'perspective' in div);
})(),
flexbox: (function () {
var div = document.createElement('div').style;
var styles = ('alignItems webkitAlignItems webkitBoxAlign msFlexAlign mozBoxAlign webkitFlexDirection msFlexDirection mozBoxDirection mozBoxOrient webkitBoxDirection webkitBoxOrient').split(' ');
for (var i = 0; i < styles.length; i++) {
if (styles[i] in div) return true;
}
})(),
observer: (function () {
return ('MutationObserver' in window || 'WebkitMutationObserver' in window);
})()
},
/*==================================================
Plugins
====================================================*/
plugins: {}
};

View file

@ -0,0 +1,2 @@
return Swiper;
}));

View file

@ -0,0 +1,2 @@
window.Swiper = Swiper;
})();

View file

@ -0,0 +1,17 @@
(function (root, factory) {
'use strict';
if (typeof define === 'function' && define.amd) {
// AMD. Register as an anonymous module.
define(['jquery'], factory);
} else if (typeof exports === 'object') {
// Node. Does not work with strict CommonJS, but
// only CommonJS-like environments that support module.exports,
// like Node.
module.exports = factory(require('jquery'));
} else {
// Browser globals (root is window)
root.Swiper = factory(root.jQuery);
}
}(this, function ($) {
'use strict';

View file

@ -0,0 +1,3 @@
(function () {
'use strict';
var $;

View file

@ -0,0 +1,104 @@
.swiper-container {
margin:0 auto;
position:relative;
overflow:hidden;
/* Fix of Webkit flickering */
z-index:1;
}
.swiper-container-no-flexbox {
.swiper-slide {
float: left;
}
}
.swiper-container-vertical > .swiper-wrapper{
-webkit-box-orient: vertical;
-moz-box-orient: vertical;
-ms-flex-direction: column;
-webkit-flex-direction: column;
flex-direction: column;
}
.swiper-wrapper {
position:relative;
width: 100%;
height: 100%;
z-index: 1;
display: -webkit-box;
display: -moz-box;
display: -ms-flexbox;
display: -webkit-flex;
display: flex;
-webkit-transition-property:-webkit-transform;
-moz-transition-property:-moz-transform;
-o-transition-property:-o-transform;
-ms-transition-property:-ms-transform;
transition-property:transform;
-webkit-box-sizing: content-box;
-moz-box-sizing: content-box;
box-sizing: content-box;
}
.swiper-container-android .swiper-slide, .swiper-wrapper {
-webkit-transform:translate3d(0px,0,0);
-moz-transform:translate3d(0px,0,0);
-o-transform:translate(0px,0px);
-ms-transform:translate3d(0px,0,0);
transform:translate3d(0px,0,0);
}
.swiper-container-multirow > .swiper-wrapper {
-webkit-box-lines: multiple;
-moz-box-lines: multiple;
-ms-flex-wrap: wrap;
-webkit-flex-wrap: wrap;
flex-wrap: wrap;
}
.swiper-container-free-mode > .swiper-wrapper {
-webkit-transition-timing-function: ease-out;
-moz-transition-timing-function: ease-out;
-ms-transition-timing-function: ease-out;
-o-transition-timing-function: ease-out;
transition-timing-function: ease-out;
margin: 0 auto;
}
.swiper-slide {
-webkit-flex-shrink: 0;
-ms-flex: 0 0 auto;
flex-shrink: 0;
width: 100%;
height: 100%;
position: relative;
}
/* Auto Height */
.swiper-container-autoheight, .swiper-container-autoheight .swiper-slide {
height: auto;
}
.swiper-container-autoheight .swiper-wrapper {
-webkit-box-align: start;
-ms-flex-align: start;
-webkit-align-items: flex-start;
align-items: flex-start;
-webkit-transition-property: -webkit-transform, height;
-moz-transition-property: -moz-transform;
-o-transition-property: -o-transform;
-ms-transition-property: -ms-transform;
transition-property: transform, height;
}
/* a11y */
.swiper-container .swiper-notification {
position: absolute;
left: 0;
top: 0;
pointer-events: none;
opacity: 0;
z-index: -1000;
}
/* IE10 Windows Phone 8 Fixes */
.swiper-wp8-horizontal {
-ms-touch-action: pan-y;
touch-action: pan-y;
}
.swiper-wp8-vertical {
-ms-touch-action: pan-x;
touch-action: pan-x;
}

View file

@ -0,0 +1,142 @@
/* 3D Container */
.swiper-container-3d {
-webkit-perspective: 1200px;
-moz-perspective: 1200px;
-o-perspective: 1200px;
perspective: 1200px;
.swiper-wrapper, .swiper-slide, .swiper-slide-shadow-left, .swiper-slide-shadow-right, .swiper-slide-shadow-top, .swiper-slide-shadow-bottom, .swiper-cube-shadow {
.preserve3d();
}
.swiper-slide-shadow-left, .swiper-slide-shadow-right, .swiper-slide-shadow-top, .swiper-slide-shadow-bottom {
position: absolute;
left: 0;
top: 0;
width: 100%;
height: 100%;
pointer-events: none;
z-index: 10;
}
.swiper-slide-shadow-left {
background-image: -webkit-gradient(linear, left top, right top, from(rgba(0,0,0,0.5)), to(rgba(0,0,0,0))); /* Safari 4+, Chrome */
background-image: -webkit-linear-gradient(right, rgba(0,0,0,0.5), rgba(0,0,0,0)); /* Chrome 10+, Safari 5.1+, iOS 5+ */
background-image: -moz-linear-gradient(right, rgba(0,0,0,0.5), rgba(0,0,0,0)); /* Firefox 3.6-15 */
background-image: -o-linear-gradient(right, rgba(0,0,0,0.5), rgba(0,0,0,0)); /* Opera 11.10-12.00 */
background-image: linear-gradient(to left, rgba(0,0,0,0.5), rgba(0,0,0,0)); /* Firefox 16+, IE10, Opera 12.50+ */
}
.swiper-slide-shadow-right {
background-image: -webkit-gradient(linear, right top, left top, from(rgba(0,0,0,0.5)), to(rgba(0,0,0,0))); /* Safari 4+, Chrome */
background-image: -webkit-linear-gradient(left, rgba(0,0,0,0.5), rgba(0,0,0,0)); /* Chrome 10+, Safari 5.1+, iOS 5+ */
background-image: -moz-linear-gradient(left, rgba(0,0,0,0.5), rgba(0,0,0,0)); /* Firefox 3.6-15 */
background-image: -o-linear-gradient(left, rgba(0,0,0,0.5), rgba(0,0,0,0)); /* Opera 11.10-12.00 */
background-image: linear-gradient(to right, rgba(0,0,0,0.5), rgba(0,0,0,0)); /* Firefox 16+, IE10, Opera 12.50+ */
}
.swiper-slide-shadow-top {
background-image: -webkit-gradient(linear, left top, left bottom, from(rgba(0,0,0,0.5)), to(rgba(0,0,0,0))); /* Safari 4+, Chrome */
background-image: -webkit-linear-gradient(bottom, rgba(0,0,0,0.5), rgba(0,0,0,0)); /* Chrome 10+, Safari 5.1+, iOS 5+ */
background-image: -moz-linear-gradient(bottom, rgba(0,0,0,0.5), rgba(0,0,0,0)); /* Firefox 3.6-15 */
background-image: -o-linear-gradient(bottom, rgba(0,0,0,0.5), rgba(0,0,0,0)); /* Opera 11.10-12.00 */
background-image: linear-gradient(to top, rgba(0,0,0,0.5), rgba(0,0,0,0)); /* Firefox 16+, IE10, Opera 12.50+ */
}
.swiper-slide-shadow-bottom {
background-image: -webkit-gradient(linear, left bottom, left top, from(rgba(0,0,0,0.5)), to(rgba(0,0,0,0))); /* Safari 4+, Chrome */
background-image: -webkit-linear-gradient(top, rgba(0,0,0,0.5), rgba(0,0,0,0)); /* Chrome 10+, Safari 5.1+, iOS 5+ */
background-image: -moz-linear-gradient(top, rgba(0,0,0,0.5), rgba(0,0,0,0)); /* Firefox 3.6-15 */
background-image: -o-linear-gradient(top, rgba(0,0,0,0.5), rgba(0,0,0,0)); /* Opera 11.10-12.00 */
background-image: linear-gradient(to bottom, rgba(0,0,0,0.5), rgba(0,0,0,0)); /* Firefox 16+, IE10, Opera 12.50+ */
}
}
/* Coverflow */
.swiper-container-coverflow, .swiper-container-flip {
.swiper-wrapper {
/* Windows 8 IE 10 fix */
-ms-perspective:1200px;
}
}
/* Cube + Flip */
.swiper-container-cube, .swiper-container-flip {
overflow: visible;
.swiper-slide {
pointer-events: none;
-webkit-backface-visibility: hidden;
-moz-backface-visibility: hidden;
-ms-backface-visibility: hidden;
backface-visibility: hidden;
z-index: 1;
.swiper-slide {
pointer-events: none;
}
}
.swiper-slide-active {
&, & .swiper-slide-active {
pointer-events: auto;
}
}
.swiper-slide-shadow-top, .swiper-slide-shadow-bottom, .swiper-slide-shadow-left, .swiper-slide-shadow-right {
z-index: 0;
-webkit-backface-visibility: hidden;
-moz-backface-visibility: hidden;
-ms-backface-visibility: hidden;
backface-visibility: hidden;
}
}
/* Cube */
.swiper-container-cube {
.swiper-slide {
visibility: hidden;
-webkit-transform-origin: 0 0;
-moz-transform-origin: 0 0;
-ms-transform-origin: 0 0;
transform-origin: 0 0;
width: 100%;
height: 100%;
}
&.swiper-container-rtl .swiper-slide{
-webkit-transform-origin: 100% 0;
-moz-transform-origin: 100% 0;
-ms-transform-origin: 100% 0;
transform-origin: 100% 0;
}
.swiper-slide-active, .swiper-slide-next, .swiper-slide-prev, .swiper-slide-next + .swiper-slide {
pointer-events: auto;
visibility: visible;
}
.swiper-cube-shadow {
position: absolute;
left: 0;
bottom: 0px;
width: 100%;
height: 100%;
background: #000;
opacity: 0.6;
-webkit-filter: blur(50px);
filter: blur(50px);
z-index: 0;
}
}
/* Fade */
.swiper-container-fade {
&.swiper-container-free-mode {
.swiper-slide {
-webkit-transition-timing-function: ease-out;
-moz-transition-timing-function: ease-out;
-ms-transition-timing-function: ease-out;
-o-transition-timing-function: ease-out;
transition-timing-function: ease-out;
}
}
.swiper-slide {
pointer-events: none;
-webkit-transition-property: opacity;
-moz-transition-property: opacity;
-o-transition-property: opacity;
transition-property: opacity;
.swiper-slide {
pointer-events: none;
}
}
.swiper-slide-active {
&, & .swiper-slide-active {
pointer-events: auto;
}
}
}

View file

@ -0,0 +1,10 @@
.preserve3d() {
-webkit-transform-style: preserve-3d;
-moz-transform-style: preserve-3d;
-ms-transform-style: preserve-3d;
transform-style: preserve-3d;
}
.encoded-svg-background(@svg) {
@url: `encodeURIComponent(@{svg})`;
background-image: url("data:image/svg+xml;charset=utf-8,@{url}");
}

View file

@ -0,0 +1,143 @@
/* Arrows */
.swiper-button-prev, .swiper-button-next {
position: absolute;
top: 50%;
width: 27px;
height: 44px;
margin-top: -22px;
z-index: 10;
cursor: pointer;
-moz-background-size: 27px 44px;
-webkit-background-size: 27px 44px;
background-size: 27px 44px;
background-position: center;
background-repeat: no-repeat;
&.swiper-button-disabled {
opacity: 0.35;
cursor: auto;
pointer-events: none;
}
}
.swiper-button-prev, .swiper-container-rtl .swiper-button-next {
.encoded-svg-background("<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 27 44'><path d='M0,22L22,0l2.1,2.1L4.2,22l19.9,19.9L22,44L0,22L0,22L0,22z' fill='#007aff'/></svg>");
left: 10px;
right: auto;
}
.swiper-button-next, .swiper-container-rtl .swiper-button-prev {
.encoded-svg-background("<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 27 44'><path d='M27,22L27,22L5,44l-2.1-2.1L22.8,22L2.9,2.1L5,0L27,22L27,22z' fill='#007aff'/></svg>");
right: 10px;
left: auto;
}
/* Pagination Styles */
.swiper-pagination {
position: absolute;
text-align: center;
-webkit-transition: 300ms;
-moz-transition: 300ms;
-o-transition: 300ms;
transition: 300ms;
-webkit-transform: translate3d(0,0,0);
-ms-transform: translate3d(0,0,0);
-o-transform: translate3d(0,0,0);
transform: translate3d(0,0,0);
z-index: 10;
&.swiper-pagination-hidden {
opacity: 0;
}
}
/* Common Styles */
.swiper-pagination-fraction, .swiper-pagination-custom, .swiper-container-horizontal > .swiper-pagination-bullets{
bottom: 10px;
left: 0;
width: 100%;
}
/* Bullets */
.swiper-pagination-bullet {
width: 8px;
height: 8px;
display: inline-block;
border-radius: 100%;
background: #000;
opacity: 0.2;
button& {
border: none;
margin: 0;
padding: 0;
box-shadow: none;
-moz-appearance: none;
-ms-appearance: none;
-webkit-appearance: none;
appearance: none;
}
.swiper-pagination-clickable & {
cursor: pointer;
}
}
.swiper-pagination-bullet-active {
opacity: 1;
background: #007aff;
}
.swiper-container-vertical {
> .swiper-pagination-bullets {
right: 10px;
top: 50%;
-webkit-transform:translate3d(0px,-50%,0);
-moz-transform:translate3d(0px,-50%,0);
-o-transform:translate(0px,-50%);
-ms-transform:translate3d(0px,-50%,0);
transform:translate3d(0px,-50%,0);
.swiper-pagination-bullet {
margin: 5px 0;
display: block;
}
}
}
.swiper-container-horizontal {
> .swiper-pagination-bullets {
.swiper-pagination-bullet {
margin: 0 5px;
}
}
}
/* Progress */
.swiper-pagination-progress {
background: rgba(0,0,0,0.25);
position: absolute;
.swiper-pagination-progressbar {
background: #007aff;
position: absolute;
left: 0;
top: 0;
width: 100%;
height: 100%;
-webkit-transform: scale(0);
-ms-transform: scale(0);
-o-transform: scale(0);
transform: scale(0);
-webkit-transform-origin: left top;
-moz-transform-origin: left top;
-ms-transform-origin: left top;
-o-transform-origin: left top;
transform-origin: left top;
}
.swiper-container-rtl & .swiper-pagination-progressbar {
-webkit-transform-origin: right top;
-moz-transform-origin: right top;
-ms-transform-origin: right top;
-o-transform-origin: right top;
transform-origin: right top;
}
.swiper-container-horizontal > & {
width: 100%;
height: 4px;
left: 0;
top: 0;
}
.swiper-container-vertical > & {
width: 4px;
height: 100%;
left: 0;
top: 0;
}
}

View file

@ -0,0 +1,174 @@
/* Arrows */
.swiper-button-prev, .swiper-button-next {
position: absolute;
top: 50%;
width: 27px;
height: 44px;
margin-top: -22px;
z-index: 10;
cursor: pointer;
-moz-background-size: 27px 44px;
-webkit-background-size: 27px 44px;
background-size: 27px 44px;
background-position: center;
background-repeat: no-repeat;
&.swiper-button-disabled {
opacity: 0.35;
cursor: auto;
pointer-events: none;
}
}
.swiper-button-prev, .swiper-container-rtl .swiper-button-next {
.encoded-svg-background("<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 27 44'><path d='M0,22L22,0l2.1,2.1L4.2,22l19.9,19.9L22,44L0,22L0,22L0,22z' fill='#007aff'/></svg>");
left: 10px;
right: auto;
&.swiper-button-black {
.encoded-svg-background("<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 27 44'><path d='M0,22L22,0l2.1,2.1L4.2,22l19.9,19.9L22,44L0,22L0,22L0,22z' fill='#000000'/></svg>");
}
&.swiper-button-white {
.encoded-svg-background("<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 27 44'><path d='M0,22L22,0l2.1,2.1L4.2,22l19.9,19.9L22,44L0,22L0,22L0,22z' fill='#ffffff'/></svg>");
}
}
.swiper-button-next, .swiper-container-rtl .swiper-button-prev {
.encoded-svg-background("<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 27 44'><path d='M27,22L27,22L5,44l-2.1-2.1L22.8,22L2.9,2.1L5,0L27,22L27,22z' fill='#007aff'/></svg>");
right: 10px;
left: auto;
&.swiper-button-black {
.encoded-svg-background("<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 27 44'><path d='M27,22L27,22L5,44l-2.1-2.1L22.8,22L2.9,2.1L5,0L27,22L27,22z' fill='#000000'/></svg>");
}
&.swiper-button-white {
.encoded-svg-background("<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 27 44'><path d='M27,22L27,22L5,44l-2.1-2.1L22.8,22L2.9,2.1L5,0L27,22L27,22z' fill='#ffffff'/></svg>");
}
}
/* Pagination Styles */
.swiper-pagination {
position: absolute;
text-align: center;
-webkit-transition: 300ms;
-moz-transition: 300ms;
-o-transition: 300ms;
transition: 300ms;
-webkit-transform: translate3d(0,0,0);
-ms-transform: translate3d(0,0,0);
-o-transform: translate3d(0,0,0);
transform: translate3d(0,0,0);
z-index: 10;
&.swiper-pagination-hidden {
opacity: 0;
}
}
/* Common Styles */
.swiper-pagination-fraction, .swiper-pagination-custom, .swiper-container-horizontal > .swiper-pagination-bullets{
bottom: 10px;
left: 0;
width: 100%;
}
/* Bullets */
.swiper-pagination-bullet {
width: 8px;
height: 8px;
display: inline-block;
border-radius: 100%;
background: #000;
opacity: 0.2;
button& {
border: none;
margin: 0;
padding: 0;
box-shadow: none;
-moz-appearance: none;
-ms-appearance: none;
-webkit-appearance: none;
appearance: none;
}
.swiper-pagination-clickable & {
cursor: pointer;
}
.swiper-pagination-white & {
background: #fff;
}
}
.swiper-pagination-bullet-active {
opacity: 1;
background: #007aff;
.swiper-pagination-white & {
background: #fff;
}
.swiper-pagination-black & {
background: #000;
}
}
.swiper-container-vertical {
> .swiper-pagination-bullets {
right: 10px;
top: 50%;
-webkit-transform:translate3d(0px,-50%,0);
-moz-transform:translate3d(0px,-50%,0);
-o-transform:translate(0px,-50%);
-ms-transform:translate3d(0px,-50%,0);
transform:translate3d(0px,-50%,0);
.swiper-pagination-bullet {
margin: 5px 0;
display: block;
}
}
}
.swiper-container-horizontal {
> .swiper-pagination-bullets {
.swiper-pagination-bullet {
margin: 0 5px;
}
}
}
/* Progress */
.swiper-pagination-progress {
background: rgba(0,0,0,0.25);
position: absolute;
.swiper-pagination-progressbar {
background: #007aff;
position: absolute;
left: 0;
top: 0;
width: 100%;
height: 100%;
-webkit-transform: scale(0);
-ms-transform: scale(0);
-o-transform: scale(0);
transform: scale(0);
-webkit-transform-origin: left top;
-moz-transform-origin: left top;
-ms-transform-origin: left top;
-o-transform-origin: left top;
transform-origin: left top;
}
.swiper-container-rtl & .swiper-pagination-progressbar {
-webkit-transform-origin: right top;
-moz-transform-origin: right top;
-ms-transform-origin: right top;
-o-transform-origin: right top;
transform-origin: right top;
}
.swiper-container-horizontal > & {
width: 100%;
height: 4px;
left: 0;
top: 0;
}
.swiper-container-vertical > & {
width: 4px;
height: 100%;
left: 0;
top: 0;
}
&.swiper-pagination-white {
background: rgba(255,255,255,0.5);
.swiper-pagination-progressbar {
background: #fff;
}
}
&.swiper-pagination-black {
.swiper-pagination-progressbar {
background: #000;
}
}
}

View file

@ -0,0 +1,11 @@
/* Preloader */
.swiper-slide .preloader {
width: 42px;
height: 42px;
position: absolute;
left: 50%;
top: 50%;
margin-left: -21px;
margin-top: -21px;
z-index: 10;
}

View file

@ -0,0 +1,42 @@
/* Preloader */
.swiper-lazy-preloader {
width: 42px;
height: 42px;
position: absolute;
left: 50%;
top: 50%;
margin-left: -21px;
margin-top: -21px;
z-index: 10;
-webkit-transform-origin: 50%;
-moz-transform-origin: 50%;
transform-origin: 50%;
-webkit-animation: swiper-preloader-spin 1s steps(12, end) infinite;
-moz-animation: swiper-preloader-spin 1s steps(12, end) infinite;
animation: swiper-preloader-spin 1s steps(12, end) infinite;
}
.swiper-lazy-preloader:after {
display: block;
content: "";
width: 100%;
height: 100%;
.encoded-svg-background("<svg viewBox='0 0 120 120' xmlns='http://www.w3.org/2000/svg' xmlns:xlink='http://www.w3.org/1999/xlink'><defs><line id='l' x1='60' x2='60' y1='7' y2='27' stroke='#6c6c6c' stroke-width='11' stroke-linecap='round'/></defs><g><use xlink:href='#l' opacity='.27'/><use xlink:href='#l' opacity='.27' transform='rotate(30 60,60)'/><use xlink:href='#l' opacity='.27' transform='rotate(60 60,60)'/><use xlink:href='#l' opacity='.27' transform='rotate(90 60,60)'/><use xlink:href='#l' opacity='.27' transform='rotate(120 60,60)'/><use xlink:href='#l' opacity='.27' transform='rotate(150 60,60)'/><use xlink:href='#l' opacity='.37' transform='rotate(180 60,60)'/><use xlink:href='#l' opacity='.46' transform='rotate(210 60,60)'/><use xlink:href='#l' opacity='.56' transform='rotate(240 60,60)'/><use xlink:href='#l' opacity='.66' transform='rotate(270 60,60)'/><use xlink:href='#l' opacity='.75' transform='rotate(300 60,60)'/><use xlink:href='#l' opacity='.85' transform='rotate(330 60,60)'/></g></svg>");
background-position: 50%;
-webkit-background-size: 100%;
background-size: 100%;
background-repeat: no-repeat;
}
.swiper-lazy-preloader-white:after {
.encoded-svg-background("<svg viewBox='0 0 120 120' xmlns='http://www.w3.org/2000/svg' xmlns:xlink='http://www.w3.org/1999/xlink'><defs><line id='l' x1='60' x2='60' y1='7' y2='27' stroke='#fff' stroke-width='11' stroke-linecap='round'/></defs><g><use xlink:href='#l' opacity='.27'/><use xlink:href='#l' opacity='.27' transform='rotate(30 60,60)'/><use xlink:href='#l' opacity='.27' transform='rotate(60 60,60)'/><use xlink:href='#l' opacity='.27' transform='rotate(90 60,60)'/><use xlink:href='#l' opacity='.27' transform='rotate(120 60,60)'/><use xlink:href='#l' opacity='.27' transform='rotate(150 60,60)'/><use xlink:href='#l' opacity='.37' transform='rotate(180 60,60)'/><use xlink:href='#l' opacity='.46' transform='rotate(210 60,60)'/><use xlink:href='#l' opacity='.56' transform='rotate(240 60,60)'/><use xlink:href='#l' opacity='.66' transform='rotate(270 60,60)'/><use xlink:href='#l' opacity='.75' transform='rotate(300 60,60)'/><use xlink:href='#l' opacity='.85' transform='rotate(330 60,60)'/></g></svg>");
}
@-webkit-keyframes swiper-preloader-spin {
100% {
-webkit-transform: rotate(360deg);
}
}
@keyframes swiper-preloader-spin {
100% {
transform: rotate(360deg);
}
}

View file

@ -0,0 +1,35 @@
/* Scrollbar */
.swiper-scrollbar {
border-radius: 10px;
position: relative;
-ms-touch-action: none;
background: rgba(0,0,0,0.1);
.swiper-container-horizontal > & {
position: absolute;
left: 1%;
bottom: 3px;
z-index: 50;
height: 5px;
width: 98%;
}
.swiper-container-vertical > & {
position: absolute;
right: 3px;
top: 1%;
z-index: 50;
width: 5px;
height: 98%;
}
}
.swiper-scrollbar-drag {
height: 100%;
width: 100%;
position: relative;
background: rgba(0,0,0,0.5);
border-radius: 10px;
left: 0;
top: 0;
}
.swiper-scrollbar-cursor-drag {
cursor: move;
}

View file

@ -0,0 +1,6 @@
@import url('mixins.less');
@import url('core.less');
@import url('navigation.less');
@import url('effects.less');
@import url('scrollbar.less');
@import url('preloader.less');

View file

@ -15,12 +15,12 @@
}, },
"devDependencies": {}, "devDependencies": {},
"ignore": [], "ignore": [],
"version": "1.0.42", "version": "1.0.49",
"_release": "1.0.42", "_release": "1.0.49",
"_resolution": { "_resolution": {
"type": "version", "type": "version",
"tag": "1.0.42", "tag": "1.0.49",
"commit": "72b4735c586da9d565a9ff268cec1156a71da144" "commit": "460488b5fd0723a72995cc23f9f8cb5a860bd370"
}, },
"_source": "git://github.com/MediaBrowser/emby-webcomponents.git", "_source": "git://github.com/MediaBrowser/emby-webcomponents.git",
"_target": "~1.0.0", "_target": "~1.0.0",

View file

@ -0,0 +1,44 @@
<!--
Copyright (c) 2014 The Polymer Project Authors. All rights reserved.
This code may only be used under the BSD style license found at http://polymer.github.io/LICENSE.txt
The complete set of authors may be found at http://polymer.github.io/AUTHORS.txt
The complete set of contributors may be found at http://polymer.github.io/CONTRIBUTORS.txt
Code distributed by Google as part of the polymer project is also
subject to an additional IP rights grant found at http://polymer.github.io/PATENTS.txt
-->
<!--
`iron-icons` is a utility import that includes the definition for the `iron-icon` element, `iron-iconset-svg` element, as well as an import for the default icon set.
The `iron-icons` directory also includes imports for additional icon sets that can be loaded into your project.
Example loading icon set:
<link rel="import" href="../iron-icons/maps-icons.html">
To use an icon from one of these sets, first prefix your `iron-icon` with the icon set name, followed by a colon, ":", and then the icon id.
Example using the directions-bus icon from the maps icon set:
<iron-icon icon="maps:directions-bus"></iron-icon>
See [iron-icon](#iron-icon) for more information about working with icons.
See [iron-iconset](#iron-iconset) and [iron-iconset-svg](#iron-iconset-svg) for more information about how to create a custom iconset.
@group Iron Elements
@element iron-icons
@demo demo/index.html
-->
<iron-iconset-svg name="slideshow" size="24">
<svg>
<defs>
<g id="arrow-back"><path d="M20 11H7.83l5.59-5.59L12 4l-8 8 8 8 1.41-1.41L7.83 13H20v-2z" /></g>
<g id="pause"><path d="M6 19h4V5H6v14zm8-14v14h4V5h-4z" /></g>
<g id="skip-next"><path d="M6 18l8.5-6L6 6v12zM16 6v12h2V6h-2z" /></g>
<g id="skip-previous"><path d="M6 6h2v12H6zm3.5 6l8.5 6V6z" /></g>
<g id="play-arrow"><path d="M8 5v14l11-7z" /></g>
</defs>
</svg>
</iron-iconset-svg>

View file

@ -0,0 +1,409 @@
define(['paperdialoghelper', 'inputManager', 'connectionManager', 'browser', 'css!./style', 'html!./icons', 'iron-icon-set'], function (paperdialoghelper, inputmanager, connectionManager, browser) {
return function (options) {
var self = this;
var swiperInstance;
var dlg;
function createElements(options) {
dlg = paperdialoghelper.createDialog({
exitAnimationDuration: 800,
size: 'fullscreen'
});
dlg.classList.add('slideshowDialog');
var html = '';
if (options.interactive) {
html += '<div>';
html += '<div class="slideshowSwiperContainer"><div class="swiper-wrapper"></div></div>';
html += '<paper-icon-button icon="slideshow:arrow-back" class="btnSlideshowExit" tabindex="-1"></paper-icon-button>';
html += '<div class="slideshowControlBar">';
html += '<paper-icon-button icon="slideshow:skip-previous" class="btnSlideshowPrevious slideshowButton"></paper-icon-button>';
html += '<paper-icon-button icon="slideshow:pause" class="btnSlideshowPause slideshowButton" autoFocus></paper-icon-button>';
html += '<paper-icon-button icon="slideshow:skip-next" class="btnSlideshowNext slideshowButton"></paper-icon-button>';
html += '</div>';
html += '</div>';
} else {
html += '<div class="slideshowImage"></div><h1 class="slideshowImageText"></h1>';
}
dlg.innerHTML = html;
if (options.interactive) {
dlg.querySelector('.btnSlideshowExit').addEventListener('click', function (e) {
paperdialoghelper.close(dlg);
});
dlg.querySelector('.btnSlideshowNext').addEventListener('click', nextImage);
dlg.querySelector('.btnSlideshowPrevious').addEventListener('click', previousImage);
dlg.querySelector('.btnSlideshowPause').addEventListener('click', playPause);
}
document.body.appendChild(dlg);
paperdialoghelper.open(dlg).then(function () {
stopInterval();
dlg.parentNode.removeChild(dlg);
});
inputmanager.on(window, onInputCommand);
dlg.addEventListener('iron-overlay-closed', onDialogClosed);
if (options.interactive) {
loadSwiper(dlg);
}
}
function loadSwiper(dlg) {
if (currentOptions.slides) {
dlg.querySelector('.swiper-wrapper').innerHTML = currentOptions.slides.map(getSwiperSlideHtmlFromSlide).join('');
} else {
dlg.querySelector('.swiper-wrapper').innerHTML = currentOptions.items.map(getSwiperSlideHtmlFromItem).join('');
}
require(['swiper'], function (swiper) {
swiperInstance = new Swiper(dlg.querySelector('.slideshowSwiperContainer'), {
// Optional parameters
direction: 'horizontal',
loop: true,
autoplay: options.interval || 8000,
// Disable preloading of all images
preloadImages: false,
// Enable lazy loading
lazyLoading: true,
autoplayDisableOnInteraction: false,
initialSlide: options.startIndex || 0
});
if (browser.mobile) {
pause();
} else {
play();
}
});
}
function getSwiperSlideHtmlFromItem(item) {
return getSwiperSlideHtmlFromSlide({
imageUrl: getImgUrl(item)
//title: item.Name,
//description: item.Overview
});
}
function getSwiperSlideHtmlFromSlide(item) {
var html = '';
html += '<div class="swiper-slide">';
html += '<img data-src="' + item.imageUrl + '" class="swiper-lazy">';
//html += '<paper-spinner class="swiper-lazy-preloader"></paper-spinner>';
if (item.title || item.subtitle) {
html += '<div class="slideText">';
html += '<div class="slideTextInner">';
if (item.title) {
html += '<div class="slideTitle">';
html += item.title;
html += '</div>';
}
if (item.description) {
html += '<div class="slideSubtitle">';
html += item.description;
html += '</div>';
}
html += '</div>';
html += '</div>';
}
html += '</div>';
return html;
}
function previousImage() {
if (swiperInstance) {
swiperInstance.slidePrev();
} else {
stopInterval();
showNextImage(currentIndex - 1);
}
}
function nextImage() {
if (swiperInstance) {
swiperInstance.slideNext();
} else {
stopInterval();
showNextImage(currentIndex + 1);
}
}
function play() {
dlg.querySelector('.btnSlideshowPause').icon = "slideshow:pause";
swiperInstance.startAutoplay();
}
function pause() {
dlg.querySelector('.btnSlideshowPause').icon = "slideshow:play-arrow";
swiperInstance.stopAutoplay();
}
function playPause() {
var paused = dlg.querySelector('.btnSlideshowPause').icon != "slideshow:pause";
if (paused) {
play();
} else {
pause();
}
}
function onDialogClosed() {
var swiper = swiperInstance;
if (swiper) {
swiper.destroy(true, true);
swiperInstance = null;
}
inputmanager.off(window, onInputCommand);
}
var currentTimeout;
var currentIntervalMs;
var currentOptions;
var currentIndex;
function startInterval(options) {
currentOptions = options;
stopInterval();
createElements(options);
if (!options.interactive) {
currentIntervalMs = options.interval || 8000;
showNextImage(options.startIndex || 0, true);
}
}
function getImgUrl(item) {
var apiClient = connectionManager.getApiClient(item.ServerId);
if (item.BackdropImageTags && item.BackdropImageTags.length) {
return getBackdropImageUrl(item, {
maxWidth: screen.availWidth
}, apiClient);
} else {
return getImageUrl(item, {
type: "Primary",
maxWidth: screen.availWidth
}, apiClient);
}
}
function getBackdropImageUrl(item, options, apiClient) {
options = options || {};
options.type = options.type || "Backdrop";
options.width = null;
delete options.width;
options.maxWidth = null;
delete options.maxWidth;
options.maxHeight = null;
delete options.maxHeight;
options.height = null;
delete options.height;
// If not resizing, get the original image
if (!options.maxWidth && !options.width && !options.maxHeight && !options.height) {
options.quality = 100;
options.format = 'jpg';
}
if (item.BackdropImageTags && item.BackdropImageTags.length) {
options.tag = item.BackdropImageTags[0];
return apiClient.getScaledImageUrl(item.Id, options);
}
return null;
}
function getImageUrl(item, options, apiClient) {
options = options || {};
options.type = options.type || "Primary";
if (typeof (item) === 'string') {
return apiClient.getScaledImageUrl(item, options);
}
if (item.ImageTags && item.ImageTags[options.type]) {
options.tag = item.ImageTags[options.type];
return apiClient.getScaledImageUrl(item.Id, options);
}
if (options.type == 'Primary') {
if (item.AlbumId && item.AlbumPrimaryImageTag) {
options.tag = item.AlbumPrimaryImageTag;
return apiClient.getScaledImageUrl(item.AlbumId, options);
}
//else if (item.AlbumId && item.SeriesPrimaryImageTag) {
// imgUrl = ApiClient.getScaledImageUrl(item.SeriesId, {
// type: "Primary",
// width: downloadWidth,
// tag: item.SeriesPrimaryImageTag,
// minScale: minScale
// });
//}
//else if (item.ParentPrimaryImageTag) {
// imgUrl = ApiClient.getImageUrl(item.ParentPrimaryImageItemId, {
// type: "Primary",
// width: downloadWidth,
// tag: item.ParentPrimaryImageTag,
// minScale: minScale
// });
//}
}
return null;
}
function showNextImage(index, skipPreload) {
index = Math.max(0, index);
if (index >= currentOptions.items.length) {
index = 0;
}
currentIndex = index;
var options = currentOptions;
var items = options.items;
var item = items[index];
var imgUrl = getImgUrl(item);
var onSrcLoaded = function () {
var cardImageContainer = dlg.querySelector('.slideshowImage');
var newCardImageContainer = document.createElement('div');
newCardImageContainer.className = cardImageContainer.className;
if (options.cover) {
newCardImageContainer.classList.add('cover');
}
newCardImageContainer.style.backgroundImage = "url('" + imgUrl + "')";
newCardImageContainer.classList.add('hide');
cardImageContainer.parentNode.appendChild(newCardImageContainer);
if (options.showTitle) {
dlg.querySelector('.slideshowImageText').innerHTML = item.Name;
} else {
dlg.querySelector('.slideshowImageText').innerHTML = '';
}
newCardImageContainer.classList.remove('hide');
var onAnimationFinished = function () {
var parentNode = cardImageContainer.parentNode;
if (parentNode) {
parentNode.removeChild(cardImageContainer);
}
};
if (newCardImageContainer.animate) {
var keyframes = [
{ opacity: '0', offset: 0 },
{ opacity: '1', offset: 1 }];
var timing = { duration: 1200, iterations: 1 };
newCardImageContainer.animate(keyframes, timing).onfinish = onAnimationFinished;
} else {
onAnimationFinished();
}
stopInterval();
currentTimeout = setTimeout(function () {
showNextImage(index + 1, true);
}, currentIntervalMs);
};
if (!skipPreload) {
var img = new Image();
img.onload = onSrcLoaded;
img.src = imgUrl;
} else {
onSrcLoaded();
}
}
function stopInterval() {
if (currentTimeout) {
clearTimeout(currentTimeout);
currentTimeout = null;
}
}
function onInputCommand(e) {
switch (e.detail.command) {
case 'left':
previousImage();
break;
case 'right':
nextImage();
break;
case 'play':
play();
break;
case 'pause':
pause();
break;
case 'playpause':
playPause();
break;
default:
return
break;
}
e.preventDefault();
}
self.show = function () {
startInterval(options);
};
self.hide = function () {
var dialog = dlg;
if (dialog) {
paperdialoghelper.close(dialog);
}
};
}
});

View file

@ -0,0 +1,104 @@
.slideshowImage, .slideshowSwiperContainer {
position: fixed;
top: 0;
right: 0;
left: 0;
bottom: 0;
z-index: 1001;
background-position: center center;
background-size: contain;
background-repeat: no-repeat;
margin: 0 !important;
color: #fff;
}
.slideshowImage.cover {
background-size: cover;
}
.slideshowImageText {
position: fixed;
bottom: .25em;
right: .5em;
color: #fff;
z-index: 1002;
font-weight: 400;
}
.swiper-slide {
background: #000;
}
.swiper-slide img {
width: auto;
height: auto;
max-width: 100%;
max-height: 100%;
-ms-transform: translate(-50%, -50%);
-webkit-transform: translate(-50%, -50%);
-moz-transform: translate(-50%, -50%);
transform: translate(-50%, -50%);
position: absolute;
left: 50%;
top: 50%;
}
.btnSlideshowExit {
z-index: 1002;
position: absolute;
top: 1%;
left: .5%;
width: 6vh;
height: 6vh;
color: #eee;
}
.slideshowControlBar {
position: fixed;
left: 0;
bottom: 0;
right: 0;
z-index: 1002;
background: rgba(0,0,0,.5);
text-align: center;
color: #eee;
}
.mouseIdle .btnSlideshowExit {
display: none;
}
.mouseIdle .slideshowControlBar {
transform: translateY(100%);
transition: transform 600ms ease-out;
}
.slideshowButton {
width: 8vh;
height: 8vh;
}
.slideText {
position: absolute;
left: 0;
right: 0;
bottom: 10vh;
text-align: center;
}
.slideTextInner {
margin: 0 auto;
max-width: 60%;
background: rgba(0,0,0,.8);
display: inline-block;
padding: .5em 1em;
border-radius: .25em;
}
.slideTitle {
font-size: 180%;
}
.slideSubtitle {
color: #ccc;
}

View file

@ -26,14 +26,14 @@
"webcomponentsjs": "webcomponents/webcomponentsjs#^0.7.0" "webcomponentsjs": "webcomponents/webcomponentsjs#^0.7.0"
}, },
"main": "iron-meta.html", "main": "iron-meta.html",
"homepage": "https://github.com/PolymerElements/iron-meta", "homepage": "https://github.com/polymerelements/iron-meta",
"_release": "1.1.1", "_release": "1.1.1",
"_resolution": { "_resolution": {
"type": "version", "type": "version",
"tag": "v1.1.1", "tag": "v1.1.1",
"commit": "e171ee234b482219c9514e6f9551df48ef48bd9f" "commit": "e171ee234b482219c9514e6f9551df48ef48bd9f"
}, },
"_source": "git://github.com/PolymerElements/iron-meta.git", "_source": "git://github.com/polymerelements/iron-meta.git",
"_target": "^1.0.0", "_target": "^1.0.0",
"_originalSource": "PolymerElements/iron-meta" "_originalSource": "polymerelements/iron-meta"
} }

View file

@ -36,7 +36,7 @@
"tag": "v1.1.0", "tag": "v1.1.0",
"commit": "abd9ee7c29f0aae7b583abfe0af9db7f2555eabf" "commit": "abd9ee7c29f0aae7b583abfe0af9db7f2555eabf"
}, },
"_source": "git://github.com/PolymerElements/iron-selector.git", "_source": "git://github.com/polymerelements/iron-selector.git",
"_target": "^1.0.0", "_target": "^1.0.0",
"_originalSource": "PolymerElements/iron-selector" "_originalSource": "polymerelements/iron-selector"
} }

View file

@ -32,14 +32,14 @@
"iron-test-helpers": "PolymerElements/iron-test-helpers#^1.0.0" "iron-test-helpers": "PolymerElements/iron-test-helpers#^1.0.0"
}, },
"ignore": [], "ignore": [],
"homepage": "https://github.com/polymerelements/paper-ripple", "homepage": "https://github.com/PolymerElements/paper-ripple",
"_release": "1.0.5", "_release": "1.0.5",
"_resolution": { "_resolution": {
"type": "version", "type": "version",
"tag": "v1.0.5", "tag": "v1.0.5",
"commit": "d72e7a9a8ab518b901ed18dde492df3b87a93be5" "commit": "d72e7a9a8ab518b901ed18dde492df3b87a93be5"
}, },
"_source": "git://github.com/polymerelements/paper-ripple.git", "_source": "git://github.com/PolymerElements/paper-ripple.git",
"_target": "^1.0.0", "_target": "^1.0.0",
"_originalSource": "polymerelements/paper-ripple" "_originalSource": "PolymerElements/paper-ripple"
} }

View file

@ -1,17 +0,0 @@
{
"name": "swipebox",
"version": "1.4.1",
"main": "src/js/jquery.swipebox.js",
"ignore": [],
"homepage": "https://github.com/brutaldesign/swipebox",
"_release": "1.4.1",
"_resolution": {
"type": "version",
"tag": "1.4.1",
"commit": "80c68575772aacfbcffe4203a9f0ad57d4db8a62"
},
"_source": "git://github.com/brutaldesign/swipebox.git",
"_target": "~1.4.1",
"_originalSource": "swipebox",
"_direct": true
}

View file

@ -1,2 +0,0 @@
# Auto detect text files and perform LF normalization
* text=auto

View file

@ -1,20 +0,0 @@
# Ignore dist
dist/
stage/
# Ignore demo scss
demo/scss/
# Ignore grunt stuff
**/.sass-cache
**/.grunt
**/node_modules
# Windows image file caches
Thumbs.db
# Folder config file
Desktop.ini
# Mac crap
.DS_Store

View file

@ -1,6 +0,0 @@
{
"name": "swipebox",
"version": "1.4.1",
"main": "src/js/jquery.swipebox.js",
"ignore": []
}

File diff suppressed because one or more lines are too long

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.6 KiB

View file

@ -1 +0,0 @@
/*! normalize.css v3.0.0 | MIT License | git.io/normalize */html{font-family:sans-serif;-ms-text-size-adjust:100%;-webkit-text-size-adjust:100%}body{margin:0}article,aside,details,figcaption,figure,footer,header,hgroup,main,nav,section,summary{display:block}audio,canvas,progress,video{display:inline-block;vertical-align:baseline}audio:not([controls]){display:none;height:0}[hidden],template{display:none}a{background:transparent}a:active,a:hover{outline:0}abbr[title]{border-bottom:1px dotted}b,strong{font-weight:bold}dfn{font-style:italic}h1{font-size:2em;margin:0.67em 0}mark{background:#ff0;color:#000}small{font-size:80%}sub,sup{font-size:75%;line-height:0;position:relative;vertical-align:baseline}sup{top:-0.5em}sub{bottom:-0.25em}img{border:0}svg:not(:root){overflow:hidden}figure{margin:1em 40px}hr{-moz-box-sizing:content-box;box-sizing:content-box;height:0}pre{overflow:auto}code,kbd,pre,samp{font-family:monospace, monospace;font-size:1em}button,input,optgroup,select,textarea{color:inherit;font:inherit;margin:0}button{overflow:visible}button,select{text-transform:none}button,html input[type="button"],input[type="reset"],input[type="submit"]{-webkit-appearance:button;cursor:pointer}button[disabled],html input[disabled]{cursor:default}button::-moz-focus-inner,input::-moz-focus-inner{border:0;padding:0}input{line-height:normal}input[type="checkbox"],input[type="radio"]{box-sizing:border-box;padding:0}input[type="number"]::-webkit-inner-spin-button,input[type="number"]::-webkit-outer-spin-button{height:auto}input[type="search"]{-webkit-appearance:textfield;-moz-box-sizing:content-box;-webkit-box-sizing:content-box;box-sizing:content-box}input[type="search"]::-webkit-search-cancel-button,input[type="search"]::-webkit-search-decoration{-webkit-appearance:none}fieldset{border:1px solid #c0c0c0;margin:0 2px;padding:0.35em 0.625em 0.75em}legend{border:0;padding:0}textarea{overflow:auto}optgroup{font-weight:bold}table{border-collapse:collapse;border-spacing:0}td,th{padding:0}

View file

@ -1 +0,0 @@
body{font-family:'Merriweather', serif;border-top:5px solid #4BBD93;overflow-x:hidden !important;background:#FFF;color:#666}body img{opacity:1 !important}h1,h2,h3,h4,h4,h6{font-family:'Raleway', sans-serif}a{text-decoration:none}ol{margin-left:2em;margin-bottom:2em}ul{margin-left:1em;margin-bottom:0}ul ul{margin-left:1em}header h1{margin-top:0;font-size:12rem}.lead{margin-bottom:2em}#fork-this{position:absolute;z-index:1;right:0;top:5px;width:0px;height:0px;border-style:solid;border-width:0 150px 150px 0;border-color:transparent #4BBD93 transparent transparent}#fork-this a{display:block;position:absolute;z-index:10;width:150px;height:150px;top:0;right:-150px;z-index:10;background:url("fork.png") no-repeat 0 0;background-size:150px 150px}#share{margin-bottom:3rem}#share #fb,#share #twitter{display:inline-block}#share #fb{position:relative;top:-8px}.container:nth-child(even){background:whitesmoke}.container:nth-child(odd){background:#fff}#box-container{margin:0;padding:0}.box{list-style-type:none;float:left;margin-bottom:1rem;margin-left:1%;margin-right:1%;width:48%}.box:nth-child(2n+1){clear:both;margin-left:0}.box:nth-child(2n+0){margin-right:0}.box a{display:block;width:100%;height:auto}.box a img{-webkit-back-visibility:hidden;display:block;width:100%;height:auto;vertical-align:bottom}footer{font-size:1.3rem;font-family:"Helvetica neue", Helvetica, Arial, sans-serif;text-align:center;color:#666;margin:2rem 0}footer a{color:#666}@media screen and (max-width: 799px){header h1{font-size:8rem}hr{margin:2rem 0}#fork-this{display:none}#share #fb{top:-8px}.button{margin-left:0;margin-right:0;width:100%}.button{font-size:1.3rem;padding:1.4rem 2rem}}@media screen and (max-width: 410px){header h1{font-size:5rem}.box{width:100%;margin-left:0;margin-right:0}}

View file

@ -1,24 +0,0 @@
{
"boss": true,
"curly": true,
"eqeqeq": true,
"eqnull": true,
"es3": true,
"expr": true,
"immed": true,
"noarg": true,
"onevar": true,
"quotmark": "single",
"trailing": true,
"undef": true,
"unused": true,
"browser": true,
"globals": {
"_": false,
"Backbone": false,
"jQuery": false,
"wp": false
}
}

View file

@ -1,168 +0,0 @@
module.exports = function(grunt) {
// don't forget to update the version in the package.json and bower.json file
// load dependencies
require('load-grunt-tasks')(grunt);
grunt.initConfig({
version: grunt.file.readJSON('package.json').version,
pkg: grunt.file.readJSON('package.json'),
// notify cross-OS - see https://github.com/dylang/grunt-notify
notify: {
scss: {
options: {
title: 'SCSS compiled',
message: 'CSS is in the hood'
}
},
js: {
options: {
title: 'JS checked and minified',
message: 'JS is all good'
}
},
dist: {
options: {
title: 'Project Compiled',
message: 'All good'
}
}
},
// compile scss
sass: {
dist:{
options:{
style: 'expanded'
},
files:{
'../src/css/swipebox.css': '../scss/swipebox.scss',
}
},
demo:{
options:{
style: 'compressed'
},
files:{
'../demo/style.css': '../demo/scss/style.scss',
}
}
},
// https://github.com/nDmitry/grunt-autoprefixer
autoprefixer: {
options: {
browsers: ['last 3 versions', 'bb 10', 'android 3']
},
no_dest: {
src: '../src/css/swipebox.css',
}
},
// minify css asset files
cssmin: {
minify: {
expand: true,
cwd: '../src/css/',
src: ['*.css', '!*.min.css'],
dest: '../src/css/',
ext: '.min.css'
}
},
// chech our JS
jshint: {
options : {
jshintrc : '.jshintrc'
},
all: [ '../src/js/jquery.swipebox.js' ]
},
// minify JS
uglify: {
options:{
banner : '/*! Swipebox v<%= version %> | Constantin Saguin csag.co | MIT License | github.com/brutaldesign/swipebox */\n'
},
admin: {
files: {
'../src/js/jquery.swipebox.min.js': [ '../src/js/jquery.swipebox.js']
}
}
},
// watch it live
watch: {
js: {
files: [ '../src/js/*.js' ],
tasks: [
'jshint',
'uglify',
'notify:js'
],
},
scss: {
files: ['../scss/*.scss', '../demo/scss/*.scss'],
tasks: [
'sass',
'autoprefixer',
'cssmin',
'notify:scss'
],
},
css: {
files: ['*.css']
},
livereload: {
files: [ '../src/css/*.css', '../demo/*.css' ],
options: { livereload: true }
}
},
} ); // end init config
/**
* Default task
*/
grunt.registerTask( 'default', [
'sass:dist',
'autoprefixer',
'cssmin',
'jshint',
'uglify',
'sass:demo',
'notify:dist'
] );
/**
* Dev task
*
* The main tasks for development
*
*/
grunt.registerTask( 'dev', [
'sass:dist',
'autoprefixer',
'cssmin',
'jshint',
'uglify',
'sass:demo',
'watch'
] );
};

View file

@ -1,21 +0,0 @@
{
"name": "grunt-swipebox",
"version": "1.4.1",
"description": "A touchable jQuery lightbox",
"repository": {
"type": "git",
"url": "git://github.com/brutaldesign/swipebox.git"
},
"license": "MIT",
"devDependencies": {
"grunt": "~0.4.5",
"load-grunt-tasks": "~1.0.0",
"grunt-contrib-sass": "~0.8.1",
"grunt-autoprefixer": "~2.0.0",
"grunt-contrib-cssmin": "~0.10.0",
"grunt-contrib-jshint": "~0.10.0",
"grunt-contrib-uglify": "~0.6.0",
"grunt-contrib-watch": "~0.6.1",
"grunt-notify": "~0.3.1"
}
}

View file

@ -1,274 +0,0 @@
<!DOCTYPE HTML>
<html lang="en-US">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0"/>
<meta name="description" content="A touchable jQuery lightbox plugin for desktop, mobile and tablet" />
<meta property="og:site_name" content="Swipebox" />
<meta property="og:url" content="http://brutaldesign.github.com/swipebox/" />
<meta property="og:image" content="http://swipebox.csag.co/images/swipe250.jpg" />
<meta property="og:type" content="article" />
<meta property="og:title" content="Swipebox | A touchable jQuery lightbox" />
<meta property="og:description" content="Swipebox is a jQuery lightbox plugin for desktop, mobile and tablet">
<meta itemprop="name" content="Swipebox | A touchable jQuery lightbox">
<meta itemprop="image" content="http://swipebox.csag.co/images/swipe250.jpg">
<meta itemprop="description" content="Swipebox is a jQuery lightbox plugin for desktop, mobile and tablet">
<link href='http://fonts.googleapis.com/css?family=Source+Sans+Pro:400,700|Merriweather:400,700&subset=latin,latin-ext' rel='stylesheet' type='text/css'>
<link rel="stylesheet" href="demo/normalize.css">
<link rel="stylesheet" href="demo/bagpakk.min.css">
<link rel="stylesheet" href="demo/style.css">
<link rel="stylesheet" href="src/css/swipebox.css">
<title>Swipebox | A touchable jQuery lightbox</title>
<!-- share buttons -->
<script type="text/javascript">(function(doc, script) {
var js,
fjs = doc.getElementsByTagName(script)[0],
add = function(url, id) {
if (doc.getElementById(id)) {return;}
js = doc.createElement(script);
js.src = url;
id && (js.id = id);
fjs.parentNode.insertBefore(js, fjs);
};add("//connect.facebook.net/en_US/all.js#xfbml=1", "facebook-jssdk");
add("//platform.twitter.com/widgets.js", "twitter-wjs");
}(document, "script"));
</script>
<!-- end share buttons -->
</head>
<body>
<div id="fb-root"></div>
<div id="fork-this">
<a href="https://github.com/brutaldesign/swipebox"></a>
</div>
<header class="container">
<div class="wrap small-width">
<div class="lead text-center">
<h1>Swipebox.</h1>
<p class="tagline">A touchable jQuery lightbox</p>
</div>
<div id="share" class="text-center">
<div id="twitter">
<a href="https://twitter.com/share" class="twitter-share-button" data-url="http://brutaldesign.github.com/swipebox" data-text="Swipebox | A touchable jQuery lightbox" data-via="brutaldesign">Tweet</a>
</div>
<div id="fb">
<div class="fb-like" data-href="http://brutaldesign.github.com/swipebox/" data-send="false" data-layout="button_count" data-width="110" data-show-faces="false" data-colorscheme="light" data-action="like"></div>
</div>
</div>
<ul>
<li><a href="#what">What is Swipebox ?</a>
<ul>
<li><a href="#features">Main Features</a></li>
<li><a href="#compatibility">Compatibility</a></li>
</ul>
</li>
<li><a href="#try">Try it</a></li>
<li><a href="#basic">Basic Usage</a></li>
<li><a href="#advanced">Advanced</a>
<ul>
<li><a href="#rel">Gallery</a></li>
<li><a href="#video">Video support</a></li>
<li><a href="#dynamic">Load slides dynamically</a></li>
<li><a href="#open">Check open state</a></li>
<li><a href="#options">Options</a></li>
</ul>
</li>
<li><a href="#download">Download</a></li>
</ul>
</div>
</header>
<section id="exemple" class="container">
<div class="wrap small-width">
<div id="try"></div>
<ul id="box-container">
<li class="box">
<a href="http://swipebox.csag.co/images/image-1.jpg" class="swipebox" title="Fog">
<img src="http://swipebox.csag.co/images/image-1.jpg" alt="image">
</a>
</li>
<li class="box">
<a href="http://swipebox.csag.co/images/image-2.jpg" class="swipebox" title="City">
<img src="http://swipebox.csag.co/images/image-2.jpg" alt="image">
</a>
</li>
<li class="box">
<a href="http://swipebox.csag.co/images/image-3.jpg" class="swipebox" title="Street">
<img src="http://swipebox.csag.co/images/image-3.jpg" alt="image">
</a>
</li>
<li class="box">
<a href="http://swipebox.csag.co/images/image-4.jpg" class="swipebox" title="Mustache Guy">
<img src="http://swipebox.csag.co/images/image-4.jpg" alt="image">
</a>
</li>
</ul>
</div>
</section>
<section id="presentation" class="container">
<div class="wrap small-width">
<div id="what"></div>
<h2>What is Swipebox ?</h2>
<p>Swipebox is a jQuery "lightbox" plugin for desktop, mobile and tablet.</p>
<div id="features"></div>
<h3>Main Features</h3>
<ol>
<li>Swipe gestures for mobile</li>
<li>Keyboard Navigation for desktop</li>
<li>CSS transitions with jQuery fallback</li>
<li>Retina support for UI icons</li>
<li>Easy CSS customization</li>
</ol>
<div id="compatibility"></div>
<h3>Compatibility</h3>
<p>Chrome, Safari, Firefox, Opera, IE9+, IOS4+, Android, windows phone.</p>
</div>
</section>
<section id="usage" class="container">
<div class="wrap small-width">
<div id="basic"></div>
<h2>Basic Usage</h2>
<h3>Javascript</h3>
<p>Include jquery and the swipebox script in your <code>head</code> tags or right before your <code>body</code> closing tag.</p>
<pre>&lt;script src="lib/jquery-2.0.3.js"&gt;&lt;/script&gt;
&lt;script src="src/js/jquery.swipebox.js"&gt;&lt;/script&gt;</pre>
<h3>CSS</h3>
<p>Include the swipebox CSS style in your <code>head</code> tags.</p>
<pre>&lt;link rel="stylesheet" href="src/css/swipebox.css"&gt;</pre>
<h3>HTML</h3>
<p>Use a specific class for your links and use the title attribute as caption.</p>
<pre>&lt;a href="big/image.jpg" class="swipebox" title="My Caption"&gt;
&lt;img src="small/image.jpg" alt="image"&gt;
&lt;/a></pre>
<h3>Fire the plugin</h3>
<p>Bind the swipebox behaviour on every link with the "swipebox" class.</p>
<pre>&lt;script type="text/javascript"&gt;
;( function( $ ) {
$( '.swipebox' ).swipebox();
} )( jQuery );
&lt;/script&gt;
</pre>
</div>
</section>
<section id="advanced-usage" class="container">
<div class="wrap small-width">
<div id="advanced"></div>
<h2>Advanced</h2>
<div id="rel"></div>
<h3>Gallery</h3>
<p>You can add a <code>rel</code> attribute to your links to seperate your galleries.</p>
<pre>
<span>&lt;!-- Gallery 1 --&gt;</span>
&lt;a rel="gallery-1" href="big/image1.jpg" class="swipebox"&gt;
&lt;img src="small/image1.jpg" alt="image"&gt;
&lt;/a&gt;
&lt;a rel="gallery-1" href="big/image2.jpg" class="swipebox"&gt;
&lt;img src="small/image2.jpg" alt="image"&gt;
&lt;/a&gt;
<span>&lt;!-- Gallery 2 --&gt;</span>
&lt;a rel="gallery-2" href="big/image3.jpg" class="swipebox"&gt;
&lt;img src="small/image3.jpg" alt="image"&gt;
&lt;/a&gt;
&lt;a rel="gallery-2" href="big/image4.jpg" class="swipebox"&gt;
&lt;img src="small/image4.jpg" alt="image"&gt;
&lt;/a&gt;</pre>
<div id="video"></div>
<h3>Video support</h3>
<p>Simply paste a youtube or vimeo video URL in your href attribute. The script will automatically check if it's a youtube or vimeo URL and open the video in the swipebox.</p>
<p>
<a class="swipebox-video" href="http://vimeo.com/29193046">My Video</a>
</p>
<pre>&lt;a class="swipebox-video" rel="vimeo" href="http://vimeo.com/29193046"&gt;My Videos&lt;/a&gt;</pre>
<div id="dynamic"></div>
<h3>Load slides dynamically</h3>
<p>You can set your gallery dynamically by passing an array object to the swipebox.</p>
<p><a id="gallery" href="#">View gallery</a></p>
<pre>
$( '#gallery' ).click( function( e ) {
e.preventDefault();
$.swipebox( [
{ href:'big/image1.jpg', title:'My Caption' },
{ href:'big/image2.jpg', title:'My Second Caption' }
] );
} );</pre>
<div id="open"></div>
<h3>Check open state</h3>
<pre>if ( $.swipebox.isOpen ) {
// do stuff
}</pre>
<div id="options"></div>
<h3>Options</h3>
<pre>
&lt;script type="text/javascript"&gt;
;( function( $ ) {
$( '.swipebox' ).swipebox( {
useCSS : true, <span>// false will force the use of jQuery for animations</span>
useSVG : true, <span>// false to force the use of png for buttons</span>
initialIndexOnArray : 0, <span>// which image index to init when a array is passed</span>
hideCloseButtonOnMobile : false, <span>// true will hide the close button on mobile devices</span>
hideBarsDelay : 3000, <span>// delay before hiding bars on desktop</span>
videoMaxWidth : 1140, <span>// videos max width</span>
beforeOpen: function() {}, <span>// called before opening</span>
afterOpen: null, <span>// called after opening</span>
afterClose: function() {}, <span>// called after closing</span>
loopAtEnd: false <span>// true will return to the first image after the last image is reached</span>
} );
} )( jQuery );
&lt;/script&gt;</pre>
</div>
</section>
<section id="action" class="container text-center">
<div class="wrap small-width">
<div id="download"></div>
<p><a class="button-big" href="https://github.com/brutaldesign/swipebox/archive/master.zip">Download</a> <a class="button-big" href="https://github.com/brutaldesign/swipebox">View Source</a></p>
</div>
</section>
<footer class="text-center">
<div class="wrap small-width">
<a href="http://csag.co" target="_blank">csag.co</a> | <a href="http://wpwlf.co" target="_blank">wpwlf.co</a>
</div>
</footer>
<script src="lib/ios-orientationchange-fix.js"></script>
<script src="lib/jquery-2.1.0.min.js"></script>
<script src="src/js/jquery.swipebox.js"></script>
<script type="text/javascript">
$( document ).ready(function() {
/* Basic Gallery */
$( '.swipebox' ).swipebox();
/* Video */
$( '.swipebox-video' ).swipebox();
/* Dynamic Gallery */
$( '#gallery' ).click( function( e ) {
e.preventDefault();
$.swipebox( [
{ href : 'http://swipebox.csag.co/mages/image-1.jpg', title : 'My Caption' },
{ href : 'http://swipebox.csag.co/images/image-2.jpg', title : 'My Second Caption' }
] );
} );
});
</script>
</body>
</html>

View file

@ -1,56 +0,0 @@
/*! A fix for the iOS orientationchange zoom bug.
Script by @scottjehl, rebound by @wilto.
MIT / GPLv2 License.
*/
(function(w){
// This fix addresses an iOS bug, so return early if the UA claims it's something else.
var ua = navigator.userAgent;
if( !( /iPhone|iPad|iPod/.test( navigator.platform ) && /OS [1-5]_[0-9_]* like Mac OS X/i.test(ua) && ua.indexOf( "AppleWebKit" ) > -1 ) ){
return;
}
var doc = w.document;
if( !doc.querySelector ){ return; }
var meta = doc.querySelector( "meta[name=viewport]" ),
initialContent = meta && meta.getAttribute( "content" ),
disabledZoom = initialContent + ",maximum-scale=1",
enabledZoom = initialContent + ",maximum-scale=10",
enabled = true,
x, y, z, aig;
if( !meta ){ return; }
function restoreZoom(){
meta.setAttribute( "content", enabledZoom );
enabled = true;
}
function disableZoom(){
meta.setAttribute( "content", disabledZoom );
enabled = false;
}
function checkTilt( e ){
aig = e.accelerationIncludingGravity;
x = Math.abs( aig.x );
y = Math.abs( aig.y );
z = Math.abs( aig.z );
// If portrait orientation and in one of the danger zones
if( (!w.orientation || w.orientation === 180) && ( x > 7 || ( ( z > 6 && y < 8 || z < 8 && y > 6 ) && x > 5 ) ) ){
if( enabled ){
disableZoom();
}
}
else if( !enabled ){
restoreZoom();
}
}
w.addEventListener( "orientationchange", restoreZoom, false );
w.addEventListener( "devicemotion", checkTilt, false );
})( this );

File diff suppressed because one or more lines are too long

View file

@ -1,308 +0,0 @@
/*! Swipebox v1.3.0 | Constantin Saguin csag.co | MIT License | github.com/brutaldesign/swipebox */
// Gradient mixin
@mixin css-gradient($from: #dfdfdf, $to: #f8f8f8) {
background-color: $from;
background-image: -webkit-gradient(linear, left top, left bottom, from($from), to($to));
background-image: -webkit-linear-gradient(top, $from, $to);
background-image: -moz-linear-gradient(top, $from, $to);
background-image: -o-linear-gradient(top, $from, $to);
background-image: linear-gradient(to bottom, $from, $to);
}
// Bar mixin
@mixin bar($color) {
background-color:$color;
@include css-gradient( $color, darken($color, 20%) );
}
html.swipebox-html.swipebox-touch {
overflow: hidden!important;
}
#swipebox-overlay img {
border: none!important;
}
#swipebox-overlay {
width: 100%;
height: 100%;
position: fixed;
top: 0;
left: 0;
z-index: 99999!important;
overflow: hidden;
user-select: none;
}
#swipebox-container{
position: relative;
width: 100%;
height: 100%;
}
#swipebox-slider {
transition : transform 0.4s ease;
height: 100%;
left: 0;
top: 0;
width: 100%;
white-space: nowrap;
position: absolute;
display: none;
cursor: pointer;
.slide {
height: 100%;
width: 100%;
line-height: 1px;
text-align: center;
display: inline-block;
&:before {
content: "";
display: inline-block;
height: 50%;
width: 1px;
margin-right: -1px;
}
img,
.swipebox-video-container,
.swipebox-inline-container {
display: inline-block;
max-height: 100%;
max-width: 100%;
margin: 0;
padding: 0;
width: auto;
height: auto;
vertical-align: middle;
}
.swipebox-video-container {
background:none;
max-width: 1140px;
max-height: 100%;
width: 100%;
padding:5%;
box-sizing: border-box;
.swipebox-video{
width: 100%;
height: 0;
padding-bottom: 56.25%;
overflow: hidden;
position: relative;
iframe{
width: 100%!important;
height: 100%!important;
position: absolute;
top: 0; left: 0;
}
}
}
}
.slide-loading {
background: url(../img/loader.gif) no-repeat center center;
}
}
#swipebox-bottom-bar,
#swipebox-top-bar{
transition : 0.5s;
position: absolute;
left: 0;
z-index: 999;
height: 50px;
width: 100%;
}
#swipebox-bottom-bar {
bottom: -50px;
&.visible-bars {
transform: translate3d(0,-50px,0);
}
}
#swipebox-top-bar {
top: -50px;
&.visible-bars {
transform: translate3d(0,50px,0);
}
}
#swipebox-title{
display:block;
width: 100%;
text-align: center;
}
#swipebox-prev,
#swipebox-next,
#swipebox-close {
background-image: url(../img/icons.png);
background-repeat: no-repeat;
border: none!important;
text-decoration: none!important;
cursor: pointer;
//position: absolute;
width: 50px;
height: 50px;
top: 0;
}
#swipebox-arrows{
display: block;
margin: 0 auto;
width: 100%;
height: 50px;
}
#swipebox-prev{
background-position: -32px 13px;
float: left;
}
#swipebox-next{
background-position: -78px 13px;
float: right;
}
#swipebox-close{
top: 0;
right: 0;
position: absolute;
z-index: 9999;
background-position: 15px 12px;
}
.swipebox-no-close-button #swipebox-close{
display: none;
}
#swipebox-prev,
#swipebox-next{
&.disabled{
opacity: 0.3;
}
}
.swipebox-no-touch{
#swipebox-overlay.rightSpring #swipebox-slider {
animation : rightSpring 0.3s;
}
#swipebox-overlay.leftSpring #swipebox-slider{
animation : leftSpring 0.3s;
}
}
.swipebox-touch{
#swipebox-container {
&:before,
&:after{
backface-visibility:hidden;
transition : all .3s ease;
content : ' ';
position: absolute;
z-index: 999;
top: 0;
height: 100%;
width: 20px;
opacity: 0;
}
&:before{
left: 0;
box-shadow: inset 10px 0px 10px -8px #656565;
}
&:after{
right: 0;
box-shadow: inset -10px 0px 10px -8px #656565;
}
}
#swipebox-overlay.leftSpringTouch #swipebox-container{
&:before{
opacity: 1;
}
}
#swipebox-overlay.rightSpringTouch #swipebox-container{
&:after{
opacity: 1;
}
}
}
@keyframes rightSpring {
0% {
left:0;
}
50% {
left:-30px;
}
100% {
left:0;
}
}
@keyframes leftSpring {
0% {
left:0;
}
50% {
left:30px;
}
100% {
left:0;
}
}
@media screen and (min-width: 800px) {
#swipebox-close{
right: 10px;
}
#swipebox-arrows{
width: 92%;
max-width: 800px;
}
}
/* Skin
--------------------------*/
#swipebox-overlay {
background: #0d0d0d;
}
#swipebox-bottom-bar,
#swipebox-top-bar {
text-shadow: 1px 1px 1px black;
background: #000;
//@include bar(#0d0d0d);
opacity: 0.95;
}
#swipebox-bottom-bar {
//border-top: 1px solid rgba(255, 255, 255, 0.1);
}
#swipebox-top-bar {
//border-bottom: 1px solid rgba(255, 255, 255, 0.1);
color: white!important;
font-size: 15px;
line-height: 43px;
font-family: Helvetica, Arial, sans-serif;
}

View file

@ -1,295 +0,0 @@
/*! Swipebox v1.3.0 | Constantin Saguin csag.co | MIT License | github.com/brutaldesign/swipebox */
html.swipebox-html.swipebox-touch {
overflow: hidden !important;
}
#swipebox-overlay img {
border: none !important;
}
#swipebox-overlay {
width: 100%;
height: 100%;
position: fixed;
top: 0;
left: 0;
z-index: 99999 !important;
overflow: hidden;
-webkit-user-select: none;
-moz-user-select: none;
-ms-user-select: none;
user-select: none;
}
#swipebox-container {
position: relative;
width: 100%;
height: 100%;
}
#swipebox-slider {
-webkit-transition: -webkit-transform 0.4s ease;
transition: transform 0.4s ease;
height: 100%;
left: 0;
top: 0;
width: 100%;
white-space: nowrap;
position: absolute;
display: none;
cursor: pointer;
}
#swipebox-slider .slide {
height: 100%;
width: 100%;
line-height: 1px;
text-align: center;
display: inline-block;
}
#swipebox-slider .slide:before {
content: "";
display: inline-block;
height: 50%;
width: 1px;
margin-right: -1px;
}
#swipebox-slider .slide img,
#swipebox-slider .slide .swipebox-video-container,
#swipebox-slider .slide .swipebox-inline-container {
display: inline-block;
max-height: 100%;
max-width: 100%;
margin: 0;
padding: 0;
width: auto;
height: auto;
vertical-align: middle;
}
#swipebox-slider .slide .swipebox-video-container {
background: none;
max-width: 1140px;
max-height: 100%;
width: 100%;
padding: 5%;
-webkit-box-sizing: border-box;
box-sizing: border-box;
}
#swipebox-slider .slide .swipebox-video-container .swipebox-video {
width: 100%;
height: 0;
padding-bottom: 56.25%;
overflow: hidden;
position: relative;
}
#swipebox-slider .slide .swipebox-video-container .swipebox-video iframe {
width: 100% !important;
height: 100% !important;
position: absolute;
top: 0;
left: 0;
}
#swipebox-slider .slide-loading {
background: url(../img/loader.gif) no-repeat center center;
}
#swipebox-bottom-bar,
#swipebox-top-bar {
-webkit-transition: 0.5s;
transition: 0.5s;
position: absolute;
left: 0;
z-index: 999;
height: 50px;
width: 100%;
}
#swipebox-bottom-bar {
bottom: -50px;
}
#swipebox-bottom-bar.visible-bars {
-webkit-transform: translate3d(0, -50px, 0);
transform: translate3d(0, -50px, 0);
}
#swipebox-top-bar {
top: -50px;
}
#swipebox-top-bar.visible-bars {
-webkit-transform: translate3d(0, 50px, 0);
transform: translate3d(0, 50px, 0);
}
#swipebox-title {
display: block;
width: 100%;
text-align: center;
}
#swipebox-prev,
#swipebox-next,
#swipebox-close {
background-image: url(../img/icons.png);
background-repeat: no-repeat;
border: none !important;
text-decoration: none !important;
cursor: pointer;
width: 50px;
height: 50px;
top: 0;
}
#swipebox-arrows {
display: block;
margin: 0 auto;
width: 100%;
height: 50px;
}
#swipebox-prev {
background-position: -32px 13px;
float: left;
}
#swipebox-next {
background-position: -78px 13px;
float: right;
}
#swipebox-close {
top: 0;
right: 0;
position: absolute;
z-index: 9999;
background-position: 15px 12px;
}
.swipebox-no-close-button #swipebox-close {
display: none;
}
#swipebox-prev.disabled,
#swipebox-next.disabled {
opacity: 0.3;
}
.swipebox-no-touch #swipebox-overlay.rightSpring #swipebox-slider {
-webkit-animation: rightSpring 0.3s;
animation: rightSpring 0.3s;
}
.swipebox-no-touch #swipebox-overlay.leftSpring #swipebox-slider {
-webkit-animation: leftSpring 0.3s;
animation: leftSpring 0.3s;
}
.swipebox-touch #swipebox-container:before, .swipebox-touch #swipebox-container:after {
-webkit-backface-visibility: hidden;
backface-visibility: hidden;
-webkit-transition: all .3s ease;
transition: all .3s ease;
content: ' ';
position: absolute;
z-index: 999;
top: 0;
height: 100%;
width: 20px;
opacity: 0;
}
.swipebox-touch #swipebox-container:before {
left: 0;
-webkit-box-shadow: inset 10px 0px 10px -8px #656565;
box-shadow: inset 10px 0px 10px -8px #656565;
}
.swipebox-touch #swipebox-container:after {
right: 0;
-webkit-box-shadow: inset -10px 0px 10px -8px #656565;
box-shadow: inset -10px 0px 10px -8px #656565;
}
.swipebox-touch #swipebox-overlay.leftSpringTouch #swipebox-container:before {
opacity: 1;
}
.swipebox-touch #swipebox-overlay.rightSpringTouch #swipebox-container:after {
opacity: 1;
}
@-webkit-keyframes rightSpring {
0% {
left: 0;
}
50% {
left: -30px;
}
100% {
left: 0;
}
}
@keyframes rightSpring {
0% {
left: 0;
}
50% {
left: -30px;
}
100% {
left: 0;
}
}
@-webkit-keyframes leftSpring {
0% {
left: 0;
}
50% {
left: 30px;
}
100% {
left: 0;
}
}
@keyframes leftSpring {
0% {
left: 0;
}
50% {
left: 30px;
}
100% {
left: 0;
}
}
@media screen and (min-width: 800px) {
#swipebox-close {
right: 10px;
}
#swipebox-arrows {
width: 92%;
max-width: 800px;
}
}
/* Skin
--------------------------*/
#swipebox-overlay {
background: #0d0d0d;
}
#swipebox-bottom-bar,
#swipebox-top-bar {
text-shadow: 1px 1px 1px black;
background: #000;
opacity: 0.95;
}
#swipebox-top-bar {
color: white !important;
font-size: 15px;
line-height: 43px;
font-family: Helvetica, Arial, sans-serif;
}

View file

@ -1 +0,0 @@
/*! Swipebox v1.3.0 | Constantin Saguin csag.co | MIT License | github.com/brutaldesign/swipebox */html.swipebox-html.swipebox-touch{overflow:hidden!important}#swipebox-overlay img{border:none!important}#swipebox-overlay{width:100%;height:100%;position:fixed;top:0;left:0;z-index:99999!important;overflow:hidden;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}#swipebox-container{position:relative;width:100%;height:100%}#swipebox-slider{-webkit-transition:-webkit-transform .4s ease;transition:transform .4s ease;height:100%;left:0;top:0;width:100%;white-space:nowrap;position:absolute;display:none;cursor:pointer}#swipebox-slider .slide{height:100%;width:100%;line-height:1px;text-align:center;display:inline-block}#swipebox-slider .slide:before{content:"";display:inline-block;height:50%;width:1px;margin-right:-1px}#swipebox-slider .slide .swipebox-inline-container,#swipebox-slider .slide .swipebox-video-container,#swipebox-slider .slide img{display:inline-block;max-height:100%;max-width:100%;margin:0;padding:0;width:auto;height:auto;vertical-align:middle}#swipebox-slider .slide .swipebox-video-container{background:0 0;max-width:1140px;max-height:100%;width:100%;padding:5%;-webkit-box-sizing:border-box;box-sizing:border-box}#swipebox-slider .slide .swipebox-video-container .swipebox-video{width:100%;height:0;padding-bottom:56.25%;overflow:hidden;position:relative}#swipebox-slider .slide .swipebox-video-container .swipebox-video iframe{width:100%!important;height:100%!important;position:absolute;top:0;left:0}#swipebox-slider .slide-loading{background:url(../img/loader.gif) center center no-repeat}#swipebox-bottom-bar,#swipebox-top-bar{-webkit-transition:.5s;transition:.5s;position:absolute;left:0;z-index:999;height:50px;width:100%}#swipebox-bottom-bar{bottom:-50px}#swipebox-bottom-bar.visible-bars{-webkit-transform:translate3d(0,-50px,0);transform:translate3d(0,-50px,0)}#swipebox-top-bar{top:-50px}#swipebox-top-bar.visible-bars{-webkit-transform:translate3d(0,50px,0);transform:translate3d(0,50px,0)}#swipebox-title{display:block;width:100%;text-align:center}#swipebox-close,#swipebox-next,#swipebox-prev{background-image:url(../img/icons.png);background-repeat:no-repeat;border:none!important;text-decoration:none!important;cursor:pointer;width:50px;height:50px;top:0}#swipebox-arrows{display:block;margin:0 auto;width:100%;height:50px}#swipebox-prev{background-position:-32px 13px;float:left}#swipebox-next{background-position:-78px 13px;float:right}#swipebox-close{top:0;right:0;position:absolute;z-index:9999;background-position:15px 12px}.swipebox-no-close-button #swipebox-close{display:none}#swipebox-next.disabled,#swipebox-prev.disabled{opacity:.3}.swipebox-no-touch #swipebox-overlay.rightSpring #swipebox-slider{-webkit-animation:rightSpring .3s;animation:rightSpring .3s}.swipebox-no-touch #swipebox-overlay.leftSpring #swipebox-slider{-webkit-animation:leftSpring .3s;animation:leftSpring .3s}.swipebox-touch #swipebox-container:after,.swipebox-touch #swipebox-container:before{-webkit-backface-visibility:hidden;backface-visibility:hidden;-webkit-transition:all .3s ease;transition:all .3s ease;content:' ';position:absolute;z-index:999;top:0;height:100%;width:20px;opacity:0}.swipebox-touch #swipebox-container:before{left:0;-webkit-box-shadow:inset 10px 0 10px -8px #656565;box-shadow:inset 10px 0 10px -8px #656565}.swipebox-touch #swipebox-container:after{right:0;-webkit-box-shadow:inset -10px 0 10px -8px #656565;box-shadow:inset -10px 0 10px -8px #656565}.swipebox-touch #swipebox-overlay.leftSpringTouch #swipebox-container:before,.swipebox-touch #swipebox-overlay.rightSpringTouch #swipebox-container:after{opacity:1}@-webkit-keyframes rightSpring{0%{left:0}50%{left:-30px}100%{left:0}}@keyframes rightSpring{0%{left:0}50%{left:-30px}100%{left:0}}@-webkit-keyframes leftSpring{0%{left:0}50%{left:30px}100%{left:0}}@keyframes leftSpring{0%{left:0}50%{left:30px}100%{left:0}}@media screen and (min-width:800px){#swipebox-close{right:10px}#swipebox-arrows{width:92%;max-width:800px}}#swipebox-overlay{background:#0d0d0d}#swipebox-bottom-bar,#swipebox-top-bar{text-shadow:1px 1px 1px #000;background:#000;opacity:.95}#swipebox-top-bar{color:#fff!important;font-size:15px;line-height:43px;font-family:Helvetica,Arial,sans-serif}

Binary file not shown.

Before

Width:  |  Height:  |  Size: 729 B

View file

@ -1 +0,0 @@
<?xml version="1.0" encoding="utf-8"?> <!-- Generator: IcoMoon.io --> <!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"> <svg width="120" height="24" viewBox="0 0 120 24" fill="#ffffff" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink"><path d="M 17.384,17.705q0.00,0.536 -0.375,0.911l-1.821,1.821q-0.375,0.375 -0.911,0.375t-0.911-0.375l-3.938-3.938l-3.938,3.938q-0.375,0.375 -0.911,0.375t-0.911-0.375l-1.821-1.821q-0.375-0.375 -0.375-0.911t 0.375-0.911l 3.938-3.938l-3.938-3.938q-0.375-0.375 -0.375-0.911t 0.375-0.911l 1.821-1.821q 0.375-0.375 0.911-0.375t 0.911,0.375l 3.938,3.938l 3.938-3.938q 0.375-0.375 0.911-0.375t 0.911,0.375l 1.821,1.821q 0.375,0.375 0.375,0.911 t-0.375,0.911l-3.938,3.938l 3.938,3.938q 0.375,0.375 0.375,0.911zM 57.938,21.067l-8.732-8.719q-0.496-0.496 -0.496-1.212t 0.496-1.212l 8.732-8.719q 0.496-0.496 1.212-0.496t 1.212,0.496l 1.004,1.004q 0.496,0.496 0.496,1.212t-0.496,1.212l-6.509,6.509l 6.509,6.496q 0.496,0.509 0.496,1.219t-0.496,1.205l-1.004,1.004q-0.496,0.496 -1.212,0.496t-1.212-0.496zM 110.719,11.143q0.00,0.696 -0.496,1.219l-8.732,8.719q-0.496,0.496 -1.205,0.496t-1.205-0.496l-1.018-1.004q-0.496-0.522 -0.496-1.219q0.00-0.71 0.496-1.205l 6.509-6.509l-6.509-6.496q-0.496-0.522 -0.496-1.219q0.00-0.71 0.496-1.205l 1.018-1.004q 0.482-0.509 1.205-0.509t 1.205,0.509l 8.732,8.719q 0.496,0.496 0.496,1.205z"></path></svg>

Before

Width:  |  Height:  |  Size: 1.4 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.5 KiB

View file

@ -1,950 +0,0 @@
/*! Swipebox v1.4.1 | Constantin Saguin csag.co | MIT License | github.com/brutaldesign/swipebox */
;( function ( window, document, $, undefined ) {
$.swipebox = function( elem, options ) {
// Default options
var ui,
defaults = {
useCSS : true,
useSVG : true,
initialIndexOnArray : 0,
removeBarsOnMobile : true,
hideCloseButtonOnMobile : false,
hideBarsDelay : 3000,
videoMaxWidth : 1140,
vimeoColor : 'cccccc',
beforeOpen: null,
afterOpen: null,
afterClose: null,
nextSlide: null,
prevSlide: null,
loopAtEnd: false,
autoplayVideos: false,
queryStringData: {},
toggleClassOnLoad: ''
},
plugin = this,
elements = [], // slides array [ { href:'...', title:'...' }, ...],
$elem,
selector = elem.selector,
$selector = $( selector ),
isMobile = navigator.userAgent.match( /(iPad)|(iPhone)|(iPod)|(Android)|(PlayBook)|(BB10)|(BlackBerry)|(Opera Mini)|(IEMobile)|(webOS)|(MeeGo)/i ),
isTouch = isMobile !== null || document.createTouch !== undefined || ( 'ontouchstart' in window ) || ( 'onmsgesturechange' in window ) || navigator.msMaxTouchPoints,
supportSVG = !! document.createElementNS && !! document.createElementNS( 'http://www.w3.org/2000/svg', 'svg').createSVGRect,
winWidth = window.innerWidth ? window.innerWidth : $( window ).width(),
winHeight = window.innerHeight ? window.innerHeight : $( window ).height(),
currentX = 0,
/* jshint multistr: true */
html = '<div id="swipebox-overlay">\
<div id="swipebox-container">\
<div id="swipebox-slider"></div>\
<div id="swipebox-top-bar">\
<div id="swipebox-title"></div>\
</div>\
<div id="swipebox-bottom-bar">\
<div id="swipebox-arrows">\
<a id="swipebox-prev"></a>\
<a id="swipebox-next"></a>\
</div>\
</div>\
<a id="swipebox-close"></a>\
</div>\
</div>';
plugin.settings = {};
$.swipebox.close = function () {
ui.closeSlide();
};
$.swipebox.extend = function () {
return ui;
};
plugin.init = function() {
plugin.settings = $.extend( {}, defaults, options );
if ( $.isArray( elem ) ) {
elements = elem;
ui.target = $( window );
ui.init( plugin.settings.initialIndexOnArray );
} else {
$( document ).on( 'click', selector, function( event ) {
// console.log( isTouch );
if ( event.target.parentNode.className === 'slide current' ) {
return false;
}
if ( ! $.isArray( elem ) ) {
ui.destroy();
$elem = $( selector );
ui.actions();
}
elements = [];
var index , relType, relVal;
// Allow for HTML5 compliant attribute before legacy use of rel
if ( ! relVal ) {
relType = 'data-rel';
relVal = $( this ).attr( relType );
}
if ( ! relVal ) {
relType = 'rel';
relVal = $( this ).attr( relType );
}
if ( relVal && relVal !== '' && relVal !== 'nofollow' ) {
$elem = $selector.filter( '[' + relType + '="' + relVal + '"]' );
} else {
$elem = $( selector );
}
$elem.each( function() {
var title = null,
href = null;
if ( $( this ).attr( 'title' ) ) {
title = $( this ).attr( 'title' );
}
if ( $( this ).attr( 'href' ) ) {
href = $( this ).attr( 'href' );
}
elements.push( {
href: href,
title: title
} );
} );
index = $elem.index( $( this ) );
event.preventDefault();
event.stopPropagation();
ui.target = $( event.target );
ui.init( index );
} );
}
};
ui = {
/**
* Initiate Swipebox
*/
init : function( index ) {
if ( plugin.settings.beforeOpen ) {
plugin.settings.beforeOpen();
}
this.target.trigger( 'swipebox-start' );
$.swipebox.isOpen = true;
this.build();
this.openSlide( index );
this.openMedia( index );
this.preloadMedia( index+1 );
this.preloadMedia( index-1 );
if ( plugin.settings.afterOpen ) {
plugin.settings.afterOpen();
}
},
/**
* Built HTML containers and fire main functions
*/
build : function () {
var $this = this, bg;
$( 'body' ).append( html );
if ( supportSVG && plugin.settings.useSVG === true ) {
bg = $( '#swipebox-close' ).css( 'background-image' );
bg = bg.replace( 'png', 'svg' );
$( '#swipebox-prev, #swipebox-next, #swipebox-close' ).css( {
'background-image' : bg
} );
}
if ( isMobile && plugin.settings.removeBarsOnMobile ) {
$( '#swipebox-bottom-bar, #swipebox-top-bar' ).remove();
}
$.each( elements, function() {
$( '#swipebox-slider' ).append( '<div class="slide"></div>' );
} );
$this.setDim();
$this.actions();
if ( isTouch ) {
$this.gesture();
}
// Devices can have both touch and keyboard input so always allow key events
$this.keyboard();
$this.animBars();
$this.resize();
},
/**
* Set dimensions depending on windows width and height
*/
setDim : function () {
var width, height, sliderCss = {};
// Reset dimensions on mobile orientation change
if ( 'onorientationchange' in window ) {
window.addEventListener( 'orientationchange', function() {
if ( window.orientation === 0 ) {
width = winWidth;
height = winHeight;
} else if ( window.orientation === 90 || window.orientation === -90 ) {
width = winHeight;
height = winWidth;
}
}, false );
} else {
width = window.innerWidth ? window.innerWidth : $( window ).width();
height = window.innerHeight ? window.innerHeight : $( window ).height();
}
sliderCss = {
width : width,
height : height
};
$( '#swipebox-overlay' ).css( sliderCss );
},
/**
* Reset dimensions on window resize envent
*/
resize : function () {
var $this = this;
$( window ).resize( function() {
$this.setDim();
} ).resize();
},
/**
* Check if device supports CSS transitions
*/
supportTransition : function () {
var prefixes = 'transition WebkitTransition MozTransition OTransition msTransition KhtmlTransition'.split( ' ' ),
i;
for ( i = 0; i < prefixes.length; i++ ) {
if ( document.createElement( 'div' ).style[ prefixes[i] ] !== undefined ) {
return prefixes[i];
}
}
return false;
},
/**
* Check if CSS transitions are allowed (options + devicesupport)
*/
doCssTrans : function () {
if ( plugin.settings.useCSS && this.supportTransition() ) {
return true;
}
},
/**
* Touch navigation
*/
gesture : function () {
var $this = this,
index,
hDistance,
vDistance,
hDistanceLast,
vDistanceLast,
hDistancePercent,
vSwipe = false,
hSwipe = false,
hSwipMinDistance = 10,
vSwipMinDistance = 50,
startCoords = {},
endCoords = {},
bars = $( '#swipebox-top-bar, #swipebox-bottom-bar' ),
slider = $( '#swipebox-slider' );
bars.addClass( 'visible-bars' );
$this.setTimeout();
$( 'body' ).bind( 'touchstart', function( event ) {
$( this ).addClass( 'touching' );
index = $( '#swipebox-slider .slide' ).index( $( '#swipebox-slider .slide.current' ) );
endCoords = event.originalEvent.targetTouches[0];
startCoords.pageX = event.originalEvent.targetTouches[0].pageX;
startCoords.pageY = event.originalEvent.targetTouches[0].pageY;
$( '#swipebox-slider' ).css( {
'-webkit-transform' : 'translate3d(' + currentX +'%, 0, 0)',
'transform' : 'translate3d(' + currentX + '%, 0, 0)'
} );
$( '.touching' ).bind( 'touchmove',function( event ) {
event.preventDefault();
event.stopPropagation();
endCoords = event.originalEvent.targetTouches[0];
if ( ! hSwipe ) {
vDistanceLast = vDistance;
vDistance = endCoords.pageY - startCoords.pageY;
if ( Math.abs( vDistance ) >= vSwipMinDistance || vSwipe ) {
var opacity = 0.75 - Math.abs(vDistance) / slider.height();
slider.css( { 'top': vDistance + 'px' } );
slider.css( { 'opacity': opacity } );
vSwipe = true;
}
}
hDistanceLast = hDistance;
hDistance = endCoords.pageX - startCoords.pageX;
hDistancePercent = hDistance * 100 / winWidth;
if ( ! hSwipe && ! vSwipe && Math.abs( hDistance ) >= hSwipMinDistance ) {
$( '#swipebox-slider' ).css( {
'-webkit-transition' : '',
'transition' : ''
} );
hSwipe = true;
}
if ( hSwipe ) {
// swipe left
if ( 0 < hDistance ) {
// first slide
if ( 0 === index ) {
// console.log( 'first' );
$( '#swipebox-overlay' ).addClass( 'leftSpringTouch' );
} else {
// Follow gesture
$( '#swipebox-overlay' ).removeClass( 'leftSpringTouch' ).removeClass( 'rightSpringTouch' );
$( '#swipebox-slider' ).css( {
'-webkit-transform' : 'translate3d(' + ( currentX + hDistancePercent ) +'%, 0, 0)',
'transform' : 'translate3d(' + ( currentX + hDistancePercent ) + '%, 0, 0)'
} );
}
// swipe rught
} else if ( 0 > hDistance ) {
// last Slide
if ( elements.length === index +1 ) {
// console.log( 'last' );
$( '#swipebox-overlay' ).addClass( 'rightSpringTouch' );
} else {
$( '#swipebox-overlay' ).removeClass( 'leftSpringTouch' ).removeClass( 'rightSpringTouch' );
$( '#swipebox-slider' ).css( {
'-webkit-transform' : 'translate3d(' + ( currentX + hDistancePercent ) +'%, 0, 0)',
'transform' : 'translate3d(' + ( currentX + hDistancePercent ) + '%, 0, 0)'
} );
}
}
}
} );
return false;
} ).bind( 'touchend',function( event ) {
event.preventDefault();
event.stopPropagation();
$( '#swipebox-slider' ).css( {
'-webkit-transition' : '-webkit-transform 0.4s ease',
'transition' : 'transform 0.4s ease'
} );
vDistance = endCoords.pageY - startCoords.pageY;
hDistance = endCoords.pageX - startCoords.pageX;
hDistancePercent = hDistance*100/winWidth;
// Swipe to bottom to close
if ( vSwipe ) {
vSwipe = false;
if ( Math.abs( vDistance ) >= 2 * vSwipMinDistance && Math.abs( vDistance ) > Math.abs( vDistanceLast ) ) {
var vOffset = vDistance > 0 ? slider.height() : - slider.height();
slider.animate( { top: vOffset + 'px', 'opacity': 0 },
300,
function () {
$this.closeSlide();
} );
} else {
slider.animate( { top: 0, 'opacity': 1 }, 300 );
}
} else if ( hSwipe ) {
hSwipe = false;
// swipeLeft
if( hDistance >= hSwipMinDistance && hDistance >= hDistanceLast) {
$this.getPrev();
// swipeRight
} else if ( hDistance <= -hSwipMinDistance && hDistance <= hDistanceLast) {
$this.getNext();
}
} else { // Top and bottom bars have been removed on touchable devices
// tap
if ( ! bars.hasClass( 'visible-bars' ) ) {
$this.showBars();
$this.setTimeout();
} else {
$this.clearTimeout();
$this.hideBars();
}
}
$( '#swipebox-slider' ).css( {
'-webkit-transform' : 'translate3d(' + currentX + '%, 0, 0)',
'transform' : 'translate3d(' + currentX + '%, 0, 0)'
} );
$( '#swipebox-overlay' ).removeClass( 'leftSpringTouch' ).removeClass( 'rightSpringTouch' );
$( '.touching' ).off( 'touchmove' ).removeClass( 'touching' );
} );
},
/**
* Set timer to hide the action bars
*/
setTimeout: function () {
if ( plugin.settings.hideBarsDelay > 0 ) {
var $this = this;
$this.clearTimeout();
$this.timeout = window.setTimeout( function() {
$this.hideBars();
},
plugin.settings.hideBarsDelay
);
}
},
/**
* Clear timer
*/
clearTimeout: function () {
window.clearTimeout( this.timeout );
this.timeout = null;
},
/**
* Show navigation and title bars
*/
showBars : function () {
var bars = $( '#swipebox-top-bar, #swipebox-bottom-bar' );
if ( this.doCssTrans() ) {
bars.addClass( 'visible-bars' );
} else {
$( '#swipebox-top-bar' ).animate( { top : 0 }, 500 );
$( '#swipebox-bottom-bar' ).animate( { bottom : 0 }, 500 );
setTimeout( function() {
bars.addClass( 'visible-bars' );
}, 1000 );
}
},
/**
* Hide navigation and title bars
*/
hideBars : function () {
var bars = $( '#swipebox-top-bar, #swipebox-bottom-bar' );
if ( this.doCssTrans() ) {
bars.removeClass( 'visible-bars' );
} else {
$( '#swipebox-top-bar' ).animate( { top : '-50px' }, 500 );
$( '#swipebox-bottom-bar' ).animate( { bottom : '-50px' }, 500 );
setTimeout( function() {
bars.removeClass( 'visible-bars' );
}, 1000 );
}
},
/**
* Animate navigation and top bars
*/
animBars : function () {
var $this = this,
bars = $( '#swipebox-top-bar, #swipebox-bottom-bar' );
bars.addClass( 'visible-bars' );
$this.setTimeout();
$( '#swipebox-slider' ).click( function() {
if ( ! bars.hasClass( 'visible-bars' ) ) {
$this.showBars();
$this.setTimeout();
}
} );
$( '#swipebox-bottom-bar' ).hover( function() {
$this.showBars();
bars.addClass( 'visible-bars' );
$this.clearTimeout();
}, function() {
if ( plugin.settings.hideBarsDelay > 0 ) {
bars.removeClass( 'visible-bars' );
$this.setTimeout();
}
} );
},
/**
* Keyboard navigation
*/
keyboard : function () {
var $this = this;
$( window ).bind( 'keyup', function( event ) {
event.preventDefault();
event.stopPropagation();
if ( event.keyCode === 37 ) {
$this.getPrev();
} else if ( event.keyCode === 39 ) {
$this.getNext();
} else if ( event.keyCode === 27 ) {
$this.closeSlide();
}
} );
},
/**
* Navigation events : go to next slide, go to prevous slide and close
*/
actions : function () {
var $this = this,
action = 'touchend click'; // Just detect for both event types to allow for multi-input
if ( elements.length < 2 ) {
$( '#swipebox-bottom-bar' ).hide();
if ( undefined === elements[ 1 ] ) {
$( '#swipebox-top-bar' ).hide();
}
} else {
$( '#swipebox-prev' ).bind( action, function( event ) {
event.preventDefault();
event.stopPropagation();
$this.getPrev();
$this.setTimeout();
} );
$( '#swipebox-next' ).bind( action, function( event ) {
event.preventDefault();
event.stopPropagation();
$this.getNext();
$this.setTimeout();
} );
}
$( '#swipebox-close' ).bind( action, function() {
$this.closeSlide();
} );
},
/**
* Set current slide
*/
setSlide : function ( index, isFirst ) {
isFirst = isFirst || false;
var slider = $( '#swipebox-slider' );
currentX = -index*100;
if ( this.doCssTrans() ) {
slider.css( {
'-webkit-transform' : 'translate3d(' + (-index*100)+'%, 0, 0)',
'transform' : 'translate3d(' + (-index*100)+'%, 0, 0)'
} );
} else {
slider.animate( { left : ( -index*100 )+'%' } );
}
$( '#swipebox-slider .slide' ).removeClass( 'current' );
$( '#swipebox-slider .slide' ).eq( index ).addClass( 'current' );
this.setTitle( index );
if ( isFirst ) {
slider.fadeIn();
}
$( '#swipebox-prev, #swipebox-next' ).removeClass( 'disabled' );
if ( index === 0 ) {
$( '#swipebox-prev' ).addClass( 'disabled' );
} else if ( index === elements.length - 1 && plugin.settings.loopAtEnd !== true ) {
$( '#swipebox-next' ).addClass( 'disabled' );
}
},
/**
* Open slide
*/
openSlide : function ( index ) {
$( 'html' ).addClass( 'swipebox-html' );
if ( isTouch ) {
$( 'html' ).addClass( 'swipebox-touch' );
if ( plugin.settings.hideCloseButtonOnMobile ) {
$( 'html' ).addClass( 'swipebox-no-close-button' );
}
} else {
$( 'html' ).addClass( 'swipebox-no-touch' );
}
$( window ).trigger( 'resize' ); // fix scroll bar visibility on desktop
this.setSlide( index, true );
},
/**
* Set a time out if the media is a video
*/
preloadMedia : function ( index ) {
var $this = this,
src = null;
if ( elements[ index ] !== undefined ) {
src = elements[ index ].href;
}
if ( ! $this.isVideo( src ) ) {
setTimeout( function() {
$this.openMedia( index );
}, 1000);
} else {
$this.openMedia( index );
}
},
/**
* Open
*/
openMedia : function ( index ) {
var $this = this,
src,
slide;
if ( elements[ index ] !== undefined ) {
src = elements[ index ].href;
}
if ( index < 0 || index >= elements.length ) {
return false;
}
slide = $( '#swipebox-slider .slide' ).eq( index );
if ( ! $this.isVideo( src ) ) {
slide.addClass( 'slide-loading' );
$this.loadMedia( src, function() {
slide.removeClass( 'slide-loading' );
slide.html( this );
} );
} else {
slide.html( $this.getVideo( src ) );
}
},
/**
* Set link title attribute as caption
*/
setTitle : function ( index ) {
var title = null;
$( '#swipebox-title' ).empty();
if ( elements[ index ] !== undefined ) {
title = elements[ index ].title;
}
if ( title ) {
$( '#swipebox-top-bar' ).show();
$( '#swipebox-title' ).append( title );
} else {
$( '#swipebox-top-bar' ).hide();
}
},
/**
* Check if the URL is a video
*/
isVideo : function ( src ) {
if ( src ) {
if ( src.match( /(youtube\.com|youtube-nocookie\.com)\/watch\?v=([a-zA-Z0-9\-_]+)/) || src.match( /vimeo\.com\/([0-9]*)/ ) || src.match( /youtu\.be\/([a-zA-Z0-9\-_]+)/ ) ) {
return true;
}
if ( src.toLowerCase().indexOf( 'swipeboxvideo=1' ) >= 0 ) {
return true;
}
}
},
/**
* Parse URI querystring and:
* - overrides value provided via dictionary
* - rebuild it again returning a string
*/
parseUri : function (uri, customData) {
var a = document.createElement('a'),
qs = {};
// Decode the URI
a.href = decodeURIComponent( uri );
// QueryString to Object
if ( a.search ) {
qs = JSON.parse( '{"' + a.search.toLowerCase().replace('?','').replace(/&/g,'","').replace(/=/g,'":"') + '"}' );
}
// Extend with custom data
if ( $.isPlainObject( customData ) ) {
qs = $.extend( qs, customData, plugin.settings.queryStringData ); // The dev has always the final word
}
// Return querystring as a string
return $
.map( qs, function (val, key) {
if ( val && val > '' ) {
return encodeURIComponent( key ) + '=' + encodeURIComponent( val );
}
})
.join('&');
},
/**
* Get video iframe code from URL
*/
getVideo : function( url ) {
var iframe = '',
youtubeUrl = url.match( /((?:www\.)?youtube\.com|(?:www\.)?youtube-nocookie\.com)\/watch\?v=([a-zA-Z0-9\-_]+)/ ),
youtubeShortUrl = url.match(/(?:www\.)?youtu\.be\/([a-zA-Z0-9\-_]+)/),
vimeoUrl = url.match( /(?:www\.)?vimeo\.com\/([0-9]*)/ ),
qs = '';
if ( youtubeUrl || youtubeShortUrl) {
if ( youtubeShortUrl ) {
youtubeUrl = youtubeShortUrl;
}
qs = ui.parseUri( url, {
'autoplay' : ( plugin.settings.autoplayVideos ? '1' : '0' ),
'v' : ''
});
iframe = '<iframe width="560" height="315" src="//' + youtubeUrl[1] + '/embed/' + youtubeUrl[2] + '?' + qs + '" frameborder="0" allowfullscreen></iframe>';
} else if ( vimeoUrl ) {
qs = ui.parseUri( url, {
'autoplay' : ( plugin.settings.autoplayVideos ? '1' : '0' ),
'byline' : '0',
'portrait' : '0',
'color': plugin.settings.vimeoColor
});
iframe = '<iframe width="560" height="315" src="//player.vimeo.com/video/' + vimeoUrl[1] + '?' + qs + '" frameborder="0" webkitAllowFullScreen mozallowfullscreen allowFullScreen></iframe>';
} else {
iframe = '<iframe width="560" height="315" src="' + url + '" frameborder="0" allowfullscreen></iframe>';
}
return '<div class="swipebox-video-container" style="max-width:' + plugin.settings.videoMaxWidth + 'px"><div class="swipebox-video">' + iframe + '</div></div>';
},
/**
* Load image
*/
loadMedia : function ( src, callback ) {
// Inline content
if ( src.trim().indexOf('#') === 0 ) {
callback.call(
$('<div>', {
'class' : 'swipebox-inline-container'
})
.append(
$(src)
.clone()
.toggleClass( plugin.settings.toggleClassOnLoad )
)
);
}
// Everything else
else {
if ( ! this.isVideo( src ) ) {
var img = $( '<img>' ).on( 'load', function() {
callback.call( img );
} );
img.attr( 'src', src );
}
}
},
/**
* Get next slide
*/
getNext : function () {
var $this = this,
src,
index = $( '#swipebox-slider .slide' ).index( $( '#swipebox-slider .slide.current' ) );
if ( index + 1 < elements.length ) {
src = $( '#swipebox-slider .slide' ).eq( index ).contents().find( 'iframe' ).attr( 'src' );
$( '#swipebox-slider .slide' ).eq( index ).contents().find( 'iframe' ).attr( 'src', src );
index++;
$this.setSlide( index );
$this.preloadMedia( index+1 );
if ( plugin.settings.nextSlide ) {
plugin.settings.nextSlide();
}
} else {
if ( plugin.settings.loopAtEnd === true ) {
src = $( '#swipebox-slider .slide' ).eq( index ).contents().find( 'iframe' ).attr( 'src' );
$( '#swipebox-slider .slide' ).eq( index ).contents().find( 'iframe' ).attr( 'src', src );
index = 0;
$this.preloadMedia( index );
$this.setSlide( index );
$this.preloadMedia( index + 1 );
if ( plugin.settings.nextSlide ) {
plugin.settings.nextSlide();
}
} else {
$( '#swipebox-overlay' ).addClass( 'rightSpring' );
setTimeout( function() {
$( '#swipebox-overlay' ).removeClass( 'rightSpring' );
}, 500 );
}
}
},
/**
* Get previous slide
*/
getPrev : function () {
var index = $( '#swipebox-slider .slide' ).index( $( '#swipebox-slider .slide.current' ) ),
src;
if ( index > 0 ) {
src = $( '#swipebox-slider .slide' ).eq( index ).contents().find( 'iframe').attr( 'src' );
$( '#swipebox-slider .slide' ).eq( index ).contents().find( 'iframe' ).attr( 'src', src );
index--;
this.setSlide( index );
this.preloadMedia( index-1 );
if ( plugin.settings.prevSlide ) {
plugin.settings.prevSlide();
}
} else {
$( '#swipebox-overlay' ).addClass( 'leftSpring' );
setTimeout( function() {
$( '#swipebox-overlay' ).removeClass( 'leftSpring' );
}, 500 );
}
},
nextSlide : function () {
// Callback for next slide
},
prevSlide : function () {
// Callback for prev slide
},
/**
* Close
*/
closeSlide : function () {
$( 'html' ).removeClass( 'swipebox-html' );
$( 'html' ).removeClass( 'swipebox-touch' );
$( window ).trigger( 'resize' );
this.destroy();
},
/**
* Destroy the whole thing
*/
destroy : function () {
$( window ).unbind( 'keyup' );
$( 'body' ).unbind( 'touchstart' );
$( 'body' ).unbind( 'touchmove' );
$( 'body' ).unbind( 'touchend' );
$( '#swipebox-slider' ).unbind();
$( '#swipebox-overlay' ).remove();
if ( ! $.isArray( elem ) ) {
elem.removeData( '_swipebox' );
}
if ( this.target ) {
this.target.trigger( 'swipebox-destroy' );
}
$.swipebox.isOpen = false;
if ( plugin.settings.afterClose ) {
plugin.settings.afterClose();
}
}
};
plugin.init();
};
$.fn.swipebox = function( options ) {
if ( ! $.data( this, '_swipebox' ) ) {
var swipebox = new $.swipebox( this, options );
this.data( '_swipebox', swipebox );
}
return this.data( '_swipebox' );
};
}( window, document, jQuery ) );

File diff suppressed because one or more lines are too long

View file

@ -1270,7 +1270,7 @@ $(document).on('pageshow', "#dashboardPage", DashboardPage.onPageShow).on('pageb
(function ($, document, window) { (function ($, document, window) {
var welcomeDismissValue = '11'; var welcomeDismissValue = '12';
var welcomeTourKey = 'welcomeTour'; var welcomeTourKey = 'welcomeTour';
function dismissWelcome(page, userId) { function dismissWelcome(page, userId) {
@ -1312,27 +1312,35 @@ $(document).on('pageshow', "#dashboardPage", DashboardPage.onPageShow).on('pageb
function takeTour(page, userId) { function takeTour(page, userId) {
require(['swipebox'], function () { require(['slideshow'], function () {
var slides = [
{ imageUrl: 'css/images/tour/dashboard/dashboard.png', title: Globalize.translate('DashboardTourDashboard') },
{ imageUrl: 'css/images/tour/dashboard/help.png', title: Globalize.translate('DashboardTourHelp') },
{ imageUrl: 'css/images/tour/dashboard/users.png', title: Globalize.translate('DashboardTourUsers') },
{ imageUrl: 'css/images/tour/dashboard/sync.png', title: Globalize.translate('DashboardTourSync') },
{ imageUrl: 'css/images/tour/dashboard/cinemamode.png', title: Globalize.translate('DashboardTourCinemaMode') },
{ imageUrl: 'css/images/tour/dashboard/chapters.png', title: Globalize.translate('DashboardTourChapters') },
{ imageUrl: 'css/images/tour/dashboard/subtitles.png', title: Globalize.translate('DashboardTourSubtitles') },
{ imageUrl: 'css/images/tour/dashboard/plugins.png', title: Globalize.translate('DashboardTourPlugins') },
{ imageUrl: 'css/images/tour/dashboard/notifications.png', title: Globalize.translate('DashboardTourNotifications') },
{ imageUrl: 'css/images/tour/dashboard/scheduledtasks.png', title: Globalize.translate('DashboardTourScheduledTasks') },
{ imageUrl: 'css/images/tour/dashboard/mobile.png', title: Globalize.translate('DashboardTourMobile') },
{ imageUrl: 'css/images/tour/enjoy.jpg', title: Globalize.translate('MessageEnjoyYourStay') }
];
require(['slideshow'], function (slideshow) {
var newSlideShow = new slideshow({
slides: slides,
interactive: true,
loop: false
});
newSlideShow.show();
$.swipebox([
{ href: 'css/images/tour/dashboard/dashboard.png', title: Globalize.translate('DashboardTourDashboard') },
{ href: 'css/images/tour/dashboard/help.png', title: Globalize.translate('DashboardTourHelp') },
{ href: 'css/images/tour/dashboard/users.png', title: Globalize.translate('DashboardTourUsers') },
{ href: 'css/images/tour/dashboard/sync.png', title: Globalize.translate('DashboardTourSync') },
{ href: 'css/images/tour/dashboard/cinemamode.png', title: Globalize.translate('DashboardTourCinemaMode') },
{ href: 'css/images/tour/dashboard/chapters.png', title: Globalize.translate('DashboardTourChapters') },
{ href: 'css/images/tour/dashboard/subtitles.png', title: Globalize.translate('DashboardTourSubtitles') },
{ href: 'css/images/tour/dashboard/plugins.png', title: Globalize.translate('DashboardTourPlugins') },
{ href: 'css/images/tour/dashboard/notifications.png', title: Globalize.translate('DashboardTourNotifications') },
{ href: 'css/images/tour/dashboard/scheduledtasks.png', title: Globalize.translate('DashboardTourScheduledTasks') },
{ href: 'css/images/tour/dashboard/mobile.png', title: Globalize.translate('DashboardTourMobile') },
{ href: 'css/images/tour/enjoy.jpg', title: Globalize.translate('MessageEnjoyYourStay') }
], {
afterClose: function () {
dismissWelcome(page, userId); dismissWelcome(page, userId);
$('.welcomeMessage', page).hide(); $('.welcomeMessage', page).hide();
},
hideBarsDelay: 30000
}); });
}); });
} }

View file

@ -166,30 +166,38 @@
function takeTour(page, userId) { function takeTour(page, userId) {
require(['swipebox'], function () { require(['slideshow'], function () {
var slides = [
{ imageUrl: 'css/images/tour/web/tourcontent.jpg', title: Globalize.translate('WebClientTourContent') },
{ imageUrl: 'css/images/tour/web/tourmovies.jpg', title: Globalize.translate('WebClientTourMovies') },
{ imageUrl: 'css/images/tour/web/tourmouseover.jpg', title: Globalize.translate('WebClientTourMouseOver') },
{ imageUrl: 'css/images/tour/web/tourtaphold.jpg', title: Globalize.translate('WebClientTourTapHold') },
{ imageUrl: 'css/images/tour/web/tourmysync.png', title: Globalize.translate('WebClientTourMySync') },
{ imageUrl: 'css/images/tour/web/toureditor.png', title: Globalize.translate('WebClientTourMetadataManager') },
{ imageUrl: 'css/images/tour/web/tourplaylist.png', title: Globalize.translate('WebClientTourPlaylists') },
{ imageUrl: 'css/images/tour/web/tourcollections.jpg', title: Globalize.translate('WebClientTourCollections') },
{ imageUrl: 'css/images/tour/web/tourusersettings1.png', title: Globalize.translate('WebClientTourUserPreferences1') },
{ imageUrl: 'css/images/tour/web/tourusersettings2.png', title: Globalize.translate('WebClientTourUserPreferences2') },
{ imageUrl: 'css/images/tour/web/tourusersettings3.png', title: Globalize.translate('WebClientTourUserPreferences3') },
{ imageUrl: 'css/images/tour/web/tourusersettings4.png', title: Globalize.translate('WebClientTourUserPreferences4') },
{ imageUrl: 'css/images/tour/web/tourmobile1.jpg', title: Globalize.translate('WebClientTourMobile1') },
{ imageUrl: 'css/images/tour/web/tourmobile2.png', title: Globalize.translate('WebClientTourMobile2') },
{ imageUrl: 'css/images/tour/enjoy.jpg', title: Globalize.translate('MessageEnjoyYourStay') }
];
require(['slideshow'], function (slideshow) {
var newSlideShow = new slideshow({
slides: slides,
interactive: true,
loop: false
});
newSlideShow.show();
$.swipebox([
{ href: 'css/images/tour/web/tourcontent.jpg', title: Globalize.translate('WebClientTourContent') },
{ href: 'css/images/tour/web/tourmovies.jpg', title: Globalize.translate('WebClientTourMovies') },
{ href: 'css/images/tour/web/tourmouseover.jpg', title: Globalize.translate('WebClientTourMouseOver') },
{ href: 'css/images/tour/web/tourtaphold.jpg', title: Globalize.translate('WebClientTourTapHold') },
{ href: 'css/images/tour/web/tourmysync.png', title: Globalize.translate('WebClientTourMySync') },
{ href: 'css/images/tour/web/toureditor.png', title: Globalize.translate('WebClientTourMetadataManager') },
{ href: 'css/images/tour/web/tourplaylist.png', title: Globalize.translate('WebClientTourPlaylists') },
{ href: 'css/images/tour/web/tourcollections.jpg', title: Globalize.translate('WebClientTourCollections') },
{ href: 'css/images/tour/web/tourusersettings1.png', title: Globalize.translate('WebClientTourUserPreferences1') },
{ href: 'css/images/tour/web/tourusersettings2.png', title: Globalize.translate('WebClientTourUserPreferences2') },
{ href: 'css/images/tour/web/tourusersettings3.png', title: Globalize.translate('WebClientTourUserPreferences3') },
{ href: 'css/images/tour/web/tourusersettings4.png', title: Globalize.translate('WebClientTourUserPreferences4') },
{ href: 'css/images/tour/web/tourmobile1.jpg', title: Globalize.translate('WebClientTourMobile1') },
{ href: 'css/images/tour/web/tourmobile2.png', title: Globalize.translate('WebClientTourMobile2') },
{ href: 'css/images/tour/enjoy.jpg', title: Globalize.translate('MessageEnjoyYourStay') }
], {
afterClose: function () {
dismissWelcome(page, userId); dismissWelcome(page, userId);
$('.welcomeMessage', page).hide(); $('.welcomeMessage', page).hide();
},
hideBarsDelay: 30000
}); });
}); });
} }

View file

@ -125,26 +125,6 @@
function showSlideshow(page, items, startItemId) { function showSlideshow(page, items, startItemId) {
var screenWidth = $(window).width();
var screenHeight = $(window).height();
var slideshowItems = items.map(function (item) {
var imgUrl = ApiClient.getScaledImageUrl(item.Id, {
tag: item.ImageTags.Primary,
type: 'Primary',
maxWidth: screenWidth,
maxHeight: screenHeight
});
return {
title: item.Name,
href: imgUrl
};
});
var index = items.map(function (i) { var index = items.map(function (i) {
return i.Id; return i.Id;
@ -154,12 +134,18 @@
index = 0; index = 0;
} }
require(['swipebox'], function () { require(['slideshow'], function (slideshow) {
$.swipebox(slideshowItems, { var newSlideShow = new slideshow({
initialIndexOnArray: index, showTitle: false,
hideBarsDelay: 30000 cover: false,
items: items,
startIndex: index,
interval: 7000,
interactive: true
}); });
newSlideShow.show();
}); });
} }

View file

@ -1974,7 +1974,8 @@ var AppInfo = {};
define("jqmpanel", ["thirdparty/jquerymobile-1.4.5/jqm.panel", 'css!thirdparty/jquerymobile-1.4.5/jqm.panel.css']); define("jqmpanel", ["thirdparty/jquerymobile-1.4.5/jqm.panel", 'css!thirdparty/jquerymobile-1.4.5/jqm.panel.css']);
define("swipebox", [bowerPath + '/swipebox/src/js/jquery.swipebox.min', "css!" + bowerPath + "/swipebox/src/css/swipebox.min.css"]); define("iron-icon-set", ["html!" + bowerPath + "/iron-icon/iron-icon.html", "html!" + bowerPath + "/iron-iconset-svg/iron-iconset-svg.html"]);
define("slideshow", [embyWebComponentsBowerPath + "/slideshow/slideshow"], returnFirstDependency);
define('fetch', [bowerPath + '/fetch/fetch']); define('fetch', [bowerPath + '/fetch/fetch']);
define('webcomponentsjs', [bowerPath + '/webcomponentsjs/webcomponents-lite.min.js']); define('webcomponentsjs', [bowerPath + '/webcomponentsjs/webcomponents-lite.min.js']);
@ -2003,6 +2004,8 @@ var AppInfo = {};
define("offlineusersync", [apiClientBowerPath + "/sync/offlineusersync"]); define("offlineusersync", [apiClientBowerPath + "/sync/offlineusersync"]);
define("mediasync", [apiClientBowerPath + "/sync/mediasync"]); define("mediasync", [apiClientBowerPath + "/sync/mediasync"]);
define("swiper", [bowerPath + "/Swiper/dist/js/swiper.min", "css!" + bowerPath + "/Swiper/dist/css/swiper.min"], returnFirstDependency);
define("paperdialoghelper", [embyWebComponentsBowerPath + "/paperdialoghelper/paperdialoghelper"], returnFirstDependency); define("paperdialoghelper", [embyWebComponentsBowerPath + "/paperdialoghelper/paperdialoghelper"], returnFirstDependency);
// alias // alias
@ -2015,6 +2018,20 @@ var AppInfo = {};
} }
}; };
}); });
// mock this for now. not used in this app
define("inputManager", [], function () {
return {
on: function () {
},
off: function () {
}
};
});
define("connectionManager", [], function () {
return ConnectionManager;
});
} }
function init(hostingAppInfo) { function init(hostingAppInfo) {