Skip to content

Instantly share code, notes, and snippets.

@mspanish
Created February 6, 2013 21:29
Show Gist options
  • Save mspanish/4726021 to your computer and use it in GitHub Desktop.
Save mspanish/4726021 to your computer and use it in GitHub Desktop.
A CodePen by Stacey Reiman.
<div id="buttonbar"><img id="memoryToggle" onClick="memoryMode()" class="buttonBar" src="http://www.instaspanish.com/dev/memory.svg" height="75px" width="150px" /><img id="matchToggle" class="buttonBar" onClick="matchMode()" src="http://www.instaspanish.com/dev/match.svg" height="75px" width="150px" /></div>
memorytoggle = $('#memoryToggle')
matchtoggle = $('#matchToggle')
init();
function init() {
TweenLite.to(memorytoggle, .1, {css:{skewY:"-180deg"}});
}
function matchMode() {
TweenLite.to(matchtoggle, .2, {css:{autoAlpha:0}});
TweenLite.to(matchtoggle, .5, {css:{skewY:"180deg"}});
TweenLite.to(memorytoggle, .5, {css:{skewY:"-180deg", autoAlpha:1}});
}
function memoryMode() {
TweenLite.to(memorytoggle, .2, {css:{autoAlpha:0}});
TweenLite.to(memorytoggle, .5, {css:{skewY:"180deg"}});
TweenLite.to(matchtoggle, .5, {css:{skewY:"-180deg", autoAlpha:1}});
}
.buttonBar {
position:absolute;
left:80%;
top:10px;
height:auto;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment