Skip to content

Commit 9dce33f

Browse files
authored
Merge branch 'main' into content/obsidian-entry
2 parents 0773369 + f9d35c0 commit 9dce33f

File tree

12 files changed

+116
-10
lines changed

12 files changed

+116
-10
lines changed

design/src/styles/layout/main.css

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ a {
1616
}
1717

1818
.container {
19-
width: calc(100%-16px);
19+
width: calc(100% - 16px);
2020
/* height: 100vh; */
2121
margin-left: auto;
2222
margin-right: auto;

personal/package-lock.json

Lines changed: 18 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

personal/package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "aaronczichon.de",
33
"type": "module",
4-
"version": "1.0.0",
4+
"version": "1.0.1",
55
"description": "Personal website of Aaron Czichon",
66
"scripts": {
77
"dev": "astro dev",
@@ -28,6 +28,7 @@
2828
"typescript": "^5.3.3"
2929
},
3030
"devDependencies": {
31+
"@types/mapbox-gl": "^3.1.0",
3132
"prettier": "^3.2.5",
3233
"prettier-plugin-astro": "^0.13.0"
3334
}

personal/src/components/BlogEntryList.astro

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
---
22
import { getCollection } from "astro:content";
3-
import { Image } from "astro:assets";
43
const allPosts = await getCollection("blog");
54
65
const dateOptions: object = {

personal/src/components/CVList.astro

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
---
22
import { getCollection } from "astro:content";
3-
import SkillList from "./SkillList.astro";
43
import SkillBand from "./SkillBand.astro";
54
const allCvEntries = await getCollection("cv");
65

personal/src/components/Nav.astro

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,11 @@ import { Image } from "astro:assets";
3131
class={currentPath.indexOf("cv") > -1 ? "active" : ""}>CV</a
3232
> -->
3333
<a href="/cv/" class={currentPath.indexOf("cv") > -1 ? "active" : ""}>CV</a>
34+
<a
35+
href="/visited-countries/"
36+
class={currentPath.indexOf("visited-countries") > -1 ? "active" : ""}
37+
>Visited Countries</a
38+
>
3439
<!-- <a
3540
href="/pengiun"
3641
class={currentPath.indexOf("pengiun") > -1 ? "active" : ""}
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
import { useState, useEffect } from 'preact/hooks';
2+
3+
import BasicMap from './BasicMap';
4+
import { addMapLayer } from './map.func';
5+
6+
export default function CountryDynamicMap({zoom, center}) {
7+
const [map, setMap] = useState(null);
8+
useEffect(() => {
9+
// Add route to map
10+
if (map) {
11+
map.on('load', () => {
12+
addMapLayer(map);
13+
});
14+
}
15+
}, [map]);
16+
17+
useEffect(() => {
18+
if (map) {
19+
map.setCenter(center);
20+
}
21+
})
22+
23+
return (
24+
<BasicMap zoom={zoom} setMap={setMap} />
25+
);
26+
}

personal/src/components/dynamic/PathMap.jsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ function parseGPX(gpxData) {
1414

1515
export default function PathDynamicMap({gpxUrl, zoom, tooltip}) {
1616
const [map, setMap] = useState(null);
17-
const [popup, setPopup] = useState(null);
17+
const [popup, _setPopup] = useState(null);
1818
const [routeCoordinates, setRouteCoordinates] = useState(null);
1919

2020
useEffect(() => {
Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
import * as mapboxgl from 'mapbox-gl';
2+
3+
export const addMapLayer = (map: mapboxgl.Map) => {
4+
map.addSource('countries', {
5+
type: 'vector',
6+
url: 'mapbox://mapbox.country-boundaries-v1'
7+
});
8+
9+
map.addLayer(
10+
{
11+
id: 'country-boundaries',
12+
source: 'countries',
13+
'source-layer': 'country_boundaries',
14+
type: 'fill',
15+
paint: {
16+
'fill-color': '#19bf32',
17+
'fill-opacity': 0.7,
18+
},
19+
},
20+
'country-label'
21+
);
22+
23+
// ISO List: https://en.wikipedia.org/wiki/ISO_3166-1_alpha-3
24+
map.setFilter('country-boundaries', [
25+
"in",
26+
"iso_3166_1_alpha_3",
27+
'ITA',
28+
'CAN',
29+
'DEU',
30+
'ESP',
31+
'SVK',
32+
'SVN',
33+
'CZE',
34+
'HRV',
35+
'BEL',
36+
'NOR',
37+
'AUT',
38+
'LTU',
39+
'FIN',
40+
'EST',
41+
'USA',
42+
'CHE',
43+
'FRA'
44+
]);
45+
}

personal/src/content/config.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ const blogCollection = defineCollection({
2121

2222
const cvCollection = defineCollection({
2323
type: 'content', // v2.5.0 and later
24-
schema: ({ image }) =>
24+
schema: () =>
2525
z.object({
2626
title: z.string(),
2727
position: z.string(),

personal/src/pages/cv.astro

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,6 @@
11
---
22
import Layout from "../layouts/Layout.astro";
33
import CVList from "../components/CVList.astro";
4-
5-
const { frontmatter } = Astro.props;
64
---
75

86
<Layout title="Aaron Czichon - CV">
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
---
2+
import Layout from "../layouts/Layout.astro";
3+
import CountryMap from "../components/dynamic/CountryMap";
4+
---
5+
6+
<Layout title="Aaron Czichon - Visited Countries">
7+
<main class="container">
8+
<h1>Visited Countries</h1>
9+
<p>
10+
I've already visited a bunch of countries in my life. I love to keep track
11+
of such things.
12+
</p>
13+
</main>
14+
15+
<!-- Map Component here -->
16+
<CountryMap client:visible zoom="3" center={[10.451526, 51.165691]} />
17+
</Layout>

0 commit comments

Comments
 (0)