info.luke-else.co.uk/js/flip.js

14 lines
460 B
JavaScript
Raw Normal View History

2023-08-29 16:23:21 +00:00
var flipped = false;
function flipCard() {
if (!flipped) {
document.getElementById('card-front').style.transform = 'rotateX(-180deg)';
document.getElementById('card-back').style.transform = 'rotateX(0deg)';
flipped = true;
}else{
document.getElementById('card-front').style.transform = 'rotateX(0deg)';
document.getElementById('card-back').style.transform = 'rotateX(-180deg)';
flipped = false;
}
}