Skip to content

Commit

Permalink
Color change
Browse files Browse the repository at this point in the history
  • Loading branch information
Florian Fechner authored and Florian Fechner committed Jun 17, 2017
1 parent ece02ad commit 68aedfa
Show file tree
Hide file tree
Showing 6 changed files with 169 additions and 129 deletions.
197 changes: 113 additions & 84 deletions main.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,103 +10,132 @@ const Menu = electron.Menu;
const path = require('path');
const url = require('url');

const template =
[
let browserWindow = null;

function createWindow()
{
browserWindow = new BrowserWindow(
{
label: 'Edit',
submenu: [
{role: 'undo'},
{role: 'redo'},
{type: 'separator'},
{role: 'cut'},
{role: 'copy'},
{role: 'paste'},
{role: 'pasteandmatchstyle'},
{role: 'delete'},
{role: 'selectall'}
]
},
width: 800,
height: 515,
backgroundColor: '#fff'
});

browserWindow.loadURL(path.join('file://', __dirname, 'index.html'));

browserWindow.on('closed', () =>
{
label: 'View',
submenu: [
{role: 'reload'},
{role: 'forcereload'},
{role: 'toggledevtools'},
{type: 'separator'},
{role: 'resetzoom'},
{role: 'zoomin'},
{role: 'zoomout'},
browserWindow = null;
});

const template =
[
{
label: 'Edit',
submenu: [
{role: 'undo'},
{role: 'redo'},
{type: 'separator'},
{role: 'cut'},
{role: 'copy'},
{role: 'paste'},
{role: 'pasteandmatchstyle'},
{role: 'delete'},
{role: 'selectall'}
]
},
{
label: 'View',
submenu: [
{role: 'reload'},
{role: 'forcereload'},
{role: 'toggledevtools'},
{type: 'separator'},
{role: 'resetzoom'},
{role: 'zoomin'},
{role: 'zoomout'},
{type: 'separator'},
{role: 'togglefullscreen'}
]
},
{
role: 'window',
submenu: [
{role: 'minimize'},
{role: 'close'}
]
},
{
role: 'help',
submenu: [
{
label: 'Learn More',
click () { require('electron').shell.openExternal('https://github.com/FlorianFe/Elements') }
}
]
}
]

if (process.platform === 'darwin') {
template.unshift({
label: app.getName(),
submenu: [
{role: 'about'},
{type: 'separator'},
{role: 'services', submenu: []},
{type: 'separator'},
{role: 'hide'},
{role: 'hideothers'},
{role: 'unhide'},
{type: 'separator'},
{role: 'quit'}
]
})

// Edit menu
template[1].submenu.push(
{type: 'separator'},
{role: 'togglefullscreen'}
]
},
{
role: 'window',
submenu: [
{role: 'minimize'},
{role: 'close'}
]
},
{
role: 'help',
submenu: [
{
label: 'Learn More',
click () { require('electron').shell.openExternal('https://electron.atom.io') }
label: 'Speech',
submenu: [
{role: 'startspeaking'},
{role: 'stopspeaking'}
]
}
]
}
]
)

if (process.platform === 'darwin') {
template.unshift({
label: app.getName(),
submenu: [
{role: 'about'},
{type: 'separator'},
{role: 'services', submenu: []},
{type: 'separator'},
{role: 'hide'},
{role: 'hideothers'},
{role: 'unhide'},
// Window menu
template[3].submenu = [
{role: 'close'},
{role: 'minimize'},
{role: 'zoom'},
{type: 'separator'},
{role: 'quit'}
{role: 'front'}
]
})
}

// Edit menu
template[1].submenu.push(
{type: 'separator'},
{
label: 'Speech',
submenu: [
{role: 'startspeaking'},
{role: 'stopspeaking'}
]
}
)

// Window menu
template[3].submenu = [
{role: 'close'},
{role: 'minimize'},
{role: 'zoom'},
{type: 'separator'},
{role: 'front'}
]
let menu = Menu.buildFromTemplate(template);
Menu.setApplicationMenu(menu);
}

Menu.setApplicationMenu(Menu.buildFromTemplate(template));

app.on('ready', function()
app.on('ready', () =>
{
createWindow();
});

app.on('activate', function ()
{
let browserWindow = new BrowserWindow(
if (browserWindow === null)
{
width: 800,
height: 515,
backgroundColor: '#fff'
});
createWindow()
}
});

browserWindow.loadURL(path.join('file://', __dirname, 'index.html'));
//browserWindow.toggleDevTools();
app.on('window-all-closed', () =>
{
if(process.platform !== 'darwin')
{
app.quit()
}
});
22 changes: 11 additions & 11 deletions periodic-table/chemical-element-page/chemical-element-page.html
Original file line number Diff line number Diff line change
Expand Up @@ -58,17 +58,17 @@
width: 25%;
}

.not-metal { color: var(--non-metal-color); }
.alkali-metal { color: var(--alkali-metal-color); }
.alkaline-earth-metal { color: var(--alkaline-earth-metal-color); }
.transition-metal { color: var(--transition-metal-color); }
.metalloid { color: var(--metalloid-color); }
.post-transition-metal { color: var(--post-transition-metal-color); }
.other-nonmetal { color: var(--other-nonmetal-color); }
.lanthanide { color: var(--lanthanide-color); }
.actinide { color: var(--actinide-color); }
.halogen { color: var(--halogen-color); }
.noble-gas { color: var(--noble-gas-color); }
.not-metal { color: var(--non-metal-primary-color); }
.alkali-metal { color: var(--alkali-metal-primary-color); }
.alkaline-earth-metal { color: var(--alkaline-earth-metal-primary-color); }
.transition-metal { color: var(--transition-metal-primary-color); }
.metalloid { color: var(--metalloid-primary-color); }
.post-transition-metal { color: var(--post-transition-metal-primary-color); }
.other-nonmetal { color: var(--other-nonmetal-primary-color); }
.lanthanide { color: var(--lanthanide-primary-color); }
.actinide { color: var(--actinide-primary-color); }
.halogen { color: var(--halogen-primary-color); }
.noble-gas { color: var(--noble-gas-primary-color); }

</style>
</custom-style>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,17 +11,17 @@
<custom-style>
<style>

.not-metal { fill: var(--non-metal-color); }
.alkali-metal { fill: var(--alkali-metal-color); }
.alkaline-earth-metal { fill: var(--alkaline-earth-metal-color); }
.transition-metal { fill: var(--transition-metal-color); }
.metalloid { fill: var(--metalloid-color); }
.post-transition-metal { fill: var(--post-transition-metal-color); }
.other-nonmetal { fill: var(--other-nonmetal-color); }
.lanthanide { fill: var(--lanthanide-color); }
.actinide { fill: var(--actinide-color); }
.halogen { fill: var(--halogen-color); }
.noble-gas { fill: var(--noble-gas-color); }
.not-metal { fill: var(--non-metal-primary-color); }
.alkali-metal { fill: var(--alkali-metal-primary-color); }
.alkaline-earth-metal { fill: var(--alkaline-earth-metal-primary-color); }
.transition-metal { fill: var(--transition-metal-primary-color); }
.metalloid { fill: var(--metalloid-primary-color); }
.post-transition-metal { fill: var(--post-transition-metal-primary-color); }
.other-nonmetal { fill: var(--other-nonmetal-primary-color); }
.lanthanide { fill: var(--lanthanide-primary-color); }
.actinide { fill: var(--actinide-primary-color); }
.halogen { fill: var(--halogen-primary-color); }
.noble-gas { fill: var(--noble-gas-primary-color); }

.ring
{
Expand Down
22 changes: 11 additions & 11 deletions periodic-table/chemical-element/chemical-element.html
Original file line number Diff line number Diff line change
Expand Up @@ -33,17 +33,17 @@
@apply --shadow-elevation-4dp;
}

.not-metal { background-color: var(--non-metal-color); }
.alkali-metal { background-color: var(--alkali-metal-color); }
.alkaline-earth-metal { background-color: var(--alkaline-earth-metal-color); }
.transition-metal { background-color: var(--transition-metal-color); }
.metalloid { background-color: var(--metalloid-color); }
.post-transition-metal { background-color: var(--post-transition-metal-color); }
.other-nonmetal { background-color: var(--other-nonmetal-color); }
.lanthanide { background-color: var(--lanthanide-color); }
.actinide { background-color: var(--actinide-color); }
.halogen { background-color: var(--halogen-color); }
.noble-gas { background-color: var(--noble-gas-color); }
.not-metal { background-color: var(--non-metal-background-color); }
.alkali-metal { background-color: var(--alkali-metal-background-color); }
.alkaline-earth-metal { background-color: var(--alkaline-earth-metal-background-color); }
.transition-metal { background-color: var(--transition-metal-background-color); }
.metalloid { background-color: var(--metalloid-background-color); }
.post-transition-metal { background-color: var(--post-transition-metal-background-color); }
.other-nonmetal { background-color: var(--other-nonmetal-background-color); }
.lanthanide { background-color: var(--lanthanide-background-color); }
.actinide { background-color: var(--actinide-background-color); }
.halogen { background-color: var(--halogen-background-color); }
.noble-gas { background-color: var(--noble-gas-background-color); }

.selected
{
Expand Down
4 changes: 2 additions & 2 deletions periodic-table/periodic-table.css
Original file line number Diff line number Diff line change
Expand Up @@ -49,10 +49,10 @@ paper-card

.lan­thanide
{
background-color: var(--lanthanide-color);
background-color: var(--lanthanide-background-color);
}

.actinide
{
background-color: var(--actinide-color);
background-color: var(--actinide-background-color);
}
31 changes: 21 additions & 10 deletions periodic-table/periodic-table.html
Original file line number Diff line number Diff line change
Expand Up @@ -21,16 +21,27 @@

:host
{
--alkali-metal-color: #ffab91;
--alkaline-earth-metal-color: #fff59d;
--transition-metal-color: #ffe082;
--metalloid-color: #b0bec5;
--post-transition-metal-color: #ffcc80;
--other-nonmetal-color: #c5e1a5;
--lanthanide-color: #b39ddb;
--actinide-color: #f48fb1;
--halogen-color: #e6ee9c;
--noble-gas-color: #80cbc4;
--alkali-metal-primary-color: #ff8a65;
--alkaline-earth-metal-primary-color: #ffb74d;
--transition-metal-primary-color: #ffd54f;
--post-transition-metal-primary-color: #dce775;
--metalloid-primary-color: #aed581;
--other-nonmetal-primary-color: #4db6ac;
--halogen-primary-color: #4dd0e1;
--noble-gas-primary-color: #4fc3f7;
--lanthanide-primary-color: #9575cd;
--actinide-primary-color: #f06292;

--alkali-metal-background-color: #ffab91;
--alkaline-earth-metal-background-color: #ffcc80;
--transition-metal-background-color: #ffe082;
--post-transition-metal-background-color: #c5e1a5;
--metalloid-background-color: #a5d6a7;
--other-nonmetal-background-color: #80cbc4;
--halogen-background-color: #80deea;
--noble-gas-background-color: #81d4fa;
--lanthanide-background-color: #ce93d8;
--actinide-background-color: #f48fb1;
}

</style>
Expand Down

0 comments on commit 68aedfa

Please sign in to comment.