diff options
author | Joris | 2021-05-13 14:50:51 +0200 |
---|---|---|
committer | Joris | 2021-05-13 14:58:26 +0200 |
commit | 221b6451fb4f8559a10e7fefebd13ce125ef29d0 (patch) | |
tree | 3ab337b7b2d40e8235f887046a580b0850540f11 /src/animation.ml | |
parent | 5c636f11cdfed82634ee572645d765b704941b68 (diff) |
Rewrite in TypeScript
BuckleScript is no longer maintained. Choose a widely used techno that
will still be maintained in the following years.
Diffstat (limited to 'src/animation.ml')
-rw-r--r-- | src/animation.ml | 27 |
1 files changed, 0 insertions, 27 deletions
diff --git a/src/animation.ml b/src/animation.ml deleted file mode 100644 index 35294dc..0000000 --- a/src/animation.ml +++ /dev/null @@ -1,27 +0,0 @@ -let isRunning = ref false - -let start base ~onStart ~onEnd = - if not !isRunning then - let () = isRunning := true in - let () = onStart () in - let () = Element.setClassName base "g-Animation" in - let delay = 400 in - let _ = - Js.Global.setTimeout - (fun () -> - let () = Element.setClassName base "" in - let () = onEnd () in - isRunning := false) - delay - in - () - else () - -let replaceChild scrollBase base mkChild = - start base - ~onStart:(fun _ -> - let () = Element.setScrollTop scrollBase 0 in - Element.appendChild base (mkChild ())) - ~onEnd:(fun _ -> - let _ = Element.removeFirstChild base in - ()) |