-
Notifications
You must be signed in to change notification settings - Fork 0
/
script2.js
108 lines (99 loc) · 2.78 KB
/
script2.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
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
106
107
108
$(document).ready(function () {
"use strict";
/* Swiper
-------------------------------------------------------*/
//initialize swiper when document ready
var mySwiper = new Swiper(".swiper-container", {
// Navigation arrows
nextButton: ".swiper-button-next",
prevButton: ".swiper-button-prev",
slidesPerView: 2.7,
centeredSlides: true,
breakpoints: {
1440: {
slidesPerView: 2.6
},
1439: {
slidesPerView: 1.45
},
1024: {
slidesPerView: 1.45
},
1023: {
slidesPerView: 2
},
768: {
slidesPerView: 2
},
568: {
slidesPerView: 1.5,
spaceBetween: 10
},
414: {
slidesPerView: 1.09,
spaceBetween: 3
},
320: {
slidesPerView: 1.09,
spaceBetween: 3
}
}
});
/* Info Card
-------------------------------------------------------*/
var $revealCardContentBtn = $(".sl--card-nav-container"),
$contentContainer = $(
".sl-card-wrapper .sl--content-wrapper .sl--content-container"
),
$navGFX = $(
".sl-card-wrapper .sl--content-wrapper .sl--card-nav-container .sl--content-btn .card-nav-gfx"
);
$revealCardContentBtn.on("click", function () {
var parent = $(this).closest(".swiper-slide");
// IC Container
parent.siblings().find($contentContainer).removeClass("sl--card-reveal");
parent.siblings().find($contentContainer).addClass("sl--card-hide");
parent.find($contentContainer).toggleClass("sl--card-hide sl--card-reveal");
// IC Nav wrapper
parent
.siblings()
.find(".sl--content-wrapper")
.removeClass("sl--content-wrapper-active");
parent
.siblings()
.find(".sl--content-wrapper")
.addClass("sl--content-wrapper-inactive");
parent
.find(".sl--content-wrapper")
.toggleClass("sl--content-wrapper-inactive sl--content-wrapper-active");
// IC Nav GFX
parent.siblings().find($navGFX).removeClass("sl--close-card-info");
parent.siblings().find($navGFX).addClass("sl--show-card-info");
parent.find($navGFX).toggleClass("sl--show-card-info sl--close-card-info");
});
/* Hide content on slide change
-------------------------------------------------------*/
mySwiper.on("onSlideChangeStart", function () {
if ($contentContainer.hasClass("sl--card-reveal")) {
var $CI_ContentWrapper = $(".sl--content-wrapper");
$contentContainer.removeClass("sl--card-reveal");
$contentContainer.addClass("sl--card-hide");
$navGFX.removeClass("sl--close-card-info");
$navGFX.addClass("sl--show-card-info");
$CI_ContentWrapper.removeClass("sl--content-wrapper-active");
$CI_ContentWrapper.addClass("sl--content-wrapper-inactive");
}
});
// Media Query
var windowWidth = $(window).width();
if (windowWidth === 320) {
}
if (windowWidth === 375) {
}
if (windowWidth === 414) {
}
if (windowWidth === 768) {
}
if (windowWidth === 1024) {
}
}); //END: $(document)