Skip to content

Luchador page Versus relocation and Reactive Layout #1248

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 9 additions & 14 deletions src/components/BoxerCard.astro
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ const { id, name, versus, class: extraClass } = Astro.props
interface Props {
id: string
name: string
versus: string
versus?: string
class: string
}
---
Expand Down Expand Up @@ -144,24 +144,21 @@ interface Props {
const versus = singleBoxerCard.getAttribute('data-versus')
if (versus) {
versusCard = document.querySelector(`[data-id=${versus}]`) as HTMLAnchorElement

versusCardDiv = versusCard.children[1] as HTMLDivElement

versusCardDiv.classList.remove('translate-y-2')
versusCardDiv.classList.add('opacity-100',"translate-y-0")
versusCardDiv.classList.add('opacity-100', 'translate-y-0')

versusCard.classList.remove('grayscale-100', 'opacity-40')
versusCard.classList.add("shadow-lg")
versusCard.classList.add('shadow-lg')

versusCard.children[0].children[2].classList.add('border-2',"opacity-100")
versusCard.children[0].children[2].classList.add('border-2', 'opacity-100')
versusCard.children[0].children[1].classList.add('translate-x-full')
versusCard.children[0].children[0].classList.add('scale-110')

versusCard.children[2].classList.add('w-2/3')
// select the second div inside the versusCard



}
})

Expand All @@ -175,20 +172,18 @@ interface Props {
boxerCards.forEach((card) => card.classList.remove('grayscale-100', 'opacity-40'))
// Quitar la clase de la tarjeta versus si existe
if (versusCard) {
versusCard.classList.remove("shadow-lg")
versusCardDiv?.classList.remove('opacity-100',"translate-y-0")
versusCard.classList.remove('shadow-lg')
versusCardDiv?.classList.remove('opacity-100', 'translate-y-0')
versusCardDiv?.classList.add('translate-y-2')


versusCard.children[0].children[2].classList.remove('border-2',"opacity-100")
versusCard.children[0].children[2].classList.remove('border-2', 'opacity-100')
versusCard.children[0].children[1].classList.remove('translate-x-full')
versusCard.children[0].children[0].classList.remove('scale-110')
versusCard.children[2].classList.remove('w-2/3')

versusCardDiv = null
versusCard = null
}

})

singleBoxerCard.addEventListener('focus', () => {
Expand Down
Loading