Last active
March 15, 2018 18:34
-
-
Save erikvorhes/d926a3e92ced0505610a3880bf36dff8 to your computer and use it in GitHub Desktop.
You need a marquee.
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
| /** | |
| * This marquee stuff is deliberately low-tech. Use at your own risk. Licensed under whatever license you need. | |
| * Also available as a part of https://github.com/erikvorhes/Useless-JS | |
| * | |
| * Usage: `marquee();` | |
| */ | |
| function marquee(behavior, direction) { | |
| var behaviors = ['scroll', 'slide', 'alternate']; | |
| var directions = ['left', 'right', 'up', 'down']; | |
| var marquee = document.createElement('marquee'); | |
| if (behavior && behaviors.includes(behavior)) { | |
| marquee.behavior = behavior; | |
| } | |
| if (direction && directions.includes(direction)) { | |
| marquee.direction = direction; | |
| } | |
| marquee.innerHTML = document.body.innerHTML; | |
| document.body.innerHTML = ''; | |
| document.body.appendChild(marquee); | |
| console && console.log('Enjoy.'); | |
| } |
Why is this not an actual repo so I can PR? :D
https://gist.github.com/ClaudiuCeia/39d73505afc3e87d69fa6bc1e1c757ab
Author
Why is this not an actual repo so I can PR?
Because you’ve added something that is not a marquee, @ClaudiuCeia. COME ON
Fair enough 👎
Author
@ClaudiuCeia -- You'll be happy to know that I just added marquee.js to Useless-JS. Feel free to add blink.js via pull request.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
🎉