Skip to content

Commit 115007b

Browse files
committed
add CommonJS and package.json
1 parent e20e20d commit 115007b

3 files changed

Lines changed: 85 additions & 7 deletions

File tree

.gitignore

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
# Logs
2+
logs
3+
*.log
4+
npm-debug.log*
5+
6+
# Runtime data
7+
pids
8+
*.pid
9+
*.seed
10+
11+
# Directory for instrumented libs generated by jscoverage/JSCover
12+
lib-cov
13+
14+
# Coverage directory used by tools like istanbul
15+
coverage
16+
17+
# Grunt intermediate storage (http://gruntjs.com/creating-plugins#storing-task-files)
18+
.grunt
19+
20+
# node-waf configuration
21+
.lock-wscript
22+
23+
# Compiled binary addons (http://nodejs.org/api/addons.html)
24+
build/Release
25+
26+
# Dependency directory
27+
node_modules
28+
29+
# Optional npm cache directory
30+
.npm
31+
32+
# Optional REPL history
33+
.node_repl_history

js/dialogFx.js

Lines changed: 24 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,28 @@
88
* Copyright 2014, Codrops
99
* http://www.codrops.com
1010
*/
11-
;( function( window ) {
12-
11+
12+
(function (root, factory) {
13+
var Modernizr = {
14+
prefixed: function () {
15+
'animation',
16+
},
17+
cssanimations: true,
18+
};
19+
20+
if (typeof module === 'object' && module.exports) {
21+
var classie = require('classie');
22+
try {
23+
require('browsernizr/test/css/animations');
24+
Modernizr = require('browsernizr');
25+
} catch(e) {}
26+
module.exports = factory(classie, Modernizr);
27+
} else {
28+
// Browser globals (root is window)
29+
root.DialogFx = factory(root.classie, root.Modernizr || Modernizr);
30+
}
31+
}(this, function (classie, Modernizr) {
32+
1333
'use strict';
1434

1535
var support = { animations : Modernizr.cssanimations },
@@ -151,8 +171,5 @@
151171

152172
this.isOpen = !this.isOpen;
153173
};
154-
155-
// add to global namespace
156-
window.DialogFx = DialogFx;
157-
158-
})( window );
174+
return DialogFx;
175+
}));

package.json

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
{
2+
"name": "dialog-fx",
3+
"version": "0.0.1",
4+
"description": "A small collection of dialog effects using CSS animations for your inspiration.",
5+
"main": "js/dialogFx.js",
6+
"scripts": {
7+
"test": "echo \"Error: no test specified\" && exit 1"
8+
},
9+
"repository": {
10+
"type": "git",
11+
"url": "git+https://github.com/codrops/DialogEffects.git"
12+
},
13+
"keywords": [
14+
"dialog",
15+
"effect",
16+
"animation",
17+
"css"
18+
],
19+
"author": "codrops",
20+
"license": "MIT",
21+
"bugs": {
22+
"url": "https://github.com/codrops/DialogEffects/issues"
23+
},
24+
"homepage": "https://github.com/codrops/DialogEffects#readme",
25+
"dependencies": {
26+
"classie": "^1.0.0"
27+
}
28+
}

0 commit comments

Comments
 (0)