Skip to content
(function($) {
// init Isotope
var $grid = $('.grid').isotope({
itemSelector: '.element-item',
percentPosition: true,
masonry: {
columnWidth: '.grid-sizer',
gutter: '.gutter-sizer'
}
});
var hashType = window.location.hash.substr(1);
if (hashType) {
var hashFilter = "." + hashType;
$grid.isotope({ filter: hashFilter });
var source = $('.button-group');
source.find("button.is-checked").removeClass("is-checked");
source.find("button[data-filter='" + hashFilter + "']").addClass("is-checked");
}
// bind filter button click
$('#filters').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');
});
});
})( jQuery );
(function($) {
$(".word-rotate").each(function() {
var $this = $(this),
itemsWrapper = $(this).find(".word-rotate-items"),
items = itemsWrapper.find("> span"),
firstItem = items.eq(0),
firstItemClone = firstItem.clone(),
itemHeight = 0,
currentItem = 1,
currentTop = 0;
itemHeight = firstItem.height();
itemsWrapper.append(firstItemClone);
$this
.height(itemHeight)
.addClass("active");
setInterval(function() {
currentTop = (currentItem * itemHeight);
itemsWrapper.animate({
top: -(currentTop) + "px"
}, 300, "easeOutQuad", function() {
currentItem++;
if(currentItem > items.length) {
itemsWrapper.css("top", 0);
currentItem = 1;
}
});
}, 2000);
});
})( jQuery );