Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

97
Views
How to make the cards turn over?

I'm trying to turn the cards around in this game, but I can't. I tried to do some things by manipulating the state, but to no avail. What I want to do is: When I click on the button that is in the Header component, all the cards must turn over. How can I do this?

Code:

import { imagesUrl } from "../../constants/urls"
import useRequestData from "../../hooks/useRequestData"
import { Card, Container, Footer } from "./styledTarotCard"

    const TarotCard = () => {
        const getTarot = useRequestData([], "tarot.json")
    
        const renderCard = getTarot?.cards?.map((card) => {
            return (
                <Card key={card.name}>
                    <img src={`${imagesUrl}${card.image}`} alt={"Imagem da Carta"} />
                    <Footer>
                        <p>{card.name}</p>
                    </Footer>
                </Card>
            )
        })
    
        return (
            <Container>
                {renderCard}
            </Container>
        )
    }
    
    export default TarotCard

Demo: http://muddled-shirt.surge.sh/

about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

Would something like this work? https://3dtransforms.desandro.com/card-flip

Basically, you would create two faces and apply some CSS magic (transform, backface-visibility, ...) and switch classes when you click or hover over a card.

about 4 years ago · Juan Pablo Isaza Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!