Skip to content

Commit

Permalink
Merge pull request #38 from ViktorSvertoka/modal-exercise
Browse files Browse the repository at this point in the history
  • Loading branch information
ViktorSvertoka authored Dec 16, 2023
2 parents d5b5660 + 2e24a59 commit 00c3053
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions src/js/05-modal-exercises.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
import APIService from './00-api';
import icons from '../img/sprite.svg';
import image from '../img/modal-exercise-image.jpg';
import imageRetina from '../img/[email protected]';
const apiService = new APIService();

const modalExercises = document.querySelector('.modal-exercises');
Expand Down Expand Up @@ -104,8 +107,8 @@ function createMarkup({
const getExerciseGif = getGif(gifUrl);
function getGif(gifUrl) {
if (gifUrl === null || !gifUrl) {
return `srcset = './img/modal-exercise-image.jpg 1x,./img/[email protected] 2x'
src = './img/modal-exercise-image.jpg'`;
return `srcset = '${image} 1x,${imageRetina} 2x'
src = '${image}'`;
}
return `src="${gifUrl}"`;
}
Expand All @@ -114,7 +117,7 @@ function createMarkup({
<div class="modal-exercises__container" data-id="${_id}">
<button class="modal-exercises__btn-close">
<svg width="24" height="24">
<use href="../img/sprite.svg#icon-menu-mobile-close"></use>
<use href="${icons}#icon-menu-mobile-close"></use>
</svg>
</button>
Expand Down Expand Up @@ -163,7 +166,7 @@ function createMarkup({
<button class="modal-exercises__btn-favorites modal-exercises__btn" data-id="${_id}">
Add to favorites
<svg class="btn-favorites__icon">
<use href="../img/sprite.svg#icon-favorites"></use>
<use href="${icons}#icon-favorites"></use>
</svg>
</button>
<button class="modal-exercises__btn-rating modal-exercises__btn">Give a rating</button>
Expand Down

0 comments on commit 00c3053

Please sign in to comment.