Skip to content

Commit 96a7f36

Browse files
committed
put stickman above start at the beginning + finish line instead of conclusion
1 parent 507ac12 commit 96a7f36

2 files changed

Lines changed: 14 additions & 4 deletions

File tree

website/index.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -318,7 +318,7 @@ <h2>What would a fair distribution of Olympic medals look like?</h2>
318318
</div>
319319

320320
<div class="section" data-anchor="conclusion">
321-
<h2>Conclusion</h2>
321+
<h2>Finish line</h2>
322322

323323
<div class="intro-columns">
324324
<div class="intro-column">

website/js/race-navigation.js

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,7 @@
109109
checkpoint.style.setProperty("--side-path-width", `${sidePathWidth}px`);
110110

111111
checkpoint.innerHTML = `
112-
<span class="race-dot"></span>
112+
${index === 0 ? "" : `<span class="race-dot"></span>`}
113113
${sideDots}
114114
<span class="race-label">${section.label}</span>
115115
`;
@@ -149,7 +149,10 @@
149149

150150
const progress = getProgressPercent(safeSectionIndex);
151151

152-
nav.style.setProperty("--race-progress", `${progress}%`);
152+
// title page should not fill the line
153+
const lineProgress = safeSectionIndex === 0 ? 0 : progress;
154+
155+
nav.style.setProperty("--race-progress", `${lineProgress}%`);
153156

154157
updateRunner(nav, currentSection, progress, safeSlideIndex);
155158
updateNavClasses(nav, currentSection, safeSectionIndex, direction);
@@ -213,7 +216,14 @@
213216

214217
function getProgressPercent(index) {
215218
if (state.sections.length <= 1) return 0;
216-
return (index / (state.sections.length - 1)) * 100;
219+
220+
// title page: keep runner above start line
221+
if (index === 0) {
222+
return -10;
223+
}
224+
225+
// start from Introduction section
226+
return ((index - 1) / (state.sections.length - 2)) * 100;
217227
}
218228

219229
function clamp(value, min, max) {

0 commit comments

Comments
 (0)