diff --git a/src/css/star.scss b/src/css/star.scss index 241c60a..b092bb1 100644 --- a/src/css/star.scss +++ b/src/css/star.scss @@ -3,7 +3,6 @@ $starHue: 38; :root { --yellow: #{hsl($starHue,90%,55%)}; - --yellow-t: #{hsla($starHue,90%,55%,0)}; --bezier: cubic-bezier(0.42,0,0.58,1); --trans-dur: 0.3s; } @@ -113,13 +112,6 @@ $starHue: 38; &__input-5:checked ~ &__label:nth-of-type(-n + 5) &__star-fill { animation-name: starFill; } - &__input-1:not(:checked):hover ~ &__label:first-of-type &__star-fill, - &__input-2:not(:checked):hover ~ &__label:nth-of-type(2) &__star-fill, - &__input-3:not(:checked):hover ~ &__label:nth-of-type(3) &__star-fill, - &__input-4:not(:checked):hover ~ &__label:nth-of-type(4) &__star-fill, - &__input-5:not(:checked):hover ~ &__label:nth-of-type(5) &__star-fill { - fill: var(--yellow-t); - } // screen reader text &__sr { clip: rect(1px,1px,1px,1px); diff --git a/src/js/helper/get-access.js b/src/js/helper/get-access.js index f42e009..0e3cfe4 100644 --- a/src/js/helper/get-access.js +++ b/src/js/helper/get-access.js @@ -36,7 +36,7 @@ async function patchAccess({ id, formData }) { try { const response = await axios.patch( `https://energyflow.b.goit.study/api/exercises/${id}/rating`, formData); - iziToastFunctions.getSuccessInfo('Rating has been updated'); + iziToastFunctions.getSuccessInfo('Thank you! Your opinion really important for us!'); return response; } diff --git a/src/js/modal-window.js b/src/js/modal-window.js index a44cf06..fb4bf8b 100644 --- a/src/js/modal-window.js +++ b/src/js/modal-window.js @@ -5,6 +5,8 @@ export const refs = { closeIcon: document.querySelector('.js-modal-window'), galleryWindow: document.querySelector('.js-gallery'), ratingBtn: document.querySelector('.js-open-rating'), + formRating: document.querySelector('.js-form'), + numberRating: document.querySelector('.js-rating'), } export let idExercises; @@ -35,6 +37,9 @@ function closeModal() { refs.backdrop.classList.add('is-open'); document.body.style.overflow = ''; + refs.formRating.reset(); + refs.numberRating.textContent = '0.0'; + clearModalContent(); } diff --git a/src/js/rating.js b/src/js/rating.js index 781f6ee..ed53a6a 100644 --- a/src/js/rating.js +++ b/src/js/rating.js @@ -58,7 +58,7 @@ refsRating.backdrop.addEventListener('click', function (event) { } }); -export const timeToClose = () => setTimeout(() => closeModal(), 1500) +export const timeToClose = () => setTimeout(() => closeModal(), 1000) // Функція відправки рейтенгу refsRating.formRating.addEventListener('submit', sendRating) @@ -80,8 +80,9 @@ function sendRating(event) { formData: objectDate, }) .then(() => { - timeToClose(); refsRating.formRating.reset(); + refsRating.numberRating.textContent = '0.0'; + timeToClose(); }) .catch((error) => { console.log(error); diff --git a/src/partials/rating.html b/src/partials/rating.html index 38af5a9..ec73401 100644 --- a/src/partials/rating.html +++ b/src/partials/rating.html @@ -6,405 +6,404 @@
-

Rating

+
+

Rating

-
-

0.0

-
- - - - - -
-
- -