Skip to content

Instantly share code, notes, and snippets.

@kylefox
Last active March 19, 2016 03:57
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save kylefox/f52b624b4a3f5d7b4a5b to your computer and use it in GitHub Desktop.
Save kylefox/f52b624b4a3f5d7b4a5b to your computer and use it in GitHub Desktop.
<!-- in head -->
<style>
body.clicked {
background: #7f1d26;
}
.smiley {
position: fixed;
top: 1rem;
right: 1rem;
width: 1rem;
height: 1rem;
line-height: 1rem;
font-size: 1rem;
transition-duration: .5s;
}
body.clicked .smiley {
transform: rotate(360deg) scale(2);
}
</style>
<!-- in body -->
<div class="smiley">😎</div>
<script>
jQuery('.smiley').on('click', function() {
jQuery('body').toggleClass('clicked');
});
</script>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment