Added the files
This commit is contained in:
185
js/init.js
Executable file
185
js/init.js
Executable file
@ -0,0 +1,185 @@
|
||||
/*-----------------------------------------------------------------------------------
|
||||
/*
|
||||
/* Init JS
|
||||
/*
|
||||
-----------------------------------------------------------------------------------*/
|
||||
|
||||
jQuery(document).ready(function($) {
|
||||
|
||||
/*----------------------------------------------------*/
|
||||
/* FitText Settings
|
||||
------------------------------------------------------ */
|
||||
|
||||
setTimeout(function() {
|
||||
$('h1.responsive-headline').fitText(1, { minFontSize: '40px', maxFontSize: '90px' });
|
||||
}, 100);
|
||||
|
||||
|
||||
/*----------------------------------------------------*/
|
||||
/* Smooth Scrolling
|
||||
------------------------------------------------------ */
|
||||
|
||||
$('.smoothscroll').on('click',function (e) {
|
||||
e.preventDefault();
|
||||
|
||||
var target = this.hash,
|
||||
$target = $(target);
|
||||
|
||||
$('html, body').stop().animate({
|
||||
'scrollTop': $target.offset().top
|
||||
}, 800, 'swing', function () {
|
||||
window.location.hash = target;
|
||||
});
|
||||
});
|
||||
|
||||
|
||||
/*----------------------------------------------------*/
|
||||
/* Highlight the current section in the navigation bar
|
||||
------------------------------------------------------*/
|
||||
|
||||
var sections = $("section");
|
||||
var navigation_links = $("#nav-wrap a");
|
||||
|
||||
sections.waypoint({
|
||||
|
||||
handler: function(event, direction) {
|
||||
|
||||
var active_section;
|
||||
|
||||
active_section = $(this);
|
||||
if (direction === "up") active_section = active_section.prev();
|
||||
|
||||
var active_link = $('#nav-wrap a[href="#' + active_section.attr("id") + '"]');
|
||||
|
||||
navigation_links.parent().removeClass("current");
|
||||
active_link.parent().addClass("current");
|
||||
|
||||
},
|
||||
offset: '35%'
|
||||
|
||||
});
|
||||
|
||||
|
||||
/*----------------------------------------------------*/
|
||||
/* Make sure that #header-background-image height is
|
||||
/* equal to the browser height.
|
||||
------------------------------------------------------ */
|
||||
|
||||
$('header').css({ 'height': $(window).height() });
|
||||
$(window).on('resize', function() {
|
||||
|
||||
$('header').css({ 'height': $(window).height() });
|
||||
$('body').css({ 'width': $(window).width() })
|
||||
});
|
||||
|
||||
|
||||
/*----------------------------------------------------*/
|
||||
/* Fade In/Out Primary Navigation
|
||||
------------------------------------------------------*/
|
||||
|
||||
$(window).on('scroll', function() {
|
||||
|
||||
var h = $('header').height();
|
||||
var y = $(window).scrollTop();
|
||||
var nav = $('#nav-wrap');
|
||||
|
||||
if ( (y > h*.20) && (y < h) && ($(window).outerWidth() > 768 ) ) {
|
||||
nav.fadeOut('fast');
|
||||
}
|
||||
else {
|
||||
if (y < h*.20) {
|
||||
nav.removeClass('opaque').fadeIn('fast');
|
||||
}
|
||||
else {
|
||||
nav.addClass('opaque').fadeIn('fast');
|
||||
}
|
||||
}
|
||||
|
||||
});
|
||||
|
||||
|
||||
/*----------------------------------------------------*/
|
||||
/* Modal Popup
|
||||
------------------------------------------------------*/
|
||||
|
||||
$('.item-wrap a').magnificPopup({
|
||||
|
||||
type:'inline',
|
||||
fixedContentPos: false,
|
||||
removalDelay: 200,
|
||||
showCloseBtn: false,
|
||||
mainClass: 'mfp-fade'
|
||||
|
||||
});
|
||||
|
||||
$(document).on('click', '.popup-modal-dismiss', function (e) {
|
||||
e.preventDefault();
|
||||
$.magnificPopup.close();
|
||||
});
|
||||
|
||||
|
||||
/*----------------------------------------------------*/
|
||||
/* Flexslider
|
||||
/*----------------------------------------------------*/
|
||||
$('.flexslider').flexslider({
|
||||
namespace: "flex-",
|
||||
controlsContainer: ".flex-container",
|
||||
animation: 'slide',
|
||||
controlNav: true,
|
||||
directionNav: false,
|
||||
smoothHeight: true,
|
||||
slideshowSpeed: 7000,
|
||||
animationSpeed: 600,
|
||||
randomize: false,
|
||||
});
|
||||
|
||||
/*----------------------------------------------------*/
|
||||
/* contact form
|
||||
------------------------------------------------------*/
|
||||
|
||||
$('form#contactForm button.submit').click(function() {
|
||||
$('form#contactForm button.submit').prop('disabled', true);
|
||||
|
||||
$('#image-loader').fadeIn();
|
||||
|
||||
var contactName = $('#contactForm #contactName').val();
|
||||
var contactEmail = $('#contactForm #contactEmail').val();
|
||||
var contactSubject = $('#contactForm #contactSubject').val();
|
||||
var contactMessage = $('#contactForm #contactMessage').val();
|
||||
var contactCaptcha = $('#g-recaptcha-response').val();
|
||||
|
||||
var data = 'contactName=' + contactName + '&contactEmail=' + contactEmail +
|
||||
'&contactSubject=' + contactSubject + '&contactMessage=' + contactMessage +
|
||||
'&contactCaptcha=' + contactCaptcha;
|
||||
|
||||
$.ajax({
|
||||
|
||||
type: "POST",
|
||||
url: "inc/sendEmail.php",
|
||||
data: data,
|
||||
success: function(msg) {
|
||||
|
||||
// Message was sent
|
||||
if (msg == 'OK') {
|
||||
$('#image-loader').fadeOut();
|
||||
$('#message-warning').hide();
|
||||
$('#contactForm').fadeOut();
|
||||
$('#message-success').fadeIn();
|
||||
}
|
||||
// There was an error
|
||||
else {
|
||||
$('#image-loader').fadeOut();
|
||||
$('#message-warning').html(msg);
|
||||
$('#message-warning').fadeIn();
|
||||
grecaptcha.reset();
|
||||
$('form#contactForm button.submit').prop('disabled', false);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
});
|
||||
return false;
|
||||
});
|
||||
|
||||
|
||||
});
|
6
js/jquery-1.10.2.min.js
vendored
Executable file
6
js/jquery-1.10.2.min.js
vendored
Executable file
File diff suppressed because one or more lines are too long
2
js/jquery-migrate-1.2.1.min.js
vendored
Executable file
2
js/jquery-migrate-1.2.1.min.js
vendored
Executable file
File diff suppressed because one or more lines are too long
43
js/jquery.fittext.js
Executable file
43
js/jquery.fittext.js
Executable file
@ -0,0 +1,43 @@
|
||||
/*global jQuery */
|
||||
/*!
|
||||
* FitText.js 1.1
|
||||
*
|
||||
* Copyright 2011, Dave Rupert http://daverupert.com
|
||||
* Released under the WTFPL license
|
||||
* http://sam.zoy.org/wtfpl/
|
||||
*
|
||||
* Date: Thu May 05 14:23:00 2011 -0600
|
||||
*/
|
||||
|
||||
(function( $ ){
|
||||
|
||||
$.fn.fitText = function( kompressor, options ) {
|
||||
|
||||
// Setup options
|
||||
var compressor = kompressor || 1,
|
||||
settings = $.extend({
|
||||
'minFontSize' : Number.NEGATIVE_INFINITY,
|
||||
'maxFontSize' : Number.POSITIVE_INFINITY
|
||||
}, options);
|
||||
|
||||
return this.each(function(){
|
||||
|
||||
// Store the object
|
||||
var $this = $(this);
|
||||
|
||||
// Resizer() resizes items based on the object width divided by the compressor * 10
|
||||
var resizer = function () {
|
||||
$this.css('font-size', Math.max(Math.min($this.width() / (compressor*10), parseFloat(settings.maxFontSize)), parseFloat(settings.minFontSize)));
|
||||
};
|
||||
|
||||
// Call once to set.
|
||||
resizer();
|
||||
|
||||
// Call on resize. Opera debounces their resize by default.
|
||||
$(window).on('resize.fittext orientationchange.fittext', resizer);
|
||||
|
||||
});
|
||||
|
||||
};
|
||||
|
||||
})( jQuery );
|
1128
js/jquery.flexslider.js
Executable file
1128
js/jquery.flexslider.js
Executable file
File diff suppressed because it is too large
Load Diff
3
js/magnific-popup.js
Executable file
3
js/magnific-popup.js
Executable file
File diff suppressed because one or more lines are too long
4
js/modernizr.js
Executable file
4
js/modernizr.js
Executable file
File diff suppressed because one or more lines are too long
8
js/waypoints.js
Executable file
8
js/waypoints.js
Executable file
@ -0,0 +1,8 @@
|
||||
/*
|
||||
jQuery Waypoints - v1.1.7
|
||||
Copyright (c) 2011-2012 Caleb Troughton
|
||||
Dual licensed under the MIT license and GPL license.
|
||||
https://github.com/imakewebthings/jquery-waypoints/blob/master/MIT-license.txt
|
||||
https://github.com/imakewebthings/jquery-waypoints/blob/master/GPL-license.txt
|
||||
*/
|
||||
(function($,k,m,i,d){var e=$(i),g="waypoint.reached",b=function(o,n){o.element.trigger(g,n);if(o.options.triggerOnce){o.element[k]("destroy")}},h=function(p,o){if(!o){return -1}var n=o.waypoints.length-1;while(n>=0&&o.waypoints[n].element[0]!==p[0]){n-=1}return n},f=[],l=function(n){$.extend(this,{element:$(n),oldScroll:0,waypoints:[],didScroll:false,didResize:false,doScroll:$.proxy(function(){var q=this.element.scrollTop(),p=q>this.oldScroll,s=this,r=$.grep(this.waypoints,function(u,t){return p?(u.offset>s.oldScroll&&u.offset<=q):(u.offset<=s.oldScroll&&u.offset>q)}),o=r.length;if(!this.oldScroll||!q){$[m]("refresh")}this.oldScroll=q;if(!o){return}if(!p){r.reverse()}$.each(r,function(u,t){if(t.options.continuous||u===o-1){b(t,[p?"down":"up"])}})},this)});$(n).bind("scroll.waypoints",$.proxy(function(){if(!this.didScroll){this.didScroll=true;i.setTimeout($.proxy(function(){this.doScroll();this.didScroll=false},this),$[m].settings.scrollThrottle)}},this)).bind("resize.waypoints",$.proxy(function(){if(!this.didResize){this.didResize=true;i.setTimeout($.proxy(function(){$[m]("refresh");this.didResize=false},this),$[m].settings.resizeThrottle)}},this));e.load($.proxy(function(){this.doScroll()},this))},j=function(n){var o=null;$.each(f,function(p,q){if(q.element[0]===n){o=q;return false}});return o},c={init:function(o,n){this.each(function(){var u=$.fn[k].defaults.context,q,t=$(this);if(n&&n.context){u=n.context}if(!$.isWindow(u)){u=t.closest(u)[0]}q=j(u);if(!q){q=new l(u);f.push(q)}var p=h(t,q),s=p<0?$.fn[k].defaults:q.waypoints[p].options,r=$.extend({},s,n);r.offset=r.offset==="bottom-in-view"?function(){var v=$.isWindow(u)?$[m]("viewportHeight"):$(u).height();return v-$(this).outerHeight()}:r.offset;if(p<0){q.waypoints.push({element:t,offset:null,options:r})}else{q.waypoints[p].options=r}if(o){t.bind(g,o)}if(n&&n.handler){t.bind(g,n.handler)}});$[m]("refresh");return this},remove:function(){return this.each(function(o,p){var n=$(p);$.each(f,function(r,s){var q=h(n,s);if(q>=0){s.waypoints.splice(q,1);if(!s.waypoints.length){s.element.unbind("scroll.waypoints resize.waypoints");f.splice(r,1)}}})})},destroy:function(){return this.unbind(g)[k]("remove")}},a={refresh:function(){$.each(f,function(r,s){var q=$.isWindow(s.element[0]),n=q?0:s.element.offset().top,p=q?$[m]("viewportHeight"):s.element.height(),o=q?0:s.element.scrollTop();$.each(s.waypoints,function(u,x){if(!x){return}var t=x.options.offset,w=x.offset;if(typeof x.options.offset==="function"){t=x.options.offset.apply(x.element)}else{if(typeof x.options.offset==="string"){var v=parseFloat(x.options.offset);t=x.options.offset.indexOf("%")?Math.ceil(p*(v/100)):v}}x.offset=x.element.offset().top-n+o-t;if(x.options.onlyOnScroll){return}if(w!==null&&s.oldScroll>w&&s.oldScroll<=x.offset){b(x,["up"])}else{if(w!==null&&s.oldScroll<w&&s.oldScroll>=x.offset){b(x,["down"])}else{if(!w&&s.element.scrollTop()>x.offset){b(x,["down"])}}}});s.waypoints.sort(function(u,t){return u.offset-t.offset})})},viewportHeight:function(){return(i.innerHeight?i.innerHeight:e.height())},aggregate:function(){var n=$();$.each(f,function(o,p){$.each(p.waypoints,function(q,r){n=n.add(r.element)})});return n}};$.fn[k]=function(n){if(c[n]){return c[n].apply(this,Array.prototype.slice.call(arguments,1))}else{if(typeof n==="function"||!n){return c.init.apply(this,arguments)}else{if(typeof n==="object"){return c.init.apply(this,[null,n])}else{$.error("Method "+n+" does not exist on jQuery "+k)}}}};$.fn[k].defaults={continuous:true,offset:0,triggerOnce:false,context:i};$[m]=function(n){if(a[n]){return a[n].apply(this)}else{return a.aggregate()}};$[m].settings={resizeThrottle:200,scrollThrottle:100};e.load(function(){$[m]("refresh")})})(jQuery,"waypoint","waypoints",window);
|
Reference in New Issue
Block a user