├── .gitignore ├── test ├── issue36.html ├── issue23.html ├── issue49.html └── issue38.html ├── bower.json ├── package.json ├── theme-src ├── original.styl ├── libnotify.styl ├── bigbox.styl ├── notify.styl ├── boldlight.styl └── jackedup.styl ├── themes ├── original.css ├── flatty.css ├── notify.css ├── bigbox.css ├── libnotify.css ├── boldlight.css └── jackedup.css ├── readme.md ├── changelog.md ├── humane.min.js ├── index.html └── humane.js /.gitignore: -------------------------------------------------------------------------------- 1 | node_modules 2 | .DS_Store 3 | -------------------------------------------------------------------------------- /test/issue36.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 9 | 10 | -------------------------------------------------------------------------------- /bower.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "humane-js", 3 | "author": "Marc Harter <@wavded> (wavded.com)", 4 | "description": "A simple, modern, browser notification system", 5 | "keywords": [ "notification", "alert" ], 6 | "main":"./humane.min.js" 7 | } 8 | -------------------------------------------------------------------------------- /test/issue23.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 |

Automatically Show

5 | 10 | 11 | 12 | -------------------------------------------------------------------------------- /test/issue49.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 10 | -------------------------------------------------------------------------------- /test/issue38.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 |
7 | 15 | 16 | -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- 1 | { 2 | "author": "Marc Harter <@wavded> (wavded.com)", 3 | "name": "humane-js", 4 | "description": "A simple, modern, browser notification system", 5 | "version": "3.2.2", 6 | "homepage": "http://wavded.github.com/humane-js/", 7 | "repository": { 8 | "type": "git", 9 | "url": "git://github.com/wavded/humane-js.git" 10 | }, 11 | "main": "humane.js", 12 | "scripts": { 13 | "watch": "stylus -u nib -w theme-src/*.styl -o themes/", 14 | "minify": "uglifyjs --comments --preamble=\";\" humane.js > humane.min.js", 15 | "serve": "python -m SimpleHTTPServer" 16 | }, 17 | "engines": {}, 18 | "dependencies": {}, 19 | "devDependencies": { 20 | "canvas": "1.0.2", 21 | "nib": "^1.0.3", 22 | "stylus": "^0.47.3", 23 | "uglify-js": "^2.4.15" 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /theme-src/original.styl: -------------------------------------------------------------------------------- 1 | @import 'nib' 2 | vendor-prefixes = moz webkit ms o official 3 | support-for-ie = false 4 | 5 | html, body { min-height: 100% } 6 | .humane 7 | .humane-original 8 | position : fixed 9 | transition : all .2s ease-out 10 | z-index : 100000 11 | filter : unquote("progid:DXImageTransform.Microsoft.Alpha(Opacity=100)") 12 | 13 | .humane 14 | .humane-original 15 | font-family : Ubuntu, Verdana, sans-serif 16 | line-height : 40px 17 | font-size : 25px 18 | top : 25% 19 | left : 25% 20 | opacity : 0 21 | width : 50% 22 | min-height : 40px 23 | padding : 10px 24 | text-align : center 25 | background-color : #000 26 | color : #fff 27 | border-radius : 15px 28 | p, ul 29 | margin: 0 30 | padding: 0 31 | ul 32 | list-style: none 33 | &.humane-original-info 34 | background-color : #030 35 | &.humane-original-success 36 | background-color : #030 37 | &.humane-original-error 38 | background-color : #300 39 | 40 | .humane.humane-animate 41 | .humane-original.humane-original-animate 42 | opacity : 0.8 43 | &:hover 44 | opacity : 0.6 45 | 46 | .humane.humane-js-animate 47 | .humane-original.humane-original-js-animate 48 | opacity : 0.8 49 | &:hover 50 | opacity : 0.6 51 | filter : unquote("progid:DXImageTransform.Microsoft.Alpha(Opacity=60)") 52 | -------------------------------------------------------------------------------- /themes/original.css: -------------------------------------------------------------------------------- 1 | html, 2 | body { 3 | min-height: 100%; 4 | } 5 | .humane, 6 | .humane-original { 7 | position: fixed; 8 | -moz-transition: all 0.2s ease-out; 9 | -webkit-transition: all 0.2s ease-out; 10 | -ms-transition: all 0.2s ease-out; 11 | -o-transition: all 0.2s ease-out; 12 | transition: all 0.2s ease-out; 13 | z-index: 100000; 14 | filter: progid:DXImageTransform.Microsoft.Alpha(Opacity=100); 15 | } 16 | .humane, 17 | .humane-original { 18 | font-family: Ubuntu, Verdana, sans-serif; 19 | line-height: 40px; 20 | font-size: 25px; 21 | top: 25%; 22 | left: 25%; 23 | opacity: 0; 24 | width: 50%; 25 | min-height: 40px; 26 | padding: 10px; 27 | text-align: center; 28 | background-color: #000; 29 | color: #fff; 30 | -webkit-border-radius: 15px; 31 | border-radius: 15px; 32 | } 33 | .humane p, 34 | .humane-original p, 35 | .humane ul, 36 | .humane-original ul { 37 | margin: 0; 38 | padding: 0; 39 | } 40 | .humane ul, 41 | .humane-original ul { 42 | list-style: none; 43 | } 44 | .humane.humane-original-info, 45 | .humane-original.humane-original-info { 46 | background-color: #030; 47 | } 48 | .humane.humane-original-success, 49 | .humane-original.humane-original-success { 50 | background-color: #030; 51 | } 52 | .humane.humane-original-error, 53 | .humane-original.humane-original-error { 54 | background-color: #300; 55 | } 56 | .humane.humane-animate, 57 | .humane-original.humane-original-animate { 58 | opacity: 0.8; 59 | } 60 | .humane.humane-animate:hover, 61 | .humane-original.humane-original-animate:hover { 62 | opacity: 0.6; 63 | } 64 | .humane.humane-js-animate, 65 | .humane-original.humane-original-js-animate { 66 | opacity: 0.8; 67 | } 68 | .humane.humane-js-animate:hover, 69 | .humane-original.humane-original-js-animate:hover { 70 | opacity: 0.6; 71 | filter: progid:DXImageTransform.Microsoft.Alpha(Opacity=60); 72 | } 73 | -------------------------------------------------------------------------------- /theme-src/libnotify.styl: -------------------------------------------------------------------------------- 1 | @import 'nib' 2 | vendor-prefixes = moz webkit ms o official 3 | support-for-ie = false 4 | 5 | html, body { min-height: 100% } 6 | .humane 7 | .humane-libnotify 8 | position : fixed 9 | transition : all .3s ease-out 10 | z-index : 100000 11 | filter : unquote("progid:DXImageTransform.Microsoft.Alpha(Opacity=100)") 12 | 13 | .humane 14 | .humane-libnotify 15 | font-family : Ubuntu, Arial, sans-serif 16 | text-align : center 17 | font-size : 15px 18 | top : 10px 19 | right : 10px 20 | opacity : 0 21 | width : 150px 22 | color : #fff 23 | padding : 10px 24 | background-image : linear-gradient-image(80px, rgba(0,0,0,0.9), rgba(50,50,50,0.9)) 25 | background : linear-gradient(top, rgba(0,0,0,0.9), rgba(50,50,50,0.9)) no-repeat 26 | *background-color : #000 27 | border-radius : 5px 28 | box-shadow : 0 4px 4px -4px #000 29 | transform : translateY(-40px) 30 | p, ul 31 | margin: 0 32 | padding: 0 33 | ul 34 | list-style: none 35 | &.humane-libnotify-info 36 | background-image : linear-gradient-image(80px, rgba(0,0,50,0.9), rgba(0,0,100,0.9)) 37 | background : linear-gradient(top, rgba(0,0,50,0.9), rgba(0,0,100,0.9)) no-repeat 38 | *background-color : #030 39 | &.humane-libnotify-success 40 | background-image : linear-gradient-image(80px, rgba(0,50,0,0.9), rgba(0,100,0,0.9)) 41 | background : linear-gradient(top, rgba(0,50,0,0.9), rgba(0,100,0,0.9)) no-repeat 42 | *background-color : #030 43 | &.humane-libnotify-error 44 | background-image : linear-gradient-image(200px, rgba(50,0,0,0.9), rgba(100,0,0,0.9)) 45 | background : linear-gradient(top, rgba(50,0,0,0.9), rgba(100,0,0,0.9)) no-repeat 46 | *background-color : #300 47 | 48 | .humane.humane-animate 49 | .humane-libnotify.humane-libnotify-animate 50 | opacity : 1 51 | transform : translateY(0) 52 | &:hover 53 | opacity : 0.2 54 | 55 | .humane.humane-animate 56 | .humane-libnotify.humane-libnotify-js-animate 57 | opacity : 1 58 | transform : translateY(0) 59 | &:hover 60 | opacity : 0.2 61 | filter : unquote("progid:DXImageTransform.Microsoft.Alpha(Opacity=20)") 62 | -------------------------------------------------------------------------------- /theme-src/bigbox.styl: -------------------------------------------------------------------------------- 1 | @import 'nib' 2 | vendor-prefixes = moz webkit ms o official 3 | support-for-ie = false 4 | 5 | html, body { min-height: 100% } 6 | .humane 7 | .humane-bigbox 8 | position : fixed 9 | transition : all .3s ease-out 10 | z-index : 100000 11 | filter : unquote("progid:DXImageTransform.Microsoft.Alpha(Opacity=100)") 12 | 13 | .humane 14 | .humane-bigbox 15 | font-family : Ubuntu, Verdana, sans-serif 16 | line-height : 40px 17 | font-size : 35px 18 | top : 25% 19 | left : 25% 20 | opacity : 0 21 | width : 50% 22 | min-height : 40px 23 | padding : 30px 24 | text-align : center 25 | background-image : linear-gradient-image(200px, rgba(0,0,0,1), rgba(100,100,100,0.8)) 26 | background : linear-gradient(top, rgba(0,0,0,1), rgba(0,0,0,0.9)) no-repeat 27 | *background-color : #000 28 | color : #fff 29 | border-radius : 15px 30 | text-shadow : 0 -1px 1px #ddd 31 | box-shadow : 0 15px 15px -15px #000 32 | transform : scale(0.1) 33 | p, ul 34 | margin: 0 35 | padding: 0 36 | ul 37 | list-style: none 38 | &.humane-bigbox-info 39 | background-image : linear-gradient-image(200px, rgba(0,0,100,1), rgba(0,0,100,0.8)) 40 | background : linear-gradient(top, rgba(0,0,100,1), rgba(0,0,100,0.9)) no-repeat 41 | *background-color : #030 42 | &.humane-bigbox-success 43 | background-image : linear-gradient-image(200px, rgba(0,100,0,1), rgba(0,100,0,0.8)) 44 | background : linear-gradient(top, rgba(0,100,0,1), rgba(0,100,0,0.9)) no-repeat 45 | *background-color : #030 46 | &.humane-bigbox-error 47 | background-image : linear-gradient-image(200px, rgba(100,0,0,1), rgba(100,0,0,0.8)) 48 | background : linear-gradient(top, rgba(100,0,0,1), rgba(100,0,0,0.9)) no-repeat 49 | *background-color : #300 50 | 51 | .humane.humane-animate 52 | .humane-bigbox.humane-bigbox-animate 53 | opacity: 1 54 | transform: scale(1) 55 | &:hover 56 | opacity: 0.6 57 | transform: scale(0.8) 58 | 59 | .humane.humane-js-animate 60 | .humane-bigbox.humane-bigbox-js-animate 61 | opacity: 1 62 | transform: scale(1) 63 | &:hover 64 | opacity: 0.6 65 | filter : unquote("progid:DXImageTransform.Microsoft.Alpha(Opacity=60)") 66 | -------------------------------------------------------------------------------- /theme-src/notify.styl: -------------------------------------------------------------------------------- 1 | @import 'nib' 2 | vendor-prefixes = moz webkit ms o official 3 | support-for-ie = false 4 | 5 | html, body { min-height: 100% } 6 | .humane 7 | .humane-notify 8 | position : fixed 9 | transition : all 0.35s cubic-bezier(0.175, 0.885, 0.320, 1.275) 10 | z-index : 100000 11 | filter : unquote("progid:DXImageTransform.Microsoft.Alpha(Opacity=100)") 12 | 13 | .humane 14 | .humane-notify 15 | font-family : Ubuntu, Arial, sans-serif 16 | text-align : center 17 | font-size : 15px 18 | bottom : 10px 19 | right : 10px 20 | opacity : 0 21 | width : 150px 22 | color : #fff 23 | padding : 5px 10px 24 | background-image : linear-gradient-image(80px, rgba(72, 72, 72, 1), rgba(122, 122, 122, 1)) 25 | background : linear-gradient(top,rgba(72, 72, 72, 1), rgba(122, 122, 122, 1)) no-repeat 26 | *background-color : #484848 27 | box-shadow : 0 4px 4px -4px #000 28 | transform : translateX(100%) 29 | p, ul 30 | margin: 0 31 | padding: 0 32 | ul 33 | list-style: none 34 | &.humane-notify-info 35 | background-image : linear-gradient-image(80px, rgba(72, 72, 72, 1), rgba(122, 122, 122, 1)) 36 | background : linear-gradient(top, rgba(72, 72, 72, 1), rgba(122, 122, 122, 1)) no-repeat 37 | *background-color : #484848 38 | &.humane-notify-success 39 | background-image : linear-gradient-image(80px, rgba(24, 188, 156, 1), rgba(18, 140, 116, 1)) 40 | background : linear-gradient(top, rgba(24, 188, 156, 1), rgba(18, 140, 116, 1)) no-repeat 41 | *background-color : #188c9c 42 | &.humane-notify-error 43 | background-image : linear-gradient-image(200px, rgba(231, 76, 60, 1), rgba(171, 59, 46, 1)) 44 | background : linear-gradient(top, rgba(231, 76, 60, 1), rgba(171, 59, 46, 1)) no-repeat 45 | *background-color : #874c3c 46 | 47 | .humane.humane-animate 48 | .humane-notify.humane-notify-animate 49 | opacity : 1 50 | transform : translateX(0) 51 | &:hover 52 | opacity : 0.3 53 | 54 | .humane.humane-animate 55 | .humane-notify.humane-notify-js-animate 56 | opacity : 1 57 | transform : translateX(0) 58 | &:hover 59 | opacity : 0.3 60 | filter : unquote("progid:DXImageTransform.Microsoft.Alpha(Opacity=30)") 61 | -------------------------------------------------------------------------------- /theme-src/boldlight.styl: -------------------------------------------------------------------------------- 1 | @import 'nib' 2 | vendor-prefixes = moz webkit ms o official 3 | support-for-ie = false 4 | 5 | html, body { min-height: 100% } 6 | .humane 7 | .humane-boldlight 8 | position : fixed 9 | transition : all .3s ease-out 10 | z-index : 100000 11 | filter : unquote("progid:DXImageTransform.Microsoft.Alpha(Opacity=100)") 12 | 13 | .humane 14 | .humane-boldlight 15 | font-family : Ubuntu, Verdana, sans-serif 16 | font-size : 25px 17 | letter-spacing : -1px 18 | top : 25% 19 | left : 25% 20 | opacity : 0 21 | width : 50% 22 | color : #000 23 | padding : 10px 24 | text-align : center 25 | background-image : linear-gradient-image(150px, rgba(255,255,255,0.8), rgba(150,150,150,0.8)) 26 | background : linear-gradient(top, rgba(255,255,255,0.8), rgba(150,150,150,0.8)) no-repeat 27 | *background-color: #fff 28 | border-radius : 15px 29 | text-shadow : 0 -1px 1px rgba(#ddd,0.4) 30 | box-shadow : 0 4px 4px -4px #eee 31 | transform : scale(1.1) 32 | p, ul 33 | margin: 0 34 | padding: 0 35 | ul 36 | list-style: none 37 | &.humane-boldlight-info 38 | background-image : linear-gradient-image(200px, rgba(100,100,255,1), rgba(100,100,255,0.8)) 39 | background : linear-gradient(top, rgba(100,100,255,1), rgba(100,100,255,0.8)) no-repeat 40 | *background-color : rgb(100,100,255) 41 | &.humane-boldlight-success 42 | background-image : linear-gradient-image(200px, rgba(100,255,100,0.8), rgba(100,255,100,0.8)) 43 | background : linear-gradient(top, rgba(100,255,100,1), rgba(100,255,100,0.8)) no-repeat 44 | *background-color : rgb(100,255,100) 45 | &.humane-boldlight-error 46 | background-image : linear-gradient-image(200px, rgba(255,100,100,0.8), rgba(255,100,100,0.8)) 47 | background : linear-gradient(top, rgba(255,100,100,1), rgba(255,100,100,0.8)) no-repeat 48 | *background-color : rgb(255,100,100) 49 | 50 | .humane.humane-animate 51 | .humane-boldlight.humane-boldlight-animate 52 | opacity : 1 53 | transform : scale(1) 54 | &:hover 55 | opacity : 0.4 56 | transform : scale(1.8) 57 | 58 | .humane.humane-animate 59 | .humane-boldlight.humane-boldlight-js-animate 60 | opacity : 1 61 | transform : scale(1) 62 | &:hover 63 | opacity : 0.4 64 | filter : unquote("progid:DXImageTransform.Microsoft.Alpha(Opacity=40)") 65 | -------------------------------------------------------------------------------- /theme-src/jackedup.styl: -------------------------------------------------------------------------------- 1 | @import 'nib' 2 | vendor-prefixes = moz webkit ms o official 3 | support-for-ie = false 4 | 5 | html, body { min-height: 100% } 6 | .humane 7 | .humane-jackedup 8 | position : fixed 9 | transition : all .6s ease-in-out 10 | z-index : 100000 11 | filter : unquote("progid:DXImageTransform.Microsoft.Alpha(Opacity=100)") 12 | 13 | .humane 14 | .humane-jackedup 15 | font-family : Helvetica Neue, Helvetica, sans-serif 16 | font-size : 18px 17 | letter-spacing : -1px 18 | top : 20px 19 | left : 30% 20 | opacity : 0 21 | width : 40% 22 | color : #333 23 | padding : 10px 24 | text-align : center 25 | background-image : linear-gradient-image(150px, rgba(0,0,0,.1), rgba(0,0,0,.2)) 26 | background : linear-gradient(top, rgba(0,0,0,.1), rgba(0,0,0,.2)) no-repeat 27 | background-color : #fff 28 | border-radius : 3px 29 | text-shadow : 0 1px 1px rgba(rgba(255,255,255,.8)) 30 | box-shadow : 0 1px 2px rgba(0,0,0,.5) 31 | transform : translateY(-100px) 32 | p, ul 33 | margin: 0 34 | padding: 0 35 | ul 36 | list-style: none 37 | &.humane-jackedup-info 38 | background-image : linear-gradient-image(200px, rgba(100,100,255,1), rgba(100,100,255,0.8)) 39 | background : linear-gradient(top, rgba(0,0,0,.7), rgba(0,0,0,.85)) no-repeat 40 | background-color : #fff 41 | color : #fff 42 | text-shadow : 0 -1px 1px rgba(0,0,0,.35) 43 | &.humane-jackedup-success 44 | background-image : linear-gradient-image(200px, rgba(100,255,100,1), rgba(100,255,100,0.8)) 45 | background : linear-gradient(top, rgba(98,196,98,1), rgba(87,169,87,1)) no-repeat 46 | background-color : rgb(100,255,100) 47 | color : #fff 48 | text-shadow : 0 -1px 1px rgba(0,0,0,.35) 49 | &.humane-jackedup-error 50 | background-image : linear-gradient-image(200px, rgba(238,95,91,1), rgba(196,60,53,1)) 51 | background : linear-gradient(top, rgba(238,95,91,1), rgba(196,60,53,1)) no-repeat 52 | background-color : rgb(238,95,91) 53 | color : #fff 54 | text-shadow : 0 -1px 1px rgba(rgba(0,0,0,.35)) 55 | 56 | .humane-animate 57 | .humane-jackedup.humane-jackedup-animate 58 | opacity : 1 59 | transform : translateY(0) 60 | &:hover 61 | opacity : .7 62 | 63 | .humane-js-animate 64 | .humane-jackedup.humane-jackedup-js-animate 65 | opacity : 1 66 | transform : translateY(0) 67 | &:hover 68 | opacity : 0.7 69 | filter : unquote("progid:DXImageTransform.Microsoft.Alpha(Opacity=70)") 70 | -------------------------------------------------------------------------------- /themes/flatty.css: -------------------------------------------------------------------------------- 1 | html, 2 | body { 3 | min-height: 100%; 4 | } 5 | .humane, 6 | .humane-flatty { 7 | position: fixed; 8 | -moz-transition: all 0.4s ease-in-out; 9 | -webkit-transition: all 0.4s ease-in-out; 10 | -ms-transition: all 0.4s ease-in-out; 11 | -o-transition: all 0.4s ease-in-out; 12 | transition: all 0.4s ease-in-out; 13 | z-index: 100000; 14 | filter: progid:DXImageTransform.Microsoft.Alpha(Opacity=100); 15 | } 16 | .humane, 17 | .humane-flatty { 18 | font-family: Helvetica Neue, Helvetica, sans-serif; 19 | font-size: 16px; 20 | top: 0; 21 | left: 30%; 22 | opacity: 0; 23 | width: 40%; 24 | color: #444; 25 | padding: 10px; 26 | text-align: center; 27 | background-color: #fff; 28 | -webkit-border-bottom-right-radius: 3px; 29 | -webkit-border-bottom-left-radius: 3px; 30 | -moz-border-bottom-right-radius: 3px; 31 | -moz-border-bottom-left-radius: 3px; 32 | border-bottom-right-radius: 3px; 33 | border-bottom-left-radius: 3px; 34 | -webkit-box-shadow: 0 1px 2px rgba(0,0,0,0.5); 35 | box-shadow: 0 1px 2px rgba(0,0,0,0.5); 36 | -moz-transform: translateY(-100px); 37 | -webkit-transform: translateY(-100px); 38 | -ms-transform: translateY(-100px); 39 | -o-transform: translateY(-100px); 40 | transform: translateY(-100px); 41 | } 42 | .humane p, 43 | .humane-flatty p, 44 | .humane ul, 45 | .humane-flatty ul { 46 | margin: 0; 47 | padding: 0; 48 | } 49 | .humane ul, 50 | .humane-flatty ul { 51 | list-style: none; 52 | } 53 | .humane.humane-flatty-info, 54 | .humane-flatty.humane-flatty-info { 55 | background-color: #3498db; 56 | color: #FFF; 57 | } 58 | .humane.humane-flatty-success, 59 | .humane-flatty.humane-flatty-success { 60 | background-color: #18bc9c; 61 | color: #FFF; 62 | } 63 | .humane.humane-flatty-error, 64 | .humane-flatty.humane-flatty-error { 65 | background-color: #e74c3c; 66 | color: #FFF; 67 | } 68 | .humane-animate, 69 | .humane-flatty.humane-flatty-animate { 70 | opacity: 1; 71 | -moz-transform: translateY(0); 72 | -webkit-transform: translateY(0); 73 | -ms-transform: translateY(0); 74 | -o-transform: translateY(0); 75 | transform: translateY(0); 76 | } 77 | .humane-animate:hover, 78 | .humane-flatty.humane-flatty-animate:hover { 79 | opacity: 0.7; 80 | } 81 | .humane-js-animate, 82 | .humane-flatty.humane-flatty-js-animate { 83 | opacity: 1; 84 | -moz-transform: translateY(0); 85 | -webkit-transform: translateY(0); 86 | -ms-transform: translateY(0); 87 | -o-transform: translateY(0); 88 | transform: translateY(0); 89 | } 90 | .humane-js-animate:hover, 91 | .humane-flatty.humane-flatty-js-animate:hover { 92 | opacity: 0.7; 93 | filter: progid:DXImageTransform.Microsoft.Alpha(Opacity=70); 94 | } 95 | -------------------------------------------------------------------------------- /readme.md: -------------------------------------------------------------------------------- 1 | # humane.js 2 | This project was heavily inspired by [humanmsg](http://code.google.com/p/humanmsg/) project for jQuery. I really 3 | liked the project but I wanted to remove the jQuery dependency, add support for CSS transitions, and have more 4 | control over the timing. I consider the project complete and don't plan on adding any new features except for any bug fixes. 5 | 6 | ## About 7 | humane.js tries to be as unobtrusive as possible to the user experience while providing helpful information that is 8 | clear and grabs the users attention. It is framework independent. Customizable. 9 | 10 | ## Setup 11 | Setup is simple: 12 | 13 | - Download tar/zip 14 | - Select a [theme](https://github.com/wavded/humane-js/wiki/Themes) from `themes` dir. 15 | - Include the theme CSS in your page 16 | - Include `humane.min.js` in your page 17 | 18 | ## Demo/Usage 19 | 20 | You can see a [demo and usage here](http://wavded.github.com/humane-js/) 21 | 22 | ## Custom Themes 23 | 24 | Got a neat theme/animation, love to see it. View `theme-src/bigbox.styl` for an template to get started (uses [Stylus](http://learnboost.github.com/stylus/) w/ Nib and Canvas). 25 | 26 | To get setup with Stylus use [npm](http://npmjs.org): 27 | 28 | ```sh 29 | npm install --development 30 | ``` 31 | 32 | With Stylus installed you can watch for changes and compile into CSS by running: 33 | 34 | ```sh 35 | npm run watch 36 | ``` 37 | 38 | ## Desktop and Mobile Browser Support 39 | 40 | humane.js has been tested for the following browsers. 41 | 42 | - Internet Explorer 7+ 43 | - Firefox 3+ 44 | - Chrome 9+ 45 | - Safari 3+ 46 | - Opera 10+ 47 | - iOS 4+ 48 | - Android 2+ 49 | 50 | ## AMD and Node.js Support 51 | 52 | humane.js works for AMD systems like [require.js](http://requirejs.org/) and within Node.js CommonJS module system like [browserify](https://github.com/substack/node-browserify). 53 | 54 | ## Contributers 55 | 56 | Many thanks to the JS/Browser wizards that helped make this better, community rocks! 57 | 58 | - @bga_ (Alexander) 59 | - @joseanpg (Jose) 60 | - @OiNutter (Will McKenzie) 61 | - @ianmassey (Ian Massey) 62 | 63 | ## License 64 | 65 | (The MIT License) 66 | 67 | Copyright (c) 2018 Marc Harter <wavded@gmail.com> 68 | 69 | Permission is hereby granted, free of charge, to any person obtaining 70 | a copy of this software and associated documentation files (the 71 | 'Software'), to deal in the Software without restriction, including 72 | without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to 73 | permit persons to whom the Software is furnished to do so, subject to 74 | the following conditions: 75 | 76 | The above copyright notice and this permission notice shall be 77 | included in all copies or substantial portions of the Software. 78 | 79 | THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, 80 | EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 81 | MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. 82 | IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY 83 | CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, 84 | TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE 85 | SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 86 | -------------------------------------------------------------------------------- /changelog.md: -------------------------------------------------------------------------------- 1 | 2 | 3.2.2 / 2014-12-09 3 | ================== 4 | 5 | * mod; User timeoutAfterMove of currentMsg [EloHg] 6 | 7 | 3.2.1 / 2014-11-02 8 | ================== 9 | 10 | * mod; readme 11 | * mod; switch to package.json scripts 12 | * add; semi's to protect js bundling issues 13 | 14 | 3.2.0 / 2014-03-22 15 | ================== 16 | 17 | * add; new theme called Flatty [msurguy] 18 | * add; requirejs test 19 | * fix; broken theme link 20 | * fix; version tag in bower configuration 21 | 22 | 3.1.0 / 2013-05-25 23 | ================== 24 | 25 | * removed; forceNew opt, not used 26 | * fixed; try catch for ie8 filter issue when gradient filter used 27 | * fixed; prevent accessing property of null/undefined objects 28 | * fixed; appendChild of null error GH #36 29 | * added; component.json 30 | * added new param: timeoutAfterMove : bool. Adds additional timeout after user action before closing 31 | 32 | 3.0.6 / 2013-01-04 33 | ================== 34 | 35 | * updated; modified styles for themes 36 | * fixed; timeout of 0 not working GH #35 37 | * fixed; font typo in jackedup.css 38 | * added; note about amd and commonjs to readme 39 | * added; ability to set container element when creating new humane instance 40 | 41 | 3.0.5 / 2012-09-03 42 | ================== 43 | 44 | * fixed; loading humane lib after dom ready GH #30 45 | 46 | 3.0.4 / 2012-07-21 47 | ================== 48 | 49 | * updated; build process 50 | * updated; attribution, sample 51 | * added; support Asynchronous Module Definition [tahu] 52 | * added; make spawn actions chainable 53 | 54 | 3.0.3 / 2012-07-06 55 | ================== 56 | 57 | * fixed; queued notification overwrites previous [JensRoland] 58 | * fixed; height declaration in themes [FileTrek] 59 | 60 | 3.0.1 / 2012-06-04 61 | ================== 62 | 63 | * updated; humane location in index 64 | * fixed; notification not showing up in ie8 onload GH #23 65 | 66 | 3.0.0 / 2012-05-07 67 | ================== 68 | 69 | * updated; documentation 70 | * removed; info, success, error (use spawn instead) 71 | * fixed; js error when no cb on remove 72 | * fixed; flicker bug in ie9 73 | * fixed; demo page not working in ie7,8 74 | * added; unique instance support 75 | * added; spawn support 76 | * added; options per notification 77 | * added; custom class support 78 | 79 | 2.8.1 / 2012-04-24 80 | ================== 81 | 82 | * added; callback to remove function GH #22 83 | 84 | 2.8.0 / 2012-02-21 85 | ================== 86 | 87 | * added; custom notifier support GH #19 88 | 89 | 2.7.2 / 2012-02-10 90 | ================== 91 | 92 | * fixed; IE 7/8 display issue 93 | * updated; docs page 94 | 95 | 2.7.1 / 2012-01-26 96 | ================== 97 | 98 | * fixed; display:none humane when not in use Fixes #18 99 | * added; exposed remove() 100 | 101 | 2.7.0 / 2012-01-12 102 | ================== 103 | 104 | * updated; improved support for iOS 4+, Android 2+ 105 | 106 | 2.6.0 / 2012-01-02 107 | ================== 108 | 109 | * added; event support 110 | * fixed; bug w/ transEnd firing multiple times 111 | 112 | 2.5.0 / 2011-12-23 113 | ================== 114 | 115 | * removed; forceNew (breaking change), hacky solution that didn't work very well 116 | * updated; code cleanup and refactor 117 | * updated; using transitionend for end events instead of timeout 118 | * added; waitForMove by type 119 | 120 | 2.2.8 / 2011-12-22 121 | ================== 122 | 123 | * added; timeout and clickToClose by type 124 | 125 | 2.2.7 / 2011-12-10 126 | ================== 127 | 128 | * added; ability to set the timeout to 0 (no timeout) 129 | 130 | 2.2.6 / 2011-12-08 131 | ================== 132 | 133 | * added; 'original' theme 134 | 135 | 2.2.5 / 2011-12-02 136 | ================== 137 | 138 | * added; click to close option 139 | 140 | 2.2.0 / 2011-12-02 141 | ================== 142 | 143 | * added; callback support @OiNutter 144 | * fixed; jackedup to support IE<9 145 | 146 | 2.1.1 / 2011-11-28 147 | ================== 148 | 149 | * fixed; restore original class after completion 150 | * added; jackedup theme 151 | * fixed; some IE fixes 152 | 153 | 2.1.0 / 2011-11-28 154 | ================== 155 | 156 | * added; stylus support, updated themes 157 | * added; bigbox theme 158 | * added; message types (log, info, error, success) 159 | 160 | 2.0.0 / 2011-07-12 161 | ================== 162 | 163 | * mobile support for iOS / Android 164 | * ie z-index fix 165 | * switched to z-index instead of visibility 166 | -------------------------------------------------------------------------------- /themes/notify.css: -------------------------------------------------------------------------------- 1 | html, 2 | body { 3 | min-height: 100%; 4 | } 5 | .humane, 6 | .humane-notify { 7 | position: fixed; 8 | -moz-transition: all 0.35s cubic-bezier(0.175, 0.885, 0.320, 1.275); 9 | -webkit-transition: all 0.35s cubic-bezier(0.175, 0.885, 0.320, 1.275); 10 | -ms-transition: all 0.35s cubic-bezier(0.175, 0.885, 0.320, 1.275); 11 | -o-transition: all 0.35s cubic-bezier(0.175, 0.885, 0.320, 1.275); 12 | transition: all 0.35s cubic-bezier(0.175, 0.885, 0.320, 1.275); 13 | z-index: 100000; 14 | filter: progid:DXImageTransform.Microsoft.Alpha(Opacity=100); 15 | } 16 | .humane, 17 | .humane-notify { 18 | font-family: Ubuntu, Arial, sans-serif; 19 | text-align: center; 20 | font-size: 15px; 21 | bottom: 10px; 22 | right: 10px; 23 | opacity: 0; 24 | width: 150px; 25 | color: #fff; 26 | padding: 5px 10px; 27 | background: -webkit-gradient(linear, left top, left bottom, color-stop(0, rgba(72, 72, 72, 1)), color-stop(1, rgba(122, 122, 122, 1))) no-repeat; 28 | background: -moz-linear-gradient(top, rgba(72, 72, 72, 1) 0%, rgba(122, 122, 122, 1) 100%) no-repeat; 29 | background: -webkit-linear-gradient(top, rgba(72, 72, 72, 1) 0%, rgba(122, 122, 122, 1) 100%) no-repeat; 30 | background: -ms-linear-gradient(top, rgba(72, 72, 72, 1) 0%, rgba(122, 122, 122, 1) 100%) no-repeat; 31 | background: -o-linear-gradient(top, rgba(72, 72, 72, 1) 0%, rgba(122, 122, 122, 1) 100%) no-repeat; 32 | background: linear-gradient(top, rgba(72, 72, 72, 1) 0%, rgba(122, 122, 122, 1) 100%) no-repeat; 33 | *background-color: #484848; 34 | -webkit-box-shadow: 0 4px 4px -4px #000; 35 | box-shadow: 0 4px 4px -4px #000; 36 | -moz-transform: translateX(100%); 37 | -webkit-transform: translateX(100%); 38 | -ms-transform: translateX(100%); 39 | -o-transform: translateX(100%); 40 | transform: translateX(100%); 41 | } 42 | .humane p, 43 | .humane-notify p, 44 | .humane ul, 45 | .humane-notify ul { 46 | margin: 0; 47 | padding: 0; 48 | } 49 | .humane ul, 50 | .humane-notify ul { 51 | list-style: none; 52 | } 53 | .humane.humane-notify-info, 54 | .humane-notify.humane-notify-info { 55 | background: -webkit-gradient(linear, left top, left bottom, color-stop(0, rgba(72, 72, 72, 1)), color-stop(1, rgba(122, 122, 122, 1))) no-repeat; 56 | background: -moz-linear-gradient(top, rgba(72, 72, 72, 1) 0%, rgba(122, 122, 122, 1) 100%) no-repeat; 57 | background: -webkit-linear-gradient(top, rgba(72, 72, 72, 1) 0%, rgba(122, 122, 122, 1) 100%) no-repeat; 58 | background: -ms-linear-gradient(top, rgba(72, 72, 72, 1) 0%, rgba(122, 122, 122, 1) 100%) no-repeat; 59 | background: -o-linear-gradient(top, rgba(72, 72, 72, 1) 0%, rgba(122, 122, 122, 1) 100%) no-repeat; 60 | background: linear-gradient(top, rgba(72, 72, 72, 1) 0%, rgba(122, 122, 122, 1) 100%) no-repeat; 61 | *background-color: #484848; 62 | } 63 | .humane.humane-notify-success, 64 | .humane-notify.humane-notify-success { 65 | background: -webkit-gradient(linear, left top, left bottom, color-stop(0, rgba(24, 188, 156, 1)), color-stop(1, rgba(18, 140, 116, 1))) no-repeat; 66 | background: -moz-linear-gradient(top, rgba(24, 188, 156, 1) 0%, rgba(18, 140, 116, 1) 100%) no-repeat; 67 | background: -webkit-linear-gradient(top, rgba(24, 188, 156, 1) 0%, rgba(18, 140, 116, 1) 100%) no-repeat; 68 | background: -ms-linear-gradient(top, rgba(24, 188, 156, 1) 0%, rgba(18, 140, 116, 1) 100%) no-repeat; 69 | background: -o-linear-gradient(top, rgba(24, 188, 156, 1) 0%, rgba(18, 140, 116, 1) 100%) no-repeat; 70 | background: linear-gradient(top, rgba(24, 188, 156, 1) 0%, rgba(18, 140, 116, 1) 100%) no-repeat; 71 | *background-color: #188c9c; 72 | } 73 | .humane.humane-notify-error, 74 | .humane-notify.humane-notify-error { 75 | background: -webkit-gradient(linear, left top, left bottom, color-stop(0, rgba(231, 76, 60, 1)), color-stop(1, rgba(171, 59, 46, 1))) no-repeat; 76 | background: -moz-linear-gradient(top, rgba(231, 76, 60, 1) 0%, rgba(171, 59, 46, 1) 100%) no-repeat; 77 | background: -webkit-linear-gradient(top, rgba(231, 76, 60, 1) 0%, rgba(171, 59, 46, 1) 100%) no-repeat; 78 | background: -ms-linear-gradient(top, rgba(231, 76, 60, 1) 0%, rgba(171, 59, 46, 1) 100%) no-repeat; 79 | background: -o-linear-gradient(top, rgba(231, 76, 60, 1) 0%, rgba(171, 59, 46, 1) 100%) no-repeat; 80 | background: linear-gradient(top, rgba(231, 76, 60, 1) 0%, rgba(171, 59, 46, 1) 100%) no-repeat; 81 | *background-color: #874c3c; 82 | } 83 | .humane.humane-animate, 84 | .humane-notify.humane-notify-animate { 85 | opacity: 1; 86 | -moz-transform: translateX(0); 87 | -webkit-transform: translateX(0); 88 | -ms-transform: translateX(0); 89 | -o-transform: translateX(0); 90 | transform: translateX(0); 91 | } 92 | .humane.humane-animate:hover, 93 | .humane-notify.humane-notify-animate:hover { 94 | opacity: 0.3; 95 | } 96 | .humane.humane-animate, 97 | .humane-notify.humane-notify-js-animate { 98 | opacity: 1; 99 | -moz-transform: translateX(0); 100 | -webkit-transform: translateX(0); 101 | -ms-transform: translateX(0); 102 | -o-transform: translateX(0); 103 | transform: translateX(0); 104 | } 105 | .humane.humane-animate:hover, 106 | .humane-notify.humane-notify-js-animate:hover { 107 | opacity: 0.3; 108 | filter: progid:DXImageTransform.Microsoft.Alpha(Opacity=30); 109 | } 110 | -------------------------------------------------------------------------------- /humane.min.js: -------------------------------------------------------------------------------- 1 | ; 2 | /** 3 | * humane.js 4 | * Humanized Messages for Notifications 5 | * @author Marc Harter (@wavded) 6 | * @example 7 | * humane.log('hello world'); 8 | * @license MIT 9 | * See more usage examples at: http://wavded.github.com/humane-js/ 10 | */ 11 | !function(name,context,definition){if(typeof module!=="undefined")module.exports=definition(name,context);else if(typeof define==="function"&&typeof define.amd==="object")define(definition);else context[name]=definition(name,context)}("humane",this,function(name,context){var win=window;var doc=document;var ENV={on:function(el,type,cb){"addEventListener"in win?el.addEventListener(type,cb,false):el.attachEvent("on"+type,cb)},off:function(el,type,cb){"removeEventListener"in win?el.removeEventListener(type,cb,false):el.detachEvent("on"+type,cb)},bind:function(fn,ctx){return function(){fn.apply(ctx,arguments)}},isArray:Array.isArray||function(obj){return Object.prototype.toString.call(obj)==="[object Array]"},config:function(preferred,fallback){return preferred!=null?preferred:fallback},transSupport:false,useFilter:/msie [678]/i.test(navigator.userAgent),_checkTransition:function(){var el=doc.createElement("div");var vendors={webkit:"webkit",Moz:"",O:"o",ms:"MS"};for(var vendor in vendors)if(vendor+"Transition"in el.style){this.vendorPrefix=vendors[vendor];this.transSupport=true}}};ENV._checkTransition();var Humane=function(o){o||(o={});this.queue=[];this.baseCls=o.baseCls||"humane";this.addnCls=o.addnCls||"";this.timeout="timeout"in o?o.timeout:2500;this.waitForMove=o.waitForMove||false;this.clickToClose=o.clickToClose||false;this.timeoutAfterMove=o.timeoutAfterMove||false;this.container=o.container;try{this._setupEl()}catch(e){ENV.on(win,"load",ENV.bind(this._setupEl,this))}};Humane.prototype={constructor:Humane,_setupEl:function(){var el=doc.createElement("div");el.style.display="none";if(!this.container){if(doc.body)this.container=doc.body;else throw"document.body is null"}this.container.appendChild(el);this.el=el;this.removeEvent=ENV.bind(function(){var timeoutAfterMove=ENV.config(this.currentMsg.timeoutAfterMove,this.timeoutAfterMove);if(!timeoutAfterMove){this.remove()}else{setTimeout(ENV.bind(this.remove,this),timeoutAfterMove)}},this);this.transEvent=ENV.bind(this._afterAnimation,this);this._run()},_afterTimeout:function(){if(!ENV.config(this.currentMsg.waitForMove,this.waitForMove))this.remove();else if(!this.removeEventsSet){ENV.on(doc.body,"mousemove",this.removeEvent);ENV.on(doc.body,"click",this.removeEvent);ENV.on(doc.body,"keypress",this.removeEvent);ENV.on(doc.body,"touchstart",this.removeEvent);this.removeEventsSet=true}},_run:function(){if(this._animating||!this.queue.length||!this.el)return;this._animating=true;if(this.currentTimer){clearTimeout(this.currentTimer);this.currentTimer=null}var msg=this.queue.shift();var clickToClose=ENV.config(msg.clickToClose,this.clickToClose);if(clickToClose){ENV.on(this.el,"click",this.removeEvent);ENV.on(this.el,"touchstart",this.removeEvent)}var timeout=ENV.config(msg.timeout,this.timeout);if(timeout>0)this.currentTimer=setTimeout(ENV.bind(this._afterTimeout,this),timeout);if(ENV.isArray(msg.html))msg.html="";this.el.innerHTML=msg.html;this.currentMsg=msg;this.el.className=this.baseCls;if(ENV.transSupport){this.el.style.display="block";setTimeout(ENV.bind(this._showMsg,this),50)}else{this._showMsg()}},_setOpacity:function(opacity){if(ENV.useFilter){try{this.el.filters.item("DXImageTransform.Microsoft.Alpha").Opacity=opacity*100}catch(err){}}else{this.el.style.opacity=String(opacity)}},_showMsg:function(){var addnCls=ENV.config(this.currentMsg.addnCls,this.addnCls);if(ENV.transSupport){this.el.className=this.baseCls+" "+addnCls+" "+this.baseCls+"-animate"}else{var opacity=0;this.el.className=this.baseCls+" "+addnCls+" "+this.baseCls+"-js-animate";this._setOpacity(0);this.el.style.display="block";var self=this;var interval=setInterval(function(){if(opacity<1){opacity+=.1;if(opacity>1)opacity=1;self._setOpacity(opacity)}else clearInterval(interval)},30)}},_hideMsg:function(){var addnCls=ENV.config(this.currentMsg.addnCls,this.addnCls);if(ENV.transSupport){this.el.className=this.baseCls+" "+addnCls;ENV.on(this.el,ENV.vendorPrefix?ENV.vendorPrefix+"TransitionEnd":"transitionend",this.transEvent)}else{var opacity=1;var self=this;var interval=setInterval(function(){if(opacity>0){opacity-=.1;if(opacity<0)opacity=0;self._setOpacity(opacity)}else{self.el.className=self.baseCls+" "+addnCls;clearInterval(interval);self._afterAnimation()}},30)}},_afterAnimation:function(){if(ENV.transSupport)ENV.off(this.el,ENV.vendorPrefix?ENV.vendorPrefix+"TransitionEnd":"transitionend",this.transEvent);if(this.currentMsg.cb)this.currentMsg.cb();this.el.style.display="none";this._animating=false;this._run()},remove:function(e){var cb=typeof e=="function"?e:null;ENV.off(doc.body,"mousemove",this.removeEvent);ENV.off(doc.body,"click",this.removeEvent);ENV.off(doc.body,"keypress",this.removeEvent);ENV.off(doc.body,"touchstart",this.removeEvent);ENV.off(this.el,"click",this.removeEvent);ENV.off(this.el,"touchstart",this.removeEvent);this.removeEventsSet=false;if(cb&&this.currentMsg)this.currentMsg.cb=cb;if(this._animating)this._hideMsg();else if(cb)cb()},log:function(html,o,cb,defaults){var msg={};if(defaults)for(var opt in defaults)msg[opt]=defaults[opt];if(typeof o=="function")cb=o;else if(o)for(var opt in o)msg[opt]=o[opt];msg.html=html;if(cb)msg.cb=cb;this.queue.push(msg);this._run();return this},spawn:function(defaults){var self=this;return function(html,o,cb){self.log.call(self,html,o,cb,defaults);return self}},create:function(o){return new Humane(o)}};return new Humane}); -------------------------------------------------------------------------------- /themes/bigbox.css: -------------------------------------------------------------------------------- 1 | html, 2 | body { 3 | min-height: 100%; 4 | } 5 | .humane, 6 | .humane-bigbox { 7 | position: fixed; 8 | -moz-transition: all 0.3s ease-out; 9 | -webkit-transition: all 0.3s ease-out; 10 | -ms-transition: all 0.3s ease-out; 11 | -o-transition: all 0.3s ease-out; 12 | transition: all 0.3s ease-out; 13 | z-index: 100000; 14 | filter: progid:DXImageTransform.Microsoft.Alpha(Opacity=100); 15 | } 16 | .humane, 17 | .humane-bigbox { 18 | font-family: Ubuntu, Verdana, sans-serif; 19 | line-height: 40px; 20 | font-size: 35px; 21 | top: 25%; 22 | left: 25%; 23 | opacity: 0; 24 | width: 50%; 25 | min-height: 40px; 26 | padding: 30px; 27 | text-align: center; 28 | background-image: url('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAADICAYAAAAp8ov1AAAABmJLR0QA/wD/AP+gvaeTAAAAc0lEQVQokb2RQQ6EMAwDx/7/n80BtIEC3RYhLlXrVLGTAYiBWBIGtkPSP01SfreTVoV5re9Rcee1scwDk9NurbR62sZJcpzy9O+2X5KsXabyPaQFYNuvkqkRviDTp9Vs8opC0TpkHvJtVjeReW/5kEyX1gKeLEKE9peeWAAAAABJRU5ErkJggg=='); 29 | background: -webkit-gradient(linear, left top, left bottom, color-stop(0, #000), color-stop(1, rgba(0,0,0,0.9))) no-repeat; 30 | background: -moz-linear-gradient(top, #000 0%, rgba(0,0,0,0.9) 100%) no-repeat; 31 | background: -webkit-linear-gradient(top, #000 0%, rgba(0,0,0,0.9) 100%) no-repeat; 32 | background: -ms-linear-gradient(top, #000 0%, rgba(0,0,0,0.9) 100%) no-repeat; 33 | background: -o-linear-gradient(top, #000 0%, rgba(0,0,0,0.9) 100%) no-repeat; 34 | background: linear-gradient(top, #000 0%, rgba(0,0,0,0.9) 100%) no-repeat; 35 | *background-color: #000; 36 | color: #fff; 37 | -webkit-border-radius: 15px; 38 | border-radius: 15px; 39 | text-shadow: 0 -1px 1px #ddd; 40 | -webkit-box-shadow: 0 15px 15px -15px #000; 41 | box-shadow: 0 15px 15px -15px #000; 42 | -moz-transform: scale(0.1); 43 | -webkit-transform: scale(0.1); 44 | -ms-transform: scale(0.1); 45 | -o-transform: scale(0.1); 46 | transform: scale(0.1); 47 | } 48 | .humane p, 49 | .humane-bigbox p, 50 | .humane ul, 51 | .humane-bigbox ul { 52 | margin: 0; 53 | padding: 0; 54 | } 55 | .humane ul, 56 | .humane-bigbox ul { 57 | list-style: none; 58 | } 59 | .humane.humane-bigbox-info, 60 | .humane-bigbox.humane-bigbox-info { 61 | background-image: url('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAADICAYAAAAp8ov1AAAABmJLR0QA/wD/AP+gvaeTAAAAQElEQVQokWNgYEj5z8TAwPCfiYGBgQGVIEKMTG2DTYwRVez/IHIaNcUGyBnYgpORel6gpvFEJhBqpxIaG8/AAADsKDq/HhYQ2AAAAABJRU5ErkJggg=='); 62 | background: -webkit-gradient(linear, left top, left bottom, color-stop(0, #000064), color-stop(1, rgba(0,0,100,0.9))) no-repeat; 63 | background: -moz-linear-gradient(top, #000064 0%, rgba(0,0,100,0.9) 100%) no-repeat; 64 | background: -webkit-linear-gradient(top, #000064 0%, rgba(0,0,100,0.9) 100%) no-repeat; 65 | background: -ms-linear-gradient(top, #000064 0%, rgba(0,0,100,0.9) 100%) no-repeat; 66 | background: -o-linear-gradient(top, #000064 0%, rgba(0,0,100,0.9) 100%) no-repeat; 67 | background: linear-gradient(top, #000064 0%, rgba(0,0,100,0.9) 100%) no-repeat; 68 | *background-color: #030; 69 | } 70 | .humane.humane-bigbox-success, 71 | .humane-bigbox.humane-bigbox-success { 72 | background-image: url('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAADICAYAAAAp8ov1AAAABmJLR0QA/wD/AP+gvaeTAAAAPklEQVQokWNgSGH4z8TAACEYUAkixMjUNsjEGFHF/g8ip1FVbGCcgS04GannBaoaT1wCwWkvmXbQ2HgGBgYA8Yw6v+m4Kh8AAAAASUVORK5CYII='); 73 | background: -webkit-gradient(linear, left top, left bottom, color-stop(0, #006400), color-stop(1, rgba(0,100,0,0.9))) no-repeat; 74 | background: -moz-linear-gradient(top, #006400 0%, rgba(0,100,0,0.9) 100%) no-repeat; 75 | background: -webkit-linear-gradient(top, #006400 0%, rgba(0,100,0,0.9) 100%) no-repeat; 76 | background: -ms-linear-gradient(top, #006400 0%, rgba(0,100,0,0.9) 100%) no-repeat; 77 | background: -o-linear-gradient(top, #006400 0%, rgba(0,100,0,0.9) 100%) no-repeat; 78 | background: linear-gradient(top, #006400 0%, rgba(0,100,0,0.9) 100%) no-repeat; 79 | *background-color: #030; 80 | } 81 | .humane.humane-bigbox-error, 82 | .humane-bigbox.humane-bigbox-error { 83 | background-image: url('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAADICAYAAAAp8ov1AAAABmJLR0QA/wD/AP+gvaeTAAAAPklEQVQokWNIYWD4z8QAJRhQCSLEyNQ2uMQYUcX+DyKnUVdsQJyBLTgZqecF6hpPVALBaS+ZdtDYeAYGBgYA9vA6v4OR3MkAAAAASUVORK5CYII='); 84 | background: -webkit-gradient(linear, left top, left bottom, color-stop(0, #640000), color-stop(1, rgba(100,0,0,0.9))) no-repeat; 85 | background: -moz-linear-gradient(top, #640000 0%, rgba(100,0,0,0.9) 100%) no-repeat; 86 | background: -webkit-linear-gradient(top, #640000 0%, rgba(100,0,0,0.9) 100%) no-repeat; 87 | background: -ms-linear-gradient(top, #640000 0%, rgba(100,0,0,0.9) 100%) no-repeat; 88 | background: -o-linear-gradient(top, #640000 0%, rgba(100,0,0,0.9) 100%) no-repeat; 89 | background: linear-gradient(top, #640000 0%, rgba(100,0,0,0.9) 100%) no-repeat; 90 | *background-color: #300; 91 | } 92 | .humane.humane-animate, 93 | .humane-bigbox.humane-bigbox-animate { 94 | opacity: 1; 95 | -moz-transform: scale(1); 96 | -webkit-transform: scale(1); 97 | -ms-transform: scale(1); 98 | -o-transform: scale(1); 99 | transform: scale(1); 100 | } 101 | .humane.humane-animate:hover, 102 | .humane-bigbox.humane-bigbox-animate:hover { 103 | opacity: 0.6; 104 | -moz-transform: scale(0.8); 105 | -webkit-transform: scale(0.8); 106 | -ms-transform: scale(0.8); 107 | -o-transform: scale(0.8); 108 | transform: scale(0.8); 109 | } 110 | .humane.humane-js-animate, 111 | .humane-bigbox.humane-bigbox-js-animate { 112 | opacity: 1; 113 | -moz-transform: scale(1); 114 | -webkit-transform: scale(1); 115 | -ms-transform: scale(1); 116 | -o-transform: scale(1); 117 | transform: scale(1); 118 | } 119 | .humane.humane-js-animate:hover, 120 | .humane-bigbox.humane-bigbox-js-animate:hover { 121 | opacity: 0.6; 122 | filter: progid:DXImageTransform.Microsoft.Alpha(Opacity=60); 123 | } 124 | -------------------------------------------------------------------------------- /themes/libnotify.css: -------------------------------------------------------------------------------- 1 | html, 2 | body { 3 | min-height: 100%; 4 | } 5 | .humane, 6 | .humane-libnotify { 7 | position: fixed; 8 | -moz-transition: all 0.3s ease-out; 9 | -webkit-transition: all 0.3s ease-out; 10 | -ms-transition: all 0.3s ease-out; 11 | -o-transition: all 0.3s ease-out; 12 | transition: all 0.3s ease-out; 13 | z-index: 100000; 14 | filter: progid:DXImageTransform.Microsoft.Alpha(Opacity=100); 15 | } 16 | .humane, 17 | .humane-libnotify { 18 | font-family: Ubuntu, Arial, sans-serif; 19 | text-align: center; 20 | font-size: 15px; 21 | top: 10px; 22 | right: 10px; 23 | opacity: 0; 24 | width: 150px; 25 | color: #fff; 26 | padding: 10px; 27 | background-image: url('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAABQCAYAAADYxx/bAAAABmJLR0QA/wD/AP+gvaeTAAAANElEQVQYlWNgYGB4ysTAwMDAxMjICCUQXDQWAwMDAxMTExMedcRyB6d5CAMQ5hGrjSrmAQBQdgIXlosSTwAAAABJRU5ErkJggg=='); 28 | background: -webkit-gradient(linear, left top, left bottom, color-stop(0, rgba(0,0,0,0.9)), color-stop(1, rgba(50,50,50,0.9))) no-repeat; 29 | background: -moz-linear-gradient(top, rgba(0,0,0,0.9) 0%, rgba(50,50,50,0.9) 100%) no-repeat; 30 | background: -webkit-linear-gradient(top, rgba(0,0,0,0.9) 0%, rgba(50,50,50,0.9) 100%) no-repeat; 31 | background: -ms-linear-gradient(top, rgba(0,0,0,0.9) 0%, rgba(50,50,50,0.9) 100%) no-repeat; 32 | background: -o-linear-gradient(top, rgba(0,0,0,0.9) 0%, rgba(50,50,50,0.9) 100%) no-repeat; 33 | background: linear-gradient(top, rgba(0,0,0,0.9) 0%, rgba(50,50,50,0.9) 100%) no-repeat; 34 | *background-color: #000; 35 | -webkit-border-radius: 5px; 36 | border-radius: 5px; 37 | -webkit-box-shadow: 0 4px 4px -4px #000; 38 | box-shadow: 0 4px 4px -4px #000; 39 | -moz-transform: translateY(-40px); 40 | -webkit-transform: translateY(-40px); 41 | -ms-transform: translateY(-40px); 42 | -o-transform: translateY(-40px); 43 | transform: translateY(-40px); 44 | } 45 | .humane p, 46 | .humane-libnotify p, 47 | .humane ul, 48 | .humane-libnotify ul { 49 | margin: 0; 50 | padding: 0; 51 | } 52 | .humane ul, 53 | .humane-libnotify ul { 54 | list-style: none; 55 | } 56 | .humane.humane-libnotify-info, 57 | .humane-libnotify.humane-libnotify-info { 58 | background-image: url('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAABQCAYAAADYxx/bAAAABmJLR0QA/wD/AP+gvaeTAAAAMUlEQVQYlWNgYDB6ysTAwMDAxMDACCcYUFkMDEwMDEwMBNVhkxg65jGhmke6M6hgHgBSdgHnpZwADwAAAABJRU5ErkJggg=='); 59 | background: -webkit-gradient(linear, left top, left bottom, color-stop(0, rgba(0,0,50,0.9)), color-stop(1, rgba(0,0,100,0.9))) no-repeat; 60 | background: -moz-linear-gradient(top, rgba(0,0,50,0.9) 0%, rgba(0,0,100,0.9) 100%) no-repeat; 61 | background: -webkit-linear-gradient(top, rgba(0,0,50,0.9) 0%, rgba(0,0,100,0.9) 100%) no-repeat; 62 | background: -ms-linear-gradient(top, rgba(0,0,50,0.9) 0%, rgba(0,0,100,0.9) 100%) no-repeat; 63 | background: -o-linear-gradient(top, rgba(0,0,50,0.9) 0%, rgba(0,0,100,0.9) 100%) no-repeat; 64 | background: linear-gradient(top, rgba(0,0,50,0.9) 0%, rgba(0,0,100,0.9) 100%) no-repeat; 65 | *background-color: #030; 66 | } 67 | .humane.humane-libnotify-success, 68 | .humane-libnotify.humane-libnotify-success { 69 | background-image: url('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAABQCAYAAADYxx/bAAAABmJLR0QA/wD/AP+gvaeTAAAAMUlEQVQYlWNgMGJ4ysTAwMDAxMAIJxhQWQwMDEwMTKgS2NRhkxg65jGhmke6M6hhHgBS2QHn2LzhygAAAABJRU5ErkJggg=='); 70 | background: -webkit-gradient(linear, left top, left bottom, color-stop(0, rgba(0,50,0,0.9)), color-stop(1, rgba(0,100,0,0.9))) no-repeat; 71 | background: -moz-linear-gradient(top, rgba(0,50,0,0.9) 0%, rgba(0,100,0,0.9) 100%) no-repeat; 72 | background: -webkit-linear-gradient(top, rgba(0,50,0,0.9) 0%, rgba(0,100,0,0.9) 100%) no-repeat; 73 | background: -ms-linear-gradient(top, rgba(0,50,0,0.9) 0%, rgba(0,100,0,0.9) 100%) no-repeat; 74 | background: -o-linear-gradient(top, rgba(0,50,0,0.9) 0%, rgba(0,100,0,0.9) 100%) no-repeat; 75 | background: linear-gradient(top, rgba(0,50,0,0.9) 0%, rgba(0,100,0,0.9) 100%) no-repeat; 76 | *background-color: #030; 77 | } 78 | .humane.humane-libnotify-error, 79 | .humane-libnotify.humane-libnotify-error { 80 | background-image: url('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAADICAYAAAAp8ov1AAAABmJLR0QA/wD/AP+gvaeTAAAAPklEQVQokWMwYmB4ysTAwMCATjASFsOmBBvBRJ7x+O0g0wCS7CDTH/RwH7X9MVDuwyaG032D2M2UeIYO7gMAqt8C19Bn7+YAAAAASUVORK5CYII='); 81 | background: -webkit-gradient(linear, left top, left bottom, color-stop(0, rgba(50,0,0,0.9)), color-stop(1, rgba(100,0,0,0.9))) no-repeat; 82 | background: -moz-linear-gradient(top, rgba(50,0,0,0.9) 0%, rgba(100,0,0,0.9) 100%) no-repeat; 83 | background: -webkit-linear-gradient(top, rgba(50,0,0,0.9) 0%, rgba(100,0,0,0.9) 100%) no-repeat; 84 | background: -ms-linear-gradient(top, rgba(50,0,0,0.9) 0%, rgba(100,0,0,0.9) 100%) no-repeat; 85 | background: -o-linear-gradient(top, rgba(50,0,0,0.9) 0%, rgba(100,0,0,0.9) 100%) no-repeat; 86 | background: linear-gradient(top, rgba(50,0,0,0.9) 0%, rgba(100,0,0,0.9) 100%) no-repeat; 87 | *background-color: #300; 88 | } 89 | .humane.humane-animate, 90 | .humane-libnotify.humane-libnotify-animate { 91 | opacity: 1; 92 | -moz-transform: translateY(0); 93 | -webkit-transform: translateY(0); 94 | -ms-transform: translateY(0); 95 | -o-transform: translateY(0); 96 | transform: translateY(0); 97 | } 98 | .humane.humane-animate:hover, 99 | .humane-libnotify.humane-libnotify-animate:hover { 100 | opacity: 0.2; 101 | } 102 | .humane.humane-animate, 103 | .humane-libnotify.humane-libnotify-js-animate { 104 | opacity: 1; 105 | -moz-transform: translateY(0); 106 | -webkit-transform: translateY(0); 107 | -ms-transform: translateY(0); 108 | -o-transform: translateY(0); 109 | transform: translateY(0); 110 | } 111 | .humane.humane-animate:hover, 112 | .humane-libnotify.humane-libnotify-js-animate:hover { 113 | opacity: 0.2; 114 | filter: progid:DXImageTransform.Microsoft.Alpha(Opacity=20); 115 | } 116 | -------------------------------------------------------------------------------- /themes/boldlight.css: -------------------------------------------------------------------------------- 1 | html, 2 | body { 3 | min-height: 100%; 4 | } 5 | .humane, 6 | .humane-boldlight { 7 | position: fixed; 8 | -moz-transition: all 0.3s ease-out; 9 | -webkit-transition: all 0.3s ease-out; 10 | -ms-transition: all 0.3s ease-out; 11 | -o-transition: all 0.3s ease-out; 12 | transition: all 0.3s ease-out; 13 | z-index: 100000; 14 | filter: progid:DXImageTransform.Microsoft.Alpha(Opacity=100); 15 | } 16 | .humane, 17 | .humane-boldlight { 18 | font-family: Ubuntu, Verdana, sans-serif; 19 | font-size: 25px; 20 | letter-spacing: -1px; 21 | top: 25%; 22 | left: 25%; 23 | opacity: 0; 24 | width: 50%; 25 | color: #000; 26 | padding: 10px; 27 | text-align: center; 28 | background-image: url('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAACWCAYAAAAfduJyAAAABmJLR0QA/wD/AP+gvaeTAAAAPElEQVQokWP4////Gab///8zQAgGBgYo8e/fP2QxSpSgydJNCYJLRSVoPqeOkgEIYop9TrGbSfcWpW4GAFeF/7lb/oWBAAAAAElFTkSuQmCC'); 29 | background: -webkit-gradient(linear, left top, left bottom, color-stop(0, rgba(255,255,255,0.8)), color-stop(1, rgba(150,150,150,0.8))) no-repeat; 30 | background: -moz-linear-gradient(top, rgba(255,255,255,0.8) 0%, rgba(150,150,150,0.8) 100%) no-repeat; 31 | background: -webkit-linear-gradient(top, rgba(255,255,255,0.8) 0%, rgba(150,150,150,0.8) 100%) no-repeat; 32 | background: -ms-linear-gradient(top, rgba(255,255,255,0.8) 0%, rgba(150,150,150,0.8) 100%) no-repeat; 33 | background: -o-linear-gradient(top, rgba(255,255,255,0.8) 0%, rgba(150,150,150,0.8) 100%) no-repeat; 34 | background: linear-gradient(top, rgba(255,255,255,0.8) 0%, rgba(150,150,150,0.8) 100%) no-repeat; 35 | *background-color: #fff; 36 | -webkit-border-radius: 15px; 37 | border-radius: 15px; 38 | text-shadow: 0 -1px 1px rgba(221,221,221,0.4); 39 | -webkit-box-shadow: 0 4px 4px -4px #eee; 40 | box-shadow: 0 4px 4px -4px #eee; 41 | -moz-transform: scale(1.1); 42 | -webkit-transform: scale(1.1); 43 | -ms-transform: scale(1.1); 44 | -o-transform: scale(1.1); 45 | transform: scale(1.1); 46 | } 47 | .humane p, 48 | .humane-boldlight p, 49 | .humane ul, 50 | .humane-boldlight ul { 51 | margin: 0; 52 | padding: 0; 53 | } 54 | .humane ul, 55 | .humane-boldlight ul { 56 | list-style: none; 57 | } 58 | .humane.humane-boldlight-info, 59 | .humane-boldlight.humane-boldlight-info { 60 | background-image: url('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAADICAYAAAAp8ov1AAAABmJLR0QA/wD/AP+gvaeTAAAAR0lEQVQokWNISfn/n4mBgeE/EwMDAwMqQYQYmdoGlxgjI4rY//+Dx2nUFRsQZ2ALTrQQp8QL1DWeqASC014y7aCx8QwMDAwA1aZBIulmpvwAAAAASUVORK5CYII='); 61 | background: -webkit-gradient(linear, left top, left bottom, color-stop(0, #6464ff), color-stop(1, rgba(100,100,255,0.8))) no-repeat; 62 | background: -moz-linear-gradient(top, #6464ff 0%, rgba(100,100,255,0.8) 100%) no-repeat; 63 | background: -webkit-linear-gradient(top, #6464ff 0%, rgba(100,100,255,0.8) 100%) no-repeat; 64 | background: -ms-linear-gradient(top, #6464ff 0%, rgba(100,100,255,0.8) 100%) no-repeat; 65 | background: -o-linear-gradient(top, #6464ff 0%, rgba(100,100,255,0.8) 100%) no-repeat; 66 | background: linear-gradient(top, #6464ff 0%, rgba(100,100,255,0.8) 100%) no-repeat; 67 | *background-color: #6464ff; 68 | } 69 | .humane.humane-boldlight-success, 70 | .humane-boldlight.humane-boldlight-success { 71 | background-image: url('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAADICAYAAAAp8ov1AAAABmJLR0QA/wD/AP+gvaeTAAAAGklEQVQokWNI+Z9yhomBgYFhlBglRonhSgAAFX0EItSd0k8AAAAASUVORK5CYII='); 72 | background: -webkit-gradient(linear, left top, left bottom, color-stop(0, #64ff64), color-stop(1, rgba(100,255,100,0.8))) no-repeat; 73 | background: -moz-linear-gradient(top, #64ff64 0%, rgba(100,255,100,0.8) 100%) no-repeat; 74 | background: -webkit-linear-gradient(top, #64ff64 0%, rgba(100,255,100,0.8) 100%) no-repeat; 75 | background: -ms-linear-gradient(top, #64ff64 0%, rgba(100,255,100,0.8) 100%) no-repeat; 76 | background: -o-linear-gradient(top, #64ff64 0%, rgba(100,255,100,0.8) 100%) no-repeat; 77 | background: linear-gradient(top, #64ff64 0%, rgba(100,255,100,0.8) 100%) no-repeat; 78 | *background-color: #64ff64; 79 | } 80 | .humane.humane-boldlight-error, 81 | .humane-boldlight.humane-boldlight-error { 82 | background-image: url('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAADICAYAAAAp8ov1AAAABmJLR0QA/wD/AP+gvaeTAAAAGklEQVQokWP4n5JyhomBgYFhlBglRonhSgAAFhgEIhjGqQkAAAAASUVORK5CYII='); 83 | background: -webkit-gradient(linear, left top, left bottom, color-stop(0, #ff6464), color-stop(1, rgba(255,100,100,0.8))) no-repeat; 84 | background: -moz-linear-gradient(top, #ff6464 0%, rgba(255,100,100,0.8) 100%) no-repeat; 85 | background: -webkit-linear-gradient(top, #ff6464 0%, rgba(255,100,100,0.8) 100%) no-repeat; 86 | background: -ms-linear-gradient(top, #ff6464 0%, rgba(255,100,100,0.8) 100%) no-repeat; 87 | background: -o-linear-gradient(top, #ff6464 0%, rgba(255,100,100,0.8) 100%) no-repeat; 88 | background: linear-gradient(top, #ff6464 0%, rgba(255,100,100,0.8) 100%) no-repeat; 89 | *background-color: #ff6464; 90 | } 91 | .humane.humane-animate, 92 | .humane-boldlight.humane-boldlight-animate { 93 | opacity: 1; 94 | -moz-transform: scale(1); 95 | -webkit-transform: scale(1); 96 | -ms-transform: scale(1); 97 | -o-transform: scale(1); 98 | transform: scale(1); 99 | } 100 | .humane.humane-animate:hover, 101 | .humane-boldlight.humane-boldlight-animate:hover { 102 | opacity: 0.4; 103 | -moz-transform: scale(1.8); 104 | -webkit-transform: scale(1.8); 105 | -ms-transform: scale(1.8); 106 | -o-transform: scale(1.8); 107 | transform: scale(1.8); 108 | } 109 | .humane.humane-animate, 110 | .humane-boldlight.humane-boldlight-js-animate { 111 | opacity: 1; 112 | -moz-transform: scale(1); 113 | -webkit-transform: scale(1); 114 | -ms-transform: scale(1); 115 | -o-transform: scale(1); 116 | transform: scale(1); 117 | } 118 | .humane.humane-animate:hover, 119 | .humane-boldlight.humane-boldlight-js-animate:hover { 120 | opacity: 0.4; 121 | filter: progid:DXImageTransform.Microsoft.Alpha(Opacity=40); 122 | } 123 | -------------------------------------------------------------------------------- /themes/jackedup.css: -------------------------------------------------------------------------------- 1 | html, 2 | body { 3 | min-height: 100%; 4 | } 5 | .humane, 6 | .humane-jackedup { 7 | position: fixed; 8 | -moz-transition: all 0.6s ease-in-out; 9 | -webkit-transition: all 0.6s ease-in-out; 10 | -ms-transition: all 0.6s ease-in-out; 11 | -o-transition: all 0.6s ease-in-out; 12 | transition: all 0.6s ease-in-out; 13 | z-index: 100000; 14 | filter: progid:DXImageTransform.Microsoft.Alpha(Opacity=100); 15 | } 16 | .humane, 17 | .humane-jackedup { 18 | font-family: Helvetica Neue, Helvetica, sans-serif; 19 | font-size: 18px; 20 | letter-spacing: -1px; 21 | top: 20px; 22 | left: 30%; 23 | opacity: 0; 24 | width: 40%; 25 | color: #333; 26 | padding: 10px; 27 | text-align: center; 28 | background-image: url('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAACWCAYAAAAfduJyAAAABmJLR0QA/wD/AP+gvaeTAAAAIklEQVQokWNgYGCQZGJgYGDARTDSQnboGDqsnDt0DKWNLAAkiQFdC+vZNQAAAABJRU5ErkJggg=='); 29 | background: -webkit-gradient(linear, left top, left bottom, color-stop(0, rgba(0,0,0,0.1)), color-stop(1, rgba(0,0,0,0.2))) no-repeat; 30 | background: -moz-linear-gradient(top, rgba(0,0,0,0.1) 0%, rgba(0,0,0,0.2) 100%) no-repeat; 31 | background: -webkit-linear-gradient(top, rgba(0,0,0,0.1) 0%, rgba(0,0,0,0.2) 100%) no-repeat; 32 | background: -ms-linear-gradient(top, rgba(0,0,0,0.1) 0%, rgba(0,0,0,0.2) 100%) no-repeat; 33 | background: -o-linear-gradient(top, rgba(0,0,0,0.1) 0%, rgba(0,0,0,0.2) 100%) no-repeat; 34 | background: linear-gradient(top, rgba(0,0,0,0.1) 0%, rgba(0,0,0,0.2) 100%) no-repeat; 35 | background-color: #fff; 36 | -webkit-border-radius: 3px; 37 | border-radius: 3px; 38 | text-shadow: 0 1px 1px rgba(255,255,255,0.8); 39 | -webkit-box-shadow: 0 1px 2px rgba(0,0,0,0.5); 40 | box-shadow: 0 1px 2px rgba(0,0,0,0.5); 41 | -moz-transform: translateY(-100px); 42 | -webkit-transform: translateY(-100px); 43 | -ms-transform: translateY(-100px); 44 | -o-transform: translateY(-100px); 45 | transform: translateY(-100px); 46 | } 47 | .humane p, 48 | .humane-jackedup p, 49 | .humane ul, 50 | .humane-jackedup ul { 51 | margin: 0; 52 | padding: 0; 53 | } 54 | .humane ul, 55 | .humane-jackedup ul { 56 | list-style: none; 57 | } 58 | .humane.humane-jackedup-info, 59 | .humane-jackedup.humane-jackedup-info { 60 | background-image: url('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAADICAYAAAAp8ov1AAAABmJLR0QA/wD/AP+gvaeTAAAAR0lEQVQokWNISfn/n4mBgeE/EwMDAwMqQYQYmdoGlxgjI4rY//+Dx2nUFRsQZ2ALTrQQp8QL1DWeqASC014y7aCx8QwMDAwA1aZBIulmpvwAAAAASUVORK5CYII='); 61 | background: -webkit-gradient(linear, left top, left bottom, color-stop(0, rgba(0,0,0,0.7)), color-stop(1, rgba(0,0,0,0.85))) no-repeat; 62 | background: -moz-linear-gradient(top, rgba(0,0,0,0.7) 0%, rgba(0,0,0,0.85) 100%) no-repeat; 63 | background: -webkit-linear-gradient(top, rgba(0,0,0,0.7) 0%, rgba(0,0,0,0.85) 100%) no-repeat; 64 | background: -ms-linear-gradient(top, rgba(0,0,0,0.7) 0%, rgba(0,0,0,0.85) 100%) no-repeat; 65 | background: -o-linear-gradient(top, rgba(0,0,0,0.7) 0%, rgba(0,0,0,0.85) 100%) no-repeat; 66 | background: linear-gradient(top, rgba(0,0,0,0.7) 0%, rgba(0,0,0,0.85) 100%) no-repeat; 67 | background-color: #fff; 68 | color: #fff; 69 | text-shadow: 0 -1px 1px rgba(0,0,0,0.35); 70 | } 71 | .humane.humane-jackedup-success, 72 | .humane-jackedup.humane-jackedup-success { 73 | background-image: url('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAADICAYAAAAp8ov1AAAABmJLR0QA/wD/AP+gvaeTAAAASElEQVQokc2SMQ4AIAgDD9/K/79QVzWaENTownAJbWnA5SqACkA/Aiy59hczrGVC30Q7y57EmNU5NL5zwln50IMsfZMel+UBKtFBQSLWM9wLAAAAAElFTkSuQmCC'); 74 | background: -webkit-gradient(linear, left top, left bottom, color-stop(0, #62c462), color-stop(1, #57a957)) no-repeat; 75 | background: -moz-linear-gradient(top, #62c462 0%, #57a957 100%) no-repeat; 76 | background: -webkit-linear-gradient(top, #62c462 0%, #57a957 100%) no-repeat; 77 | background: -ms-linear-gradient(top, #62c462 0%, #57a957 100%) no-repeat; 78 | background: -o-linear-gradient(top, #62c462 0%, #57a957 100%) no-repeat; 79 | background: linear-gradient(top, #62c462 0%, #57a957 100%) no-repeat; 80 | background-color: #64ff64; 81 | color: #fff; 82 | text-shadow: 0 -1px 1px rgba(0,0,0,0.35); 83 | } 84 | .humane.humane-jackedup-error, 85 | .humane-jackedup.humane-jackedup-error { 86 | background-image: url('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAADICAIAAACmkByiAAAABmJLR0QA/wD/AP+gvaeTAAAAf0lEQVQokY2TOQ7AIAwER/5mivy/yRc2RQDhA0jhghFYO5bhuS+TZMAoIUMEhhH4loGhfu71cenM3DutWMsaeGKjv3zO5N17KLPJ0+fQD8cpv5uVLPo4vnX0PpXj0nuaaeVzdmw+yXG1O96n2p3kozB757Ni1Z5UPsU9SP8AeAG1kHXE+7RlPAAAAABJRU5ErkJggg=='); 87 | background: -webkit-gradient(linear, left top, left bottom, color-stop(0, #ee5f5b), color-stop(1, #c43c35)) no-repeat; 88 | background: -moz-linear-gradient(top, #ee5f5b 0%, #c43c35 100%) no-repeat; 89 | background: -webkit-linear-gradient(top, #ee5f5b 0%, #c43c35 100%) no-repeat; 90 | background: -ms-linear-gradient(top, #ee5f5b 0%, #c43c35 100%) no-repeat; 91 | background: -o-linear-gradient(top, #ee5f5b 0%, #c43c35 100%) no-repeat; 92 | background: linear-gradient(top, #ee5f5b 0%, #c43c35 100%) no-repeat; 93 | background-color: #ee5f5b; 94 | color: #fff; 95 | text-shadow: 0 -1px 1px rgba(0,0,0,0.35); 96 | } 97 | .humane-animate, 98 | .humane-jackedup.humane-jackedup-animate { 99 | opacity: 1; 100 | -moz-transform: translateY(0); 101 | -webkit-transform: translateY(0); 102 | -ms-transform: translateY(0); 103 | -o-transform: translateY(0); 104 | transform: translateY(0); 105 | } 106 | .humane-animate:hover, 107 | .humane-jackedup.humane-jackedup-animate:hover { 108 | opacity: 0.7; 109 | } 110 | .humane-js-animate, 111 | .humane-jackedup.humane-jackedup-js-animate { 112 | opacity: 1; 113 | -moz-transform: translateY(0); 114 | -webkit-transform: translateY(0); 115 | -ms-transform: translateY(0); 116 | -o-transform: translateY(0); 117 | transform: translateY(0); 118 | } 119 | .humane-js-animate:hover, 120 | .humane-jackedup.humane-jackedup-js-animate:hover { 121 | opacity: 0.7; 122 | filter: progid:DXImageTransform.Microsoft.Alpha(Opacity=70); 123 | } 124 | -------------------------------------------------------------------------------- /index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | humane.js 5 | 6 | 7 | 8 | 9 | 10 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | Fork me on GitHub 76 | 77 |

humane.js

78 |

79 | A simple, modern, framework-independent, well-tested, unobtrusive, notification system. 80 |
Utilizes CSS transitions when available, falls back to JS animation when not. Includes mobile support. 81 |

82 |

Select a theme: 83 | 92 |

93 |

Click a code sample below to see it in action:

94 | 95 |
humane.log("Welcome Back")
96 |
humane.log("Record 392 has been updated")
97 |
humane.log(["List","of","Items"])
98 |
humane.log("Callback when finished", function(){ document.body.style.backgroundColor="#a66000" })
99 |
humane.log("Options can be passed", { timeout: 4000, clickToClose: true, addnCls: 'humane-error' })
100 | 101 |

Options

102 |

Options can be specified in a variety of ways. Either by the entire instance as shown below, or per notification, as shown above:

103 |
humane.timeout = 5000 // default: 2500
104 |
105 |

Sets the delay before a message fades out (set to 0 for no timeout).

106 |
107 |
humane.waitForMove = true // default: false
108 |
109 |

Wait for mouse, keyboard, or touch action to be taken before clearing message (after timeout)

110 |
111 |
humane.clickToClose = true // default: false
112 |
113 |

Click or touch the notification to close

114 |
115 |
humane.timeoutAfterMove = 2000 // default: 0
116 |
117 |

Delay before notification disappears (useful in conjunction with waitForMove)

118 |
119 |
humane.addnCls = 'humane-info' // default: ''
120 |
121 |

Specify an additional class to apply when notifying (nice when you only want to change just a little bit of the style)

122 |
123 |

Create instances with humane.create

124 |

Create a completely new instance of humane using humane.create().

125 |
126 | var notify = humane.create({ timeout: 4000, baseCls: 'humane-bigbox' })
127 | notify.log('Custom Notifier')
128 | 129 |

There are a options that can also be applied when creating an instance:

130 |
humane.baseCls = 'humane' // default: 'humane'
131 |
132 |

Specify an base class

133 |
134 | 135 |

Spawn notifiers with humane.spawn

136 |

Create a custom notifier using humane.spawn().

137 |
138 | humane.info = humane.spawn({ addnCls: 'humane-libnotify-info', timeout: 1000 })
139 | humane.info('Info Themed Notifier')
140 |
141 | humane.error = humane.spawn({ addnCls: 'humane-libnotify-error', timeout: 1000 })
142 | humane.error('Error Themed Notifier')
143 | 144 |

Force remove current notification

145 |
humane.remove(function(){ alert('removed') })
146 |
147 |

Force remove current notification, takes an optional callback fired when finished (note each instance has its own remove)

148 |
149 | 150 |

Go crazy

151 |

With all this power, you are bound to go CRAZY! Click the sample below to go crazy:

152 |
153 | var bigbox = humane.create({baseCls: 'humane-bigbox', timeout: 1000})
154 | bigbox.error = bigbox.spawn({addnCls: 'humane-bigbox-error'})
155 | bigbox.log('Oh!').error('No!')
156 | 
157 | var libnotify = humane.create({baseCls: 'humane-libnotify', addnCls: 'humane-libnotify-info'})
158 | libnotify.log('Notified')
159 | 
160 | var jacked = humane.create({baseCls: 'humane-jackedup', addnCls: 'humane-jackedup-success'})
161 | jacked.log("What's up here!")
162 | 163 |

Browser Support

164 |

Uses CSS Transitions where available otherwise falls back to JS animation, degrades gracefully.

165 | 174 | 175 |

Create A Custom Theme

176 |

Humane is easily themable using Stylus. There are currently a few themes, but I hope this grows. Send me a pull request and update the wiki with your favorite look and feel.

177 | 178 | 179 |

Download and Usage

180 |

Visit github page to download and get more details.

181 | 182 | 191 | 192 | 193 | -------------------------------------------------------------------------------- /humane.js: -------------------------------------------------------------------------------- 1 | /** 2 | * humane.js 3 | * Humanized Messages for Notifications 4 | * @author Marc Harter (@wavded) 5 | * @example 6 | * humane.log('hello world'); 7 | * @license MIT 8 | * See more usage examples at: http://wavded.github.com/humane-js/ 9 | */ 10 | 11 | ;!function (name, context, definition) { 12 | if (typeof module !== 'undefined') module.exports = definition(name, context) 13 | else if (typeof define === 'function' && typeof define.amd === 'object') define(definition) 14 | else context[name] = definition(name, context) 15 | }('humane', this, function (name, context) { 16 | var win = window 17 | var doc = document 18 | 19 | var ENV = { 20 | on: function (el, type, cb) { 21 | 'addEventListener' in win ? el.addEventListener(type,cb,false) : el.attachEvent('on'+type,cb) 22 | }, 23 | off: function (el, type, cb) { 24 | 'removeEventListener' in win ? el.removeEventListener(type,cb,false) : el.detachEvent('on'+type,cb) 25 | }, 26 | bind: function (fn, ctx) { 27 | return function () { fn.apply(ctx,arguments) } 28 | }, 29 | isArray: Array.isArray || function (obj) { return Object.prototype.toString.call(obj) === '[object Array]' }, 30 | config: function (preferred, fallback) { 31 | return preferred != null ? preferred : fallback 32 | }, 33 | transSupport: false, 34 | useFilter: /msie [678]/i.test(navigator.userAgent), // sniff, sniff 35 | _checkTransition: function () { 36 | var el = doc.createElement('div') 37 | var vendors = { webkit: 'webkit', Moz: '', O: 'o', ms: 'MS' } 38 | 39 | for (var vendor in vendors) 40 | if (vendor + 'Transition' in el.style) { 41 | this.vendorPrefix = vendors[vendor] 42 | this.transSupport = true 43 | } 44 | } 45 | } 46 | ENV._checkTransition() 47 | 48 | var Humane = function (o) { 49 | o || (o = {}) 50 | this.queue = [] 51 | this.baseCls = o.baseCls || 'humane' 52 | this.addnCls = o.addnCls || '' 53 | this.timeout = 'timeout' in o ? o.timeout : 2500 54 | this.waitForMove = o.waitForMove || false 55 | this.clickToClose = o.clickToClose || false 56 | this.timeoutAfterMove = o.timeoutAfterMove || false 57 | this.container = o.container 58 | 59 | try { this._setupEl() } // attempt to setup elements 60 | catch (e) { 61 | ENV.on(win,'load',ENV.bind(this._setupEl, this)) // dom wasn't ready, wait till ready 62 | } 63 | } 64 | 65 | Humane.prototype = { 66 | constructor: Humane, 67 | _setupEl: function () { 68 | var el = doc.createElement('div') 69 | el.style.display = 'none' 70 | if (!this.container){ 71 | if(doc.body) this.container = doc.body; 72 | else throw 'document.body is null' 73 | } 74 | this.container.appendChild(el) 75 | this.el = el 76 | this.removeEvent = ENV.bind(function(){ 77 | var timeoutAfterMove = ENV.config(this.currentMsg.timeoutAfterMove,this.timeoutAfterMove) 78 | if (!timeoutAfterMove){ 79 | this.remove() 80 | } else { 81 | setTimeout(ENV.bind(this.remove,this),timeoutAfterMove) 82 | } 83 | },this) 84 | 85 | this.transEvent = ENV.bind(this._afterAnimation,this) 86 | this._run() 87 | }, 88 | _afterTimeout: function () { 89 | if (!ENV.config(this.currentMsg.waitForMove,this.waitForMove)) this.remove() 90 | 91 | else if (!this.removeEventsSet) { 92 | ENV.on(doc.body,'mousemove',this.removeEvent) 93 | ENV.on(doc.body,'click',this.removeEvent) 94 | ENV.on(doc.body,'keypress',this.removeEvent) 95 | ENV.on(doc.body,'touchstart',this.removeEvent) 96 | this.removeEventsSet = true 97 | } 98 | }, 99 | _run: function () { 100 | if (this._animating || !this.queue.length || !this.el) return 101 | 102 | this._animating = true 103 | if (this.currentTimer) { 104 | clearTimeout(this.currentTimer) 105 | this.currentTimer = null 106 | } 107 | 108 | var msg = this.queue.shift() 109 | var clickToClose = ENV.config(msg.clickToClose,this.clickToClose) 110 | 111 | if (clickToClose) { 112 | ENV.on(this.el,'click',this.removeEvent) 113 | ENV.on(this.el,'touchstart',this.removeEvent) 114 | } 115 | 116 | var timeout = ENV.config(msg.timeout,this.timeout) 117 | 118 | if (timeout > 0) 119 | this.currentTimer = setTimeout(ENV.bind(this._afterTimeout,this), timeout) 120 | 121 | if (ENV.isArray(msg.html)) msg.html = '' 122 | 123 | this.el.innerHTML = msg.html 124 | this.currentMsg = msg 125 | this.el.className = this.baseCls 126 | if (ENV.transSupport) { 127 | this.el.style.display = 'block' 128 | setTimeout(ENV.bind(this._showMsg,this),50) 129 | } else { 130 | this._showMsg() 131 | } 132 | 133 | }, 134 | _setOpacity: function (opacity) { 135 | if (ENV.useFilter){ 136 | try{ 137 | this.el.filters.item('DXImageTransform.Microsoft.Alpha').Opacity = opacity*100 138 | } catch(err){} 139 | } else { 140 | this.el.style.opacity = String(opacity) 141 | } 142 | }, 143 | _showMsg: function () { 144 | var addnCls = ENV.config(this.currentMsg.addnCls,this.addnCls) 145 | if (ENV.transSupport) { 146 | this.el.className = this.baseCls+' '+addnCls+' '+this.baseCls+'-animate' 147 | } 148 | else { 149 | var opacity = 0 150 | this.el.className = this.baseCls+' '+addnCls+' '+this.baseCls+'-js-animate' 151 | this._setOpacity(0) // reset value so hover states work 152 | this.el.style.display = 'block' 153 | 154 | var self = this 155 | var interval = setInterval(function(){ 156 | if (opacity < 1) { 157 | opacity += 0.1 158 | if (opacity > 1) opacity = 1 159 | self._setOpacity(opacity) 160 | } 161 | else clearInterval(interval) 162 | }, 30) 163 | } 164 | }, 165 | _hideMsg: function () { 166 | var addnCls = ENV.config(this.currentMsg.addnCls,this.addnCls) 167 | if (ENV.transSupport) { 168 | this.el.className = this.baseCls+' '+addnCls 169 | ENV.on(this.el,ENV.vendorPrefix ? ENV.vendorPrefix+'TransitionEnd' : 'transitionend',this.transEvent) 170 | } 171 | else { 172 | var opacity = 1 173 | var self = this 174 | var interval = setInterval(function(){ 175 | if(opacity > 0) { 176 | opacity -= 0.1 177 | if (opacity < 0) opacity = 0 178 | self._setOpacity(opacity); 179 | } 180 | else { 181 | self.el.className = self.baseCls+' '+addnCls 182 | clearInterval(interval) 183 | self._afterAnimation() 184 | } 185 | }, 30) 186 | } 187 | }, 188 | _afterAnimation: function () { 189 | if (ENV.transSupport) ENV.off(this.el,ENV.vendorPrefix ? ENV.vendorPrefix+'TransitionEnd' : 'transitionend',this.transEvent) 190 | 191 | if (this.currentMsg.cb) this.currentMsg.cb() 192 | this.el.style.display = 'none' 193 | 194 | this._animating = false 195 | this._run() 196 | }, 197 | remove: function (e) { 198 | var cb = typeof e == 'function' ? e : null 199 | 200 | ENV.off(doc.body,'mousemove',this.removeEvent) 201 | ENV.off(doc.body,'click',this.removeEvent) 202 | ENV.off(doc.body,'keypress',this.removeEvent) 203 | ENV.off(doc.body,'touchstart',this.removeEvent) 204 | ENV.off(this.el,'click',this.removeEvent) 205 | ENV.off(this.el,'touchstart',this.removeEvent) 206 | this.removeEventsSet = false 207 | 208 | if (cb && this.currentMsg) this.currentMsg.cb = cb 209 | if (this._animating) this._hideMsg() 210 | else if (cb) cb() 211 | }, 212 | log: function (html, o, cb, defaults) { 213 | var msg = {} 214 | if (defaults) 215 | for (var opt in defaults) 216 | msg[opt] = defaults[opt] 217 | 218 | if (typeof o == 'function') cb = o 219 | else if (o) 220 | for (var opt in o) msg[opt] = o[opt] 221 | 222 | msg.html = html 223 | if (cb) msg.cb = cb 224 | this.queue.push(msg) 225 | this._run() 226 | return this 227 | }, 228 | spawn: function (defaults) { 229 | var self = this 230 | return function (html, o, cb) { 231 | self.log.call(self,html,o,cb,defaults) 232 | return self 233 | } 234 | }, 235 | create: function (o) { return new Humane(o) } 236 | } 237 | return new Humane() 238 | }); 239 | --------------------------------------------------------------------------------