Skip to content

Commit

Permalink
Merge pull request #464 from educlopez/feature/boxers
Browse files Browse the repository at this point in the history
Add active class to boxer links and update image filter
  • Loading branch information
midudev authored Mar 12, 2024
2 parents d1538fd + 0c18224 commit ba90f34
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion src/sections/SelectYourBoxer.astro
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,7 @@ const msFadeLuchador = 150
boxerLinks.forEach((link) => {
link.addEventListener("mouseenter", (event) => {
const { id, name, country, countryName } = (event.currentTarget as HTMLElement)?.dataset

link.classList.add("active")
setTimeout(
() => {
const boxerSrc = `/img/boxers/${id}-big`
Expand All @@ -162,6 +162,9 @@ const msFadeLuchador = 150
article.getAttribute("data-transition-duration") as unknown as number
)
})
link.addEventListener("mouseleave", () => {
link.classList.remove("active")
})
})
</script>

Expand Down Expand Up @@ -224,7 +227,14 @@ const msFadeLuchador = 150
.boxer-link:hover .boxer-image {
transform: scale(1.05);
}
.boxer-link .boxer-image {
filter: grayscale(100%);
transition: filter 0.3s ease;
}

.boxer-link.active .boxer-image {
filter: grayscale(0%);
}
.boxer-link:hover .boxer-link-background {
filter: brightness(0.5);
}
Expand Down

0 comments on commit ba90f34

Please sign in to comment.