', thumb : '', url : ''},
{image : 'http://mandm2014.cafe24.com/bizdemo25289/img/images/_include/img/slider-images/image04.jpg', title : '
', thumb : '', url : ''}
],
// Theme Options
progress_bar : 0, // Timer for each slide
mouse_scrub : 0
});
}
/* ==================================================
Navigation Fix
================================================== */
BRUSHED.nav = function(){
$('.sticky-nav').waypoint('sticky');
}
/* ==================================================
Filter Works
================================================== */
BRUSHED.filter = function (){
if($('#projects').length > 0){
var $container = $('#projects');
$container.imagesLoaded(function() {
$container.isotope({
// options
animationEngine: 'best-available',
itemSelector : '.item-thumbs',
layoutMode : 'fitRows'
});
});
// filter items when filter link is clicked
var $optionSets = $('#options .option-set'),
$optionLinks = $optionSets.find('a');
$optionLinks.click(function(){
var $this = $(this);
// don't proceed if already selected
if ( $this.hasClass('selected') ) {
return false;
}
var $optionSet = $this.parents('.option-set');
$optionSet.find('.selected').removeClass('selected');
$this.addClass('selected');
// make option object dynamically, i.e. { filter: '.my-filter-class' }
var options = {},
key = $optionSet.attr('data-option-key'),
value = $this.attr('data-option-value');
// parse 'false' as false boolean
value = value === 'false' ? false : value;
options[ key ] = value;
if ( key === 'layoutMode' && typeof changeLayoutMode === 'function' ) {
// changes in layout modes need extra logic
changeLayoutMode( $this, options )
} else {
// otherwise, apply new options
$container.isotope( options );
}
return false;
});
}
}
/* ==================================================
FancyBox
================================================== */
BRUSHED.fancyBox = function(){
if($('.fancybox').length > 0 || $('.fancybox-media').length > 0 || $('.fancybox-various').length > 0){
$(".fancybox").fancybox({
padding : 0,
beforeShow: function () {
this.title = $(this.element).attr('title');
this.title = '
' + this.title + '
' + '
' + $(this.element).parent().find('img').attr('alt') + '
';
},
helpers : {
title : { type: 'inside' },
}
});
$('.fancybox-media').fancybox({
openEffect : 'none',
closeEffect : 'none',
helpers : {
media : {}
}
});
}
}
/* ==================================================
Contact Form
================================================== */
BRUSHED.contactForm = function(){
$("#contact-submit").on('click',function() {
$contact_form = $('#contact-form');
var fields = $contact_form.serialize();
$.ajax({
type: "POST",
url: "_include/php/contact.php",
data: fields,
dataType: 'json',
success: function(response) {
if(response.status){
$('#contact-form input').val('');
$('#contact-form textarea').val('');
}
$('#response').empty().html(response.html);
}
});
return false;
});
}
/* ==================================================
Twitter Feed
================================================== */
BRUSHED.tweetFeed = function(){
var valueTop = -64; // Margin Top Value
$("#ticker").tweet({
modpath: '_include/js/twitter/',
username: "Bluxart", // Change this with YOUR ID
page: 1,
avatar_size: 0,
count: 10,
template: "{text}{time}",
filter: function(t){ return ! /^@\w+/.test(t.tweet_raw_text); },
loading_text: "loading ..."
}).bind("loaded", function() {
var ul = $(this).find(".tweet_list");
var ticker = function() {
setTimeout(function() {
ul.find('li:first').animate( {marginTop: valueTop + 'px'}, 500, 'linear', function() {
$(this).detach().appendTo(ul).removeAttr('style');
});
ticker();
}, 5000);
};
ticker();
});
}
/* ==================================================
Menu Highlight
================================================== */
BRUSHED.menu = function(){
$('#menu-nav, #menu-nav-mobile').onePageNav({
currentClass: 'current',
changeHash: false,
scrollSpeed: 750,
scrollOffset: 30,
scrollThreshold: 0.5,
easing: 'easeOutExpo',
filter: ':not(.external)'
});
}
/* ==================================================
Next Section
================================================== */
BRUSHED.goSection = function(){
$('#nextsection').on('click', function(){
$target = $($(this).attr('href')).offset().top-30;
$('body, html').animate({scrollTop : $target}, 750, 'easeOutExpo');
return false;
});
}
/* ==================================================
GoUp
================================================== */
BRUSHED.goUp = function(){
$('#goUp').on('click', function(){
$target = $($(this).attr('href')).offset().top-30;
$('body, html').animate({scrollTop : $target}, 750, 'easeOutExpo');
return false;
});
}
/* ==================================================
Scroll to Top
================================================== */
BRUSHED.scrollToTop = function(){
var windowWidth = $(window).width(),
didScroll = false;
var $arrow = $('#back-to-top');
$arrow.click(function(e) {
$('body,html').animate({ scrollTop: "0" }, 750, 'easeOutExpo' );
e.preventDefault();
})
$(window).scroll(function() {
didScroll = true;
});
setInterval(function() {
if( didScroll ) {
didScroll = false;
if( $(window).scrollTop() > 1000 ) {
$arrow.css('display', 'block');
} else {
$arrow.css('display', 'none');
}
}
}, 250);
}
/* ==================================================
Thumbs / Social Effects
================================================== */
BRUSHED.utils = function(){
$('.item-thumbs').bind('touchstart', function(){
$(".active").removeClass("active");
$(this).addClass('active');
});
$('.image-wrap').bind('touchstart', function(){
$(".active").removeClass("active");
$(this).addClass('active');
});
$('#social ul li').bind('touchstart', function(){
$(".active").removeClass("active");
$(this).addClass('active');
});
}
/* ==================================================
Accordion
================================================== */
BRUSHED.accordion = function(){
var accordion_trigger = $('.accordion-heading.accordionize');
accordion_trigger.delegate('.accordion-toggle','click', function(event){
if($(this).hasClass('active')){
$(this).removeClass('active');
$(this).addClass('inactive');
}
else{
accordion_trigger.find('.active').addClass('inactive');
accordion_trigger.find('.active').removeClass('active');
$(this).removeClass('inactive');
$(this).addClass('active');
}
event.preventDefault();
});
}
/* ==================================================
Toggle
================================================== */
BRUSHED.toggle = function(){
var accordion_trigger_toggle = $('.accordion-heading.togglize');
accordion_trigger_toggle.delegate('.accordion-toggle','click', function(event){
if($(this).hasClass('active')){
$(this).removeClass('active');
$(this).addClass('inactive');
}
else{
$(this).removeClass('inactive');
$(this).addClass('active');
}
event.preventDefault();
});
}
/* ==================================================
Tooltip
================================================== */
BRUSHED.toolTip = function(){
$('a[data-toggle=tooltip]').tooltip();
}
/* ==================================================
Init
================================================== */
BRUSHED.slider();
$(document).ready(function(){
Modernizr.load([
{
test: Modernizr.placeholder,
nope: '_include/js/placeholder.js',
complete : function() {
if (!Modernizr.placeholder) {
Placeholders.init({
live: true,
hideOnFocus: false,
className: "yourClass",
textColor: "#999"
});
}
}
}
]);
// Preload the page with jPreLoader
$('body').jpreLoader({
splashID: "#jSplash",
showSplash: true,
showPercentage: true,
autoClose: true,
splashFunction: function() {
$('#circle').delay(250).animate({'opacity' : 1}, 500, 'linear');
}
});
BRUSHED.nav();
BRUSHED.mobileNav();
BRUSHED.listenerMenu();
BRUSHED.menu();
BRUSHED.goSection();
BRUSHED.goUp();
BRUSHED.filter();
BRUSHED.fancyBox();
BRUSHED.contactForm();
BRUSHED.tweetFeed();
BRUSHED.scrollToTop();
BRUSHED.utils();
BRUSHED.accordion();
BRUSHED.toggle();
BRUSHED.toolTip();
});
$(window).resize(function(){
BRUSHED.mobileNav();
});
});