-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathapp.js
More file actions
105 lines (66 loc) · 2.01 KB
/
Copy pathapp.js
File metadata and controls
105 lines (66 loc) · 2.01 KB
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
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
const modalCall = $("[data-modal]");
const modalClose = $("[data-close]");
modalCall.on("click",function(event){
event.preventDefault();
let $this = $(this);
let modalId = $this.data('modal');
$(modalId).addClass('show');
$("body").addClass('no-scroll');
setTimeout(function() {
$(modalId).find(".modal__dialog").css({
transform: "scale(1)"
});
}, 200);
});
modalClose.on("click", function(event) {
event.preventDefault();
let $this = $(this);
let modalParent = $this.parents('.modal');
modalParent.find(".modal__dialog").css({
transform: "scale(0)"
});
setTimeout(function() {
modalParent.removeClass('show');
$("body").removeClass('no-scroll');
}, 200);
});
$(".modal").on("click", function(event) {
let $this = $(this);
$this.find(".modal__dialog").css({
transform: "scale(0)"
});
setTimeout(function() {
$this.removeClass('show');
$("body").removeClass('no-scroll');
$(".modal__dialog").on("click", function(event) {
event.stopPropagation();
});
}, 200);
});
/* Slider: https://kenwheeler.github.io/slick/
=====================*/
const worksSlider = $('[data-slider="slick"]');
worksSlider.slick({
infinite: true,
slidesToShow: 1,
slidesToScroll: 1,
fade: true,
arrows: false,
dots: true
});
$(".slickPrev").on("click", function(event) {
event.preventDefault();
let currentSlider = $(this).parents('.modal').find('[data-slider="slick"]');
currentSlider.slick("slickPrev");
});
$(".slickNext").on("click", function(event) {
event.preventDefault();
let currentSlider = $(this).parents('.modal').find('[data-slider="slick"]');
currentSlider.slick("slickNext");
});
const navToggle = $("#navToggle")
const nav = $("#nav")
navToggle.on("click", function(event) {
event.preventDefault();
nav.toggleClass("show")
})