Skip to content

Commit

Permalink
change to moon icon
Browse files Browse the repository at this point in the history
  • Loading branch information
amiechen committed Apr 2, 2018
1 parent 6183ce9 commit 41193de
Show file tree
Hide file tree
Showing 12 changed files with 53 additions and 65 deletions.
Binary file not shown.
Binary file not shown.
8 changes: 7 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ Pretzel is Mac desktop app that shows and search keyboard shortcuts based on you

## Download for Mac

[Download the latest release](https://github.com/amiechen/pretzel/releases/tag/v0.5.0)
[Download the latest release](https://github.com/amiechen/pretzel/releases)

## Run it locally (if you are curious):

Expand All @@ -25,6 +25,12 @@ npm install
npm start
```

Compile Scss

```
sass --watch sass/main.ss:main.css
```

To compile:

```
Expand Down
17 changes: 0 additions & 17 deletions assets/sliders.svg

This file was deleted.

15 changes: 11 additions & 4 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -49,10 +49,17 @@ <h1 class="app-name"></h1>
<ul>
<li class="flexbox">
<label>Night Mode</label>
<div class="toggle-container">
<div class="toggle">
<div class="ball"></div>
</div>
<div class="mode">
<?xml version="1.0" encoding="UTF-8"?>
<svg width="24px" height="24px" viewBox="0 0 16 16" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
<!-- Generator: Sketch 49.2 (51160) - http://www.bohemiancoding.com/sketch -->
<title>Artboard</title>
<desc>Created with Sketch.</desc>
<defs></defs>
<g id="Artboard" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
<path d="M13,8.43888889 C12.7568615,11.0698936 10.5086225,13.057575 7.86765359,12.9764268 C5.22668467,12.8952786 3.10472138,10.7733153 3.02357317,8.13234641 C2.94242496,5.49137749 4.93010644,3.24313846 7.56111111,3 C6.41686774,4.54802873 6.57736477,6.70025177 7.9385565,8.0614435 C9.29974823,9.42263523 11.4519713,9.58313226 13,8.43888889 Z" id="moon" stroke="#000000"></path>
</g>
</svg>
</div>
</li>
<li class="flexbox flexbox--column">
Expand Down
4 changes: 2 additions & 2 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ const assetsDirectory = path.join(__dirname, "assets");
const shortcutsDirectory = path.join(__dirname, "shortcuts");
const mb = menubar({
icon: path.join(__dirname, "/assets/icon.png"),
width: 800,
width: 300,
height: 400,
resizable: false,
showDockIcon: false,
Expand Down Expand Up @@ -47,7 +47,7 @@ function toggleWindow() {
}

mb.on("ready", function ready() {
mb.window.webContents.toggleDevTools();
// mb.window.webContents.toggleDevTools();
// settings.deleteAll();
autoUpdater.checkForUpdatesAndNotify();
globalShortcut.register(
Expand Down
10 changes: 9 additions & 1 deletion main.css

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion main.css.map

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

21 changes: 9 additions & 12 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,25 +1,26 @@
{
"name": "pretzel",
"productName": "Pretzel",
"version": "0.5.2",
"version": "0.6.0",
"description": "a contextual shortcuts finder",
"author": "Amie Chen",
"main": "index.js",
"scripts": {
"start": "electron .",
"package": "build",
"publish": "build -p always",
"build:mac": "electron-packager . Pretzel --platform=darwin --arch=x64 --asar --icon='./build/icon.icns' --osx-sign",
"build:win": "electron-packager . Pretzel --platform=win32 --arch=x64 --asar --icon=icon.ico",
"build:linux": "electron-packager . Pretzel --platform=linux --arch=x64 --asar --icon=icon.ico"
"build:mac":
"electron-packager . Pretzel --platform=darwin --arch=x64 --asar --icon='./build/icon.icns' --osx-sign",
"build:win":
"electron-packager . Pretzel --platform=win32 --arch=x64 --asar --icon=icon.ico",
"build:linux":
"electron-packager . Pretzel --platform=linux --arch=x64 --asar --icon=icon.ico"
},
"repository": {
"type": "git",
"url": "git+https://github.com/amiechen/pretzel.git"
},
"keywords": [
"shortcuts"
],
"keywords": ["shortcuts"],
"license": "MIT",
"bugs": {
"url": "https://github.com/amiechen/pretzel/issues"
Expand All @@ -40,11 +41,7 @@
},
"build": {
"appId": "com.Hyperyolo.Pretzel",
"files": [
"**/*",
"!screenshot/${/*}",
"!docs${/*}"
],
"files": ["**/*", "!screenshot/${/*}", "!docs${/*}"],
"copyright": "Copyright © Amie Chen"
}
}
12 changes: 6 additions & 6 deletions renderer.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ const search = get("#search");
const allAppsBtn = get("#show-all-apps");
const quitAppBtn = get("#quit-app");
const settingAppBtn = get("#setting-app");
const toggleBtn = get(".toggle-container");
const modeBtn = get(".mode");
const cancelSettingBtn = get(".cancel");
const body = get("body");
const saveAndRelaunchBtn = get(".save-and-relaunch");
Expand Down Expand Up @@ -79,7 +79,7 @@ function setPretzelTheme() {
const theme = setting.getTheme() || "dark";
body.classList = "";
body.classList.add(theme);
theme === "dark" ? get(".toggle").classList.add("active") : null;
theme === "dark" ? get(".mode").classList.add("active") : null;
}

ipcRenderer.on("noShortcuts", (event, name) => {
Expand Down Expand Up @@ -165,13 +165,13 @@ saveAndRelaunchBtn.addEventListener("click", () => {
remote.app.exit(0);
});

toggleBtn.addEventListener("click", event => {
if (event.target.classList.contains("active")) {
modeBtn.addEventListener("click", event => {
if (event.currentTarget.classList.contains("active")) {
body.classList.remove("dark");
body.classList.add("light");
event.target.classList.remove("active");
event.currentTarget.classList.remove("active");
} else {
event.target.classList.add("active");
event.currentTarget.classList.add("active");
body.classList.remove("light");
body.classList.add("dark");
}
Expand Down
27 changes: 7 additions & 20 deletions sass/toggle.scss
Original file line number Diff line number Diff line change
@@ -1,25 +1,12 @@
.toggle-container {
transition: all 0.2s;
.mode {
margin-top: -0.3rem;
cursor: pointer;
width: 32px;
.ball {
height: 1rem;
width: 1rem;
margin-left: 0;
border-radius: 2.5rem;
box-shadow: 0 3px 6px 0 rgba(0, 35, 11, 0.2);
background-color: #fff;
transition: all 0.3s ease-out;
#moon {
stroke: #68a1f3;
}
.toggle {
border-radius: 3rem;
background-color: $light-gray;
transition: all 0.2s;
&.active {
background-color: $medium-blue-1;
.ball {
margin-left: 1rem;
}
&.active {
#moon {
fill: #68a1f3;
}
}
}
2 changes: 1 addition & 1 deletion sass/usersettings.scss
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
padding: 2rem;
}
li {
margin-bottom: 1.5rem;
margin-bottom: 0.5rem;
}
label {
flex-grow: 1;
Expand Down

0 comments on commit 41193de

Please sign in to comment.