Skip to content

Instantly share code, notes, and snippets.

@seaside98
Created March 4, 2014 03:59
Show Gist options
  • Save seaside98/a60aaf378c274b600497 to your computer and use it in GitHub Desktop.
Save seaside98/a60aaf378c274b600497 to your computer and use it in GitHub Desktop.
/*April Fools 2013 (Backwards Chat) - by Seaside98 and Danielboone6702*/
var mill = new Date().getTime();
var goStop;
function timeCheck() {
var millCur = new Date().getTime();
if (millCur < mill+30000) { // < 30 seconds
goStop = true;
} else if (millCur > mill+300000) { // 5 minutes have passed
mill = mill+300000;
goStop = true;
} else { // > 30 seconds but < 5 minutes
goStop = false;
}
}
$('textarea[name="message"]').keydown(function(e) {
timeCheck();
if (goStop) {
$(this).val('\u202E' + $(this).val());
if (e.keyCode === 8 || e.keyCode === 46) {
return false;
}
}
});
/*April Fools 2014 (Wiggling Page) - by Seaside98*/
function wiggle(){
var t=Math.floor(new Date().getTime()%300000/6000);
if(t<=2&&!$('.wiggle').length){
$('body').append('<style type="text/css" class="wiggle">@-webkit-keyframes wiggle{0%{-webkit-transform:translate(2px, 1px) rotate(0deg);} 10%{-webkit-transform:translate(-1px, -2px) rotate(-1deg);} 20%{-webkit-transform:translate(-3px, 0px) rotate(1deg);} 30%{-webkit-transform:translate(0px, 2px) rotate(0deg);} 40%{-webkit-transform:translate(1px, -1px) rotate(1deg);} 50%{-webkit-transform:translate(-1px, 2px) rotate(-1deg);} 60%{-webkit-transform:translate(-3px, 1px) rotate(0deg);} 70%{-webkit-transform:translate(2px, 1px) rotate(-1deg);} 80%{-webkit-transform:translate(-1px, -1px) rotate(1deg);} 90%{-webkit-transform:translate(2px, 2px) rotate(0deg);} 100%{-webkit-transform:translate(1px, -2px) rotate(-1deg);}} @keyframes wiggle{0%{transform:translate(2px, 1px) rotate(0deg);} 10%{transform:translate(-1px, -2px) rotate(-1deg);} 20%{transform:translate(-3px, 0px) rotate(1deg);} 30%{transform:translate(0px, 2px) rotate(0deg);} 40%{transform:translate(1px, -1px) rotate(1deg);} 50%{transform:translate(-1px, 2px) rotate(-1deg);} 60%{transform:translate(-3px, 1px) rotate(0deg);} 70%{transform:translate(2px, 1px) rotate(-1deg);} 80%{transform:translate(-1px, -1px) rotate(1deg);} 90%{transform:translate(2px, 2px) rotate(0deg);} 100%{transform:translate(1px, -2px) rotate(-1deg);}} div{-webkit-animation-name:wiggle;-webkit-animation-duration:0.8s;-webkit-transform-origin:50% 50%;-webkit-animation-iteration-count:infinite;-webkit-animation-timing-function:linear;animation-name:wiggle;animation-duration:0.8s;transform-origin:50% 50%;animation-iteration-count:infinite;animation-timing-function:linear;}</style>');
}else if(t>2&&$('.wiggle').length){
$('.wiggle').remove();
}
}
var ug = wgUserGroups.join(' ');
if(ug.indexOf('staff')+ug.indexOf('helper')+ug.indexOf('vstf')==-3){setInterval(wiggle,12000);}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment