Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- async function animateWrapper() {
- for (let i = 0; i < lines.length; i++) {
- let line = lines[i];
- console.log(i)
- if(i==80){
- //alert("Success")
- $("div.success").fadeIn( 300 ).delay( 1500 ).fadeOut( 400 );
- const pStandby = line.node().getPointAtLength(line.node().getTotalLength());
- g.append("circle").attr("cx", pStandby.x).attr("cy", pStandby.y).attr("r", 5).style("fill", "red").style("opacity", "1");
- await sleep(3000);
- }
- function tweenDash() {
- return function (t) {
- const l = line.node().getTotalLength();
- const interpolate = d3.interpolateString("0," + l, l + "," + l);
- const marker = d3.select("#marker");
- marker.style("fill", line.attr('marker-color'));
- const p = line.node().getPointAtLength(t * l);
- marker.attr("transform", "translate(" + p.x + "," + p.y + ")"); //move marker
- //console.log(t)
- return interpolate(t);
- }
- }
- await animate(line, tweenDash);
- }
- }
- $("div.success").fadeIn( 300 ).delay( 1500 ).fadeOut( 400 );
- <div class="alert-box success">Successful Alert !!!</div>
Add Comment
Please, Sign In to add comment