This repository has been archived on 2024-06-06. You can view files and clone it, but cannot push or open issues or pull requests.
portfolios_exemple3_abandon/static/js/main.js

69 lines
1.5 KiB
JavaScript
Raw Permalink Normal View History

2021-12-14 14:46:02 +01:00
/*
*=================================
* Hugo UILite Portfolio v0.8
*=================================
*
* Free version https://uicard.io/products/hugo-uilite
* Pro version https://uicard.io/products/hugo-uilite-pro
* Demo https://demo.uicard.io/hugo-uilite-portfolio-demo/
*
* Coded By UICardio
*
* The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
*
*/
let menuBtn = $("#menuBar");
menuBtn.click(function() {
$('.hamburger-menu').toggleClass('animate');
if ($(".secondaryMenu").hasClass("active")) {
$(".secondaryMenu").removeClass("active");
setTimeout(function() {
$(".primaryMenu").addClass("active");
}, 400);
} else {
$(".primaryMenu").removeClass("active");
setTimeout(function() {
$(".secondaryMenu").addClass("active");
}, 350);
}
});
function scrollTo(target) {
const top = $(target).offset().top;
const duration = 500;
const changeHash = function() {
location.hash = target
};
$("html, body").animate({ scrollTop: top }, duration, changeHash);
}
$(document).ready(function() {
var elements = $(".sidebar > .main-info *");
console.log(elements);
for (let i = 0; i < elements.length; i++) {
setTimeout(function() {
$(elements[i].tagName).addClass("bs");
}, (400 * i) - 90 * i);
}
setTimeout(function() {
$(".main-content").addClass("active");
}, 1900);
$("#sidebar a.btn[href='#contact']").on("click", function (event) {
event.preventDefault();
scrollTo($.attr(this, "href"));
});
});