123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144 |
- var $cards = $('#items .full-works');
- var $card = $('#items .card');
- var $cat = $('.cat-list .cat a');
- var $img = $('.item #items .img');
- function masonry() {
- var $grid = $cards.masonry({
- itemSelector: '.card',
- columnWidth: '.card',
- percentPosition: true,
- gutter: 10,
- isAnimated: true,
- transitionDuration: '0.5s'
- });
- var $grid2 = $img.masonry({
- itemSelector: '.img-card',
- columnWidth: '.img-card',
- percentPosition: true,
- gutter: 10,
- transitionDuration: '0.2s'
- });
- $(".cat-list .btn a").click(function(e) {
- e.preventDefault();
- $('.active').removeClass('active');
- $(this).addClass('active');
- var filter = $(this).attr("data-filter");
- var self = $('#body-wrapper #items .full-works');
- self.masonryFilter({
- filter: function () {
- if (!filter) return true;
- return $(this).attr("data-filter") == filter;
- }
- });
- });
- $grid.imagesLoaded().progress(function() {
- $grid.masonry();
- });
- $grid2.imagesLoaded().progress(function() {
- $grid2.masonry();
- });
- }
- function filteritem() {
- var $card = $('#body > .card');
- var $cat = $('.cat a');
- var $img = $('#body .img');
- }
- function contact() {
- var $contact = $('header .contact');
- $contact.on('click', function() {
- if ($(this).hasClass('open')) {
- $(this).removeClass('open');
- $(this).addClass('close');
- } else {
- $(this).addClass('open');
- $(this).removeClass('close');
- }
- })
- }
- var $page = $('#page-wrapper.blog');
- function customscroll($page_item) {
- var $page_item = $("body.blog #start, body.item");
- $page_item.mCustomScrollbar({
- theme: "dark",
- scrollbarPosition: "outside",
- scrollInertia: 1000,
- callbacks: {
- onInit: function(){
- $('.top').on('click', function() {
- event.preventDefault()
- $page_item.mCustomScrollbar('scrollTo',['top',null]);
- });
- }
- }
- });
- $("body").mCustomScrollbar({
- theme: "dark",
- scrollbarPosition: "outside",
- callbacks: {
- whileScrolling: function() {
- var pct = this.mcs.topPct;
- if (pct < 1) {
- } else {
- $page.addClass("down");
- $page_item.mCustomScrollbar("disable",true);
- }
- setTimeout(function(){
- $page_item.mCustomScrollbar("update");
- }, 2000);
- }
- }
- });
- }
- function clickscroll() {
- var $btnscroll = $('.scroll');
- $btnscroll.on('click', function() {
- $page.addClass("down");
- })
- }
- function transitionPage() {
- // var $links = $('a');
- // $links.on('click', function(e) {
- // var $link = $(this).attr("href");
- // setTimeout(function() {
- // window.location.href = $link;
- // }, 10000);
- //
- // $links.parents('#top').fadeOut()
- // })
- $("a:not(.filter)").click(function(e) {
- var link = $(this).attr("href");
- $(this).parents('#top').fadeOut()
- setTimeout(function() {
- window.location.href = link;
- }, 600);
- e.preventDefault();
- });
- $('#top').fadeIn(1000).removeClass('hidden');
- }
- jQuery(document).ready(function($) {
- masonry();
- filteritem();
- contact();
- customscroll();
- clickscroll();
- transitionPage();
- // $('#top').fadeIn();
- });
|