diff --git a/public/android-chrome-96x96.png b/public/android-chrome-96x96.png new file mode 100644 index 00000000..7faa1677 Binary files /dev/null and b/public/android-chrome-96x96.png differ diff --git a/public/apple-touch-icon.png b/public/apple-touch-icon.png new file mode 100644 index 00000000..5f09b297 Binary files /dev/null and b/public/apple-touch-icon.png differ diff --git a/public/browserconfig.xml b/public/browserconfig.xml new file mode 100644 index 00000000..5aecc916 --- /dev/null +++ b/public/browserconfig.xml @@ -0,0 +1,9 @@ + + + + + + #00aba9 + + + diff --git a/public/favicon-16x16.png b/public/favicon-16x16.png new file mode 100644 index 00000000..1627c5fd Binary files /dev/null and b/public/favicon-16x16.png differ diff --git a/public/favicon-32x32.png b/public/favicon-32x32.png new file mode 100644 index 00000000..047716f3 Binary files /dev/null and b/public/favicon-32x32.png differ diff --git a/public/favicon.ico b/public/favicon.ico new file mode 100644 index 00000000..eaf78704 Binary files /dev/null and b/public/favicon.ico differ diff --git a/public/mstile-150x150.png b/public/mstile-150x150.png new file mode 100644 index 00000000..e47d19d5 Binary files /dev/null and b/public/mstile-150x150.png differ diff --git a/public/safari-pinned-tab.svg b/public/safari-pinned-tab.svg new file mode 100644 index 00000000..c187f1ce --- /dev/null +++ b/public/safari-pinned-tab.svg @@ -0,0 +1,21 @@ + + + + +Created by potrace 1.14, written by Peter Selinger 2001-2017 + + + + + diff --git a/public/site.webmanifest b/public/site.webmanifest new file mode 100644 index 00000000..53d0b63a --- /dev/null +++ b/public/site.webmanifest @@ -0,0 +1,14 @@ +{ + "name": "Cartes de Leim", + "short_name": "Cartes de Leim", + "icons": [ + { + "src": "/android-chrome-96x96.png", + "sizes": "96x96", + "type": "image/png" + } + ], + "theme_color": "#a9d1eb", + "background_color": "#a9d1eb", + "display": "standalone" +} diff --git a/src/assets/scss/_leaflet.scss b/src/assets/scss/_leaflet.scss new file mode 100644 index 00000000..8ab520e5 --- /dev/null +++ b/src/assets/scss/_leaflet.scss @@ -0,0 +1,36 @@ +@use './utils/text'; + +.leaflet-container { + margin: auto; + width: 100%; + max-width: 100%; + max-height: 100%; + background: #98bcd0 !important; + + .leaflet-map-pane { + .leaflet-tooltip-pane { + .leaflet-tooltip { + &.capital-name { + padding: .2rem .4rem; + color: #EEE; + font-weight: bold; + background: none; + border: none; + box-shadow: none; + border-bottom-left-radius: 0; + border-bottom-right-radius: 0; + + &::before { + display: none; + } + + @include text.stroke(2, #18181b); + } + } + } + } +} + +.leaflet-popup-content-wrapper { + border-radius: .25rem; +} \ No newline at end of file diff --git a/src/assets/scss/theme.scss b/src/assets/scss/theme.scss new file mode 100644 index 00000000..feaf5b78 --- /dev/null +++ b/src/assets/scss/theme.scss @@ -0,0 +1,5 @@ +@use './leaflet'; + +html { + font-family: system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Open Sans', 'Helvetica Neue', sans-serif; +} \ No newline at end of file diff --git a/src/assets/scss/utils/_text.scss b/src/assets/scss/utils/_text.scss new file mode 100644 index 00000000..49e17613 --- /dev/null +++ b/src/assets/scss/utils/_text.scss @@ -0,0 +1,24 @@ +/// Stroke font-character +/// @param {Integer} $stroke - Stroke width +/// @param {Color} $color - Stroke color +/// @return {List} - text-shadow list +@function stroke($stroke, $color) { + $shadow: (); + $from: $stroke*-1; + + @for $i from $from through $stroke { + @for $j from $from through $stroke { + $shadow: append($shadow, $i*1px $j*1px 0 $color, comma); + } + } + + @return $shadow; +} + +/// Stroke font-character +/// @param {Integer} $stroke - Stroke width +/// @param {Color} $color - Stroke color +/// @return {Style} - text-shadow +@mixin stroke($stroke, $color) { + text-shadow: stroke($stroke, $color); +} diff --git a/src/components/maps/AllianceKaldelienne.astro b/src/components/maps/AllianceKaldelienne.astro index 79099776..dcb564fa 100644 --- a/src/components/maps/AllianceKaldelienne.astro +++ b/src/components/maps/AllianceKaldelienne.astro @@ -1,6 +1,16 @@ +--- +import type { MapMarker } from '@/types/Leaflet'; + +interface Props { + markers: MapMarker; +} + +const { markers } = Astro.props +--- +
- - \ No newline at end of file diff --git a/src/layouts/Layout.astro b/src/layouts/Layout.astro index 5b6c4eb8..3a5f02d3 100644 --- a/src/layouts/Layout.astro +++ b/src/layouts/Layout.astro @@ -7,15 +7,22 @@ const { title } = Astro.props; --- - + - {title} + + + + + + + + @@ -28,32 +35,7 @@ const { title } = Astro.props; - diff --git a/src/pages/api/data/alliance.markers.ts b/src/pages/api/data/alliance.markers.ts new file mode 100644 index 00000000..5b4d1bde --- /dev/null +++ b/src/pages/api/data/alliance.markers.ts @@ -0,0 +1,603 @@ +import type { MapMarker } from "@/types/Leaflet"; + +export const allianceMarkers: MapMarker[] = [ + { + group: "capitals", + title: "Ambrose", + description: "Chef-lieu de Nacride et Capitale économique de l'Alliance Kaldélienne.", + link: "https://alexcreates.fr/leim/index.php?title=Ambrose", + markerCoords: { + x: 83.6, + y: -185.2, + } + }, + { + group: "capitals", + title: "Cordouac", + description: "Chef-lieu d'Héraldie et Capitale administrative de l'Alliance Kaldélienne.", + link: "https://alexcreates.fr/leim/index.php?title=Cordouac", + markerCoords: { + x: 133.46875, + y: -146.0625 , + } + }, + { + group: "capitals", + title: "Bordelac", + description: "Chef-lieu des Hautes-Berges", + link: "https://alexcreates.fr/leim/index.php?title=Bordelac", + markerCoords: { + x: 151.22656, + y: -173.63281, + } + }, + { + group: "capitals", + title: "Tourgrise", + description: "Chef-lieu de Ternâcre. C'est une cité de mages archivistes, mais c'est aussi ici qu'on trouve la plus grande population carcérale de l'Alliance.", + link: "https://alexcreates.fr/leim/index.php?title=Tourgrise", + markerCoords: { + x: 132.26953, + y: -98.19141, + } + }, + { + group: "capitals", + title: "Valsoie", + description: "Chef-lieu de Mireloin.", + link: "https://alexcreates.fr/leim/index.php?title=Valsoie", + markerCoords: { + x: 103.4375, + y: -79.5, + } + }, + { + group: "capitals", + title: "Prismalline", + description: "Chef-lieu de Corambre.", + link: "https://alexcreates.fr/leim/index.php?title=Prismalline", + markerCoords: { + x: 103.00329, + y: -138.02162, + } + }, + { + group: "capitals", + title: "Port-brisé", + description: "Chef-lieu d'Émerose.", + link: "https://alexcreates.fr/leim/index.php?title=Port-brisé", + markerCoords: { + x: 168.39491, + y: -109.13376, + } + }, + { + group: "capitals", + title: "Berce", + description: "Chef-lieu des Basses-berges.", + link: "https://alexcreates.fr/leim/index.php?title=Berce", + markerCoords: { + x: 173.39874, + y: -164.39011, + } + }, + { + group: "capitals", + title: "Lamière", + description: "Chef-lieu de Quillon.", + link: "https://alexcreates.fr/leim/index.php?title=Lamière", + markerCoords: { + x: 140.20731, + y: -195.77923, + } + }, + { + group: "capitals", + title: "Halport", + description: "Chef-lieu de Lagarde.", + link: "https://alexcreates.fr/leim/index.php?title=Halport", + markerCoords: { + x: 76.6803, + y: -198.76159, + } + }, + { + group: "capitals", + title: "Soubreciel", + description: "Chef-lieu de Rougefer.", + link: "https://alexcreates.fr/leim/index.php?title=Soubreciel", + markerCoords: { + x: 204.42515, + y: -226.85883, + } + }, + { + group: "capitals", + title: "Dramast", + description: "Chef-lieu d'Asharos.", + link: "https://alexcreates.fr/leim/index.php?title=Dramast", + markerCoords: { + x: 119.35456, + y: -27.53623, + } + }, + { + group: "capitals", + title: "Briseroc", + description: "Chef-lieu de Pergaré.", + link: "https://alexcreates.fr/leim/index.php?title=Briseroc", + markerCoords: { + x: 41.96763, + y: -48.83056, + } + }, + { + group: "capitals", + title: "Demilieu", + description: "Ancienne cité militaire laissée à l'abandon depuis plusieurs centaines d'années.", + link: "https://alexcreates.fr/leim/index.php?title=Demilieu", + markerCoords: { + x: 204.75462, + y: -116.80687, + } + }, + { + group: "cities", + title: "Borélis", + description: "Cité côtière vivant principalement de la pêche.", + link: "https://alexcreates.fr/leim/index.php?title=Borélis", + markerCoords: { + x: 138.44531, + y: -51.54687, + } + }, + { + group: "cities", + title: "Alcombe", + description: "", + link: "https://alexcreates.fr/leim/index.php?title=Alcombe", + markerCoords: { + x: 165.42471, + y: -164.00393, + } + }, + { + group: "cities", + title: "Cristaline", + description: "", + link: "https://alexcreates.fr/leim/index.php?title=Cristaline", + markerCoords: { + x: 167.06242, + y: -176.47233, + } + }, + { + group: "cities", + title: "Vidinamel", + description: "", + link: "https://alexcreates.fr/leim/index.php?title=Vidinamel", + markerCoords: { + x: 176.40469, + y: -199.94666, + } + }, + { + group: "cities", + title: "Cantane", + description: "", + link: "https://alexcreates.fr/leim/index.php?title=Cantane", + markerCoords: { + x: 196.00387, + y: -210.9071, + } + }, + { + group: "cities", + title: "Horfer", + description: "", + link: "https://alexcreates.fr/leim/index.php?title=Horfer", + markerCoords: { + x: 185.57431, + y: -229.08588, + } + }, + { + group: "cities", + title: "Cimeterre", + description: "", + link: "https://alexcreates.fr/leim/index.php?title=Cimeterre", + markerCoords: { + x: 143.16512, + y: -217.37201, + } + }, + { + group: "cities", + title: "Aubert", + description: "", + link: "https://alexcreates.fr/leim/index.php?title=Aubert", + markerCoords: { + x: 140.19456, + y: -201.85993, + } + }, + { + group: "cities", + title: "Telos", + description: "", + link: "https://alexcreates.fr/leim/index.php?title=Telos", + markerCoords: { + x: 104.61938, + y: -204.35683, + } + }, + { + group: "cities", + title: "Saint-Amanthe", + description: "", + link: "https://alexcreates.fr/leim/index.php?title=Saint-Amanthe", + markerCoords: { + x: 83.88068, + y: -196.35341, + } + }, + { + group: "cities", + title: "Flauvent", + description: "", + link: "https://alexcreates.fr/leim/index.php?title=Flauvent", + markerCoords: { + x: 77.58332, + y: -210.22326, + } + }, + { + group: "cities", + title: "Nardion", + description: "", + link: "https://alexcreates.fr/leim/index.php?title=Nardion", + markerCoords: { + x: 43.56226, + y: -218.19662, + } + }, + { + group: "cities", + title: "Granvert", + description: "", + link: "https://alexcreates.fr/leim/index.php?title=Granvert", + markerCoords: { + x: 63.47312, + y: -192.67867, + } + }, + { + group: "cities", + title: "Olydra", + description: "", + link: "https://alexcreates.fr/leim/index.php?title=Olydra", + markerCoords: { + x: 92.24383, + y: -179.9298, + } + }, + { + group: "cities", + title: "Vermeil", + description: "", + link: "https://alexcreates.fr/leim/index.php?title=Vermeil", + markerCoords: { + x: 98.86066, + y: -185.63039, + } + }, + { + group: "cities", + title: "Corindon", + description: "", + link: "https://alexcreates.fr/leim/index.php?title=Corindon", + markerCoords: { + x: 85.04465, + y: -173.44829, + } + }, + { + group: "cities", + title: "Verdame", + description: "", + link: "https://alexcreates.fr/leim/index.php?title=Verdame", + markerCoords: { + x: 93.64841, + y: -155.23226, + } + }, + { + group: "cities", + title: "Sellier", + description: "", + link: "https://alexcreates.fr/leim/index.php?title=Sellier", + markerCoords: { + x: 112.8161, + y: -165.85315, + } + }, + { + group: "cities", + title: "Fort-Altare", + description: "", + link: "https://alexcreates.fr/leim/index.php?title=Fort-Altare", + markerCoords: { + x: 123.1809, + y: -156.79472, + } + }, + { + group: "cities", + title: "Naegir", + description: "", + link: "https://alexcreates.fr/leim/index.php?title=Naegir", + markerCoords: { + x: 111.22838, + y: -142.46072, + } + }, + { + group: "cities", + title: "Silène", + description: "", + link: "https://alexcreates.fr/leim/index.php?title=Silène", + markerCoords: { + x: 129.49372, + y: -127.83022, + } + }, + { + group: "cities", + title: "Astelion", + description: "", + link: "https://alexcreates.fr/leim/index.php?title=Astelion", + markerCoords: { + x: 149.80364, + y: -141.47096, + } + }, + { + group: "cities", + title: "Mythuse", + description: "", + link: "https://alexcreates.fr/leim/index.php?title=Mythuse", + markerCoords: { + x: 101.52778, + y: -119.3854, + } + }, + { + group: "cities", + title: "Celadonis", + description: "", + link: "https://alexcreates.fr/leim/index.php?title=Celadonis", + markerCoords: { + x: 121.39631, + y: -107.59972, + } + }, + { + group: "cities", + title: "Mestrl", + description: "", + link: "https://alexcreates.fr/leim/index.php?title=Mestrl", + markerCoords: { + x: 141.59822, + y: -112.96104, + } + }, + { + group: "cities", + title: "Pyranae", + description: "", + link: "https://alexcreates.fr/leim/index.php?title=Pyranae", + markerCoords: { + x: 191.89054, + y: -166.99251, + } + }, + { + group: "cities", + title: "Liserios", + description: "", + link: "https://alexcreates.fr/leim/index.php?title=Liserios", + markerCoords: { + x: 187.69872, + y: -101.89283, + } + }, + { + group: "cities", + title: "Armistille", + description: "", + link: "https://alexcreates.fr/leim/index.php?title=Armistille", + markerCoords: { + x: 187.72908, + y: -111.21423, + } + }, + { + group: "cities", + title: "Gasterre", + description: "", + link: "https://alexcreates.fr/leim/index.php?title=Gasterre", + markerCoords: { + x: 167.39995, + y: -144.62217, + } + }, + { + group: "cities", + title: "Valversant", + description: "", + link: "https://alexcreates.fr/leim/index.php?title=Valversant", + markerCoords: { + x: 177.56325, + y: -156.35054, + } + }, + { + group: "cities", + title: "Becqueraut", + description: "", + link: "https://alexcreates.fr/leim/index.php?title=Becqueraut", + markerCoords: { + x: 129.06038, + y: -190.31194, + } + }, + { + group: "cities", + title: "Grasselieu", + description: "", + link: "https://alexcreates.fr/leim/index.php?title=Grasselieu", + markerCoords: { + x: 148.54698, + y: -185.44567, + } + }, + { + group: "cities", + title: "Asandre", + description: "", + link: "https://alexcreates.fr/leim/index.php?title=Asandre", + markerCoords: { + x: 125.35658, + y: -95.44555, + } + }, + { + group: "cities", + title: "Félisse", + description: "", + link: "https://alexcreates.fr/leim/index.php?title=Félisse", + markerCoords: { + x: 138.45867, + y: -87.15509, + } + }, + { + group: "cities", + title: "Félisse", + description: "", + link: "https://alexcreates.fr/leim/index.php?title=Félisse", + markerCoords: { + x: 151.79771, + y: -89.78763, + } + }, + { + group: "cities", + title: "Anderol", + description: "", + link: "https://alexcreates.fr/leim/index.php?title=Anderol", + markerCoords: { + x: 88.08019, + y: -76.54403, + } + }, + { + group: "cities", + title: "Denteloin", + description: "", + link: "https://alexcreates.fr/leim/index.php?title=Denteloin", + markerCoords: { + x: 99.26192, + y: -94.88901, + } + }, + { + group: "cities", + title: "Willeau", + description: "", + link: "https://alexcreates.fr/leim/index.php?title=Willeau", + markerCoords: { + x: 107.50352, + y: -67.36631, + } + }, + { + group: "cities", + title: "Borglah", + description: "", + link: "https://alexcreates.fr/leim/index.php?title=Borglah", + markerCoords: { + x: 91.03982, + y: -57.75967, + } + }, + { + group: "cities", + title: "Karlas", + description: "", + link: "https://alexcreates.fr/leim/index.php?title=Karlas", + markerCoords: { + x: 133.5332, + y: -44.42783, + } + }, + { + group: "cities", + title: "Sérak", + description: "", + link: "https://alexcreates.fr/leim/index.php?title=Sérak", + markerCoords: { + x: 127.10271, + y: -18.2676, + } + }, + { + group: "cities", + title: "Plumeroche", + description: "", + link: "https://alexcreates.fr/leim/index.php?title=Plumeroche", + markerCoords: { + x: 52.68144, + y: -44.71821, + } + }, + { + group: 'landmarks', + title: "L'Ange d'Aldys", + description: "", + markerCoords: { + x: 89.08707, + y: -166.49361, + } + }, + { + group: 'landmarks', + title: "Les Cages Handaniennes", + description: "Complexe pénitencier réservé aux criminels maîtrisant la magie.", + link: "https://alexcreates.fr/leim/index.php?title=Cages_Handaniennes", + markerCoords: { + x: 168.31641, + y: -60.54297, + } + }, + { + group: 'landmarks', + title: "Solemthelio", + description: "", + link: "https://alexcreates.fr/leim/index.php?title=Solemthelio", + markerCoords: { + x: 174.22358, + y: -197.04778, + } + }, + { + group: 'landmarks', + title: "Temple du soleil", + description: "", + link: "https://alexcreates.fr/leim/index.php?title=Temple du soleil", + markerCoords: { + x: 58.89295, + y: -189.69308, + } + } +]; diff --git a/src/pages/api/markers.json.ts b/src/pages/api/markers.json.ts new file mode 100644 index 00000000..ae503bed --- /dev/null +++ b/src/pages/api/markers.json.ts @@ -0,0 +1,8 @@ +import type { APIRoute } from "astro"; +import { allianceMarkers } from "./data/alliance.markers"; + +export const GET: APIRoute = ({ params, request }) => { + return new Response( + JSON.stringify(allianceMarkers) + ) +} \ No newline at end of file diff --git a/src/pages/index.astro b/src/pages/index.astro index 15d1ba1d..a54e705d 100644 --- a/src/pages/index.astro +++ b/src/pages/index.astro @@ -1,8 +1,11 @@ --- import Layout from '../layouts/Layout.astro'; import AllianceKaldelienne from '../components/maps/AllianceKaldelienne.astro' + +const res = await fetch('http://localhost:4321/api/markers.json'); +const data = await res.json(); --- - - + + diff --git a/src/types/Leaflet.ts b/src/types/Leaflet.ts new file mode 100644 index 00000000..f45b8dbc --- /dev/null +++ b/src/types/Leaflet.ts @@ -0,0 +1,12 @@ +export type MapMarkerGroup = "capitals" | "cities" | "towns" | "landmarks"; + +export type MapMarker = { + title: string, + markerCoords: { + x: number, + y: number, + } + description?: string, + link?: string, + group?: MapMarkerGroup, +} diff --git a/tsconfig.json b/tsconfig.json index 77da9dd0..f363b6b0 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -1,3 +1,9 @@ { - "extends": "astro/tsconfigs/strict" + "extends": "astro/tsconfigs/strict", + "compilerOptions": { + "baseUrl": ".", + "paths": { + "@/*": ["src/*"], + } + } } \ No newline at end of file