Skip to content

Commit 67b970e

Browse files
OriROri Riner
authored and
Ori Riner
committed
prepare for publish
1 parent 94d8a87 commit 67b970e

8 files changed

+104
-2140
lines changed

.gitignore

+1
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88

99
# production
1010
/build
11+
/lib
1112

1213
# misc
1314
.idea

.npmignore

+21
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
# dependencies
2+
/node_modules
3+
4+
# testing
5+
/coverage
6+
7+
# source
8+
/src
9+
/public
10+
11+
# misc
12+
.idea
13+
.DS_Store
14+
.env.local
15+
.env.development.local
16+
.env.test.local
17+
.env.production.local
18+
19+
npm-debug.log*
20+
yarn-debug.log*
21+
yarn-error.log*

LICENSE

+21
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
MIT License
2+
3+
Copyright (c) 2017
4+
5+
Permission is hereby granted, free of charge, to any person obtaining a copy
6+
of this software and associated documentation files (the "Software"), to deal
7+
in the Software without restriction, including without limitation the rights
8+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9+
copies of the Software, and to permit persons to whom the Software is
10+
furnished to do so, subject to the following conditions:
11+
12+
The above copyright notice and this permission notice shall be included in all
13+
copies or substantial portions of the Software.
14+
15+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21+
SOFTWARE.

README.md

+40-2,118
Large diffs are not rendered by default.

dist/index.js

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
import EmojifyImage from '../lib/EmojifyImage';
2+
import EmojifyImageCustom from '../lib/EmojifyImageCustom';
3+
4+
export default EmojifyImage;
5+
export { EmojifyImageCustom };

package.json

+14-7
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,29 @@
11
{
22
"name": "react-emojify-image",
3+
"description": "pixelating an image, with emojis",
34
"version": "0.0.1",
4-
"homepage": "http://orir.github.io/react-emojify",
5-
"dependencies": {
6-
"react": "^15.6.1",
7-
"prop-types": "^15.5.10",
8-
"react-dom": "^15.6.1",
9-
"react-scripts": "1.0.10"
10-
},
5+
"main": "dist/index.js",
6+
"homepage": "http://orir.github.io/react-emojify-image",
7+
"license": "MIT",
8+
"keywords": ["react", "emoji", "emojify", "image", "photo"],
119
"scripts": {
10+
"compile": "NODE_ENV=production babel -d lib/ src/ --presets react-app",
11+
"prepublish": "npm run compile",
1212
"start": "react-scripts start",
1313
"build": "react-scripts build",
1414
"test": "react-scripts test --env=jsdom",
1515
"eject": "react-scripts eject",
1616
"predeploy": "npm run build",
1717
"deploy": "gh-pages -d build"
1818
},
19+
"dependencies": {
20+
"react": "^15.6.1",
21+
"prop-types": "^15.5.10",
22+
"react-dom": "^15.6.1",
23+
"react-scripts": "1.0.10"
24+
},
1925
"devDependencies": {
26+
"babel-cli": "^6.24.1",
2027
"gh-pages": "^1.0.0"
2128
}
2229
}

src/mapColors.js

-15
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,3 @@
1-
const RGBtoHSL = (component) => {
2-
const normalR = component.red / 255;
3-
const normalG = component.green / 255;
4-
const normalB = component.blue / 255;
5-
const max = Math.max(normalR, normalG, normalB);
6-
const min = Math.min(normalR, normalG, normalB);
7-
const diff = max - min;
8-
9-
const L = (max + min) / 2;
10-
const S = diff / (1 - Math.abs(2 * L - 1));
11-
const H = (diff === 0 ? 0 : max === normalR ? ((normalG - normalB) / diff) % 6 : max === normalG ? ((normalB - normalR)/diff + 2) : ((normalR - normalG) / diff) + 4) * 60;
12-
13-
return {H, S, L};
14-
};
15-
161
const getImageData = (totalEmojis) => {
172
const entireData = [];
183
// Canvas has a max side length of 32,767 pixels (width and height).

src/promiseWorker.js

+2
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,9 @@ export default (actions) => {
2727
const actions = {
2828
build: (self, data) => {
2929
Object.assign(actions, Object.keys(data).reduce((newData, key) => {
30+
/*eslint-disable no-eval*/
3031
newData[key] = eval(`(${data[key]})`);
32+
/*eslint-enable no-eval*/
3133
return newData;
3234
}, {}));
3335
(actions.init || (() => {}))(self, context);

0 commit comments

Comments
 (0)