Compare commits
11 Commits
fix/prod
...
f4a2e8cbf9
Author | SHA1 | Date | |
---|---|---|---|
f4a2e8cbf9 | |||
0fec2417a9 | |||
7f1986e765 | |||
07ee4b9e57 | |||
20ebad74fb | |||
aec568d0c7 | |||
0849ffe42c | |||
e13cb9bbb9 | |||
c348e2b2ac | |||
c93141e68f | |||
2ecc5c86ca |
10
.github/workflows/build_jsdoc_drink.yml
vendored
10
.github/workflows/build_jsdoc_drink.yml
vendored
@ -1,16 +1,10 @@
|
||||
name: JsDocs
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- '*'
|
||||
tags:
|
||||
- v*
|
||||
pull_request:
|
||||
branches:
|
||||
- master
|
||||
|
||||
- '*'
|
||||
jobs:
|
||||
docs:
|
||||
coverage:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Checkout # rapatrie le depot
|
||||
|
@ -1,8 +1,5 @@
|
||||
/** @type {import('ts-jest').JestConfigWithTsJest} */
|
||||
module.exports = {
|
||||
testPathIgnorePatterns: [
|
||||
"<rootDir>/dist/"
|
||||
],
|
||||
testTimeout: 10000,
|
||||
preset: 'ts-jest',
|
||||
testEnvironment: 'node',
|
||||
|
24
Express/barAndCafe/package-lock.json
generated
24
Express/barAndCafe/package-lock.json
generated
@ -8,7 +8,6 @@
|
||||
"@types/express": "^4.17.21",
|
||||
"@types/node": "^20.12.7",
|
||||
"axios": "^1.6.8",
|
||||
"cors": "^2.8.5",
|
||||
"dotenv": "^16.4.5",
|
||||
"express": "^4.19.2",
|
||||
"rimraf": "^5.0.5",
|
||||
@ -16,7 +15,6 @@
|
||||
"swagger-ui-express": "^5.0.0"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@types/cors": "^2.8.17",
|
||||
"@types/jest": "^29.5.12",
|
||||
"@types/rewire": "^2.5.30",
|
||||
"@types/supertest": "^6.0.2",
|
||||
@ -1970,15 +1968,6 @@
|
||||
"integrity": "sha512-he+DHOWReW0nghN24E1WUqM0efK4kI9oTqDm6XmK8ZPe2djZ90BSNdGnIyCLzCPw7/pogPlGbzI2wHGGmi4O/Q==",
|
||||
"dev": true
|
||||
},
|
||||
"node_modules/@types/cors": {
|
||||
"version": "2.8.17",
|
||||
"resolved": "https://registry.npmjs.org/@types/cors/-/cors-2.8.17.tgz",
|
||||
"integrity": "sha512-8CGDvrBj1zgo2qE+oS3pOCyYNqCPryMWY2bGfwA0dcfopWGgxs+78df0Rs3rc9THP4JkOhLsAa+15VdpAqkcUA==",
|
||||
"dev": true,
|
||||
"dependencies": {
|
||||
"@types/node": "*"
|
||||
}
|
||||
},
|
||||
"node_modules/@types/express": {
|
||||
"version": "4.17.21",
|
||||
"resolved": "https://registry.npmjs.org/@types/express/-/express-4.17.21.tgz",
|
||||
@ -4756,18 +4745,6 @@
|
||||
"dev": true,
|
||||
"optional": true
|
||||
},
|
||||
"node_modules/cors": {
|
||||
"version": "2.8.5",
|
||||
"resolved": "https://registry.npmjs.org/cors/-/cors-2.8.5.tgz",
|
||||
"integrity": "sha512-KIHbLJqu73RGr/hnbrO9uBeixNGuvSQjul/jdFvS/KFSIH1hWVd1ng7zOHx+YrEfInLG7q4n6GHQ9cDtxv/P6g==",
|
||||
"dependencies": {
|
||||
"object-assign": "^4",
|
||||
"vary": "^1"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">= 0.10"
|
||||
}
|
||||
},
|
||||
"node_modules/create-jest": {
|
||||
"version": "29.7.0",
|
||||
"resolved": "https://registry.npmjs.org/create-jest/-/create-jest-29.7.0.tgz",
|
||||
@ -9271,6 +9248,7 @@
|
||||
"version": "4.1.1",
|
||||
"resolved": "https://registry.npmjs.org/object-assign/-/object-assign-4.1.1.tgz",
|
||||
"integrity": "sha512-rJgTQnkUnH1sFw8yT6VSU3zD3sWmu6sZhIseY8VX+GRu3P6F7Fu+JNDoXfklElbLJSnc3FUQHVe4cU5hj+BcUg==",
|
||||
"dev": true,
|
||||
"engines": {
|
||||
"node": ">=0.10.0"
|
||||
}
|
||||
|
@ -14,7 +14,6 @@
|
||||
"@types/express": "^4.17.21",
|
||||
"@types/node": "^20.12.7",
|
||||
"axios": "^1.6.8",
|
||||
"cors": "^2.8.5",
|
||||
"dotenv": "^16.4.5",
|
||||
"express": "^4.19.2",
|
||||
"rimraf": "^5.0.5",
|
||||
@ -22,7 +21,6 @@
|
||||
"swagger-ui-express": "^5.0.0"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@types/cors": "^2.8.17",
|
||||
"@types/jest": "^29.5.12",
|
||||
"@types/rewire": "^2.5.30",
|
||||
"@types/supertest": "^6.0.2",
|
||||
|
@ -1,13 +1,11 @@
|
||||
import { getCity, getRadius, getPoiId, getBox } from "./openTripMaps"
|
||||
import express from "express"
|
||||
import cors from "cors"
|
||||
/**
|
||||
* Initialize Express application instance.
|
||||
* @returns An initialized Express application object.
|
||||
*/
|
||||
const app = express()
|
||||
|
||||
app.use(cors())
|
||||
|
||||
|
||||
/**
|
||||
|
@ -13,7 +13,7 @@ const key = process.env.OPEN_TRIP_MAPS_KEY
|
||||
* @param {string} lat2 Latitude of the 2nd point of the box
|
||||
* @returns {FeatureCollection} a list of POIs with their type, id, etc. (cf: [opentripmap](https://dev.opentripmap.org/docs#))
|
||||
*/
|
||||
async function callBox(lon1:string, lat1:string, lon2: string, lat2: string, rate: string) {
|
||||
async function callBox(lon1:string, lat1:string, lon2: string, lat2: string) {
|
||||
const lonMin = Math.min(parseFloat(lon1), parseFloat(lon2))
|
||||
const lonMax = Math.max(parseFloat(lon1), parseFloat(lon2))
|
||||
const latMin = Math.min(parseFloat(lat1), parseFloat(lat2))
|
||||
@ -27,7 +27,6 @@ async function callBox(lon1:string, lat1:string, lon2: string, lat2: string, rat
|
||||
lon_max: lonMax,
|
||||
lat_min: latMin,
|
||||
lat_max: latMax,
|
||||
rate: rate,
|
||||
apikey: key,
|
||||
kinds: 'bars,cafes,pubs,biergartens'
|
||||
},
|
||||
@ -183,16 +182,11 @@ export async function getBox(req:express.Request, res: express.Response) {
|
||||
const lat1 = req.query["lat1"] as string
|
||||
const lon2 = req.query["lon2"] as string
|
||||
const lat2 = req.query["lat2"] as string
|
||||
let rate = req.query["rate"] as string
|
||||
if(!lon1 || !lat1 || !lon2 || !lat2){
|
||||
res.status(400).send("Missing Argument")
|
||||
return
|
||||
}
|
||||
|
||||
if(!rate){
|
||||
rate = "1";
|
||||
}
|
||||
|
||||
res.send( await callBox(lon1, lat1, lon2, lat2, rate))
|
||||
res.send( await callBox(lon1, lat1, lon2, lat2))
|
||||
}
|
||||
|
||||
|
@ -21,7 +21,7 @@ const options = {
|
||||
}
|
||||
],
|
||||
},
|
||||
apis: ['./src/*.ts','./dist/src/*.js'],
|
||||
apis: ['./src/*.ts'],
|
||||
explorer: true
|
||||
}
|
||||
|
||||
|
@ -219,14 +219,6 @@ describe("Test the otm city path", () => {
|
||||
}
|
||||
]
|
||||
}
|
||||
function sleep(milliseconds: number) {
|
||||
const date = Date.now();
|
||||
let currentDate = null;
|
||||
do {
|
||||
currentDate = Date.now();
|
||||
} while (currentDate - date < milliseconds);
|
||||
}
|
||||
sleep(2000);
|
||||
request(app)
|
||||
.get("/otm/box")
|
||||
.query({'lon1':'-1.435199','lon2':'-1.43519', 'lat1':'46.668460', 'lat2':'46.668461'})
|
||||
|
155
PB_export.json
155
PB_export.json
@ -1,155 +0,0 @@
|
||||
[
|
||||
{
|
||||
"id": "_pb_users_auth_",
|
||||
"name": "users",
|
||||
"type": "auth",
|
||||
"system": false,
|
||||
"schema": [
|
||||
{
|
||||
"system": false,
|
||||
"id": "users_name",
|
||||
"name": "name",
|
||||
"type": "text",
|
||||
"required": false,
|
||||
"presentable": false,
|
||||
"unique": false,
|
||||
"options": {
|
||||
"min": null,
|
||||
"max": null,
|
||||
"pattern": ""
|
||||
}
|
||||
},
|
||||
{
|
||||
"system": false,
|
||||
"id": "users_avatar",
|
||||
"name": "avatar",
|
||||
"type": "file",
|
||||
"required": false,
|
||||
"presentable": false,
|
||||
"unique": false,
|
||||
"options": {
|
||||
"mimeTypes": [
|
||||
"image/jpeg",
|
||||
"image/png",
|
||||
"image/svg+xml",
|
||||
"image/gif",
|
||||
"image/webp"
|
||||
],
|
||||
"thumbs": null,
|
||||
"maxSelect": 1,
|
||||
"maxSize": 5242880,
|
||||
"protected": false
|
||||
}
|
||||
}
|
||||
],
|
||||
"indexes": [],
|
||||
"listRule": "id = @request.auth.id",
|
||||
"viewRule": "id = @request.auth.id",
|
||||
"createRule": "",
|
||||
"updateRule": "id = @request.auth.id",
|
||||
"deleteRule": "id = @request.auth.id",
|
||||
"options": {
|
||||
"allowEmailAuth": true,
|
||||
"allowOAuth2Auth": true,
|
||||
"allowUsernameAuth": true,
|
||||
"exceptEmailDomains": null,
|
||||
"manageRule": null,
|
||||
"minPasswordLength": 8,
|
||||
"onlyEmailDomains": null,
|
||||
"onlyVerified": false,
|
||||
"requireEmail": false
|
||||
}
|
||||
},
|
||||
{
|
||||
"id": "okcdl5ouza7wpmh",
|
||||
"name": "POI",
|
||||
"type": "base",
|
||||
"system": false,
|
||||
"schema": [
|
||||
{
|
||||
"system": false,
|
||||
"id": "tizn7ekv",
|
||||
"name": "Poi",
|
||||
"type": "json",
|
||||
"required": true,
|
||||
"presentable": false,
|
||||
"unique": false,
|
||||
"options": {
|
||||
"maxSize": 2000000
|
||||
}
|
||||
},
|
||||
{
|
||||
"system": false,
|
||||
"id": "sknwezy1",
|
||||
"name": "Poi_id",
|
||||
"type": "text",
|
||||
"required": true,
|
||||
"presentable": false,
|
||||
"unique": false,
|
||||
"options": {
|
||||
"min": null,
|
||||
"max": null,
|
||||
"pattern": ""
|
||||
}
|
||||
}
|
||||
],
|
||||
"indexes": [
|
||||
"CREATE UNIQUE INDEX `idx_iGYiVpo` ON `POI` (`Poi_id`)"
|
||||
],
|
||||
"listRule": "@request.auth.id != \"\"",
|
||||
"viewRule": "@request.auth.id != \"\"",
|
||||
"createRule": "(@request.auth.id != \"\")",
|
||||
"updateRule": null,
|
||||
"deleteRule": null,
|
||||
"options": {}
|
||||
},
|
||||
{
|
||||
"id": "iqpfqlcao9so0mj",
|
||||
"name": "user_poi",
|
||||
"type": "base",
|
||||
"system": false,
|
||||
"schema": [
|
||||
{
|
||||
"system": false,
|
||||
"id": "skjq9wtr",
|
||||
"name": "owner",
|
||||
"type": "relation",
|
||||
"required": false,
|
||||
"presentable": false,
|
||||
"unique": false,
|
||||
"options": {
|
||||
"collectionId": "_pb_users_auth_",
|
||||
"cascadeDelete": false,
|
||||
"minSelect": null,
|
||||
"maxSelect": 1,
|
||||
"displayFields": null
|
||||
}
|
||||
},
|
||||
{
|
||||
"system": false,
|
||||
"id": "buw92nch",
|
||||
"name": "poi_list",
|
||||
"type": "relation",
|
||||
"required": false,
|
||||
"presentable": false,
|
||||
"unique": false,
|
||||
"options": {
|
||||
"collectionId": "okcdl5ouza7wpmh",
|
||||
"cascadeDelete": false,
|
||||
"minSelect": null,
|
||||
"maxSelect": 1,
|
||||
"displayFields": null
|
||||
}
|
||||
}
|
||||
],
|
||||
"indexes": [
|
||||
"CREATE UNIQUE INDEX `idx_PC3A5Pg` ON `user_poi` (\n `owner`,\n `poi_list`\n)"
|
||||
],
|
||||
"listRule": "",
|
||||
"viewRule": "",
|
||||
"createRule": "",
|
||||
"updateRule": null,
|
||||
"deleteRule": "",
|
||||
"options": {}
|
||||
}
|
||||
]
|
17
README.md
17
README.md
@ -1,19 +1,4 @@
|
||||
Original repo : https://git.lab-ouest.org/Epitech/ratrapage_T-WEB
|
||||
|
||||
|
||||
Submodule repo : https://git.lab-ouest.org/Epitech/fork-open-data-tourism/
|
||||
|
||||
# Prod link :
|
||||
|
||||
|
||||
JSDocs : https://drink-tweb.docs.cb85.fr/
|
||||
|
||||
Swagger : https://drink-tweb.cb85.fr/api-docs/
|
||||
|
||||
PB : https://pb-tweb.cb85.fr/
|
||||
|
||||
|
||||
Datatourisme :
|
||||
- https://datatour-tweb.cb85.fr/
|
||||
- https://datatour-tweb.cb85.fr/graphiql
|
||||
- https://datatour-tweb.cb85.fr/voyager
|
||||
Submodule repo : https://git.lab-ouest.org/Epitech/fork-open-data-tourism/
|
@ -1,18 +0,0 @@
|
||||
{
|
||||
"folders": [
|
||||
{
|
||||
"name": "Ratrapage_WEB",
|
||||
"path": "."
|
||||
},
|
||||
{
|
||||
"name": "barAndCafe",
|
||||
"path": "Express/barAndCafe"
|
||||
},
|
||||
{
|
||||
"path": "front"
|
||||
}
|
||||
],
|
||||
"settings": {
|
||||
"typescript.tsdk": "node_modules/typescript/lib"
|
||||
}
|
||||
}
|
@ -1,6 +1,5 @@
|
||||
vars {
|
||||
TRIPMAP_URL: https://api.opentripmap.com/0.1
|
||||
EXPRESS_API: http://localhost:3001
|
||||
}
|
||||
vars:secret [
|
||||
app_key,
|
||||
|
@ -1,8 +0,0 @@
|
||||
vars {
|
||||
EXPRESS_API: https://drink-tweb.cb85.fr
|
||||
PB_URL: https://pb-tweb.cb85.fr
|
||||
TRIPMAP_URL: https://api.opentripmap.com/0.1/
|
||||
}
|
||||
vars:secret [
|
||||
OTM_KEY
|
||||
]
|
@ -5,7 +5,7 @@ meta {
|
||||
}
|
||||
|
||||
get {
|
||||
url: {{EXPRESS_API}}/otm/city?name=La roche sur yon&radius=300
|
||||
url: http://localhost:3001/otm/city?name=La roche sur yon&radius=300
|
||||
body: none
|
||||
auth: none
|
||||
}
|
||||
|
@ -1,16 +0,0 @@
|
||||
meta {
|
||||
name: otm_city
|
||||
type: http
|
||||
seq: 5
|
||||
}
|
||||
|
||||
get {
|
||||
url: {{TRIPMAP_URL}}/en/places/geoname?name=paris&apikey={{OTM_KEY}}
|
||||
body: none
|
||||
auth: none
|
||||
}
|
||||
|
||||
query {
|
||||
name: paris
|
||||
apikey: {{OTM_KEY}}
|
||||
}
|
@ -1,18 +0,0 @@
|
||||
meta {
|
||||
name: connexion
|
||||
type: http
|
||||
seq: 1
|
||||
}
|
||||
|
||||
post {
|
||||
url: {{PB_URL}}/api/collections/users/auth-with-password
|
||||
body: json
|
||||
auth: none
|
||||
}
|
||||
|
||||
body:json {
|
||||
{
|
||||
"identity": "michel.biche@aptatio.com",
|
||||
"password": "123456789"
|
||||
}
|
||||
}
|
@ -1,27 +0,0 @@
|
||||
meta {
|
||||
name: get all poi
|
||||
type: http
|
||||
seq: 5
|
||||
}
|
||||
|
||||
get {
|
||||
url: {{PB_URL}}/api/collections/user_poi/records?filter=owner='vvy93m1hoaeshwy'&&poi_list='cabkkovmjsfoapa'
|
||||
body: json
|
||||
auth: bearer
|
||||
}
|
||||
|
||||
query {
|
||||
filter: owner
|
||||
poi_list: 'cabkkovmjsfoapa'
|
||||
}
|
||||
|
||||
auth:bearer {
|
||||
token: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJjb2xsZWN0aW9uSWQiOiJfcGJfdXNlcnNfYXV0aF8iLCJleHAiOjE3MTg4Mjg0NzEsImlkIjoidnZ5OTNtMWhvYWVzaHd5IiwidHlwZSI6ImF1dGhSZWNvcmQifQ.pC7u-QaZ_BYqWA5wG8wu1lRbbd4mKuKeAveWe_IBnfU
|
||||
}
|
||||
|
||||
body:json {
|
||||
{
|
||||
"owner": "vvy93m1hoaeshwy",
|
||||
"poi_list": "sh430u0im37cxm5"
|
||||
}
|
||||
}
|
@ -1,22 +0,0 @@
|
||||
meta {
|
||||
name: link user to poi
|
||||
type: http
|
||||
seq: 3
|
||||
}
|
||||
|
||||
post {
|
||||
url: {{PB_URL}}/api/collections/user_poi/records
|
||||
body: json
|
||||
auth: bearer
|
||||
}
|
||||
|
||||
auth:bearer {
|
||||
token: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJjb2xsZWN0aW9uSWQiOiJfcGJfdXNlcnNfYXV0aF8iLCJleHAiOjE3MTg4Mjg0NzEsImlkIjoidnZ5OTNtMWhvYWVzaHd5IiwidHlwZSI6ImF1dGhSZWNvcmQifQ.pC7u-QaZ_BYqWA5wG8wu1lRbbd4mKuKeAveWe_IBnfU
|
||||
}
|
||||
|
||||
body:json {
|
||||
{
|
||||
"owner": "vvy93m1hoaeshwy",
|
||||
"poi_list": "sh430u0im37cxm5"
|
||||
}
|
||||
}
|
@ -1,40 +0,0 @@
|
||||
meta {
|
||||
name: send a poi
|
||||
type: http
|
||||
seq: 2
|
||||
}
|
||||
|
||||
post {
|
||||
url: {{PB_URL}}/api/collections/POI/records
|
||||
body: json
|
||||
auth: bearer
|
||||
}
|
||||
|
||||
auth:bearer {
|
||||
token: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJjb2xsZWN0aW9uSWQiOiJfcGJfdXNlcnNfYXV0aF8iLCJleHAiOjE3MTg4Mjg0NzEsImlkIjoidnZ5OTNtMWhvYWVzaHd5IiwidHlwZSI6ImF1dGhSZWNvcmQifQ.pC7u-QaZ_BYqWA5wG8wu1lRbbd4mKuKeAveWe_IBnfU
|
||||
}
|
||||
|
||||
body:json {
|
||||
{
|
||||
"Poi_id": "11472887",
|
||||
"Poi": {
|
||||
"type": "Feature",
|
||||
"id": "11472887",
|
||||
"geometry": {
|
||||
"type": "Point",
|
||||
"coordinates": [
|
||||
-0.0626024,
|
||||
51.4924088
|
||||
]
|
||||
},
|
||||
"properties": {
|
||||
"xid": "W544344833",
|
||||
"name": "The Blue Anchor",
|
||||
"rate": 2,
|
||||
"osm": "way/544344833",
|
||||
"wikidata": "Q7718716",
|
||||
"kinds": "pubs,foods,shops,marketplaces,tourist_facilities"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
@ -1,37 +0,0 @@
|
||||
meta {
|
||||
name: send fav to astro
|
||||
type: http
|
||||
seq: 4
|
||||
}
|
||||
|
||||
post {
|
||||
url: http://localhost:3000/maps/save_poi
|
||||
body: json
|
||||
auth: bearer
|
||||
}
|
||||
|
||||
auth:bearer {
|
||||
token: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJjb2xsZWN0aW9uSWQiOiJfcGJfdXNlcnNfYXV0aF8iLCJleHAiOjE3MTg4ODY2OTIsImlkIjoidnZ5OTNtMWhvYWVzaHd5IiwidHlwZSI6ImF1dGhSZWNvcmQifQ.R9PBGlHn6aBHt89g6G0NykMh_Vye24OpKEUYtz6R6Og
|
||||
}
|
||||
|
||||
body:json {
|
||||
{
|
||||
"type": "Feature",
|
||||
"id": "11472888",
|
||||
"geometry": {
|
||||
"type": "Point",
|
||||
"coordinates": [
|
||||
-0.0626024,
|
||||
51.4924088
|
||||
]
|
||||
},
|
||||
"properties": {
|
||||
"xid": "W544344833",
|
||||
"name": "The Blue Anchor",
|
||||
"rate": 2,
|
||||
"osm": "way/544344833",
|
||||
"wikidata": "Q7718716",
|
||||
"kinds": "pubs,foods,shops,marketplaces,tourist_facilities"
|
||||
}
|
||||
}
|
||||
}
|
@ -35,7 +35,6 @@ services:
|
||||
image: git.lab-ouest.org/epitech/ratrapage_t-web_back:master
|
||||
environment:
|
||||
- port=${BACK_BASE_PORT}
|
||||
- OPEN_TRIP_MAPS_KEY=${OPEN_TRIP_MAPS_KEY}
|
||||
labels:
|
||||
- traefik.enable=true
|
||||
- traefik.http.routers.expressDrinkTweb.rule=Host(`${DRINK_URL}`)
|
||||
@ -95,4 +94,4 @@ x-dockge:
|
||||
- https://${FRONT_URL}/
|
||||
- https://${DOCS_DRINK_URL}/
|
||||
- https://${DRINK_URL}/
|
||||
- https://${DATA_TOURISME_URL}/
|
||||
- https://${DATA_TOURISME_URL}/
|
97
front/package-lock.json
generated
97
front/package-lock.json
generated
@ -20,16 +20,12 @@
|
||||
"astro-embed": "^0.7.2",
|
||||
"astro-icon": "^1.1.0",
|
||||
"leaflet": "^1.9.4",
|
||||
"leaflet-control-geocoder": "^2.4.0",
|
||||
"leaflet-geosearch": "^4.0.0",
|
||||
"leaflet-routing-machine": "^3.2.12",
|
||||
"limax": "4.1.0",
|
||||
"lodash.merge": "^4.6.2",
|
||||
"lucide-astro": "^0.372.0",
|
||||
"pocketbase": "^0.21.1",
|
||||
"react-leaflet": "^4.2.1",
|
||||
"simple-icons-astro": "^11.12.0",
|
||||
"tailwind-merge": "^2.3.0",
|
||||
"tailwindcss": "^3.4.3",
|
||||
"unpic": "^3.18.0"
|
||||
},
|
||||
@ -46,7 +42,6 @@
|
||||
"@types/eslint__js": "^8.42.3",
|
||||
"@types/js-yaml": "^4.0.9",
|
||||
"@types/leaflet": "^1.9.12",
|
||||
"@types/leaflet-routing-machine": "^3.2.8",
|
||||
"@types/lodash.merge": "^4.6.9",
|
||||
"@types/node": "^20",
|
||||
"@typescript-eslint/eslint-plugin": "^6.21.0",
|
||||
@ -64,6 +59,7 @@
|
||||
"reading-time": "^1.5.0",
|
||||
"rehype-plugin-image-native-lazy-loading": "^1.2.0",
|
||||
"sharp": "0.33.3",
|
||||
"tailwind-merge": "^2.3.0",
|
||||
"tailwindcss": "^3.4.3",
|
||||
"typescript": "^5",
|
||||
"typescript-eslint": "^7.9.0",
|
||||
@ -1133,6 +1129,7 @@
|
||||
"version": "7.24.5",
|
||||
"resolved": "https://registry.npmjs.org/@babel/runtime/-/runtime-7.24.5.tgz",
|
||||
"integrity": "sha512-Nms86NXrsaeU9vbBJKni6gXiEXZ4CVpYVzEjDH9Sb8vmZ3UljyA1GSOJl/6LGPO8EHLuSF9H+IxNXHPX8QHJ4g==",
|
||||
"dev": true,
|
||||
"dependencies": {
|
||||
"regenerator-runtime": "^0.14.0"
|
||||
},
|
||||
@ -1749,15 +1746,6 @@
|
||||
"resolved": "https://registry.npmjs.org/@fontsource-variable/inter/-/inter-5.0.18.tgz",
|
||||
"integrity": "sha512-rJzSrtJ3b7djiGFvRuTe6stDfbYJGhdQSfn2SI2WfXviee7Er0yKAHE5u7FU7OWVQQQ1x3+cxdmx9NdiAkcrcA=="
|
||||
},
|
||||
"node_modules/@googlemaps/js-api-loader": {
|
||||
"version": "1.16.6",
|
||||
"resolved": "https://registry.npmjs.org/@googlemaps/js-api-loader/-/js-api-loader-1.16.6.tgz",
|
||||
"integrity": "sha512-V8p5W9DbPQx74jWUmyYJOerhiB4C+MHekaO0ZRmc6lrOYrvY7+syLhzOWpp55kqSPeNb+qbC2h8i69aLIX6krQ==",
|
||||
"optional": true,
|
||||
"dependencies": {
|
||||
"fast-deep-equal": "^3.1.3"
|
||||
}
|
||||
},
|
||||
"node_modules/@humanwhocodes/config-array": {
|
||||
"version": "0.11.14",
|
||||
"resolved": "https://registry.npmjs.org/@humanwhocodes/config-array/-/config-array-0.11.14.tgz",
|
||||
@ -2471,22 +2459,6 @@
|
||||
"@jridgewell/sourcemap-codec": "^1.4.14"
|
||||
}
|
||||
},
|
||||
"node_modules/@mapbox/corslite": {
|
||||
"version": "0.0.7",
|
||||
"resolved": "https://registry.npmjs.org/@mapbox/corslite/-/corslite-0.0.7.tgz",
|
||||
"integrity": "sha512-w/uS474VFjmqQ7fFWIMZINQM1BAQxDLuoJaZZIPES1BmeYpCtlh9MtbFxKGGDAsfvut8/HircIsVvEYRjQ+iMg=="
|
||||
},
|
||||
"node_modules/@mapbox/polyline": {
|
||||
"version": "0.2.0",
|
||||
"resolved": "https://registry.npmjs.org/@mapbox/polyline/-/polyline-0.2.0.tgz",
|
||||
"integrity": "sha512-GCddO0iw6AzOQqZgBmjEQI9Pgo40/yRgkTkikGctE01kNBN0ThWYuAnTD+hRWrAWMV6QJ0rNm4m8DAsaAXE7Pg==",
|
||||
"bin": {
|
||||
"polyline": "bin/polyline.bin.js"
|
||||
},
|
||||
"engines": {
|
||||
"node": "*"
|
||||
}
|
||||
},
|
||||
"node_modules/@mdx-js/mdx": {
|
||||
"version": "3.0.1",
|
||||
"resolved": "https://registry.npmjs.org/@mdx-js/mdx/-/mdx-3.0.1.tgz",
|
||||
@ -3089,15 +3061,6 @@
|
||||
"@types/geojson": "*"
|
||||
}
|
||||
},
|
||||
"node_modules/@types/leaflet-routing-machine": {
|
||||
"version": "3.2.8",
|
||||
"resolved": "https://registry.npmjs.org/@types/leaflet-routing-machine/-/leaflet-routing-machine-3.2.8.tgz",
|
||||
"integrity": "sha512-v2pJDv/nqbB769SsytHemhLkqwjVor9UdWvZ1l6Y2SEaXNt1yDwVrktc4sCT8/4n7npuEb8VP+UAk8xrPePqSQ==",
|
||||
"dev": true,
|
||||
"dependencies": {
|
||||
"@types/leaflet": "*"
|
||||
}
|
||||
},
|
||||
"node_modules/@types/lodash": {
|
||||
"version": "4.17.4",
|
||||
"resolved": "https://registry.npmjs.org/@types/lodash/-/lodash-4.17.4.tgz",
|
||||
@ -6355,7 +6318,7 @@
|
||||
"version": "3.1.3",
|
||||
"resolved": "https://registry.npmjs.org/fast-deep-equal/-/fast-deep-equal-3.1.3.tgz",
|
||||
"integrity": "sha512-f3qQ9oQy9j2AhBe/H9VC91wLmKBCCU/gDOnKNAYG5hswO7BLKj09Hc5HYNz9cGI++xlpDCIgDaitVs03ATR84Q==",
|
||||
"devOptional": true
|
||||
"dev": true
|
||||
},
|
||||
"node_modules/fast-glob": {
|
||||
"version": "3.3.2",
|
||||
@ -8154,36 +8117,6 @@
|
||||
"resolved": "https://registry.npmjs.org/leaflet/-/leaflet-1.9.4.tgz",
|
||||
"integrity": "sha512-nxS1ynzJOmOlHp+iL3FyWqK89GtNL8U8rvlMOsQdTTssxZwCXh8N2NB3GDQOL+YR3XnWyZAxwQixURb+FA74PA=="
|
||||
},
|
||||
"node_modules/leaflet-control-geocoder": {
|
||||
"version": "2.4.0",
|
||||
"resolved": "https://registry.npmjs.org/leaflet-control-geocoder/-/leaflet-control-geocoder-2.4.0.tgz",
|
||||
"integrity": "sha512-b2QlxuFd40uIDbnoUI3U9fzfnB4yKUYlmsXjquJ2d2YjoJqnyVYcIJeErAVv3kPvX3nI0gzvBq1XHMgSVFrGkQ==",
|
||||
"optionalDependencies": {
|
||||
"open-location-code": "^1.0.0"
|
||||
},
|
||||
"peerDependencies": {
|
||||
"leaflet": "^1.6.0"
|
||||
}
|
||||
},
|
||||
"node_modules/leaflet-geosearch": {
|
||||
"version": "4.0.0",
|
||||
"resolved": "https://registry.npmjs.org/leaflet-geosearch/-/leaflet-geosearch-4.0.0.tgz",
|
||||
"integrity": "sha512-a92VNY9gxyv3oyEDqIWoCNoBllajWRYejztzOSNmpLRtzpA6JtGgy/wwl9tsB8+6Eek1fe+L6+W0MDEOaidbXA==",
|
||||
"optionalDependencies": {
|
||||
"@googlemaps/js-api-loader": "^1.16.6",
|
||||
"leaflet": "^1.6.0"
|
||||
}
|
||||
},
|
||||
"node_modules/leaflet-routing-machine": {
|
||||
"version": "3.2.12",
|
||||
"resolved": "https://registry.npmjs.org/leaflet-routing-machine/-/leaflet-routing-machine-3.2.12.tgz",
|
||||
"integrity": "sha512-HLde58G1YtD9xSIzZavJ6BPABZaV1hHeGst8ouhzuxmSC3s32NVtADT+njbIUMW1maHRCrsgTk/E4hz5QH7FrA==",
|
||||
"dependencies": {
|
||||
"@mapbox/corslite": "0.0.7",
|
||||
"@mapbox/polyline": "^0.2.0",
|
||||
"osrm-text-instructions": "^0.13.2"
|
||||
}
|
||||
},
|
||||
"node_modules/levn": {
|
||||
"version": "0.4.1",
|
||||
"resolved": "https://registry.npmjs.org/levn/-/levn-0.4.1.tgz",
|
||||
@ -8231,6 +8164,7 @@
|
||||
"cpu": [
|
||||
"arm64"
|
||||
],
|
||||
"dev": true,
|
||||
"optional": true,
|
||||
"os": [
|
||||
"darwin"
|
||||
@ -8250,6 +8184,7 @@
|
||||
"cpu": [
|
||||
"x64"
|
||||
],
|
||||
"dev": true,
|
||||
"optional": true,
|
||||
"os": [
|
||||
"darwin"
|
||||
@ -8269,6 +8204,7 @@
|
||||
"cpu": [
|
||||
"x64"
|
||||
],
|
||||
"dev": true,
|
||||
"optional": true,
|
||||
"os": [
|
||||
"freebsd"
|
||||
@ -8288,6 +8224,7 @@
|
||||
"cpu": [
|
||||
"arm"
|
||||
],
|
||||
"dev": true,
|
||||
"optional": true,
|
||||
"os": [
|
||||
"linux"
|
||||
@ -8307,6 +8244,7 @@
|
||||
"cpu": [
|
||||
"arm64"
|
||||
],
|
||||
"dev": true,
|
||||
"optional": true,
|
||||
"os": [
|
||||
"linux"
|
||||
@ -8326,6 +8264,7 @@
|
||||
"cpu": [
|
||||
"arm64"
|
||||
],
|
||||
"dev": true,
|
||||
"optional": true,
|
||||
"os": [
|
||||
"linux"
|
||||
@ -8345,6 +8284,7 @@
|
||||
"cpu": [
|
||||
"x64"
|
||||
],
|
||||
"dev": true,
|
||||
"optional": true,
|
||||
"os": [
|
||||
"linux"
|
||||
@ -8364,6 +8304,7 @@
|
||||
"cpu": [
|
||||
"x64"
|
||||
],
|
||||
"dev": true,
|
||||
"optional": true,
|
||||
"os": [
|
||||
"linux"
|
||||
@ -8383,6 +8324,7 @@
|
||||
"cpu": [
|
||||
"x64"
|
||||
],
|
||||
"dev": true,
|
||||
"optional": true,
|
||||
"os": [
|
||||
"win32"
|
||||
@ -10064,12 +10006,6 @@
|
||||
"url": "https://github.com/sponsors/sindresorhus"
|
||||
}
|
||||
},
|
||||
"node_modules/open-location-code": {
|
||||
"version": "1.0.3",
|
||||
"resolved": "https://registry.npmjs.org/open-location-code/-/open-location-code-1.0.3.tgz",
|
||||
"integrity": "sha512-DBm14BSn40Ee241n80zIFXIT6+y8Tb0I+jTdosLJ8Sidvr2qONvymwqymVbHV2nS+1gkDZ5eTNpnOIVV0Kn2fw==",
|
||||
"optional": true
|
||||
},
|
||||
"node_modules/optionator": {
|
||||
"version": "0.9.4",
|
||||
"resolved": "https://registry.npmjs.org/optionator/-/optionator-0.9.4.tgz",
|
||||
@ -10120,11 +10056,6 @@
|
||||
"url": "https://github.com/chalk/chalk?sponsor=1"
|
||||
}
|
||||
},
|
||||
"node_modules/osrm-text-instructions": {
|
||||
"version": "0.13.4",
|
||||
"resolved": "https://registry.npmjs.org/osrm-text-instructions/-/osrm-text-instructions-0.13.4.tgz",
|
||||
"integrity": "sha512-ge4ZTIetMQKAHKq2MwWf83ntzdJN20ndRKRaVNoZ3SkDkBNO99Qddz7r6+hrVx38I+ih6Rk5T1yslczAB6Q9Pg=="
|
||||
},
|
||||
"node_modules/p-limit": {
|
||||
"version": "5.0.0",
|
||||
"resolved": "https://registry.npmjs.org/p-limit/-/p-limit-5.0.0.tgz",
|
||||
@ -10968,7 +10899,8 @@
|
||||
"node_modules/regenerator-runtime": {
|
||||
"version": "0.14.1",
|
||||
"resolved": "https://registry.npmjs.org/regenerator-runtime/-/regenerator-runtime-0.14.1.tgz",
|
||||
"integrity": "sha512-dYnhHh0nJoMfnkZs6GmmhFknAGRrLznOu5nc9ML+EJxGvrx6H7teuevqVqCuPcPK//3eDrrjQhehXVx9cnkGdw=="
|
||||
"integrity": "sha512-dYnhHh0nJoMfnkZs6GmmhFknAGRrLznOu5nc9ML+EJxGvrx6H7teuevqVqCuPcPK//3eDrrjQhehXVx9cnkGdw==",
|
||||
"dev": true
|
||||
},
|
||||
"node_modules/regexp.prototype.flags": {
|
||||
"version": "1.5.2",
|
||||
@ -12340,6 +12272,7 @@
|
||||
"version": "2.3.0",
|
||||
"resolved": "https://registry.npmjs.org/tailwind-merge/-/tailwind-merge-2.3.0.tgz",
|
||||
"integrity": "sha512-vkYrLpIP+lgR0tQCG6AP7zZXCTLc1Lnv/CCRT3BqJ9CZ3ui2++GPaGb1x/ILsINIMSYqqvrpqjUFsMNLlW99EA==",
|
||||
"dev": true,
|
||||
"dependencies": {
|
||||
"@babel/runtime": "^7.24.1"
|
||||
},
|
||||
|
@ -16,32 +16,38 @@
|
||||
},
|
||||
"dependencies": {
|
||||
"@astrojs/node": "^8.2.5",
|
||||
"@astrojs/rss": "^4.0.5",
|
||||
"@astrojs/sitemap": "^3.1.4",
|
||||
"@astrojs/tailwind": "^5.1.0",
|
||||
"@astrolib/analytics": "^0.5.0",
|
||||
"@astrolib/seo": "^1.0.0-beta.5",
|
||||
"@fontsource-variable/inter": "^5.0.18",
|
||||
"@tailwindcss/typography": "^0.5.12",
|
||||
"astro": "^4.8.3",
|
||||
"astro-embed": "^0.7.2",
|
||||
"astro-icon": "^1.1.0",
|
||||
"leaflet": "^1.9.4",
|
||||
"leaflet-control-geocoder": "^2.4.0",
|
||||
"leaflet-geosearch": "^4.0.0",
|
||||
"leaflet-routing-machine": "^3.2.12",
|
||||
"limax": "4.1.0",
|
||||
"lodash.merge": "^4.6.2",
|
||||
"lucide-astro": "^0.372.0",
|
||||
"pocketbase": "^0.21.1",
|
||||
"react-leaflet": "^4.2.1",
|
||||
"simple-icons-astro": "^11.12.0",
|
||||
"tailwind-merge": "^2.3.0",
|
||||
"tailwindcss": "^3.4.3",
|
||||
"unpic": "^3.18.0"
|
||||
"@astrojs/rss": "^4.0.5",
|
||||
"@astrojs/sitemap": "^3.1.4",
|
||||
"@astrolib/analytics": "^0.5.0",
|
||||
"@astrolib/seo": "^1.0.0-beta.5",
|
||||
"@fontsource-variable/inter": "^5.0.18",
|
||||
"astro": "^4.8.3",
|
||||
"astro-embed": "^0.7.2",
|
||||
"astro-icon": "^1.1.0",
|
||||
"limax": "4.1.0",
|
||||
"lodash.merge": "^4.6.2",
|
||||
"unpic": "^3.18.0",
|
||||
"tailwind-merge": "^2.3.0"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@astrojs/check": "^0",
|
||||
"@types/leaflet": "^1.9.12",
|
||||
"@types/node": "^20",
|
||||
"@typescript-eslint/eslint-plugin": "^6.21.0",
|
||||
"@typescript-eslint/parser": "^6.21.0",
|
||||
"@vitest/coverage-v8": "^1",
|
||||
"eslint": "^8.57.0",
|
||||
"eslint-plugin-astro": "^0.31.4",
|
||||
"typescript": "^5",
|
||||
"vitest": "^1",
|
||||
"@astrojs/mdx": "^3.0.0",
|
||||
"@astrojs/partytown": "^2.1.0",
|
||||
"@astrojs/tailwind": "5.1.0",
|
||||
@ -52,16 +58,8 @@
|
||||
"@tailwindcss/typography": "^0.5.13",
|
||||
"@types/eslint__js": "^8.42.3",
|
||||
"@types/js-yaml": "^4.0.9",
|
||||
"@types/leaflet": "^1.9.12",
|
||||
"@types/leaflet-routing-machine": "^3.2.8",
|
||||
"@types/lodash.merge": "^4.6.9",
|
||||
"@types/node": "^20",
|
||||
"@typescript-eslint/eslint-plugin": "^6.21.0",
|
||||
"@typescript-eslint/parser": "^6.21.0",
|
||||
"@vitest/coverage-v8": "^1",
|
||||
"astro-eslint-parser": "^1.0.2",
|
||||
"eslint": "^8.57.0",
|
||||
"eslint-plugin-astro": "^0.31.4",
|
||||
"eslint-plugin-jsx-a11y": "^6.8.0",
|
||||
"globals": "^15.2.0",
|
||||
"js-yaml": "^4.1.0",
|
||||
@ -72,8 +70,6 @@
|
||||
"rehype-plugin-image-native-lazy-loading": "^1.2.0",
|
||||
"sharp": "0.33.3",
|
||||
"tailwindcss": "^3.4.3",
|
||||
"typescript": "^5",
|
||||
"typescript-eslint": "^7.9.0",
|
||||
"vitest": "^1"
|
||||
"typescript-eslint": "^7.9.0"
|
||||
}
|
||||
}
|
||||
|
@ -1,30 +0,0 @@
|
||||
---
|
||||
import type { Input as Props } from 'types';
|
||||
|
||||
const {value, checked ,name, label, autocomplete, placeholder, divClass, inputClass} = Astro.props;
|
||||
|
||||
---
|
||||
|
||||
<>
|
||||
{
|
||||
name && (
|
||||
<div class={"flex flex-row items-center " + divClass}>
|
||||
<input
|
||||
type="checkbox"
|
||||
name={name}
|
||||
id={name}
|
||||
checked={checked}
|
||||
value={value}
|
||||
autocomplete={autocomplete}
|
||||
placeholder={placeholder}
|
||||
class={"mr-2 size-5 " + inputClass}
|
||||
/>
|
||||
{label && (
|
||||
<label for={name} class="block text-lg font-medium">
|
||||
{label}
|
||||
</label>
|
||||
)}
|
||||
</div>
|
||||
)
|
||||
}
|
||||
</>
|
@ -1,19 +0,0 @@
|
||||
---
|
||||
|
||||
export interface Props {
|
||||
values: Array<{label:String, name:string, checked?:boolean | undefined}>
|
||||
}
|
||||
|
||||
|
||||
const fields = Astro.props.values
|
||||
|
||||
---
|
||||
|
||||
<>
|
||||
<div class="flex, flex-col">
|
||||
{fields.map(value => (
|
||||
<input type="radio" id={value.name} name="note-min" value={value.name} checked={value.checked}>
|
||||
<label for={value.name} class="ml-1">{value.label}</label><br>
|
||||
))}
|
||||
</div>
|
||||
</>
|
@ -26,7 +26,7 @@ export interface Props {
|
||||
const { socialLinks = [], secondaryLinks = [], links = [], footNote = '', theme = 'light' } = Astro.props;
|
||||
---
|
||||
|
||||
<footer class:list={[{ dark: theme === 'dark' }, 'relative border-t border-gray-200 dark:border-slate-800 not-prose, mt-auto, h-{11rem}']}>
|
||||
<footer class:list={[{ dark: theme === 'dark' }, 'relative border-t border-gray-200 dark:border-slate-800 not-prose, mt-auto']}>
|
||||
<div class="dark:bg-dark absolute inset-0 pointer-events-none" aria-hidden="true"></div>
|
||||
<div class="relative max-w-7xl mx-auto px-4 sm:px-6 dark:text-slate-300">
|
||||
<div class="grid grid-cols-12 gap-4 gap-y-8 sm:gap-8 py-8 md:py-12">
|
||||
|
@ -55,7 +55,7 @@ const currentPath = `/${trimSlash(new URL(Astro.url).pathname)}`
|
||||
<header
|
||||
class:list={[
|
||||
{ sticky: isSticky, relative: !isSticky, dark: isDark },
|
||||
'top-0 z-[1001] h-[5rem] bg-page flex-none mx-auto w-full border-b border-gray-50/0 transition-[opacity] ease-in-out',
|
||||
'top-0 z-40 flex-none mx-auto w-full border-b border-gray-50/0 transition-[opacity] ease-in-out',
|
||||
]}
|
||||
{...isSticky ? { 'data-aw-sticky-header': true } : {}}
|
||||
{...id ? { id } : {}}
|
||||
@ -88,7 +88,7 @@ const currentPath = `/${trimSlash(new URL(Astro.url).pathname)}`
|
||||
aria-label="Main navigation"
|
||||
>
|
||||
<ul
|
||||
class="flex flex-col bg-page md:flex-row md:self-center w-full md:w-auto text-xl md:text-[0.9375rem] tracking-[0.01rem] font-medium md:justify-center"
|
||||
class="flex flex-col md:flex-row md:self-center w-full md:w-auto text-xl md:text-[0.9375rem] tracking-[0.01rem] font-medium md:justify-center"
|
||||
>
|
||||
{
|
||||
links.map(({ text, href, links }) => (
|
||||
|
@ -3,16 +3,119 @@ import { getPermalink, getBlogPermalink } from './utils/permalinks'
|
||||
export const headerData = {
|
||||
links: [
|
||||
{
|
||||
text: 'Explorer POI',
|
||||
href: '/maps',
|
||||
text: 'Homes',
|
||||
links: [
|
||||
{
|
||||
text: 'SaaS',
|
||||
href: getPermalink('/homes/saas'),
|
||||
},
|
||||
{
|
||||
text: 'Startup',
|
||||
href: getPermalink('/homes/startup'),
|
||||
},
|
||||
{
|
||||
text: 'Mobile App',
|
||||
href: getPermalink('/homes/mobile-app'),
|
||||
},
|
||||
{
|
||||
text: 'Personal',
|
||||
href: getPermalink('/homes/personal'),
|
||||
},
|
||||
],
|
||||
},
|
||||
{
|
||||
text: 'itinéraire',
|
||||
href: '/maps/find_route',
|
||||
{
|
||||
text: 'Pages',
|
||||
links: [
|
||||
{
|
||||
text: 'Features (Anchor Link)',
|
||||
href: getPermalink('/#features'),
|
||||
},
|
||||
{
|
||||
text: 'Services',
|
||||
href: getPermalink('/services'),
|
||||
},
|
||||
{
|
||||
text: 'Pricing',
|
||||
href: getPermalink('/pricing'),
|
||||
},
|
||||
{
|
||||
text: 'About us',
|
||||
href: getPermalink('/about'),
|
||||
},
|
||||
{
|
||||
text: 'Contact',
|
||||
href: getPermalink('/contact'),
|
||||
},
|
||||
{
|
||||
text: 'Terms',
|
||||
href: getPermalink('/terms'),
|
||||
},
|
||||
{
|
||||
text: 'Privacy policy',
|
||||
href: getPermalink('/privacy'),
|
||||
},
|
||||
],
|
||||
},
|
||||
{
|
||||
text: 'Compte',
|
||||
href: '/account',
|
||||
{
|
||||
text: 'Landing',
|
||||
links: [
|
||||
{
|
||||
text: 'Lead Generation',
|
||||
href: getPermalink('/landing/lead-generation'),
|
||||
},
|
||||
{
|
||||
text: 'Long-form Sales',
|
||||
href: getPermalink('/landing/sales'),
|
||||
},
|
||||
{
|
||||
text: 'Click-Through',
|
||||
href: getPermalink('/landing/click-through'),
|
||||
},
|
||||
{
|
||||
text: 'Product Details (or Services)',
|
||||
href: getPermalink('/landing/product'),
|
||||
},
|
||||
{
|
||||
text: 'Coming Soon or Pre-Launch',
|
||||
href: getPermalink('/landing/pre-launch'),
|
||||
},
|
||||
{
|
||||
text: 'Subscription',
|
||||
href: getPermalink('/landing/subscription'),
|
||||
},
|
||||
],
|
||||
},
|
||||
{
|
||||
text: 'Blog',
|
||||
links: [
|
||||
{
|
||||
text: 'Blog List',
|
||||
href: getBlogPermalink(),
|
||||
},
|
||||
{
|
||||
text: 'Article',
|
||||
href: getPermalink(
|
||||
'get-started-website-with-astro-tailwind-css',
|
||||
'post'
|
||||
),
|
||||
},
|
||||
{
|
||||
text: 'Article (with MDX)',
|
||||
href: getPermalink('markdown-elements-demo-post', 'post'),
|
||||
},
|
||||
{
|
||||
text: 'Category Page',
|
||||
href: getPermalink('tutorials', 'category'),
|
||||
},
|
||||
{
|
||||
text: 'Tag Page',
|
||||
href: getPermalink('astro', 'tag'),
|
||||
},
|
||||
],
|
||||
},
|
||||
{
|
||||
text: 'Widgets',
|
||||
href: '#',
|
||||
},
|
||||
],
|
||||
// actions: [
|
||||
|
31
front/src/pages/maps.astro
Normal file
31
front/src/pages/maps.astro
Normal file
@ -0,0 +1,31 @@
|
||||
---
|
||||
import Layout from 'layouts/PageLayout.astro';
|
||||
import 'leaflet/dist/leaflet.css'
|
||||
|
||||
const metadata = {
|
||||
title: 'Maps',
|
||||
ignoreTitleTemplate: true,
|
||||
};
|
||||
---
|
||||
|
||||
<Layout metadata={metadata}>
|
||||
|
||||
<div class="w-full h-96" id="map" />
|
||||
|
||||
|
||||
</Layout>
|
||||
|
||||
<script>
|
||||
import L from 'leaflet'
|
||||
|
||||
const map = L.map('map', {
|
||||
center: [50,0],
|
||||
zoom: 13,
|
||||
preferCanvas: true
|
||||
})
|
||||
L.tileLayer('https://tile.openstreetmap.org/{z}/{x}/{y}.png', {
|
||||
maxZoom: 19,
|
||||
attribution: '© <a href="http://www.openstreetmap.org/copyright">OpenStreetMap</a>'
|
||||
}).addTo(map);
|
||||
var marker = L.marker([51.5, -0.09]).addTo(map);
|
||||
</script>
|
@ -1,87 +0,0 @@
|
||||
---
|
||||
import Layout from 'layouts/PageLayout.astro'
|
||||
import 'leaflet/dist/leaflet.css'
|
||||
import 'leaflet-routing-machine/dist/leaflet-routing-machine.css'
|
||||
import FormContainer from 'components/ui/Form.astro'
|
||||
import Input from 'components/Input.astro'
|
||||
import Button from 'components/ui/Button.astro'
|
||||
|
||||
const metadata = {
|
||||
title: 'Maps',
|
||||
ignoreTitleTemplate: true,
|
||||
}
|
||||
---
|
||||
|
||||
<Layout metadata={metadata}>
|
||||
|
||||
<div class="h-[calc(100vh-5rem)] flex flex-col">
|
||||
<div class="w-full h-96 grow" id="map" />
|
||||
<Button id="test-btn">test</Button>
|
||||
</div>
|
||||
<!-- for remouve footer -->
|
||||
<div slot="footer"></div>
|
||||
</Layout>
|
||||
|
||||
<script>
|
||||
import * as L from 'leaflet'
|
||||
import markerShadow from "leaflet/dist/images/marker-shadow.png"
|
||||
import markerIcon from "leaflet/dist/images/marker-icon.png"
|
||||
import 'leaflet-routing-machine/dist/leaflet-routing-machine.js'
|
||||
import 'leaflet-control-geocoder/dist/Control.Geocoder.js'
|
||||
|
||||
const icon = {icon: new L.Icon({iconUrl: markerIcon.src, shadowUrl: markerShadow.src, iconAnchor: [13,41]})}
|
||||
|
||||
// declare map
|
||||
const map = L.map('map', {
|
||||
center: [51.5, -0.09],
|
||||
zoom: 13,
|
||||
preferCanvas: true,
|
||||
zoomControl: false
|
||||
})
|
||||
L.tileLayer('https://tile.openstreetmap.org/{z}/{x}/{y}.png', {
|
||||
maxZoom: 19,
|
||||
attribution: '© <a href="http://www.openstreetmap.org/copyright">OpenStreetMap</a>'
|
||||
}).addTo(map)
|
||||
|
||||
// move zoom ctl to bottom
|
||||
L.control.zoom({
|
||||
position: 'bottomleft'
|
||||
}).addTo(map);
|
||||
|
||||
const routing = L.Routing.control({
|
||||
// utile pour afficher des route stocké
|
||||
// waypoints: [
|
||||
// L.latLng(46.6705431, -1.4269698),
|
||||
// L.latLng(47.218536, -1.554075)
|
||||
// ],
|
||||
routeWhileDragging: true,
|
||||
//@ts-ignore
|
||||
geocoder: L.Control.Geocoder.nominatim(),
|
||||
//@ts-ignore
|
||||
position: 'topleft',
|
||||
showAlternatives: true,
|
||||
reverseWaypoints: true,
|
||||
altLineOptions: {
|
||||
missingRouteTolerance: 50,
|
||||
extendToWaypoints: true,
|
||||
styles: [
|
||||
{color: 'black', opacity: 0.15, weight: 9},
|
||||
{color: 'white', opacity: 0.2, weight: 6},
|
||||
{color: 'blue', opacity: 5, weight: 2}
|
||||
]
|
||||
}
|
||||
}).addTo(map).on('routeselected', (e) => {
|
||||
console.log("iténeraire choisie")
|
||||
console.log(e)
|
||||
}).on('routesfound', (e) =>{
|
||||
console.log("route trouvé")
|
||||
console.log(e)
|
||||
})
|
||||
document.querySelector<HTMLButtonElement>('#test-btn')?.addEventListener('click', () => {
|
||||
routing.setWaypoints(
|
||||
[L.latLng(46.6705431, -1.4269698),L.latLng(47.218536, -1.554075)]
|
||||
)
|
||||
routing.route();
|
||||
})
|
||||
|
||||
</script>
|
@ -1,281 +0,0 @@
|
||||
---
|
||||
import Layout from 'layouts/PageLayout.astro'
|
||||
import 'leaflet/dist/leaflet.css'
|
||||
import 'leaflet-geosearch/dist/geosearch.css'
|
||||
import CheckBox from 'components/CheckBox.astro'
|
||||
import Radios from 'components/Radios.astro'
|
||||
import ListResult, { type RecordModel } from 'pocketbase'
|
||||
import { Expand, Trash } from 'lucide-astro'
|
||||
|
||||
const pb = Astro.locals.pb
|
||||
const connected = pb.authStore.isValid
|
||||
|
||||
const metadata = {
|
||||
title: 'Maps',
|
||||
ignoreTitleTemplate: true,
|
||||
}
|
||||
|
||||
let fav = new Array<any>
|
||||
|
||||
if(connected){
|
||||
try {
|
||||
const request = await pb.collection('user_poi').getList(1,10,{filter:`owner="${pb.authStore.model!.id}"`, expand:"poi_list"})
|
||||
request.items.forEach(element => {
|
||||
fav.push(element.expand!.poi_list.Poi)
|
||||
});
|
||||
} catch (error) {
|
||||
console.log(error);
|
||||
}
|
||||
}
|
||||
|
||||
console.log(fav);
|
||||
|
||||
|
||||
---
|
||||
|
||||
<Layout metadata={metadata}>
|
||||
|
||||
<div class="h-[calc(100vh-5rem)] flex flex-row">
|
||||
<div class="w-1/5 flex flex-col">
|
||||
<p id="message" class="hidden text-center mb-3">pouet</p>
|
||||
<p class="text-center text-2xl mb-3">Filtre :</p>
|
||||
<div class="">
|
||||
<p>note minimal :</p>
|
||||
<Radios
|
||||
values={[
|
||||
{name: "1", label: "1", checked: true},
|
||||
{name: "2", label: "2"},
|
||||
{name: "3", label: "3"},
|
||||
{name: "1h", label: "1h"},
|
||||
{name: "2h", label: "2h"},
|
||||
{name: "3h", label: "3h"},
|
||||
]}
|
||||
/>
|
||||
<p class="text-center text-xl mb-3">Type POI :</p>
|
||||
<CheckBox
|
||||
label="Bar, Pub, Café,..."
|
||||
name="filter"
|
||||
value="drink"
|
||||
checked
|
||||
/>
|
||||
</div>
|
||||
<div class="mb-3 grow">
|
||||
<p class="text-center text-xl mb-3">Source :</p>
|
||||
<CheckBox
|
||||
label="Open Trip Maps"
|
||||
name="filter"
|
||||
value="otm"
|
||||
checked
|
||||
/>
|
||||
</div>
|
||||
{connected && (
|
||||
<div class="mb-2">
|
||||
<p class="text-center text-xl mb-3">Favori :</p>
|
||||
{fav.map(val =>(
|
||||
<div class="ml-2 flex flex-row mb-1" id="fav-div">
|
||||
<p class="grow poi-favori" id={val.id} data-pos={val.geometry.coordinates}>{val.properties.name}</p>
|
||||
<Trash id={val.id} class="poi-trash"/>
|
||||
</div>
|
||||
))}
|
||||
</div>
|
||||
)}
|
||||
</div>
|
||||
<div class="flex flex-col h-full grow">
|
||||
<div class="w-full h-full grow" id="map" />
|
||||
</div>
|
||||
</div>
|
||||
<!-- TODO: faire en sort que le style soit propre -->
|
||||
|
||||
<!-- for remouve footer -->
|
||||
<div slot="footer"></div>
|
||||
<!-- penser a rm 11 au rem au dessus pour la taille -->
|
||||
</Layout>
|
||||
|
||||
<script>
|
||||
import L, {Popup} from 'leaflet'
|
||||
import markerShadow from "leaflet/dist/images/marker-shadow.png"
|
||||
import markerIcon from "leaflet/dist/images/marker-icon.png"
|
||||
import { OpenStreetMapProvider } from 'leaflet-geosearch'
|
||||
import { GeoSearchControl } from 'leaflet-geosearch'
|
||||
|
||||
const showFav = document.querySelectorAll(".poi-favori")
|
||||
const trashFav = document.querySelectorAll(".poi-trash")
|
||||
const favDiv = document.querySelector('#fav-div')
|
||||
|
||||
const icon = {icon: new L.Icon({iconUrl: markerIcon.src, shadowUrl: markerShadow.src, iconAnchor: [13,41]})}
|
||||
|
||||
// const BACK_URL = "http://localhost:3001/" //XXX : mettre url de prod
|
||||
const BACK_URL = "https://drink-tweb.cb85.fr/" //XXX : mettre url de prod
|
||||
|
||||
// declare map
|
||||
const map = L.map('map', {
|
||||
center: [51.5, -0.09],
|
||||
zoom: 13,
|
||||
preferCanvas: true,
|
||||
zoomControl: false
|
||||
})
|
||||
L.tileLayer('https://tile.openstreetmap.org/{z}/{x}/{y}.png', {
|
||||
maxZoom: 19,
|
||||
attribution: '© <a href="http://www.openstreetmap.org/copyright">OpenStreetMap</a>'
|
||||
}).addTo(map)
|
||||
|
||||
// move zoom ctl to bottom
|
||||
L.control.zoom({
|
||||
position: 'bottomleft'
|
||||
}).addTo(map)
|
||||
|
||||
const provider = new OpenStreetMapProvider()
|
||||
|
||||
map.addControl(
|
||||
GeoSearchControl({
|
||||
notFoundMessage: 'Adresse introuvable !',
|
||||
provider,
|
||||
showMarker: false,
|
||||
style: 'bar',
|
||||
}),
|
||||
)
|
||||
|
||||
async function saveToFav(element: any, save: boolean){
|
||||
const url = '/maps/save_poi';
|
||||
const options = {
|
||||
method: 'POST',
|
||||
body: JSON.stringify({Poi : element, save: save})
|
||||
};
|
||||
|
||||
try {
|
||||
const response = await fetch(url, options);
|
||||
const data = await response.json();
|
||||
console.log(data);
|
||||
} catch (error) {
|
||||
console.error(error);
|
||||
}
|
||||
}
|
||||
|
||||
function eventGotoFav(e: Element){
|
||||
e.addEventListener('click', () =>{
|
||||
const pose = e.getAttribute('data-pos')?.split(',')
|
||||
map.panTo(new L.LatLng(parseFloat(pose![1]),parseFloat(pose![0])))
|
||||
})
|
||||
}
|
||||
|
||||
function eventRemoveFav(e: Element){
|
||||
e.addEventListener('click', async () => {
|
||||
await saveToFav({id:e.id, type:"Feature"},false)
|
||||
document.location.reload()
|
||||
})
|
||||
}
|
||||
|
||||
showFav.forEach(e => {eventGotoFav(e)})
|
||||
trashFav.forEach(e => {eventRemoveFav(e)})
|
||||
|
||||
let poiMarkers = new Array<L.Marker>
|
||||
let minimalNote = "1"
|
||||
let drink = true
|
||||
let otm = true
|
||||
|
||||
// run api search
|
||||
function searchBox(){
|
||||
const nordWest = map.getBounds().getNorthWest()
|
||||
const southEast = map.getBounds().getSouthEast()
|
||||
const params: URLSearchParams = new URLSearchParams()
|
||||
|
||||
params.append("lon1", nordWest.lng.toString())
|
||||
params.append("lat1", nordWest.lat.toString())
|
||||
params.append("lon2", southEast.lng.toString())
|
||||
params.append("lat2", southEast.lat.toString())
|
||||
params.append("rate", minimalNote)
|
||||
|
||||
if(drink && otm){
|
||||
fetch(`${BACK_URL}otm/box?${params.toString()}`,{method: 'GET',headers: {'Content-Type': 'application/json',}}).then(function (response) {
|
||||
return response.json()
|
||||
}).then(function (data) {
|
||||
poiMarkers.forEach(element => {
|
||||
element.remove()
|
||||
})
|
||||
console.log(data)
|
||||
data.features.forEach(element => {
|
||||
const prop = element.properties
|
||||
const popup: Popup = new Popup()
|
||||
let tags = new String()
|
||||
prop.kinds.split(",").forEach(element => {
|
||||
tags += "- " + element + "<br/>"
|
||||
})
|
||||
const poiMarker = L.marker([element.geometry.coordinates[1],element.geometry.coordinates[0]],icon)
|
||||
.bindPopup(`<b>${prop.name}</b><br/>note : ${prop.rate} <br/>tags:<br/> ${tags} <p>favori : <input type="checkbox" name="like" id=${element.id}/><p>`)
|
||||
.on("click", () => {
|
||||
document.querySelectorAll<HTMLInputElement>('input[name="like"]').forEach(e => {
|
||||
e.addEventListener("click", async () => {
|
||||
console.log(element)
|
||||
await saveToFav(element, e.checked)
|
||||
document.location.reload()
|
||||
})
|
||||
})
|
||||
})
|
||||
poiMarker.addTo(map)
|
||||
poiMarkers.push(poiMarker)
|
||||
})
|
||||
}).catch(function (err) {
|
||||
console.warn('Something went wrong.', err)
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
// fonciton pour lancer la recherche de box sur l'api
|
||||
function sender(){
|
||||
if(map.getZoom() >= 13){
|
||||
console.log("zoom OKAY")
|
||||
//TODO: mettre un message de recherche en cour
|
||||
searchBox()
|
||||
}else{
|
||||
console.log("zoom more to see result")
|
||||
}
|
||||
}
|
||||
// envent pour lancer la recherche
|
||||
const cooldown = 400
|
||||
sender()
|
||||
let timeoutHandle = window.setTimeout(sender, cooldown)
|
||||
|
||||
window.clearTimeout(timeoutHandle)
|
||||
|
||||
map.addEventListener("move",() =>{
|
||||
window.clearTimeout(timeoutHandle)
|
||||
timeoutHandle = window.setTimeout(sender, cooldown)
|
||||
})
|
||||
|
||||
map.addEventListener("zoom", () => {
|
||||
if(map.getZoom() <= 11){
|
||||
poiMarkers.forEach(element => {
|
||||
element.remove()
|
||||
})
|
||||
}
|
||||
})
|
||||
|
||||
document.querySelectorAll<HTMLInputElement>("input[name='filter']").forEach(e =>{
|
||||
e.addEventListener("click", () => {
|
||||
switch (e.value) {
|
||||
case "drink":
|
||||
drink = e.checked
|
||||
break;
|
||||
|
||||
case "otm":
|
||||
otm = e.checked
|
||||
break;
|
||||
|
||||
default:
|
||||
break;
|
||||
}
|
||||
poiMarkers.forEach(element => {
|
||||
element.remove()
|
||||
})
|
||||
searchBox()
|
||||
})
|
||||
})
|
||||
|
||||
document.querySelectorAll<HTMLInputElement>('input[name="note-min"]').forEach(e => {
|
||||
e.addEventListener("click", () => {
|
||||
minimalNote = e.value
|
||||
searchBox()
|
||||
})
|
||||
})
|
||||
|
||||
</script>
|
@ -1,47 +0,0 @@
|
||||
---
|
||||
import AstroUtils from "libs/AstroUtils";
|
||||
import type { RecordModel } from "pocketbase";
|
||||
|
||||
|
||||
const pb = Astro.locals.pb
|
||||
|
||||
if(!pb.authStore.isValid){
|
||||
return Astro.redirect("/account")
|
||||
}
|
||||
|
||||
await AstroUtils.wrap(async () => {
|
||||
if (Astro.request.method !== 'POST') {
|
||||
return
|
||||
}
|
||||
const poiJson = await Astro.request.json()
|
||||
|
||||
const data = {Poi: poiJson.Poi, Poi_id:poiJson.Poi.id}
|
||||
|
||||
let record: RecordModel
|
||||
|
||||
try {
|
||||
record = await pb.collection('POI').create(data);
|
||||
} catch (error) {
|
||||
try{
|
||||
record = await pb.collection('POI').getFirstListItem(`Poi_id="${poiJson.Poi.id}"`)
|
||||
} catch (error2) {
|
||||
console.log("error 1 :")
|
||||
console.log(error)
|
||||
console.log("error 2 :")
|
||||
console.log(error2)
|
||||
}
|
||||
}
|
||||
|
||||
try {
|
||||
if(poiJson.save){
|
||||
await pb.collection('user_poi').create({owner: pb.authStore.model!.id, poi_list:record!.id})
|
||||
}else{
|
||||
record = await pb.collection('user_poi').getFirstListItem(`poi_list="${record!.id}"&&owner="${pb.authStore.model!.id}"`)
|
||||
await pb.collection('user_poi').delete(record.id)
|
||||
}
|
||||
} catch (error) {
|
||||
console.log(error)
|
||||
}
|
||||
|
||||
})
|
||||
---
|
4
front/src/types.d.ts
vendored
4
front/src/types.d.ts
vendored
@ -162,15 +162,13 @@ export interface Testimonial {
|
||||
}
|
||||
|
||||
export interface Input {
|
||||
type?: HTMLInputTypeAttribute
|
||||
type: HTMLInputTypeAttribute
|
||||
name: string
|
||||
label?: string
|
||||
autocomplete?: string
|
||||
placeholder?: string
|
||||
divClass?: string
|
||||
inputClass?: string
|
||||
checked?: bool
|
||||
value?:string
|
||||
}
|
||||
|
||||
export interface Textarea {
|
||||
|
Reference in New Issue
Block a user