$(document).ready(function () { $('#menu').click(function () { $(this).toggleClass('fa-times'); $('.navbar').toggleClass('nav-toggle'); }); $(window).on('scroll load', function () { $('#menu').removeClass('fa-times'); $('.navbar').removeClass('nav-toggle'); if (window.scrollY > 60) { document.querySelector('#scroll-top').classList.add('active'); } else { document.querySelector('#scroll-top').classList.remove('active'); } }); }); document.addEventListener('visibilitychange', function () { if (document.visibilityState === "visible") { document.title = "Projects | ScriptJacker"; $("#favicon").attr("href", "/assets/images/favicon.png"); } else { document.title = "Come Back To ScriptJacker"; $("#favicon").attr("href", "/assets/images/favhand.png"); } }); // fetch projects start function getProjects() { return fetch("projects.json") .then(response => response.json()) .then(data => { return data }); } function showProjects(projects) { let projectsContainer = document.querySelector(".work .box-container"); let projectsHTML = ""; projects.forEach(project => { projectsHTML += `
project

${project.name}

${project.desc}

` }); projectsContainer.innerHTML = projectsHTML; // vanilla tilt.js // VanillaTilt.init(document.querySelectorAll(".tilt"), { // max: 20, // }); // // vanilla tilt.js // /* ===== SCROLL REVEAL ANIMATION ===== */ // const srtop = ScrollReveal({ // origin: 'bottom', // distance: '80px', // duration: 1000, // reset: true // }); // /* SCROLL PROJECTS */ // srtop.reveal('.work .box', { interval: 200 }); // isotope filter products var $grid = $('.box-container').isotope({ itemSelector: '.grid-item', layoutMode: 'fitRows', masonry: { columnWidth: 200 } }); // filter items on button click $('.button-group').on('click', 'button', function () { $('.button-group').find('.is-checked').removeClass('is-checked'); $(this).addClass('is-checked'); var filterValue = $(this).attr('data-filter'); $grid.isotope({ filter: filterValue }); }); } getProjects().then(data => { showProjects(data); }) // fetch projects end // disable developer mode document.onkeydown = function (e) { if (e.keyCode == 123) { return false; } if (e.ctrlKey && e.shiftKey && e.keyCode == 'I'.charCodeAt(0)) { return false; } if (e.ctrlKey && e.shiftKey && e.keyCode == 'C'.charCodeAt(0)) { return false; } if (e.ctrlKey && e.shiftKey && e.keyCode == 'J'.charCodeAt(0)) { return false; } if (e.ctrlKey && e.keyCode == 'U'.charCodeAt(0)) { return false; } } // Handle autoclose and open of navbar document.addEventListener("DOMContentLoaded", function () { const researchDropdown = document.getElementById("researchDropdown"); const dropdownContent = researchDropdown.querySelector(".dropdown-content"); // Initially set the dropdown content to "none" dropdownContent.style.display = "none"; researchDropdown.addEventListener("click", function () { dropdownContent.style.display = (dropdownContent.style.display === "block") ? "none" : "block"; }); // Close the dropdown when clicking outside of it window.addEventListener("click", function (event) { if (!researchDropdown.contains(event.target)) { dropdownContent.style.display = "none"; } }); });