Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save interfacecreation/e7dac95d79f66963076b37e00124236e to your computer and use it in GitHub Desktop.
Save interfacecreation/e7dac95d79f66963076b37e00124236e to your computer and use it in GitHub Desktop.
Draggable.create("svg", {
type: "rotation",
// throwProps: true,this will require a lisence
});
$('.slice path').click(function(e){
$('.slice path').css('fill', '#F3EAFE');
$(this).css('fill', '#D3C4E4');
var sliceID = $(this).parents('.slice').attr('id');
if (sliceID == 'slice-6'){
var rotationValue = 120
} else if( sliceID == 'slice-5'){
var rotationValue = 180
} else if( sliceID == 'slice-4'){
var rotationValue = 240
} else if( sliceID == 'slice-3'){
var rotationValue = 300
} else if( sliceID == 'slice-2'){
var rotationValue = 360
}
else {
var rotationValue = 60
}
var tl = new TimelineLite();
tl.to("svg", 0.5, {rotation:rotationValue})
// animate the tabs for spinning wheel
var sliceNumber = $('#' + sliceID).attr('data-slice-number');
$('.wheel__descriptions li').filter(':visible').fadeOut(200);
$('#wheel__description-'+ sliceNumber).delay(200).fadeIn(200);
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment