Skip to content

Commit 8984b81

Browse files
committed
fixed bug, toggle was falling behind featured in mobile
1 parent 54e54b4 commit 8984b81

4 files changed

Lines changed: 5 additions & 14 deletions

File tree

assets/css/extended/custom.css

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515
body:has(#shepherd-bg) .main {
1616
position: relative;
1717
overflow: hidden;
18+
padding-bottom: 50px; /* extends iframe below featured-section so toggle has clear space */
1819
}
1920

2021
/* Profile card and featured posts sit above the iframe */

config.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ minify:
6565
params:
6666

6767
homeInfoParams:
68-
Title: P Travis Jardine
68+
Title: tangents
6969
Content: on technology, artificial intelligence, and other things
7070

7171
assets:

static/web_shepherd_local/style.css

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -106,8 +106,6 @@ canvas {
106106
color: var(--color-label-inactive);
107107
transition: color 0.2s;
108108
user-select: none;
109-
padding: 6px 0;
110-
touch-action: manipulation;
111109
}
112110

113111
.three-way-toggle[data-pos="0"] .three-way-labels span:nth-child(1),

static/web_shepherd_local/ui.js

Lines changed: 3 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -79,19 +79,11 @@ function initCursorModeToggle() {
7979

8080
slider.addEventListener('click', (e) => applyToggle(e.target));
8181

82-
slider.addEventListener('touchstart', (e) => {
83-
e.preventDefault(); // block scroll and synthesized mouse events
84-
}, { passive: false });
85-
8682
slider.addEventListener('touchend', (e) => {
87-
e.preventDefault();
83+
e.preventDefault(); // prevent synthesized click + 300ms delay
8884
const touch = e.changedTouches[0];
89-
const rect = slider.getBoundingClientRect();
90-
const x = touch.clientX - rect.left;
91-
const third = rect.width / 3;
92-
const idx = x < third ? 0 : x < third * 2 ? 1 : 2;
93-
slider.dataset.pos = String(idx);
94-
cursorMode = modes[idx];
85+
const el = document.elementFromPoint(touch.clientX, touch.clientY);
86+
if (el) applyToggle(el);
9587
});
9688
}
9789

0 commit comments

Comments
 (0)