• Stars
    star
    178
  • Rank 214,989 (Top 5 %)
  • Language
    JavaScript
  • License
    MIT License
  • Created over 8 years ago
  • Updated about 1 year ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

😜 Make users laugh when your app loads.

Travis build status Dependency Status devDependency Status

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

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

import {FunniesComponent} from 'funnies';
ReactDOM.render(<FunniesComponent />, node);
ReactDOM.render(<FunniesComponent interval={1000} />, node); // a new message every second
ReactDOM.render(<FunniesComponent customMessages={["You're too funny", "Thinking really hard..."]} />, node); // Add a few of your own messages

React Styles

Here's some css to properly animate funnies in the react component. Totally not required!

.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!

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.
    • Use Github's issue tracker.

Areas to improve

  • Angular bindings would be great.

More Repositories

1

debundle

🗃️ A javascript debundler. Takes a Browserify or Webpack bundle and recreates the initial, pre-bundled source.
JavaScript
702
star
2

fuzzy-picker

🔍 React component that implements a fuzzy picker (like sublime text's command pallete, or slack's channel switcher).
JavaScript
75
star
3

biome

🎄 A script to manage an isolated shell environment for a project.
Shell
52
star
4

slackpgp

A slackbot for sending pgp-encrypted messages.
Go
11
star
5

dotfiles

📮 All of my dotfiles. I aim to maintain compatibility with the latest Ubuntu LTS and macOS release.
Shell
4
star
6

mconmanager

Terminal app for managing multiple minecraft servers
Python
4
star
7

wtf-todo

A terminal based jira client.
Shell
4
star
8

cena2

(Old Cena) += 100
HTML
3
star
9

slick

A modular and extendable slack client.
Go
3
star
10

candycrowd

My Hack Upstate (hackupstate.com) project - candy tracking during halloween. Won Hack Upstate 2015 (in fall) and got an Amazon Echo!
CSS
2
star
11

8tracks-scraper

Scrape an 8tracks mix to plaintext and an rss feed
JavaScript
2
star
12

waltz

Manage your project development time.
JavaScript
2
star
13

emoji-bookmarklet

CSS
2
star
14

pgiso

3d isometric engine, written in python and pygame
Python
2
star
15

asidebar

A dead simple aside / sidebar for jQuery and React
CSS
2
star
16

ar-wikipedia

JavaScript
1
star
17

echoparser

emulation of the way an amazon echo works inside
CoffeeScript
1
star
18

gate-language

A language to express logic diagrams and create machines out of binary gates. Built by me to help me understand how computers work.
Go
1
star
19

qlists

list management plugin
Python
1
star
20

tunein

tunein radio scraper for javascript (built for node)
CoffeeScript
1
star
21

deployman

deploy apps really easily onto a server heroku style
CoffeeScript
1
star
22

homebrew-tap

Some of my projects are installable via homebrew.
Ruby
1
star
23

empty-fork

An empty fork
Python
1
star
24

que

life automation
JavaScript
1
star
25

how-to-network

How to use networking tools and the surrounding networking details required to understand what's happening.
1
star
26

widevine-initializer

Make sure that widevine (or any other eme plugin) is initialized before trying to access a drm'd stream.
JavaScript
1
star
27

quail

Ask a question, get a response
Python
1
star
28

familyhub

DIY Samsung Family Hub with Raspberry Pi and Webcam
Python
1
star
29

list-scripts

A small script to list all `scripts` in a package.json file from the command line
JavaScript
1
star
30

git-design

A small shim for managing design assets (sketch and invision studio) with git.
Shell
1
star
31

hackfrost

Snow day calculator for hack frost 2016
JavaScript
1
star