From 0fa3d4b74b6efad580c3c12ef677bf50c73ca933 Mon Sep 17 00:00:00 2001 From: Peter Stockings Date: Fri, 8 Dec 2023 21:23:26 +1100 Subject: [PATCH] Make site even more responsive --- static/css/style.css | 1 - templates/partials/new_set_form.html | 10 +++---- templates/partials/sparkline.html | 40 ++++++++++++++------------- templates/partials/workout_modal.html | 8 +++--- 4 files changed, 30 insertions(+), 29 deletions(-) diff --git a/static/css/style.css b/static/css/style.css index 841e159..5361c41 100644 --- a/static/css/style.css +++ b/static/css/style.css @@ -39,7 +39,6 @@ tr.htmx-swapping td { border-radius: 8px; box-shadow: 0px 0px 20px 0px rgba(0,0,0,0.3); background-color: white; - padding: 20px; /* Animate when opening */ animation-name: zoomIn; animation-duration: 150ms; diff --git a/templates/partials/new_set_form.html b/templates/partials/new_set_form.html index 6bf4f18..dbb27f2 100644 --- a/templates/partials/new_set_form.html +++ b/templates/partials/new_set_form.html @@ -8,7 +8,7 @@ then trigger clearNewSetInputs">
-
+
@@ -34,7 +34,7 @@
-
+
@@ -44,7 +44,7 @@ _="on clearNewSetInputs set my.placeholder to ''" {% endif %}>
-
+
@@ -56,7 +56,7 @@
@@ -64,7 +64,7 @@
diff --git a/templates/partials/sparkline.html b/templates/partials/sparkline.html index e6077cf..43220c0 100644 --- a/templates/partials/sparkline.html +++ b/templates/partials/sparkline.html @@ -1,44 +1,46 @@ {% set fill = "#dcfce7" %} {% set stroke = "#bbf7d0" %} {% set stroke_width = 4 %} -{% set margin = 0 %} {# space allocated for axis labels and ticks #} +{% set margin = 2 %} {% macro path(data_points, vb_height) %} {% for value, position, message in data_points %} - {% set x = position * vb_width %} - {% set y = vb_height - value %} + {% set x = (position * vb_width)+margin %} + {% set y = (vb_height - value)+margin %} {% if loop.first %}M{{ x }} {{ y }}{% else %} L{{ x }} {{ y }}{% endif %} {% endfor %} {% endmacro %} {% macro circles(data_points, vb_height) %} {% for value, position, message in data_points %} - {% set x = position * vb_width %} - {% set y = vb_height - value %} + {% set x = (position * vb_width)+margin %} + {% set y = (vb_height - value)+margin %} + add .hidden to #popover-{{ unique_id }}"> + {% endfor %} {% endmacro %} -{% macro closed_path(points, vb_width, vb_height) %} - {{ path(points, vb_width, vb_height) }} L {{ vb_width + 2*margin }} {{ vb_height + 2*margin }} L {{ 2*margin }} {{ vb_height + 2*margin }} Z -{% endmacro %} + +{% macro random_int() %}{% for n in [0,1,2,3,4,5] %}{{ [0,1,2,3,4,5,6,7,8,9]|random }}{% endfor %}{% endmacro %} + + +{% set parts = [random_int()] %} +{% set unique_id = parts|join('-') %}
- + + + {{ circles(data_points, vb_height) }} +
diff --git a/templates/partials/workout_modal.html b/templates/partials/workout_modal.html index 3fd20f2..9fc668c 100644 --- a/templates/partials/workout_modal.html +++ b/templates/partials/workout_modal.html @@ -10,12 +10,12 @@ then remove me then toggle .hide-scrollbar on document.body'> -