10-28-2020 12:24
10-28-2020 12:24
Hello!
I have a clock face with a working heart rate sensor and i need to do some things with it.
First i have a heart icon with an SVG animate transform that needs to shrink and scale when the heart rate sensors refreshes.
Then, i have to replace the first "heart icon" with another "heart icon" whenever the heart rate is above 100.
What is the process of doing that ?
11-16-2020 05:05
11-16-2020 05:05
You can see examples of the different ways to animate an element here: https://dev.fitbit.com/build/guides/user-interface/animations/
and you can trigger those animations using javascript, as seen here: https://dev.fitbit.com/build/guides/user-interface/animations/#javascript-animations
to change the image, just set the href property to the new value.
if (hr.bpm >= 80) {
myImg.href = "newImage.png"
} else {
myImg.href = "oldImage.png"
}