From 94f9bdf20df4d728b6f787a59812cb4448080347 Mon Sep 17 00:00:00 2001 From: David Vazgenovich Shakaryan Date: Mon, 16 May 2022 18:19:18 -0700 Subject: web: add throw animation --- web/web_svg.c | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'web/web_svg.c') diff --git a/web/web_svg.c b/web/web_svg.c index 470b7ec..485583d 100644 --- a/web/web_svg.c +++ b/web/web_svg.c @@ -1,5 +1,6 @@ #include "web_svg.h" #include "web_dom.h" +#include "web_opts.h" #include "board.h" #include "comp.h" @@ -224,6 +225,12 @@ void svg_draw_point(double x, double y) dom_elem_add_attrd(e, "cx", x); dom_elem_add_attrd(e, "cy", y); + if (delay_ms >= SVG_THROW_ANIM_MS) { + char buf[64]; + sprintf(buf, "animation: throw-anim %dms;", SVG_THROW_ANIM_MS); + dom_elem_add_attr(e, "style", buf); + } + dom_append_elemv("#dartboard .overlay", 1, &e); dom_elem_free(e); } -- cgit v1.2.3-70-g09d2