{"id":17061965,"url":"https://github.com/brh55/fitbit-core","last_synced_at":"2025-10-20T04:01:30.727Z","repository":{"id":57141335,"uuid":"388245432","full_name":"brh55/fitbit-core","owner":"brh55","description":"🌑  A framework to simplify building Fitbit OS watchfaces","archived":false,"fork":false,"pushed_at":"2023-05-27T21:31:15.000Z","size":234,"stargazers_count":4,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-04-12T18:12:49.698Z","etag":null,"topics":["clockface","fitbit","fitbit-clockface","fitbit-development","fitbit-os","watchface"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/brh55.png","metadata":{"files":{"readme":"readme.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null}},"created_at":"2021-07-21T21:04:52.000Z","updated_at":"2024-11-04T05:44:09.000Z","dependencies_parsed_at":"2024-02-01T20:07:57.418Z","dependency_job_id":"1680d22b-3200-4a8d-b1df-e705accdd225","html_url":"https://github.com/brh55/fitbit-core","commit_stats":{"total_commits":29,"total_committers":2,"mean_commits":14.5,"dds":0.03448275862068961,"last_synced_commit":"30f4b08a6a14333440285012b878b9f1223fbe88"},"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/brh55/fitbit-core","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/brh55%2Ffitbit-core","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/brh55%2Ffitbit-core/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/brh55%2Ffitbit-core/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/brh55%2Ffitbit-core/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/brh55","download_url":"https://codeload.github.com/brh55/fitbit-core/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/brh55%2Ffitbit-core/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":267755631,"owners_count":24139463,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-07-29T02:00:12.549Z","response_time":2574,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["clockface","fitbit","fitbit-clockface","fitbit-development","fitbit-os","watchface"],"created_at":"2024-10-14T10:48:49.159Z","updated_at":"2025-10-20T04:01:25.647Z","avatar_url":"https://github.com/brh55.png","language":"JavaScript","readme":"# fitbit-core\n[![Travis branch](https://app.travis-ci.com/brh55/fitbit-core.svg?branch=main\u0026status=started)](https://app.travis-ci.com/github/brh55/fitbit-core) [![Coveralls branch](https://img.shields.io/coveralls/brh55/fitbit-core/master.svg)](https://coveralls.io/github/brh55/fitbit-core) [![npm badge](https://img.shields.io/npm/dt/fitbit-core.svg)](https://www.npmjs.com/package/fitbit-core)\n\n\u003e 🌑 A library to handle core functionality for building Fitbit OS watchface\n\n\u003e Note, this is still a work in progress\n\nThe purpose of this library is to provide a simple interface to abstract the basic core functionality of a Fitbit watchface (date and time). As a result, you'll be able to manage and render the time and date, all within 2 lines code, allowing you to focus mainly on styling and superset features.\n\n**Functionality**\n- Manage and Display Date including i18n / multi-language support\n- Manage and Display Time including user's format preferences and updating on ticks.\n- Simple interface\n- Support custom font through FitFont Rendering\n\n**Future Roadmap**\n- multi-line time (hour / minutes)\n- Support seconds\n\n### Usage\nCreate a `Text` or `FitFont` element in your `.view`. Provide that ID to the core class caller, and initialize the core. \n\n```js\nconst TimeConfiguration = { timeId: 'time' };\nconst DateConfiguration = { dateId: 'date' };\n\nconst core = new Core(TimeConfiguration, DateConfiguration);\ncore.initialize();\n```\n\n**Example: Coloring Elements**\n```js\nconst core = new Core({ timeId: 'time', dateId: 'date' });\ncore.initialize();\n\nif (user.clicked) {\n    core.time.setColor('deepbluesky');\n    core.date.setColor('plum');\n}\n```\n\n**Example: Using Custom Fonts with Fitfont** \u003cbr\u003e\n*index.view: View GUI File*\n```xml\n    \u003csvg\u003e\n        \u003cuse href=\"#fitfont\" id=\"time\"\u003e\n            \u003cuse href=\"#fitfont-char\"/\u003e\n            \u003cuse href=\"#fitfont-char\"/\u003e\n            \u003cuse href=\"#fitfont-char\"/\u003e\n            \u003cuse href=\"#fitfont-char\"/\u003e\n            \u003cuse href=\"#fitfont-char\"/\u003e\n        \u003c/use\u003e\n        \u003cuse href=\"#fitfont\" id=\"date\"\u003e\n            \u003cuse href=\"#fitfont-char\"/\u003e\n            \u003cuse href=\"#fitfont-char\"/\u003e\n            \u003cuse href=\"#fitfont-char\"/\u003e\n            \u003cuse href=\"#fitfont-char\"/\u003e\n            \u003cuse href=\"#fitfont-char\"/\u003e\n            \u003cuse href=\"#fitfont-char\"/\u003e\n            \u003cuse href=\"#fitfont-char\"/\u003e\n            \u003cuse href=\"#fitfont-char\"/\u003e\n            \u003cuse href=\"#fitfont-char\"/\u003e\n            \u003cuse href=\"#fitfont-char\"/\u003e\n            \u003cuse href=\"#fitfont-char\"/\u003e\n            \u003cuse href=\"#fitfont-char\"/\u003e\n            \u003cuse href=\"#fitfont-char\"/\u003e\n            \u003cuse href=\"#fitfont-char\"/\u003e\n        \u003c/use\u003e\n    \u003c/svg\u003e\n```\n*your.js: Clockface JS File*\n```js\nconst CustomDateFont = {\n    font: 'Roboto_30',\n    halign: 'middle',\n    valign: 'start',\n    letterspacing: 0\n};\n\nconst CustomTimeFont = {\n    font: 'Roboto_70',\n    halign: 'middle',\n    valign: 'start',\n    letterspacing: 1\n};\n\nconst core = new Core({\n    timeId: 'time',\n    fitfont: CustomTimeFont\n}, {\n    dateId: 'date',\n    fitfont: CustomDateFont\n});\n\n// Time and Date Displayed\ncore.initialize();\n\nif (someCondition) {\n    const TimeElement = core.time.get();\n    TimeElement.letterspacing = 3;\n    TimeElement.halign = 'end';\n}\n```\n\n## fitbit-core/app\n\n### Core(TimeConfiguration, DateConfiguration)\n**Type:** `class`\u003cbr\u003e\n**Usage:** `new Core(TimeConfiguration, DateConfiguration)`\n\n#### TimeConfiguration\n**Type:** `object`\u003cbr\u003e\nConfiguration for the element used to display the **time**.\n\n##### timeId *(required)*\n**Type:** `string`\u003cbr\u003e\nID of the Time Element\n\n##### fitfont\n**Type:** `object`\u003cbr\u003e\nFitfont configuration, this will render the element as a Fitfont element instead. ID will be populated with the `timeId`.\n\n##### format\n**Type:** `enum` (\"12h\"/\"24h\")\u003cbr\u003e\nConfigure which format will the clock display.\n\n##### onTick\n**Type:** `function` \u003cbr\u003e\nRegister a callback that will be executed upon tick (clock update) events.\n\n#### DateConfiguration\n**Type:** `object`\u003cbr\u003e\nConfiguration for the element used to display the **date**.\n\n##### dateId *(required)*\n**Type:** `string`\u003cbr\u003e\nID of the Date Element\n\n##### fitfont\n**Type:** `object`\u003cbr\u003e\nFitfont configuration, this will render the element as a Fitfont element instead. ID will be populated with the `dateId`.\n\n##### i18n\n**Type:** `boolean`\u003cbr\u003e\nSet to true to automatically reference your PO files for translations. Days are all lowercase.\n\n*Note:* `fitbit-core` will use these `msgid` to map across your i18n/po files: `['sunday', 'monday', 'tuesday', 'wednesday', 'thursday', 'friday', 'saturday']`\n\n## Core Instance API\n### core.date\n**Type:** `Class Instance`\u003cbr\u003e\n\n#### core.date.set(dateObject)\nParses the date object and sets the element text value to the date.\n\n#### core.date.setColor(colorString)\nSets the Date element color to the value inputted.\n\n### core.time\n**Type:** `Class Instance`\u003cbr\u003e\n\n#### core.time.set(dateObject)\nParses the date object and sets element text value to the time.\n\n#### core.time.setColor(colorString)\nSets the Time element color to the value inputted.\n\n#### core.time.onTick(onTickHandler)\nConfigure a onTick handler to be called when the time ticks\n\n## Relevant\nThis library works well in conjunction with:\n\n- [`fitbit-settings`](https://github.com/brh55/fitbit-settings) - A simple library to handle managing settings\n\n## Used in The Wild\nThis module is being used for the following watchfaces:\n\n- [Dogee](https://gallery.fitbit.com/details/6359d45c-696f-4867-aa15-08397fa0f3fe) (4.8 ⭐s) - A free dogecoin watchface by Pixels on Ridge\n\nPixels on Ridge\n## License\nMIT © [Brandon Him](https://github.com/brh55/fitbit-core)\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbrh55%2Ffitbit-core","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbrh55%2Ffitbit-core","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbrh55%2Ffitbit-core/lists"}