Fetching contributors…
Cannot retrieve contributors at this time
191 lines (175 sloc) 7.58 KB
<!doctype html>
<meta http-equiv="X-UA-Compatible" content="IE=Edge">
<meta charset='utf-8'>
<link href='' rel='stylesheet' type='text/css'>
<link href='' rel='stylesheet' type='text/css'>
<link href='' rel='stylesheet' type='text/css'>
body {
font-family: Ubuntu, sans-serif;
padding: 80px;
background-color: #60D6A7;
h1,h3 {
font-family: 'Cabin Sketch', serif;
text-shadow: -1px 0px 1px #aaa;
h1 {
font-size: 4em;
margin: 0
h3 {
font-size: 2em;
margin: 0
select {
font-size: 0.8em;
a {
text-decoration: none;
color: #a13;
font-weight: bold;
a:hover {
text-decoration: underline;
pre {
font-family: "Ubuntu Mono";
font-size: 0.9em;
width: 75%;
background-color: #007143;
border-radius: 6px;
padding: 5px 10px;
color: #fff;
cursor: pointer;
text-shadow: -1px 1px 1px #333;
box-shadow: 0px 8px 8px -8px #333;
-moz-transition: all 0.3s ease-out;
-webkit-transition: all 0.3s ease-out;
-ms-transition: all 0.3s ease-out;
-o-transition: all 0.3s ease-out;
transition: all 0.3s ease-out;
pre:hover {
background-color: #00ae68;
blockquote {
font-size: 0.8em
<meta http-equiv="X-UA-Compatible" content="IE=Edge">
<link rel='stylesheet' href='themes/bigbox.css'/>
<link rel='stylesheet' href='themes/boldlight.css'/>
<link rel='stylesheet' href='themes/jackedup.css'/>
<link rel='stylesheet' href='themes/libnotify.css'/>
<link rel='stylesheet' href='themes/original.css'/>
<link rel='stylesheet' href='themes/flatty.css'/>
<script src='humane.js'></script>
<a href=""><img style="position: absolute; top: 0; right: 0; border: 0;" src="" alt="Fork me on GitHub" /></a>
<strong>A simple, modern, framework-independent, well-tested, unobtrusive, notification system.</strong>
<br/>Utilizes CSS transitions when available, falls back to JS animation when not. Includes mobile support.
<h3>Select a theme:
<select onchange='humane.baseCls="humane-"+this.options[this.selectedIndex].value'>
<option selected>libnotify</option>
<p>Click a code sample below to see it in action:</p>
<pre>humane.log("Welcome Back")</pre>
<pre>humane.log("Record <b>392</b> has been updated")</pre>
<pre>humane.log("Callback when finished", function(){"#a66000" })</pre>
<pre>humane.log("Options can be passed", { timeout: 4000, clickToClose: true, addnCls: 'humane-error' })</pre>
<p>Options can be specified in a variety of ways. Either by the entire instance as shown below, or per notification, as shown above:</p>
<pre>humane.timeout = 5000 // default: 2500</pre>
<p>Sets the delay before a message fades out (set to <b>0</b> for no timeout).</p>
<pre>humane.waitForMove = true // default: false</pre>
<p>Wait for mouse, keyboard, or touch action to be taken before clearing message (after timeout)</p>
<pre>humane.clickToClose = true // default: false</pre>
<p>Click or touch the notification to close</p>
<pre>humane.timeoutAfterMove = 2000 // default: 0</pre>
<p>Delay before notification disappears (useful in conjunction with waitForMove)</p>
<pre>humane.addnCls = 'humane-info' // default: ''</pre>
<p>Specify an additional class to apply when notifying (nice when you only want to change just a little bit of the style)</p>
<h3>Create instances with humane.create</h3>
<p>Create a completely new instance of humane using <b>humane.create()</b>.</p>
var notify = humane.create({ timeout: 4000, baseCls: 'humane-bigbox' })
notify.log('Custom Notifier')</pre>
<p>There are a options that can also be applied when creating an instance:</p>
<pre>humane.baseCls = 'humane' // default: 'humane'</pre>
<p>Specify an base class</p>
<h3>Spawn notifiers with humane.spawn</h3>
<p>Create a custom notifier using <b>humane.spawn()</b>.</p>
<pre> = humane.spawn({ addnCls: 'humane-libnotify-info', timeout: 1000 })'Info Themed Notifier')</pre>
humane.error = humane.spawn({ addnCls: 'humane-libnotify-error', timeout: 1000 })
humane.error('Error Themed Notifier')</pre>
<h3>Force remove current notification</h3>
<pre>humane.remove(function(){ alert('removed') })</pre>
<p>Force remove current notification, takes an optional callback fired when finished (note each instance has its own remove)</p>
<h3>Go crazy</h3>
<p>With all this power, you are bound to go CRAZY! Click the sample below to go crazy:</p>
var bigbox = humane.create({baseCls: 'humane-bigbox', timeout: 1000})
bigbox.error = bigbox.spawn({addnCls: 'humane-bigbox-error'})
var libnotify = humane.create({baseCls: 'humane-libnotify', addnCls: 'humane-libnotify-info'})
var jacked = humane.create({baseCls: 'humane-jackedup', addnCls: 'humane-jackedup-success'})
jacked.log("What's up here!")</pre>
<h3>Browser Support</h3>
<p>Uses CSS Transitions where available otherwise falls back to JS animation, degrades gracefully.</p>
<li>Internet Explorer 7+</li>
<li>Firefox 3+</li>
<li>Chrome 9+</li>
<li>Safari 3+</li>
<li>Opera 10+</li>
<li>iOS 4+</li>
<li>Android 2+</li>
<h3>Create A Custom Theme</h3>
<p>Humane is easily themable using <a href="">Stylus</a>. There are currently a few <a href=''>themes</a>, but I hope this grows. Send me a pull request and update the wiki with your favorite look and feel.</p>
<h3>Download and Usage</h3>
<p>Visit <a href=''>github page</a> to download and get more details.</p>
humane.baseCls = 'humane-libnotify'
var pretags = document.getElementsByTagName('pre')
for (var i = 0; i < pretags.length; i++) { (function(el){
el.onclick = function () {
}(pretags[i])) }