Skip to content

Commit

Permalink
change gap
Browse files Browse the repository at this point in the history
  • Loading branch information
KristinaHranovska committed Feb 12, 2024
1 parent 5d5c5fc commit ed099a0
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 6 deletions.
6 changes: 2 additions & 4 deletions src/css/exercises.css
Original file line number Diff line number Diff line change
Expand Up @@ -84,8 +84,7 @@
}

.gallery {
column-gap: 14px;
row-gap: 14px;
gap: 28px 20px;
}
}

Expand Down Expand Up @@ -114,8 +113,7 @@
}

.gallery {
column-gap: 20px;
row-gap: 20px;
gap: 20px 14px;
}

.gallery-item {
Expand Down
22 changes: 20 additions & 2 deletions src/js/modal-window.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import { getAccess } from "./helper/get-access";


const backdrop = document.querySelector('.backdrop-thumb');
const closeIcon = document.querySelector('.js-modal-window');
const galleryWindow = document.querySelector('.exercises-card');
Expand All @@ -22,7 +21,6 @@ function openModal(e) {
}
}


// Закриття модального вікна
closeIcon.addEventListener('click', closeModal)

Expand All @@ -31,6 +29,7 @@ function closeModal() {
document.body.style.overflow = '';
}

// Завантаження сторінки
function getExercisesObject(id) {
getAccess({ typeFilter: 'exercises', id: id })
.then(({ data }) => {
Expand All @@ -48,6 +47,20 @@ function getExercisesObject(id) {
descriptionValue: document.querySelector('.js-description'),
}

const ratingPage = parseFloat(rating);

const stars = document.querySelectorAll('.raiting-item .icon-star');

stars.forEach((star, index) => {
if (index < Math.floor(ratingPage)) {
star.classList.remove('non-activ');
} else if (index === Math.floor(ratingPage) && ratingPage % 1 !== 0) {
star.classList.remove('non-activ');
} else {
star.classList.add('non-activ');
}
});

refs.img.setAttribute('src', gifUrl);
refs.title.textContent = name;
refs.raiting.textContent = rating;
Expand All @@ -57,6 +70,11 @@ function getExercisesObject(id) {
refs.popularValue.textContent = popularity;
refs.caloriesValue.textContent = burnedCalories;
refs.descriptionValue.textContent = description;



})
.catch((err) => console.error(err));
}

// Рейтенг

0 comments on commit ed099a0

Please sign in to comment.