Documente Academic
Documente Profesional
Documente Cultură
* Glint - Main JS
*
* ------------------------------------------------------------------- */
(function($) {
"use strict";
var cfg = {
scrollDuration : 800, // smoothscroll duration
mailChimpURL : 'https://facebook.us8.list-manage.com/subscribe/post?
u=cdb7b577e41181934ed6a6a44&id=e6957d85dc' // mailchimp url
},
$WIN = $(window);
/* Preloader
* -------------------------------------------------- */
var clPreloader = function() {
$("html").addClass('cl-preload');
$WIN.on('load', function() {
});
};
/* Menu on Scrolldown
* ------------------------------------------------------ */
var clMenuOnScrolldown = function() {
$WIN.on('scroll', function() {
});
};
/* OffCanvas Menu
* ------------------------------------------------------ */
var clOffCanvas = function() {
};
/* photoswipe
* ----------------------------------------------------- */
var clPhotoswipe = function() {
var items = [],
$pswp = $('.pswp')[0],
$folioItems = $('.item-folio');
// get items
$folioItems.each( function(i) {
var item = {
src : $href,
w : $width,
h : $height
}
if ($caption.length > 0) {
item.title = $.trim($titleText + $captionText);
}
items.push(item);
});
$(this).on('click', function(e) {
e.preventDefault();
var options = {
index: i,
showHideOpacity: true
}
// initialize PhotoSwipe
var lightBox = new PhotoSwipe($pswp, PhotoSwipeUI_Default,
items, options);
lightBox.init();
});
});
};
/* Stat Counter
* ------------------------------------------------------ */
var clStatCount = function() {
statSection.waypoint({
handler: function(direction) {
stats.each(function () {
var $this = $(this);
},
offset: "90%"
});
};
/* Masonry
* ---------------------------------------------------- */
var clMasonryFolio = function () {
containerBricks.imagesLoaded(function () {
containerBricks.masonry({
itemSelector: '.masonry__brick',
resize: true
});
});
};
/* slick slider
* ------------------------------------------------------ */
var clSlickSlider = function() {
$('.clients').slick({
arrows: false,
dots: true,
infinite: true,
slidesToShow: 6,
slidesToScroll: 2,
//autoplay: true,
pauseOnFocus: false,
autoplaySpeed: 1000,
responsive: [
{
breakpoint: 1200,
settings: {
slidesToShow: 5
}
},
{
breakpoint: 1000,
settings: {
slidesToShow: 4
}
},
{
breakpoint: 800,
settings: {
slidesToShow: 3,
slidesToScroll: 2
}
},
{
breakpoint: 500,
settings: {
slidesToShow: 2,
slidesToScroll: 2
}
}
]
});
$('.testimonials').slick({
arrows: true,
dots: false,
infinite: true,
slidesToShow: 1,
slidesToScroll: 1,
adaptiveHeight: true,
pauseOnFocus: false,
autoplaySpeed: 1500,
responsive: [
{
breakpoint: 900,
settings: {
slidesToShow: 1,
slidesToScroll: 1
}
},
{
breakpoint: 800,
settings: {
arrows: false,
dots: true
}
}
]
});
};
/* Smooth Scrolling
* ------------------------------------------------------ */
var clSmoothScroll = function() {
e.preventDefault();
e.stopPropagation();
$('html, body').stop().animate({
'scrollTop': $target.offset().top
}, cfg.scrollDuration, 'swing').promise().done(function () {
window.location.hash = target;
});
});
};
/* Alert Boxes
* ------------------------------------------------------ */
var clAlertBoxes = function() {
};
/* Contact Form
* ------------------------------------------------------ */
var clContactForm = function() {
/* local validation */
$('#contactForm').validate({
$.ajax({
type: "POST",
url: "inc/sendEmail.php",
data: $(form).serialize(),
beforeSend: function() {
sLoader.slideDown("slow");
},
success: function(msg) {
},
error: function() {
sLoader.slideUp("slow");
$('.message-warning').html("Something went wrong. Please
try again.");
$('.message-warning').slideDown("slow");
});
}
});
};
/* Animate On Scroll
* ------------------------------------------------------ */
var clAOS = function() {
AOS.init( {
offset: 200,
duration: 600,
easing: 'ease-in-sine',
delay: 300,
once: true,
disable: 'mobile'
});
};
/* AjaxChimp
* ------------------------------------------------------ */
var clAjaxChimp = function() {
$('#mc-form').ajaxChimp({
language: 'es',
url: cfg.mailChimpURL
});
// Mailchimp translation
//
// Defaults:
// 'submit': 'Submitting...',
// 0: 'We have sent you a confirmation email',
// 1: 'Please enter a value',
// 2: 'An email address must contain a single @',
// 3: 'The domain portion of the email address is invalid (the portion
after the @: )',
// 4: 'The username portion of the email address is invalid (the portion
before the @: )',
// 5: 'This email address looks fake or invalid. Please enter a real email
address'
$.ajaxChimp.translations.es = {
'submit': 'Submitting...',
0: '<i class="fa fa-check"></i> We have sent you a confirmation email',
1: '<i class="fa fa-warning"></i> You must enter a valid e-mail
address.',
2: '<i class="fa fa-warning"></i> E-mail address is not valid.',
3: '<i class="fa fa-warning"></i> E-mail address is not valid.',
4: '<i class="fa fa-warning"></i> E-mail address is not valid.',
5: '<i class="fa fa-warning"></i> E-mail address is not valid.'
}
};
/* Back to Top
* ------------------------------------------------------ */
var clBackToTop = function() {
/* Initialize
* ------------------------------------------------------ */
(function ssInit() {
clPreloader();
clMenuOnScrolldown();
clOffCanvas();
clPhotoswipe();
clStatCount();
clMasonryFolio();
clSlickSlider();
clSmoothScroll();
clPlaceholder();
clAlertBoxes();
clContactForm();
clAOS();
clAjaxChimp();
clBackToTop();
})();
})(jQuery);