05-07-2019 05:17
05-07-2019 05:17
Hello.
I would like to have a heart beat animation on a clock face.
For example, the following code is working.
<text id="heartRateText">---</text> : : const heartRateText = document.getElementById("heartRateText"); : : heartRateText.text = hrm.heartRate;
However, I can not add or remove class to the following heartRateIcon for heart beat animation.
const heartRateIcon = document.getElementById("heartRateIcon");
Could you teach me how to change the state of objects?
Answered! Go to the Best Answer.
05-13-2019 04:35
05-13-2019 04:35
05-07-2019 05:23
05-07-2019 05:23
Assuming the icon is an image, change the image's href. You're right that fitbit doesn't let us change classes at run time.
05-07-2019 05:31
05-07-2019 05:31
Thank you for your reply.
My code was the following:
/* index.gui */ <image id="activityIcon"/> : : /* styles.css */ #heartRateIcon { x: 21; y: 75%; width: 48; height: 48; href: "stat_hr_solid_48px.png"; fill: red; }
05-13-2019 04:35
05-13-2019 04:35
I found sample SDK version of the "Moment" clock face by Fitbit.