Cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Image scale animation based on heart rate

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 Answer
0 Votes
1 REPLY 1

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
0 Votes