Make user's laugh when your app is loading.
npm install funnies


1.2.0, funnies ships with examples. Take a look atnpm install && gulp example. This will start up a local server on port 8080.javascript
import Funnies from 'funnies';
let funnies = new Funnies();
funnies.message(); // "Reticulating Splines..."
funnies.message(); // "Generating witty dialog..."
funnies.message(); // "Go ahead -- hold your breath!"
`React Component
!React rendering
`jsx
import {FunniesComponent} from 'funnies';
ReactDOM.render( , node);
ReactDOM.render( , node); // a new message every second
ReactDOM.render( , node); // Add a few of your own messages
`$3
Here's some css to properly animate funnies in the react component. Totally not required!
`css
.funnies-text {
transition: opacity 250ms ease-in-out;
}
.funnies-text.funnies-enter {
opacity: 0;
}
.funnies-text.funnies-enter-active {
opacity: 0;
}
.funnies-text.funnies-leave {
display: none;
}
.funnies-text.funnies-leave-active {
opacity: 0;
}
`jQuery
Odan wrote a great jQuery plugin for Funnies!
`javascript
import $ from 'jquery';
// (include js/jquery.funnies.js)$('element').funnies();
`
Troubleshooting/FAQ
- Does this work in both the client and server-side?
Yes. Either include
dist/funnies.min.js within your page and use window.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.- Angular bindings would be great.