Compare commits
9 Commits
Author | SHA1 | Date | |
---|---|---|---|
![]() |
5db5edcee3 | ||
![]() |
2a92f8f752 | ||
![]() |
4ff13c61f4 | ||
![]() |
1d764cbb94 | ||
![]() |
6419e21387 | ||
![]() |
36ac898508 | ||
![]() |
32feab4483 | ||
![]() |
8c3305685f | ||
![]() |
8dccc528ba |
@ -9,9 +9,10 @@ Watchface with simple and useful design without any diverting factors
|
|||||||
- Clocks with hours, minutes and **seconds**
|
- Clocks with hours, minutes and **seconds**
|
||||||
- Battery percentage
|
- Battery percentage
|
||||||
- Distance
|
- Distance
|
||||||
|
- Week days on english and russian (v1.1.0)
|
||||||
|
|
||||||
## How it looks like
|
## How it looks like
|
||||||
|
|
||||||

|

|
||||||
<img src="https://github.com/user-attachments/assets/9158e9f6-2234-40ca-b5cf-727f86ff8767" height=200>
|
<img src="https://github.com/user-attachments/assets/9158e9f6-2234-40ca-b5cf-727f86ff8767" height=200>
|
||||||
<img src="https://github.com/user-attachments/assets/2c77cb6f-9639-4c7f-8ef2-38d1e17ae81b" height=200>
|
<img src="https://github.com/user-attachments/assets/001d922b-54f2-489f-bd56-c071bdb9012a" height=200>
|
||||||
|
5
app.json
@ -6,7 +6,7 @@
|
|||||||
"appType": "watchface",
|
"appType": "watchface",
|
||||||
"version": {
|
"version": {
|
||||||
"code": 1,
|
"code": 1,
|
||||||
"name": "1.0.5"
|
"name": "1.1.1"
|
||||||
},
|
},
|
||||||
"icon": "icon.png",
|
"icon": "icon.png",
|
||||||
"vender": "zepp",
|
"vender": "zepp",
|
||||||
@ -51,6 +51,9 @@
|
|||||||
"i18n": {
|
"i18n": {
|
||||||
"en-US": {
|
"en-US": {
|
||||||
"appName": "VHS Watch"
|
"appName": "VHS Watch"
|
||||||
|
},
|
||||||
|
"ru-RU": {
|
||||||
|
"appName": "VHS Watch"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"defaultLanguage": "en-US"
|
"defaultLanguage": "en-US"
|
||||||
|
Before Width: | Height: | Size: 9.2 KiB After Width: | Height: | Size: 14 KiB |
BIN
assets/390x450-amazfit-gts-4/misc/altDot.PNG
Normal file
After Width: | Height: | Size: 139 B |
BIN
assets/390x450-amazfit-gts-4/misc/km.png
Normal file
After Width: | Height: | Size: 933 B |
BIN
assets/390x450-amazfit-gts-4/misc/week.kra
Normal file
BIN
assets/390x450-amazfit-gts-4/week/WeekEn/Friday.PNG
Normal file
After Width: | Height: | Size: 727 B |
BIN
assets/390x450-amazfit-gts-4/week/WeekEn/Monday.PNG
Normal file
After Width: | Height: | Size: 879 B |
BIN
assets/390x450-amazfit-gts-4/week/WeekEn/Saturday.PNG
Normal file
After Width: | Height: | Size: 1.1 KiB |
BIN
assets/390x450-amazfit-gts-4/week/WeekEn/Sunday.PNG
Normal file
After Width: | Height: | Size: 1.0 KiB |
BIN
assets/390x450-amazfit-gts-4/week/WeekEn/Thursday.PNG
Normal file
After Width: | Height: | Size: 750 B |
BIN
assets/390x450-amazfit-gts-4/week/WeekEn/Tuesday.PNG
Normal file
After Width: | Height: | Size: 801 B |
BIN
assets/390x450-amazfit-gts-4/week/WeekEn/Wednesday.PNG
Normal file
After Width: | Height: | Size: 1.0 KiB |
BIN
assets/390x450-amazfit-gts-4/week/WeekRu/Воскресенье.PNG
Normal file
After Width: | Height: | Size: 889 B |
BIN
assets/390x450-amazfit-gts-4/week/WeekRu/Вторник.PNG
Normal file
After Width: | Height: | Size: 638 B |
BIN
assets/390x450-amazfit-gts-4/week/WeekRu/Понедельник.PNG
Normal file
After Width: | Height: | Size: 383 B |
BIN
assets/390x450-amazfit-gts-4/week/WeekRu/Пятница.PNG
Normal file
After Width: | Height: | Size: 353 B |
BIN
assets/390x450-amazfit-gts-4/week/WeekRu/Среда.PNG
Normal file
After Width: | Height: | Size: 856 B |
BIN
assets/390x450-amazfit-gts-4/week/WeekRu/Суббота.PNG
Normal file
After Width: | Height: | Size: 894 B |
BIN
assets/390x450-amazfit-gts-4/week/WeekRu/Четверг.PNG
Normal file
After Width: | Height: | Size: 502 B |
BIN
assets/logo.png
Before Width: | Height: | Size: 9.2 KiB After Width: | Height: | Size: 14 KiB |
@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "vhs-watch",
|
"name": "vhs-watch",
|
||||||
"version": "1.0.5",
|
"version": "1.1.1",
|
||||||
"description": "vhs watch for Zepp OS 3.0 (GTS 4)",
|
"description": "vhs watch for Zepp OS 3.0 (GTS 4)",
|
||||||
"main": "app.js",
|
"main": "app.js",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
@ -14,4 +14,4 @@
|
|||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@zeppos/zml": "^0.0.9"
|
"@zeppos/zml": "^0.0.9"
|
||||||
}
|
}
|
||||||
}
|
}
|
@ -9,4 +9,4 @@ export default [
|
|||||||
'clk/7.PNG',
|
'clk/7.PNG',
|
||||||
'clk/8.PNG',
|
'clk/8.PNG',
|
||||||
'clk/9.PNG'
|
'clk/9.PNG'
|
||||||
];
|
]
|
@ -9,4 +9,4 @@ export default [
|
|||||||
'date/7.PNG',
|
'date/7.PNG',
|
||||||
'date/8.PNG',
|
'date/8.PNG',
|
||||||
'date/9.PNG'
|
'date/9.PNG'
|
||||||
];
|
]
|
19
watchface/fontData/weekData.js
Normal file
@ -0,0 +1,19 @@
|
|||||||
|
export const en = [
|
||||||
|
'week/WeekEn/Monday.PNG',
|
||||||
|
'week/WeekEn/Tuesday.PNG',
|
||||||
|
'week/WeekEn/Wednesday.PNG',
|
||||||
|
'week/WeekEn/Thursday.PNG',
|
||||||
|
'week/WeekEn/Friday.PNG',
|
||||||
|
'week/WeekEn/Saturday.PNG',
|
||||||
|
'week/WeekEn/Sunday.PNG'
|
||||||
|
]
|
||||||
|
|
||||||
|
export const ru = [
|
||||||
|
'week/WeekRu/Понедельник.PNG',
|
||||||
|
'week/WeekRu/Вторник.PNG',
|
||||||
|
'week/WeekRu/Среда.PNG',
|
||||||
|
'week/WeekRu/Четверг.PNG',
|
||||||
|
'week/WeekRu/Пятница.PNG',
|
||||||
|
'week/WeekRu/Суббота.PNG',
|
||||||
|
'week/WeekRu/Воскресенье.PNG'
|
||||||
|
]
|
@ -3,6 +3,7 @@ import clockModule from "./modules/clock"
|
|||||||
import dateModule from "./modules/date"
|
import dateModule from "./modules/date"
|
||||||
import distanceModule from "./modules/distance"
|
import distanceModule from "./modules/distance"
|
||||||
import heartRateModule from "./modules/heartRate"
|
import heartRateModule from "./modules/heartRate"
|
||||||
|
import weekModule from "./modules/week"
|
||||||
|
|
||||||
WatchFace({
|
WatchFace({
|
||||||
onInit() {
|
onInit() {
|
||||||
@ -11,6 +12,7 @@ WatchFace({
|
|||||||
batteryModule()
|
batteryModule()
|
||||||
heartRateModule()
|
heartRateModule()
|
||||||
distanceModule()
|
distanceModule()
|
||||||
|
weekModule()
|
||||||
},
|
},
|
||||||
|
|
||||||
build() {
|
build() {
|
||||||
|
@ -1,36 +1,24 @@
|
|||||||
import { getScene, SCENE_AOD } from '@zos/app'
|
import { getScene, SCENE_AOD } from '@zos/app'
|
||||||
import * as hmSensor from '@zos/sensor'
|
|
||||||
import * as hmUI from '@zos/ui'
|
import * as hmUI from '@zos/ui'
|
||||||
import fontArray from '../fontData/secondaryFont'
|
import fontArray from '../fontData/secondaryFont'
|
||||||
|
|
||||||
let batteryWg;
|
|
||||||
const moduleX = 310
|
const moduleX = 310
|
||||||
const moduleY = 10
|
const moduleY = 10
|
||||||
export default function () {
|
export default function () {
|
||||||
console.log("[modules]: battery module init")
|
console.log("[modules]: battery module init")
|
||||||
let battery = new hmSensor.Battery()
|
if (getScene() != SCENE_AOD) {
|
||||||
updateBatteryWidget(battery.getCurrent())
|
hmUI.createWidget(hmUI.widget.IMG, {
|
||||||
battery.onChange(() => updateBatteryWidget(battery.getCurrent()))
|
x: moduleX,
|
||||||
if (getScene() != SCENE_AOD)
|
y: moduleY,
|
||||||
hmUI.createWidget(hmUI.widget.IMG, {
|
src: 'date/perc.PNG'
|
||||||
x: moduleX,
|
})
|
||||||
y: moduleY,
|
hmUI.createWidget(hmUI.widget.TEXT_IMG, {
|
||||||
src: 'date/perc.PNG'
|
x: moduleX - 85,
|
||||||
})
|
y: moduleY,
|
||||||
}
|
font_array: fontArray,
|
||||||
function updateBatteryWidget(batteryPercentage) {
|
h_space: 1,
|
||||||
if (batteryWg)
|
align_h: hmUI.align.RIGHT,
|
||||||
hmUI.deleteWidget(batteryWg)
|
type: hmUI.data_type.BATTERY
|
||||||
|
})
|
||||||
if (getScene() != SCENE_AOD) {
|
}
|
||||||
batteryWg = hmUI.createWidget(hmUI.widget.TEXT_IMG, {
|
|
||||||
x: moduleX - 85,
|
|
||||||
y: moduleY,
|
|
||||||
type: hmUI.data_type.BATTERY,
|
|
||||||
font_array: fontArray,
|
|
||||||
h_space: 1,
|
|
||||||
align_h: hmUI.align.RIGHT,
|
|
||||||
text: batteryPercentage
|
|
||||||
})
|
|
||||||
}
|
|
||||||
}
|
}
|
@ -1,41 +1,30 @@
|
|||||||
import { getScene, SCENE_AOD } from '@zos/app'
|
import { getScene, SCENE_AOD } from '@zos/app'
|
||||||
import * as hmSensor from '@zos/sensor'
|
import * as hmUI from '@zos/ui'
|
||||||
import * as hmUI from '@zos/ui';
|
import secondaryFont from '../fontData/secondaryFont'
|
||||||
import secondaryFont from '../fontData/secondaryFont';
|
|
||||||
|
|
||||||
let distWg;
|
|
||||||
const moduleX = 50
|
const moduleX = 50
|
||||||
const moduleY = 405
|
const moduleY = 405
|
||||||
export default function () {
|
export default function () {
|
||||||
console.log("[modules]: distance module init")
|
console.log("[modules]: distance module init")
|
||||||
let distance = new hmSensor.Distance();
|
|
||||||
updateDistance(distance.getCurrent())
|
|
||||||
distance.onChange(() => updateDistance(distance.getCurrent()))
|
|
||||||
if (getScene() != SCENE_AOD) {
|
if (getScene() != SCENE_AOD) {
|
||||||
hmUI.createWidget(hmUI.widget.IMG, {
|
hmUI.createWidget(hmUI.widget.IMG, {
|
||||||
x: moduleX,
|
x: moduleX,
|
||||||
y: moduleY,
|
y: moduleY,
|
||||||
src: 'misc/dist.PNG'
|
src: 'misc/dist.PNG'
|
||||||
})
|
})
|
||||||
}
|
hmUI.createWidget(hmUI.widget.TEXT_IMG, {
|
||||||
}
|
x: moduleX + 145,
|
||||||
|
|
||||||
function updateDistance(dist) {
|
|
||||||
if (!dist)
|
|
||||||
dist = 0
|
|
||||||
|
|
||||||
if (distWg)
|
|
||||||
hmUI.deleteWidget(distWg)
|
|
||||||
|
|
||||||
if (getScene() != SCENE_AOD) {
|
|
||||||
distWg = hmUI.createWidget(hmUI.widget.TEXT_IMG, {
|
|
||||||
x: moduleX + 150,
|
|
||||||
y: moduleY,
|
y: moduleY,
|
||||||
type: hmUI.data_type.DISTANCE,
|
|
||||||
font_array: secondaryFont,
|
font_array: secondaryFont,
|
||||||
h_space: 1,
|
h_space: 1,
|
||||||
align_h: hmUI.align.LEFT,
|
align_h: hmUI.align.LEFT,
|
||||||
text: dist
|
type: hmUI.data_type.DISTANCE,
|
||||||
|
dot_image: "misc/altDot.PNG"
|
||||||
|
})
|
||||||
|
hmUI.createWidget(hmUI.widget.IMG, {
|
||||||
|
x: moduleX + 243,
|
||||||
|
y: moduleY,
|
||||||
|
src: "misc/km.PNG"
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
}
|
}
|
@ -1,39 +1,22 @@
|
|||||||
import { getScene, SCENE_AOD } from '@zos/app'
|
import { getScene, SCENE_AOD } from '@zos/app'
|
||||||
import * as hmSensor from '@zos/sensor'
|
|
||||||
import * as hmUI from '@zos/ui';
|
import * as hmUI from '@zos/ui';
|
||||||
import secondaryFont from '../fontData/secondaryFont';
|
import secondaryFont from '../fontData/secondaryFont';
|
||||||
|
|
||||||
let heartRateWg;
|
|
||||||
export default function () {
|
export default function () {
|
||||||
console.log("[modules]: heartrate module init")
|
console.log("[modules]: heartrate module init")
|
||||||
if (getScene() != SCENE_AOD) {
|
if (getScene() != SCENE_AOD) {
|
||||||
let heart = new hmSensor.HeartRate();
|
|
||||||
updateHeartWidget(heart.getLast())
|
|
||||||
heart.onCurrentChange(() => updateHeartWidget(heart.getCurrent()))
|
|
||||||
hmUI.createWidget(hmUI.widget.IMG, {
|
hmUI.createWidget(hmUI.widget.IMG, {
|
||||||
x: 10,
|
x: 20,
|
||||||
y: 365,
|
y: 365,
|
||||||
src: 'misc/hb.PNG'
|
src: 'misc/hb.PNG'
|
||||||
})
|
})
|
||||||
}
|
hmUI.createWidget(hmUI.widget.TEXT_IMG, {
|
||||||
}
|
x: 105,
|
||||||
|
|
||||||
function updateHeartWidget(hbpm) {
|
|
||||||
if (!hbpm) {
|
|
||||||
hbpm = 0
|
|
||||||
}
|
|
||||||
if (heartRateWg) {
|
|
||||||
hmUI.deleteWidget(heartRateWg)
|
|
||||||
}
|
|
||||||
if (getScene() != SCENE_AOD) {
|
|
||||||
heartRateWg = hmUI.createWidget(hmUI.widget.TEXT_IMG, {
|
|
||||||
x: 100,
|
|
||||||
y: 365,
|
y: 365,
|
||||||
type: hmUI.data_type.BATTERY,
|
|
||||||
font_array: secondaryFont,
|
font_array: secondaryFont,
|
||||||
h_space: 1,
|
h_space: 1,
|
||||||
align_h: hmUI.align.LEFT,
|
align_h: hmUI.align.LEFT,
|
||||||
text: hbpm
|
type: hmUI.data_type.HEART
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
}
|
}
|
34
watchface/modules/week.js
Normal file
@ -0,0 +1,34 @@
|
|||||||
|
import { getScene, SCENE_AOD } from '@zos/app'
|
||||||
|
import * as hmSetting from '@zos/settings'
|
||||||
|
import * as hmUI from '@zos/ui'
|
||||||
|
import { ru, en } from '../fontData/weekData'
|
||||||
|
|
||||||
|
const moduleX = 225
|
||||||
|
const moduleY = 90
|
||||||
|
|
||||||
|
export default function () {
|
||||||
|
console.log("[modules]: week module init")
|
||||||
|
const language = hmSetting.getLanguage()
|
||||||
|
if (getScene() != SCENE_AOD) {
|
||||||
|
switch (language) {
|
||||||
|
case 4: //ru-RU
|
||||||
|
hmUI.createWidget(hmUI.widget.IMG_WEEK, {
|
||||||
|
x: moduleX,
|
||||||
|
y: moduleY,
|
||||||
|
week_en: ru,
|
||||||
|
week_tc: ru,
|
||||||
|
week_sc: ru
|
||||||
|
})
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
hmUI.createWidget(hmUI.widget.IMG_WEEK, {
|
||||||
|
x: moduleX,
|
||||||
|
y: moduleY,
|
||||||
|
week_en: en,
|
||||||
|
week_tc: en,
|
||||||
|
week_sc: en
|
||||||
|
})
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|