ironjr commited on
Commit
386d57b
1 Parent(s): 97c54c2

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +35 -10
app.py CHANGED
@@ -589,8 +589,8 @@ css = css + f"""
589
  left: 0;
590
  width: 0;
591
  color: #BE002A;
592
- -webkit-animation: text-red {opt.run_time + opt.prep_time:.1f}s ease infinite;
593
- animation: text-red {opt.run_time + opt.prep_time:.1f}s ease infinite;
594
  z-index: 2;
595
  background: transparent;
596
  }}
@@ -602,22 +602,22 @@ css = css + f"""
602
 
603
  #red-flame {{
604
  opacity: 0;
605
- -webkit-animation: show-flames {opt.run_time + opt.prep_time:.1f}s ease infinite, red-flame 120ms ease infinite;
606
- animation: show-flames {opt.run_time + opt.prep_time:.1f}s ease infinite, red-flame 120ms ease infinite;
607
  transform-origin: center bottom;
608
  }}
609
 
610
  #yellow-flame {{
611
  opacity: 0;
612
- -webkit-animation: show-flames {opt.run_time + opt.prep_time:.1f}s ease infinite, yellow-flame 120ms ease infinite;
613
- animation: show-flames {opt.run_time + opt.prep_time:.1f}s ease infinite, yellow-flame 120ms ease infinite;
614
  transform-origin: center bottom;
615
  }}
616
 
617
  #white-flame {{
618
  opacity: 0;
619
- -webkit-animation: show-flames {opt.run_time + opt.prep_time:.1f}s ease infinite, red-flame 100ms ease infinite;
620
- animation: show-flames {opt.run_time + opt.prep_time:.1f}s ease infinite, red-flame 100ms ease infinite;
621
  transform-origin: center bottom;
622
  }}
623
  """
@@ -1104,7 +1104,8 @@ async () => {{
1104
  var deadlineText = function (remainingTime) {{
1105
  var el = gradioEl.querySelector('.deadline-timer');
1106
  var htmlBase = 'Remaining <span class="day">' + remainingTime + '</span> <span class="days">s</span>';
1107
- var html = '<div class="mask-red"><div class="inner">' + htmlBase + '</div></div><div class="mask-white"><div class="inner">' + htmlBase + '</div></div>';
 
1108
  el.innerHTML = html;
1109
  }};
1110
 
@@ -1126,10 +1127,28 @@ async () => {{
1126
  gradioEl.querySelector('#progress-time-fill').style['animation-name'] = 'progress-fill';
1127
  gradioEl.querySelector('#death-group').style['animation-duration'] = animationTime + 's';
1128
  gradioEl.querySelector('#death-group').style['-webkit-animation-name'] = 'walk';
1129
- gradioEl.querySelector('#death-group').style['animation-name'] = 'walk';
 
 
 
 
 
 
1130
  }} else {{
1131
  clearInterval(timer);
1132
  deadlineTextFinished();
 
 
 
 
 
 
 
 
 
 
 
 
1133
  }}
1134
  }}
1135
  }}
@@ -1156,6 +1175,12 @@ async () => {{
1156
  gradioEl.querySelector('#death-group').style['animation-duration'] = 1000000 + 's';
1157
  gradioEl.querySelector('#death-group').style['-webkit-animation-name'] = 'idle';
1158
  gradioEl.querySelector('#death-group').style['animation-name'] = 'idle';
 
 
 
 
 
 
1159
  }} else {{
1160
  // Running = True
1161
  state = true;
 
589
  left: 0;
590
  width: 0;
591
  color: #BE002A;
592
+ // -webkit-animation: text-red {opt.run_time + opt.prep_time:.1f}s ease infinite;
593
+ // animation: text-red {opt.run_time + opt.prep_time:.1f}s ease infinite;
594
  z-index: 2;
595
  background: transparent;
596
  }}
 
602
 
603
  #red-flame {{
604
  opacity: 0;
605
+ -webkit-animation: idle-flames {opt.run_time + opt.prep_time:.1f}s ease infinite, red-flame 120ms ease infinite;
606
+ animation: idle-flames {opt.run_time + opt.prep_time:.1f}s ease infinite, red-flame 120ms ease infinite;
607
  transform-origin: center bottom;
608
  }}
609
 
610
  #yellow-flame {{
611
  opacity: 0;
612
+ -webkit-animation: idle-flames {opt.run_time + opt.prep_time:.1f}s ease infinite, yellow-flame 120ms ease infinite;
613
+ animation: idle-flames {opt.run_time + opt.prep_time:.1f}s ease infinite, yellow-flame 120ms ease infinite;
614
  transform-origin: center bottom;
615
  }}
616
 
617
  #white-flame {{
618
  opacity: 0;
619
+ -webkit-animation: idle-flames {opt.run_time + opt.prep_time:.1f}s ease infinite, red-flame 100ms ease infinite;
620
+ animation: idle-flames {opt.run_time + opt.prep_time:.1f}s ease infinite, red-flame 100ms ease infinite;
621
  transform-origin: center bottom;
622
  }}
623
  """
 
1104
  var deadlineText = function (remainingTime) {{
1105
  var el = gradioEl.querySelector('.deadline-timer');
1106
  var htmlBase = 'Remaining <span class="day">' + remainingTime + '</span> <span class="days">s</span>';
1107
+ // var html = '<div class="mask-red"><div class="inner">' + htmlBase + '</div></div><div class="mask-white"><div class="inner">' + htmlBase + '</div></div>';
1108
+ var html = '<div class="mask-white"><div class="inner">' + htmlBase + '</div></div>';
1109
  el.innerHTML = html;
1110
  }};
1111
 
 
1127
  gradioEl.querySelector('#progress-time-fill').style['animation-name'] = 'progress-fill';
1128
  gradioEl.querySelector('#death-group').style['animation-duration'] = animationTime + 's';
1129
  gradioEl.querySelector('#death-group').style['-webkit-animation-name'] = 'walk';
1130
+ gradioEl.querySelector('#death-group').style['animation-name'] = 'show-flames';
1131
+ gradioEl.querySelector('#red-flame').style['-webkit-animation-name'] = 'show-flames';
1132
+ gradioEl.querySelector('#red-flame').style['animation-name'] = 'show-flames';
1133
+ gradioEl.querySelector('#yellow-flame').style['-webkit-animation-name'] = 'show-flames';
1134
+ gradioEl.querySelector('#yellow-flame').style['animation-name'] = 'show-flames';
1135
+ gradioEl.querySelector('#white-flame').style['-webkit-animation-name'] = 'show-flames';
1136
+ gradioEl.querySelector('#white-flame').style['animation-name'] = 'show-flames';
1137
  }} else {{
1138
  clearInterval(timer);
1139
  deadlineTextFinished();
1140
+ gradioEl.querySelector('#progress-time-fill').style['animation-duration'] = 1000000 + 's';
1141
+ gradioEl.querySelector('#progress-time-fill').style['-webkit-animation-name'] = 'finished-fill';
1142
+ gradioEl.querySelector('#progress-time-fill').style['animation-name'] = 'finished-fill';
1143
+ gradioEl.querySelector('#death-group').style['animation-duration'] = 1000000 + 's';
1144
+ gradioEl.querySelector('#death-group').style['-webkit-animation-name'] = 'finished';
1145
+ gradioEl.querySelector('#death-group').style['animation-name'] = 'finished';
1146
+ gradioEl.querySelector('#red-flame').style['-webkit-animation-name'] = 'finished-flames';
1147
+ gradioEl.querySelector('#red-flame').style['animation-name'] = 'finished-flames';
1148
+ gradioEl.querySelector('#yellow-flame').style['-webkit-animation-name'] = 'finished-flames';
1149
+ gradioEl.querySelector('#yellow-flame').style['animation-name'] = 'finished-flames';
1150
+ gradioEl.querySelector('#white-flame').style['-webkit-animation-name'] = 'finished-flames';
1151
+ gradioEl.querySelector('#white-flame').style['animation-name'] = 'finished-flames';
1152
  }}
1153
  }}
1154
  }}
 
1175
  gradioEl.querySelector('#death-group').style['animation-duration'] = 1000000 + 's';
1176
  gradioEl.querySelector('#death-group').style['-webkit-animation-name'] = 'idle';
1177
  gradioEl.querySelector('#death-group').style['animation-name'] = 'idle';
1178
+ gradioEl.querySelector('#red-flame').style['-webkit-animation-name'] = 'idle-flames';
1179
+ gradioEl.querySelector('#red-flame').style['animation-name'] = 'idle-flames';
1180
+ gradioEl.querySelector('#yellow-flame').style['-webkit-animation-name'] = 'idle-flames';
1181
+ gradioEl.querySelector('#yellow-flame').style['animation-name'] = 'idle-flames';
1182
+ gradioEl.querySelector('#white-flame').style['-webkit-animation-name'] = 'idle-flames';
1183
+ gradioEl.querySelector('#white-flame').style['animation-name'] = 'idle-flames';
1184
  }} else {{
1185
  // Running = True
1186
  state = true;