Skip to content

Commit 4c327fd

Browse files
VolksRat71claude
andcommitted
Fix mobile scroll animations and StepNav centering
- Fix StepNav centering at 500-617px viewport widths - Add progressive media query breakpoints (700px, 600px, 480px, 380px) - Change justify-content from flex-start to center at mobile widths - Add missing scroll selectors for all step components: - .exploit-flow for Exploit step network phase - .code-diff-container, .lessons-grid for browser targets - .vulnerable-code, .remediation-section, .resources-section for explanation targets 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
1 parent 7efab03 commit 4c327fd

2 files changed

Lines changed: 59 additions & 15 deletions

File tree

‎src/lib/components/StepNav.svelte‎

Lines changed: 56 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -120,6 +120,28 @@
120120
flex-shrink: 0;
121121
}
122122
123+
/* Medium mobile: keep centered, reduce sizes */
124+
@media (max-width: 700px) {
125+
.step-btn {
126+
min-width: 75px;
127+
padding: 0.4rem 0.5rem;
128+
}
129+
130+
.step-num {
131+
width: 20px;
132+
height: 20px;
133+
font-size: 0.65rem;
134+
}
135+
136+
.step-label {
137+
font-size: 0.6rem;
138+
}
139+
140+
.step-connector {
141+
width: 12px;
142+
}
143+
}
144+
123145
/* Mobile: horizontal scroll with smaller buttons */
124146
@media (max-width: 600px) {
125147
.step-nav {
@@ -128,43 +150,65 @@
128150
}
129151
130152
.step-indicators {
131-
justify-content: flex-start;
153+
justify-content: center;
132154
padding: 0 0.25rem;
133155
}
134156
135157
.step-btn {
136-
min-width: 70px;
137-
padding: 0.4rem 0.5rem;
158+
min-width: 65px;
159+
padding: 0.35rem 0.4rem;
138160
}
139161
140162
.step-num {
141-
width: 20px;
142-
height: 20px;
143-
font-size: 0.65rem;
163+
width: 18px;
164+
height: 18px;
165+
font-size: 0.6rem;
144166
}
145167
146168
.step-label {
147-
font-size: 0.6rem;
169+
font-size: 0.55rem;
148170
}
149171
150172
.step-connector {
151-
width: 12px;
173+
width: 8px;
174+
}
175+
}
176+
177+
/* Narrow mobile: extra compact */
178+
@media (max-width: 480px) {
179+
.step-btn {
180+
min-width: 55px;
181+
padding: 0.3rem 0.35rem;
182+
}
183+
184+
.step-label {
185+
font-size: 0.5rem;
186+
}
187+
188+
.step-connector {
189+
width: 6px;
152190
}
153191
}
154192
155193
/* Very small screens: even more compact */
156194
@media (max-width: 380px) {
157195
.step-btn {
158-
min-width: 60px;
159-
padding: 0.35rem 0.4rem;
196+
min-width: 48px;
197+
padding: 0.25rem 0.3rem;
160198
}
161199
162-
.step-label {
200+
.step-num {
201+
width: 16px;
202+
height: 16px;
163203
font-size: 0.55rem;
164204
}
165205
206+
.step-label {
207+
font-size: 0.45rem;
208+
}
209+
166210
.step-connector {
167-
width: 8px;
211+
width: 4px;
168212
}
169213
}
170214
</style>

‎src/lib/utils/autoScroll.ts‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -39,10 +39,10 @@ export function getScrollTargetElement(
3939
if (!container) return null;
4040

4141
const selectors: Record<ScrollTarget, string> = {
42-
browser: '.client-side, .render-side:first-child, .attacker-entity',
43-
network: '.data-flow-column, .flight-channel',
42+
browser: '.client-side, .render-side:first-child, .attacker-entity, .code-diff-container, .lessons-grid',
43+
network: '.data-flow-column, .flight-channel, .exploit-flow',
4444
server: '.server-side, .render-side:last-child, .server-entity',
45-
explanation: '.explanation-panel, .impact-section, .comparison-summary',
45+
explanation: '.explanation-panel, .impact-section, .comparison-summary, .vulnerable-code, .remediation-section, .resources-section',
4646
controls: '.video-controls, .timeline-container'
4747
};
4848

0 commit comments

Comments
 (0)