From deceebd8993aec6759f87b353623f6bb120ab0e1 Mon Sep 17 00:00:00 2001 From: Artem Date: Wed, 30 Sep 2026 10:38:43 +0300 Subject: [PATCH] update for 2gis --- angular.json | 33 +-- package-lock.json | 47 ++-- package.json | 6 +- src/app/map/city-map/city-map.html | 1 - src/app/map/city-map/city-map.scss | 2 +- src/app/map/city-map/city-map.ts | 235 +++++++++++------- .../pages/map-item-page/map-item-page.html | 182 +++++++------- .../pages/map-item-page/map-item-page.scss | 25 +- src/assets/styles/_camera.scss | 4 + src/assets/styles/_map.scss | 10 +- src/assets/styles/_tokens.scss | 2 + src/assets/styles/index.scss | 1 + src/index.html | 1 - 13 files changed, 296 insertions(+), 253 deletions(-) create mode 100644 src/assets/styles/_camera.scss diff --git a/angular.json b/angular.json index bd16b86..38320a7 100644 --- a/angular.json +++ b/angular.json @@ -3,7 +3,7 @@ "version": 1, "newProjectRoot": "projects", "projects": { - "maps": { + "gorodar-front": { "projectType": "application", "schematics": { "@schematics/angular:component": { @@ -18,15 +18,11 @@ "builder": "@angular/build:application", "options": { "browser": "src/main.ts", - "polyfills": [ - "zone.js" - ], + "polyfills": ["zone.js"], "tsConfig": "tsconfig.app.json", "inlineStyleLanguage": "scss", "stylePreprocessorOptions": { - "includePaths": [ - "src/assets/styles" - ] + "includePaths": ["src/assets/styles"] }, "assets": [ { @@ -34,10 +30,7 @@ "input": "public" } ], - "styles": [ - "@angular/material/prebuilt-themes/magenta-violet.css", - "src/styles.scss" - ] + "styles": ["@angular/material/prebuilt-themes/magenta-violet.css", "src/styles.scss"] }, "configurations": { "production": { @@ -68,10 +61,10 @@ "builder": "@angular/build:dev-server", "configurations": { "production": { - "buildTarget": "maps:build:production" + "buildTarget": "gorodar-front:build:production" }, "development": { - "buildTarget": "maps:build:development" + "buildTarget": "gorodar-front:build:development" } }, "defaultConfiguration": "development" @@ -82,16 +75,11 @@ "test": { "builder": "@angular/build:karma", "options": { - "polyfills": [ - "zone.js", - "zone.js/testing" - ], + "polyfills": ["zone.js", "zone.js/testing"], "tsConfig": "tsconfig.spec.json", "inlineStyleLanguage": "scss", "stylePreprocessorOptions": { - "includePaths": [ - "src/assets/styles" - ] + "includePaths": ["src/assets/styles"] }, "assets": [ { @@ -99,10 +87,7 @@ "input": "public" } ], - "styles": [ - "@angular/material/prebuilt-themes/magenta-violet.css", - "src/styles.scss" - ] + "styles": ["@angular/material/prebuilt-themes/magenta-violet.css", "src/styles.scss"] } } } diff --git a/package-lock.json b/package-lock.json index c54be42..ab24165 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,13 +1,14 @@ { - "name": "maps", + "name": "gorodar-front", "version": "0.0.0", "lockfileVersion": 3, "requires": true, "packages": { "": { - "name": "maps", + "name": "gorodar-front", "version": "0.0.0", "dependencies": { + "@2gis/mapgl": "^1.78.1", "@angular/animations": "^20.3.32", "@angular/cdk": "^20.2.14", "@angular/common": "^20.3.0", @@ -35,7 +36,6 @@ "@angular/compiler-cli": "^20.3.0", "@capacitor/cli": "^6.2.2", "@types/jasmine": "~5.1.0", - "@yandex/ymaps3-types": "^1.0.21108841", "jasmine-core": "~5.9.0", "karma": "~6.4.0", "karma-chrome-launcher": "~3.2.0", @@ -45,6 +45,18 @@ "typescript": "~5.9.2" } }, + "node_modules/@2gis/mapgl": { + "version": "1.78.1", + "resolved": "https://registry.npmjs.org/@2gis/mapgl/-/mapgl-1.78.1.tgz", + "integrity": "sha512-SkbrqwBMPTLV4hihV+BgAtftIfyMeSru6yqlVF0IJEE6jaGQ8LFq0NJb1TTaXt3I1t3q8sjvU7X/hhHpxo5JXQ==", + "license": "BSD-2-Clause", + "dependencies": { + "@types/geojson": "^7946.0.7" + }, + "engines": { + "node": ">=16.0.0" + } + }, "node_modules/@algolia/abtesting": { "version": "1.1.0", "resolved": "https://registry.npmjs.org/@algolia/abtesting/-/abtesting-1.1.0.tgz", @@ -4536,6 +4548,12 @@ "@types/node": "*" } }, + "node_modules/@types/geojson": { + "version": "7946.0.16", + "resolved": "https://registry.npmjs.org/@types/geojson/-/geojson-7946.0.16.tgz", + "integrity": "sha512-6C8nqWur3j98U6+lXDfTUWIfgvZU+EumvpHKcYjujKH7woYyLj2sUmff0tRhrqM7BohUw7Pz3ZB1jj2gW9Fvmg==", + "license": "MIT" + }, "node_modules/@types/jasmine": { "version": "5.1.15", "resolved": "https://registry.npmjs.org/@types/jasmine/-/jasmine-5.1.15.tgz", @@ -4593,29 +4611,6 @@ "node": ">=14.6" } }, - "node_modules/@yandex/ymaps3-types": { - "version": "1.0.21108841", - "resolved": "https://registry.npmjs.org/@yandex/ymaps3-types/-/ymaps3-types-1.0.21108841.tgz", - "integrity": "sha512-ZUUjQ2sgVQZE+Alt7d1u2oVvHhDNlq1YrVqlqadiqvotkOWT5kIKWoWv+qsMoCsriObtYh1jRtAyXzOqAsFyRg==", - "dev": true, - "license": "Apache-2.0", - "peerDependencies": { - "@types/react": "^16.0.0 || ^17.0.0 || ^18.0.0 || ^19.0.0", - "@types/react-dom": "^16.0.0 || ^17.0.0 || ^18.0.0 || ^19.0.0", - "@vue/runtime-core": "3" - }, - "peerDependenciesMeta": { - "@types/react": { - "optional": true - }, - "@types/react-dom": { - "optional": true - }, - "@vue/runtime-core": { - "optional": true - } - } - }, "node_modules/@yarnpkg/lockfile": { "version": "1.1.0", "resolved": "https://registry.npmjs.org/@yarnpkg/lockfile/-/lockfile-1.1.0.tgz", diff --git a/package.json b/package.json index d6cf33e..58320d7 100644 --- a/package.json +++ b/package.json @@ -1,5 +1,5 @@ { - "name": "maps", + "name": "gorodar-front", "version": "0.0.0", "scripts": { "ng": "ng", @@ -22,6 +22,7 @@ }, "private": true, "dependencies": { + "@2gis/mapgl": "^1.78.1", "@angular/animations": "^20.3.32", "@angular/cdk": "^20.2.14", "@angular/common": "^20.3.0", @@ -49,7 +50,6 @@ "@angular/compiler-cli": "^20.3.0", "@capacitor/cli": "^6.2.2", "@types/jasmine": "~5.1.0", - "@yandex/ymaps3-types": "^1.0.21108841", "jasmine-core": "~5.9.0", "karma": "~6.4.0", "karma-chrome-launcher": "~3.2.0", @@ -58,4 +58,4 @@ "karma-jasmine-html-reporter": "~2.1.0", "typescript": "~5.9.2" } -} \ No newline at end of file +} diff --git a/src/app/map/city-map/city-map.html b/src/app/map/city-map/city-map.html index 909d238..4d35896 100644 --- a/src/app/map/city-map/city-map.html +++ b/src/app/map/city-map/city-map.html @@ -10,7 +10,6 @@ > {{ city.name }} - - {{ city.name }} - +
+
+ + + {{ city.name }} +
-
-

{{ item.title }}

+
+

{{ item.title }}

-
- - - {{ collectedLabel() }} - -
+
+ + + {{ collectedLabel() }} + +
-
- -
-

{{ item.address }}

- {{ item.addressHint }} +
+ +
+

{{ item.address }}

+ {{ item.addressHint }} +
-
-
-
-

О месте

-

{{ item.description }}

-
- -
-

Интересные факты

-
    - @for (fact of item.facts; track fact; let index = $index) { -
  1. - {{ index + 1 }} - {{ fact }} -
  2. - } -
-
- - @if (collected()) { +
-

Ваше фото

- -

Этот объект уже в вашей коллекции. Повторно его получить нельзя.

+

О месте

+

{{ item.description }}

- - - Показать на карте - - } @else {
-

Примеры фото

-
- @for (photo of photoExamples; track photo.label) { -
- - {{ photo.label }} -
+

Интересные факты

+
    + @for (fact of item.facts; track fact; let index = $index) { +
  1. + {{ index + 1 }} + + {{ fact }} + +
  2. } -
-

{{ item.photoHint }}

-
- -
-

Как забрать

-
    -
  1. Приезжайте на место и найдите объект
  2. -
  3. Нажмите «Забрать» и сфотографируйте объект
  4. -
  5. Получите объект в свою коллекцию
- } -
- @if (!collected()) { -
- -

Понадобится доступ к камере

-
- } -
+ @if (collected()) { +
+

Ваше фото

+ +

+ Этот объект уже в вашей коллекции. Повторно его получить нельзя. +

+
+ + + + Показать на карте + + } @else { +
+

Примеры фото

+
+ @for (photo of photoExamples; track photo.label) { +
+ + {{ photo.label }} +
+ } +
+

{{ item.photoHint }}

+
+ +
+

Как забрать

+
    +
  1. Приезжайте на место и найдите объект
  2. +
  3. Нажмите «Забрать» и сфотографируйте объект
  4. +
  5. Получите объект в свою коллекцию
  6. +
+
+ } + + + @if (!collected()) { +
+ +

Понадобится доступ к камере

+
+ } + } @if (photoOpen()) { @if (userPhoto(); as image) {
- Ваше фото объекта diff --git a/src/app/pages/map-item-page/map-item-page.scss b/src/app/pages/map-item-page/map-item-page.scss index 78fde25..1dcb755 100644 --- a/src/app/pages/map-item-page/map-item-page.scss +++ b/src/app/pages/map-item-page/map-item-page.scss @@ -78,10 +78,17 @@ .object__intro h1, .object__body h2, -.facts span { +.facts { margin: 0; - font-family: var(--font-display); - font-weight: 700; + + &__number { + font-family: var(--font-display); + font-weight: 700; + } + + &__value { + margin: 0; + } } .object__intro h1 { @@ -220,11 +227,13 @@ line-height: 1.5; } -.facts span { - min-width: 18px; - color: var(--color-accent); - font-size: 24px; - line-height: 1; +.facts { + &__number { + min-width: 18px; + color: var(--color-accent); + font-size: 24px; + line-height: 1; + } } .object__hint { diff --git a/src/assets/styles/_camera.scss b/src/assets/styles/_camera.scss new file mode 100644 index 0000000..0cef1b3 --- /dev/null +++ b/src/assets/styles/_camera.scss @@ -0,0 +1,4 @@ +pwa-camera-modal-instance { + --inset-width: var(--camera-width); + --inset-height: var(--camera-height); +} diff --git a/src/assets/styles/_map.scss b/src/assets/styles/_map.scss index 63b78bb..04680e5 100644 --- a/src/assets/styles/_map.scss +++ b/src/assets/styles/_map.scss @@ -140,13 +140,7 @@ } } -.city-map__canvas [class*='distribution'], -.city-map__canvas [class*='Distribution'], -.city-map__canvas .ymaps3--open-maps-button, -.city-map__canvas .ymaps3--controls_bottom { - display: none !important; -} - -.city-map__canvas :has(> .city-map__marker) { +.city-map__canvas :has(> .city-map__marker), +.city-map__canvas :has(> .city-map__user) { overflow: visible !important; } diff --git a/src/assets/styles/_tokens.scss b/src/assets/styles/_tokens.scss index 93f1b52..66a3309 100644 --- a/src/assets/styles/_tokens.scss +++ b/src/assets/styles/_tokens.scss @@ -16,4 +16,6 @@ --page-max-width: 560px; --radius-card: 24px; --radius-pill: 999px; + --camera-width: 100%; + --camera-height: 100%; } diff --git a/src/assets/styles/index.scss b/src/assets/styles/index.scss index b1d73d8..682bbfa 100644 --- a/src/assets/styles/index.scss +++ b/src/assets/styles/index.scss @@ -6,3 +6,4 @@ @use 'map'; @use 'object'; @use 'collection'; +@use 'camera'; diff --git a/src/index.html b/src/index.html index 5b75c6e..47a292d 100644 --- a/src/index.html +++ b/src/index.html @@ -21,7 +21,6 @@ href="https://fonts.googleapis.com/css2?family=Onest:wght@400;500;600;700&family=Playfair+Display:wght@700&display=swap" rel="stylesheet" /> -