This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function gotoElem(sel) { | |
var targetElem = sel; // must be an element object, not a selector string | |
window.scrollTo(targetElem.offsetLeft+targetElem.offsetWidth/2-window.innerWidth/2,targetElem.offsetTop+targetElem.offsetHeight/2-window.innerHeight/2); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// get poke buttons, including suggested pokes | |
var pokeButtons = document.querySelectorAll(".mls a._4jy0"); | |
// exclude suggested pokes, because I couldn't find a way to do this using selectors ;_; | |
var pokeBacks = []; | |
for(i=0;i<pokeButtons.length;i++){ | |
if(pokeButtons[i].parentNode.parentNode.parentNode.parentNode.innerHTML.indexOf("Suggested Poke") == -1){ | |
pokeBacks.push(pokeButtons[i]) | |
} | |
} | |
// click all poke buttons |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<style> | |
body { | |
opacity:0; /* invisible at first */ | |
transition:opacity 1s; /* transition opacity for 1 second */ | |
} | |
</style> | |
<script> | |
document.addEventListener("DOMContentLoaded",function(){ // equivalent to jQuery ready() | |
document.body.style.opacity = "1"; // set body's opacity to 1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var I = 1; | |
var interval = setInterval( | |
function(){ | |
console.log(I); | |
I++; | |
},1); | |
setTimeout(function(){clearInterval(interval)},1000); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var typingEffect = function(string,node,delay){ | |
var splitString = string.split(""), | |
increment = 0; | |
var le_interval = setInterval(function(){ | |
if (increment < splitString.length) { | |
var span = document.createElement("span"); | |
span.innerHTML = splitString[increment]; | |
node.appendChild(span); | |
++increment; | |
} else { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
div._585- { | |
background-color: transparent; | |
border: none; | |
box-shadow: none; | |
} | |
div._585- * { | |
color: rgba(255,255,255,.7); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var objectSort = function(array,sortKey,sortFunction) { | |
switch (sortFunction) { | |
case "number-asc": | |
return array.sort(function(a, b){ | |
return a[sortKey]-b[sortKey]; | |
}); | |
break; | |
case "number-desc": | |
return array.sort(function(a, b){ | |
return b[sortKey]-a[sortKey]; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html> | |
<html> | |
<head> | |
<style> | |
* { | |
font-family:"Helvetica Neue",Helvetica,sans-serif; | |
} | |
html,body { | |
height:100%; | |
width:100%; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var injectJS = function(uri){ | |
var _injectJS_script = document.createElement("script"); | |
_injectJS_script.src = uri; | |
document.querySelectorAll("head")[0].appendChild(_injectJS_script); | |
} | |
// injectJS("//ajax.googleapis.com/ajax/libs/mootools/1.4.5/mootools-yui-compressed.js") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var autoClick = function(node,delay){ | |
setInterval(function(){ | |
node.click() | |
},delay) | |
} | |
// autoClick(document.body,1) | |
// delay is in milliseconds |
OlderNewer