Code Monkey home page Code Monkey logo

stopwatch's Issues

Make bulk actions on multiple stopwatches at the same time

Would be great to be able to set and clone stopwatches then start all of them at once. Would work great for sprints where you won’t have time to start a stopwatch, clone it a few times, personalise them and hit stop on each before the race finishes.

This is a good idea. I think it would be best that users can select which stopwatches they want to be able to take bulk actions on, so they let other stopwatches continue running. This will also give them the ability to create whatever combinations they need in any given situation.

Add logic to merge splits

Add logic to merge multiple splits into a single split. Something like:

StopWatch.prototype.merge = function(startIndex, endIndex) {

    return newSplit;
}

Cases to handle:

  • If an endIndex is not provided, merge all splits after startIndex;
  • If the last split is merged, update lastSplit and localGap accordingly

This is to account for the fact that time cannot be removed from a stopwatch, so delete would be ambiguous, and we would not know if the time needs to be applied to the previous/next split already recorded.

Notes

Add the ability to add long-form notes to a stopwatch to document anything that isn't covered by other functionality.

Store all timestamps as timezone-aware timestamps

Stopwatch data should include timezone data, to ensure the originating timezone can be tracked. If a stopwatch has a valid timezone/timezoneOffset value, the stopwatch data will be rendered in that timezone.

Store all stopwatch values as timezone-aware dates:

class TZDate {
  private utcTimestamp: number;  // Milliseconds since Unix epoch in UTC
  private timezone: string;
  private timezoneOffset: number;

  constructor(utcTimestamp: number, timezoneOffset: number | null, timezone: string | null) {
    this.utcTimestamp = utcTimestamp;
    this.timezoneOffset = timezoneOffset || (new Date).getTimezoneOffset();
    this.timezone = timezone || Intl.DateTimeFormat().resolvedOptions().timeZone;
  }

  toOriginalDate(): Date {
    var date = new Date(this.utcTimestamp),
        utcMinutes = date.getUTCHours() * 60 + date.getUTCMinutes(),
        localMinutes = (utcMinutes + this.timezoneOffset + 1440) % 1440;
    date.setUTCHours(Math.floor(localMinutes / 60), localMinutes % 60);
    return date;
  }

  toLocalDate(): Date {
    return new Date(this.utcTimestamp);
  }

  static now(): TZDate {
    var now: number = Date.now(),
        timezoneOffset = (new Date).getTimezoneOffset(),
        timezone = Intl.DateTimeFormat().resolvedOptions().timeZone;
    return new TZDate(now, timezoneOffset, timezone);
  }
}

interface CreationModificationDates {
  readonly createdAt: TZDate;
  lastModified: TZDate | null;
}

interface StopWatchMetadata {
  readonly createdAt: TZDate;
  startedAt: TZDate | null;
  stoppedAt: TZDate | null;
  resumedAt: TZDate | null;
  resetAt: TZDate | null;
  lastModified: TZDate | null;
}

class Split {
  public value: TZDate;
  public metadata: CreationModificationDates;

  constructor(value: number, metadata: CreationModificationDates) {
    this.value = value;
    this.metadata = metadata;
  }
}

System for organizing archived races

From reddit:

I’d love to be able to archive with a race name / tag

Maybe even have tags in the customise section as well.

As users accumulate many records, they would need a way to quickly find relevant races. Tags might be the best/simplest way to go. Maybe a search box to search by the name of the stopwatch.

Stopwatch-specific Activity Log

Record all the actions taken on a given stopwatch, and when they were taken. The log for each stopwatch could be deleted when the stopwatch is deleted.

This would need to be another screen/view on each stopwatch. May need to switch to a tab-based interface under the clock of each stopwatch to keep the UI from getting too cluttered.

Add a Dark mode

Add a dark mode to the website.

Athletes/Coaches/Spectators may not have access to a charger, and having a dark mode could reduce battery consumption. It would also be useful for night races, reviewing times at night, etc.

Stopwatch-Specific "Undo" feature

Adds functionality to undo the last action of each stopwatch. Stack-based, so once the most recent action is un-done, then the one before it can be un-done.

Related to #17.

Export data

Give users the option to export their data to a file. This would probably be best suited for the settings tab, as that is where data is kept.

Should users be given the option to import data from compatible files?

Race stopwatches

Race Stopwatch

A stopwatch with additional functionality based around laps and pace:

  • laps - If a lapDistance is provided, allow a lapSplit to be taken. This can be extended to include a method which returns the lapDuration.
  • pace - Methods to give the pace of a lap, the fastest/slowest/average lap pace.

User Interface Enhancements

Overall

  • Indicate which tab the user is currently on
  • Transition between tabs
  • Make the About page a HTML different page entirely
  • Add splash page?
  • Add an FAQ tab?
    • Explain what it means to clone a stopwatch (with scenarios)

Settings

  • Make it clear what the settings edit
    • Add "Stopwatch" as a main header
  • Add help text to some inputs to make it clear what they are editing
  • For "Font Size", show the user what the current font-size is
    • Better yet, render a stopwatch to show all settings changes

Stopwatch

  • Add ability to label splits

multi-tenant stopwatch

Make stopwatches accessible for multiple users so that multiple users can record splits.

Will need to make this application a hosted application. Use WebSockets for broadcasting splits to users of each given stopwatch.

May also need a different interface for visualizing races with splits recorded by many users, and for filtering out other users' splits.

Add support for tracking laps

The a user provides a lap distance and lap units, add a Lap button to track laps. Laps are a more specialized lap, in that laps have a constant distance, where splits can be taken at any distance interval. Laps track the time since the last lap, and splits track the time since the last split of any kind. This gives the user fast multi-tiered tracking of users and matches the existing mental model for tracking competitors in a race.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.