ltsecurityinc安防产品在线商城代码
This commit is contained in:
+657
@@ -0,0 +1,657 @@
|
||||
// Variables
|
||||
@athlete-slideshow__main-color: #ffe51e;
|
||||
@athlete-slideshow__transition: all 200ms ease;
|
||||
@athlete-slideshow__transition-long: all 600ms ease-in-out;
|
||||
@tiny-font: Arial, sans-serif;
|
||||
//
|
||||
// Common
|
||||
//____________________________________________________
|
||||
|
||||
& when (@media-common = true) {
|
||||
.athlete-slideshow {
|
||||
display:none;
|
||||
overflow: hidden;
|
||||
position: relative;
|
||||
z-index: 1;
|
||||
.slide{
|
||||
display: none;
|
||||
width:100%;
|
||||
height:100%;
|
||||
/* in case script does not load */
|
||||
&.first {
|
||||
display: block;
|
||||
}
|
||||
.container{
|
||||
height:100%;
|
||||
}
|
||||
.slide-img {
|
||||
position: absolute;
|
||||
z-index: 1;
|
||||
width: 100%;
|
||||
}
|
||||
.slide-content-container {
|
||||
position: relative;
|
||||
z-index: 2;
|
||||
width: 98%;
|
||||
margin: 0 auto;
|
||||
padding: 0;
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
align-items: center;
|
||||
height: 100%;
|
||||
}
|
||||
.controls-title {
|
||||
position: relative;
|
||||
float: left;
|
||||
margin: 0;
|
||||
}
|
||||
.controls {
|
||||
position: relative;
|
||||
float: left;
|
||||
margin: 0;
|
||||
.slide-control {
|
||||
.lib-css(transition, @athlete-slideshow__transition, @_prefix: 1);
|
||||
opacity: 0;
|
||||
filter:alpha(opacity=0);
|
||||
width:60px;
|
||||
height: 52px;
|
||||
z-index: 800;
|
||||
overflow: hidden;
|
||||
cursor: pointer;
|
||||
background:#000;
|
||||
&:after{
|
||||
content: '';
|
||||
display: block;
|
||||
background: @athlete-slideshow__main-color;
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
transform: scaleY(0);
|
||||
}
|
||||
span{
|
||||
position:absolute;
|
||||
z-index:2;
|
||||
&:after,
|
||||
&:before{
|
||||
content: '';
|
||||
display: block;
|
||||
width: 20px;
|
||||
height: 2px;
|
||||
position: absolute;
|
||||
background: #fff;
|
||||
}
|
||||
}
|
||||
&:hover{
|
||||
span{
|
||||
&:after,
|
||||
&:before{
|
||||
background: #000;
|
||||
}
|
||||
}
|
||||
}
|
||||
&.slide-prev {
|
||||
span{
|
||||
&:before{
|
||||
transform: rotate(-45deg);
|
||||
top: 24px;
|
||||
left: 13px;
|
||||
}
|
||||
&:after{
|
||||
transform: rotate(45deg);
|
||||
top: 24px;
|
||||
left: 27px;
|
||||
}
|
||||
}
|
||||
&:after {
|
||||
transform-origin: top;
|
||||
animation: arrow-out 200ms;
|
||||
}
|
||||
}
|
||||
&.slide-next {
|
||||
span{
|
||||
&:before{
|
||||
transform: rotate(45deg);
|
||||
top: 27px;
|
||||
left: 13px;
|
||||
}
|
||||
&:after{
|
||||
transform: rotate(-45deg);
|
||||
top: 27px;
|
||||
left: 27px;
|
||||
}
|
||||
}
|
||||
&:after {
|
||||
transform-origin: bottom;
|
||||
animation: arrow-out 200ms;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.progress {
|
||||
position: absolute;
|
||||
right: 0;
|
||||
height: 10px;
|
||||
width: 0;
|
||||
background: @athlete-slideshow__main-color;
|
||||
border-radius: 0;
|
||||
}
|
||||
}
|
||||
.disabled {
|
||||
background-color:#999;
|
||||
}
|
||||
.slide-banners{
|
||||
margin-left: auto;
|
||||
}
|
||||
.slide-banner {
|
||||
display: block;
|
||||
margin: 0 -10px 18px;
|
||||
opacity: 0;
|
||||
filter:alpha(opacity=0);
|
||||
&:last-child {
|
||||
margin-bottom: 0;
|
||||
}
|
||||
img {
|
||||
.lib-css(transition, @athlete-slideshow__transition, @_prefix: 1);
|
||||
display: block;
|
||||
float: right;
|
||||
margin-left: 15px;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
.no-touch {
|
||||
.slide-title {
|
||||
.link{
|
||||
&:hover {
|
||||
color: #ffffff;
|
||||
background-color: #000000;
|
||||
span{
|
||||
transform: translateX(4px);
|
||||
&:before,
|
||||
&:after{
|
||||
background: #ffffff;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
.athlete-slideshow {
|
||||
.slide{
|
||||
.controls{
|
||||
.slide-control{
|
||||
&:hover{
|
||||
&:after{
|
||||
transform: scaleY(1);
|
||||
}
|
||||
}
|
||||
}
|
||||
.slide-prev{
|
||||
&:hover:after {
|
||||
transform-origin: bottom;
|
||||
animation: arrow-over 200ms;
|
||||
}
|
||||
}
|
||||
.slide-next{
|
||||
&:hover:after {
|
||||
transform-origin: top;
|
||||
animation: arrow-over 200ms;
|
||||
}
|
||||
}
|
||||
.disabled:hover {
|
||||
background-color:#999;
|
||||
}
|
||||
}
|
||||
.slide-banner{
|
||||
&:hover {
|
||||
img {
|
||||
margin:0 15px 0 0;
|
||||
opacity: 0.9;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.pseudo-arrow(@width; @height; @top; @left; @deg; @bg){
|
||||
content: '';
|
||||
display: block;
|
||||
position: absolute;
|
||||
width: @width;
|
||||
height: @height;
|
||||
background: @bg;
|
||||
transform: rotate(@deg);
|
||||
top: @top;
|
||||
left: @left;
|
||||
}
|
||||
|
||||
.slide-title {
|
||||
float: left;
|
||||
margin: 0;
|
||||
/*
|
||||
position: absolute;
|
||||
left: 60px;
|
||||
*/
|
||||
z-index: 1;
|
||||
display: none;
|
||||
br {
|
||||
clear:both;
|
||||
height:0;
|
||||
line-height: 0;
|
||||
font-size: 0;
|
||||
}
|
||||
.text {
|
||||
position: relative;
|
||||
display: inline-block;
|
||||
overflow: hidden;
|
||||
white-space: nowrap;
|
||||
line-height:48px;
|
||||
padding:1px 12px 3px 6px;
|
||||
margin: 0;
|
||||
color:#fff;
|
||||
background-color: #000000;
|
||||
font-size:48px;
|
||||
font-weight:900;
|
||||
text-transform:uppercase;
|
||||
letter-spacing: -0.03em;
|
||||
&:first-child {
|
||||
margin-top: 0;
|
||||
}
|
||||
}
|
||||
.link {
|
||||
position: relative;
|
||||
display: inline-block;
|
||||
overflow: hidden;
|
||||
white-space: nowrap;
|
||||
line-height: 35px;
|
||||
margin: 0;
|
||||
padding:0 51px 0 11px;
|
||||
color:#000;
|
||||
background-color: @athlete-slideshow__main-color;
|
||||
font-size:16px;
|
||||
font-weight:700;
|
||||
text-transform:uppercase;
|
||||
text-decoration: none;
|
||||
letter-spacing: -0.03em;
|
||||
span {
|
||||
.lib-css(transition, @athlete-slideshow__transition-long, @_prefix: 1);
|
||||
display: block;
|
||||
position: absolute;
|
||||
top: 0;
|
||||
right: 0;
|
||||
overflow: hidden;
|
||||
width:25px;
|
||||
height: 35px;
|
||||
&:after{
|
||||
.pseudo-arrow(10px; 3px; 13px; 1px; 45deg; #000);
|
||||
}
|
||||
&:before{
|
||||
.pseudo-arrow(10px; 3px; 19px; 1px; -45deg; #000);
|
||||
}
|
||||
}
|
||||
&:hover{
|
||||
span{
|
||||
.lib-css(transition, @athlete-slideshow__transition, @_prefix: 1);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
.slide-title--reset(){
|
||||
content: '';
|
||||
position: absolute;
|
||||
left: 0;
|
||||
top: 0;
|
||||
width: 0;
|
||||
height: 100%;
|
||||
z-index: -1;
|
||||
}
|
||||
|
||||
.slide-title {
|
||||
.animation-wrapper {
|
||||
position: relative;
|
||||
z-index: 3;
|
||||
overflow: hidden;
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
&:first-child {
|
||||
margin-top: 0;
|
||||
}
|
||||
}
|
||||
.animation-link {
|
||||
margin-top: 0
|
||||
}
|
||||
|
||||
.slide-title {
|
||||
.text{
|
||||
&:after {
|
||||
.slide-title--reset();
|
||||
}
|
||||
}
|
||||
}
|
||||
.text{
|
||||
&:before {
|
||||
.slide-title--reset();
|
||||
width: 100%
|
||||
}
|
||||
}
|
||||
.animate-me {
|
||||
.text{
|
||||
&:after {
|
||||
width: 100%;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
/* loading */
|
||||
.cycle-loading {
|
||||
box-sizing: border-box;
|
||||
width: 80px;
|
||||
height: 30px;
|
||||
content:url('../Olegnax_Athlete2Slideshow/images/preloader.svg');
|
||||
}
|
||||
|
||||
/* pager */
|
||||
.cycle-pager {
|
||||
text-align: center;
|
||||
width: 100%;
|
||||
z-index: 500;
|
||||
position: absolute;
|
||||
top: 10px;
|
||||
overflow: hidden;
|
||||
> * {
|
||||
cursor: pointer;
|
||||
}
|
||||
span {
|
||||
font-family: @tiny-font;
|
||||
font-size: 50px;
|
||||
width: 16px;
|
||||
height: 16px;
|
||||
display: inline-block;
|
||||
color: #ddd;
|
||||
cursor: pointer;
|
||||
&.cycle-pager-active {
|
||||
color: #D69746;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/* caption */
|
||||
.cycle-caption {
|
||||
position: absolute;
|
||||
color: white;
|
||||
bottom: 15px;
|
||||
right: 15px;
|
||||
z-index: 700;
|
||||
}
|
||||
|
||||
/* overlay */
|
||||
.cycle-overlay {
|
||||
font-family: tahoma, Arial, sans-serif;
|
||||
position: absolute;
|
||||
bottom: 0;
|
||||
width: 100%;
|
||||
z-index: 600;
|
||||
background: black;
|
||||
color: white;
|
||||
padding: 15px;
|
||||
opacity: .5;
|
||||
}
|
||||
/* prev / next links */
|
||||
.cycle-prev,
|
||||
.cycle-next {
|
||||
position: absolute;
|
||||
top: 0;
|
||||
width: 30%;
|
||||
opacity: 0;
|
||||
filter: alpha(opacity=0);
|
||||
z-index: 800;
|
||||
height: 100%;
|
||||
cursor: pointer;
|
||||
&:hover{
|
||||
opacity: .7;
|
||||
filter: alpha(opacity=70);
|
||||
}
|
||||
}
|
||||
.cycle-prev {
|
||||
left: 0;
|
||||
}
|
||||
.cycle-next {
|
||||
right: 0;
|
||||
}
|
||||
}
|
||||
|
||||
@keyframes arrow-over {
|
||||
from {
|
||||
transform:scaleY(0);
|
||||
}
|
||||
to {
|
||||
transform:scaleY(1);
|
||||
}
|
||||
}
|
||||
@keyframes arrow-out {
|
||||
from {
|
||||
transform:scaleY(1);
|
||||
}
|
||||
to {
|
||||
transform:scaleY(0);
|
||||
}
|
||||
}
|
||||
|
||||
@media only screen and (max-width: 1023px) {
|
||||
.athlete-slideshow {
|
||||
.slide {
|
||||
.controls {
|
||||
.slide-control {
|
||||
width:51px;
|
||||
height: 44px;
|
||||
span{
|
||||
&:after,
|
||||
&:before{
|
||||
width: 17px;
|
||||
}
|
||||
}
|
||||
&.slide-prev {
|
||||
span{
|
||||
&:before{
|
||||
top: 21px;
|
||||
left: 12px;
|
||||
}
|
||||
&:after{
|
||||
top: 21px;
|
||||
left: 23px;
|
||||
}
|
||||
}
|
||||
}
|
||||
&.slide-next {
|
||||
span{
|
||||
&:before{
|
||||
top: 21px;
|
||||
left: 12px;
|
||||
}
|
||||
&:after{
|
||||
top: 21px;
|
||||
left: 23px;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
.slide-title {
|
||||
/*left: 51px; */
|
||||
.text {
|
||||
line-height: 40px;
|
||||
font-size: 40px;
|
||||
}
|
||||
}
|
||||
}
|
||||
@media only screen and (max-width: 767px) {
|
||||
.hide-below-768 { display: none; }
|
||||
.show-below-768 { display: block; }
|
||||
.athlete-slideshow .slide {
|
||||
.slide-content-container{
|
||||
flex-wrap: wrap;
|
||||
flex-flow: column;
|
||||
}
|
||||
.controls {
|
||||
.slide-control {
|
||||
width:39px;
|
||||
height: 34px;
|
||||
span{
|
||||
&:after,
|
||||
&:before{
|
||||
width: 13px;
|
||||
}
|
||||
}
|
||||
&.slide-prev {
|
||||
span{
|
||||
&:before{
|
||||
top: 16px;
|
||||
left: 9px;
|
||||
}
|
||||
&:after{
|
||||
top: 16px;
|
||||
left: 18px;
|
||||
}
|
||||
}
|
||||
}
|
||||
&.slide-next {
|
||||
span{
|
||||
&:before{
|
||||
top: 16px;
|
||||
left: 9px;
|
||||
}
|
||||
&:after{
|
||||
top: 16px;
|
||||
left: 18px;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
.controls-title {
|
||||
float: none;
|
||||
width: 426px;
|
||||
margin: 0 auto;
|
||||
}
|
||||
.slide-banners {
|
||||
float: none;
|
||||
margin: 0 auto;
|
||||
text-align: center;
|
||||
}
|
||||
.slide-banner {
|
||||
display: inline-block;
|
||||
margin: 5px;
|
||||
img {
|
||||
display: inline-block;
|
||||
max-width: 100%;
|
||||
height: auto;
|
||||
float: none;
|
||||
margin: 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
.no-touch .athlete-slideshow .slide .slide-banner:hover img {
|
||||
margin: 0;
|
||||
opacity: 1
|
||||
}
|
||||
.slide-title {
|
||||
/*left: 39px; */
|
||||
.text {
|
||||
line-height: 30px;
|
||||
font-size: 30px;
|
||||
}
|
||||
.link {
|
||||
line-height: 26px;
|
||||
font-size: 12px;
|
||||
padding: 0 41px 0 7px;
|
||||
span {
|
||||
width:19px;
|
||||
height: 26px;
|
||||
&:before{
|
||||
top: 14px;
|
||||
width: 7px;
|
||||
height: 2px;
|
||||
}
|
||||
&:after{
|
||||
width: 7px;
|
||||
height: 2px;
|
||||
top: 10px;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@media only screen and (max-width: 479px) {
|
||||
.athlete-slideshow .slide {
|
||||
.controls-title {
|
||||
width: 300px
|
||||
}
|
||||
.controls {
|
||||
.slide-control {
|
||||
width:33px;
|
||||
height: 28px;
|
||||
span{
|
||||
&:after,
|
||||
&:before{
|
||||
width: 11px;
|
||||
}
|
||||
}
|
||||
&.slide-prev {
|
||||
span{
|
||||
&:before{
|
||||
top: 13px;
|
||||
left: 8px;
|
||||
}
|
||||
&:after{
|
||||
top: 13px;
|
||||
left: 15px;
|
||||
}
|
||||
}
|
||||
}
|
||||
&.slide-next {
|
||||
span{
|
||||
&:before{
|
||||
top: 13px;
|
||||
left: 8px;
|
||||
}
|
||||
&:after{
|
||||
top: 13px;
|
||||
left: 15px;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
.slide-title {
|
||||
/*left: 33px; */
|
||||
.text {
|
||||
line-height: 24px;
|
||||
font-size: 24px;
|
||||
}
|
||||
.link {
|
||||
line-height: 20px;
|
||||
font-size: 11px;
|
||||
padding: 0 31px 0 5px;
|
||||
span {
|
||||
width:14px;
|
||||
height: 20px;
|
||||
&:before{
|
||||
top: 10px;
|
||||
width: 6px;
|
||||
}
|
||||
&:after{
|
||||
width: 6px;
|
||||
top: 7px;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,56 @@
|
||||
<svg id="athlete_preloader" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 80 30">
|
||||
<defs>
|
||||
<style type="text/css"><![CDATA[
|
||||
@keyframes athlete_preloader {
|
||||
0%{
|
||||
transform-origin:left;
|
||||
transform: scale(0, 1);
|
||||
}
|
||||
70% {
|
||||
transform-origin:left;
|
||||
transform: scale(1, 1);
|
||||
}
|
||||
70.01% {
|
||||
transform-origin:right;
|
||||
transform: scale(1, 1);
|
||||
}
|
||||
100% {
|
||||
transform-origin:right;
|
||||
transform: scale(0, 1);
|
||||
}
|
||||
}
|
||||
@-webkit-keyframes athlete_preloader {
|
||||
0%{
|
||||
-webkit-transform-origin:left;
|
||||
-webkit-transform: scale(0, 1);
|
||||
transform-origin:left;
|
||||
transform: scale(0, 1);
|
||||
}
|
||||
70% {
|
||||
-webkit-transform-origin:left;
|
||||
-webkit-transform: scale(1, 1);
|
||||
transform-origin:left;
|
||||
transform: scale(1, 1);
|
||||
}
|
||||
70.01% {
|
||||
-webkit-transform-origin:right;
|
||||
-webkit-transform: scale(1, 1);
|
||||
transform-origin:right;
|
||||
transform: scale(1, 1);
|
||||
}
|
||||
100% {
|
||||
-webkit-transform-origin:right;
|
||||
-webkit-transform: scale(0, 1);
|
||||
transform-origin:right;
|
||||
transform: scale(0, 1);
|
||||
}
|
||||
}
|
||||
.athlete_preloader_fill{
|
||||
transform-origin:left;
|
||||
animation: athlete_preloader 3s infinite;
|
||||
}
|
||||
]]></style>
|
||||
</defs>
|
||||
<path d="M0,0V30H80V0H0ZM76,26H4V4H76V26Z"/>
|
||||
<rect width="80" height="30" class="athlete_preloader_fill"/>
|
||||
</svg>
|
||||
|
After Width: | Height: | Size: 1.4 KiB |
Binary file not shown.
|
After Width: | Height: | Size: 43 B |
+14
@@ -0,0 +1,14 @@
|
||||
/*! Copyright 2012, Ben Lin (http://dreamerslab.com/)
|
||||
* Licensed under the MIT License (LICENSE.txt).
|
||||
*
|
||||
* Version: 1.0.19
|
||||
*
|
||||
* Requires: jQuery >= 1.2.3
|
||||
*/
|
||||
(function(a){if(typeof define==="function"&&define.amd){define(["jquery"],a);
|
||||
}else{a(jQuery);}}(function(a){a.fn.addBack=a.fn.addBack||a.fn.andSelf;a.fn.extend({actual:function(b,l){if(!this[b]){throw'$.actual => The jQuery method "'+b+'" you called does not exist';
|
||||
}var f={absolute:false,clone:false,includeMargin:false,display:"block"};var i=a.extend(f,l);var e=this.eq(0);var h,j;if(i.clone===true){h=function(){var m="position: absolute !important; top: -1000 !important; ";
|
||||
e=e.clone().attr("style",m).appendTo("body");};j=function(){e.remove();};}else{var g=[];var d="";var c;h=function(){c=e.parents().addBack().filter(":hidden");
|
||||
d+="visibility: hidden !important; display: "+i.display+" !important; ";if(i.absolute===true){d+="position: absolute !important; ";}c.each(function(){var m=a(this);
|
||||
var n=m.attr("style");g.push(n);m.attr("style",n?n+";"+d:d);});};j=function(){c.each(function(m){var o=a(this);var n=g[m];if(n===undefined){o.removeAttr("style");
|
||||
}else{o.attr("style",n);}});};}h();var k=/(outer)/.test(b)?e[b](i.includeMargin):e[b]();j();return k;}});}));
|
||||
+184
File diff suppressed because one or more lines are too long
@@ -0,0 +1,338 @@
|
||||
require([
|
||||
'jquery',
|
||||
'matchMedia',
|
||||
'jquery-ui-modules/effect',
|
||||
'jquery.actual',
|
||||
'jquery.cycle2',
|
||||
], function ($) {
|
||||
'use strict';
|
||||
|
||||
$(function () {
|
||||
|
||||
var debounce = function (func, wait, immediate) {
|
||||
var timeout, args, context, timestamp, result;
|
||||
return function () {
|
||||
context = this;
|
||||
args = arguments;
|
||||
timestamp = new Date();
|
||||
var later = function () {
|
||||
var last = (new Date()) - timestamp;
|
||||
if (last < wait) {
|
||||
timeout = setTimeout(later, wait - last);
|
||||
} else {
|
||||
timeout = null;
|
||||
if (!immediate)
|
||||
result = func.apply(context, args);
|
||||
}
|
||||
};
|
||||
var callNow = immediate && !timeout;
|
||||
if (!timeout) {
|
||||
timeout = setTimeout(later, wait);
|
||||
}
|
||||
if (callNow)
|
||||
result = func.apply(context, args);
|
||||
return result;
|
||||
};
|
||||
};
|
||||
|
||||
var _height = function (o) {
|
||||
return $(o).actual('height') + parseInt($(o).css('padding-top')) + parseInt($(o).css('padding-bottom'));
|
||||
};
|
||||
if (typeof ATHLETE_SLIDESHOW === 'undefined') {
|
||||
return;
|
||||
}
|
||||
|
||||
var slideshow = $('#athlete-slideshow').hide(),
|
||||
slideshowInit = false,
|
||||
slideMaxHeight = 0,
|
||||
content_padding = 20;
|
||||
|
||||
var getMaxSlideHeight = function (w) {
|
||||
slideMaxHeight = 0;
|
||||
//reset padding
|
||||
/*$('.slide-content-container', slideshow).css({'padding': content_padding + 'px 0'});
|
||||
$('.controls-title', slideshow).css({'margin-top': 0});
|
||||
$('.slide-banners', slideshow).css({'margin-top': 0, 'padding-top': 0});*/
|
||||
|
||||
$(slideshow).find(".slide").each(function () {
|
||||
/*var slide_img_height = $('.slide-img', this).height() || 0;*/
|
||||
if (window.matchMedia('(max-width: 767px)').matches && $('.slide-banners', this).children().length) {
|
||||
$('.slide-banners', this).css({'padding-top': Math.round(content_padding * 2) + 'px'});
|
||||
} else {
|
||||
$('.slide-banners', this).css({'padding-top': ''});
|
||||
}
|
||||
var slide_content_height = _height($('.slide-content-container', this));
|
||||
var slide_img_height = $('.slide-img', this).attr('data-height') || 0;
|
||||
var slide_title = $('.controls-title', this).height();
|
||||
if (window.matchMedia('(max-width: 767px)').matches) {
|
||||
slide_img_height = Math.ceil(w * slide_img_height / $(slideshow).attr('data-width'));
|
||||
$('.slide-img', this).css({'background-size': 'cover'});
|
||||
if (slide_img_height) {
|
||||
//v-align title over the image, move banners under the image
|
||||
if ((slide_title + content_padding * 2) < slide_img_height) {
|
||||
$('.controls-title', this).css({'margin': Math.round((slide_img_height - slide_title) / 2 - content_padding) + 'px auto'});
|
||||
}
|
||||
}
|
||||
} else {
|
||||
$('.slide-img', this).css({'background-size': 'auto'});
|
||||
}
|
||||
$('.slide-img', this).css({'height': (slide_img_height) + 'px'});
|
||||
|
||||
var height = Math.max(slide_content_height, slide_img_height);
|
||||
if (height > slideMaxHeight)
|
||||
slideMaxHeight = height;
|
||||
});
|
||||
};
|
||||
|
||||
var initSlideTitle = function (slide) {
|
||||
$('.controls-title, .slide-title .text, .slide-title .link', slide).removeAttr('style');
|
||||
$('.slide-title .text, .slide-title .link', slide).each(function () {
|
||||
$(this).attr('style', $(this).attr('data-style'));
|
||||
});
|
||||
$('.animation-wrapper', slide).removeAttr('style').css({visibility: 'hidden'}).attr({'data-width': '', 'data-height': ''});
|
||||
|
||||
$('.slide-title', slide).show();
|
||||
$('.slide-title .text, .slide-title .link', slide).each(function () {
|
||||
var w = $(this).actual('outerWidth'),
|
||||
h = $(this).actual('outerHeight');
|
||||
|
||||
$(this).width($(this).actual('width', {absolute: true}));
|
||||
|
||||
$(this).parent()
|
||||
.attr('data-width', w)
|
||||
.attr('data-height', h)
|
||||
.width(0)
|
||||
.height(h)
|
||||
});
|
||||
|
||||
$('.controls-title', slide).height($('.controls', slide).actual('height'));
|
||||
if ($('.slide-title', slide).actual('height') > $('.controls', slide).actual('height')) {
|
||||
$('.controls-title', slide).height($('.slide-title', slide).actual('height'));
|
||||
}
|
||||
};
|
||||
|
||||
var slideAnimationShow = function (slide) {
|
||||
var delayTime = 100;
|
||||
|
||||
//prev / next
|
||||
$('.slide-prev', slide).css('margin-top', '-10px').animate({opacity: 1, marginTop: 0}, 256, 'easeOutExpo');
|
||||
$('.slide-next', slide).css('margin-top', '20px').animate({opacity: 1, marginTop: 0}, 256, 'easeOutExpo', function () {
|
||||
});
|
||||
|
||||
//title and link
|
||||
$('.animation-wrapper', slide)
|
||||
.css({visibility: 'visible', width: '0px'})
|
||||
.each(function (i) {
|
||||
$(this)
|
||||
.delay(delayTime * (i))
|
||||
.queue(function (next) {
|
||||
$(this).animate({width: $(this).attr('data-width')}, 600, 'easeOutExpo');
|
||||
next();
|
||||
});
|
||||
});
|
||||
|
||||
//banners
|
||||
$('.slide-banner', slide).each(function (i) {
|
||||
$(this)
|
||||
.delay(256 * (i))
|
||||
.queue(function (next) {
|
||||
$(this)
|
||||
.animate({opacity: 1, marginRight: 0}, 100, 'easeInExpo');
|
||||
next();
|
||||
});
|
||||
});
|
||||
|
||||
};
|
||||
|
||||
var slideAnimationHide = function (slide) {
|
||||
var delayTime = 64;
|
||||
|
||||
//prev / next
|
||||
$('.slide-prev', slide).animate({opacity: 0, marginTop: '-10px'}, 64, 'easeOutExpo');
|
||||
$('.slide-next', slide).animate({opacity: 0, marginTop: '10px'}, 64, 'easeOutExpo');
|
||||
|
||||
//title and link
|
||||
$('.animation-wrapper', slide).each(function (i) {
|
||||
$(this)
|
||||
.delay(delayTime * (i))
|
||||
.queue(function (next) {
|
||||
$(this).animate({width: 0}, 128, 'easeOutExpo');
|
||||
next();
|
||||
});
|
||||
});
|
||||
|
||||
//banners
|
||||
$('.slide-banner', slide).each(function (i) {
|
||||
$(this)
|
||||
.delay(100 * (i))
|
||||
.queue(function (next) {
|
||||
$(this)
|
||||
.animate({opacity: 0, marginRight: '-10px'}, 100, 'easeOutExpo');
|
||||
next();
|
||||
});
|
||||
});
|
||||
|
||||
};
|
||||
|
||||
var slideContentHide = function (slide) {
|
||||
//prev / next
|
||||
$('.slide-prev', slide).css({opacity: 0, marginTop: '-10px'});
|
||||
$('.slide-next', slide).css({opacity: 0, marginTop: '10px'});
|
||||
|
||||
//title and link
|
||||
$('.animation-wrapper', slide).css({width: 0});
|
||||
|
||||
//banners
|
||||
$('.slide-banner', slide).css({opacity: 0, marginRight: '-10px'});
|
||||
|
||||
};
|
||||
|
||||
////////////////////////////////////////////////////////
|
||||
//slide animation
|
||||
slideshow.on('cycle-initialized', function (e, opts) {
|
||||
slideshowInit = true;
|
||||
slideAnimationShow(opts.slides.get(opts.currSlide));
|
||||
});
|
||||
|
||||
slideshow.on('cycle-before', function (e, opts) {
|
||||
slideAnimationHide(opts.slides.get(opts.currSlide));
|
||||
});
|
||||
|
||||
slideshow.on('cycle-after', function (e, opts) {
|
||||
slideAnimationShow(opts.slides.get(opts.nextSlide));
|
||||
});
|
||||
////////////////////////////////////////////////////////
|
||||
|
||||
////////////////////////////////////////////////////////
|
||||
//progress bar
|
||||
var first_run = true;
|
||||
slideshow.on('cycle-initialized cycle-before', function (e, opts) {
|
||||
if (!ATHLETE_SLIDESHOW.timeout)
|
||||
return;
|
||||
var progress = $('.progress', opts.slides.get(opts.currSlide));
|
||||
$(progress).stop(true).css('width', 0);
|
||||
});
|
||||
|
||||
slideshow.on('cycle-initialized cycle-after', function (e, opts) {
|
||||
if (!ATHLETE_SLIDESHOW.timeout)
|
||||
return;
|
||||
if (!slideshow.is('.cycle-paused')) {
|
||||
if (first_run) {
|
||||
var progress = $('.progress', opts.slides.get(opts.currSlide));
|
||||
$(progress).css('width', 0).animate({width: '100%'}, opts.timeout, 'linear');
|
||||
first_run = false;
|
||||
} else {
|
||||
var progress = $('.progress', opts.slides.get(opts.nextSlide));
|
||||
$(progress).css('width', 0).animate({width: '100%'}, opts.timeout, 'linear');
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
slideshow.on('cycle-paused', function (e, opts) {
|
||||
if (!ATHLETE_SLIDESHOW.timeout)
|
||||
return;
|
||||
var progress = $('.progress', opts.slides.get(opts.currSlide));
|
||||
$(progress).stop();
|
||||
});
|
||||
|
||||
slideshow.on('cycle-resumed', function (e, opts, timeoutRemaining) {
|
||||
if (!ATHLETE_SLIDESHOW.timeout)
|
||||
return;
|
||||
var progress = $('.progress', opts.slides.get(opts.currSlide));
|
||||
$(progress).animate({width: '100%'}, timeoutRemaining, 'linear');
|
||||
});
|
||||
////////////////////////////////////////////////////////
|
||||
|
||||
|
||||
////////////////////////////////////////////////////////
|
||||
// scale
|
||||
|
||||
$(window).resize(function () {
|
||||
if (!slideshowInit)
|
||||
return;
|
||||
slideContentHide($(slideshow).data("cycle.opts").slides.get($(slideshow).data("cycle.opts").currSlide));
|
||||
$(slideshow).cycle('pause');
|
||||
});
|
||||
|
||||
var scaleSlideshow = function () {
|
||||
|
||||
$(slideshow).find(".slide").each(function () {
|
||||
initSlideTitle(this);
|
||||
});
|
||||
|
||||
var w = jQuery('.page-wrapper .page-main').first().width();
|
||||
getMaxSlideHeight(w);
|
||||
|
||||
$(slideshow).find(".slide").each(function () {
|
||||
|
||||
var slide_img_height = $('.slide-img', this).height() || 0;
|
||||
var slide_title = $('.controls-title', this).height();
|
||||
var slide_content_height = $('.slide-content-container', this).actual('height');
|
||||
|
||||
if (w < 768) {
|
||||
if (slide_img_height) {
|
||||
if ((slide_title + content_padding * 2) < slide_img_height) {
|
||||
$('.controls-title', this).css('margin', Math.round((slide_img_height - slide_title) / 2 - content_padding) + 'px auto');
|
||||
}
|
||||
} else if (ATHLETE_SLIDESHOW.autoHeight != 'container') {
|
||||
if ((slide_content_height + content_padding * 2) < slideMaxHeight) {
|
||||
$('.slide-content-container', this).css('padding-top', Math.round((slideMaxHeight - slide_content_height) / 2));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
});
|
||||
|
||||
if (!slideshowInit)
|
||||
return;
|
||||
|
||||
var currSlide = $(slideshow).data("cycle.opts").slides.get($(slideshow).data("cycle.opts").currSlide);
|
||||
|
||||
if (ATHLETE_SLIDESHOW.autoHeight != 'container') {
|
||||
slideshow.animate({height: slideMaxHeight + 'px'}, 600, 'easeOutExpo', function () {
|
||||
slideAnimationShow(currSlide);
|
||||
$(slideshow).cycle('resume');
|
||||
});
|
||||
} else {
|
||||
slideshow.animate({height: $(currSlide).height() + 'px'}, 600, 'easeOutExpo', function () {
|
||||
slideAnimationShow(currSlide);
|
||||
$(slideshow).cycle('resume');
|
||||
});
|
||||
}
|
||||
};
|
||||
////////////////////////////////////////////////////////
|
||||
|
||||
////////////////////////////////////////////////////////
|
||||
// init
|
||||
|
||||
//$( window ).on( "load", function () {
|
||||
setTimeout(function () {
|
||||
|
||||
$('.slide-title .text, .slide-title .link', slideshow).each(function () {
|
||||
$(this).attr('data-style', $(this).attr('style'));
|
||||
});
|
||||
|
||||
$('.slide-title .text', slideshow).wrap('<div class="animation-wrapper animation-text" />');
|
||||
$('.slide-title .link', slideshow).wrap('<div class="animation-wrapper animation-link" />');
|
||||
$('.slide-title br', slideshow).hide();
|
||||
|
||||
scaleSlideshow();
|
||||
$(window).resize(debounce(scaleSlideshow, 200));
|
||||
|
||||
slideshow
|
||||
.css('height', '0px')
|
||||
.show()
|
||||
.stop()
|
||||
.animate(
|
||||
{height: slideMaxHeight + 'px'},
|
||||
1000,
|
||||
'easeOutExpo',
|
||||
function () {
|
||||
slideshow.cycle(ATHLETE_SLIDESHOW);
|
||||
}
|
||||
);
|
||||
}, 1000);
|
||||
//} );
|
||||
|
||||
});
|
||||
});
|
||||
Reference in New Issue
Block a user