Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
|
@@ -1092,24 +1092,23 @@ async () => {{
|
|
| 1092 |
var deadlineTextBegin = function () {{
|
| 1093 |
var el = gradioEl.querySelector('.deadline-timer');
|
| 1094 |
var html = 'Preparing...';
|
| 1095 |
-
el.html
|
| 1096 |
}};
|
| 1097 |
|
| 1098 |
var deadlineTextFinished = function () {{
|
| 1099 |
var el = gradioEl.querySelector('.deadline-timer');
|
| 1100 |
var html = 'Done! Retry?';
|
| 1101 |
-
el.html
|
| 1102 |
}};
|
| 1103 |
|
| 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 |
-
el.html(html);
|
| 1108 |
var html = '<div class="mask-red"><div class="inner">' + htmlBase + '</div></div><div class="mask-white"><div class="inner">' + htmlBase + '</div></div>';
|
| 1109 |
-
el.html
|
| 1110 |
}};
|
| 1111 |
|
| 1112 |
-
function
|
| 1113 |
var time = totalTime * 1000;
|
| 1114 |
var dayDuration = time / (deadline + {opt.prep_time});
|
| 1115 |
var actualDay = deadline + {opt.prep_time};
|
|
@@ -1122,10 +1121,8 @@ async () => {{
|
|
| 1122 |
deadlineTextBegin();
|
| 1123 |
}} else if (actualDay > 0) {{
|
| 1124 |
deadlineText(actualDay);
|
| 1125 |
-
// gradioEl.querySelector('.deadline-timer .day').text(actualDay - {opt.prep_time});
|
| 1126 |
}} else {{
|
| 1127 |
clearInterval(timer);
|
| 1128 |
-
// gradioEl.querySelector('.deadline-timer .day').text(deadline);
|
| 1129 |
deadlineTextFinished();
|
| 1130 |
}}
|
| 1131 |
}}
|
|
@@ -1152,8 +1149,8 @@ async () => {{
|
|
| 1152 |
state = true;
|
| 1153 |
|
| 1154 |
// Run the main animation just once.
|
| 1155 |
-
gradioEl.querySelector('#progress-time-fill, #death-group')
|
| 1156 |
-
|
| 1157 |
deadlineAnimation();
|
| 1158 |
deadlineText({opt.run_time});
|
| 1159 |
console.log('begin interval', animationTime * 1000);
|
|
|
|
| 1092 |
var deadlineTextBegin = function () {{
|
| 1093 |
var el = gradioEl.querySelector('.deadline-timer');
|
| 1094 |
var html = 'Preparing...';
|
| 1095 |
+
el.innerHTML = html;
|
| 1096 |
}};
|
| 1097 |
|
| 1098 |
var deadlineTextFinished = function () {{
|
| 1099 |
var el = gradioEl.querySelector('.deadline-timer');
|
| 1100 |
var html = 'Done! Retry?';
|
| 1101 |
+
el.innerHTML = html;
|
| 1102 |
}};
|
| 1103 |
|
| 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 |
|
| 1111 |
+
function timerFunc(totalTime, deadline) {{
|
| 1112 |
var time = totalTime * 1000;
|
| 1113 |
var dayDuration = time / (deadline + {opt.prep_time});
|
| 1114 |
var actualDay = deadline + {opt.prep_time};
|
|
|
|
| 1121 |
deadlineTextBegin();
|
| 1122 |
}} else if (actualDay > 0) {{
|
| 1123 |
deadlineText(actualDay);
|
|
|
|
| 1124 |
}} else {{
|
| 1125 |
clearInterval(timer);
|
|
|
|
| 1126 |
deadlineTextFinished();
|
| 1127 |
}}
|
| 1128 |
}}
|
|
|
|
| 1149 |
state = true;
|
| 1150 |
|
| 1151 |
// Run the main animation just once.
|
| 1152 |
+
gradioEl.querySelector('#progress-time-fill, #death-group')['animation-duration'] = animationTime+'s';
|
| 1153 |
+
timerFunc(animationTime, days);
|
| 1154 |
deadlineAnimation();
|
| 1155 |
deadlineText({opt.run_time});
|
| 1156 |
console.log('begin interval', animationTime * 1000);
|