Skip to content

Commit 1695934

Browse files
update mobile styles
1 parent 5b7837a commit 1695934

File tree

3 files changed

+57
-3
lines changed

3 files changed

+57
-3
lines changed

src/components/Timeline.js

Lines changed: 21 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,30 @@
1-
import { createMemo, Show, createSignal, onMount } from "solid-js";
1+
import { createMemo, Show, createSignal, onMount, onCleanup } from "solid-js";
22
import { formatTime } from "../util";
33
import MarkerDetails from "./MarkerDetails";
44

55
export default (props) => {
6-
const [isVisible, setIsVisible] = createSignal(true);
6+
// Check if we're on a mobile device (width <= 768px)
7+
const isMobile = () => window.innerWidth <= 768;
8+
9+
// Initialize visibility based on device type
10+
const [isVisible, setIsVisible] = createSignal(!isMobile());
711
const [isTransitioning, setIsTransitioning] = createSignal(false);
812

13+
// Handle window resize
14+
const handleResize = () => {
15+
if (isMobile()) {
16+
setIsVisible(false);
17+
}
18+
};
19+
20+
onMount(() => {
21+
window.addEventListener('resize', handleResize);
22+
});
23+
24+
onCleanup(() => {
25+
window.removeEventListener('resize', handleResize);
26+
});
27+
928
const markers = createMemo(() =>
1029
typeof props.duration === "number" ? props.markers.filter((m) => m[0] < props.duration) : [],
1130
);

src/less/partials/_player.less

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ div.ap-wrapper {
6767
position: relative;
6868
background-color: var(--term-color-background);
6969
color: var(--term-color-foreground);
70-
font-family: @monospace;
70+
font-family: Consolas, Menlo, 'Bitstream Vera Sans Mono', monospace;
7171
font-size: 15px;
7272
line-height: 1;
7373
box-sizing: content-box;
@@ -136,4 +136,9 @@ div.ap-wrapper {
136136
.fg-8, .fg-9, .fg-10, .fg-11, .fg-12, .fg-13, .fg-14, .fg-15 {
137137
font-weight: bold;
138138
}
139+
140+
// Mobile styles
141+
@media (max-width: 768px) {
142+
font-size: 13px !important;
143+
}
139144
}

src/less/partials/_timeline.less

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -165,6 +165,36 @@
165165
font-weight: bold;
166166
}
167167
}
168+
169+
// Mobile styles
170+
@media (max-width: 768px) {
171+
width: 85% !important;
172+
max-width: 300px;
173+
174+
.ap-timeline-header {
175+
font-size: 14px;
176+
padding: 8px;
177+
}
178+
179+
.ap-marker-details {
180+
font-size: 11px;
181+
padding: 8px;
182+
183+
.ap-marker-header h3 {
184+
font-size: 13px;
185+
}
186+
187+
.ap-marker-section {
188+
h4 {
189+
font-size: 11px;
190+
}
191+
192+
code {
193+
font-size: 10px;
194+
}
195+
}
196+
}
197+
}
168198
}
169199

170200
@keyframes fadeIn {

0 commit comments

Comments
 (0)