Skip to content

Commit 32f9e69

Browse files
Merge pull request #111 from borgbackup/fix-counters-nojs
index2: fix bottom counters showing wrong values without JS
2 parents 5f8f1b3 + df188f2 commit 32f9e69

1 file changed

Lines changed: 6 additions & 4 deletions

File tree

index2.html

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1125,9 +1125,9 @@ <h2>Trusted by sysadmins, hoarders and the merely paranoid.</h2>
11251125
<p class="lead">Borg has protected production servers, research data and family photo
11261126
archives for a decade. It is boring, in the best possible way.</p>
11271127
<div class="counters">
1128-
<div class="counter"><div class="num"><span aria-hidden="true"><span data-count="10">0</span>+</span><span class="sr-only">10+</span></div><div class="what">years of development</div></div>
1129-
<div class="counter"><div class="num"><span aria-hidden="true"><span data-count="100">0</span>%</span><span class="sr-only">100%</span></div><div class="what">free software, BSD licensed</div></div>
1130-
<div class="counter"><div class="num"><span aria-hidden="true"><span data-count="0">7</span></span><span class="sr-only">0</span></div><div class="what">trust required in your server</div></div>
1128+
<div class="counter"><div class="num"><span aria-hidden="true"><span data-count="10" data-count-from="0">10</span>+</span><span class="sr-only">10+</span></div><div class="what">years of development</div></div>
1129+
<div class="counter"><div class="num"><span aria-hidden="true"><span data-count="100" data-count-from="0">100</span>%</span><span class="sr-only">100%</span></div><div class="what">free software, BSD licensed</div></div>
1130+
<div class="counter"><div class="num"><span aria-hidden="true"><span data-count="0" data-count-from="7">0</span></span><span class="sr-only">0</span></div><div class="what">trust required in your server</div></div>
11311131
</div>
11321132
</section>
11331133

@@ -1508,7 +1508,9 @@ <h2>Trusted by sysadmins, hoarders and the merely paranoid.</h2>
15081508
// counters
15091509
document.querySelectorAll('[data-count]').forEach((el) => {
15101510
const target = parseInt(el.dataset.count, 10);
1511-
const obj = { v: el.textContent === '7' ? 7 : 0 };
1511+
const from = parseInt(el.dataset.countFrom, 10);
1512+
const obj = { v: from };
1513+
el.textContent = from;
15121514
gsap.to(obj, {
15131515
v: target, duration: 1.6, ease: 'power1.out',
15141516
scrollTrigger: { trigger: el, start: 'top 85%' },

0 commit comments

Comments
 (0)