Skip to content

Instantly share code, notes, and snippets.

@asterick
Forked from StoneCypher/chicken.js
Last active August 29, 2015 14:00
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
Star You must be signed in to star a gist
Embed
What would you like to do?
(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");
@StoneCypher
Copy link

@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