How can I set conditions on dynamic attribute?

This is the goal how the page looks.

I would like to add fontawesome crown icon before the following part and change colors depending on the rank.
<div class="d-block" dmx-text="rank_total_votes"></div>

btw, currently the page looks as follows.

how can I do this(my question is only about crown icon and ranking color)??

Community Page
Last updated: