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 ?
Best Answer11-16-2020 05:05
Fitbit Developers oversee the SDK and API forums. We're here to answer questions about Fitbit developer tools, assist with projects, and make sure your voice is heard by the development team.
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"
}
Best Answer