Skip to content

Commit 5eb5330

Browse files
committed
Update all dependencies
1 parent a5bd1e4 commit 5eb5330

File tree

15 files changed

+135
-165
lines changed

15 files changed

+135
-165
lines changed

.babelrc

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
{
2+
"presets": ["react", "es2015"],
3+
"env": {
4+
"development": {
5+
"presets": ["react-hmre"]
6+
}
7+
}
8+
}

devServer.js

Lines changed: 0 additions & 29 deletions
This file was deleted.

dist/bundle.js

Lines changed: 8 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/bundle.js.map

Lines changed: 1 addition & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

index.html

100755100644
Lines changed: 19 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,21 @@
1-
<!doctype html>
1+
<!DOCTYPE html>
22
<html>
33
<head>
4-
<title>img2css</title>
5-
<link rel="stylesheet" href="style/main.css">
6-
<link href='https://fonts.googleapis.com/css?family=Roboto:300,300italic,100' rel='stylesheet' type='text/css'>
4+
<meta charset="utf-8">
5+
<meta name="viewport" content="width=device-width, initial-scale=1.0">
6+
<meta http-equiv="X-UA-Compatible" content="IE=edge">
7+
<link rel="canonical" href="http://javier.xyz/">
8+
<link rel="shortcut icon" href="/favicon.ico" type="image/x-icon">
9+
10+
<title>img2css | Convert any image to pure CSS</title>
11+
<meta name="description" content="This is a tool that can convert any image into a pure css image.">
712

813
<meta property="og:title" content="img2css">
9-
<meta property="og:url" content="http://javier.xyz/img2css/">
10-
<meta property="og:description" content="This is a tool that can convert any image into a pure css image.">
11-
<meta property="og:image" content="https://github.com/javierbyte/img2css/raw/gh-pages/screenshot.png">
14+
<meta property="og:url" content="http://javier.xyz/img2css">
15+
<meta property="og:image" content="http://javier.xyz/img2css/docs-assets/thumbnail.jpg">
16+
17+
<link rel="stylesheet" href="styles/styles.css">
18+
<link href='https://fonts.googleapis.com/css?family=Roboto:300,300italic,100' rel='stylesheet' type='text/css'>
1219
</head>
1320
<body>
1421
<div class="padding-2x">
@@ -17,22 +24,20 @@ <h1>img2css.</h1>
1724
<div>Try it! (It's cpu heavy, please try with a small image first).</div>
1825
<br />
1926
<iframe src="https://ghbtns.com/github-btn.html?user=javierbyte&amp;repo=img2css&amp;type=star&amp;count=true" width="170" height="20" style="border: none; overflow: hidden;"></iframe>
20-
2127
</div>
22-
23-
<div id='root'></div>
24-
28+
<div id="root"></div>
2529
<div class="padding-2x">
30+
Want a programatic way to do this? Look at <a target="_blank" href="https://github.com/javierbyte/base64-image-utils">base64-image-utils.</a>
31+
<br>
2632
Created by <a href='http://github.com/javierbyte/'>javierbyte</a>.
2733
<br /><br />
2834
<a href="https://twitter.com/javierbyte" class="twitter-follow-button" data-show-count="true">Follow @javierbyte</a>
2935
<script>!function(d,s,id){var js,fjs=d.getElementsByTagName(s)[0],p=/^http:/.test(d.location)?'http':'https';if(!d.getElementById(id)){js=d.createElement(s);js.id=id;js.src=p+'://platform.twitter.com/widgets.js';fjs.parentNode.insertBefore(js,fjs);}}(document, 'script', 'twitter-wjs');</script>
3036
</div>
3137

32-
<script src="static/bundle.js"></script>
33-
34-
<a target='_blank' style="position: fixed; top: 0; right: 0" href="https://github.com/javierbyte/img2css"><img style="position: absolute; top: 0; right: 0; border: 0;" src="https://camo.githubusercontent.com/365986a132ccd6a44c23a9169022c0b5c890c387/68747470733a2f2f73332e616d617a6f6e6177732e636f6d2f6769746875622f726962626f6e732f666f726b6d655f72696768745f7265645f6161303030302e706e67" alt="Fork me on GitHub" data-canonical-src="https://s3.amazonaws.com/github/ribbons/forkme_left_red_aa0000.png"></a>
38+
<a href="https://github.com/javierbyte/img2css/" class="github-corner"><svg width="80" height="80" viewBox="0 0 250 250" style="fill:#FD6C6C; color:#fff; position: absolute; top: 0; border: 0; right: 0;"><path d="M0,0 L115,115 L130,115 L142,142 L250,250 L250,0 Z"></path><path d="M128.3,109.0 C113.8,99.7 119.0,89.6 119.0,89.6 C122.0,82.7 120.5,78.6 120.5,78.6 C119.2,72.0 123.4,76.3 123.4,76.3 C127.3,80.9 125.5,87.3 125.5,87.3 C122.9,97.6 130.6,101.9 134.4,103.2" fill="currentColor" style="transform-origin: 130px 106px;" class="octo-arm"></path><path d="M115.0,115.0 C114.9,115.1 118.7,116.5 119.8,115.4 L133.7,101.6 C136.9,99.2 139.9,98.4 142.2,98.6 C133.8,88.0 127.5,74.4 143.8,58.0 C148.5,53.4 154.0,51.2 159.7,51.0 C160.3,49.4 163.2,43.6 171.4,40.1 C171.4,40.1 176.1,42.5 178.8,56.2 C183.1,58.6 187.2,61.8 190.9,65.4 C194.5,69.0 197.7,73.2 200.1,77.6 C213.8,80.2 216.3,84.9 216.3,84.9 C212.7,93.1 206.9,96.0 205.4,96.6 C205.1,102.4 203.0,107.8 198.3,112.5 C181.9,128.9 168.3,122.5 157.7,114.1 C157.9,116.9 156.7,120.9 152.7,124.9 L141.0,136.5 C139.8,137.7 141.6,141.9 141.8,141.8 Z" fill="currentColor" class="octo-body"></path></svg></a><style>.github-corner:hover .octo-arm{animation:octocat-wave 560ms ease-in-out}@keyframes octocat-wave{0%,100%{transform:rotate(0)}20%,60%{transform:rotate(-25deg)}40%,80%{transform:rotate(10deg)}}@media (max-width:500px){.github-corner:hover .octo-arm{animation:none}.github-corner .octo-arm{animation:octocat-wave 560ms ease-in-out}}</style>
3539

40+
<script src="dist/bundle.js"></script>
3641
<script>
3742
(function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
3843
(i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),

package.json

Lines changed: 20 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -1,46 +1,41 @@
11
{
22
"name": "img2css",
3-
"version": "0.0.1",
3+
"version": "0.1.0",
44
"description": "Convert any image to pure css.",
55
"scripts": {
66
"clean": "rimraf dist",
7-
"build:webpack": "NODE_ENV=production webpack --config webpack.config.prod.js",
7+
"build:webpack": "cross-env NODE_ENV=production webpack --config webpack/webpack.config.prod.js",
88
"build": "npm run clean && npm run build:webpack",
9-
"start": "node devServer.js"
9+
"start": "node webpack/devServer.js"
1010
},
1111
"repository": {
1212
"type": "git",
1313
"url": "https://github.com/javierbyte/img2css.git"
1414
},
15-
"keywords": [
16-
"react",
17-
"reactjs",
18-
"css",
19-
"picture"
20-
],
15+
"keywords": [],
2116
"author": "Javier Bórquez <hi@javier.xyz> (http://github.com/javierbyte)",
2217
"license": "CC0-1.0",
23-
"bugs": {
24-
"url": "https://github.com/javierbyte/img2css/issues"
25-
},
2618
"homepage": "https://github.com/javierbyte/img2css",
2719
"devDependencies": {
28-
"babel-core": "^5.4.7",
29-
"babel-loader": "^5.1.2",
30-
"babel-plugin-react-transform": "^1.1.1",
20+
"babel-core": "^6.6.5",
21+
"babel-loader": "^6.2.4",
22+
"babel-preset-es2015": "^6.3.13",
23+
"babel-preset-react": "^6.3.13",
24+
"babel-preset-react-hmre": "^1.1.1",
25+
"cross-env": "^1.0.7",
26+
"eventsource-polyfill": "^0.9.6",
3127
"express": "^4.13.3",
32-
"react-transform-catch-errors": "^1.0.0",
33-
"react-transform-hmr": "^1.0.0",
34-
"redbox-react": "^1.0.1",
3528
"rimraf": "^2.4.3",
36-
"webpack": "^1.9.6",
37-
"webpack-dev-middleware": "^1.2.0",
38-
"webpack-hot-middleware": "^2.0.0"
29+
"standard": "^6.0.8",
30+
"webpack": "^1.12.9",
31+
"webpack-dev-middleware": "^1.4.0",
32+
"webpack-hot-middleware": "^2.9.1"
3933
},
4034
"dependencies": {
41-
"lodash": "^3.10.1",
42-
"react": "^0.13.0",
43-
"react-dropzone": "^2.2.1",
44-
"tinycolor2": "^1.1.2"
35+
"lodash": "^4.7.0",
36+
"react": "^0.14.7",
37+
"react-dom": "^0.14.7",
38+
"react-dropzone": "^3.3.2",
39+
"tinycolor2": "^1.3.0"
4540
}
4641
}

src/App.js

Lines changed: 21 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,29 +1,29 @@
1-
import React from 'react'
2-
import tinycolor from 'tinycolor2'
1+
const React = require('react')
2+
const tinycolor = require('tinycolor2')
33

4-
var _ = require('lodash')
5-
var Dropzone = require('react-dropzone')
4+
const _ = require('lodash')
5+
const Dropzone = require('react-dropzone')
66

7-
var base64ImageToRGBArray = require('./lib/base64ImageToRGBArray')
7+
const base64ImageToRGBArray = require('./lib/base64ImageToRGBArray')
88

99
function compressColor (rgb) {
10-
var hex = tinycolor(rgb).toHexString()
10+
const hex = tinycolor(rgb).toHexString()
1111

1212
switch (hex) { // based on CSS3 supported color names http://www.w3.org/TR/css3-color/
13-
case '#c0c0c0': return 'silver';
14-
case '#808080': return 'gray';
15-
case '#800000': return 'maroon';
16-
case '#ff0000': return 'red';
17-
case '#800080': return 'purple';
18-
case '#008000': return 'green';
19-
case '#808000': return 'olive';
20-
case '#000080': return 'navy';
21-
case '#008080': return 'teal';
13+
case '#c0c0c0': return 'silver'
14+
case '#808080': return 'gray'
15+
case '#800000': return 'maroon'
16+
case '#ff0000': return 'red'
17+
case '#800080': return 'purple'
18+
case '#008000': return 'green'
19+
case '#808000': return 'olive'
20+
case '#000080': return 'navy'
21+
case '#008080': return 'teal'
2222
}
23-
return hex[1] === hex[2] && hex[3] === hex[4] && hex[5] === hex[6] ? "#" + hex[1] + hex[3] + hex[5] : hex;
23+
return hex[1] === hex[2] && hex[3] === hex[4] && hex[5] === hex[6] ? '#' + hex[1] + hex[3] + hex[5] : hex
2424
}
2525

26-
export const App = React.createClass({
26+
var App = React.createClass({
2727

2828
getInitialState () {
2929
return {
@@ -48,9 +48,9 @@ export const App = React.createClass({
4848
const base64 = data.currentTarget.result
4949

5050
if (base64.length > 100000) {
51-
let confirmation = confirm('Your image is really big, do you really want to try to convert it?')
51+
let confirmation = window.confirm('Your image is really big, do you really want to try to convert it?')
5252

53-
if(!confirmation) {
53+
if (!confirmation) {
5454
this.setState({
5555
loadingImage: false
5656
})
@@ -115,3 +115,5 @@ export const App = React.createClass({
115115
)
116116
}
117117
})
118+
119+
module.exports = App

src/index.js

100755100644
Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
1-
import React from 'react'
2-
import { App } from './App'
1+
const React = require('react')
2+
const ReactDOM = require('react-dom')
3+
const App = require('./App')
34

4-
React.render(<App />, document.getElementById('root'))
5+
ReactDOM.render(<App />, document.getElementById('root'))

static/bundle.js

Lines changed: 0 additions & 21 deletions
This file was deleted.

static/bundle.js.map

Lines changed: 0 additions & 1 deletion
This file was deleted.

0 commit comments

Comments
 (0)