Uses the Twitch.tv JSON API to display a list of Online and Offline streamers. Now with a search bar!
This file contains hidden or 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 getTicks(min, max, numMiddleTicks) { | |
| const delta = (max - min) / (numMiddleTicks + 1); | |
| const middleTicks = Array(numMiddleTicks) | |
| .fill() | |
| .map((_, i) => { | |
| return min + (i + 1) * delta; | |
| }) | |
| return [min, ...middleTicks, max]; | |
| } |
This file contains hidden or 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 - returns function - shortens long numbers, given array of strings | |
| return function | |
| not numerical string (strings, not a number, arrays) --> number string | |
| INPUT | |
| array of string labels, base number | |
| input to the return function, must be validated |
Click the button to get a random Chuck Norris fact. Repeat ad nauseam. *Now with staggered animations using ngAnimate and animate.css! *Now with smoother interactions by preloading JSON for the next click so that it is ready to display. By the time each set animation is done, the next set of jokes should already be loaded.
TODO: Add twitter buttons to tweet awesome Chuck Norris jokes.