-
Notifications
You must be signed in to change notification settings - Fork 0
/
script.js
48 lines (33 loc) · 1.16 KB
/
script.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
$(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');
});
$('.portfolio .button-container .btn').click(function(){
let filter = $(this).attr('data-filter');
if(filter == 'all'){
$('.portfolio .image-container .box').show('400')
}else{
$('.portfolio .image-container .box').not('.'+filter).hide('200');
$('.portfolio .image-container .box').filter('.'+filter).show('400');
}
});
$('#theme-toggler').click(function(){
$(this).toggleClass('fa-sun');
$('body').toggleClass('dark-theme');
});
// smooth scrolling
$('a[href*="#"]').on('click',function(e){
e.preventDefault();
$('html, body').animate({
scrollTop : $($(this).attr('href')).offset().top,
},
500,
'linear'
);
});
});