Skip to content

Commit

Permalink
First commit for chrono
Browse files Browse the repository at this point in the history
  • Loading branch information
esellier committed Mar 20, 2024
1 parent 5228fc9 commit 973066e
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 10 deletions.
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "bb-timer",
"name": "bb-chrono",
"version": "0.1.0",
"description": "A kinda cool timer thing",
"description": "A kinda cool chrono thing",
"license": "MIT",
"svelte": "index.js",
"module": "dist/plugin.min.js",
Expand Down
6 changes: 3 additions & 3 deletions schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@
"type": "component",
"metadata": {},
"schema": {
"name": "bb-timer",
"friendlyName": "Timer",
"description": "A timer with event trigger",
"name": "bb-chrono",
"friendlyName": "Chrono",
"description": "A Chrono with event trigger",
"icon": "Text",
"settings": [
{
Expand Down
11 changes: 6 additions & 5 deletions src/lib/Timer.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -47,25 +47,26 @@
function start(): void {
timerIsRunning = true;
counter = longTimeToSecs(hrs, mins, secs);
counter = 0; //longTimeToSecs(hrs, mins, secs);
// we don't want to create more than one interval
if (intervalID) {
return;
}
intervalID = window.setInterval(() => {
counter = counter - 1;
counter = counter + 1;
displayTime = newDisplayTime(counter);
if (counter < 1) {
/*if (counter < 1) {
stop();
timeout();
}
}, 1000);
}*/
}, 10);
}
function stop(): void {
timerIsRunning = false;
window.clearInterval(intervalID);
intervalID = 0;
timeout();
}
function reset(): void {
Expand Down

0 comments on commit 973066e

Please sign in to comment.