ironjr commited on
Commit
44693cd
1 Parent(s): c52b408

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +11 -10
app.py CHANGED
@@ -1055,6 +1055,14 @@ async () => {{
1055
  el.html(html);
1056
  }};
1057
 
 
 
 
 
 
 
 
 
1058
  function timer(totalTime, deadline) {{
1059
  var time = totalTime * 1000;
1060
  var dayDuration = time / deadline;
@@ -1067,7 +1075,8 @@ async () => {{
1067
  if (actualDay > deadline) {{
1068
  deadlineTextBegin();
1069
  }} else if (actualDay > 0) {{
1070
- jQuery('.deadline-timer .day').text(actualDay - {opt.prep_time});
 
1071
  }} else {{
1072
  clearInterval(timer);
1073
  // jQuery('.deadline-timer .day').text(deadline);
@@ -1076,18 +1085,10 @@ async () => {{
1076
  }}
1077
  }}
1078
 
1079
- var deadlineText = function () {{
1080
- var el = jQuery('.deadline-timer');
1081
- var htmlBase = 'Remaining <span class="day">{opt.run_time}</span> <span class="days">s</span>';
1082
- el.html(html);
1083
- var html = '<div class="mask-red"><div class="inner">' + htmlBase + '</div></div><div class="mask-white"><div class="inner">' + htmlBase + '</div></div>';
1084
- el.html(html);
1085
- }};
1086
-
1087
  var runAnimation = function() {{
1088
  timer(animationTime, days);
1089
  remation();
1090
- deadlineText();
1091
 
1092
  console.log('begin interval', animationTime * 1000);
1093
  }};
 
1055
  el.html(html);
1056
  }};
1057
 
1058
+ var deadlineText = function (remainingTime) {{
1059
+ var el = jQuery('.deadline-timer');
1060
+ var htmlBase = 'Remaining <span class="day">' + remainingTime + '</span> <span class="days">s</span>';
1061
+ el.html(html);
1062
+ var html = '<div class="mask-red"><div class="inner">' + htmlBase + '</div></div><div class="mask-white"><div class="inner">' + htmlBase + '</div></div>';
1063
+ el.html(html);
1064
+ }};
1065
+
1066
  function timer(totalTime, deadline) {{
1067
  var time = totalTime * 1000;
1068
  var dayDuration = time / deadline;
 
1075
  if (actualDay > deadline) {{
1076
  deadlineTextBegin();
1077
  }} else if (actualDay > 0) {{
1078
+ deadlineText(actualDay - {opt.prep_time});
1079
+ // jQuery('.deadline-timer .day').text(actualDay - {opt.prep_time});
1080
  }} else {{
1081
  clearInterval(timer);
1082
  // jQuery('.deadline-timer .day').text(deadline);
 
1085
  }}
1086
  }}
1087
 
 
 
 
 
 
 
 
 
1088
  var runAnimation = function() {{
1089
  timer(animationTime, days);
1090
  remation();
1091
+ deadlineText({opt.run_time});
1092
 
1093
  console.log('begin interval', animationTime * 1000);
1094
  }};