Skip to content

Commit 6802076

Browse files
committed
added support for saving of color profile and updated readme
1 parent 2583ba0 commit 6802076

File tree

2 files changed

+8
-4
lines changed

2 files changed

+8
-4
lines changed

app/index.js

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ import { style, stopStyle } from "./style.js"
1717
import { format } from "path";
1818

1919
//grab screen elements
20+
const background = document.getElementById("background");
2021
const time = document.getElementById("time");
2122
const progressArc = document.getElementById("progressArc");
2223
const countdownText = document.getElementById("countdown");
@@ -57,6 +58,11 @@ clock.ontick = (evt) => {
5758
}
5859

5960
setupWithUserSettings();
61+
try{
62+
let s = fs.readFileSync("styleSettings.txt", "cbor");
63+
background.value = s.value;
64+
}
65+
catch (err){}
6066
style();
6167
progress();
6268

@@ -81,6 +87,7 @@ messaging.peerSocket.onmessage = (evt)=>{
8187
me.onunload = () => {
8288
//save data on exit
8389
saveStateToFile();
90+
writeToFile({value: background.value} ,"styleSettings.txt");
8491
}
8592

8693
function saveStateToFile(){
@@ -213,8 +220,7 @@ function setupWithUserSettings(){
213220
settings = fs.readFileSync("flowSettings.txt", "cbor");
214221
}
215222
catch(err){
216-
settings = {flowTime: 0, shortBreakTime: 0, longBreakTime: 0}
217-
//writeToFile({flowTime: 0, shortBreakTime: 0, longBreakTime: 0}, "flowSettings.txt");
223+
settings = {flowTime: 0, shortBreakTime: 0, longBreakTime: 0};
218224
}
219225
//setup consts based on user settings
220226
totalFlowInSeconds = settings.flowTime == 0 ? totalFlowInSeconds : parseInt(settings.flowTime)*60;

readme.md

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,7 @@ The user will complete a set of 4 sprints, with the first 3 followed by a short
77
![](https://github.com/aes421/WorkFlow/blob/master/photos/Sample3.PNG?raw=true)
88
# Upcoming
99
This app is still currently in development. Future enhancements include:
10-
* Ability to exit app without losing progress
1110
* Make your own color combos
12-
* Save user settings for color
1311
* Animated Progress Bar
1412

1513
### Installing

0 commit comments

Comments
 (0)