diff --git a/src/Store.ts b/src/Store.ts index 69b5a0c..01b8c41 100644 --- a/src/Store.ts +++ b/src/Store.ts @@ -13,6 +13,8 @@ export class Store { private appState: ApplicationState = reactive({ isMenuVisible: false, isPopUpVisible: false, + isImageModalVisible: false, + imageModalUrl: "", popUpType: null, popUpData: null, virtualVisitAlreadyOpened: false, @@ -55,6 +57,14 @@ export class Store { this.appState.isPopUpVisible = !this.appState.isPopUpVisible } + public updateImageModalVisibility (visibility: boolean) { + this.appState.isImageModalVisible = visibility + } + + public setImageModalUrl (url: string) { + this.appState.imageModalUrl = url + } + public setPopUpData (data: OpsData | OtherData, type: PopUpType) { this.appState.popUpType = type this.appState.popUpData = data diff --git a/src/classes/State.ts b/src/classes/State.ts index 17937d1..6fe04c1 100644 --- a/src/classes/State.ts +++ b/src/classes/State.ts @@ -23,6 +23,8 @@ export enum PopUpType { export interface ApplicationState { isMenuVisible: boolean; isPopUpVisible: boolean; + isImageModalVisible: boolean; + imageModalUrl: string; popUpType: PopUpType | null; popUpData: OpsData | OtherData | null; virtualVisitAlreadyOpened: boolean; diff --git a/src/classes/data/OpsData.ts b/src/classes/data/OpsData.ts index a93b326..a9e41d9 100644 --- a/src/classes/data/OpsData.ts +++ b/src/classes/data/OpsData.ts @@ -26,11 +26,11 @@ export interface OpsData { boatType : string nbNationalities : string transfertType : string - imageSrc: string[] - videoSrc: string[] + imageSrc: string + videoSrc: string portDisembarkation : string - testimonyName: string[] - testimonySrc: string[] + testimonyName: string + testimonySrc: string } const createDate = function (dateDayFirst: string) { @@ -84,13 +84,13 @@ const convertOpsData = function (rawOpsData: {[key: string]: string}, metadataEr res.boatType = rawOpsData.boatType res.nbNationalities = rawOpsData.typeNationalities res.transfertType = rawOpsData.transfertType - res.imageSrc = rawOpsData.imageSrc ? rawOpsData.imageSrc.split(";") : [] - res.videoSrc = rawOpsData.videoSrv ? rawOpsData.videoSrv.split(";") : [] + res.imageSrc = rawOpsData.imageSrc + res.videoSrc = rawOpsData.videoSrv res.portDisembarkation = rawOpsData.PortDisembarkation - res.testimonyName = rawOpsData.testimonyName ? rawOpsData.testimonyName.split(";") : [] - if (res.testimonyName.length === 1) res.testimonyName = res.testimonyName.pop() as unknown as string[] - res.testimonySrc = rawOpsData.testimonySrc ? rawOpsData.testimonySrc.split(";") : [] - if (res.testimonySrc.length === 1) res.testimonySrc = res.testimonySrc.pop() as unknown as string[] + res.testimonyName = rawOpsData.testimonyName + // if (res.testimonyName.length === 1) res.testimonyName = res.testimonyName.pop() as unknown as string[] + res.testimonySrc = rawOpsData.testimonySrc + // if (res.testimonySrc.length === 1) res.testimonySrc = res.testimonySrc.pop() as unknown as string[] return res } diff --git a/src/components/PopUp.vue b/src/components/PopUp.vue index 9bc7ed5..943be84 100644 --- a/src/components/PopUp.vue +++ b/src/components/PopUp.vue @@ -10,11 +10,25 @@ + +
+
+
+ +
+
+
+
diff --git a/src/components/Stats.vue b/src/components/Stats.vue index 4e6e05b..c3f5f85 100644 --- a/src/components/Stats.vue +++ b/src/components/Stats.vue @@ -42,17 +42,17 @@

- +

{{ $t("stats.females") }}

- +

{{ $t("stats.males") }}

- +

{{ $t("stats.minors") }}

@@ -73,7 +73,7 @@
- +

{{ $t("stats.children") }}

diff --git a/src/components/popUpContent/DeathDescription.vue b/src/components/popUpContent/DeathDescription.vue index 138f6a5..749caa0 100644 --- a/src/components/popUpContent/DeathDescription.vue +++ b/src/components/popUpContent/DeathDescription.vue @@ -7,10 +7,10 @@

{{ format(deathData.date, "full") }}


-

{{ $t("popup.boatInvolved") }}: +

{{ $t("popup.boatInvolved") }}: {{ deathData.boatInvolved }}

-

{{ $t("popup.peoplesNB") }}: +

{{ $t("popup.peoplesNB") }}: {{ deathData.deathNumber }}

@@ -35,20 +35,6 @@ - -

-
-
- -
-
-
- @@ -95,17 +76,4 @@ p, span { button { left: 100%; } - -.image-modal{ - display: flex; - z-index: 100; - justify-content: center; - align-items: center; - background-color: black; - position: fixed; - top: 0px; - left: 0px; - height: 100%; - width: 100%; -} diff --git a/src/components/popUpContent/IncidentDescription.vue b/src/components/popUpContent/IncidentDescription.vue index 15481d6..2855418 100644 --- a/src/components/popUpContent/IncidentDescription.vue +++ b/src/components/popUpContent/IncidentDescription.vue @@ -7,10 +7,10 @@

{{ format(incidentData.date, "full") }}


-

{{ $t("popup.boatInvolved") }}: +

{{ $t("popup.boatInvolved") }}: {{ incidentData.boatInvolved }}

-

+

{{ $t("popup.facts") }}: {{ incidentData.incAction }}

@@ -36,20 +36,6 @@ - -
-
-
- -
-
-
-
@@ -96,17 +77,4 @@ const currentImage = ref("") button { left: 100%; } - - .image-modal{ - display: flex; - z-index: 100; - justify-content: center; - align-items: center; - background-color: black; - position: fixed; - top: 0px; - left: 0px; - height: 100%; - width: 100%; - } diff --git a/src/components/popUpContent/OperationDescription.vue b/src/components/popUpContent/OperationDescription.vue index ada0651..97e1469 100644 --- a/src/components/popUpContent/OperationDescription.vue +++ b/src/components/popUpContent/OperationDescription.vue @@ -80,40 +80,21 @@ - -
-
-
- -
-
-
-
@@ -136,16 +117,7 @@ const currentImage = ref("") left: 100%; } - .image-modal{ - display: flex; - z-index: 100; - justify-content: center; - align-items: center; - background-color: black; - position: fixed; - top: 0px; - left: 0px; - height: 100%; - width: 100%; - } + p, span { + color: var(--text-color); +} diff --git a/src/components/popUpContent/ShipwreckDescription.vue b/src/components/popUpContent/ShipwreckDescription.vue index 9ca316d..b7f5ecb 100644 --- a/src/components/popUpContent/ShipwreckDescription.vue +++ b/src/components/popUpContent/ShipwreckDescription.vue @@ -39,20 +39,6 @@ - -
-
-
- -
-
-
-
@@ -99,17 +80,4 @@ p, span { button { left: 100%; } - -.image-modal{ - display: flex; - z-index: 100; - justify-content: center; - align-items: center; - background-color: black; - position: fixed; - top: 0px; - left: 0px; - height: 100%; - width: 100%; -} diff --git a/src/utils/arrayToGeojson.ts b/src/utils/arrayToGeojson.ts index d484843..784d599 100644 --- a/src/utils/arrayToGeojson.ts +++ b/src/utils/arrayToGeojson.ts @@ -9,18 +9,6 @@ export function opsDataToGeoJSON (rawData: OpsData[]): FeatureCollection { } // eslint-disable-next-line array-callback-return rawData.map(x => { - if (x.imageSrc.length === 0) { - (x as any).imageSrc = "" - } - if (x.videoSrc.length === 0) { - (x as any).videoSrc = "" - } - if (x.imageSrc.length > 0 && typeof (x.imageSrc) !== "string") { - (x as any).imageSrc = x.imageSrc.join() - } - if (x.videoSrc.length > 0 && typeof (x.videoSrc) !== "string") { - (x as any).videoSrc = x.videoSrc.join() - } if (!isNaN(x.latitude) || !isNaN(x.longitude)) { featuresCollection.features.push({ type: "Feature",