Funnies
A flexible way to add funny loading messages to webapps with optional react support.
Examples and Demo
As of funnies 1.2.0
, funnies ships with examples. Take a look at
https://1egoman.github.io/funnies/ or build them locally by cloning down this repository, then
running npm install && gulp example
. This will start up a local server on port 8080.
Usage
Javascript
;let funnies = ;funnies; // "Reticulating Splines..."funnies; // "Generating witty dialog..."funnies; // "Go ahead -- hold your breath!"
React Component
import FunniesComponent from 'funnies';ReactDOM;ReactDOM; // a new message every secondReactDOM; // Add a few of your own messages
React Styles
Here's some css to properly animate funnies in the react component. Totally not required!
jQuery
Odan wrote a great jQuery plugin for Funnies!
;// (include js/jquery.funnies.js) ;
Troubleshooting/FAQ
-
Does this work in both the client and server-side?
Yes. Either include
dist/funnies.min.js
within your page and usewindow.Funnies
, or use node/browserify/webpack to require the module. -
Can I return a funny message within preformatted HTML?
Yes, try
funnies.messageHTML()
. -
I want to add a funny message!
Create a fork, add your message to
src/funnies.js
, then create a pull request. -
Something isn't working properly.
- Send me a tweet
@rgausnet
and I'll help you out asap. - Use Github's issue tracker.
- Send me a tweet
Areas to improve
- Angular bindings would be great.