Skip to content

Commit

Permalink
Animate the progress bar
Browse files Browse the repository at this point in the history
  • Loading branch information
laffra committed Dec 4, 2023
1 parent 0f81c11 commit bc8b588
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion examples/pitch.py
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ def run():
section = script[current]
section["tick"] = 0
section["tick"] += 1
ltk.find(f"#progress-{current}").css("width", 15 * section["tick"])
ltk.find(f"#progress-{current}").animate(ltk.to_js({"width": 15 * section["tick"]}), 500)
lines = section["lines"]
line_index = max(0, min(len(lines) - 1, int(-0.1 + len(lines) * section["tick"] / section["duration"])))
line = lines[line_index]
Expand Down

0 comments on commit bc8b588

Please sign in to comment.