Skip to content

Commit

Permalink
add opposite time watchface
Browse files Browse the repository at this point in the history
  • Loading branch information
novvember committed Nov 28, 2024
1 parent 3a3bda8 commit eda44f7
Show file tree
Hide file tree
Showing 26 changed files with 497 additions and 0 deletions.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -70,3 +70,4 @@ To add a new watchface to your device:
| ![](./grotesque/demo.png) | Grotesque | All round watches | ✅ Done |
| ![](./time-machine/demo.png) | Time Machine | All round watches | ✅ Done |
| ![](./concentric-data/demo.png) | Concentric Data | All round watches | ✅ Done |
| ![](./opposite-time/demo.png) | Opposite Time | All round watches | ✅ Done |
15 changes: 15 additions & 0 deletions opposite-time/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
.DS_Store
node_modules/**
dist/*
npm-debug.log
yarn-debug.log*
yarn-error.log*
yarn.lock
package-lock.json
selenium-debug.log
.idea
.vscode
*.suo
*.ntvs*
*.njsproj
*.sln
42 changes: 42 additions & 0 deletions opposite-time/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
# Opposite Time Watchface
Watchface for Amazfit GTR Mini and for other round ZeppOS watch.

![demo](./demo-gtr-mini.png)

## Features

**Main features**
- Time is displayed with a word for every digit.
- Lots of extra data

**Legend**

`.` – steps

`*` – calories

`´` – active time

`:` – heart rate

`%` – battery

**Original watchface by:**

TTMM studia and their [OPPOSITTMM watchface for Fitbit Versa](https://ttmm.is/portfolio/opposittmm/).

**Model compatibility:** Amazfit GTR Mini, Amazfit GTR 4 and all other round ZeppOS watches

**Note: Time text requires devices with ZeppOS 2 and higher and is not compatible with older models like the GTR 3 and GTR 3.**

**AOD:** No

**Tap-zones:** No

**Language:** English, Russian

## Download ⏬

To install it to your smartwatch:

See instructions [here](https://github.com/novvember/amazfit-watchfaces/blob/main/README.md) to download and install to your watch.
10 changes: 10 additions & 0 deletions opposite-time/app.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
App({
globalData: {},
onCreate(options) {
console.log('app on create invoke')
},

onDestroy(options) {
console.log('app on destroy invoke')
}
})
59 changes: 59 additions & 0 deletions opposite-time/app.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
{
"configVersion": "v3",
"app": {
"appId": 1068472,
"appName": "Opposite Time",
"appType": "watchface",
"version": {
"code": 1,
"name": "1.0.0"
},
"icon": "icon.png",
"vender": "novvember",
"cover": [
"cover.png",
"cover2.png"
],
"description": "Opposite Time watchface. Source code here: https://github.com/novvember/amazfit-watchfaces. Original idea by Daniel Duarte"
},
"runtime": {
"apiVersion": {
"compatible": "1.0.0",
"target": "1.0.1",
"minVersion": "1.0.0"
}
},
"permissions": [],
"targets": {
"common": {
"module": {
"watchface": {
"path": "watchface/index",
"main": 1,
"editable": 1,
"lockscreen": 1,
"photoscreen": 0
}
},
"platforms": [
{
"st": "r"
}
],
"designWidth": 480
}
},
"i18n": {
"en-US": {
"appName": "Opposite Time"
},
"ru-RU": {
"appName": "Opposite Time"
},
"uk-UA": {
"appName": "Opposite Time"
}
},
"defaultLanguage": "en-US",
"debug": false
}
Binary file added opposite-time/assets/common.r/cover.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added opposite-time/assets/common.r/cover2.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file not shown.
Binary file added opposite-time/assets/common.r/icon.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added opposite-time/demo-balance.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added opposite-time/demo-balance_2.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added opposite-time/demo-gtr-3-pro.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added opposite-time/demo-gtr-3-pro_2.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added opposite-time/demo-gtr-4.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added opposite-time/demo-gtr-4_2.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added opposite-time/demo-gtr-mini.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added opposite-time/demo-gtr-mini_2.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added opposite-time/demo-t-rex-2.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added opposite-time/demo-t-rex-2_2.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added opposite-time/demo.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added opposite-time/preview.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added opposite-time/preview2.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
64 changes: 64 additions & 0 deletions opposite-time/utils/constants.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
const lang = DeviceRuntimeCore.HmUtils.getLanguage();
const isRusLang = ['ru-RU', 'uk-UA'].includes(lang);

const { width, height } = hmSetting.getDeviceInfo();

export const SCREEN = {
width,
height,
centerX: width / 2,
centerY: height / 2,
};

export const COLORS = {
primary: 0xffffff,
secondary: 0x6b6c70,
accent: 0xfea308,
accentFaded: 0xce7f00,
};

export const FONT = 'fonts/FiraSans-Black.ttf';

export const WIDTH = isRusLang ? px(364) : px(324);

export const TEXT_HEIGHT = px(44);
export const TEXT_SIZE = px(52);

export const LINE_Y = new Array(7)
.fill(null)
.map((_, i) => px(82) + i * TEXT_HEIGHT);

const DIGITS_EN = [
'ZERO',
'ONE',
'TWO',
'THREE',
'FOUR',
'FIVE',
'SIX',
'SEVEN',
'EIGHT',
'NINE',
];

const DIGITS_RU = [
'НОЛЬ',
'ОДИН',
'ДВА',
'ТРИ',
'ЧЕТЫРЕ',
'ПЯТЬ',
'ШЕСТЬ',
'СЕМЬ',
'ВОСЕМЬ',
'ДЕВЯТЬ',
];

export const DIGITS = isRusLang ? DIGITS_RU : DIGITS_EN;

const WEEKDAYS_EN = ['MON', 'TUE', 'WED', 'THU', 'FRI', 'SAT', 'SUN'];
const WEEKDAYS_RU = ['ПН', 'ВТ', 'СР', 'ЧТ', 'ПТ', 'СБ', 'ВС'];
export const WEEKDAYS = isRusLang ? WEEKDAYS_RU : WEEKDAYS_EN;

export const M_TEXT = isRusLang ? 'м' : 'm';
export const KM_TEXT = isRusLang ? 'км' : 'km';
11 changes: 11 additions & 0 deletions opposite-time/utils/getTimeDigits.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
export function getTimeDigits(timeSensor) {
const { hour, minute, second } = timeSensor;

const is12HourFormat = hmSetting.getTimeFormat() === 0;
const hourValue = is12HourFormat ? hour % 12 || 12 : hour;
const [h0, h1] = hourValue.toString().padStart(2, '0');
const [m0, m1] = minute.toString().padStart(2, '0');
const [s0, s1] = second.toString().padStart(2, '0');

return [h0, h1, m0, m1, s0, s1];
}
Loading

0 comments on commit eda44f7

Please sign in to comment.