Skip to content

Commit

Permalink
Deploying to gh-pages from @ cf18037 🚀
Browse files Browse the repository at this point in the history
  • Loading branch information
trovster committed Oct 5, 2023
1 parent 809db3c commit f92bfc5
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 1 deletion.
8 changes: 8 additions & 0 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -133,6 +133,7 @@ <h1 class="tracking-tight leading-none font-display font-black text-4xl md:text-
<fitness-card
class="overflow-hidden rounded-3xl mx-auto bg-gray-800 text-white max-w-3xl"
date="Monday, 25 September 2023"
replayable="true"
steps="10639" distance="8964" flights="8"
move-total="500" move-goal="750"
exercise-total="30" exercise-goal="60"
Expand All @@ -157,6 +158,7 @@ <h1 class="tracking-tight leading-none font-display font-black text-4xl md:text-
<fitness-card
class="overflow-hidden rounded-3xl mx-auto bg-gray-800 text-white max-w-3xl"
date="Tuesday, 26 September 2023"
replayable="true"
steps="18935" distance="16254" flights="5"
move-total="1002" move-goal="1200"
exercise-total="76" exercise-goal="120"
Expand All @@ -181,6 +183,7 @@ <h1 class="tracking-tight leading-none font-display font-black text-4xl md:text-
<fitness-card
class="overflow-hidden rounded-3xl mx-auto bg-gray-800 text-white max-w-3xl"
date="Wednesday, 27 September 2023"
replayable="true"
steps="700" distance="1200" flights="3"
move-total="412" move-goal="650"
exercise-total="12" exercise-goal="30"
Expand All @@ -205,6 +208,7 @@ <h1 class="tracking-tight leading-none font-display font-black text-4xl md:text-
<fitness-card
class="overflow-hidden rounded-3xl mx-auto bg-gray-800 text-white max-w-3xl"
date="Thursday, 28 September 2023"
replayable="true"
steps="650" distance="650" flights="4"
move-total="600" move-goal="650"
exercise-total="28" exercise-goal="30"
Expand All @@ -229,6 +233,7 @@ <h1 class="tracking-tight leading-none font-display font-black text-4xl md:text-
<fitness-card
class="overflow-hidden rounded-3xl mx-auto bg-gray-800 text-white max-w-3xl"
date="Friday, 29 September 2023"
replayable="true"
steps="6523" distance="3650" flights="8"
move-total="1024" move-goal="650"
exercise-total="71" exercise-goal="30"
Expand All @@ -253,6 +258,7 @@ <h1 class="tracking-tight leading-none font-display font-black text-4xl md:text-
<fitness-card
class="overflow-hidden rounded-3xl mx-auto bg-gray-800 text-white max-w-3xl"
date="Saturday, 30 September 2023"
replayable="true"
steps="700" distance="1200" flights="3"
move-total="412" move-goal="650"
exercise-total="12" exercise-goal="30"
Expand All @@ -277,6 +283,7 @@ <h1 class="tracking-tight leading-none font-display font-black text-4xl md:text-
<fitness-card
class="overflow-hidden rounded-3xl mx-auto bg-gray-800 text-white max-w-3xl"
date="Sunday, 1 October 2023"
replayable="true"
steps="756" distance="4345" flights="4"
move-total="680" move-goal="750"
exercise-total="35" exercise-goal="60"
Expand Down Expand Up @@ -321,6 +328,7 @@ <h2 class="tracking-tight leading-none font-display font-bold text-center text-4

<span class="token tag"><span class="token tag"><span class="token punctuation">&lt;</span>fitness-card</span>
<span class="token attr-name">date</span><span class="token attr-value"><span class="token punctuation attr-equals">=</span><span class="token punctuation">"</span>item.date<span class="token punctuation">"</span></span>
<span class="token attr-name">replayable</span><span class="token attr-value"><span class="token punctuation attr-equals">=</span><span class="token punctuation">"</span>true<span class="token punctuation">"</span></span>
<span class="token attr-name">steps</span><span class="token attr-value"><span class="token punctuation attr-equals">=</span><span class="token punctuation">"</span>item.steps<span class="token punctuation">"</span></span> <span class="token attr-name">distance</span><span class="token attr-value"><span class="token punctuation attr-equals">=</span><span class="token punctuation">"</span>item.distance<span class="token punctuation">"</span></span> <span class="token attr-name">flights</span><span class="token attr-value"><span class="token punctuation attr-equals">=</span><span class="token punctuation">"</span>item.flights<span class="token punctuation">"</span></span>
<span class="token attr-name">move-total</span><span class="token attr-value"><span class="token punctuation attr-equals">=</span><span class="token punctuation">"</span>item.move.total<span class="token punctuation">"</span></span> <span class="token attr-name">move-goal</span><span class="token attr-value"><span class="token punctuation attr-equals">=</span><span class="token punctuation">"</span>item.move.goal<span class="token punctuation">"</span></span>
<span class="token attr-name">exercise-total</span><span class="token attr-value"><span class="token punctuation attr-equals">=</span><span class="token punctuation">"</span>item.exercise.total<span class="token punctuation">"</span></span> <span class="token attr-name">exercise-goal</span><span class="token attr-value"><span class="token punctuation attr-equals">=</span><span class="token punctuation">"</span>item.exercise.goal<span class="token punctuation">"</span></span>
Expand Down
1 change: 1 addition & 0 deletions js/FitnessCard.js
Original file line number Diff line number Diff line change
Expand Up @@ -348,6 +348,7 @@ export default class FitnessCard extends HTMLElement {
<fitness-ring
part="ring"
replayable="${this.getAttribute('replayable')}"
move-total="${this.getAttribute('move-total')}"
move-goal="${this.getAttribute('move-goal')}"
exercise-total="${this.getAttribute('exercise-total')}"
Expand Down
4 changes: 3 additions & 1 deletion js/FitnessRing.js
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ export default class FitnessRing extends HTMLElement {
}

wrapper.addEventListener('click', () => {
if (wrapper.classList.contains('complete')) {
if (this.replayable() && wrapper.classList.contains('complete')) {
wrapper.classList.add('reset');
wrapper.classList.remove('complete');
}
Expand All @@ -67,6 +67,8 @@ export default class FitnessRing extends HTMLElement {
this.observer.disconnect();
}

replayable =() => this.getAttribute('replayable') && this.getAttribute('replayable') === 'true';

percentage = (total = 0, goal = 100, max = 100) =>
Math.min(Math.floor((total / goal) * 100), max);

Expand Down

0 comments on commit f92bfc5

Please sign in to comment.