Skip to main content

countdown_ring

Function countdown_ring 

Source
pub fn countdown_ring<'a, Message: 'a>(
    left: u32,
    total: u32,
    side: f32,
) -> Element<'a, Message>
Expand description

A ring of side side with left of total still to go, the rest drawn empty, and left written in its centre.

The ring answers what the number alone cannot: whether nine seconds is most of the time or the last of it. The filled part runs clockwise from twelve o’clock and shrinks as time passes, the way every countdown people already know does.

A total of zero draws an empty ring rather than dividing by it.