Allow card to flip both ways
This commit is contained in:
parent
30a5d53bc0
commit
357f0b06f3
14
flip.js
14
flip.js
@ -1,4 +1,14 @@
|
||||
var flipped = false;
|
||||
|
||||
function flipCard() {
|
||||
document.getElementById('card-front').style.transform = 'rotateX(-180deg)';
|
||||
document.getElementById('card-back').style.transform = 'rotateX(0deg)';
|
||||
|
||||
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;
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue
Block a user