var Spry; if (!Spry) Spry = {}; Spry.forwards = 1; // const Spry.backwards = 2; // const if (!Spry.Effect) Spry.Effect = {}; Spry.Effect.Transitions = { linearTransition: function(time, begin, change, duration) { if (time > duration) return change+begin; return begin + (time / duration) * change; }, sinusoidalTransition: function(time, begin, change, duration) { if (time > duration) return change+begin; return begin + ((-Math.cos((time/duration)*Math.PI)/2) + 0.5) * change; }, squareTransition: function(time, begin, change, duration) { if (time > duration) return change+begin; return begin + Math.pow(time/duration, 2) * change; }, squarerootTransition: function(time, begin, change, duration) { if (time > duration) return change+begin; return begin + Math.sqrt(time/duration) * change; }, fifthTransition: function(time, begin, change, duration) { if (time > duration) return change+begin; return begin + Math.sqrt((-Math.cos((time/duration)*Math.PI)/2) + 0.5) * change; }, circleTransition: function(time, begin, change, duration) { if (time > duration) return change+begin; var pos = time/duration; return begin + Math.sqrt(1 - Math.pow((pos-1), 2))* change; }, pulsateTransition: function(time, begin, change, duration) { if (time > duration) return change+begin; return begin + (0.5 + Math.sin(17*time/duration)/2) * change; }, growSpecificTransition: function(time, begin, change, duration) { if (time > duration) return change+begin; var pos = time/duration; return begin + (5 * Math.pow(pos, 3) - 6.4 * Math.pow(pos, 2) + 2 * pos) * change; } }; for (var trans in Spry.Effect.Transitions) { Spry[trans] = Spry.Effect.Transitions[trans]; } ////////////////////////////////////////////////////////////////////// // // Spry.Effect.Registry // ////////////////////////////////////////////////////////////////////// Spry.Effect.Registry = function() { this.effects = []; }; Spry.Effect.Registry.prototype.getRegisteredEffect = function(element, options) { var a = {}; a.element = Spry.Effect.getElement(element); a.options = options; for (var i=0; i0) { if(isFirstEntry) { camelizedString = oStringList[i]; isFirstEntry = false; } else { var s = oStringList[i]; camelizedString += s.charAt(0).toUpperCase() + s.substring(1); } } } return camelizedString; }; Spry.Effect.Utils.isPercentValue = function(value) { var result = false; if (typeof value == 'string' && value.length > 0 && value.lastIndexOf("%") > 0) result = true; return result; }; Spry.Effect.Utils.getPercentValue = function(value) { var result = 0; try { result = Number(value.substring(0, value.lastIndexOf("%"))); } catch (e) {Spry.Effect.Utils.showError('Spry.Effect.Utils.getPercentValue: ' + e);} return result; }; Spry.Effect.Utils.getPixelValue = function(value) { var result = 0; if (typeof value == 'number') return value; var unitIndex = value.lastIndexOf("px"); if ( unitIndex == -1) unitIndex = value.length; try { result = parseInt(value.substring(0, unitIndex), 10); } catch (e){} return result; }; Spry.Effect.Utils.getFirstChildElement = function(node) { if (node) { var childCurr = node.firstChild; while (childCurr) { if (childCurr.nodeType == 1) // Node.ELEMENT_NODE return childCurr; childCurr = childCurr.nextSibling; } } return null; }; Spry.Effect.Utils.fetchChildImages = function(startEltIn, targetImagesOut) { if(!startEltIn || startEltIn.nodeType != 1 || !targetImagesOut) return; if(startEltIn.hasChildNodes()) { var childImages = startEltIn.getElementsByTagName('img'); var imageCnt = childImages.length; for(var i=0; i