Make site even more responsive
This commit is contained in:
@@ -39,7 +39,6 @@ tr.htmx-swapping td {
|
|||||||
border-radius: 8px;
|
border-radius: 8px;
|
||||||
box-shadow: 0px 0px 20px 0px rgba(0,0,0,0.3);
|
box-shadow: 0px 0px 20px 0px rgba(0,0,0,0.3);
|
||||||
background-color: white;
|
background-color: white;
|
||||||
padding: 20px;
|
|
||||||
/* Animate when opening */
|
/* Animate when opening */
|
||||||
animation-name: zoomIn;
|
animation-name: zoomIn;
|
||||||
animation-duration: 150ms;
|
animation-duration: 150ms;
|
||||||
|
|||||||
@@ -8,7 +8,7 @@
|
|||||||
then trigger clearNewSetInputs">
|
then trigger clearNewSetInputs">
|
||||||
|
|
||||||
<div class="flex flex-wrap -mx-3 mb-2" id="new-set-workout-{{ workout_id }}">
|
<div class="flex flex-wrap -mx-3 mb-2" id="new-set-workout-{{ workout_id }}">
|
||||||
<div class="w-full md:w-1/3 px-3 mb-6 md:mb-0">
|
<div class="w-full md:w-1/3 px-2 md:px-3 mb-6 md:mb-0">
|
||||||
<label class="block uppercase tracking-wide text-gray-700 text-xs font-bold mb-2" for="grid-state">
|
<label class="block uppercase tracking-wide text-gray-700 text-xs font-bold mb-2" for="grid-state">
|
||||||
Exercise
|
Exercise
|
||||||
</label>
|
</label>
|
||||||
@@ -34,7 +34,7 @@
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="w-full md:w-1/3 px-3 mb-6 md:mb-0">
|
<div class="w-full md:w-1/3 px-2 md:px-3 mb-6 md:mb-0">
|
||||||
<label class="block uppercase tracking-wide text-gray-700 text-xs font-bold mb-2" for="grid-city">
|
<label class="block uppercase tracking-wide text-gray-700 text-xs font-bold mb-2" for="grid-city">
|
||||||
Reps
|
Reps
|
||||||
</label>
|
</label>
|
||||||
@@ -44,7 +44,7 @@
|
|||||||
_="on clearNewSetInputs set my.placeholder to ''" {% endif %}>
|
_="on clearNewSetInputs set my.placeholder to ''" {% endif %}>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="w-full md:w-1/3 px-3 mb-6 md:mb-0">
|
<div class="w-full md:w-1/3 px-2 md:px-3 mb-6 md:mb-0">
|
||||||
<label class="block uppercase tracking-wide text-gray-700 text-xs font-bold mb-2" for="grid-zip">
|
<label class="block uppercase tracking-wide text-gray-700 text-xs font-bold mb-2" for="grid-zip">
|
||||||
Weight
|
Weight
|
||||||
</label>
|
</label>
|
||||||
@@ -56,7 +56,7 @@
|
|||||||
</div>
|
</div>
|
||||||
<div class="grid grid-cols-1 sm:grid-cols-2 gap-4 pt-2 px-0 sm:px-2">
|
<div class="grid grid-cols-1 sm:grid-cols-2 gap-4 pt-2 px-0 sm:px-2">
|
||||||
<button
|
<button
|
||||||
class="py-2 px-3 mb-3 text-sm font-medium text-center text-gray-900 bg-cyan-600 hover:bg-cyan-700 rounded-lg border border-gray-300 hover:scale-[1.02] transition-transform"
|
class="py-2 px-2 md:px-3 mb-3 text-sm font-medium text-center text-gray-900 bg-cyan-600 hover:bg-cyan-700 rounded-lg border border-gray-300 hover:scale-[1.02] transition-transform"
|
||||||
type="submit">
|
type="submit">
|
||||||
Add top set
|
Add top set
|
||||||
</button>
|
</button>
|
||||||
@@ -64,7 +64,7 @@
|
|||||||
<button hx-confirm="Are you sure you wish to delete this workout?"
|
<button hx-confirm="Are you sure you wish to delete this workout?"
|
||||||
hx-delete="{{ url_for('delete_workout', person_id=person_id, workout_id=workout_id) }}"
|
hx-delete="{{ url_for('delete_workout', person_id=person_id, workout_id=workout_id) }}"
|
||||||
_='on click trigger closeModal'
|
_='on click trigger closeModal'
|
||||||
class="py-2 px-3 mb-3 text-sm font-medium text-center text-gray-900 bg-white rounded-lg border border-gray-300 hover:bg-gray-100 hover:scale-[1.02] transition-transform">Delete
|
class="py-2 px-2 md:px-3 mb-3 text-sm font-medium text-center text-gray-900 bg-white rounded-lg border border-gray-300 hover:bg-gray-100 hover:scale-[1.02] transition-transform">Delete
|
||||||
workout</button>
|
workout</button>
|
||||||
</div>
|
</div>
|
||||||
</form>
|
</form>
|
||||||
|
|||||||
@@ -1,44 +1,46 @@
|
|||||||
{% set fill = "#dcfce7" %}
|
{% set fill = "#dcfce7" %}
|
||||||
{% set stroke = "#bbf7d0" %}
|
{% set stroke = "#bbf7d0" %}
|
||||||
{% set stroke_width = 4 %}
|
{% set stroke_width = 4 %}
|
||||||
{% set margin = 0 %} {# space allocated for axis labels and ticks #}
|
{% set margin = 2 %}
|
||||||
|
|
||||||
{% macro path(data_points, vb_height) %}
|
{% macro path(data_points, vb_height) %}
|
||||||
{% for value, position, message in data_points %}
|
{% for value, position, message in data_points %}
|
||||||
{% set x = position * vb_width %}
|
{% set x = (position * vb_width)+margin %}
|
||||||
{% set y = vb_height - value %}
|
{% set y = (vb_height - value)+margin %}
|
||||||
{% if loop.first %}M{{ x }} {{ y }}{% else %} L{{ x }} {{ y }}{% endif %}
|
{% if loop.first %}M{{ x }} {{ y }}{% else %} L{{ x }} {{ y }}{% endif %}
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
{% endmacro %}
|
{% endmacro %}
|
||||||
|
|
||||||
{% macro circles(data_points, vb_height) %}
|
{% macro circles(data_points, vb_height) %}
|
||||||
{% for value, position, message in data_points %}
|
{% for value, position, message in data_points %}
|
||||||
{% set x = position * vb_width %}
|
{% set x = (position * vb_width)+margin %}
|
||||||
{% set y = vb_height - value %}
|
{% set y = (vb_height - value)+margin %}
|
||||||
<circle cx="{{ x }}" cy="{{ y }}" r="5" class="cursor-pointer" data-message="{{ message }}" fill-opacity="0%"
|
<circle cx="{{ x }}" cy="{{ y }}" r="5" class="cursor-pointer" data-message="{{ message }}" fill-opacity="0%"
|
||||||
_="on mouseover
|
_="on mouseover
|
||||||
put my @data-message into #popover
|
put my @data-message into #popover-{{ unique_id }}
|
||||||
then remove .hidden from #popover
|
then remove .hidden from #popover-{{ unique_id }}
|
||||||
on mouseout
|
on mouseout
|
||||||
add .hidden to #popover">
|
add .hidden to #popover-{{ unique_id }}">
|
||||||
</circle>
|
</circle>
|
||||||
|
<circle cx="{{ x }}" cy="{{ y }}" r="1" stroke="blue" fill="blue"></circle>
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
{% endmacro %}
|
{% endmacro %}
|
||||||
|
|
||||||
{% macro closed_path(points, vb_width, vb_height) %}
|
<!-- HubSpot doesn't escape whitespace. -->
|
||||||
{{ path(points, vb_width, vb_height) }} L {{ vb_width + 2*margin }} {{ vb_height + 2*margin }} L {{ 2*margin }} {{ vb_height + 2*margin }} Z
|
{% 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 %}
|
||||||
{% endmacro %}
|
|
||||||
|
<!-- You have to manually call the macros in a list. -->
|
||||||
|
{% set parts = [random_int()] %}
|
||||||
|
{% set unique_id = parts|join('-') %}
|
||||||
|
|
||||||
<div class="relative">
|
<div class="relative">
|
||||||
<div id="popover" class="absolute t-0 r-0 hidden bg-white border border-gray-300 p-2 z-10">
|
<div id="popover-{{ unique_id }}" class="absolute t-0 r-0 hidden bg-white border border-gray-300 p-2 z-10">
|
||||||
<!-- Popover content will be dynamically inserted here -->
|
<!-- Popover content will be dynamically inserted here -->
|
||||||
</div>
|
</div>
|
||||||
<svg viewBox="0 0 {{ vb_width }} {{ vb_height }}" preserveAspectRatio="none">
|
<svg viewBox="0 0 {{ vb_width + 4 }} {{ vb_height + 4 }}" preserveAspectRatio="none">
|
||||||
|
<path d="{{ path(data_points, vb_height) }}" stroke="blue" fill="none" />
|
||||||
<path d="{{ path(data_points, vb_height) }}" stroke="blue" fill="none" />
|
{{ circles(data_points, vb_height) }}
|
||||||
|
</svg>
|
||||||
{{ circles(data_points, vb_height) }}
|
|
||||||
</svg>
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -10,12 +10,12 @@
|
|||||||
then remove me
|
then remove me
|
||||||
then toggle .hide-scrollbar on document.body'>
|
then toggle .hide-scrollbar on document.body'>
|
||||||
<div class='modal-underlay' _='on click trigger closeModal'></div>
|
<div class='modal-underlay' _='on click trigger closeModal'></div>
|
||||||
<div class='modal-content m-4 sm:mt-24 max-h-[95%]' _='init toggle .hide-scrollbar on document.body'>
|
<div class='modal-content p-2 md:p-4 m-2 sm:mt-24 max-h-[98%]' _='init toggle .hide-scrollbar on document.body'>
|
||||||
<div class="relative w-full h-full max-w-2xl md:h-auto overflow-auto">
|
<div class="relative w-full h-full max-w-2xl md:h-auto overflow-auto">
|
||||||
<!-- Modal content -->
|
<!-- Modal content -->
|
||||||
<div class="relative bg-white rounded-lg shadow">
|
<div class="relative bg-white rounded-lg shadow">
|
||||||
<!-- Modal header -->
|
<!-- Modal header -->
|
||||||
<div class="flex items-start justify-between p-4 border-b rounded-t">
|
<div class="flex items-start justify-between p-2 md:p-4 border-0 md:border-b rounded-t">
|
||||||
<div class="flex flex-col w-full">
|
<div class="flex flex-col w-full">
|
||||||
<div class="flex items-center justify-between">
|
<div class="flex items-center justify-between">
|
||||||
<div class="w-full">
|
<div class="w-full">
|
||||||
@@ -59,7 +59,7 @@
|
|||||||
|
|
||||||
</div>
|
</div>
|
||||||
<!-- Modal body -->
|
<!-- Modal body -->
|
||||||
<div class="p-6 space-y-6">
|
<div class="p-3 md:p-6 space-y-6">
|
||||||
<table class="items-center w-full bg-transparent border-collapse table-fixed">
|
<table class="items-center w-full bg-transparent border-collapse table-fixed">
|
||||||
<thead>
|
<thead>
|
||||||
<tr>
|
<tr>
|
||||||
@@ -94,7 +94,7 @@
|
|||||||
{% endif %}
|
{% endif %}
|
||||||
</div>
|
</div>
|
||||||
<!-- Modal footer -->
|
<!-- Modal footer -->
|
||||||
<div class="flex items-center p-6 space-x-2 border-t border-gray-200 rounded-b dark:border-gray-600">
|
<div class="flex items-center p-3 md:p-6 space-x-2 border-t border-gray-200 rounded-b dark:border-gray-600">
|
||||||
{{ render_partial('partials/new_set_form.html', person_id=workout['PersonId'],
|
{{ render_partial('partials/new_set_form.html', person_id=workout['PersonId'],
|
||||||
workout_id=workout['WorkoutId'],
|
workout_id=workout['WorkoutId'],
|
||||||
exercises=exercises,
|
exercises=exercises,
|
||||||
|
|||||||
Reference in New Issue
Block a user