Skip to content

Commit

Permalink
Merge pull request #24 from WildCodeSchool-2023-09/S6_game_played_com…
Browse files Browse the repository at this point in the history
…ment

S6 game played comment
  • Loading branch information
nicolasalibert authored Feb 7, 2024
2 parents cd179c0 + d21cf5c commit f60696c
Show file tree
Hide file tree
Showing 26 changed files with 922 additions and 239 deletions.
15 changes: 15 additions & 0 deletions assets/images/icons/star-regular-empty-mini.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
15 changes: 15 additions & 0 deletions assets/images/icons/star-regular-empty.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 2 additions & 2 deletions assets/scripts/carousel.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ export function setVerticalCarousel(slideHeight, carousel, sliderBtns, currentSl
carousel.addEventListener("scroll", function(e) {
setTimeout(function() {
for (let i = 0 ; i < sliderBtns.length ; i++) {
if (carousel.scrollTop >= slideHeight * i) {
if (carousel.scrollTop > slideHeight * i - 1 && carousel.scrollTop < slideHeight * i + 1) {
document.querySelector('.' + currentSlide).classList.toggle(currentSlide);
sliderBtns[i].classList.toggle(currentSlide);
}
Expand All @@ -37,7 +37,7 @@ export function setHorizontalCarousel(slideWidth, carousel, sliderBtns, currentS
carousel.addEventListener("scroll", function(e) {
setTimeout(function() {
for (let i = (sliderBtns.length - 1) ; i >= 0 ; i--) {
if (carousel.scrollLeft <= slideWidth * i) {
if (carousel.scrollLeft < slideWidth * i + 1 && carousel.scrollLeft > slideWidth * i - 1) {
document.querySelector('.' + currentSlide).classList.toggle(currentSlide);
sliderBtns[i].classList.toggle(currentSlide);
}
Expand Down
153 changes: 153 additions & 0 deletions assets/scripts/notationReview.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,153 @@
const inputNotation = document.querySelector(".input-notation");
const firstStar = document.getElementById("first-star");
const firstStarSolid = document.getElementById("first-star-solid");
const secondStar = document.getElementById("second-star");
const secondStarSolid = document.getElementById("second-star-solid");
const thirdStar = document.getElementById("third-star");
const thirdStarSolid = document.getElementById("third-star-solid");
const fourthStar = document.getElementById("fourth-star");
const fourthStarSolid = document.getElementById("fourth-star-solid");
const fifthStar = document.getElementById("fifth-star");
const fifthStarSolid = document.getElementById("fifth-star-solid");

inputNotation.setAttribute('value', 0);

firstStar.addEventListener("click", () => {
firstStar.style.display = "none";
firstStarSolid.style.display = "block";
secondStar.style.display = "block";
secondStarSolid.style.display = "none";
thirdStar.style.display = "block";
thirdStarSolid.style.display = "none";
fourthStar.style.display = "block";
fourthStarSolid.style.display = "none";
fifthStar.style.display = "block";
fifthStarSolid.style.display = "none";
inputNotation.setAttribute("value", 1);
});

firstStarSolid.addEventListener("click", () => {
firstStar.style.display = "none";
firstStarSolid.style.display = "block";
secondStar.style.display = "block";
secondStarSolid.style.display = "none";
thirdStar.style.display = "block";
thirdStarSolid.style.display = "none";
fourthStar.style.display = "block";
fourthStarSolid.style.display = "none";
fifthStar.style.display = "block";
fifthStarSolid.style.display = "none";
inputNotation.setAttribute("value", 1);
});

secondStar.addEventListener("click", () => {
firstStar.style.display = "none";
firstStarSolid.style.display = "block";
secondStar.style.display = "none";
secondStarSolid.style.display = "block";
thirdStar.style.display = "block";
thirdStarSolid.style.display = "none";
fourthStar.style.display = "block";
fourthStarSolid.style.display = "none";
fifthStar.style.display = "block";
fifthStarSolid.style.display = "none";
inputNotation.setAttribute("value", 2);
});

secondStarSolid.addEventListener("click", () => {
firstStar.style.display = "none";
firstStarSolid.style.display = "block";
secondStar.style.display = "none";
secondStarSolid.style.display = "block";
thirdStar.style.display = "block";
thirdStarSolid.style.display = "none";
fourthStar.style.display = "block";
fourthStarSolid.style.display = "none";
fifthStar.style.display = "block";
fifthStarSolid.style.display = "none";
inputNotation.setAttribute("value", 2);
});

thirdStar.addEventListener("click", () => {
firstStar.style.display = "none";
firstStarSolid.style.display = "block";
secondStar.style.display = "none";
secondStarSolid.style.display = "block";
thirdStar.style.display = "none";
thirdStarSolid.style.display = "block";
fourthStar.style.display = "block";
fourthStarSolid.style.display = "none";
fifthStar.style.display = "block";
fifthStarSolid.style.display = "none";
inputNotation.setAttribute("value", 3);
});

thirdStarSolid.addEventListener("click", () => {
firstStar.style.display = "none";
firstStarSolid.style.display = "block";
secondStar.style.display = "none";
secondStarSolid.style.display = "block";
thirdStar.style.display = "none";
thirdStarSolid.style.display = "block";
fourthStar.style.display = "block";
fourthStarSolid.style.display = "none";
fifthStar.style.display = "block";
fifthStarSolid.style.display = "none";
inputNotation.setAttribute("value", 3);
});

fourthStar.addEventListener("click", () => {
firstStar.style.display = "none";
firstStarSolid.style.display = "block";
secondStar.style.display = "none";
secondStarSolid.style.display = "block";
thirdStar.style.display = "none";
thirdStarSolid.style.display = "block";
fourthStar.style.display = "none";
fourthStarSolid.style.display = "block";
fifthStar.style.display = "block";
fifthStarSolid.style.display = "none";
inputNotation.setAttribute("value", 4);
});

fourthStarSolid.addEventListener("click", () => {
firstStar.style.display = "none";
firstStarSolid.style.display = "block";
secondStar.style.display = "none";
secondStarSolid.style.display = "block";
thirdStar.style.display = "none";
thirdStarSolid.style.display = "block";
fourthStar.style.display = "none";
fourthStarSolid.style.display = "block";
fifthStar.style.display = "block";
fifthStarSolid.style.display = "none";
inputNotation.setAttribute("value", 4);
});

fifthStar.addEventListener("click", () => {
firstStar.style.display = "none";
firstStarSolid.style.display = "block";
secondStar.style.display = "none";
secondStarSolid.style.display = "block";
thirdStar.style.display = "none";
thirdStarSolid.style.display = "block";
fourthStar.style.display = "none";
fourthStarSolid.style.display = "block";
fifthStar.style.display = "none";
fifthStarSolid.style.display = "block";
inputNotation.setAttribute("value", 5);
});

fifthStarSolid.addEventListener("click", () => {
firstStar.style.display = "none";
firstStarSolid.style.display = "block";
secondStar.style.display = "none";
secondStarSolid.style.display = "block";
thirdStar.style.display = "none";
thirdStarSolid.style.display = "block";
fourthStar.style.display = "none";
fourthStarSolid.style.display = "block";
fifthStar.style.display = "none";
fifthStarSolid.style.display = "block";
inputNotation.setAttribute("value", 5);
});
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
document.addEventListener('DOMContentLoaded', () => {
const doc = document.querySelector('.carousel');
const doc = document.querySelector('#game-played');
const trigger = document.querySelector('[aria-haspopup="dialog"]');
const dialog = document.getElementById(trigger.getAttribute('aria-controls'));
const dismissTrigger = dialog.querySelector('[data-dismiss]');
const commentBox = document.querySelector('.comment-box');
const commentBox = document.querySelector('.review-box');

// Function to display the modal with animation
const open = function (dialog, box) {
Expand Down
4 changes: 2 additions & 2 deletions assets/styles/app.scss
Original file line number Diff line number Diff line change
Expand Up @@ -105,8 +105,8 @@ table {

// TEXT

h2, h3, h4, h5, h6, span, td, th, a,
p, ul, label, input, input::placeholder, select, button, img[alt],
h2, h3, h4, h5, h6, span,
p, ul, label, input, input::placeholder, select, textarea, a, button, img[alt],
.text
{
background: $colorGradient5;
Expand Down
9 changes: 9 additions & 0 deletions assets/styles/dashboard-admin.scss
Original file line number Diff line number Diff line change
Expand Up @@ -41,9 +41,18 @@

.content {

div.logout {
a {
padding: .5rem 1rem;
border-radius: $borderRadiusSmall;
border: 1px #C10BEE solid;
}
}

.nav-admin {
display: flex;
flex-direction: column;
margin-top: 15px;

a {
text-align: center;
Expand Down
Loading

0 comments on commit f60696c

Please sign in to comment.