Skip to content

Instantly share code, notes, and snippets.

@stephenhay
Forked from sanderaarts/list-chars.js
Last active November 21, 2015 12:42
Show Gist options
  • Save stephenhay/f32c72d0ed191bc68675 to your computer and use it in GitHub Desktop.
Save stephenhay/f32c72d0ed191bc68675 to your computer and use it in GitHub Desktop.
void function() {
var chars = document.body.innerText.split('').sort().filter(function(char, i, arr) {
return i === 0 || arr[i - 1] !== char;
}).join('');
var textarea = document.createElement('textarea'),
snippet = '<pre><link rel="stylesheet" type="text/css" href="http://fonts.googleapis.com/css?family=Inconsolata&text=' + chars + '"></pre>';
textarea.innerHTML = snippet;
textarea.setAttribute('style','position:fixed;top:5vh;left:5vw;height:90vh;width:90vw;box-shadow:0 0 5vmax black;background:white');
document.body.appendChild(textarea);
}();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment