Created
April 19, 2018 02:13
-
-
Save bahia0019/becbec0c4dfde62054db6e1f0b97737e to your computer and use it in GitHub Desktop.
Flip Image with Greensock
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Polaroid Flip | |
* | |
*/ | |
// const polaroidFlip = function () { | |
// const flipSection = document.querySelectorAll('section'); | |
// for (var i = 0; i < flipSection.length; i++) { | |
// // cardBack = document.createElement('div') | |
// // cardBack.classList.add('content-block-back') | |
// // flipSection[i].appendChild(cardBack) | |
// const cardFront = document.querySelector('.content-block'); | |
// const cardBack = document.querySelector('.content-block-back'); | |
// const flipImages = document.querySelector('.swiper-polaroid'); | |
// const flipButton = document.querySelector('.flip-button'); | |
// const flipBackButton = document.querySelector('.flip-back-button'); | |
// // .classList.add('content-block'); | |
// // flipSection.appendChild(cardBack) | |
// var tl = new TimelineMax({ paused: true }); | |
// tl.to(cardFront, 1, { rotationY: '180', zIndex: 0 }) | |
// .to(cardBack, 1, { rotationY: '0', zIndex: 10 }, 0) | |
// flipButton.addEventListener( | |
// "click", | |
// function (event) { | |
// tl.play(0) | |
// event.preventDefault() | |
// }, | |
// false | |
// ) | |
// flipBackButton.addEventListener( | |
// "click", | |
// function (event) { | |
// tl.reverse(0) | |
// event.preventDefault() | |
// }, | |
// false | |
// ) | |
// } | |
// }; | |
// polaroidFlip(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment