Flashcards require mapping 3D CSS animations to JavaScript state to see if a card is “flipped”.

CSS 3D Card

.card {
  perspective: 1000px;
}
.inner {
  transition: transform 0.6s;
  transform-style: preserve-3d;
}
.card.flipped .inner {
  transform: rotateY(180deg);
}

JavaScript Logic

let flashcards = [
  { q: "What is the DOM?", a: "Document Object Model" }
];

document.querySelector('.card').addEventListener('click', function() {
  this.classList.toggle('flipped');
});

See the Live Demo for the full application where you can even add your own custom flashcards!