Skip to content

Commit cf93b1c

Browse files
author
Dominik Schröder
committed
layout improvement
1 parent c67e1d5 commit cf93b1c

File tree

9 files changed

+98
-80
lines changed

9 files changed

+98
-80
lines changed

src/app/layout.tsx

+35-35
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ export default async function RootLayout({
4242
<link rel="manifest" href="/site.webmanifest" />
4343
<link
4444
rel="apple-touch-icon"
45-
href="apple-icon-180.png"
45+
href="/apple-icon-180.png"
4646
/>
4747

4848
<meta
@@ -52,172 +52,172 @@ export default async function RootLayout({
5252

5353
<link
5454
rel="apple-touch-startup-image"
55-
href="apple-splash-2048-2732.jpg"
55+
href="/apple-splash-2048-2732.jpg"
5656
media="(device-width: 1024px) and (device-height: 1366px) and (-webkit-device-pixel-ratio: 2) and (orientation: portrait)"
5757
/>
5858
<link
5959
rel="apple-touch-startup-image"
60-
href="apple-splash-2732-2048.jpg"
60+
href="/apple-splash-2732-2048.jpg"
6161
media="(device-width: 1024px) and (device-height: 1366px) and (-webkit-device-pixel-ratio: 2) and (orientation: landscape)"
6262
/>
6363
<link
6464
rel="apple-touch-startup-image"
65-
href="apple-splash-1668-2388.jpg"
65+
href="/apple-splash-1668-2388.jpg"
6666
media="(device-width: 834px) and (device-height: 1194px) and (-webkit-device-pixel-ratio: 2) and (orientation: portrait)"
6767
/>
6868
<link
6969
rel="apple-touch-startup-image"
70-
href="apple-splash-2388-1668.jpg"
70+
href="/apple-splash-2388-1668.jpg"
7171
media="(device-width: 834px) and (device-height: 1194px) and (-webkit-device-pixel-ratio: 2) and (orientation: landscape)"
7272
/>
7373
<link
7474
rel="apple-touch-startup-image"
75-
href="apple-splash-1536-2048.jpg"
75+
href="/apple-splash-1536-2048.jpg"
7676
media="(device-width: 768px) and (device-height: 1024px) and (-webkit-device-pixel-ratio: 2) and (orientation: portrait)"
7777
/>
7878
<link
7979
rel="apple-touch-startup-image"
80-
href="apple-splash-2048-1536.jpg"
80+
href="/apple-splash-2048-1536.jpg"
8181
media="(device-width: 768px) and (device-height: 1024px) and (-webkit-device-pixel-ratio: 2) and (orientation: landscape)"
8282
/>
8383
<link
8484
rel="apple-touch-startup-image"
85-
href="apple-splash-1488-2266.jpg"
85+
href="/apple-splash-1488-2266.jpg"
8686
media="(device-width: 744px) and (device-height: 1133px) and (-webkit-device-pixel-ratio: 2) and (orientation: portrait)"
8787
/>
8888
<link
8989
rel="apple-touch-startup-image"
90-
href="apple-splash-2266-1488.jpg"
90+
href="/apple-splash-2266-1488.jpg"
9191
media="(device-width: 744px) and (device-height: 1133px) and (-webkit-device-pixel-ratio: 2) and (orientation: landscape)"
9292
/>
9393
<link
9494
rel="apple-touch-startup-image"
95-
href="apple-splash-1640-2360.jpg"
95+
href="/apple-splash-1640-2360.jpg"
9696
media="(device-width: 820px) and (device-height: 1180px) and (-webkit-device-pixel-ratio: 2) and (orientation: portrait)"
9797
/>
9898
<link
9999
rel="apple-touch-startup-image"
100-
href="apple-splash-2360-1640.jpg"
100+
href="/apple-splash-2360-1640.jpg"
101101
media="(device-width: 820px) and (device-height: 1180px) and (-webkit-device-pixel-ratio: 2) and (orientation: landscape)"
102102
/>
103103
<link
104104
rel="apple-touch-startup-image"
105-
href="apple-splash-1668-2224.jpg"
105+
href="/apple-splash-1668-2224.jpg"
106106
media="(device-width: 834px) and (device-height: 1112px) and (-webkit-device-pixel-ratio: 2) and (orientation: portrait)"
107107
/>
108108
<link
109109
rel="apple-touch-startup-image"
110-
href="apple-splash-2224-1668.jpg"
110+
href="/apple-splash-2224-1668.jpg"
111111
media="(device-width: 834px) and (device-height: 1112px) and (-webkit-device-pixel-ratio: 2) and (orientation: landscape)"
112112
/>
113113
<link
114114
rel="apple-touch-startup-image"
115-
href="apple-splash-1620-2160.jpg"
115+
href="/apple-splash-1620-2160.jpg"
116116
media="(device-width: 810px) and (device-height: 1080px) and (-webkit-device-pixel-ratio: 2) and (orientation: portrait)"
117117
/>
118118
<link
119119
rel="apple-touch-startup-image"
120-
href="apple-splash-2160-1620.jpg"
120+
href="/apple-splash-2160-1620.jpg"
121121
media="(device-width: 810px) and (device-height: 1080px) and (-webkit-device-pixel-ratio: 2) and (orientation: landscape)"
122122
/>
123123
<link
124124
rel="apple-touch-startup-image"
125-
href="apple-splash-1290-2796.jpg"
125+
href="/apple-splash-1290-2796.jpg"
126126
media="(device-width: 430px) and (device-height: 932px) and (-webkit-device-pixel-ratio: 3) and (orientation: portrait)"
127127
/>
128128
<link
129129
rel="apple-touch-startup-image"
130-
href="apple-splash-2796-1290.jpg"
130+
href="/apple-splash-2796-1290.jpg"
131131
media="(device-width: 430px) and (device-height: 932px) and (-webkit-device-pixel-ratio: 3) and (orientation: landscape)"
132132
/>
133133
<link
134134
rel="apple-touch-startup-image"
135-
href="apple-splash-1179-2556.jpg"
135+
href="/apple-splash-1179-2556.jpg"
136136
media="(device-width: 393px) and (device-height: 852px) and (-webkit-device-pixel-ratio: 3) and (orientation: portrait)"
137137
/>
138138
<link
139139
rel="apple-touch-startup-image"
140-
href="apple-splash-2556-1179.jpg"
140+
href="/apple-splash-2556-1179.jpg"
141141
media="(device-width: 393px) and (device-height: 852px) and (-webkit-device-pixel-ratio: 3) and (orientation: landscape)"
142142
/>
143143
<link
144144
rel="apple-touch-startup-image"
145-
href="apple-splash-1284-2778.jpg"
145+
href="/apple-splash-1284-2778.jpg"
146146
media="(device-width: 428px) and (device-height: 926px) and (-webkit-device-pixel-ratio: 3) and (orientation: portrait)"
147147
/>
148148
<link
149149
rel="apple-touch-startup-image"
150-
href="apple-splash-2778-1284.jpg"
150+
href="/apple-splash-2778-1284.jpg"
151151
media="(device-width: 428px) and (device-height: 926px) and (-webkit-device-pixel-ratio: 3) and (orientation: landscape)"
152152
/>
153153
<link
154154
rel="apple-touch-startup-image"
155-
href="apple-splash-1170-2532.jpg"
155+
href="/apple-splash-1170-2532.jpg"
156156
media="(device-width: 390px) and (device-height: 844px) and (-webkit-device-pixel-ratio: 3) and (orientation: portrait)"
157157
/>
158158
<link
159159
rel="apple-touch-startup-image"
160-
href="apple-splash-2532-1170.jpg"
160+
href="/apple-splash-2532-1170.jpg"
161161
media="(device-width: 390px) and (device-height: 844px) and (-webkit-device-pixel-ratio: 3) and (orientation: landscape)"
162162
/>
163163
<link
164164
rel="apple-touch-startup-image"
165-
href="apple-splash-1125-2436.jpg"
165+
href="/apple-splash-1125-2436.jpg"
166166
media="(device-width: 375px) and (device-height: 812px) and (-webkit-device-pixel-ratio: 3) and (orientation: portrait)"
167167
/>
168168
<link
169169
rel="apple-touch-startup-image"
170-
href="apple-splash-2436-1125.jpg"
170+
href="/apple-splash-2436-1125.jpg"
171171
media="(device-width: 375px) and (device-height: 812px) and (-webkit-device-pixel-ratio: 3) and (orientation: landscape)"
172172
/>
173173
<link
174174
rel="apple-touch-startup-image"
175-
href="apple-splash-1242-2688.jpg"
175+
href="/apple-splash-1242-2688.jpg"
176176
media="(device-width: 414px) and (device-height: 896px) and (-webkit-device-pixel-ratio: 3) and (orientation: portrait)"
177177
/>
178178
<link
179179
rel="apple-touch-startup-image"
180-
href="apple-splash-2688-1242.jpg"
180+
href="/apple-splash-2688-1242.jpg"
181181
media="(device-width: 414px) and (device-height: 896px) and (-webkit-device-pixel-ratio: 3) and (orientation: landscape)"
182182
/>
183183
<link
184184
rel="apple-touch-startup-image"
185-
href="apple-splash-828-1792.jpg"
185+
href="/apple-splash-828-1792.jpg"
186186
media="(device-width: 414px) and (device-height: 896px) and (-webkit-device-pixel-ratio: 2) and (orientation: portrait)"
187187
/>
188188
<link
189189
rel="apple-touch-startup-image"
190-
href="apple-splash-1792-828.jpg"
190+
href="/apple-splash-1792-828.jpg"
191191
media="(device-width: 414px) and (device-height: 896px) and (-webkit-device-pixel-ratio: 2) and (orientation: landscape)"
192192
/>
193193
<link
194194
rel="apple-touch-startup-image"
195-
href="apple-splash-1242-2208.jpg"
195+
href="/apple-splash-1242-2208.jpg"
196196
media="(device-width: 414px) and (device-height: 736px) and (-webkit-device-pixel-ratio: 3) and (orientation: portrait)"
197197
/>
198198
<link
199199
rel="apple-touch-startup-image"
200-
href="apple-splash-2208-1242.jpg"
200+
href="/apple-splash-2208-1242.jpg"
201201
media="(device-width: 414px) and (device-height: 736px) and (-webkit-device-pixel-ratio: 3) and (orientation: landscape)"
202202
/>
203203
<link
204204
rel="apple-touch-startup-image"
205-
href="apple-splash-750-1334.jpg"
205+
href="/apple-splash-750-1334.jpg"
206206
media="(device-width: 375px) and (device-height: 667px) and (-webkit-device-pixel-ratio: 2) and (orientation: portrait)"
207207
/>
208208
<link
209209
rel="apple-touch-startup-image"
210-
href="apple-splash-1334-750.jpg"
210+
href="/apple-splash-1334-750.jpg"
211211
media="(device-width: 375px) and (device-height: 667px) and (-webkit-device-pixel-ratio: 2) and (orientation: landscape)"
212212
/>
213213
<link
214214
rel="apple-touch-startup-image"
215-
href="apple-splash-640-1136.jpg"
215+
href="/apple-splash-640-1136.jpg"
216216
media="(device-width: 320px) and (device-height: 568px) and (-webkit-device-pixel-ratio: 2) and (orientation: portrait)"
217217
/>
218218
<link
219219
rel="apple-touch-startup-image"
220-
href="apple-splash-1136-640.jpg"
220+
href="/apple-splash-1136-640.jpg"
221221
media="(device-width: 320px) and (device-height: 568px) and (-webkit-device-pixel-ratio: 2) and (orientation: landscape)"
222222
/>
223223
<Analytics />

src/app/map/page.tsx

+19-29
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ import {
77
type FC,
88
type RefObject,
99
createRef,
10+
useEffect,
1011
} from "react";
1112

1213
import {IconButton, Paper} from "@mui/material";
@@ -17,14 +18,22 @@ import ReactMapGL, {
1718
NavigationControl,
1819
GeolocateControl,
1920
FullscreenControl,
20-
useControl,
2121
Layer,
2222
Source,
23-
type ControlPosition,
2423
type MapRef,
25-
useMap,
24+
type SkyLayer,
2625
} from "react-map-gl";
2726

27+
const skyLayer: SkyLayer = {
28+
id: "sky",
29+
type: "sky",
30+
paint: {
31+
"sky-type": "atmosphere",
32+
"sky-atmosphere-sun": [0.0, 0.0],
33+
"sky-atmosphere-sun-intensity": 15,
34+
},
35+
};
36+
2837
import Overlay from "~/components/Map/Overlay";
2938

3039
import "mapbox-gl/dist/mapbox-gl.css";
@@ -39,36 +48,13 @@ import {categorySettings} from "~/settings/category";
3948
import {listSettings} from "~/settings/list";
4049

4150
import {Download} from "~/components/Map/DownloadControl";
42-
import {SelectionControl} from "~/components/Map/SelectionControl";
51+
import {Selection} from "~/components/Map/SelectionControl";
4352
import {LayerSwitcher} from "~/components/Map/LayerSwitcher";
4453
import type {Activity} from "~/server/db/schema";
4554
import {MapContextValue} from "react-map-gl/dist/esm/components/map";
4655
import PhotoLayer from "~/components/Map/Photo";
47-
import {
48-
Camera,
49-
CameraAlt,
50-
CameraFront,
51-
} from "@mui/icons-material";
52-
import mapboxgl from "mapbox-gl";
53-
54-
function Selection() {
55-
const {setSelected} = useStore((state) => ({
56-
setSelected: state.setSelected,
57-
}));
58-
59-
useControl(
60-
(context: MapContextValue) =>
61-
new SelectionControl({
62-
context,
63-
layers: ["routeLayerBG", "routeLayerBGsel"],
64-
source: "routeSource",
65-
selectionHandler: (sel: number[]) => {
66-
setSelected(Array.from(new Set(sel)));
67-
},
68-
})
69-
);
70-
return null;
71-
}
56+
import {CameraAlt} from "@mui/icons-material";
57+
import mapboxgl, {MapboxEvent} from "mapbox-gl";
7258

7359
function RouteLayer() {
7460
const {filterIDs} = useStore((state) => ({
@@ -223,6 +209,7 @@ function Map() {
223209
const mapRefLoc = createRef<MapRef>();
224210

225211
const loaded = useStore((state) => state.loaded);
212+
const [terrain, setTerrain] = useState(false);
226213
const [viewport, setViewport] = useState(mapPosition);
227214

228215
const overlayMaps = useMemo(
@@ -290,6 +277,8 @@ function Map() {
290277
);
291278
}
292279
}}
280+
optimizeForTerrain={true}
281+
onLoad={(event: MapboxEvent) => console.log(event)}
293282
projection={
294283
"globe" as unknown as mapboxgl.Projection
295284
}
@@ -335,6 +324,7 @@ function Map() {
335324
tileSize={512}
336325
maxzoom={14}
337326
/>
327+
<Layer {...skyLayer} />
338328
<NavigationControl position="top-right" />
339329
<GeolocateControl position="top-right" />
340330
<FullscreenControl position="top-right" />

src/app/stats/[name]/layout.tsx

+7-1
Original file line numberDiff line numberDiff line change
@@ -151,6 +151,7 @@ export default function Stats({
151151
sx={{
152152
display: "inline-flex",
153153
width: `calc(100% - 40px)`,
154+
minHeight: "40px",
154155
}}
155156
>
156157
{Object.entries(tabs).map(([url, tab]) => (
@@ -159,6 +160,11 @@ export default function Stats({
159160
label={tab.label}
160161
component={Link}
161162
href={url}
163+
sx={{
164+
minHeight: "40px",
165+
py: "8px",
166+
fontSize: "0.8rem",
167+
}}
162168
/>
163169
))}
164170
</MuiTabs>
@@ -199,7 +205,7 @@ export default function Stats({
199205
height: "60px",
200206
display: settingsOpen ? "block" : "none",
201207
borderTop: 1,
202-
zIndex: 1,
208+
//zIndex: 1,
203209
boxShadow: 1,
204210
borderColor: "divider",
205211
overflowY: "hidden",

src/components/MainContainer.tsx

-2
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,6 @@ export default function MainContainer({
6161
.get("activities")
6262
?.split(",")
6363
.map(Number);
64-
console.log("loading activities", activities);
6564
load(activities)
6665
.then(console.log)
6766
.catch(console.error);
@@ -70,7 +69,6 @@ export default function MainContainer({
7069
}
7170

7271
async function load(activities?: number[]) {
73-
console.log("loading activities");
7472
const nActivities = await loadFromDB({
7573
ids: activities,
7674
});

src/components/Map/LayerSwitcher.tsx

+3
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,9 @@ export function LayerSwitcher() {
3939
}));
4040

4141
const map = useMap();
42+
43+
if (map.current == undefined) return;
44+
4245
const [anchorEl, setAnchorEl] =
4346
useState<null | HTMLElement>(null);
4447
const open = Boolean(anchorEl);

0 commit comments

Comments
 (0)