/*! ______ _____ _______ _______ _______ _______ ______ _______ | __ \ |_| ___|_ _| | | | __ \ _ | | __/ | ___| | | | | - | < | |___| |_______|_______| |___| |___|___|_______|___|__|___|___| p l e t h o r a t h e m e s . c o m (c) 2014 theme name: cleanstart version: 1.0.2 this file contains necessary javascript for the theme to function properly. */ //===============jquery to perform on dom ready========================================================= jquery(document).ready(function() { "use strict"; trianglesetup(); // flexslider settings & init for the homepage slider jquery('#main_flexslider').flexslider({ namespace: "flex-", //{new} string: prefix string attached to the class of every element generated by the plugin selector: ".slides > li", //{new} selector: must match a simple pattern. '{container} > {slide}' -- ignore pattern at your own peril animation: "slide", //string: select your animation type, "fade" or "slide" easing: "swing", //{new} string: determines the easing method used in jquery transitions. jquery easing plugin is supported! direction: "horizontal", //string: select the sliding direction, "horizontal" or "vertical" reverse: false, //{new} boolean: reverse the animation direction animationloop: true, //boolean: should the animation loop? if false, directionnav will received "disable" classes at either end smoothheight: false, //{new} boolean: allow height of the slider to animate smoothly in horizontal mode startat: 0, //integer: the slide that the slider should start on. array notation (0 = first slide) slideshow: true, //boolean: animate slider automatically slideshowspeed: 7000, //integer: set the speed of the slideshow cycling, in milliseconds animationspeed: 600, //integer: set the speed of animations, in milliseconds initdelay: 0, //{new} integer: set an initialization delay, in milliseconds randomize: false, //boolean: randomize slide order // usability features pauseonaction: true, //boolean: pause the slideshow when interacting with control elements, highly recommended. pauseonhover: true, //boolean: pause the slideshow when hovering over slider, then resume when no longer hovering usecss: true, //{new} boolean: slider will use css3 transitions if available touch: true, //{new} boolean: allow touch swipe navigation of the slider on touch-enabled devices video: false, //{new} boolean: if using video in the slider, will prevent css3 3d transforms to avoid graphical glitches // primary controls controlnav: true, //boolean: create navigation for paging control of each clide? note: leave true for manualcontrols usage directionnav: true, //boolean: create navigation for previous/next navigation? (true/false) prevtext: "previous", //string: set the text for the "previous" directionnav item nexttext: "next", //string: set the text for the "next" directionnav item // callback api start: function(){ //jquery('.flex-active-slide .container .carousel-caption').addclass('show'); }, //callback: function(slider) - fires when the slider loads the first slide before: function(){ jquery('.flex-active-slide .container .carousel-caption').removeclass('show'); jquery(".flexslider .carousel-caption").addclass("wait_for_photo_load").hide(); }, //callback: function(slider) - fires asynchronously with each slider animation after: function(slider){ jquery('.flex-active-slide .container .carousel-caption').addclass('show'); jquery(".flexslider .carousel-caption.show").removeclass("wait_for_photo_load").show(); }, //callback: function(slider) - fires after each slider animation completes end: function(){}, //callback: function(slider) - fires when the slider reaches the last slide (asynchronous) added: function(){}, //{new} callback: function(slider) - fires after a slide is added removed: function(){} //{new} callback: function(slider) - fires after a slide is removed }); // portfolio page flexslider with carousel--------------------------------------------------------------------- jquery('#carousel').flexslider({ animation: "slide", controlnav: false, animationloop: false, slideshow: false, itemwidth: 210, itemmargin: 10, asnavfor: '#portfolio_slider' }); jquery('#portfolio_slider').flexslider({ namespace: "flex-", //{new} string: prefix string attached to the class of every element generated by the plugin selector: ".slides > li", //{new} selector: must match a simple pattern. '{container} > {slide}' -- ignore pattern at your own peril animation: "slide", //string: select your animation type, "fade" or "slide" easing: "swing", //{new} string: determines the easing method used in jquery transitions. jquery easing plugin is supported! direction: "horizontal", //string: select the sliding direction, "horizontal" or "vertical" reverse: false, //{new} boolean: reverse the animation direction animationloop: true, //boolean: should the animation loop? if false, directionnav will received "disable" classes at either end smoothheight: false, //{new} boolean: allow height of the slider to animate smoothly in horizontal mode startat: 0, //integer: the slide that the slider should start on. array notation (0 = first slide) slideshow: false, //boolean: animate slider automatically slideshowspeed: 7000, //integer: set the speed of the slideshow cycling, in milliseconds animationspeed: 600, //integer: set the speed of animations, in milliseconds initdelay: 0, //{new} integer: set an initialization delay, in milliseconds randomize: false, //boolean: randomize slide order // usability features pauseonaction: true, //boolean: pause the slideshow when interacting with control elements, highly recommended. pauseonhover: false, //boolean: pause the slideshow when hovering over slider, then resume when no longer hovering usecss: true, //{new} boolean: slider will use css3 transitions if available touch: true, //{new} boolean: allow touch swipe navigation of the slider on touch-enabled devices video: false, //{new} boolean: if using video in the slider, will prevent css3 3d transforms to avoid graphical glitches // primary controls controlnav: true, //boolean: create navigation for paging control of each clide? note: leave true for manualcontrols usage directionnav: true, //boolean: create navigation for previous/next navigation? (true/false) prevtext: "previous", //string: set the text for the "previous" directionnav item nexttext: "next", //string: set the text for the "next" directionnav item // secondary navigation keyboard: true, //boolean: allow slider navigating via keyboard left/right keys multiplekeyboard: false, //{new} boolean: allow keyboard navigation to affect multiple sliders. default behavior cuts out keyboard navigation with more than one slider present. mousewheel: false, //{updated} boolean: requires jquery.mousewheel.js (https://github.com/brandonaaron/jquery-mousewheel) - allows slider navigating via mousewheel pauseplay: false, //boolean: create pause/play dynamic element pausetext: 'pause', //string: set the text for the "pause" pauseplay item playtext: 'play', //string: set the text for the "play" pauseplay item // special properties controlscontainer: "", //{updated} selector: use class selector. declare which container the navigation elements should be appended too. default container is the flexslider element. example use would be ".flexslider-container". property is ignored if given element is not found. manualcontrols: "", //selector: declare custom control navigation. examples would be ".flex-control-nav li" or "#tabs-nav li img", etc. the number of elements in your controlnav should match the number of slides/tabs. sync: "", //{new} selector: mirror the actions performed on this slider with another slider. use with care. asnavfor: "", //{new} selector: internal property exposed for turning the slider into a thumbnail navigation for another slider // carousel options itemwidth: 0, //{new} integer: box-model width of individual carousel items, including horizontal borders and padding. itemmargin: 0, //{new} integer: margin between carousel items. minitems: 0, //{new} integer: minimum number of carousel items that should be visible. items will resize fluidly when below this. maxitems: 0, //{new} integer: maxmimum number of carousel items that should be visible. items will resize fluidly when above this limit. move: 0, //{new} integer: number of carousel items that should move on animation. if 0, slider will move all visible items. // callback api start: function(){ jquery('.flex-active-slide .container .carousel-caption').addclass('show'); }, //callback: function(slider) - fires when the slider loads the first slide before: function(){ jquery('.flex-active-slide .container .carousel-caption').removeclass('show'); jquery(".flexslider .carousel-caption").addclass("wait_for_photo_load").hide(); }, //callback: function(slider) - fires asynchronously with each slider animation after: function(slider){ jquery('.flex-active-slide .container .carousel-caption').addclass('show'); jquery(".flexslider .carousel-caption.show").removeclass("wait_for_photo_load").show(); }, //callback: function(slider) - fires after each slider animation completes end: function(){}, //callback: function(slider) - fires when the slider reaches the last slide (asynchronous) added: function(){}, //{new} callback: function(slider) - fires after a slide is added removed: function(){} //{new} callback: function(slider) - fires after a slide is removed }); // onepage ------------------------------------------------------------------------------------------------------------- var header_height = jquery('header').outerheight(); var window_height = jquery(window).outerheight(); var rest_height = header_height + 40; var contact_form_overlay_height = jquery('.contact_form_overlay').outerheight(); jquery('.onepage .main section[id]').css( "padding-top", rest_height).css( "padding-bottom", rest_height/2).css( "margin-top", -rest_height); jquery('.onepage #map').css( "height", contact_form_overlay_height ); jquery('.onepage .contact').css( "height", contact_form_overlay_height ); //smooth scrolling to hash id when clicking from the menu var $htmlbody; jquery('.onepage .menu_container a').click(function() { var href = $.attr(this, 'href'); $htmlbody = $htmlbody || jquery('html, body'); $htmlbody.animate({ scrolltop: jquery(href).offset().top }, 500, function () { window.location.hash = href; }); return false; }); // sticky header var full_page_photo_height = jquery('.full_page_photo').outerheight(); var sticky_appear_height = full_page_photo_height - 100; var sticky_nav = jquery('.sticky_header header'); jquery(window).scroll(function () { if (jquery(this).scrolltop() > 4) { jquery('.full_page_photo .flexslider .flex-control-nav').removeclass("show").addclass("disappear"); jquery('#big-video-control-container').removeclass("show").addclass("disappear"); jquery('.full_page_photo .flexslider .flex-direction-nav').hide(); } else { jquery('.full_page_photo .flexslider .flex-control-nav').removeclass("disappear").addclass("show"); jquery('#big-video-control-container').removeclass("disappear").addclass("show"); jquery('.full_page_photo .flexslider .flex-direction-nav').show(); } }); jquery(window).scroll(function () { if (jquery(this).scrolltop() > sticky_appear_height) { sticky_nav.addclass("stuck"); } else { sticky_nav.removeclass("stuck"); } }); var window_top = jquery(window).scrolltop(); if (window_top > full_page_photo_height) { sticky_nav.addclass("stuck"); } else { sticky_nav.removeclass("stuck"); } jquery('.sticky_header .main').css( "top", header_height - 1 ); //onepage map settings var $onepageclosemap = jquery(".onepage .close_map"); var $onepagecontact = jquery(".onepage .contact"); var $onepageopenmap = jquery(".onepage .open_map"); $onepageclosemap.click(function() { $onepagecontact.removeclass( "show_map" ); $onepageclosemap.hide(); $onepageopenmap.show(); }); $onepageopenmap.click(function() { $onepagecontact.addclass( "show_map" ); $onepageopenmap.hide(); $onepageclosemap.show(); }); $onepageclosemap.hide(); // refrain animations untill the photos load-------- //refrain the full_page_photo call_to_action elements from performing their animation untill the photo loads jquery(".full_page_photo .hgroup .hgroup_title").addclass("wait_for_photo_load").hide(); jquery(".full_page_photo .hgroup .hgroup_subtitle").addclass("wait_for_photo_load").hide(); //refrain the flexslider carousel-caption elements from performing their animation untill the photo loads jquery(".flexslider .carousel-caption").addclass("wait_for_photo_load").hide(); // twitter feed if (jquery('#twitter_flexslider').length) { $('#twitter_flexslider').twittie({ username: 'plethorathemes', //option to load tweets from another account or list owner's username. apipath: './js/tweetie/api/tweet.php', //path to your tweet.php file. dateformat: '%b. %d, %y', //your date format template: '
', //format how you want to show your tweets. count: 3, //number of tweets you want to display. ulclass: "slides", //class for the ul element that contains the tweets liclass: "items" //class for the li element that contains each tweet //,list: null //list name to load tweets from. if you define list name you also must define the username of the list owner in the username option. //,hashtag: null //option to load tweets with a specific hashtag. //,hidereplies: false //set true if you want to hide "@" replies as well. or leave it false to just to show your tweets and no replies. }, function() { jquery('#twitter_flexslider').flexslider({ namespace: "flex-", //{new} string: prefix string attached to the class of every element generated by the plugin selector: ".slides > li", //{new} selector: must match a simple pattern. '{container} > {slide}' -- ignore pattern at your own peril animation: "slide", //string: select your animation type, "fade" or "slide" easing: "swing", //{new} string: determines the easing method used in jquery transitions. jquery easing plugin is supported! direction: "vertical", //string: select the sliding direction, "horizontal" or "vertical" reverse: false, //{new} boolean: reverse the animation direction animationloop: true, //boolean: should the animation loop? if false, directionnav will received "disable" classes at either end smoothheight: false, //{new} boolean: allow height of the slider to animate smoothly in horizontal mode startat: 0, //integer: the slide that the slider should start on. array notation (0 = first slide) slideshow: true, //boolean: animate slider automatically slideshowspeed: 5000, //integer: set the speed of the slideshow cycling, in milliseconds animationspeed: 600, //integer: set the speed of animations, in milliseconds initdelay: 0 //{new} integer: set an initialization delay, in milliseconds }); }); } // client list carousel ------------------------------ var client_item_width = 180; var $clientcarousel = $('#clients-list'); var clients = $clientcarousel.children().length; $clientcarousel.css('width',(clients * client_item_width)); var rotating = true; var clientspeed = 1800; var seeclients = setinterval(rotateclients, clientspeed); $(document).on({ // turn off rotation on hover mouseenter: function(){ rotating = false; }, mouseleave: function(){ rotating = true; } }, '#clients'); function rotateclients() { if(rotating) { var $first = $('#clients-list li:first'); $first.animate({ 'margin-left': '-'+client_item_width+'px' }, 600, function() { $first.remove().css({ 'margin-left': '0px' }); $('#clients-list li:last').after($first); }); } } }); //end==================jquery to perform on dom ready============================================================= //=====================jquery to perform on window load=========================================================== jquery(document).ready(function() { "use strict"; window.cleanstartslider = function slidewindow(){ var header_height = jquery('header').outerheight(); var full_page_photo_height = jquery('.full_page_photo').outerheight(); jquery('.sticky_header .main').css( "top", full_page_photo_height ); jquery('.touch .sticky_header .overflow_wrapper').css( "padding-bottom", full_page_photo_height ); jquery('.flex-active-slide .container .carousel-caption').addclass('show'); //settimeout( function() { var window_top = jquery(window).scrolltop(); if (window_top < 4) { //jquery(".full_page_photo .flexslider .flex-control-nav").removeclass("show").addclass("disappear"); //} else { jquery(".full_page_photo .flexslider .flex-control-nav").addclass("show"); jquery("#big-video-control-container").addclass("show"); } //}, 1000 ); //starting the full_page_photo call_to_action elements animations now that the photo is loaded jquery(".full_page_photo .hgroup .hgroup_title").removeclass("wait_for_photo_load").show(); jquery(".full_page_photo .hgroup .hgroup_subtitle").removeclass("wait_for_photo_load").show(); jquery(".flexslider .carousel-caption.show").removeclass("wait_for_photo_load").show(); } cleanstartslider(); // twenty twenty plugin ------------------------------ var $twentytwentycontainer = jquery('.twentytwenty-container'); if ( $twentytwentycontainer.length) { $twentytwentycontainer.twentytwenty({ default_offset_pct: 0.5 }); } // parallax ------------------------------------------ var $window = jquery(window); jquery('.parallax').each(function(){ var $scroll = jquery(this); $window.scroll(function() { if ( $window.scrolltop() + $window.outerheight() >= $scroll.offset().top ) { var ypos = ($window.scrolltop() + $window.outerheight() - $scroll.offset().top) / 10; var coords = '50% '+ (100-ypos) + '%'; } $scroll.css({ backgroundposition: coords }); }); // end window scroll }); // end section function //------wow reveal on scroll initialization only for no-touch devices------------------ if (jquery('.no-touch').length) { var wow = new wow( { animateclass: 'animated', offset: 100 } ); wow.init(); } //end---wow----------------------------------------- //------lightbox with all its settings-------------- var activityindicatoron = function() { jquery( '{{user_name}} / {{screen_name}} • {{date}}
{{tweet}}