This commit is contained in:
2018-09-12 00:03:10 +02:00
parent 3aa753eaaa
commit a9abf33996
70 changed files with 23431 additions and 0 deletions

41
js/form.js Normal file
View File

@ -0,0 +1,41 @@
function _(id){
return document.getElementById(id);
}
function submitForm(){
_("contact-submit").disabled = true;
_("status").innerHTML = 'Envoi en cours ...';
var formdata = new FormData();
formdata.append("name", _("name").value);
formdata.append("email", _("email").value);
formdata.append("subject", _("subject").value);
formdata.append("message", _("message").value);
/*
$.ajax({
url: "/contact",
data: formdata,
success: function(data){
console.log('Mail ! ');
console.log(data);
}
});*/
var ajax = new XMLHttpRequest();
ajax.open("POST", "/contact");
ajax.onreadystatechange = function(){
if(ajax.readyState == 4 && ajax.status == 200){
if(ajax.responseText == "success"){
_("contact-form").innerHTML = '<h2>Merci ' + _("name").value + ', votre message à bien été envoyé.</h2>';
}else{
alert(ajax.status);
alert(ajax.responseText);
_("status").innerHTML = ajax.responseText;
_("contact-submit").disabled = false;
}
}
}
ajax.send(formdata);
}

3894
js/libs/bootstrap.js vendored Normal file

File diff suppressed because it is too large Load Diff

7
js/libs/bootstrap.min.js vendored Normal file

File diff suppressed because one or more lines are too long

12
js/libs/isotope.pkgd.min.js vendored Normal file

File diff suppressed because one or more lines are too long

4
js/libs/jquery-3.1.0.min.js vendored Normal file

File diff suppressed because one or more lines are too long

File diff suppressed because it is too large Load Diff

2
js/libs/jquery.min.js vendored Normal file

File diff suppressed because one or more lines are too long

1
js/libs/jscrollreveal.min.js vendored Normal file

File diff suppressed because one or more lines are too long

7
js/libs/owl.carousel.min.js vendored Normal file

File diff suppressed because one or more lines are too long

45
js/libs/particles-conf.js Normal file
View File

@ -0,0 +1,45 @@
particlesJS("particles-js", {
"particles": {
"number": {"value": 120, "density": {"enable": true, "value_area": 800}},
"color": {"value": "#454545"},
"shape": {
"type": "circle",
"stroke": {"width": 0, "color": "#000000"},
"polygon": {"nb_sides": 5},
"image": {"src": "img/github.svg", "width": 100, "height": 100}
},
"opacity": {
"value": 0.5,
"random": false,
"anim": {"enable": false, "speed": 1, "opacity_min": 0.1, "sync": false}
},
"size": {"value": 3, "random": true, "anim": {"enable": false, "speed": 40, "size_min": 0.1, "sync": false}},
"line_linked": {"enable": true, "distance": 150, "color": "#ffffff", "opacity": 0.4, "width": 1},
"move": {
"enable": true,
"speed": 6,
"direction": "none",
"random": false,
"straight": false,
"out_mode": "out",
"bounce": false,
"attract": {"enable": false, "rotateX": 600, "rotateY": 1200}
}
},
"interactivity": {
"detect_on": "canvas",
"events": {
"onhover": {"enable": true, "mode": "repulse"},
"onclick": {"enable": true, "mode": "push"},
"resize": true
},
"modes": {
"grab": {"distance": 400, "line_linked": {"opacity": 1}},
"bubble": {"distance": 400, "size": 40, "duration": 2, "opacity": 8, "speed": 3},
"repulse": {"distance": 200, "duration": 0.4},
"push": {"particles_nb": 4},
"remove": {"particles_nb": 2}
}
},
"retina_detect": true
});

9
js/libs/particles.js Normal file

File diff suppressed because one or more lines are too long

9
js/libs/particles.min.js vendored Normal file

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -0,0 +1,2 @@
/*! ScrollMagic v2.0.5 | (c) 2015 Jan Paepke (@janpaepke) | license & info: http://scrollmagic.io */
!function(e,n){"function"==typeof define&&define.amd?define(["ScrollMagic","TweenMax","TimelineMax"],n):"object"==typeof exports?(require("gsap"),n(require("scrollmagic"),TweenMax,TimelineMax)):n(e.ScrollMagic||e.jQuery&&e.jQuery.ScrollMagic,e.TweenMax||e.TweenLite,e.TimelineMax||e.TimelineLite)}(this,function(e,n,r){"use strict";e.Scene.addOption("tweenChanges",!1,function(e){return!!e}),e.Scene.extend(function(){var e,t=this;t.on("progress.plugin_gsap",function(){i()}),t.on("destroy.plugin_gsap",function(e){t.removeTween(e.reset)});var i=function(){if(e){var n=t.progress(),r=t.state();e.repeat&&-1===e.repeat()?"DURING"===r&&e.paused()?e.play():"DURING"===r||e.paused()||e.pause():n!=e.progress()&&(0===t.duration()?n>0?e.play():e.reverse():t.tweenChanges()&&e.tweenTo?e.tweenTo(n*e.duration()):e.progress(n).pause())}};t.setTween=function(o,a,s){var u;arguments.length>1&&(arguments.length<3&&(s=a,a=1),o=n.to(o,a,s));try{u=r?new r({smoothChildTiming:!0}).add(o):o,u.pause()}catch(p){return t}return e&&t.removeTween(),e=u,o.repeat&&-1===o.repeat()&&(e.repeat(-1),e.yoyo(o.yoyo())),i(),t},t.removeTween=function(n){return e&&(n&&e.progress(0).pause(),e.kill(),e=void 0),t}})});

View File

@ -0,0 +1,2 @@
/*! ScrollMagic v2.0.5 | (c) 2015 Jan Paepke (@janpaepke) | license & info: http://scrollmagic.io */
!function(e,i){"function"==typeof define&&define.amd?define(["ScrollMagic","velocity"],i):"object"==typeof exports?i(require("scrollmagic"),require("velocity")):i(e.ScrollMagic||e.jQuery&&e.jQuery.ScrollMagic,e.Velocity||e.jQuery&&e.jQuery.Velocity)}(this,function(e,i){"use strict";var t="animation.velocity",o=0;e.Scene.extend(function(){var r,u,n,c,l=this,s=e._util,a=0;l.on("progress.plugin_velocity",function(){v()}),l.on("destroy.plugin_velocity",function(e){l.off("*.plugin_velocity"),l.removeVelocity(e.reset)});var f=function(e,t,o){s.type.Array(e)?e.forEach(function(e){f(e,t,o)}):(i.Utilities.data(e,c)||i.Utilities.data(e,c,{reverseProps:s.css(e,Object.keys(u))}),i(e,t,o),void 0!==o.queue&&i.Utilities.dequeue(e,o.queue))},y=function(e,t){if(s.type.Array(e))e.forEach(function(e){y(e,t)});else{var o=i.Utilities.data(e,c);o&&o.reverseProps&&(i(e,o.reverseProps,t),void 0!==t.queue&&i.Utilities.dequeue(e,t.queue))}},v=function(){if(r){var e=l.progress();e!=a&&(0===l.duration()&&(e>0?f(r,u,n):y(r,n)),a=e)}};l.setVelocity=function(e,i,a){return r&&l.removeVelocity(),r=s.get.elements(e),u=i||{},n=a||{},c="ScrollMagic."+t+"["+o++ +"]",void 0!==n.queue&&(n.queue=c+"_queue"),v(),l},l.removeVelocity=function(e){return r&&(void 0!==n.queue&&i(r,"stop",n.queue),e&&y(r,{duration:0}),r.forEach(function(e){i.Utilities.removeData(e,c)}),r=u=n=c=void 0),l}})});

File diff suppressed because one or more lines are too long

View File

@ -0,0 +1,2 @@
/*! ScrollMagic v2.0.5 | (c) 2015 Jan Paepke (@janpaepke) | license & info: http://scrollmagic.io */
!function(e,i){"function"==typeof define&&define.amd?define(["ScrollMagic","jquery"],i):"object"==typeof exports?i(require("scrollmagic"),require("jquery")):i(e.ScrollMagic,e.jQuery)}(this,function(e,i){"use strict";e._util.get.elements=function(e){return i(e).toArray()},e._util.addClass=function(e,t){i(e).addClass(t)},e._util.removeClass=function(e,t){i(e).removeClass(t)},i.ScrollMagic=e});

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,310 @@
/*!
* ScrollMagic v2.0.5 (2015-04-29)
* The javascript library for magical scroll interactions.
* (c) 2015 Jan Paepke (@janpaepke)
* Project Website: http://scrollmagic.io
*
* @version 2.0.5
* @license Dual licensed under MIT license and GPL.
* @author Jan Paepke - e-mail@janpaepke.de
*
* @file ScrollMagic GSAP Animation Plugin.
*
* requires: GSAP ~1.14
* Powered by the Greensock Animation Platform (GSAP): http://www.greensock.com/js
* Greensock License info at http://www.greensock.com/licensing/
*/
/**
* This plugin is meant to be used in conjunction with the Greensock Animation Plattform.
* It offers an easy API to trigger Tweens or synchronize them to the scrollbar movement.
*
* Both the `lite` and the `max` versions of the GSAP library are supported.
* The most basic requirement is `TweenLite`.
*
* To have access to this extension, please include `plugins/animation.gsap.js`.
* @requires {@link http://greensock.com/gsap|GSAP ~1.14.x}
* @mixin animation.GSAP
*/
(function (root, factory) {
if (typeof define === 'function' && define.amd) {
// AMD. Register as an anonymous module.
define(['ScrollMagic', 'TweenMax', 'TimelineMax'], factory);
} else if (typeof exports === 'object') {
// CommonJS
// Loads whole gsap package onto global scope.
require('gsap');
factory(require('scrollmagic'), TweenMax, TimelineMax);
} else {
// Browser globals
factory(root.ScrollMagic || (root.jQuery && root.jQuery.ScrollMagic), root.TweenMax || root.TweenLite, root.TimelineMax || root.TimelineLite);
}
}(this, function (ScrollMagic, Tween, Timeline) {
"use strict";
var NAMESPACE = "animation.gsap";
var
console = window.console || {},
err = Function.prototype.bind.call(console.error || console.log ||
function () {}, console);
if (!ScrollMagic) {
err("(" + NAMESPACE + ") -> ERROR: The ScrollMagic main module could not be found. Please make sure it's loaded before this plugin or use an asynchronous loader like requirejs.");
}
if (!Tween) {
err("(" + NAMESPACE + ") -> ERROR: TweenLite or TweenMax could not be found. Please make sure GSAP is loaded before ScrollMagic or use an asynchronous loader like requirejs.");
}
/*
* ----------------------------------------------------------------
* Extensions for Scene
* ----------------------------------------------------------------
*/
/**
* Every instance of ScrollMagic.Scene now accepts an additional option.
* See {@link ScrollMagic.Scene} for a complete list of the standard options.
* @memberof! animation.GSAP#
* @method new ScrollMagic.Scene(options)
* @example
* var scene = new ScrollMagic.Scene({tweenChanges: true});
*
* @param {object} [options] - Options for the Scene. The options can be updated at any time.
* @param {boolean} [options.tweenChanges=false] - Tweens Animation to the progress target instead of setting it.
Does not affect animations where duration is `0`.
*/
/**
* **Get** or **Set** the tweenChanges option value.
* This only affects scenes with a duration. If `tweenChanges` is `true`, the progress update when scrolling will not be immediate, but instead the animation will smoothly animate to the target state.
* For a better understanding, try enabling and disabling this option in the [Scene Manipulation Example](../examples/basic/scene_manipulation.html).
* @memberof! animation.GSAP#
* @method Scene.tweenChanges
*
* @example
* // get the current tweenChanges option
* var tweenChanges = scene.tweenChanges();
*
* // set new tweenChanges option
* scene.tweenChanges(true);
*
* @fires {@link Scene.change}, when used as setter
* @param {boolean} [newTweenChanges] - The new tweenChanges setting of the scene.
* @returns {boolean} `get` - Current tweenChanges option value.
* @returns {Scene} `set` - Parent object for chaining.
*/
// add option (TODO: DOC (private for dev))
ScrollMagic.Scene.addOption("tweenChanges", // name
false, // default
function (val) { // validation callback
return !!val;
});
// extend scene
ScrollMagic.Scene.extend(function () {
var Scene = this,
_tween;
var log = function () {
if (Scene._log) { // not available, when main source minified
Array.prototype.splice.call(arguments, 1, 0, "(" + NAMESPACE + ")", "->");
Scene._log.apply(this, arguments);
}
};
// set listeners
Scene.on("progress.plugin_gsap", function () {
updateTweenProgress();
});
Scene.on("destroy.plugin_gsap", function (e) {
Scene.removeTween(e.reset);
});
/**
* Update the tween progress to current position.
* @private
*/
var updateTweenProgress = function () {
if (_tween) {
var
progress = Scene.progress(),
state = Scene.state();
if (_tween.repeat && _tween.repeat() === -1) {
// infinite loop, so not in relation to progress
if (state === 'DURING' && _tween.paused()) {
_tween.play();
} else if (state !== 'DURING' && !_tween.paused()) {
_tween.pause();
}
} else if (progress != _tween.progress()) { // do we even need to update the progress?
// no infinite loop - so should we just play or go to a specific point in time?
if (Scene.duration() === 0) {
// play the animation
if (progress > 0) { // play from 0 to 1
_tween.play();
} else { // play from 1 to 0
_tween.reverse();
}
} else {
// go to a specific point in time
if (Scene.tweenChanges() && _tween.tweenTo) {
// go smooth
_tween.tweenTo(progress * _tween.duration());
} else {
// just hard set it
_tween.progress(progress).pause();
}
}
}
}
};
/**
* Add a tween to the scene.
* If you want to add multiple tweens, add them into a GSAP Timeline object and supply it instead (see example below).
*
* If the scene has a duration, the tween's duration will be projected to the scroll distance of the scene, meaning its progress will be synced to scrollbar movement.
* For a scene with a duration of `0`, the tween will be triggered when scrolling forward past the scene's trigger position and reversed, when scrolling back.
* To gain better understanding, check out the [Simple Tweening example](../examples/basic/simple_tweening.html).
*
* Instead of supplying a tween this method can also be used as a shorthand for `TweenMax.to()` (see example below).
* @memberof! animation.GSAP#
*
* @example
* // add a single tween directly
* scene.setTween(TweenMax.to("obj"), 1, {x: 100});
*
* // add a single tween via variable
* var tween = TweenMax.to("obj"), 1, {x: 100};
* scene.setTween(tween);
*
* // add multiple tweens, wrapped in a timeline.
* var timeline = new TimelineMax();
* var tween1 = TweenMax.from("obj1", 1, {x: 100});
* var tween2 = TweenMax.to("obj2", 1, {y: 100});
* timeline
* .add(tween1)
* .add(tween2);
* scene.addTween(timeline);
*
* // short hand to add a TweenMax.to() tween
* scene.setTween("obj3", 0.5, {y: 100});
*
* // short hand to add a TweenMax.to() tween for 1 second
* // this is useful, when the scene has a duration and the tween duration isn't important anyway
* scene.setTween("obj3", {y: 100});
*
* @param {(object|string)} TweenObject - A TweenMax, TweenLite, TimelineMax or TimelineLite object that should be animated in the scene. Can also be a Dom Element or Selector, when using direct tween definition (see examples).
* @param {(number|object)} duration - A duration for the tween, or tween parameters. If an object containing parameters are supplied, a default duration of 1 will be used.
* @param {object} params - The parameters for the tween
* @returns {Scene} Parent object for chaining.
*/
Scene.setTween = function (TweenObject, duration, params) {
var newTween;
if (arguments.length > 1) {
if (arguments.length < 3) {
params = duration;
duration = 1;
}
TweenObject = Tween.to(TweenObject, duration, params);
}
try {
// wrap Tween into a Timeline Object if available to include delay and repeats in the duration and standardize methods.
if (Timeline) {
newTween = new Timeline({
smoothChildTiming: true
}).add(TweenObject);
} else {
newTween = TweenObject;
}
newTween.pause();
} catch (e) {
log(1, "ERROR calling method 'setTween()': Supplied argument is not a valid TweenObject");
return Scene;
}
if (_tween) { // kill old tween?
Scene.removeTween();
}
_tween = newTween;
// some properties need to be transferred it to the wrapper, otherwise they would get lost.
if (TweenObject.repeat && TweenObject.repeat() === -1) { // TweenMax or TimelineMax Object?
_tween.repeat(-1);
_tween.yoyo(TweenObject.yoyo());
}
// Some tween validations and debugging helpers
if (Scene.tweenChanges() && !_tween.tweenTo) {
log(2, "WARNING: tweenChanges will only work if the TimelineMax object is available for ScrollMagic.");
}
// check if there are position tweens defined for the trigger and warn about it :)
if (_tween && Scene.controller() && Scene.triggerElement() && Scene.loglevel() >= 2) { // controller is needed to know scroll direction.
var
triggerTweens = Tween.getTweensOf(Scene.triggerElement()),
vertical = Scene.controller().info("vertical");
triggerTweens.forEach(function (value, index) {
var
tweenvars = value.vars.css || value.vars,
condition = vertical ? (tweenvars.top !== undefined || tweenvars.bottom !== undefined) : (tweenvars.left !== undefined || tweenvars.right !== undefined);
if (condition) {
log(2, "WARNING: Tweening the position of the trigger element affects the scene timing and should be avoided!");
return false;
}
});
}
// warn about tween overwrites, when an element is tweened multiple times
if (parseFloat(TweenLite.version) >= 1.14) { // onOverwrite only present since GSAP v1.14.0
var
list = _tween.getChildren ? _tween.getChildren(true, true, false) : [_tween],
// get all nested tween objects
newCallback = function () {
log(2, "WARNING: tween was overwritten by another. To learn how to avoid this issue see here: https://github.com/janpaepke/ScrollMagic/wiki/WARNING:-tween-was-overwritten-by-another");
};
for (var i = 0, thisTween, oldCallback; i < list.length; i++) { /*jshint loopfunc: true */
thisTween = list[i];
if (oldCallback !== newCallback) { // if tweens is added more than once
oldCallback = thisTween.vars.onOverwrite;
thisTween.vars.onOverwrite = function () {
if (oldCallback) {
oldCallback.apply(this, arguments);
}
newCallback.apply(this, arguments);
};
}
}
}
log(3, "added tween");
updateTweenProgress();
return Scene;
};
/**
* Remove the tween from the scene.
* This will terminate the control of the Scene over the tween.
*
* Using the reset option you can decide if the tween should remain in the current state or be rewound to set the target elements back to the state they were in before the tween was added to the scene.
* @memberof! animation.GSAP#
*
* @example
* // remove the tween from the scene without resetting it
* scene.removeTween();
*
* // remove the tween from the scene and reset it to initial position
* scene.removeTween(true);
*
* @param {boolean} [reset=false] - If `true` the tween will be reset to its initial values.
* @returns {Scene} Parent object for chaining.
*/
Scene.removeTween = function (reset) {
if (_tween) {
if (reset) {
_tween.progress(0).pause();
}
_tween.kill();
_tween = undefined;
log(3, "removed tween (reset: " + (reset ? "true" : "false") + ")");
}
return Scene;
};
});
}));

View File

@ -0,0 +1,225 @@
/*!
* ScrollMagic v2.0.5 (2015-04-29)
* The javascript library for magical scroll interactions.
* (c) 2015 Jan Paepke (@janpaepke)
* Project Website: http://scrollmagic.io
*
* @version 2.0.5
* @license Dual licensed under MIT license and GPL.
* @author Jan Paepke - e-mail@janpaepke.de
*
* @file ScrollMagic Velocity Animation Plugin.
*
* requires: velocity ~1.2
* Powered by VelocityJS: http://VelocityJS.org
* Velocity is published under MIT license.
*/
/**
* This plugin is meant to be used in conjunction with the Velocity animation framework.
* It offers an easy API to __trigger__ Velocity animations.
*
* With the current version of Velocity scrollbound animations (scenes with duration) are not supported.
* This feature will be added as soon as Velocity provides the appropriate API.
*
* To have access to this extension, please include `plugins/animation.velocity.js`.
* @requires {@link http://julian.com/research/velocity/|Velocity ~1.2.0}
* @mixin animation.Velocity
*/
(function (root, factory) {
if (typeof define === 'function' && define.amd) {
// AMD. Register as an anonymous module.
define(['ScrollMagic', 'velocity'], factory);
} else if (typeof exports === 'object') {
// CommonJS
factory(require('scrollmagic'), require('velocity'));
} else {
// Browser globals
factory(root.ScrollMagic || (root.jQuery && root.jQuery.ScrollMagic), root.Velocity || (root.jQuery && root.jQuery.Velocity));
}
}(this, function (ScrollMagic, velocity) {
"use strict";
var NAMESPACE = "animation.velocity";
var
console = window.console || {},
err = Function.prototype.bind.call(console.error || console.log ||
function () {}, console);
if (!ScrollMagic) {
err("(" + NAMESPACE + ") -> ERROR: The ScrollMagic main module could not be found. Please make sure it's loaded before this plugin or use an asynchronous loader like requirejs.");
}
if (!velocity) {
err("(" + NAMESPACE + ") -> ERROR: Velocity could not be found. Please make sure it's loaded before ScrollMagic or use an asynchronous loader like requirejs.");
}
var autoindex = 0;
ScrollMagic.Scene.extend(function () {
var
Scene = this,
_util = ScrollMagic._util,
_currentProgress = 0,
_elems, _properties, _options, _dataID; // used to identify element data related to this scene, will be defined everytime a new velocity animation is added
var log = function () {
if (Scene._log) { // not available, when main source minified
Array.prototype.splice.call(arguments, 1, 0, "(" + NAMESPACE + ")", "->");
Scene._log.apply(this, arguments);
}
};
// set listeners
Scene.on("progress.plugin_velocity", function () {
updateAnimationProgress();
});
Scene.on("destroy.plugin_velocity", function (e) {
Scene.off("*.plugin_velocity");
Scene.removeVelocity(e.reset);
});
var animate = function (elem, properties, options) {
if (_util.type.Array(elem)) {
elem.forEach(function (elem) {
animate(elem, properties, options);
});
} else {
// set reverse values
if (!velocity.Utilities.data(elem, _dataID)) {
velocity.Utilities.data(elem, _dataID, {
reverseProps: _util.css(elem, Object.keys(_properties))
});
}
// animate
velocity(elem, properties, options);
if (options.queue !== undefined) {
velocity.Utilities.dequeue(elem, options.queue);
}
}
};
var reverse = function (elem, options) {
if (_util.type.Array(elem)) {
elem.forEach(function (elem) {
reverse(elem, options);
});
} else {
var data = velocity.Utilities.data(elem, _dataID);
if (data && data.reverseProps) {
velocity(elem, data.reverseProps, options);
if (options.queue !== undefined) {
velocity.Utilities.dequeue(elem, options.queue);
}
}
}
};
/**
* Update the tween progress to current position.
* @private
*/
var updateAnimationProgress = function () {
if (_elems) {
var progress = Scene.progress();
if (progress != _currentProgress) { // do we even need to update the progress?
if (Scene.duration() === 0) {
// play the animation
if (progress > 0) { // play forward
animate(_elems, _properties, _options);
} else { // play reverse
reverse(_elems, _options);
// velocity(_elems, _propertiesReverse, _options);
// velocity("reverse");
}
} else {
// TODO: Scrollbound animations not supported yet...
}
_currentProgress = progress;
}
}
};
/**
* Add a Velocity animation to the scene.
* The method accepts the same parameters as Velocity, with the first parameter being the target element.
*
* To gain better understanding, check out the [Velocity example](../examples/basic/simple_velocity.html).
* @memberof! animation.Velocity#
*
* @example
* // trigger a Velocity animation
* scene.setVelocity("#myElement", {opacity: 0.5}, {duration: 1000, easing: "linear"});
*
* @param {(object|string)} elems - One or more Dom Elements or a Selector that should be used as the target of the animation.
* @param {object} properties - The CSS properties that should be animated.
* @param {object} options - Options for the animation, like duration or easing.
* @returns {Scene} Parent object for chaining.
*/
Scene.setVelocity = function (elems, properties, options) {
if (_elems) { // kill old ani?
Scene.removeVelocity();
}
_elems = _util.get.elements(elems);
_properties = properties || {};
_options = options || {};
_dataID = "ScrollMagic." + NAMESPACE + "[" + (autoindex++) + "]";
if (_options.queue !== undefined) {
// we'll use the queue to identify the animation. When defined it will always stop the previously running one.
// if undefined the animation will always fully run, as is expected.
// defining anything other than 'false' as the que doesn't make much sense, because ScrollMagic takes control over the trigger.
// thus it is also overwritten.
_options.queue = _dataID + "_queue";
}
var checkDuration = function () {
if (Scene.duration() !== 0) {
log(1, "ERROR: The Velocity animation plugin does not support scrollbound animations (scenes with duration) yet.");
}
};
Scene.on("change.plugin_velocity", function (e) {
if (e.what == 'duration') {
checkDuration();
}
});
checkDuration();
log(3, "added animation");
updateAnimationProgress();
return Scene;
};
/**
* Remove the animation from the scene.
* This will stop the scene from triggering the animation.
*
* Using the reset option you can decide if the animation should remain in the current state or be rewound to set the target elements back to the state they were in before the animation was added to the scene.
* @memberof! animation.Velocity#
*
* @example
* // remove the animation from the scene without resetting it
* scene.removeVelocity();
*
* // remove the animation from the scene and reset the elements to initial state
* scene.removeVelocity(true);
*
* @param {boolean} [reset=false] - If `true` the animation will rewound.
* @returns {Scene} Parent object for chaining.
*/
Scene.removeVelocity = function (reset) {
if (_elems) {
// stop running animations
if (_options.queue !== undefined) {
velocity(_elems, "stop", _options.queue);
}
if (reset) {
reverse(_elems, {
duration: 0
});
}
_elems.forEach(function (elem) {
velocity.Utilities.removeData(elem, _dataID);
});
_elems = _properties = _options = _dataID = undefined;
}
return Scene;
};
});
}));

View File

@ -0,0 +1,672 @@
/*!
* ScrollMagic v2.0.5 (2015-04-29)
* The javascript library for magical scroll interactions.
* (c) 2015 Jan Paepke (@janpaepke)
* Project Website: http://scrollmagic.io
*
* @version 2.0.5
* @license Dual licensed under MIT license and GPL.
* @author Jan Paepke - e-mail@janpaepke.de
*
* @file Debug Extension for ScrollMagic.
*/
/**
* This plugin was formerly known as the ScrollMagic debug extension.
*
* It enables you to add visual indicators to your page, to be able to see exactly when a scene is triggered.
*
* To have access to this extension, please include `plugins/debug.addIndicators.js`.
* @mixin debug.addIndicators
*/
(function (root, factory) {
if (typeof define === 'function' && define.amd) {
// AMD. Register as an anonymous module.
define(['ScrollMagic'], factory);
} else if (typeof exports === 'object') {
// CommonJS
factory(require('scrollmagic'));
} else {
// no browser global export needed, just execute
factory(root.ScrollMagic || (root.jQuery && root.jQuery.ScrollMagic));
}
}(this, function (ScrollMagic) {
"use strict";
var NAMESPACE = "debug.addIndicators";
var
console = window.console || {},
err = Function.prototype.bind.call(console.error || console.log ||
function () {}, console);
if (!ScrollMagic) {
err("(" + NAMESPACE + ") -> ERROR: The ScrollMagic main module could not be found. Please make sure it's loaded before this plugin or use an asynchronous loader like requirejs.");
}
// plugin settings
var
FONT_SIZE = "0.85em",
ZINDEX = "9999",
EDGE_OFFSET = 15; // minimum edge distance, added to indentation
// overall vars
var
_util = ScrollMagic._util,
_autoindex = 0;
ScrollMagic.Scene.extend(function () {
var
Scene = this,
_indicator;
var log = function () {
if (Scene._log) { // not available, when main source minified
Array.prototype.splice.call(arguments, 1, 0, "(" + NAMESPACE + ")", "->");
Scene._log.apply(this, arguments);
}
};
/**
* Add visual indicators for a ScrollMagic.Scene.
* @memberof! debug.addIndicators#
*
* @example
* // add basic indicators
* scene.addIndicators()
*
* // passing options
* scene.addIndicators({name: "pin scene", colorEnd: "#FFFFFF"});
*
* @param {object} [options] - An object containing one or more options for the indicators.
* @param {(string|object)} [options.parent=undefined] - A selector, DOM Object or a jQuery object that the indicators should be added to.
If undefined, the controller's container will be used.
* @param {number} [options.name=""] - This string will be displayed at the start and end indicators of the scene for identification purposes. If no name is supplied an automatic index will be used.
* @param {number} [options.indent=0] - Additional position offset for the indicators (useful, when having multiple scenes starting at the same position).
* @param {string} [options.colorStart=green] - CSS color definition for the start indicator.
* @param {string} [options.colorEnd=red] - CSS color definition for the end indicator.
* @param {string} [options.colorTrigger=blue] - CSS color definition for the trigger indicator.
*/
Scene.addIndicators = function (options) {
if (!_indicator) {
var
DEFAULT_OPTIONS = {
name: "",
indent: 0,
parent: undefined,
colorStart: "green",
colorEnd: "red",
colorTrigger: "blue",
};
options = _util.extend({}, DEFAULT_OPTIONS, options);
_autoindex++;
_indicator = new Indicator(Scene, options);
Scene.on("add.plugin_addIndicators", _indicator.add);
Scene.on("remove.plugin_addIndicators", _indicator.remove);
Scene.on("destroy.plugin_addIndicators", Scene.removeIndicators);
// it the scene already has a controller we can start right away.
if (Scene.controller()) {
_indicator.add();
}
}
return Scene;
};
/**
* Removes visual indicators from a ScrollMagic.Scene.
* @memberof! debug.addIndicators#
*
* @example
* // remove previously added indicators
* scene.removeIndicators()
*
*/
Scene.removeIndicators = function () {
if (_indicator) {
_indicator.remove();
this.off("*.plugin_addIndicators");
_indicator = undefined;
}
return Scene;
};
});
/*
* ----------------------------------------------------------------
* Extension for controller to store and update related indicators
* ----------------------------------------------------------------
*/
// add option to globally auto-add indicators to scenes
/**
* Every ScrollMagic.Controller instance now accepts an additional option.
* See {@link ScrollMagic.Controller} for a complete list of the standard options.
* @memberof! debug.addIndicators#
* @method new ScrollMagic.Controller(options)
* @example
* // make a controller and add indicators to all scenes attached
* var controller = new ScrollMagic.Controller({addIndicators: true});
* // this scene will automatically have indicators added to it
* new ScrollMagic.Scene()
* .addTo(controller);
*
* @param {object} [options] - Options for the Controller.
* @param {boolean} [options.addIndicators=false] - If set to `true` every scene that is added to the controller will automatically get indicators added to it.
*/
ScrollMagic.Controller.addOption("addIndicators", false);
// extend Controller
ScrollMagic.Controller.extend(function () {
var
Controller = this,
_info = Controller.info(),
_container = _info.container,
_isDocument = _info.isDocument,
_vertical = _info.vertical,
_indicators = { // container for all indicators and methods
groups: []
};
var log = function () {
if (Controller._log) { // not available, when main source minified
Array.prototype.splice.call(arguments, 1, 0, "(" + NAMESPACE + ")", "->");
Controller._log.apply(this, arguments);
}
};
if (Controller._indicators) {
log(2, "WARNING: Scene already has a property '_indicators', which will be overwritten by plugin.");
}
// add indicators container
this._indicators = _indicators;
/*
needed updates:
+++++++++++++++
start/end position on scene shift (handled in Indicator class)
trigger parameters on triggerHook value change (handled in Indicator class)
bounds position on container scroll or resize (to keep alignment to bottom/right)
trigger position on container resize, window resize (if container isn't document) and window scroll (if container isn't document)
*/
// event handler for when associated bounds markers need to be repositioned
var handleBoundsPositionChange = function () {
_indicators.updateBoundsPositions();
};
// event handler for when associated trigger groups need to be repositioned
var handleTriggerPositionChange = function () {
_indicators.updateTriggerGroupPositions();
};
_container.addEventListener("resize", handleTriggerPositionChange);
if (!_isDocument) {
window.addEventListener("resize", handleTriggerPositionChange);
window.addEventListener("scroll", handleTriggerPositionChange);
}
// update all related bounds containers
_container.addEventListener("resize", handleBoundsPositionChange);
_container.addEventListener("scroll", handleBoundsPositionChange);
// updates the position of the bounds container to aligned to the right for vertical containers and to the bottom for horizontal
this._indicators.updateBoundsPositions = function (specificIndicator) {
var // constant for all bounds
groups = specificIndicator ? [_util.extend({}, specificIndicator.triggerGroup, {
members: [specificIndicator]
})] : // create a group with only one element
_indicators.groups,
// use all
g = groups.length,
css = {},
paramPos = _vertical ? "left" : "top",
paramDimension = _vertical ? "width" : "height",
edge = _vertical ? _util.get.scrollLeft(_container) + _util.get.width(_container) - EDGE_OFFSET : _util.get.scrollTop(_container) + _util.get.height(_container) - EDGE_OFFSET,
b, triggerSize, group;
while (g--) { // group loop
group = groups[g];
b = group.members.length;
triggerSize = _util.get[paramDimension](group.element.firstChild);
while (b--) { // indicators loop
css[paramPos] = edge - triggerSize;
_util.css(group.members[b].bounds, css);
}
}
};
// updates the positions of all trigger groups attached to a controller or a specific one, if provided
this._indicators.updateTriggerGroupPositions = function (specificGroup) {
var // constant vars
groups = specificGroup ? [specificGroup] : _indicators.groups,
i = groups.length,
container = _isDocument ? document.body : _container,
containerOffset = _isDocument ? {
top: 0,
left: 0
} : _util.get.offset(container, true),
edge = _vertical ? _util.get.width(_container) - EDGE_OFFSET : _util.get.height(_container) - EDGE_OFFSET,
paramDimension = _vertical ? "width" : "height",
paramTransform = _vertical ? "Y" : "X";
var // changing vars
group, elem, pos, elemSize, transform;
while (i--) {
group = groups[i];
elem = group.element;
pos = group.triggerHook * Controller.info("size");
elemSize = _util.get[paramDimension](elem.firstChild.firstChild);
transform = pos > elemSize ? "translate" + paramTransform + "(-100%)" : "";
_util.css(elem, {
top: containerOffset.top + (_vertical ? pos : edge - group.members[0].options.indent),
left: containerOffset.left + (_vertical ? edge - group.members[0].options.indent : pos)
});
_util.css(elem.firstChild.firstChild, {
"-ms-transform": transform,
"-webkit-transform": transform,
"transform": transform
});
}
};
// updates the label for the group to contain the name, if it only has one member
this._indicators.updateTriggerGroupLabel = function (group) {
var
text = "trigger" + (group.members.length > 1 ? "" : " " + group.members[0].options.name),
elem = group.element.firstChild.firstChild,
doUpdate = elem.textContent !== text;
if (doUpdate) {
elem.textContent = text;
if (_vertical) { // bounds position is dependent on text length, so update
_indicators.updateBoundsPositions();
}
}
};
// add indicators if global option is set
this.addScene = function (newScene) {
if (this._options.addIndicators && newScene instanceof ScrollMagic.Scene && newScene.controller() === Controller) {
newScene.addIndicators();
}
// call original destroy method
this.$super.addScene.apply(this, arguments);
};
// remove all previously set listeners on destroy
this.destroy = function () {
_container.removeEventListener("resize", handleTriggerPositionChange);
if (!_isDocument) {
window.removeEventListener("resize", handleTriggerPositionChange);
window.removeEventListener("scroll", handleTriggerPositionChange);
}
_container.removeEventListener("resize", handleBoundsPositionChange);
_container.removeEventListener("scroll", handleBoundsPositionChange);
// call original destroy method
this.$super.destroy.apply(this, arguments);
};
return Controller;
});
/*
* ----------------------------------------------------------------
* Internal class for the construction of Indicators
* ----------------------------------------------------------------
*/
var Indicator = function (Scene, options) {
var
Indicator = this,
_elemBounds = TPL.bounds(),
_elemStart = TPL.start(options.colorStart),
_elemEnd = TPL.end(options.colorEnd),
_boundsContainer = options.parent && _util.get.elements(options.parent)[0],
_vertical, _ctrl;
var log = function () {
if (Scene._log) { // not available, when main source minified
Array.prototype.splice.call(arguments, 1, 0, "(" + NAMESPACE + ")", "->");
Scene._log.apply(this, arguments);
}
};
options.name = options.name || _autoindex;
// prepare bounds elements
_elemStart.firstChild.textContent += " " + options.name;
_elemEnd.textContent += " " + options.name;
_elemBounds.appendChild(_elemStart);
_elemBounds.appendChild(_elemEnd);
// set public variables
Indicator.options = options;
Indicator.bounds = _elemBounds;
// will be set later
Indicator.triggerGroup = undefined;
// add indicators to DOM
this.add = function () {
_ctrl = Scene.controller();
_vertical = _ctrl.info("vertical");
var isDocument = _ctrl.info("isDocument");
if (!_boundsContainer) {
// no parent supplied or doesnt exist
_boundsContainer = isDocument ? document.body : _ctrl.info("container"); // check if window/document (then use body)
}
if (!isDocument && _util.css(_boundsContainer, "position") === 'static') {
// position mode needed for correct positioning of indicators
_util.css(_boundsContainer, {
position: "relative"
});
}
// add listeners for updates
Scene.on("change.plugin_addIndicators", handleTriggerParamsChange);
Scene.on("shift.plugin_addIndicators", handleBoundsParamsChange);
// updates trigger & bounds (will add elements if needed)
updateTriggerGroup();
updateBounds();
setTimeout(function () { // do after all execution is finished otherwise sometimes size calculations are off
_ctrl._indicators.updateBoundsPositions(Indicator);
}, 0);
log(3, "added indicators");
};
// remove indicators from DOM
this.remove = function () {
if (Indicator.triggerGroup) { // if not set there's nothing to remove
Scene.off("change.plugin_addIndicators", handleTriggerParamsChange);
Scene.off("shift.plugin_addIndicators", handleBoundsParamsChange);
if (Indicator.triggerGroup.members.length > 1) {
// just remove from memberlist of old group
var group = Indicator.triggerGroup;
group.members.splice(group.members.indexOf(Indicator), 1);
_ctrl._indicators.updateTriggerGroupLabel(group);
_ctrl._indicators.updateTriggerGroupPositions(group);
Indicator.triggerGroup = undefined;
} else {
// remove complete group
removeTriggerGroup();
}
removeBounds();
log(3, "removed indicators");
}
};
/*
* ----------------------------------------------------------------
* internal Event Handlers
* ----------------------------------------------------------------
*/
// event handler for when bounds params change
var handleBoundsParamsChange = function () {
updateBounds();
};
// event handler for when trigger params change
var handleTriggerParamsChange = function (e) {
if (e.what === "triggerHook") {
updateTriggerGroup();
}
};
/*
* ----------------------------------------------------------------
* Bounds (start / stop) management
* ----------------------------------------------------------------
*/
// adds an new bounds elements to the array and to the DOM
var addBounds = function () {
var v = _ctrl.info("vertical");
// apply stuff we didn't know before...
_util.css(_elemStart.firstChild, {
"border-bottom-width": v ? 1 : 0,
"border-right-width": v ? 0 : 1,
"bottom": v ? -1 : options.indent,
"right": v ? options.indent : -1,
"padding": v ? "0 8px" : "2px 4px",
});
_util.css(_elemEnd, {
"border-top-width": v ? 1 : 0,
"border-left-width": v ? 0 : 1,
"top": v ? "100%" : "",
"right": v ? options.indent : "",
"bottom": v ? "" : options.indent,
"left": v ? "" : "100%",
"padding": v ? "0 8px" : "2px 4px"
});
// append
_boundsContainer.appendChild(_elemBounds);
};
// remove bounds from list and DOM
var removeBounds = function () {
_elemBounds.parentNode.removeChild(_elemBounds);
};
// update the start and end positions of the scene
var updateBounds = function () {
if (_elemBounds.parentNode !== _boundsContainer) {
addBounds(); // Add Bounds elements (start/end)
}
var css = {};
css[_vertical ? "top" : "left"] = Scene.triggerPosition();
css[_vertical ? "height" : "width"] = Scene.duration();
_util.css(_elemBounds, css);
_util.css(_elemEnd, {
display: Scene.duration() > 0 ? "" : "none"
});
};
/*
* ----------------------------------------------------------------
* trigger and trigger group management
* ----------------------------------------------------------------
*/
// adds an new trigger group to the array and to the DOM
var addTriggerGroup = function () {
var triggerElem = TPL.trigger(options.colorTrigger); // new trigger element
var css = {};
css[_vertical ? "right" : "bottom"] = 0;
css[_vertical ? "border-top-width" : "border-left-width"] = 1;
_util.css(triggerElem.firstChild, css);
_util.css(triggerElem.firstChild.firstChild, {
padding: _vertical ? "0 8px 3px 8px" : "3px 4px"
});
document.body.appendChild(triggerElem); // directly add to body
var newGroup = {
triggerHook: Scene.triggerHook(),
element: triggerElem,
members: [Indicator]
};
_ctrl._indicators.groups.push(newGroup);
Indicator.triggerGroup = newGroup;
// update right away
_ctrl._indicators.updateTriggerGroupLabel(newGroup);
_ctrl._indicators.updateTriggerGroupPositions(newGroup);
};
var removeTriggerGroup = function () {
_ctrl._indicators.groups.splice(_ctrl._indicators.groups.indexOf(Indicator.triggerGroup), 1);
Indicator.triggerGroup.element.parentNode.removeChild(Indicator.triggerGroup.element);
Indicator.triggerGroup = undefined;
};
// updates the trigger group -> either join existing or add new one
/*
* Logic:
* 1 if a trigger group exist, check if it's in sync with Scene settings if so, nothing else needs to happen
* 2 try to find an existing one that matches Scene parameters
* 2.1 If a match is found check if already assigned to an existing group
* If so:
* A: it was the last member of existing group -> kill whole group
* B: the existing group has other members -> just remove from member list
* 2.2 Assign to matching group
* 3 if no new match could be found, check if assigned to existing group
* A: yes, and it's the only member -> just update parameters and positions and keep using this group
* B: yes but there are other members -> remove from member list and create a new one
* C: no, so create a new one
*/
var updateTriggerGroup = function () {
var
triggerHook = Scene.triggerHook(),
closeEnough = 0.0001;
// Have a group, check if it still matches
if (Indicator.triggerGroup) {
if (Math.abs(Indicator.triggerGroup.triggerHook - triggerHook) < closeEnough) {
// _util.log(0, "trigger", options.name, "->", "no need to change, still in sync");
return; // all good
}
}
// Don't have a group, check if a matching one exists
// _util.log(0, "trigger", options.name, "->", "out of sync!");
var
groups = _ctrl._indicators.groups,
group, i = groups.length;
while (i--) {
group = groups[i];
if (Math.abs(group.triggerHook - triggerHook) < closeEnough) {
// found a match!
// _util.log(0, "trigger", options.name, "->", "found match");
if (Indicator.triggerGroup) { // do I have an old group that is out of sync?
if (Indicator.triggerGroup.members.length === 1) { // is it the only remaining group?
// _util.log(0, "trigger", options.name, "->", "kill");
// was the last member, remove the whole group
removeTriggerGroup();
} else {
Indicator.triggerGroup.members.splice(Indicator.triggerGroup.members.indexOf(Indicator), 1); // just remove from memberlist of old group
_ctrl._indicators.updateTriggerGroupLabel(Indicator.triggerGroup);
_ctrl._indicators.updateTriggerGroupPositions(Indicator.triggerGroup);
// _util.log(0, "trigger", options.name, "->", "removing from previous member list");
}
}
// join new group
group.members.push(Indicator);
Indicator.triggerGroup = group;
_ctrl._indicators.updateTriggerGroupLabel(group);
return;
}
}
// at this point I am obviously out of sync and don't match any other group
if (Indicator.triggerGroup) {
if (Indicator.triggerGroup.members.length === 1) {
// _util.log(0, "trigger", options.name, "->", "updating existing");
// out of sync but i'm the only member => just change and update
Indicator.triggerGroup.triggerHook = triggerHook;
_ctrl._indicators.updateTriggerGroupPositions(Indicator.triggerGroup);
return;
} else {
// _util.log(0, "trigger", options.name, "->", "removing from previous member list");
Indicator.triggerGroup.members.splice(Indicator.triggerGroup.members.indexOf(Indicator), 1); // just remove from memberlist of old group
_ctrl._indicators.updateTriggerGroupLabel(Indicator.triggerGroup);
_ctrl._indicators.updateTriggerGroupPositions(Indicator.triggerGroup);
Indicator.triggerGroup = undefined; // need a brand new group...
}
}
// _util.log(0, "trigger", options.name, "->", "add a new one");
// did not find any match, make new trigger group
addTriggerGroup();
};
};
/*
* ----------------------------------------------------------------
* Templates for the indicators
* ----------------------------------------------------------------
*/
var TPL = {
start: function (color) {
// inner element (for bottom offset -1, while keeping top position 0)
var inner = document.createElement("div");
inner.textContent = "start";
_util.css(inner, {
position: "absolute",
overflow: "visible",
"border-width": 0,
"border-style": "solid",
color: color,
"border-color": color
});
var e = document.createElement('div');
// wrapper
_util.css(e, {
position: "absolute",
overflow: "visible",
width: 0,
height: 0
});
e.appendChild(inner);
return e;
},
end: function (color) {
var e = document.createElement('div');
e.textContent = "end";
_util.css(e, {
position: "absolute",
overflow: "visible",
"border-width": 0,
"border-style": "solid",
color: color,
"border-color": color
});
return e;
},
bounds: function () {
var e = document.createElement('div');
_util.css(e, {
position: "absolute",
overflow: "visible",
"white-space": "nowrap",
"pointer-events": "none",
"font-size": FONT_SIZE
});
e.style.zIndex = ZINDEX;
return e;
},
trigger: function (color) {
// inner to be above or below line but keep position
var inner = document.createElement('div');
inner.textContent = "trigger";
_util.css(inner, {
position: "relative",
});
// inner wrapper for right: 0 and main element has no size
var w = document.createElement('div');
_util.css(w, {
position: "absolute",
overflow: "visible",
"border-width": 0,
"border-style": "solid",
color: color,
"border-color": color
});
w.appendChild(inner);
// wrapper
var e = document.createElement('div');
_util.css(e, {
position: "fixed",
overflow: "visible",
"white-space": "nowrap",
"pointer-events": "none",
"font-size": FONT_SIZE
});
e.style.zIndex = ZINDEX;
e.appendChild(w);
return e;
},
};
}));

View File

@ -0,0 +1,69 @@
/*!
* ScrollMagic v2.0.5 (2015-04-29)
* The javascript library for magical scroll interactions.
* (c) 2015 Jan Paepke (@janpaepke)
* Project Website: http://scrollmagic.io
*
* @version 2.0.5
* @license Dual licensed under MIT license and GPL.
* @author Jan Paepke - e-mail@janpaepke.de
*
* @file ScrollMagic jQuery plugin.
*
* requires: jQuery ~1.11 or ~2.1
*/
/**
* This plugin is meant to be used in conjunction with jQuery.
* It enables ScrollMagic to make use of jQuery's advanced selector engine (sizzle) for all elements supplied to ScrollMagic objects, like scroll containers or trigger elements.
* ScrollMagic also accepts jQuery elements for all methods that expect references to DOM elements. Please note, that in most cases the first element of the matched set will be used.
*
* Additionally it provides the ScrollMagic object within the jQuery namespace, so it can be accessed using `$.ScrollMagic`.
*
* In contrast to most other plugins it does not offer new API additions for ScrollMagic.
*
* To have access to this extension, please include `plugins/jquery.ScrollMagic.js`.
* @example
* // create a new scene making use of jQuery's advanced selector engine
* var scene = new $.ScrollMagic.Scene({
* triggerElement: "#parent div.trigger[attr='thisone']:not(.notthisone)"
* });
* @requires {@link http://jquery.com/|jQuery ~1.11 or ~2.1}
* @mixin framework.jQuery
*/
(function (root, factory) {
if (typeof define === 'function' && define.amd) {
// AMD. Register as an anonymous module.
define(['ScrollMagic', 'jquery'], factory);
} else if (typeof exports === 'object') {
// CommonJS
factory(require('scrollmagic'), require('jquery'));
} else {
// Browser global
factory(root.ScrollMagic, root.jQuery);
}
}(this, function (ScrollMagic, $) {
"use strict";
var NAMESPACE = "jquery.ScrollMagic";
var
console = window.console || {},
err = Function.prototype.bind.call(console.error || console.log ||
function () {}, console);
if (!ScrollMagic) {
err("(" + NAMESPACE + ") -> ERROR: The ScrollMagic main module could not be found. Please make sure it's loaded before this plugin or use an asynchronous loader like requirejs.");
}
if (!$) {
err("(" + NAMESPACE + ") -> ERROR: jQuery could not be found. Please make sure it's loaded before ScrollMagic or use an asynchronous loader like requirejs.");
}
ScrollMagic._util.get.elements = function (selector) {
return $(selector).toArray();
};
ScrollMagic._util.addClass = function (elem, classname) {
$(elem).addClass(classname);
};
ScrollMagic._util.removeClass = function (elem, classname) {
$(elem).removeClass(classname);
};
$.ScrollMagic = ScrollMagic;
}));

496
js/libs/sha512.js Normal file
View File

@ -0,0 +1,496 @@
/*
* A JavaScript implementation of the Secure Hash Algorithm, SHA-512, as defined
* in FIPS 180-2
* Version 2.2 Copyright Anonymous Contributor, Paul Johnston 2000 - 2009.
* Other contributors: Greg Holt, Andrew Kepert, Ydnar, Lostinet
* Distributed under the BSD License
* See http://pajhome.org.uk/crypt/md5 for details.
*/
/*
* Configurable variables. You may need to tweak these to be compatible with
* the server-side, but the defaults work in most cases.
*/
var hexcase = 0; /* hex output format. 0 - lowercase; 1 - uppercase */
var b64pad = ""; /* base-64 pad character. "=" for strict RFC compliance */
/*
* These are the functions you'll usually want to call
* They take string arguments and return either hex or base-64 encoded strings
*/
function hex_sha512(s) { return rstr2hex(rstr_sha512(str2rstr_utf8(s))); }
function b64_sha512(s) { return rstr2b64(rstr_sha512(str2rstr_utf8(s))); }
function any_sha512(s, e) { return rstr2any(rstr_sha512(str2rstr_utf8(s)), e);}
function hex_hmac_sha512(k, d)
{ return rstr2hex(rstr_hmac_sha512(str2rstr_utf8(k), str2rstr_utf8(d))); }
function b64_hmac_sha512(k, d)
{ return rstr2b64(rstr_hmac_sha512(str2rstr_utf8(k), str2rstr_utf8(d))); }
function any_hmac_sha512(k, d, e)
{ return rstr2any(rstr_hmac_sha512(str2rstr_utf8(k), str2rstr_utf8(d)), e);}
/*
* Perform a simple self-test to see if the VM is working
*/
function sha512_vm_test()
{
return hex_sha512("abc").toLowerCase() ==
"ddaf35a193617abacc417349ae20413112e6fa4e89a97ea20a9eeee64b55d39a" +
"2192992a274fc1a836ba3c23a3feebbd454d4423643ce80e2a9ac94fa54ca49f";
}
/*
* Calculate the SHA-512 of a raw string
*/
function rstr_sha512(s)
{
return binb2rstr(binb_sha512(rstr2binb(s), s.length * 8));
}
/*
* Calculate the HMAC-SHA-512 of a key and some data (raw strings)
*/
function rstr_hmac_sha512(key, data)
{
var bkey = rstr2binb(key);
if(bkey.length > 32) bkey = binb_sha512(bkey, key.length * 8);
var ipad = Array(32), opad = Array(32);
for(var i = 0; i < 32; i++)
{
ipad[i] = bkey[i] ^ 0x36363636;
opad[i] = bkey[i] ^ 0x5C5C5C5C;
}
var hash = binb_sha512(ipad.concat(rstr2binb(data)), 1024 + data.length * 8);
return binb2rstr(binb_sha512(opad.concat(hash), 1024 + 512));
}
/*
* Convert a raw string to a hex string
*/
function rstr2hex(input)
{
try { hexcase } catch(e) { hexcase=0; }
var hex_tab = hexcase ? "0123456789ABCDEF" : "0123456789abcdef";
var output = "";
var x;
for(var i = 0; i < input.length; i++)
{
x = input.charCodeAt(i);
output += hex_tab.charAt((x >>> 4) & 0x0F)
+ hex_tab.charAt( x & 0x0F);
}
return output;
}
/*
* Convert a raw string to a base-64 string
*/
function rstr2b64(input)
{
try { b64pad } catch(e) { b64pad=''; }
var tab = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";
var output = "";
var len = input.length;
for(var i = 0; i < len; i += 3)
{
var triplet = (input.charCodeAt(i) << 16)
| (i + 1 < len ? input.charCodeAt(i+1) << 8 : 0)
| (i + 2 < len ? input.charCodeAt(i+2) : 0);
for(var j = 0; j < 4; j++)
{
if(i * 8 + j * 6 > input.length * 8) output += b64pad;
else output += tab.charAt((triplet >>> 6*(3-j)) & 0x3F);
}
}
return output;
}
/*
* Convert a raw string to an arbitrary string encoding
*/
function rstr2any(input, encoding)
{
var divisor = encoding.length;
var i, j, q, x, quotient;
/* Convert to an array of 16-bit big-endian values, forming the dividend */
var dividend = Array(Math.ceil(input.length / 2));
for(i = 0; i < dividend.length; i++)
{
dividend[i] = (input.charCodeAt(i * 2) << 8) | input.charCodeAt(i * 2 + 1);
}
/*
* Repeatedly perform a long division. The binary array forms the dividend,
* the length of the encoding is the divisor. Once computed, the quotient
* forms the dividend for the next step. All remainders are stored for later
* use.
*/
var full_length = Math.ceil(input.length * 8 /
(Math.log(encoding.length) / Math.log(2)));
var remainders = Array(full_length);
for(j = 0; j < full_length; j++)
{
quotient = Array();
x = 0;
for(i = 0; i < dividend.length; i++)
{
x = (x << 16) + dividend[i];
q = Math.floor(x / divisor);
x -= q * divisor;
if(quotient.length > 0 || q > 0)
quotient[quotient.length] = q;
}
remainders[j] = x;
dividend = quotient;
}
/* Convert the remainders to the output string */
var output = "";
for(i = remainders.length - 1; i >= 0; i--)
output += encoding.charAt(remainders[i]);
return output;
}
/*
* Encode a string as utf-8.
* For efficiency, this assumes the input is valid utf-16.
*/
function str2rstr_utf8(input)
{
var output = "";
var i = -1;
var x, y;
while(++i < input.length)
{
/* Decode utf-16 surrogate pairs */
x = input.charCodeAt(i);
y = i + 1 < input.length ? input.charCodeAt(i + 1) : 0;
if(0xD800 <= x && x <= 0xDBFF && 0xDC00 <= y && y <= 0xDFFF)
{
x = 0x10000 + ((x & 0x03FF) << 10) + (y & 0x03FF);
i++;
}
/* Encode output as utf-8 */
if(x <= 0x7F)
output += String.fromCharCode(x);
else if(x <= 0x7FF)
output += String.fromCharCode(0xC0 | ((x >>> 6 ) & 0x1F),
0x80 | ( x & 0x3F));
else if(x <= 0xFFFF)
output += String.fromCharCode(0xE0 | ((x >>> 12) & 0x0F),
0x80 | ((x >>> 6 ) & 0x3F),
0x80 | ( x & 0x3F));
else if(x <= 0x1FFFFF)
output += String.fromCharCode(0xF0 | ((x >>> 18) & 0x07),
0x80 | ((x >>> 12) & 0x3F),
0x80 | ((x >>> 6 ) & 0x3F),
0x80 | ( x & 0x3F));
}
return output;
}
/*
* Encode a string as utf-16
*/
function str2rstr_utf16le(input)
{
var output = "";
for(var i = 0; i < input.length; i++)
output += String.fromCharCode( input.charCodeAt(i) & 0xFF,
(input.charCodeAt(i) >>> 8) & 0xFF);
return output;
}
function str2rstr_utf16be(input)
{
var output = "";
for(var i = 0; i < input.length; i++)
output += String.fromCharCode((input.charCodeAt(i) >>> 8) & 0xFF,
input.charCodeAt(i) & 0xFF);
return output;
}
/*
* Convert a raw string to an array of big-endian words
* Characters >255 have their high-byte silently ignored.
*/
function rstr2binb(input)
{
var output = Array(input.length >> 2);
for(var i = 0; i < output.length; i++)
output[i] = 0;
for(var i = 0; i < input.length * 8; i += 8)
output[i>>5] |= (input.charCodeAt(i / 8) & 0xFF) << (24 - i % 32);
return output;
}
/*
* Convert an array of big-endian words to a string
*/
function binb2rstr(input)
{
var output = "";
for(var i = 0; i < input.length * 32; i += 8)
output += String.fromCharCode((input[i>>5] >>> (24 - i % 32)) & 0xFF);
return output;
}
/*
* Calculate the SHA-512 of an array of big-endian dwords, and a bit length
*/
var sha512_k;
function binb_sha512(x, len)
{
if(sha512_k == undefined)
{
//SHA512 constants
sha512_k = new Array(
new int64(0x428a2f98, -685199838), new int64(0x71374491, 0x23ef65cd),
new int64(-1245643825, -330482897), new int64(-373957723, -2121671748),
new int64(0x3956c25b, -213338824), new int64(0x59f111f1, -1241133031),
new int64(-1841331548, -1357295717), new int64(-1424204075, -630357736),
new int64(-670586216, -1560083902), new int64(0x12835b01, 0x45706fbe),
new int64(0x243185be, 0x4ee4b28c), new int64(0x550c7dc3, -704662302),
new int64(0x72be5d74, -226784913), new int64(-2132889090, 0x3b1696b1),
new int64(-1680079193, 0x25c71235), new int64(-1046744716, -815192428),
new int64(-459576895, -1628353838), new int64(-272742522, 0x384f25e3),
new int64(0xfc19dc6, -1953704523), new int64(0x240ca1cc, 0x77ac9c65),
new int64(0x2de92c6f, 0x592b0275), new int64(0x4a7484aa, 0x6ea6e483),
new int64(0x5cb0a9dc, -1119749164), new int64(0x76f988da, -2096016459),
new int64(-1740746414, -295247957), new int64(-1473132947, 0x2db43210),
new int64(-1341970488, -1728372417), new int64(-1084653625, -1091629340),
new int64(-958395405, 0x3da88fc2), new int64(-710438585, -1828018395),
new int64(0x6ca6351, -536640913), new int64(0x14292967, 0xa0e6e70),
new int64(0x27b70a85, 0x46d22ffc), new int64(0x2e1b2138, 0x5c26c926),
new int64(0x4d2c6dfc, 0x5ac42aed), new int64(0x53380d13, -1651133473),
new int64(0x650a7354, -1951439906), new int64(0x766a0abb, 0x3c77b2a8),
new int64(-2117940946, 0x47edaee6), new int64(-1838011259, 0x1482353b),
new int64(-1564481375, 0x4cf10364), new int64(-1474664885, -1136513023),
new int64(-1035236496, -789014639), new int64(-949202525, 0x654be30),
new int64(-778901479, -688958952), new int64(-694614492, 0x5565a910),
new int64(-200395387, 0x5771202a), new int64(0x106aa070, 0x32bbd1b8),
new int64(0x19a4c116, -1194143544), new int64(0x1e376c08, 0x5141ab53),
new int64(0x2748774c, -544281703), new int64(0x34b0bcb5, -509917016),
new int64(0x391c0cb3, -976659869), new int64(0x4ed8aa4a, -482243893),
new int64(0x5b9cca4f, 0x7763e373), new int64(0x682e6ff3, -692930397),
new int64(0x748f82ee, 0x5defb2fc), new int64(0x78a5636f, 0x43172f60),
new int64(-2067236844, -1578062990), new int64(-1933114872, 0x1a6439ec),
new int64(-1866530822, 0x23631e28), new int64(-1538233109, -561857047),
new int64(-1090935817, -1295615723), new int64(-965641998, -479046869),
new int64(-903397682, -366583396), new int64(-779700025, 0x21c0c207),
new int64(-354779690, -840897762), new int64(-176337025, -294727304),
new int64(0x6f067aa, 0x72176fba), new int64(0xa637dc5, -1563912026),
new int64(0x113f9804, -1090974290), new int64(0x1b710b35, 0x131c471b),
new int64(0x28db77f5, 0x23047d84), new int64(0x32caab7b, 0x40c72493),
new int64(0x3c9ebe0a, 0x15c9bebc), new int64(0x431d67c4, -1676669620),
new int64(0x4cc5d4be, -885112138), new int64(0x597f299c, -60457430),
new int64(0x5fcb6fab, 0x3ad6faec), new int64(0x6c44198c, 0x4a475817));
}
//Initial hash values
var H = new Array(
new int64(0x6a09e667, -205731576),
new int64(-1150833019, -2067093701),
new int64(0x3c6ef372, -23791573),
new int64(-1521486534, 0x5f1d36f1),
new int64(0x510e527f, -1377402159),
new int64(-1694144372, 0x2b3e6c1f),
new int64(0x1f83d9ab, -79577749),
new int64(0x5be0cd19, 0x137e2179));
var T1 = new int64(0, 0),
T2 = new int64(0, 0),
a = new int64(0,0),
b = new int64(0,0),
c = new int64(0,0),
d = new int64(0,0),
e = new int64(0,0),
f = new int64(0,0),
g = new int64(0,0),
h = new int64(0,0),
//Temporary variables not specified by the document
s0 = new int64(0, 0),
s1 = new int64(0, 0),
Ch = new int64(0, 0),
Maj = new int64(0, 0),
r1 = new int64(0, 0),
r2 = new int64(0, 0),
r3 = new int64(0, 0);
var j, i;
var W = new Array(80);
for(i=0; i<80; i++)
W[i] = new int64(0, 0);
// append padding to the source string. The format is described in the FIPS.
x[len >> 5] |= 0x80 << (24 - (len & 0x1f));
x[((len + 128 >> 10)<< 5) + 31] = len;
for(i = 0; i<x.length; i+=32) //32 dwords is the block size
{
int64copy(a, H[0]);
int64copy(b, H[1]);
int64copy(c, H[2]);
int64copy(d, H[3]);
int64copy(e, H[4]);
int64copy(f, H[5]);
int64copy(g, H[6]);
int64copy(h, H[7]);
for(j=0; j<16; j++)
{
W[j].h = x[i + 2*j];
W[j].l = x[i + 2*j + 1];
}
for(j=16; j<80; j++)
{
//sigma1
int64rrot(r1, W[j-2], 19);
int64revrrot(r2, W[j-2], 29);
int64shr(r3, W[j-2], 6);
s1.l = r1.l ^ r2.l ^ r3.l;
s1.h = r1.h ^ r2.h ^ r3.h;
//sigma0
int64rrot(r1, W[j-15], 1);
int64rrot(r2, W[j-15], 8);
int64shr(r3, W[j-15], 7);
s0.l = r1.l ^ r2.l ^ r3.l;
s0.h = r1.h ^ r2.h ^ r3.h;
int64add4(W[j], s1, W[j-7], s0, W[j-16]);
}
for(j = 0; j < 80; j++)
{
//Ch
Ch.l = (e.l & f.l) ^ (~e.l & g.l);
Ch.h = (e.h & f.h) ^ (~e.h & g.h);
//Sigma1
int64rrot(r1, e, 14);
int64rrot(r2, e, 18);
int64revrrot(r3, e, 9);
s1.l = r1.l ^ r2.l ^ r3.l;
s1.h = r1.h ^ r2.h ^ r3.h;
//Sigma0
int64rrot(r1, a, 28);
int64revrrot(r2, a, 2);
int64revrrot(r3, a, 7);
s0.l = r1.l ^ r2.l ^ r3.l;
s0.h = r1.h ^ r2.h ^ r3.h;
//Maj
Maj.l = (a.l & b.l) ^ (a.l & c.l) ^ (b.l & c.l);
Maj.h = (a.h & b.h) ^ (a.h & c.h) ^ (b.h & c.h);
int64add5(T1, h, s1, Ch, sha512_k[j], W[j]);
int64add(T2, s0, Maj);
int64copy(h, g);
int64copy(g, f);
int64copy(f, e);
int64add(e, d, T1);
int64copy(d, c);
int64copy(c, b);
int64copy(b, a);
int64add(a, T1, T2);
}
int64add(H[0], H[0], a);
int64add(H[1], H[1], b);
int64add(H[2], H[2], c);
int64add(H[3], H[3], d);
int64add(H[4], H[4], e);
int64add(H[5], H[5], f);
int64add(H[6], H[6], g);
int64add(H[7], H[7], h);
}
//represent the hash as an array of 32-bit dwords
var hash = new Array(16);
for(i=0; i<8; i++)
{
hash[2*i] = H[i].h;
hash[2*i + 1] = H[i].l;
}
return hash;
}
//A constructor for 64-bit numbers
function int64(h, l)
{
this.h = h;
this.l = l;
//this.toString = int64toString;
}
//Copies src into dst, assuming both are 64-bit numbers
function int64copy(dst, src)
{
dst.h = src.h;
dst.l = src.l;
}
//Right-rotates a 64-bit number by shift
//Won't handle cases of shift>=32
//The function revrrot() is for that
function int64rrot(dst, x, shift)
{
dst.l = (x.l >>> shift) | (x.h << (32-shift));
dst.h = (x.h >>> shift) | (x.l << (32-shift));
}
//Reverses the dwords of the source and then rotates right by shift.
//This is equivalent to rotation by 32+shift
function int64revrrot(dst, x, shift)
{
dst.l = (x.h >>> shift) | (x.l << (32-shift));
dst.h = (x.l >>> shift) | (x.h << (32-shift));
}
//Bitwise-shifts right a 64-bit number by shift
//Won't handle shift>=32, but it's never needed in SHA512
function int64shr(dst, x, shift)
{
dst.l = (x.l >>> shift) | (x.h << (32-shift));
dst.h = (x.h >>> shift);
}
//Adds two 64-bit numbers
//Like the original implementation, does not rely on 32-bit operations
function int64add(dst, x, y)
{
var w0 = (x.l & 0xffff) + (y.l & 0xffff);
var w1 = (x.l >>> 16) + (y.l >>> 16) + (w0 >>> 16);
var w2 = (x.h & 0xffff) + (y.h & 0xffff) + (w1 >>> 16);
var w3 = (x.h >>> 16) + (y.h >>> 16) + (w2 >>> 16);
dst.l = (w0 & 0xffff) | (w1 << 16);
dst.h = (w2 & 0xffff) | (w3 << 16);
}
//Same, except with 4 addends. Works faster than adding them one by one.
function int64add4(dst, a, b, c, d)
{
var w0 = (a.l & 0xffff) + (b.l & 0xffff) + (c.l & 0xffff) + (d.l & 0xffff);
var w1 = (a.l >>> 16) + (b.l >>> 16) + (c.l >>> 16) + (d.l >>> 16) + (w0 >>> 16);
var w2 = (a.h & 0xffff) + (b.h & 0xffff) + (c.h & 0xffff) + (d.h & 0xffff) + (w1 >>> 16);
var w3 = (a.h >>> 16) + (b.h >>> 16) + (c.h >>> 16) + (d.h >>> 16) + (w2 >>> 16);
dst.l = (w0 & 0xffff) | (w1 << 16);
dst.h = (w2 & 0xffff) | (w3 << 16);
}
//Same, except with 5 addends
function int64add5(dst, a, b, c, d, e)
{
var w0 = (a.l & 0xffff) + (b.l & 0xffff) + (c.l & 0xffff) + (d.l & 0xffff) + (e.l & 0xffff);
var w1 = (a.l >>> 16) + (b.l >>> 16) + (c.l >>> 16) + (d.l >>> 16) + (e.l >>> 16) + (w0 >>> 16);
var w2 = (a.h & 0xffff) + (b.h & 0xffff) + (c.h & 0xffff) + (d.h & 0xffff) + (e.h & 0xffff) + (w1 >>> 16);
var w3 = (a.h >>> 16) + (b.h >>> 16) + (c.h >>> 16) + (d.h >>> 16) + (e.h >>> 16) + (w2 >>> 16);
dst.l = (w0 & 0xffff) | (w1 << 16);
dst.h = (w2 & 0xffff) | (w3 << 16);
}

160
js/main.js Normal file
View File

@ -0,0 +1,160 @@
/*******************************************IMAGE GALLERY*******************************************/
/*******Filtering*******/
// init Isotope
var $grid = $('.img-grid').isotope({
itemSelector: '.img-container',
//layoutMode: 'fitRows',
});
// filter functions
var filterFns = {
// show if number is greater than 50
numberGreaterThan50: function () {
},
};
// bind filter button click
$('#filter-btn').on('click', 'button', function () {
var filterValue = $(this).attr('data-filter');
// use filterFn if matches value
filterValue = filterFns[filterValue] || filterValue;
$grid.isotope({filter: filterValue});
});
// change is-checked class on buttons
$('.button-group').each(function (i, buttonGroup) {
var $buttonGroup = $(buttonGroup);
$buttonGroup.on('click', 'button', function () {
$buttonGroup.find('.is-checked').removeClass('is-checked');
$(this).addClass('is-checked');
});
});
/*******************************************CAROUSEL IN MY CLIENTS*******************************************/
$(document).ready(function () {
$('.loop').owlCarousel({
center: true,
items: 1,
loop: true,
margin: 10,
responsive: {
600: {
items: 1
}
}
});
});
/*******************************************SCROLL MAGIC*******************************************/
/*******Scroll for the links*******/
var controller = new ScrollMagic.Controller();
new ScrollMagic.Scene({
triggerElement: "#hero",
duration: $("#hero").height()
}).setClassToggle("#hero-link", "active").addTo(controller);
new ScrollMagic.Scene({
triggerElement: "#about",
duration: $("#about").height() + 100
}).setClassToggle("#about-link", "active").addTo(controller);
new ScrollMagic.Scene({
triggerElement: "#competences",
duration: $("#competences").height()
}).setClassToggle("#competences-link", "active").addTo(controller);
new ScrollMagic.Scene({
triggerElement: "#engagement",
duration: $("#engagement").height()
}).setClassToggle("#engagement-link", "active").addTo(controller);
new ScrollMagic.Scene({
triggerElement: "#experiences",
duration: $("#experiences").height()
}).setClassToggle("#experiences-link", "active").addTo(controller);
new ScrollMagic.Scene({
triggerElement: "#projets",
duration: $("#experiences").height()
}).setClassToggle("#projets-link", "active").addTo(controller);
new ScrollMagic.Scene({
triggerElement: "#contact",
duration: $("#contact").height()
}).setClassToggle("#contact-link", "active").addTo(controller);
/*******Other Scroll Magic Elements*******/
$(document).ready(function () {
var controller2 = new ScrollMagic.Controller();
//The about paragraph
var about_scene = new ScrollMagic.Scene({
triggerElement: '.about-text',
triggerHook: .7
})
.setClassToggle('.about-text', 'about-text-animate')
.reverse(false)
.addTo(controller2);
//Progress bars
var progress_bar_scene = new ScrollMagic.Scene({
triggerElement: '.about-resume',
triggerHook: .7,
})
.setClassToggle('.inner-percent', 'inner-percent-animate')
.reverse(false)
.addTo(controller);
//Icons in Services
var about_scene = new ScrollMagic.Scene({
triggerElement: '.trigger',
triggerHook: .7
})
.setClassToggle('.icon', 'service-icon-animate')
.reverse(false)
.addTo(controller2);
});
/*******************************************MOBILE NAV*******************************************/
$('.mobile-toggle').click(function () {
if ($('#main-header').hasClass('open-nav')) {
$('#main-header').removeClass('open-nav');
} else {
$('#main-header').addClass('open-nav');
}
});
/*******************************************NAV SCROLL*******************************************/
$('nav a').click(function (event) {
var id = $(this).attr("href");
var offset = 70;
var target = $(id).offset().top - offset;
$('html, body').animate({
scrollTop: target
}, 500);
event.preventDefault();
});
/*******************************************PRELOAD*******************************************/
var overlay = document.getElementById("preload-overlay");
window.addEventListener('load', function () {
overlay.style.display = "none";
})
function launchModale(id) {
$(id).modal('show');
}

51
js/timeline.js Normal file
View File

@ -0,0 +1,51 @@
$(function(){
window.sr = ScrollReveal();
if ($(window).width() < 768) {
if ($('.timeline-content').hasClass('js--fadeInLeft')) {
$('.timeline-content').removeClass('js--fadeInLeft').addClass('js--fadeInRight');
}
sr.reveal('.js--fadeInRight', {
origin: 'right',
distance: '300px',
easing: 'ease-in-out',
duration: 800,
});
} else {
sr.reveal('.js--fadeInLeft', {
origin: 'left',
distance: '300px',
easing: 'ease-in-out',
duration: 800,
});
sr.reveal('.js--fadeInRight', {
origin: 'right',
distance: '300px',
easing: 'ease-in-out',
duration: 800,
});
}
sr.reveal('.js--fadeInLeft', {
origin: 'left',
distance: '300px',
easing: 'ease-in-out',
duration: 800,
});
sr.reveal('.js--fadeInRight', {
origin: 'right',
distance: '300px',
easing: 'ease-in-out',
duration: 800,
});
});

87
js/vault.js Normal file
View File

@ -0,0 +1,87 @@
function extractDomain(url) {
var domain;
//find & remove protocol (http, ftp, etc.) and get domain
if (url.indexOf("://") > -1) {
domain = url.split('/')[2];
} else {
domain = url.split('/')[0];
}
domain = domain.split(':')[0];
return domain;
}
function genpass() {
url = document.getElementById("url").value;
url = extractDomain(url);
maxchars = document.getElementById("maxchars").value;
maxchars = parseInt(maxchars, 10);
if (!(maxchars > 0)) maxchars = 512;
salt = document.getElementById("salt").value;
line = any_sha512(salt + url, "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789");
document.getElementById("resAlNum").value = line.substr(0, maxchars);
line = any_sha512(salt + url, "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789,;:!?./*+§#{([-|_@)]=}");
document.getElementById("resAlNumSpe").value = line.substr(0, maxchars);
delete line
url = "";
salt = "";
return false;
}
$(document).ready(function () {
console.log("ready!");
//material contact form animation
var floatingField = $('.material-form .floating-field').find('.form-control');
var formItem = $('.material-form .input-block').find('.form-control');
//##case 1 for default style
//on focus
formItem.focus(function () {
$(this).parent('.input-block').addClass('focus');
});
//removing focusing
formItem.blur(function () {
$(this).parent('.input-block').removeClass('focus');
});
//##case 2 for floating style
//initiating field
floatingField.each(function () {
var targetItem = $(this).parent();
if ($(this).val()) {
$(targetItem).addClass('has-value');
}
});
//on typing
floatingField.blur(function () {
$(this).parent('.input-block').removeClass('focus');
//if value is not exists
if ($(this).val().length == 0) {
$(this).parent('.input-block').removeClass('has-value');
} else {
$(this).parent('.input-block').addClass('has-value');
}
});
//dropdown list
$('body').click(function () {
if ($('.custom-select .drop-down-list').is(':visible')) {
$('.custom-select').parent().removeClass('focus');
}
$('.custom-select .drop-down-list:visible').slideUp();
});
$('.custom-select .active-list').click(function () {
$(this).parent().parent().addClass('focus');
$(this).parent().find('.drop-down-list').stop(true, true).delay(10).slideToggle(300);
});
$('.custom-select .drop-down-list li').click(function () {
var listParent = $(this).parent().parent();
//listParent.find('.active-list').trigger("click");
listParent.parent('.select-block').removeClass('focus').addClass('added');
listParent.find('.active-list').text($(this).text());
listParent.find('input.list-field').attr('value', $(this).text());
});
});