summaryrefslogtreecommitdiff
path: root/web/web_svg.c
diff options
context:
space:
mode:
authorDavid Vazgenovich Shakaryan <dvshakaryan@gmail.com>2022-05-16 18:19:18 -0700
committerDavid Vazgenovich Shakaryan <dvshakaryan@gmail.com>2022-05-16 18:20:08 -0700
commit94f9bdf20df4d728b6f787a59812cb4448080347 (patch)
treede917749e4d4751e1d7376c2d9d843dc87bae00d /web/web_svg.c
parent5a0ba5de6092493df4e8add82cca33135acc4da2 (diff)
downloaddartboat-94f9bdf20df4d728b6f787a59812cb4448080347.tar.gz
dartboat-94f9bdf20df4d728b6f787a59812cb4448080347.tar.xz
web: add throw animation
Diffstat (limited to 'web/web_svg.c')
-rw-r--r--web/web_svg.c7
1 files changed, 7 insertions, 0 deletions
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);
}