ironjr commited on
Commit
4f55a5a
1 Parent(s): 386d57b

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +12 -11
app.py CHANGED
@@ -1118,10 +1118,7 @@ async () => {{
1118
 
1119
  function countTime() {{
1120
  --actualDay;
1121
- if (actualDay > deadline) {{
1122
- deadlineTextBegin();
1123
- }} else if (actualDay > 0) {{
1124
- deadlineText(actualDay);
1125
  gradioEl.querySelector('#progress-time-fill').style['animation-duration'] = animationTime + 's';
1126
  gradioEl.querySelector('#progress-time-fill').style['-webkit-animation-name'] = 'progress-fill';
1127
  gradioEl.querySelector('#progress-time-fill').style['animation-name'] = 'progress-fill';
@@ -1134,9 +1131,8 @@ async () => {{
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';
@@ -1150,12 +1146,17 @@ async () => {{
1150
  gradioEl.querySelector('#white-flame').style['-webkit-animation-name'] = 'finished-flames';
1151
  gradioEl.querySelector('#white-flame').style['animation-name'] = 'finished-flames';
1152
  }}
 
 
 
 
 
 
 
 
1153
  }}
1154
  }}
1155
 
1156
- var imgSrc1 = gradioEl.querySelector('#output-screen > button > div > img').src;
1157
- console.log(imgSrc1);
1158
-
1159
  var runAnimation = function() {{
1160
  var imgSrc = gradioEl.querySelector('#output-screen > button > div > img').src;
1161
  var state = false;
@@ -1164,7 +1165,7 @@ async () => {{
1164
  function checkAndRun() {{
1165
  var imgSrcNew = gradioEl.querySelector('#output-screen > button > div > img').src;
1166
 
1167
- console.log('state', state, 'src', imgSrc, 'src_new', imgSrcNew);
1168
  if (!state) {{
1169
  if (imgSrc == imgSrcNew) {{
1170
  // Do nothing.
 
1118
 
1119
  function countTime() {{
1120
  --actualDay;
1121
+ if (actualDay + 1 > deadline && actualDay <= deadline) {{
 
 
 
1122
  gradioEl.querySelector('#progress-time-fill').style['animation-duration'] = animationTime + 's';
1123
  gradioEl.querySelector('#progress-time-fill').style['-webkit-animation-name'] = 'progress-fill';
1124
  gradioEl.querySelector('#progress-time-fill').style['animation-name'] = 'progress-fill';
 
1131
  gradioEl.querySelector('#yellow-flame').style['animation-name'] = 'show-flames';
1132
  gradioEl.querySelector('#white-flame').style['-webkit-animation-name'] = 'show-flames';
1133
  gradioEl.querySelector('#white-flame').style['animation-name'] = 'show-flames';
1134
+ }}
1135
+ if (actualDay + 1 > 0 && actualDay <= 0) {{
 
1136
  gradioEl.querySelector('#progress-time-fill').style['animation-duration'] = 1000000 + 's';
1137
  gradioEl.querySelector('#progress-time-fill').style['-webkit-animation-name'] = 'finished-fill';
1138
  gradioEl.querySelector('#progress-time-fill').style['animation-name'] = 'finished-fill';
 
1146
  gradioEl.querySelector('#white-flame').style['-webkit-animation-name'] = 'finished-flames';
1147
  gradioEl.querySelector('#white-flame').style['animation-name'] = 'finished-flames';
1148
  }}
1149
+ if (actualDay > deadline) {{
1150
+ deadlineTextBegin();
1151
+ }} else if (actualDay > 0) {{
1152
+ deadlineText(actualDay);
1153
+ }} else {{
1154
+ clearInterval(timer);
1155
+ deadlineTextFinished();
1156
+ }}
1157
  }}
1158
  }}
1159
 
 
 
 
1160
  var runAnimation = function() {{
1161
  var imgSrc = gradioEl.querySelector('#output-screen > button > div > img').src;
1162
  var state = false;
 
1165
  function checkAndRun() {{
1166
  var imgSrcNew = gradioEl.querySelector('#output-screen > button > div > img').src;
1167
 
1168
+ // console.log('state', state, 'src', imgSrc, 'src_new', imgSrcNew);
1169
  if (!state) {{
1170
  if (imgSrc == imgSrcNew) {{
1171
  // Do nothing.