Skip to content

Instantly share code, notes, and snippets.

@joshdcomp
Last active August 29, 2015 14:19
Show Gist options
  • Save joshdcomp/a25049ff8384fe3ac678 to your computer and use it in GitHub Desktop.
Save joshdcomp/a25049ff8384fe3ac678 to your computer and use it in GitHub Desktop.
how I'd make a
@keyframes content-peep{
//bounce frames
}
.content{
margin-top: 100vh;
&-is_peeping{
animation: content-peep 200ms 1 500ms;
}
}
function HeroSlider(){
}
HeroSlider.prototype.windowPeep = function(){
$(body).addClass('content-is_peeping');
}
HeroSlider.prototype.init = function(){
$(window).on('focus', $.proxy(this.windowPeep, this));
}
var slider = new HeroSlider();
$(function(){
slider.init();
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment