moonlantern1 commited on
Commit
31a79be
·
verified ·
1 Parent(s): d6ac878

Slow hero typing loop timing

Browse files
Files changed (1) hide show
  1. app.py +7 -6
app.py CHANGED
@@ -764,9 +764,10 @@ INDEX_HTML = r"""<!DOCTYPE html>
764
  const highlight = 'short clips';
765
  const highlightStart = text.indexOf(highlight);
766
  const highlightEnd = highlightStart + highlight.length;
767
- const typeMs = 3000;
768
- const eraseMs = 3000;
769
- const holdMs = 650;
 
770
  let index = 0;
771
  let deleting = false;
772
 
@@ -797,7 +798,7 @@ INDEX_HTML = r"""<!DOCTYPE html>
797
  render(index);
798
  if (index === 0) {
799
  deleting = false;
800
- setTimeout(step, holdMs);
801
  return;
802
  }
803
  } else {
@@ -805,7 +806,7 @@ INDEX_HTML = r"""<!DOCTYPE html>
805
  render(index);
806
  if (index === text.length) {
807
  deleting = true;
808
- setTimeout(step, holdMs);
809
  return;
810
  }
811
  }
@@ -813,7 +814,7 @@ INDEX_HTML = r"""<!DOCTYPE html>
813
  }
814
 
815
  render(index);
816
- setTimeout(step, holdMs);
817
  }
818
 
819
  startHeroTyping();
 
764
  const highlight = 'short clips';
765
  const highlightStart = text.indexOf(highlight);
766
  const highlightEnd = highlightStart + highlight.length;
767
+ const typeMs = 3500;
768
+ const eraseMs = 3500;
769
+ const emptyHoldMs = 800;
770
+ const fullHoldMs = 4000;
771
  let index = 0;
772
  let deleting = false;
773
 
 
798
  render(index);
799
  if (index === 0) {
800
  deleting = false;
801
+ setTimeout(step, emptyHoldMs);
802
  return;
803
  }
804
  } else {
 
806
  render(index);
807
  if (index === text.length) {
808
  deleting = true;
809
+ setTimeout(step, fullHoldMs);
810
  return;
811
  }
812
  }
 
814
  }
815
 
816
  render(index);
817
+ setTimeout(step, emptyHoldMs);
818
  }
819
 
820
  startHeroTyping();