goals.html 2.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263
  1. <!DOCTYPE html>
  2. <html lang="en">
  3. <head>
  4. <meta charset="UTF-8">
  5. <meta name="viewport" content="width=device-width, initial-scale=1.0">
  6. <meta http-equiv="refresh" content="5">
  7. <link rel="stylesheet" href="{{ url_for('static', filename='style.css') }}">
  8. <title>Active goals</title>
  9. <style>
  10. body {
  11. background-color: transparent;
  12. color: white;
  13. width: 600px;
  14. text-align: left;
  15. }
  16. </style>
  17. </head>
  18. <body style="position: absolute;
  19. bottom: 0; left: 0;">
  20. {% if goals %}
  21. <table>
  22. <thead>
  23. <tr>
  24. <th></th>
  25. <th style="width: 50%"></th>
  26. <th></th>
  27. </tr>
  28. </thead>
  29. <tbody>
  30. {% for goal in goals %}
  31. <tr>
  32. <td style="text-align: left;"> {{ goal[3] }} </td>
  33. {% set progress = goal[1] / goal[2] * 100 %}
  34. <td>
  35. <div class="bar-light-grey bar-tiny bar-round" style="position: relative;">
  36. <div class="bar-round bar-blue" style="text-align: center; width:{{ progress }}%;">{{ '%0.0f'| format(progress| float) }}%
  37. </div>
  38. {% set milestones = rewards[goal[0]]["milestones"] %}
  39. {% for milestone_key, milestone in milestones.items() %}
  40. {% if milestones[milestone_key][0] and milestones[milestone_key][1] %}
  41. {% if milestones[milestone_key][1] < goal[2] %}
  42. {% set milestone_progress = milestones[milestone_key][1] / goal[2] * 100 %}
  43. <div class="milestone-marker" style="position: absolute; left: {{ milestone_progress }}%; transform: translateX(-50%);">
  44. <img src="/static/img/milestone.png" style="width: 16px; height: 16px;" title="{{ milestones[milestone_key][1] }} points. {{ milestones[milestone_key][0] }}">
  45. </div>
  46. {% endif %}
  47. {% endif %}
  48. {% endfor %}
  49. </div>
  50. </td>
  51. {% if goal[1] == goal[2] %}
  52. <td style="text-align: right;">{{ goal[1] }} / {{ goal[2] }} <img src=/static/img/tada.png style="width: 24px; height: 24px;"></td>
  53. {% else %}
  54. <td style="text-align: right;">{{ goal[1] }} / {{ goal[2] }}</td>
  55. {% endif %}
  56. </tr>
  57. {% endfor %}
  58. </tbody>
  59. </table>
  60. {% endif %}
  61. </body>
  62. </html>