ironjr commited on
Commit
872944e
1 Parent(s): 13995dd

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +17 -14
app.py CHANGED
@@ -1065,42 +1065,45 @@ async () => {{
1065
  const animationTime = {opt.run_time + opt.prep_time};
1066
  const days = {opt.run_time};
1067
 
 
 
 
1068
  var deadlineAnimation = function () {{
1069
  setTimeout(function() {{
1070
- jQuery('#designer-arm-grop').css({{'animation-duration': '1.5s'}});
1071
  }}, 0);
1072
 
1073
  setTimeout(function() {{
1074
- jQuery('#designer-arm-grop').css({{'animation-duration': '1.0s'}});
1075
  }}, {int((opt.run_time + opt.prep_time) * 1000 * 0.2)});
1076
 
1077
  setTimeout(function() {{
1078
- jQuery('#designer-arm-grop').css({{'animation-duration': '0.7s'}});
1079
  }}, {int((opt.run_time + opt.prep_time) * 1000 * 0.4)});
1080
 
1081
  setTimeout(function() {{
1082
- jQuery('#designer-arm-grop').css({{'animation-duration': '0.3s'}});
1083
  }}, {int((opt.run_time + opt.prep_time) * 1000 * 0.6)});
1084
 
1085
  setTimeout(function() {{
1086
- jQuery('#designer-arm-grop').css({{'animation-duration': '0.2s'}});
1087
  }}, {int((opt.run_time + opt.prep_time) * 1000 * 0.75)});
1088
  }};
1089
 
1090
  var deadlineTextBegin = function () {{
1091
- var el = jQuery('.deadline-timer');
1092
  var html = 'Preparing...';
1093
  el.html(html);
1094
  }};
1095
 
1096
  var deadlineTextFinished = function () {{
1097
- var el = jQuery('.deadline-timer');
1098
  var html = 'Done! Retry?';
1099
  el.html(html);
1100
  }};
1101
 
1102
  var deadlineText = function (remainingTime) {{
1103
- var el = jQuery('.deadline-timer');
1104
  var htmlBase = 'Remaining <span class="day">' + remainingTime + '</span> <span class="days">s</span>';
1105
  el.html(html);
1106
  var html = '<div class="mask-red"><div class="inner">' + htmlBase + '</div></div><div class="mask-white"><div class="inner">' + htmlBase + '</div></div>';
@@ -1120,25 +1123,25 @@ async () => {{
1120
  deadlineTextBegin();
1121
  }} else if (actualDay > 0) {{
1122
  deadlineText(actualDay);
1123
- // jQuery('.deadline-timer .day').text(actualDay - {opt.prep_time});
1124
  }} else {{
1125
  clearInterval(timer);
1126
- // jQuery('.deadline-timer .day').text(deadline);
1127
  deadlineTextFinished();
1128
  }}
1129
  }}
1130
  }}
1131
 
1132
- var imgSrc1 = jQuery('#output-screen > button > div > img').src;
1133
  console.log(imgSrc1);
1134
 
1135
  var runAnimation = function() {{
1136
- var imgSrc = jQuery('#output-screen > button > div > img').src;
1137
  var state = false;
1138
  var timerMain = setInterval(checkAndRun, 250);
1139
 
1140
  function checkAndRun() {{
1141
- var imgSrcNew = jQuery('#output-screen > button > div > img').src;
1142
 
1143
  console.log('state', state, 'src', imgSrc, 'src_new', imgSrcNew);
1144
  if (!state) {{
@@ -1150,7 +1153,7 @@ async () => {{
1150
  state = true;
1151
 
1152
  // Run the main animation just once.
1153
- jQuery('#progress-time-fill, #death-group').css({{'animation-duration': animationTime+'s'}});
1154
  timer(animationTime, days);
1155
  deadlineAnimation();
1156
  deadlineText({opt.run_time});
 
1065
  const animationTime = {opt.run_time + opt.prep_time};
1066
  const days = {opt.run_time};
1067
 
1068
+ const gradioEl = document.querySelector('body > gradio-app');
1069
+ var $ = gradioEl.querySelector;
1070
+
1071
  var deadlineAnimation = function () {{
1072
  setTimeout(function() {{
1073
+ $('#designer-arm-grop').css({{'animation-duration': '1.5s'}});
1074
  }}, 0);
1075
 
1076
  setTimeout(function() {{
1077
+ $('#designer-arm-grop').css({{'animation-duration': '1.0s'}});
1078
  }}, {int((opt.run_time + opt.prep_time) * 1000 * 0.2)});
1079
 
1080
  setTimeout(function() {{
1081
+ $('#designer-arm-grop').css({{'animation-duration': '0.7s'}});
1082
  }}, {int((opt.run_time + opt.prep_time) * 1000 * 0.4)});
1083
 
1084
  setTimeout(function() {{
1085
+ $('#designer-arm-grop').css({{'animation-duration': '0.3s'}});
1086
  }}, {int((opt.run_time + opt.prep_time) * 1000 * 0.6)});
1087
 
1088
  setTimeout(function() {{
1089
+ $('#designer-arm-grop').css({{'animation-duration': '0.2s'}});
1090
  }}, {int((opt.run_time + opt.prep_time) * 1000 * 0.75)});
1091
  }};
1092
 
1093
  var deadlineTextBegin = function () {{
1094
+ var el = $('.deadline-timer');
1095
  var html = 'Preparing...';
1096
  el.html(html);
1097
  }};
1098
 
1099
  var deadlineTextFinished = function () {{
1100
+ var el = $('.deadline-timer');
1101
  var html = 'Done! Retry?';
1102
  el.html(html);
1103
  }};
1104
 
1105
  var deadlineText = function (remainingTime) {{
1106
+ var el = $('.deadline-timer');
1107
  var htmlBase = 'Remaining <span class="day">' + remainingTime + '</span> <span class="days">s</span>';
1108
  el.html(html);
1109
  var html = '<div class="mask-red"><div class="inner">' + htmlBase + '</div></div><div class="mask-white"><div class="inner">' + htmlBase + '</div></div>';
 
1123
  deadlineTextBegin();
1124
  }} else if (actualDay > 0) {{
1125
  deadlineText(actualDay);
1126
+ // $('.deadline-timer .day').text(actualDay - {opt.prep_time});
1127
  }} else {{
1128
  clearInterval(timer);
1129
+ // $('.deadline-timer .day').text(deadline);
1130
  deadlineTextFinished();
1131
  }}
1132
  }}
1133
  }}
1134
 
1135
+ var imgSrc1 = $('#output-screen > button > div > img').src;
1136
  console.log(imgSrc1);
1137
 
1138
  var runAnimation = function() {{
1139
+ var imgSrc = $('#output-screen > button > div > img').src;
1140
  var state = false;
1141
  var timerMain = setInterval(checkAndRun, 250);
1142
 
1143
  function checkAndRun() {{
1144
+ var imgSrcNew = $('#output-screen > button > div > img').src;
1145
 
1146
  console.log('state', state, 'src', imgSrc, 'src_new', imgSrcNew);
1147
  if (!state) {{
 
1153
  state = true;
1154
 
1155
  // Run the main animation just once.
1156
+ $('#progress-time-fill, #death-group').css({{'animation-duration': animationTime+'s'}});
1157
  timer(animationTime, days);
1158
  deadlineAnimation();
1159
  deadlineText({opt.run_time});