| Current Path : /home/kamilrogam/CV/assets/ |
| Current File : /home/kamilrogam/CV/assets/main.js |
var windowWidth;
var calc = function () {
windowWidth = window.innerWidth;
if (windowWidth < 1200) {
$('.toggle-sensitive').hide();
} else {
$('.toggle-sensitive').show();
}
};
$(document).ready(function () {
calc();
$('.process-bar').css({
width: 0
});
$('.process-bar').each(function () {
dataProcess = $(this).attr('data-process');
$(this).delay(1000).animate({
width: dataProcess + '%'
}, 800);
});
$('a[href^="#"]').click(function () {
target = $(this.hash);
if (target[0].id === 'about-me' || target[0].id === 'education' || target[0].id === 'experience' || target[0].id === 'achievements' || windowWidth < 1200) {
targetOffset = $(target).offset().top - 50;
} else {
targetOffset = $(target).offset().top;
}
$('html, body').animate({
'scrollTop': targetOffset
}, 800);
if (windowWidth < 1200) {
$('#' + target[0].id + '>.toggle-sensitive').slideToggle(800);
$(this).toggleClass('active');
}
});
});
$(window).resize(function () {
calc();
});