Skip to content

Instantly share code, notes, and snippets.

@abhijit-hota
Created November 22, 2014 13:51
Show Gist options
  • Save abhijit-hota/b3bfc0a590ac52302a82 to your computer and use it in GitHub Desktop.
Save abhijit-hota/b3bfc0a590ac52302a82 to your computer and use it in GitHub Desktop.
Try to check it.
<input type="checkbox" name ="check"/>
<p>Congrats, you have cat like reflexes</p>
<span>Check me if you can!</span>
//Some Variables with boYs and boXes :P
{
var yo = document.querySelector('input');
var x = 100;
var y = 100;
var boY = y;
var boX = x;
}
//Basic mouseover function
document.body.onmousemove = function(event) {
boX = event.pageX - 25;
boY = event.pageY - 100;
};
//Smooth follow equations by @neave (Paul neave)
function update() {
requestAnimationFrame(update);
x += (boX - x) / 5;//Change that 5 to a number the larger the slower
y += (boY - y) / 5;//Change that 5 to a number the larger the slower
yo.style.left = (x - 50) + 'px';
yo.style.top = (y - 20) + 'px';
}
update();
$(checkbox).checked
@import url(http://fonts.googleapis.com/css?family=Bubblegum+Sans);
html {
height: 100%;
overflow: hidden;
//Kill that cursor :P
cursor: crosshair;
}
body{
background: #2c3e50;
margin: 0;
text-align:center;
width: 100%;
height: 100%;
overflow: hidden;
}
input{
height:7em;
width: 7em;
position: absolute;
background:none ;
-webkit-animation: eh 5s linear infinite;
border:5px solid #e74c3c;
border-radius:50%;
cursor:pointer;
&:checked ~ p{
display:block;
}
&:checked ~ span{
display:none;
}
}
@-webkit-keyframes eh {
100%{transform:rotate(360deg);}
}
span {
font-size:40px;
margin-top:15%;
font-family: 'Bubblegum Sans', cursive;
color:#e74c3c;
}
p{ font-size:40px;
margin-top:15%;
font-family: 'Bubblegum Sans', cursive;
color:#e74c3c;
display:none;}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment