2021-09-17 09:26:31 -05:00
|
|
|
// Micro Modal [https://micromodal.vercel.app/]
|
|
|
|
|
MicroModal.init({
|
|
|
|
|
onShow: modal => $('.screens-slider').slick('setPosition'),
|
|
|
|
|
disableScroll: true, // default - false
|
|
|
|
|
awaitOpenAnimation: true, // default - false
|
|
|
|
|
awaitCloseAnimation: true // default - false
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
// Slick Slider [https://kenwheeler.github.io/slick/]
|
2025-02-18 14:04:48 -06:00
|
|
|
$(document).ready(function () {
|
2021-09-17 09:26:31 -05:00
|
|
|
let prevButton = '<span class="slick-prev icon-chevron-thin-left"><i class="icono-arrow-right"></i></span>';
|
2025-02-18 14:04:48 -06:00
|
|
|
let nextButton = '<span class="slick-next icon-chevron-thin-right"><i class="icono-arrow-left"></i></span>';
|
2021-09-17 09:26:31 -05:00
|
|
|
$('.screens-slider').slick({
|
|
|
|
|
prevArrow: prevButton,
|
|
|
|
|
nextArrow: nextButton,
|
|
|
|
|
centerMode: true,
|
|
|
|
|
slidesToShow: 3,
|
|
|
|
|
responsive: [
|
|
|
|
|
{
|
|
|
|
|
breakpoint: 768,
|
|
|
|
|
settings: {
|
|
|
|
|
slidesToShow: 1,
|
|
|
|
|
centerMode: false
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
]
|
|
|
|
|
});
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
// Prevent default for modal trigger button
|
|
|
|
|
const btnModal = document.querySelector('.btn-modal');
|
2024-06-07 18:04:39 -05:00
|
|
|
if (btnModal) {
|
|
|
|
|
btnModal.addEventListener('click', (event) => {
|
|
|
|
|
event.preventDefault();
|
|
|
|
|
});
|
|
|
|
|
}
|
2024-01-03 21:18:32 -06:00
|
|
|
|
2025-02-18 14:04:48 -06:00
|
|
|
function renderPlaceholders() {
|
|
|
|
|
const usbButter = document.querySelector('#usb-butter');
|
|
|
|
|
const appstoreCard = document.querySelector('#appstore-card');
|
|
|
|
|
const mapsCard = document.querySelector('#maps-card');
|
|
|
|
|
const conditionalCards = [appstoreCard, usbButter, mapsCard];
|
|
|
|
|
for (let card of conditionalCards) {
|
|
|
|
|
fetch(card.dataset.url)
|
|
|
|
|
.then(response => {
|
|
|
|
|
if (response.status === 200) {
|
|
|
|
|
card.classList.remove("hidden-card");
|
|
|
|
|
if (card.dataset.placeholderId) {
|
|
|
|
|
const placeholder = document.querySelector(`#${card.dataset.placeholderId}`);
|
|
|
|
|
if (placeholder) {
|
|
|
|
|
placeholder.classList.add("hidden-card");
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
2024-01-03 21:18:32 -06:00
|
|
|
}
|
2025-02-18 14:04:48 -06:00
|
|
|
);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
renderPlaceholders();
|