Skip to content
This repository was archived by the owner on Nov 14, 2022. It is now read-only.

Commit 9e2ef3d

Browse files
committed
Merge branch 'release/1.1'
2 parents 7f3fce0 + 9bb5f69 commit 9e2ef3d

File tree

19 files changed

+139
-29
lines changed

19 files changed

+139
-29
lines changed

build-resources/icon.icns

453 KB
Binary file not shown.

build-resources/icon.ico

428 KB
Binary file not shown.
234 KB
Loading
19.3 KB
Loading

build-resources/icons/icon_16x16.png

3.42 KB
Loading
44.3 KB
Loading

build-resources/icons/icon_32x32.png

4.86 KB
Loading
104 KB
Loading
8.95 KB
Loading

electron/main.js

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,24 @@
1-
const {app, BrowserWindow} = require('electron')
1+
const {app, BrowserWindow, Menu, ipcMain, dialog} = require('electron')
22
const path = require('path')
33
const url = require('url')
4-
const {ipcMain} = require('electron')
5-
const {dialog} = require('electron')
64

75

86
// Keep a global reference of the window object, if you don't, the window will
97
// be closed automatically when the JavaScript object is garbage collected.
108
let win
119
let selectedImagePath
1210

11+
Menu.setApplicationMenu(null)
1312
function createWindow () {
1413
// Create the browser window.
15-
win = new BrowserWindow({width: 800, height: 500})
14+
win = new BrowserWindow({
15+
width: 800,
16+
height: 400,
17+
resizable: false,
18+
maximizable: false,
19+
fullscreenable: false
20+
})
21+
win.setMenu(null)
1622

1723

1824
const startUrl = process.env.ELECTRON_START_URL || url.format({

package.json

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@
22
"name": "eicongen",
33
"version": "0.1.0",
44
"private": true,
5+
"author": "Damodar Lohani",
6+
"author-url": "https://dlohani.com.np",
57
"dependencies": {
68
"react": "^16.2.0",
79
"react-dom": "^16.2.0",
@@ -13,7 +15,8 @@
1315
"build": "react-scripts build",
1416
"test": "react-scripts test --env=jsdom",
1517
"eject": "react-scripts eject",
16-
"electron": "electron ."
18+
"electron": "electron .",
19+
"ebuild":"yarn build && node_modules/.bin/build"
1720
},
1821
"devDependencies": {
1922
"electron": "^1.8.1",
@@ -24,9 +27,16 @@
2427
"homepage": "./",
2528
"main": "electron/main.js",
2629
"build": {
27-
"appId": "com.lohanitech.ionic-electron-test",
30+
"productName": "App Icon Generator",
31+
"directories": {
32+
"buildResources": "build-resources"
33+
},
34+
"appId": "com.olohanitech.eicongen",
2835
"electronVersion": "1.8.1",
29-
"asar": false,
36+
"asar": true,
37+
"mac": {
38+
"category": "public.app-category.developer-tools"
39+
},
3040
"files": [
3141
"build/**/*",
3242
"electron/*"

public/index.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
work correctly both with client-side routing and a non-root public URL.
2020
Learn how to configure a non-root public URL by running `npm run build`.
2121
-->
22-
<title>React App</title>
22+
<title>EIcon Generator</title>
2323
</head>
2424
<body>
2525
<noscript>

src/app/App.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ import GeneratorOptions from '../components/generator/GeneratorOptions';
88
const electron = window.require('electron')
99
const nativeImage = electron.nativeImage
1010
const fs = electron.remote.require('fs');
11+
const shell = electron.shell;
1112

1213

1314
class App extends Component {
@@ -51,6 +52,8 @@ class App extends Component {
5152
this.mkdir(watchkitDir)
5253
this.generateWatchKitIcons(watchkitDir);
5354
}
55+
56+
shell.openItem(base)
5457
}
5558

5659
generateWatchKitIcons = base => {

src/components/checkbox/Checkbox.js

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
import React from 'react'
2+
import './style.css'
3+
4+
const Checkbox = ({label, checked, onChange, value, id}) => (
5+
<span>
6+
<input type="checkbox" id={id} onChange={(onChange)} checked={checked} value={value} />
7+
<label htmlFor={id}>
8+
<span></span> {label}
9+
</label>
10+
</span>
11+
)
12+
13+
export default Checkbox;

src/components/checkbox/style.css

Lines changed: 84 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,84 @@
1+
label {
2+
display: inline-block;
3+
cursor: pointer;
4+
position: relative;
5+
line-height: 30px;
6+
}
7+
label span {
8+
display: inline-block;
9+
position: relative;
10+
background-color: transparent;
11+
width: 18px;
12+
height: 18px;
13+
transform-origin: center;
14+
border: 2px solid #333;
15+
border-radius: 50%;
16+
vertical-align: -6px;
17+
margin-right: 10px;
18+
transition: background-color 150ms 200ms, transform 350ms cubic-bezier(0.78, -1.22, 0.17, 1.89);
19+
}
20+
label span:before {
21+
content: "";
22+
width: 0px;
23+
height: 2px;
24+
border-radius: 2px;
25+
background: #000;
26+
position: absolute;
27+
transform: rotate(45deg);
28+
top: 8px;
29+
left: 5px;
30+
transition: width 50ms ease 50ms;
31+
transform-origin: 0% 0%;
32+
}
33+
label span:after {
34+
content: "";
35+
width: 0;
36+
height: 2px;
37+
border-radius: 2px;
38+
background: #000;
39+
position: absolute;
40+
transform: rotate(305deg);
41+
top: 13px;
42+
left: 7px;
43+
transition: width 50ms ease;
44+
transform-origin: 0% 0%;
45+
}
46+
label:hover span:before {
47+
width: 5px;
48+
transition: width 100ms ease;
49+
}
50+
label:hover span:after {
51+
width: 10px;
52+
transition: width 150ms ease 100ms;
53+
}
54+
input[type="checkbox"] {
55+
display: none;
56+
}
57+
input[type="checkbox"]:checked + label span {
58+
background-color: #1790b5;
59+
transform: scale(1.25);
60+
}
61+
input[type="checkbox"]:checked + label span:after {
62+
width: 10px;
63+
background: #fff;
64+
transition: width 150ms ease 100ms;
65+
}
66+
input[type="checkbox"]:checked + label span:before {
67+
width: 5px;
68+
background: #fff;
69+
transition: width 150ms ease 100ms;
70+
}
71+
input[type="checkbox"]:checked + label:hover span {
72+
background-color: #1790b5;
73+
transform: scale(1.25);
74+
}
75+
input[type="checkbox"]:checked + label:hover span:after {
76+
width: 10px;
77+
background: #fff;
78+
transition: width 150ms ease 100ms;
79+
}
80+
input[type="checkbox"]:checked + label:hover span:before {
81+
width: 5px;
82+
background: #fff;
83+
transition: width 150ms ease 100ms;
84+
}

src/components/generator/GeneratorOptions.js

Lines changed: 5 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
import React from 'react';
22
import './styles.css'
3+
import Checkbox from '../checkbox/Checkbox';
34

45
const electron = window.require('electron')
56
const path = window.require('path');
@@ -44,24 +45,16 @@ class GeneratorOptions extends React.Component{
4445

4546
<ul>
4647
<li>
47-
<label>
48-
<input type="checkbox" onChange={this.handleCheckChange} value="android" checked={this.state.android} /> Android
49-
</label>
48+
<Checkbox id="android" label="Android" checked={this.state.android} onChange={this.handleCheckChange} value="android" />
5049
</li>
5150
<li>
52-
<label>
53-
<input type="checkbox" onChange={this.handleCheckChange} value="ios" checked={this.state.ios} /> iOS
54-
</label>
51+
<Checkbox id="ios" label="iOS" checked={this.state.ios} onChange={this.handleCheckChange} value="ios" />
5552
</li>
5653
<li>
57-
<label>
58-
<input type="checkbox" onChange={this.handleCheckChange} value="web" checked={this.state.web} /> Web
59-
</label>
54+
<Checkbox id="web" label="Web" checked={this.state.web} onChange={this.handleCheckChange} value="web" />
6055
</li>
6156
<li>
62-
<label>
63-
<input type="checkbox" onChange={this.handleCheckChange} value="watchkit" checked={this.state.watchkit} /> Watchkit
64-
</label>
57+
<Checkbox id="watchkit" label="Watchkit" checked={this.state.watchkit} onChange={this.handleCheckChange} value="watchkit" />
6558
</li>
6659
</ul>
6760
<button onClick={this.handleButtonClick}>Generate Icons</button>

src/components/generator/styles.css

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,9 @@
11
.generator-options{
2-
padding: 20px;
2+
padding: 10px;
33
}
44

55
.generator-options ul{
66
list-style: none;
77
padding: 0;
8+
margin: 0;
89
}

src/components/image-load/styles.css

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
text-align: center;
33
position: relative;
44
border: 1px solid #fff;
5-
padding-top: 20px;
5+
padding-top: 10px;
66
}
77

88
.image-load img{

yarn.lock

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -22,9 +22,9 @@
2222
"7zip-bin-mac" "^1.0.1"
2323
"7zip-bin-win" "^2.1.1"
2424

25-
"@types/node@^7.0.18":
26-
version "7.0.50"
27-
resolved "https://registry.yarnpkg.com/@types/node/-/node-7.0.50.tgz#432428edab1073d478924d80a58a250b390c7b1b"
25+
"@types/node@^8.0.24":
26+
version "8.5.2"
27+
resolved "https://registry.yarnpkg.com/@types/node/-/node-8.5.2.tgz#83b8103fa9a2c2e83d78f701a9aa7c9539739aa5"
2828

2929
abab@^1.0.3:
3030
version "1.0.4"
@@ -2265,11 +2265,11 @@ electron-to-chromium@^1.2.7, electron-to-chromium@^1.3.28:
22652265
version "1.3.29"
22662266
resolved "https://registry.yarnpkg.com/electron-to-chromium/-/electron-to-chromium-1.3.29.tgz#7a58236b95468c3e7660091348522d65d7736b36"
22672267

2268-
electron@^1.7.10:
2269-
version "1.7.10"
2270-
resolved "https://registry.yarnpkg.com/electron/-/electron-1.7.10.tgz#3a3e83d965fd7fafe473be8ddf8f472561b6253d"
2268+
electron@1.8.1:
2269+
version "1.8.1"
2270+
resolved "https://registry.yarnpkg.com/electron/-/electron-1.8.1.tgz#19b6f39f2013e204a91a60bc3086dc7a4a07ed88"
22712271
dependencies:
2272-
"@types/node" "^7.0.18"
2272+
"@types/node" "^8.0.24"
22732273
electron-download "^3.0.1"
22742274
extract-zip "^1.0.3"
22752275

0 commit comments

Comments
 (0)