Skip to content

Commit

Permalink
Merge pull request #1 from drecodeam/v2
Browse files Browse the repository at this point in the history
V2
  • Loading branch information
drecodeam authored Aug 19, 2018
2 parents 79232a3 + 6f447a9 commit f665fb8
Show file tree
Hide file tree
Showing 10 changed files with 9,376 additions and 406 deletions.
37 changes: 20 additions & 17 deletions main.ts
Original file line number Diff line number Diff line change
@@ -1,25 +1,34 @@
import {app, BrowserWindow, screen} from 'electron';
import {app, BrowserWindow, screen, globalShortcut } from 'electron';
import * as path from 'path';
import * as url from 'url';
import {autoUpdater} from 'electron-updater';
// const { autoUpdater } = require('electron-updater');
// const { menubar } = require('menubar');


let win, serve;
const args = process.argv.slice(1);
serve = args.some(val => val === '--serve');

function createWindow() {

const electronScreen = screen;
const size = electronScreen.getPrimaryDisplay().workAreaSize;

// Create the browser window.
win = new BrowserWindow({
x: 0,
y: 0,
width: 400,
height: 800,
titleBarStyle: 'hidden'
x: 400,
y: 100 ,
width: 350,
height: 500,
frame: false,
resizable: false,
movable: true,
title: 'Stors'
});

globalShortcut.register('Command+U', () => {
win.setVisibleOnAllWorkspaces(true);
win.show();
win.setVisibleOnAllWorkspaces(false);
});

if (serve) {
Expand All @@ -35,8 +44,6 @@ function createWindow() {
}));
}

// win.webContents.openDevTools();

// Emitted when the window is closed.
win.on('closed', () => {
// Dereference the window object, usually you would store window
Expand All @@ -51,7 +58,9 @@ try {
// This method will be called when Electron has finished
// initialization and is ready to create browser windows.
// Some APIs can only be used after this event occurs.
app.on('ready', createWindow);
app.on('ready', () => {
createWindow();
});

// Quit when all windows are closed.
app.on('window-all-closed', () => {
Expand All @@ -63,15 +72,9 @@ try {
});

app.on('activate', () => {
// On OS X it's common to re-create a window in the app when the
// dock icon is clicked and there are no other windows open.
if (win === null) {
createWindow();
}
const log = require("electron-log");
log.transports.file.level = "debug";
autoUpdater.logger = log;
autoUpdater.checkForUpdatesAndNotify();
});

} catch (e) {
Expand Down
13 changes: 2 additions & 11 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "Stors",
"version": "0.1.2",
"version": "0.3.1",
"description": "A simple task manager for a day",
"homepage": "https://insert.black",
"repository": "https://github.com/drecodeam/stors",
Expand All @@ -27,21 +27,12 @@
"electron:local": "npm run build:prod && electron .",
"electron:linux": "npm run build:prod && npx electron-builder build --linux",
"electron:windows": "npm run build:prod && npx electron-builder build --windows",
"electron:mac": "npm run build:prod && npx electron-builder build --mac --p",
"electron:mac": "npm run build:prod && npx electron-builder build --mac",
"release:mac": "npm run build:prod && npx electron-builder build --mac --p always",
"test": "ng test",
"e2e": "ng e2e"
},
"dependencies": {
"analytics-node": "^3.3.0",
"auto-launch": "^5.0.5",
"buffer": "^5.1.0",
"electron-log": "^2.2.16",
"electron-updater": "^3.0.3",
"events": "^3.0.0",
"raven-js": "^3.26.4",
"stream": "0.0.2",
"timers": "^0.1.1"
},
"devDependencies": {
"@angular-devkit/build-angular": "0.6.3",
Expand Down
38 changes: 19 additions & 19 deletions src/app/components/home/home.component.html
Original file line number Diff line number Diff line change
@@ -1,19 +1,25 @@
<div class="draggable-region"></div>
<div class="container">
<div class="title">Today</div>
<div class="total-time" *ngIf="!!status.showTime">
<span class="hrs">{{totalHrs}}h </span> <span class="mins"> {{totalMins}}m |</span>
<div class="eta">{{eta}}</div>
<div class="onboarding-container" *ngIf="!!status.showOnboarding">
<div class="title">ADDING A TASK</div>
<div class="description">Just add what you want to do and how much time it would take</div>
<div class="eg">example: 30 mins Standup <br /> Meeting with Sarah 1hr 15m <br /> 45m Demo of our new product</div>
</div>
<div class="task-list" *ngIf="!status.showEmptyState">

<input type="text" class="add-task" (keyup.enter)="addTask(todo.value)" placeholder="+ Add a new task" #todo>
<div class="input-error" *ngIf="!!inputError">
<div class="error-main">Include task duration in the input</div>
<div class="error-sub">example: 1h 6m, 1 hour 15 minutes, 25 mins. Just add time in this format anywhere in the description and stors would pick it up</div>
</div>

<div class="task-list" *ngIf="!status.showOnboarding">
<div class="task-list-item"
*ngFor="let item of data.list"
[id]="item.id"
(click)="activateTask(item)"
[class.ticked] = "!!item.isTicked"
[class.active] = "(item.id === currentTaskID)"
>
<div class="item-time">{{item.time - item.elapsed}}m</div>
<div class="item-time">{{item.displayTime}}</div>
<div class="item-separator"> | </div>
<div class="item-title">{{item.name}}</div>
<div class="done-icon"
Expand All @@ -28,17 +34,11 @@
<div class="item-progress-bar" [style.width.%]="item.progress"></div>
</div>
</div>
<div class="empty-state" *ngIf="!!status.showEmptyState">
showing an empty state
</div>
<input type="text" class="add-task" [ngModel]="addTaskInput" (keyup.enter)="addTask(todo.value)" placeholder="+ Add a new task" #todo>
</div>
<div class="help drift-open-chat">👋 Feedback</div>
<div class="onboarding" [class.show]="!!showOnboarding">
<div class="onboarding-title">Let's get started</div>
<div class="onboarding-desc">Add your task in the same format. Click on a task to start tracking time.</div>
<div class="onboarding-sample-todo">
5m | Getting started with Stors
<div class="total-time" *ngIf="!status.showOnboarding">
<div class="message">ETA: </div>
<span class="hrs">{{totalHrs}}h </span> <span class="mins"> {{totalMins}}m |</span>
<div class="eta">{{eta}}</div>
</div>
<div class="onboarding-cta" (click)="closeOnboarding()">Add your first task</div>
</div>
<!--<div class="help drift-open-chat">👋 Feedback</div>-->

Loading

0 comments on commit f665fb8

Please sign in to comment.