X-Git-Url: https://plomlompom.com/repos/do_day?a=blobdiff_plain;f=income_progress_bars.py;h=5a4f5ad013eae7e8bbc68b301e1d429c78e23b72;hb=25a026d5a558d9ae256cab7a27d525ec18b48f1a;hp=48b1179430326ec4ea1c26ef29a0801b30974fa2;hpb=739e107240a6594839fbd349b972694527589434;p=misc diff --git a/income_progress_bars.py b/income_progress_bars.py index 48b1179..5a4f5ad 100644 --- a/income_progress_bars.py +++ b/income_progress_bars.py @@ -1,4 +1,3 @@ -# Python 3 server example from http.server import BaseHTTPRequestHandler, HTTPServer import os import json @@ -26,6 +25,9 @@ td, th { background-color: black; border: none; } +.surplusbar { + width: 200px; +} .time_progress { position: absolute; height: 20px; @@ -213,14 +215,18 @@ class MyServer(BaseHTTPRequestHandler): success_income_cut = min(success_income, 1.0) success_income_bonus = max(success_income - 1.0, 0) success = success_income + 0 - diff_goal = earned - goal + diff_goal = "%.2fâ¬" % (earned - goal) + if title != "workday": + diff_goal += "(%.2fâ¬)" % (earned - (goal * time_progress)) if time_progress >= 0: - success = success_income / time_progress + success = 1 + if time_progress > 0: + success = success_income / time_progress time_progress_indicator = "
" % int(time_progress * 100) return "