diff --git a/assets/scroll-top-0dcb77ba.js.map b/assets/scroll-top-0dcb77ba.js.map index 18adbc4..8f11c0f 100644 --- a/assets/scroll-top-0dcb77ba.js.map +++ b/assets/scroll-top-0dcb77ba.js.map @@ -1 +1 @@ -{"version":3,"file":"scroll-top-0dcb77ba.js","sources":["../../src/js/services/api-service.js","../../src/js/services/iziToast.js","../../src/js/spinner.js","../../src/js/quote-of-the-day.js","../../src/js/helper.js","../../src/js/services/paginator-service.js","../../src/js/variables.js","../../src/js/favorites-gallery.js","../../src/img/example-img.jpg","../../src/js/services/storage-fav-cards.js","../../src/img/icons.svg","../../src/js/exercise-popup.js","../../src/js/mob-burger-menu.js","../../src/js/scroll-top.js"],"sourcesContent":["const BASE_URL = 'https://your-energy.b.goit.study/api';\n\nexport const fetchData = async (path, method, body) => {\n const headers = { 'Content-type': 'application/json' };\n const init = { headers, method, body };\n const resp = await fetch(path, init);\n if (!resp.ok) {\n throw new Error(`Error: status: ${resp.status}, ${resp.statusText}`);\n }\n return resp.json();\n};\n\nexport const fetchApi = {\n async getExercises(exercisesParams) {\n const params = new URLSearchParams(exercisesParams);\n const url = `${BASE_URL}/exercises?${params}`;\n return await fetchData(url);\n },\n\n async getExercisesId(id) {\n const url = `${BASE_URL}/exercises/${id}`;\n return await fetchData(url);\n },\n\n async editExercisesIdRating(id, ratingBody) {\n const method = 'PATCH';\n const url = `${BASE_URL}/exercises/${id}/rating`;\n const body = JSON.stringify(ratingBody);\n return await fetchData(url, method, body);\n },\n\n async getExercisesFilter(filterParams) {\n const params = new URLSearchParams(filterParams);\n const url = `${BASE_URL}/filters?${params}`;\n return await fetchData(url);\n },\n\n async getExercisesQuote() {\n const url = `${BASE_URL}/quote`;\n return await fetchData(url);\n },\n\n async addSubscription(subscriptionBody) {\n const method = 'POST';\n const url = `${BASE_URL}/subscription`;\n const body = JSON.stringify(subscriptionBody);\n return await fetchData(url, method, body);\n },\n};\n","import iziToast from 'izitoast';\nimport 'izitoast/dist/css/iziToast.min.css';\n\nexport const showIziToast = (message, color, time) => {\n iziToast.show({\n message,\n drag: true,\n close: false,\n timeout: time ?? 5000,\n position: 'topRight',\n messageColor: '#2a2a2a',\n closeOnClick: true,\n animateInside: true,\n backgroundColor: color ?? '#fca664',\n });\n};\n","export const setSpinner = function (status) {\n const spinnerEl = document.querySelector('.js-spinner');\n status\n ? spinnerEl.classList.remove('hidden')\n : setTimeout(() => spinnerEl.classList.add('hidden'), 300);\n};\n","import { fetchApi } from './services/api-service';\nimport { showIziToast } from './services/iziToast';\nimport { setSpinner } from './spinner';\n\nconst quote = {\n content: document.querySelector('.js-quote-content'),\n author: document.querySelector('.js-quote-author'),\n};\n\nfunction getQuoteData() {\n const storedQuote = localStorage.getItem('quoteData');\n if (storedQuote) {\n const { quote: quoteContent, author, date } = JSON.parse(storedQuote);\n const savedDate = new Date(date);\n const currentDate = new Date();\n\n if (savedDate.getDate() === currentDate.getDate()) {\n addTextContent(quoteContent, author);\n return;\n }\n }\n fetchGetExercisesQuote();\n}\n\ngetQuoteData();\n\nasync function fetchGetExercisesQuote() {\n try {\n setSpinner(true);\n const resp = await fetchApi.getExercisesQuote();\n const { quote: newQuote, author } = resp;\n const quoteData = { quote: newQuote, author, date: new Date() };\n localStorage.setItem('quoteData', JSON.stringify(quoteData));\n addTextContent(newQuote, author);\n } catch (err) {\n showIziToast(err.message);\n } finally {\n setSpinner(false);\n }\n}\n\nfunction addTextContent(content, author) {\n quote.content.textContent = content;\n quote.author.textContent = author;\n}\n","import iziToast from 'izitoast';\nimport { setSpinner } from './spinner';\n\n// iziToast settings\niziToast.settings({\n timeout: 3000,\n resetOnHover: true,\n icon: 'material-icons',\n transitionIn: 'flipInX',\n transitionOut: 'flipOutX',\n position: 'topRight',\n});\n\nexport function scrollToTop() {\n document\n .querySelector('.js-gallery-scroll')\n .scrollIntoView({ behavior: 'smooth' });\n};\n\nexport function calculateFillStar(numStar, valueStars) {\n if (numStar + 1 <= valueStars) {\n return 100;\n } \n if (numStar > valueStars) {\n return 0;\n };\n return (valueStars % 1) * 100;\n};\n","import { initFavGallery } from '../favorites-gallery';\nimport { scrollToTop } from '../helper';\n\nconst paginationContainer = document.querySelector('.js-pagination');\nlet navigationObject;\n\npaginationContainer.addEventListener('click', onPaginationStep);\n\nexport function renderPagination(totalPages, fetchGallery, params, isLocal) {\n if (totalPages === 1) {\n paginationContainer.innerHTML = '';\n return;\n }\n\n let markup = '';\n\n for (let i = 1; i <= totalPages; i++) {\n const isCurrentPage = i === params.page;\n\n markup += ``;\n }\n\n navigationObject = {\n method: fetchGallery,\n isLocal,\n params,\n };\n\n paginationContainer.innerHTML = markup;\n}\n\nfunction onPaginationStep(evt) {\n if (evt.target === evt.currentTarget) {\n return;\n }\n const btn = evt.target;\n const page = Number(btn.textContent);\n\n [...paginationContainer.children]\n .find(button => button.classList.contains('active'))\n ?.classList.remove('active');\n\n btn.classList.add('active');\n\n navigationObject.isLocal\n ? initFavGallery(page)\n : navigationObject.method({ ...navigationObject.params, page: page });\n\n scrollToTop();\n}","const TABLET_WIDTH = 768;\nconst TABLET_WORKOUTS_AMOUNT = 10;\nconst MOBILE_WORKOUTS_AMOUNT = 9;\nconst TABLET_GROUP_AMOUNT = 12;\nconst MOBILE_GROUP_AMOUNT = 9;\n\nexport const DESKTOP_WIDTH = 1440;\n\nexport const FAV_GALLERY_LIMIT =\n window.innerWidth < TABLET_WIDTH\n ? MOBILE_WORKOUTS_AMOUNT\n : TABLET_WORKOUTS_AMOUNT;\n\nexport const FAV_CARD_CLASS_NAMES = [\n 'js-fav-target',\n 'js-fav-calories',\n 'js-fav-bodyPart',\n 'js-fav-title',\n];\n\nexport const GALLERY_LIMIT = window.innerWidth < TABLET_WIDTH\n ? MOBILE_GROUP_AMOUNT\n : TABLET_GROUP_AMOUNT;\nexport const MAX_SIZE_TITLE = 31;\n\n","import { renderPagination } from './services/paginator-service';\nimport { setSpinner } from './spinner';\nimport {\n DESKTOP_WIDTH,\n FAV_GALLERY_LIMIT as perPage,\n FAV_CARD_CLASS_NAMES as classNames,\n} from './variables';\nimport { MAX_SIZE_TITLE } from './variables';\n\nconst TABLET_WIDTH = 768,\n TABLET_WORKOUTS_AMOUNT = 9,\n MOBILE_WORKOUTS_AMOUNT = 10,\n CLASS_NAMES = [\n 'js-fav-target',\n 'js-fav-calories',\n 'js-fav-bodyPart',\n 'js-fav-title',\n ];\n\ninitFavGallery();\n\nexport function initFavGallery(pageNumber = 1) {\n const template = getTemplate();\n if (!template) return;\n\n const workouts = JSON.parse(localStorage.getItem('favWorkouts'));\n const { favGalleryEl, emptyFavEl, paginationFavEl, fragment } = getRefs();\n const screenWidth = window.innerWidth;\n\n if (\n handleEmptyWorkouts({ workouts, emptyFavEl, paginationFavEl, favGalleryEl })\n ) {\n return;\n }\n\n const { startIndex, endIndex } = handlePagination({\n perPage,\n totalWorkouts: workouts.length,\n pageNumber,\n screenWidth,\n });\n\n setSpinner(true);\n\n renderGalleryItems({\n workouts,\n startIndex,\n endIndex,\n template,\n fragment,\n favGalleryEl,\n });\n\n setSpinner(false);\n}\n\nfunction getRefs() {\n return {\n favGalleryEl: document.querySelector('.js-fav-gallery'),\n emptyFavEl: document.querySelector('.js-no-fav-workouts'),\n paginationFavEl: document.querySelector('.js-pagination'),\n fragment: document.createDocumentFragment(),\n };\n}\n\nfunction getTemplate() {\n return document.querySelector('#exercise-fav');\n}\n\nfunction handleEmptyWorkouts({\n workouts,\n emptyFavEl,\n paginationFavEl,\n favGalleryEl,\n}) {\n if (!workouts?.length) {\n emptyFavEl.classList.remove('hidden');\n favGalleryEl.classList.add('hidden');\n paginationFavEl.classList.add('hidden');\n setSpinner(false);\n return true;\n }\n}\n\nfunction handlePagination({ perPage, totalWorkouts, pageNumber, screenWidth }) {\n const totalPages = Math.ceil(totalWorkouts / perPage),\n params = { page: pageNumber };\n\n let startIndex = (pageNumber - 1) * perPage,\n endIndex = Math.min(startIndex + perPage, totalWorkouts);\n\n if (screenWidth < DESKTOP_WIDTH) {\n renderPagination(totalPages, null, params, true);\n } else {\n startIndex = 0;\n endIndex = totalWorkouts;\n }\n return { startIndex, endIndex };\n}\n\nfunction renderGalleryItems({\n workouts,\n startIndex,\n endIndex,\n template,\n fragment,\n favGalleryEl,\n}) {\n for (let i = startIndex; i < endIndex; i++) {\n const itemEl = template.children[0].cloneNode(true);\n const elements = classNames.map(className =>\n itemEl.querySelector(`.${className}`)\n );\n const {\n _id,\n name: title,\n bodyPart,\n target,\n burnedCalories: calories,\n } = workouts[i];\n\n [target, calories, bodyPart, title].forEach((prop, idx) => {\n elements[idx].textContent = prop;\n });\n\n itemEl.setAttribute('id', _id);\n\n if (title.length > MAX_SIZE_TITLE) {\n const elTooltip = itemEl.querySelector('.js-tooltip');\n elTooltip.dataset.tooltip = title;\n\n elTooltip.classList.add('tooltip');\n }\n\n fragment.appendChild(itemEl);\n }\n\n favGalleryEl.replaceChildren(fragment);\n}\n","export default \"__VITE_ASSET__8092028f__\"","export function addToFavorites(obj) {\n let favorites = JSON.parse(localStorage.getItem('favWorkouts')) || [];\n const isDuplicate = favorites.some(item => item._id === obj._id);\n\n if (isDuplicate) {\n return;\n }\n\n favorites.push(obj);\n localStorage.setItem('favWorkouts', JSON.stringify(favorites));\n}\n\nexport function removeFromFavorites(obj) {\n let favorites = JSON.parse(localStorage.getItem('favWorkouts')) || [];\n let index = favorites.findIndex(item => item._id === obj._id);\n\n if (index === -1) {\n return;\n }\n\n favorites.splice(index, 1);\n localStorage.setItem('favWorkouts', JSON.stringify(favorites));\n}\n","export default \"__VITE_ASSET__3f4e380b__\"","import { fetchApi } from './services/api-service';\nimport image from '/img/example-img.jpg';\nimport { addToFavorites, removeFromFavorites } from './services/storage-fav-cards';\nimport icons from '/img/icons.svg';\nimport { setSpinner } from './spinner';\nimport { showIziToast } from './services/iziToast';\nimport { initFavGallery } from './favorites-gallery';\nimport { calculateFillStar } from './helper';\n\nconst modalExercise = document.querySelector('.modal-exercise');\nconst overlay = document.querySelector('.overlay');\nconst fullStarColor = '#eea10c';\nconst emptyStarColor = '#f4f4f433';\nconst totalStars = 5;\n\nlet isFavorite = false;\nlet currentData;\n\nexport async function openModalExercise(id) {\n overlay.addEventListener('click', clickOnOverlay);\n document.addEventListener('keydown', clickOnEscape);\n\n try {\n setSpinner(true);\n const dataExercise = await fetchApi.getExercisesId(id);\n currentData = dataExercise;\n const markup = markUp(dataExercise);\n createMarkUpModal(markup, dataExercise);\n showModalExercise();\n \n const closeModalButton = document.querySelector('.modal-exercise__btn-close');\n const buttonAddRemoveFavorites = document.querySelector('.js-favorite__btn');\n const buttonRating = document.querySelector('.js-rating__btn');\n closeModalButton.addEventListener('click', closeModalExercise);\n buttonAddRemoveFavorites.addEventListener('click', toggleButton);\n buttonRating.addEventListener('click', showNotification);\n } catch (err) {\n showIziToast(err.message);\n } finally {\n setSpinner(false);\n };\n};\n\nfunction createMarkUpModal(markup, data) {\n modalExercise.innerHTML = markup;\n showRightButtons(data);\n};\n\nfunction showRightButtons(obj) {\n const buttonAddRemoveFavorites = document.querySelector('.js-favorite__btn');\n let favorites = JSON.parse(localStorage.getItem('favWorkouts')) || [];\n const isDuplicate = favorites.some(item => item._id === obj._id);\n if (isDuplicate) {\n isFavorite = true;\n return buttonAddRemoveFavorites.innerHTML = createRemoveButton();\n };\n isFavorite = false;\n return buttonAddRemoveFavorites.innerHTML = createAddButton();\n};\n\nfunction createStarRating(rating) {\n let starsRating = '';\n\n for (let i = 0; i < totalStars; i += 1) {\n const gradientId = `gradient-id${i}`;\n const offsetPercent = calculateFillStar(i, rating);\n \n const linearGradient = `\n \n \n \n `;\n \n starsRating += `\n \n ${linearGradient}\n \n `;\n };\n return starsRating;\n};\n\nfunction createAddButton() {\n return `Add to favorite\n \n \n `\n};\n\nfunction createRemoveButton() {\n return `Remove from favorites\n \n \n `\n};\n\nfunction markUp({\n _id,\n name,\n rating,\n gifUrl,\n target,\n bodyPart,\n equipment,\n popularity,\n burnedCalories,\n time,\n description\n}) {\n const starsRating = createStarRating(rating);\n\n return `\n
\n \n\n \"Example\n\n
\n

${name}

\n
\n ${rating.toFixed(1)}\n ${starsRating}\n
\n\n
\n
    \n
  • \n

    Target

    \n

    ${target}

    \n
  • \n \n
  • \n

    Body Part

    \n

    ${bodyPart}

    \n
  • \n \n
  • \n

    Equipment

    \n

    ${equipment}

    \n
  • \n \n
  • \n

    Popular

    \n

    ${popularity}

    \n
  • \n \n
  • \n

    Burned Calories

    \n

    ${burnedCalories}/${time} min

    \n
  • \n
\n

\n ${description}\n

\n
\n
\n
\n
\n \n \n
`\n};\n\nfunction toggleButton() {\n const buttonAddRemoveFavorites = document.querySelector('.js-favorite__btn');\n isFavorite = !isFavorite; \n \n if (isFavorite) {\n addToFavorites(currentData);\n buttonAddRemoveFavorites.innerHTML = createRemoveButton();\n } else {\n removeFromFavorites(currentData);\n buttonAddRemoveFavorites.innerHTML = createAddButton();\n initFavGallery();\n };\n};\n\nfunction clickOnOverlay(e) {\n e.target === overlay && closeModalExercise();\n};\n\nfunction clickOnEscape({ key }) {\n (key === \"Escape\"\n && !modalExercise.classList.contains('hidden'))\n && closeModalExercise();\n};\n\nfunction showNotification() {\n showIziToast('Under development');\n};\n\nfunction showModalExercise() {\n overlay.classList.remove('hidden');\n modalExercise.classList.remove('hidden');\n document.body.style.overflow = 'hidden';\n};\n\nfunction closeModalExercise() {\n overlay.classList.add('hidden');\n modalExercise.classList.add('hidden');\n document.body.style.overflow = 'scroll';\n overlay.removeEventListener('click', clickOnOverlay);\n document.removeEventListener('keydown', clickOnEscape);\n};","const backdrop = document.querySelector('.js-menu-backdrop');\nconst mobMenu = document.querySelector('.js-menu-container');\nconst openMenuBtn = document.querySelector('.js-open-menu');\nconst closeMenuBtn = document.querySelector('.js-close-menu');\nconst mobMenuLink = document.querySelector('.js-menu-link');\n\nfunction toggleMenu() {\n mobMenu.classList.toggle('is-open');\n backdrop.classList.toggle('is-hidden');\n}\n\nfunction onMenuClick(evt) {\n // in case when ul clicked //\n if (evt.currentTarget === evt.target) {\n return;\n }\n toggleMenu();\n}\n\nfunction handlerBackdrop({ target }) {\n if (!target.closest('#mob-menu')) {\n toggleMenu();\n }\n}\n\nopenMenuBtn.addEventListener('click', toggleMenu);\ncloseMenuBtn.addEventListener('click', toggleMenu);\nmobMenuLink.addEventListener('click', onMenuClick);\n\nbackdrop.addEventListener('click', handlerBackdrop);\n","const scrollBtn = document.getElementById('scroll-top');\n\nconst topFunction = () => {\n document.body.scrollTop = 0;\n document.documentElement.scrollTop = 0;\n};\n\nconst scrollBtnDisplay = () => {\n window.scrollY > window.innerHeight\n ? scrollBtn.classList.add('scroll-show')\n : scrollBtn.classList.remove('scroll-show');\n};\n\nwindow.addEventListener('scroll', scrollBtnDisplay);\nscrollBtn.addEventListener('click', topFunction);\n"],"names":["BASE_URL","fetchData","path","method","body","resp","fetchApi","exercisesParams","params","url","id","ratingBody","filterParams","subscriptionBody","showIziToast","message","color","time","iziToast","setSpinner","status","spinnerEl","quote","getQuoteData","storedQuote","quoteContent","author","date","savedDate","currentDate","addTextContent","fetchGetExercisesQuote","newQuote","quoteData","err","content","scrollToTop","calculateFillStar","numStar","valueStars","paginationContainer","navigationObject","onPaginationStep","renderPagination","totalPages","fetchGallery","isLocal","markup","i","isCurrentPage","evt","btn","page","_a","button","initFavGallery","TABLET_WIDTH","TABLET_WORKOUTS_AMOUNT","MOBILE_WORKOUTS_AMOUNT","TABLET_GROUP_AMOUNT","MOBILE_GROUP_AMOUNT","DESKTOP_WIDTH","FAV_GALLERY_LIMIT","FAV_CARD_CLASS_NAMES","GALLERY_LIMIT","MAX_SIZE_TITLE","pageNumber","template","getTemplate","workouts","favGalleryEl","emptyFavEl","paginationFavEl","fragment","getRefs","screenWidth","handleEmptyWorkouts","startIndex","endIndex","handlePagination","perPage","renderGalleryItems","totalWorkouts","itemEl","elements","classNames","className","_id","title","bodyPart","target","calories","prop","idx","elTooltip","image","addToFavorites","obj","favorites","item","removeFromFavorites","index","icons","modalExercise","overlay","fullStarColor","emptyStarColor","totalStars","isFavorite","currentData","openModalExercise","clickOnOverlay","clickOnEscape","dataExercise","markUp","createMarkUpModal","showModalExercise","closeModalButton","buttonAddRemoveFavorites","buttonRating","closeModalExercise","toggleButton","showNotification","data","showRightButtons","createRemoveButton","createAddButton","createStarRating","rating","starsRating","gradientId","offsetPercent","linearGradient","name","gifUrl","equipment","popularity","burnedCalories","description","key","backdrop","mobMenu","openMenuBtn","closeMenuBtn","mobMenuLink","toggleMenu","onMenuClick","handlerBackdrop","scrollBtn","topFunction","scrollBtnDisplay"],"mappings":"+uBAAA,MAAMA,EAAW,uCAEJC,EAAY,MAAOC,EAAMC,EAAQC,IAAS,CAGrD,MAAMC,EAAO,MAAM,MAAMH,EADZ,CAAE,QADC,CAAE,eAAgB,oBACV,OAAAC,EAAQ,KAAAC,CAAI,CACD,EACnC,GAAI,CAACC,EAAK,GACR,MAAM,IAAI,MAAM,kBAAkBA,EAAK,MAAM,KAAKA,EAAK,UAAU,EAAE,EAErE,OAAOA,EAAK,MACd,EAEaC,EAAW,CACtB,MAAM,aAAaC,EAAiB,CAClC,MAAMC,EAAS,IAAI,gBAAgBD,CAAe,EAC5CE,EAAM,GAAGT,CAAQ,cAAcQ,CAAM,GAC3C,OAAO,MAAMP,EAAUQ,CAAG,CAC3B,EAED,MAAM,eAAeC,EAAI,CACvB,MAAMD,EAAM,GAAGT,CAAQ,cAAcU,CAAE,GACvC,OAAO,MAAMT,EAAUQ,CAAG,CAC3B,EAED,MAAM,sBAAsBC,EAAIC,EAAY,CAC1C,MAAMR,EAAS,QACTM,EAAM,GAAGT,CAAQ,cAAcU,CAAE,UACjCN,EAAO,KAAK,UAAUO,CAAU,EACtC,OAAO,MAAMV,EAAUQ,EAAKN,EAAQC,CAAI,CACzC,EAED,MAAM,mBAAmBQ,EAAc,CACrC,MAAMJ,EAAS,IAAI,gBAAgBI,CAAY,EACzCH,EAAM,GAAGT,CAAQ,YAAYQ,CAAM,GACzC,OAAO,MAAMP,EAAUQ,CAAG,CAC3B,EAED,MAAM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,oBAAoB,QAASO,CAAc,EACnD,SAAS,oBAAoB,UAAWC,CAAa,CACzD,CC/MA,MAAM4B,EAAW,SAAS,cAAc,mBAAmB,EACrDC,GAAU,SAAS,cAAc,oBAAoB,EACrDC,GAAc,SAAS,cAAc,eAAe,EACpDC,GAAe,SAAS,cAAc,gBAAgB,EACtDC,GAAc,SAAS,cAAc,eAAe,EAE1D,SAASC,GAAa,CACpBJ,GAAQ,UAAU,OAAO,SAAS,EAClCD,EAAS,UAAU,OAAO,WAAW,CACvC,CAEA,SAASM,GAAYhG,EAAK,CAEpBA,EAAI,gBAAkBA,EAAI,QAG9B+F,GACF,CAEA,SAASE,GAAgB,CAAE,OAAAzD,GAAU,CAC9BA,EAAO,QAAQ,WAAW,GAC7BuD,GAEJ,CAEAH,GAAY,iBAAiB,QAASG,CAAU,EAChDF,GAAa,iBAAiB,QAASE,CAAU,EACjDD,GAAY,iBAAiB,QAASE,EAAW,EAEjDN,EAAS,iBAAiB,QAASO,EAAe,EC7BlD,MAAMC,EAAY,SAAS,eAAe,YAAY,EAEhDC,GAAc,IAAM,CACxB,SAAS,KAAK,UAAY,EAC1B,SAAS,gBAAgB,UAAY,CACvC,EAEMC,GAAmB,IAAM,CAC7B,OAAO,QAAU,OAAO,YACpBF,EAAU,UAAU,IAAI,aAAa,EACrCA,EAAU,UAAU,OAAO,aAAa,CAC9C,EAEA,OAAO,iBAAiB,SAAUE,EAAgB,EAClDF,EAAU,iBAAiB,QAASC,EAAW"} \ No newline at end of file +{"version":3,"file":"scroll-top-0dcb77ba.js","sources":["../../src/js/services/api-service.js","../../src/js/services/iziToast.js","../../src/js/spinner.js","../../src/js/quote-of-the-day.js","../../src/js/helper.js","../../src/js/services/paginator-service.js","../../src/js/variables.js","../../src/js/favorites-gallery.js","../../src/img/example-img.jpg","../../src/js/services/storage-fav-cards.js","../../src/img/icons.svg","../../src/js/exercise-popup.js","../../src/js/mob-burger-menu.js","../../src/js/scroll-top.js"],"sourcesContent":["const BASE_URL = 'https://your-energy.b.goit.study/api';\n\nexport const fetchData = async (path, method, body) => {\n const headers = { 'Content-type': 'application/json' };\n const init = { headers, method, body };\n const resp = await fetch(path, init);\n if (!resp.ok) {\n throw new Error(`Error: status: ${resp.status}, ${resp.statusText}`);\n }\n return resp.json();\n};\n\nexport const fetchApi = {\n async getExercises(exercisesParams) {\n const params = new URLSearchParams(exercisesParams);\n const url = `${BASE_URL}/exercises?${params}`;\n return await fetchData(url);\n },\n\n async getExercisesId(id) {\n const url = `${BASE_URL}/exercises/${id}`;\n return await fetchData(url);\n },\n\n async editExercisesIdRating(id, ratingBody) {\n const method = 'PATCH';\n const url = `${BASE_URL}/exercises/${id}/rating`;\n const body = JSON.stringify(ratingBody);\n return await fetchData(url, method, body);\n },\n\n async getExercisesFilter(filterParams) {\n const params = new URLSearchParams(filterParams);\n const url = `${BASE_URL}/filters?${params}`;\n return await fetchData(url);\n },\n\n async getExercisesQuote() {\n const url = `${BASE_URL}/quote`;\n return await fetchData(url);\n },\n\n async addSubscription(subscriptionBody) {\n const method = 'POST';\n const url = `${BASE_URL}/subscription`;\n const body = JSON.stringify(subscriptionBody);\n return await fetchData(url, method, body);\n },\n};\n","import iziToast from 'izitoast';\nimport 'izitoast/dist/css/iziToast.min.css';\n\nexport const showIziToast = (message, color, time) => {\n iziToast.show({\n message,\n drag: true,\n close: false,\n timeout: time ?? 5000,\n position: 'topRight',\n messageColor: '#2a2a2a',\n closeOnClick: true,\n animateInside: true,\n backgroundColor: color ?? '#fca664',\n });\n};\n","export const setSpinner = function (status) {\n const spinnerEl = document.querySelector('.js-spinner');\n status\n ? spinnerEl.classList.remove('hidden')\n : setTimeout(() => spinnerEl.classList.add('hidden'), 300);\n};\n","import { fetchApi } from './services/api-service';\nimport { showIziToast } from './services/iziToast';\nimport { setSpinner } from './spinner';\n\nconst quote = {\n content: document.querySelector('.js-quote-content'),\n author: document.querySelector('.js-quote-author'),\n};\n\nfunction getQuoteData() {\n const storedQuote = localStorage.getItem('quoteData');\n if (storedQuote) {\n const { quote: quoteContent, author, date } = JSON.parse(storedQuote);\n const savedDate = new Date(date);\n const currentDate = new Date();\n\n if (savedDate.getDate() === currentDate.getDate()) {\n addTextContent(quoteContent, author);\n return;\n }\n }\n fetchGetExercisesQuote();\n}\n\ngetQuoteData();\n\nasync function fetchGetExercisesQuote() {\n try {\n setSpinner(true);\n const resp = await fetchApi.getExercisesQuote();\n const { quote: newQuote, author } = resp;\n const quoteData = { quote: newQuote, author, date: new Date() };\n localStorage.setItem('quoteData', JSON.stringify(quoteData));\n addTextContent(newQuote, author);\n } catch (err) {\n showIziToast(err.message);\n } finally {\n setSpinner(false);\n }\n}\n\nfunction addTextContent(content, author) {\n quote.content.textContent = content;\n quote.author.textContent = author;\n}\n","import iziToast from 'izitoast';\nimport { setSpinner } from './spinner';\n\n// iziToast settings\niziToast.settings({\n timeout: 3000,\n resetOnHover: true,\n icon: 'material-icons',\n transitionIn: 'flipInX',\n transitionOut: 'flipOutX',\n position: 'topRight',\n});\n\nexport function scrollToTop() {\n document\n .querySelector('.js-gallery-scroll')\n .scrollIntoView({ behavior: 'smooth' });\n};\n\nexport function calculateFillStar(numStar, valueStars) {\n if (numStar + 1 <= valueStars) {\n return 100;\n } \n if (numStar > valueStars) {\n return 0;\n };\n return (valueStars % 1) * 100;\n};\n","import { initFavGallery } from '../favorites-gallery';\nimport { scrollToTop } from '../helper';\n\nconst paginationContainer = document.querySelector('.js-pagination');\nlet navigationObject;\n\npaginationContainer.addEventListener('click', onPaginationStep);\n\nexport function renderPagination(totalPages, fetchGallery, params, isLocal) {\n if (totalPages === 1) {\n paginationContainer.innerHTML = '';\n return;\n }\n\n let markup = '';\n\n for (let i = 1; i <= totalPages; i++) {\n const isCurrentPage = i === params.page;\n\n markup += ``;\n }\n\n navigationObject = {\n method: fetchGallery,\n isLocal,\n params,\n };\n\n paginationContainer.innerHTML = markup;\n}\n\nfunction onPaginationStep(evt) {\n if (evt.target === evt.currentTarget) {\n return;\n }\n const btn = evt.target;\n const page = Number(btn.textContent);\n\n [...paginationContainer.children]\n .find(button => button.classList.contains('active'))\n ?.classList.remove('active');\n\n btn.classList.add('active');\n\n navigationObject.isLocal\n ? initFavGallery(page)\n : navigationObject.method({ ...navigationObject.params, page: page });\n\n scrollToTop();\n}","const TABLET_WIDTH = 768;\nconst TABLET_WORKOUTS_AMOUNT = 10;\nconst MOBILE_WORKOUTS_AMOUNT = 9;\nconst TABLET_GROUP_AMOUNT = 12;\nconst MOBILE_GROUP_AMOUNT = 9;\n\nexport const DESKTOP_WIDTH = 1440;\n\nexport const FAV_GALLERY_LIMIT =\n window.innerWidth < TABLET_WIDTH\n ? MOBILE_WORKOUTS_AMOUNT\n : TABLET_WORKOUTS_AMOUNT;\n\nexport const FAV_CARD_CLASS_NAMES = [\n 'js-fav-target',\n 'js-fav-calories',\n 'js-fav-bodyPart',\n 'js-fav-title',\n];\n\nexport const GALLERY_LIMIT = window.innerWidth < TABLET_WIDTH\n ? MOBILE_GROUP_AMOUNT\n : TABLET_GROUP_AMOUNT;\nexport const MAX_SIZE_TITLE = 31;\n\n","import { renderPagination } from './services/paginator-service';\nimport { setSpinner } from './spinner';\nimport {\n DESKTOP_WIDTH,\n FAV_GALLERY_LIMIT as perPage,\n FAV_CARD_CLASS_NAMES as classNames,\n} from './variables';\nimport { MAX_SIZE_TITLE } from './variables';\n\nconst TABLET_WIDTH = 768,\n TABLET_WORKOUTS_AMOUNT = 9,\n MOBILE_WORKOUTS_AMOUNT = 10,\n CLASS_NAMES = [\n 'js-fav-target',\n 'js-fav-calories',\n 'js-fav-bodyPart',\n 'js-fav-title',\n ];\n\ninitFavGallery();\n\nexport function initFavGallery(pageNumber = 1) {\n const template = getTemplate();\n if (!template) return;\n\n const workouts = JSON.parse(localStorage.getItem('favWorkouts'));\n const { favGalleryEl, emptyFavEl, paginationFavEl, fragment } = getRefs();\n const screenWidth = window.innerWidth;\n\n if (\n handleEmptyWorkouts({ workouts, emptyFavEl, paginationFavEl, favGalleryEl })\n ) {\n return;\n }\n\n const { startIndex, endIndex } = handlePagination({\n perPage,\n totalWorkouts: workouts.length,\n pageNumber,\n screenWidth,\n });\n\n setSpinner(true);\n\n renderGalleryItems({\n workouts,\n startIndex,\n endIndex,\n template,\n fragment,\n favGalleryEl,\n });\n\n setSpinner(false);\n}\n\nfunction getRefs() {\n return {\n favGalleryEl: document.querySelector('.js-fav-gallery'),\n emptyFavEl: document.querySelector('.js-no-fav-workouts'),\n paginationFavEl: document.querySelector('.js-pagination'),\n fragment: document.createDocumentFragment(),\n };\n}\n\nfunction getTemplate() {\n return document.querySelector('#exercise-fav');\n}\n\nfunction handleEmptyWorkouts({\n workouts,\n emptyFavEl,\n paginationFavEl,\n favGalleryEl,\n}) {\n if (!workouts?.length) {\n emptyFavEl.classList.remove('hidden');\n favGalleryEl.classList.add('hidden');\n paginationFavEl.classList.add('hidden');\n setSpinner(false);\n return true;\n }\n}\n\nfunction handlePagination({ perPage, totalWorkouts, pageNumber, screenWidth }) {\n const totalPages = Math.ceil(totalWorkouts / perPage),\n params = { page: pageNumber };\n\n let startIndex = (pageNumber - 1) * perPage,\n endIndex = Math.min(startIndex + perPage, totalWorkouts);\n\n if (screenWidth < DESKTOP_WIDTH) {\n renderPagination(totalPages, null, params, true);\n } else {\n startIndex = 0;\n endIndex = totalWorkouts;\n }\n return { startIndex, endIndex };\n}\n\nfunction renderGalleryItems({\n workouts,\n startIndex,\n endIndex,\n template,\n fragment,\n favGalleryEl,\n}) {\n for (let i = startIndex; i < endIndex; i++) {\n const itemEl = template.children[0].cloneNode(true);\n const elements = classNames.map(className =>\n itemEl.querySelector(`.${className}`)\n );\n const {\n _id,\n name: title,\n bodyPart,\n target,\n burnedCalories: calories,\n } = workouts[i];\n\n [target, calories, bodyPart, title].forEach((prop, idx) => {\n elements[idx].textContent = prop;\n });\n\n itemEl.setAttribute('id', _id);\n\n if (title.length > MAX_SIZE_TITLE) {\n const elTooltip = itemEl.querySelector('.js-tooltip');\n elTooltip.dataset.tooltip = title;\n\n elTooltip.classList.add('tooltip');\n }\n\n fragment.appendChild(itemEl);\n }\n\n favGalleryEl.replaceChildren(fragment);\n}\n","export default \"__VITE_ASSET__8092028f__\"","export function addToFavorites(obj) {\n let favorites = JSON.parse(localStorage.getItem('favWorkouts')) || [];\n const isDuplicate = favorites.some(item => item._id === obj._id);\n\n if (isDuplicate) {\n return;\n }\n\n favorites.push(obj);\n localStorage.setItem('favWorkouts', JSON.stringify(favorites));\n}\n\nexport function removeFromFavorites(obj) {\n let favorites = JSON.parse(localStorage.getItem('favWorkouts')) || [];\n let index = favorites.findIndex(item => item._id === obj._id);\n\n if (index === -1) {\n return;\n }\n\n favorites.splice(index, 1);\n localStorage.setItem('favWorkouts', JSON.stringify(favorites));\n}\n","export default \"__VITE_ASSET__be0c168b__\"","import { fetchApi } from './services/api-service';\nimport image from '/img/example-img.jpg';\nimport { addToFavorites, removeFromFavorites } from './services/storage-fav-cards';\nimport icons from '/img/icons.svg';\nimport { setSpinner } from './spinner';\nimport { showIziToast } from './services/iziToast';\nimport { initFavGallery } from './favorites-gallery';\nimport { calculateFillStar } from './helper';\n\nconst modalExercise = document.querySelector('.modal-exercise');\nconst overlay = document.querySelector('.overlay');\nconst fullStarColor = '#eea10c';\nconst emptyStarColor = '#f4f4f433';\nconst totalStars = 5;\n\nlet isFavorite = false;\nlet currentData;\n\nexport async function openModalExercise(id) {\n overlay.addEventListener('click', clickOnOverlay);\n document.addEventListener('keydown', clickOnEscape);\n\n try {\n setSpinner(true);\n const dataExercise = await fetchApi.getExercisesId(id);\n currentData = dataExercise;\n const markup = markUp(dataExercise);\n createMarkUpModal(markup, dataExercise);\n showModalExercise();\n \n const closeModalButton = document.querySelector('.modal-exercise__btn-close');\n const buttonAddRemoveFavorites = document.querySelector('.js-favorite__btn');\n const buttonRating = document.querySelector('.js-rating__btn');\n closeModalButton.addEventListener('click', closeModalExercise);\n buttonAddRemoveFavorites.addEventListener('click', toggleButton);\n buttonRating.addEventListener('click', showNotification);\n } catch (err) {\n showIziToast(err.message);\n } finally {\n setSpinner(false);\n };\n};\n\nfunction createMarkUpModal(markup, data) {\n modalExercise.innerHTML = markup;\n showRightButtons(data);\n};\n\nfunction showRightButtons(obj) {\n const buttonAddRemoveFavorites = document.querySelector('.js-favorite__btn');\n let favorites = JSON.parse(localStorage.getItem('favWorkouts')) || [];\n const isDuplicate = favorites.some(item => item._id === obj._id);\n if (isDuplicate) {\n isFavorite = true;\n return buttonAddRemoveFavorites.innerHTML = createRemoveButton();\n };\n isFavorite = false;\n return buttonAddRemoveFavorites.innerHTML = createAddButton();\n};\n\nfunction createStarRating(rating) {\n let starsRating = '';\n\n for (let i = 0; i < totalStars; i += 1) {\n const gradientId = `gradient-id${i}`;\n const offsetPercent = calculateFillStar(i, rating);\n \n const linearGradient = `\n \n \n \n `;\n \n starsRating += `\n \n ${linearGradient}\n \n `;\n };\n return starsRating;\n};\n\nfunction createAddButton() {\n return `Add to favorite\n \n \n `\n};\n\nfunction createRemoveButton() {\n return `Remove from favorites\n \n \n `\n};\n\nfunction markUp({\n _id,\n name,\n rating,\n gifUrl,\n target,\n bodyPart,\n equipment,\n popularity,\n burnedCalories,\n time,\n description\n}) {\n const starsRating = createStarRating(rating);\n\n return `\n
\n \n\n \"Example\n\n
\n

${name}

\n
\n ${rating.toFixed(1)}\n ${starsRating}\n
\n\n
\n
    \n
  • \n

    Target

    \n

    ${target}

    \n
  • \n \n
  • \n

    Body Part

    \n

    ${bodyPart}

    \n
  • \n \n
  • \n

    Equipment

    \n

    ${equipment}

    \n
  • \n \n
  • \n

    Popular

    \n

    ${popularity}

    \n
  • \n \n
  • \n

    Burned Calories

    \n

    ${burnedCalories}/${time} min

    \n
  • \n
\n

\n ${description}\n

\n
\n
\n
\n
\n \n \n
`\n};\n\nfunction toggleButton() {\n const buttonAddRemoveFavorites = document.querySelector('.js-favorite__btn');\n isFavorite = !isFavorite; \n \n if (isFavorite) {\n addToFavorites(currentData);\n buttonAddRemoveFavorites.innerHTML = createRemoveButton();\n } else {\n removeFromFavorites(currentData);\n buttonAddRemoveFavorites.innerHTML = createAddButton();\n initFavGallery();\n };\n};\n\nfunction clickOnOverlay(e) {\n e.target === overlay && closeModalExercise();\n};\n\nfunction clickOnEscape({ key }) {\n (key === \"Escape\"\n && !modalExercise.classList.contains('hidden'))\n && closeModalExercise();\n};\n\nfunction showNotification() {\n showIziToast('Under development');\n};\n\nfunction showModalExercise() {\n overlay.classList.remove('hidden');\n modalExercise.classList.remove('hidden');\n document.body.style.overflow = 'hidden';\n};\n\nfunction closeModalExercise() {\n overlay.classList.add('hidden');\n modalExercise.classList.add('hidden');\n document.body.style.overflow = 'scroll';\n overlay.removeEventListener('click', clickOnOverlay);\n document.removeEventListener('keydown', clickOnEscape);\n};","const backdrop = document.querySelector('.js-menu-backdrop');\nconst mobMenu = document.querySelector('.js-menu-container');\nconst openMenuBtn = document.querySelector('.js-open-menu');\nconst closeMenuBtn = document.querySelector('.js-close-menu');\nconst mobMenuLink = document.querySelector('.js-menu-link');\n\nfunction toggleMenu() {\n mobMenu.classList.toggle('is-open');\n backdrop.classList.toggle('is-hidden');\n}\n\nfunction onMenuClick(evt) {\n // in case when ul clicked //\n if (evt.currentTarget === evt.target) {\n return;\n }\n toggleMenu();\n}\n\nfunction handlerBackdrop({ target }) {\n if (!target.closest('#mob-menu')) {\n toggleMenu();\n }\n}\n\nopenMenuBtn.addEventListener('click', toggleMenu);\ncloseMenuBtn.addEventListener('click', toggleMenu);\nmobMenuLink.addEventListener('click', onMenuClick);\n\nbackdrop.addEventListener('click', handlerBackdrop);\n","const scrollBtn = document.getElementById('scroll-top');\n\nconst topFunction = () => {\n document.body.scrollTop = 0;\n document.documentElement.scrollTop = 0;\n};\n\nconst scrollBtnDisplay = () => {\n window.scrollY > window.innerHeight\n ? scrollBtn.classList.add('scroll-show')\n : scrollBtn.classList.remove('scroll-show');\n};\n\nwindow.addEventListener('scroll', scrollBtnDisplay);\nscrollBtn.addEventListener('click', topFunction);\n"],"names":["BASE_URL","fetchData","path","method","body","resp","fetchApi","exercisesParams","params","url","id","ratingBody","filterParams","subscriptionBody","showIziToast","message","color","time","iziToast","setSpinner","status","spinnerEl","quote","getQuoteData","storedQuote","quoteContent","author","date","savedDate","currentDate","addTextContent","fetchGetExercisesQuote","newQuote","quoteData","err","content","scrollToTop","calculateFillStar","numStar","valueStars","paginationContainer","navigationObject","onPaginationStep","renderPagination","totalPages","fetchGallery","isLocal","markup","i","isCurrentPage","evt","btn","page","_a","button","initFavGallery","TABLET_WIDTH","TABLET_WORKOUTS_AMOUNT","MOBILE_WORKOUTS_AMOUNT","TABLET_GROUP_AMOUNT","MOBILE_GROUP_AMOUNT","DESKTOP_WIDTH","FAV_GALLERY_LIMIT","FAV_CARD_CLASS_NAMES","GALLERY_LIMIT","MAX_SIZE_TITLE","pageNumber","template","getTemplate","workouts","favGalleryEl","emptyFavEl","paginationFavEl","fragment","getRefs","screenWidth","handleEmptyWorkouts","startIndex","endIndex","handlePagination","perPage","renderGalleryItems","totalWorkouts","itemEl","elements","classNames","className","_id","title","bodyPart","target","calories","prop","idx","elTooltip","image","addToFavorites","obj","favorites","item","removeFromFavorites","index","icons","modalExercise","overlay","fullStarColor","emptyStarColor","totalStars","isFavorite","currentData","openModalExercise","clickOnOverlay","clickOnEscape","dataExercise","markUp","createMarkUpModal","showModalExercise","closeModalButton","buttonAddRemoveFavorites","buttonRating","closeModalExercise","toggleButton","showNotification","data","showRightButtons","createRemoveButton","createAddButton","createStarRating","rating","starsRating","gradientId","offsetPercent","linearGradient","name","gifUrl","equipment","popularity","burnedCalories","description","key","backdrop","mobMenu","openMenuBtn","closeMenuBtn","mobMenuLink","toggleMenu","onMenuClick","handlerBackdrop","scrollBtn","topFunction","scrollBtnDisplay"],"mappings":"+uBAAA,MAAMA,EAAW,uCAEJC,EAAY,MAAOC,EAAMC,EAAQC,IAAS,CAGrD,MAAMC,EAAO,MAAM,MAAMH,EADZ,CAAE,QADC,CAAE,eAAgB,oB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