{"id":3311,"date":"2022-05-31T11:14:20","date_gmt":"2022-05-31T10:14:20","guid":{"rendered":"https:\/\/dev.archevio.cz\/?page_id=3311"},"modified":"2025-04-28T10:31:42","modified_gmt":"2025-04-28T09:31:42","slug":"projects","status":"publish","type":"page","link":"https:\/\/dev.archevio.cz\/en\/projects\/","title":{"rendered":"Projects"},"content":{"rendered":"<div class=\"et_pb_section et_pb_section_0  et_pb_css_mix_blend_mode et_section_regular\" >\n\t\t\t\t\n\t\t\t\t\n\t\t\t\t\n\t\t\t\t\n\t\t\t\t\n\t\t\t\t\n\t\t\t\t<div class=\"et_pb_row et_pb_row_0  et_pb_css_mix_blend_mode\">\n\t\t\t\t<div class=\"et_pb_column et_pb_column_4_4 et_pb_column_0  et_pb_css_mix_blend_mode et-last-child\">\n\t\t\t\t\n\t\t\t\t\n\t\t\t\t\n\t\t\t\t\n\t\t\t\t<div class=\"et_pb_module et_pb_code et_pb_code_0 code-embed-iframe\">\n\t\t\t\t\n\t\t\t\t\n\t\t\t\t\n\t\t\t\t\n\t\t\t\t<div class=\"et_pb_code_inner\"><script type=\"text\/javascript\" id=\"ajax_filter_script\">\n  \/\/** Cache selectors\n  var $filter = jQuery('#filter');\n  var $response = jQuery('#response');\n  var $pagination = jQuery('.pagination');\n  var $referenceFilter = jQuery('input.reference-filter');\n\n  var isLoading = false;\n  let urlParams = new URLSearchParams(window.location.search);\n  let secondPageLoad = urlParams.get('secondpage');\n  let currentPage = secondPageLoad ? 2 : 1;\n\n  function clickPrevPage(button) {\n    jQuery('.pagination').fadeOut(1000, function () { jQuery(this).remove(); });\n    currentPage--;\n    $filter.submit();\n    var target = jQuery('.reference-filter-section');\n    setTimeout(function () {\n      et_pb_smooth_scroll(target, false, 1000, 'linear');\n    }, 0);\n  };\n\n  function clickNextPage(button) {\n    console.log('currentPage: ' + currentPage);\n    if (isLoading) {\n      return false; \/\/ Prevent the creation of another \"Load more\" button\n    }\n    isLoading = true; \/\/ Set the loading state to true\n    jQuery('.pagination').fadeOut(1000, function () { jQuery(this).remove(); });\n    currentPage++;\n    console.log('new currentPage: ' + currentPage);\n\n    \/\/ Get the category ID from the URL\n    let urlParams = new URLSearchParams(window.location.search);\n    let catId = urlParams.get('cat');\n\n    var data = $filter.serializeArray();\n    data.push({ name: 'paged', value: currentPage });\n    data.push({ name: 'cat', value: catId });\n\n    jQuery.ajax({\n      url: $filter.attr('action'),\n      data: data,\n      type: $filter.attr('method'), \/\/ POST\n      success: function (data) {\n        var $data = jQuery(data);\n        $data.find('.pagination').remove(); \/\/ Remove the \"Load more\" button from the data\n        $response.append($data).fadeIn(1000); \/\/ append data\n        isLoading = false; \/\/ Set the loading state to false when the data is loaded\n      }\n    });\n    return false;\n  };\n\n  \/\/* scroll to second page first post if double load\n  jQuery(document).ready(function () {\n    if (secondPageLoad) {\n      setTimeout(function () {\n        var secondPageFirstPost = jQuery('.reference-vypis .grid-posts .project-8'); \/\/ adjust the selector as per your HTML structure\n        jQuery('html, body').animate({\n          scrollTop: secondPageFirstPost.offset().top\n        }, 500);\n      }, 500); \/\/ delay of 1 second\n    }\n  });\n  \/\/* add class to active filter\n  \/\/ On page load\n  document.addEventListener('DOMContentLoaded', (event) => {\n    \/\/ Get the category ID from the URL\n    let urlParams = new URLSearchParams(window.location.search);\n    let catId = urlParams.get('cat');\n    \/\/ If a category ID is present in the URL\n    if (catId) {\n      \/\/ Remove the \"active\" class from all links\n      document.querySelectorAll('li a').forEach((link) => {\n        link.classList.remove('active');\n      });\n      \/\/ Add the \"active\" class to the link with the selected category ID\n      let link = document.getElementById(catId);\n      if (link) {\n        link.classList.add('active');\n      }\n    }\n  });\n  \/\/ On click on a link\n  document.querySelectorAll('li a').forEach((link) => {\n    link.addEventListener('click', (event) => {\n      \/\/ Remove the \"active\" class from all links\n      document.querySelectorAll('li a').forEach((link) => {\n        link.classList.remove('active');\n      });\n\n      \/\/ Add the \"active\" class to the clicked link\n      event.target.classList.add('active');\n    });\n  });\n  \/\/* MOBILE PROJECT MENU FUNCTIONS\n  jQuery(document).ready(function($) {\n    var $filterForm = $('.reference-filter-form');\n    var $filterMenuToggle = $('.filter-menu-toggle');\n\n    var updateActiveFilterText = function(selectedInput) {\n        var text = selectedInput && selectedInput.next('label').text() ? selectedInput.next('label').text() : \"Categories\";\n        $(\".active-filter-text\").text(text);\n    };\n\n    var toggleFilterMenu = function() {\n        if (window.innerWidth <= 980) {\n            $filterForm.toggleClass('filter-menu-visible');\n\n            \/\/* Add slide-down and slide-up animations to mobile menu toggle\n            if ($filterForm.hasClass('filter-menu-visible')) {\n                $filterMenuToggle.addClass('opened');\n                $filterForm.css('height', 'auto');\n                var height = $filterForm[0].clientHeight + 'px';\n                $filterForm.css('height', '0');\n                setTimeout(function() { $filterForm.css('height', height); }, 0);\n            } else {\n                $filterMenuToggle.removeClass('opened');\n                $filterForm.css('height', $filterForm[0].clientHeight + 'px');\n                setTimeout(function() { $filterForm.css('height', '0'); }, 10);\n            }\n        }\n    };\n\n    \/\/* Initialize the active filter text\n    updateActiveFilterText($filterForm.find('input[type=\"radio\"]:checked'));\n\n    \/\/* Add click event listener to the filter menu toggle button\n    $filterMenuToggle.on('click', toggleFilterMenu);\n\n    \/\/* Add change event listener to all radio inputs inside .reference-filter-form\n    $filterForm.find('input[type=\"radio\"]').on('change', function() {\n        updateActiveFilterText($(this));\n    });\n\n    \/\/* Add click event listener to all labels inside .filter-menu\n    $filterForm.find('label').on('click', toggleFilterMenu);\n  });\n<\/script><\/div>\n\t\t\t<\/div>\n\t\t\t<\/div>\n\t\t\t\t\n\t\t\t\t\n\t\t\t\t\n\t\t\t\t\n\t\t\t<\/div>\n\t\t\t\t\n\t\t\t\t\n\t\t\t<\/div>\n","protected":false},"excerpt":{"rendered":"","protected":false},"author":2,"featured_media":3312,"parent":0,"menu_order":0,"comment_status":"closed","ping_status":"closed","template":"devpage-project-filter.php","meta":{"_acf_changed":false,"_et_pb_use_builder":"on","_et_pb_old_content":"","_et_gb_content_width":"","footnotes":""},"class_list":["post-3311","page","type-page","status-publish","has-post-thumbnail","hentry"],"acf":[],"_links":{"self":[{"href":"https:\/\/dev.archevio.cz\/en\/wp-json\/wp\/v2\/pages\/3311","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/dev.archevio.cz\/en\/wp-json\/wp\/v2\/pages"}],"about":[{"href":"https:\/\/dev.archevio.cz\/en\/wp-json\/wp\/v2\/types\/page"}],"author":[{"embeddable":true,"href":"https:\/\/dev.archevio.cz\/en\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/dev.archevio.cz\/en\/wp-json\/wp\/v2\/comments?post=3311"}],"version-history":[{"count":3,"href":"https:\/\/dev.archevio.cz\/en\/wp-json\/wp\/v2\/pages\/3311\/revisions"}],"predecessor-version":[{"id":12574,"href":"https:\/\/dev.archevio.cz\/en\/wp-json\/wp\/v2\/pages\/3311\/revisions\/12574"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/dev.archevio.cz\/en\/wp-json\/wp\/v2\/media\/3312"}],"wp:attachment":[{"href":"https:\/\/dev.archevio.cz\/en\/wp-json\/wp\/v2\/media?parent=3311"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}