Skip to content

Instantly share code, notes, and snippets.

@asterick
Forked from StoneCypher/chicken.js
Last active August 29, 2015 14:00
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 asterick/a0799b0eaa1b65fc13a5 to your computer and use it in GitHub Desktop.
Save asterick/a0799b0eaa1b65fc13a5 to your computer and use it in GitHub Desktop.
(function(word) {
var walk=document.createTreeWalker(document.body,NodeFilter.SHOW_TEXT,null,false), el;
word=word.split("");
while(el=walk.nextNode()) {
el.nodeValue = el.nodeValue.replace(/\w+/g, function (o) {
return word.map(function (v, i) {
return (o[i] < "a") ? v.toUpperCase() : v;
}).join("");
});
}
})("hodor");
@asterick
Copy link
Author

It's a fork, yo. I just made it so the word stuff is easier to change.

@StoneCypher
Copy link

yeah but dat formatting doe

also you're re upper casing it for every letter

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment