- @for (landmark of city.objects; track landmark.id) {
-
-
-
- }
+
+ {{ progress() }}%
+
+
+
- } @else {
-
Город не найден.
- }
+
+
+
+
+
+
+
} @else {
-
-
-
-
-
Пока в Городаре одна страна — Россия. Коллекции других стран появятся позже.
+
Пока нет полученных объектов.
}
diff --git a/src/app/pages/collections-page/collections-page.scss b/src/app/pages/collections-page/collections-page.scss
index 43bc501..d97d760 100644
--- a/src/app/pages/collections-page/collections-page.scss
+++ b/src/app/pages/collections-page/collections-page.scss
@@ -9,33 +9,37 @@
padding: 16px 16px 24px;
}
-.page__top {
- position: relative;
+.account {
display: flex;
align-items: center;
- justify-content: center;
+ justify-content: space-between;
+ gap: 12px;
min-height: 44px;
}
-.page__back {
- position: absolute;
- left: 0;
+.account__email {
+ margin: 0;
+ overflow: hidden;
+ color: var(--color-text);
+ font-size: 15px;
+ font-weight: 500;
+ text-overflow: ellipsis;
+ white-space: nowrap;
+}
+
+.account__logout {
display: flex;
+ flex: none;
align-items: center;
justify-content: center;
width: 44px;
height: 44px;
+ padding: 0;
border: 1px solid var(--color-border);
border-radius: 14px;
- background: rgb(28 26 23 / 86%);
+ background: var(--color-surface);
color: var(--color-text);
- text-decoration: none;
-}
-
-.page__title {
- color: var(--color-muted);
- font-size: 15px;
- font-weight: 500;
+ cursor: pointer;
}
.page__intro {
@@ -43,8 +47,7 @@
}
.page__intro h1,
-.summary b,
-.country b {
+.summary b {
margin: 0;
font-family: var(--font-display);
font-weight: 700;
@@ -70,16 +73,14 @@
font-size: 15px;
}
-.summary,
-.search,
-.country {
+.summary {
border: 1px solid var(--color-border);
background: var(--color-surface);
}
.summary {
display: grid;
- grid-template-columns: repeat(3, minmax(0, 1fr));
+ grid-template-columns: repeat(2, minmax(0, 1fr));
gap: 8px;
margin-top: 16px;
padding: 18px 16px;
@@ -92,106 +93,73 @@
line-height: 1.1;
}
-.tabs,
-.search,
-.country {
- display: flex;
-}
-
-.tabs {
- gap: 8px;
- margin-top: 16px;
-}
-
-.tabs button {
- min-height: 44px;
- padding: 0 20px;
- border: 1px solid var(--color-border);
- border-radius: 22px;
- background: var(--color-surface);
- color: var(--color-text);
- font-size: 15px;
- font-weight: 500;
- cursor: pointer;
-}
-
-.tabs button.tabs__item--active {
- border-color: var(--color-accent);
- background: var(--color-accent);
- color: var(--color-on-accent);
-}
-
-.search {
- align-items: center;
- gap: 12px;
- height: 52px;
- margin-top: 16px;
- padding: 0 18px;
- border-radius: 26px;
- color: var(--color-muted);
-}
-
-.search input {
- flex: 1;
- min-width: 0;
- height: 100%;
- border: 0;
- background: transparent;
- color: var(--color-text);
- font: inherit;
- font-size: 16px;
- outline: 0;
-}
-
.section-label {
margin: 20px 0 8px;
font-size: 14px;
font-weight: 500;
}
-.country {
- align-items: center;
- gap: 14px;
- width: 100%;
- margin-top: 16px;
- padding: 18px 16px;
- border-radius: 24px;
- font: inherit;
- color: inherit;
- text-align: left;
- cursor: pointer;
-}
-
-.country__mark {
- display: flex;
- flex: none;
- align-items: center;
- justify-content: center;
- width: 56px;
- height: 56px;
- border: 1.5px solid var(--color-accent);
- background: rgb(224 184 79 / 7%);
- color: var(--color-accent-soft);
-}
-
-.country__body {
- flex: 1;
- min-width: 0;
-}
-
-.country__body b {
- display: block;
- font-size: 22px;
- line-height: 1.15;
-}
-
-.country__body span {
- display: block;
- margin-top: 4px;
- color: var(--color-muted);
- font-size: 14px;
-}
-
.empty {
margin-top: 20px;
}
+
+.picked {
+ display: grid;
+ grid-template-columns: repeat(2, minmax(0, 1fr));
+ gap: 12px;
+ margin-top: 16px;
+}
+
+.picked__card {
+ display: flex;
+ flex-direction: column;
+ overflow: hidden;
+ border: 1px solid var(--color-border);
+ border-radius: 16px;
+ background: #141210;
+ color: inherit;
+ text-decoration: none;
+}
+
+.picked__preview {
+ display: flex;
+ align-items: center;
+ justify-content: center;
+ height: 148px;
+ background: rgb(224 184 79 / 8%);
+}
+
+.picked__preview img {
+ width: 112px;
+ height: 112px;
+ object-fit: contain;
+}
+
+.picked__body {
+ display: flex;
+ flex: 1;
+ flex-direction: column;
+ gap: 8px;
+ padding: 12px;
+}
+
+.picked__body h3 {
+ margin: 0;
+ min-height: 38px;
+ font-size: 15px;
+ font-weight: 600;
+ line-height: 1.25;
+}
+
+.picked__body span {
+ display: flex;
+ align-items: center;
+ gap: 6px;
+ color: var(--color-accent-soft);
+ font-size: 13px;
+}
+
+.picked__bar {
+ height: 4px;
+ background: var(--color-accent);
+}
diff --git a/src/app/pages/collections-page/collections-page.ts b/src/app/pages/collections-page/collections-page.ts
index 5025434..89e9eb8 100644
--- a/src/app/pages/collections-page/collections-page.ts
+++ b/src/app/pages/collections-page/collections-page.ts
@@ -1,10 +1,12 @@
-import { ChangeDetectionStrategy, Component, computed, inject, signal } from '@angular/core';
+import { afterNextRender, ChangeDetectionStrategy, Component, computed, inject } from '@angular/core';
import { RouterLink } from '@angular/router';
import { Store } from '@ngrx/store';
+import { AuthPromptService } from '../../auth/auth-prompt.service';
+import { AuthService } from '../../auth/auth.service';
import { CityCatalogService } from '../../root/services/city-catalog.service';
import { Icon } from '../../shared/icon/icon';
-import { selectCollectedIdSet, selectOpenedCount, selectProgress } from '../../state';
+import { selectCollectedIdSet, selectOpenedCount, selectProfile, selectProgress } from '../../state';
@Component({
selector: 'app-collections-page',
@@ -16,24 +18,38 @@ import { selectCollectedIdSet, selectOpenedCount, selectProgress } from '../../s
export class CollectionsPage {
private readonly catalog = inject(CityCatalogService);
private readonly store = inject(Store);
+ private readonly auth = inject(AuthService);
+ private readonly authPrompt = inject(AuthPromptService);
protected readonly city = this.catalog.city;
+ protected readonly profile = this.store.selectSignal(selectProfile);
protected readonly collectedIds = this.store.selectSignal(selectCollectedIdSet);
protected readonly openedCount = this.store.selectSignal(selectOpenedCount);
protected readonly totalCount = this.city.objects.length;
- protected readonly query = signal('');
- protected readonly tab = signal<'russia' | 'world'>('russia');
protected readonly progress = this.store.selectSignal(selectProgress);
- protected readonly cityVisible = computed(() => {
- const query = this.query().trim().toLowerCase();
- return !query || this.city.name.toLowerCase().includes(query);
- });
+ protected readonly accountEmail = computed(() =>
+ this.auth.authenticated() ? this.auth.email() : this.profile().email,
+ );
+ protected readonly collectedLandmarks = computed(() =>
+ this.city.objects.filter((item) => this.collectedIds().has(item.id)),
+ );
+
+ constructor() {
+ afterNextRender(() => {
+ void this.authPrompt.prompt('collection');
+ });
+ }
+
protected readonly objectsLabel = computed(() =>
this.plural(this.openedCount(), ['объект', 'объекта', 'объектов']),
);
- protected onQuery(event: Event): void {
- this.query.set((event.target as HTMLInputElement).value);
+ protected objectRoute(id: string): string[] {
+ return this.collectedIds().has(id) ? ['/items', id, 'icon'] : ['/items', id];
+ }
+
+ protected logout(): void {
+ this.auth.logout();
}
private plural(count: number, forms: [string, string, string]): string {
diff --git a/src/app/pages/icon-preview-page/icon-preview-page.html b/src/app/pages/icon-preview-page/icon-preview-page.html
new file mode 100644
index 0000000..86aa9c8
--- /dev/null
+++ b/src/app/pages/icon-preview-page/icon-preview-page.html
@@ -0,0 +1,15 @@
+@if (landmark(); as item) {
+ @if (collected()) {
+
+ }
+} @else {
+
+}
diff --git a/src/app/pages/icon-preview-page/icon-preview-page.scss b/src/app/pages/icon-preview-page/icon-preview-page.scss
new file mode 100644
index 0000000..dc424ff
--- /dev/null
+++ b/src/app/pages/icon-preview-page/icon-preview-page.scss
@@ -0,0 +1,22 @@
+:host {
+ display: block;
+ min-height: 100%;
+}
+
+.missing {
+ display: flex;
+ flex-direction: column;
+ gap: 16px;
+ align-items: flex-start;
+ width: min(100%, var(--page-max-width));
+ margin: 0 auto;
+ padding: 24px 16px;
+}
+
+.missing p {
+ margin: 0;
+}
+
+.missing a {
+ color: var(--color-accent-soft);
+}
diff --git a/src/app/pages/icon-preview-page/icon-preview-page.ts b/src/app/pages/icon-preview-page/icon-preview-page.ts
new file mode 100644
index 0000000..a0d33f6
--- /dev/null
+++ b/src/app/pages/icon-preview-page/icon-preview-page.ts
@@ -0,0 +1,41 @@
+import { ChangeDetectionStrategy, Component, computed, effect, inject, input } from '@angular/core';
+import { Router, RouterLink } from '@angular/router';
+import { Store } from '@ngrx/store';
+
+import { CollectSuccess } from '../../claim/collect-success/collect-success';
+import { CityCatalogService } from '../../root/services/city-catalog.service';
+import { selectCollectedIdSet } from '../../state';
+
+@Component({
+ selector: 'app-icon-preview-page',
+ imports: [CollectSuccess, RouterLink],
+ templateUrl: './icon-preview-page.html',
+ styleUrl: './icon-preview-page.scss',
+ changeDetection: ChangeDetectionStrategy.OnPush,
+})
+export class IconPreviewPage {
+ private readonly catalog = inject(CityCatalogService);
+ private readonly store = inject(Store);
+ private readonly router = inject(Router);
+ private readonly collectedIds = this.store.selectSignal(selectCollectedIdSet);
+
+ readonly id = input.required
();
+
+ protected readonly landmark = computed(() => this.catalog.landmarkById(this.id()));
+ protected readonly collected = computed(() => {
+ const item = this.landmark();
+ return item ? this.collectedIds().has(item.id) : false;
+ });
+
+ constructor() {
+ effect(() => {
+ const item = this.landmark();
+
+ if (!item || this.collectedIds().has(item.id)) {
+ return;
+ }
+
+ void this.router.navigate(['/items', item.id], { replaceUrl: true });
+ });
+ }
+}
diff --git a/src/app/pages/map-item-page/map-item-page.html b/src/app/pages/map-item-page/map-item-page.html
index 710bbb4..eb81fed 100644
--- a/src/app/pages/map-item-page/map-item-page.html
+++ b/src/app/pages/map-item-page/map-item-page.html
@@ -4,7 +4,7 @@
} @else {
-
+
@@ -36,6 +36,11 @@
{{ item.description }}
+
+
Интересные факты
@@ -67,25 +72,7 @@
Этот объект уже в вашей коллекции. Повторно его получить нельзя.
-
-
-
- Показать на карте
-
} @else {
-
- Примеры фото
-
- @for (photo of photoExamples; track photo.label) {
-
-
- {{ photo.label }}
-
- }
-
- {{ item.photoHint }}
-
-
Как забрать
diff --git a/src/app/pages/map-item-page/map-item-page.ts b/src/app/pages/map-item-page/map-item-page.ts
index af5323d..8855037 100644
--- a/src/app/pages/map-item-page/map-item-page.ts
+++ b/src/app/pages/map-item-page/map-item-page.ts
@@ -1,11 +1,21 @@
import { Location } from '@angular/common';
-import { ChangeDetectionStrategy, Component, computed, HostListener, inject, input, signal } from '@angular/core';
-import { Router, RouterLink } from '@angular/router';
+import {
+ ChangeDetectionStrategy,
+ Component,
+ computed,
+ HostListener,
+ inject,
+ input,
+ signal,
+} from '@angular/core';
import { MatButton } from '@angular/material/button';
+import { Router } from '@angular/router';
import { Store } from '@ngrx/store';
+import { AuthPromptService } from '../../auth/auth-prompt.service';
import { ClaimFlow } from '../../claim/claim-flow/claim-flow';
import { CityCatalogService } from '../../root/services/city-catalog.service';
+import { AudioGuide } from '../../shared/audio-guide/audio-guide';
import { Icon } from '../../shared/icon/icon';
import {
GorodarActions,
@@ -17,7 +27,7 @@ import {
@Component({
selector: 'app-map-item-page',
- imports: [MatButton, Icon, ClaimFlow, RouterLink],
+ imports: [MatButton, Icon, ClaimFlow, AudioGuide],
templateUrl: './map-item-page.html',
styleUrl: './map-item-page.scss',
changeDetection: ChangeDetectionStrategy.OnPush,
@@ -27,6 +37,7 @@ export class MapItemPage {
private readonly store = inject(Store);
private readonly location = inject(Location);
private readonly router = inject(Router);
+ private readonly authPrompt = inject(AuthPromptService);
readonly id = input.required();
@@ -72,11 +83,6 @@ export class MapItemPage {
return claim.landmarkId === this.id() && claim.stage !== 'idle';
});
- protected readonly photoExamples = [
- { label: 'Днём', src: '/assets/illustrations/photo-day.svg' },
- { label: 'Вечером', src: '/assets/illustrations/photo-evening.svg' },
- { label: 'Зимой', src: '/assets/illustrations/photo-winter.svg' },
- ];
protected readonly photoOpen = signal(false);
protected goBack(): void {
@@ -85,11 +91,17 @@ export class MapItemPage {
return;
}
- void this.router.navigateByUrl('/map');
+ void this.router.navigateByUrl('/city');
}
protected claimItem(): void {
- this.store.dispatch(GorodarActions.takePhoto({ landmarkId: this.id() }));
+ void this.authPrompt.prompt('claim').then((result) => {
+ if (result !== 'authenticated') {
+ return;
+ }
+
+ this.store.dispatch(GorodarActions.takePhoto({ landmarkId: this.id() }));
+ });
}
protected openPhoto(): void {
diff --git a/src/app/pages/profile-page/profile-page.html b/src/app/pages/profile-page/profile-page.html
deleted file mode 100644
index a4999c6..0000000
--- a/src/app/pages/profile-page/profile-page.html
+++ /dev/null
@@ -1,80 +0,0 @@
-
-
-
-
-
{{ initial() }}
-
{{ profile().displayName }}
-
-
- {{ profile().city }}
-
-
-
-
-
-
- -
- Имя
- {{ profile().firstName }} {{ profile().lastName }}
-
- -
- Город
- {{ profile().city }}
-
- -
- Почта
- {{ profile().email }}
-
- -
- Телефон
- {{ profile().phone }}
-
- -
- В Городаре с
- {{ profile().joinedLabel }}
-
-
-
diff --git a/src/app/pages/profile-page/profile-page.scss b/src/app/pages/profile-page/profile-page.scss
deleted file mode 100644
index 43c4ec5..0000000
--- a/src/app/pages/profile-page/profile-page.scss
+++ /dev/null
@@ -1,147 +0,0 @@
-:host {
- display: block;
- width: 100%;
- max-width: 100%;
- min-height: 100%;
-}
-
-.page {
- width: 100%;
- max-width: var(--page-max-width);
- margin: 0 auto;
- padding: 16px 16px 24px;
-}
-
-.page__top,
-.hero p {
- display: flex;
- align-items: center;
-}
-
-.page__top {
- position: relative;
- justify-content: center;
- min-height: 44px;
-}
-
-.page__back {
- position: absolute;
- left: 0;
- display: flex;
- align-items: center;
- justify-content: center;
- width: 44px;
- height: 44px;
- border: 1px solid var(--color-border);
- border-radius: 14px;
- background: rgb(28 26 23 / 86%);
- color: var(--color-text);
- text-decoration: none;
-}
-
-.page__title {
- color: var(--color-text-soft);
- font-size: 15px;
- font-weight: 500;
-}
-
-.hero {
- display: flex;
- flex-direction: column;
- align-items: center;
- margin-top: 28px;
- text-align: center;
-}
-
-.hero__avatar {
- display: flex;
- align-items: center;
- justify-content: center;
- width: 96px;
- height: 96px;
- border: 1.5px solid var(--color-accent);
- border-radius: 48px;
- background: radial-gradient(circle at 50% 38%, rgb(224 184 79 / 22%), rgb(224 184 79 / 4%) 72%),
- var(--color-surface);
- color: var(--color-accent-soft);
- font-family: var(--font-display);
- font-size: 40px;
- font-weight: 700;
-}
-
-.hero h1 {
- margin: 16px 0 0;
- font-family: var(--font-display);
- font-size: clamp(28px, 7vw, 34px);
- font-weight: 700;
- line-height: 1.12;
- letter-spacing: -0.03em;
-}
-
-.hero p {
- justify-content: center;
- gap: 8px;
- margin: 10px 0 0;
- color: var(--color-muted);
- font-size: 15px;
-}
-
-.hero p app-icon {
- color: var(--color-accent);
-}
-
-.collections {
- margin-top: 28px;
-}
-
-.collections h2 {
- margin: 0;
- font-family: var(--font-display);
- font-size: 22px;
- font-weight: 700;
-}
-
-.collections > p {
- margin: 6px 0 0;
- color: var(--color-muted);
- font-size: 15px;
-}
-
-.pack {
- margin-top: 14px;
-}
-
-.info {
- display: flex;
- flex-direction: column;
- gap: 0;
- margin: 16px 0 0;
- padding: 4px 16px;
- border: 1px solid var(--color-border);
- border-radius: 20px;
- background: var(--color-surface);
- list-style: none;
-}
-
-.info li {
- display: flex;
- flex-direction: column;
- gap: 4px;
- padding: 14px 0;
- border-bottom: 1px solid var(--color-border);
-}
-
-.info li:last-child {
- border-bottom: 0;
-}
-
-.info span {
- color: var(--color-muted);
- font-size: 13px;
-}
-
-.info b {
- color: var(--color-text);
- font-size: 16px;
- font-weight: 500;
-}
diff --git a/src/app/pages/profile-page/profile-page.ts b/src/app/pages/profile-page/profile-page.ts
deleted file mode 100644
index 594e5bf..0000000
--- a/src/app/pages/profile-page/profile-page.ts
+++ /dev/null
@@ -1,27 +0,0 @@
-import { ChangeDetectionStrategy, Component, computed, inject } from '@angular/core';
-import { RouterLink } from '@angular/router';
-import { Store } from '@ngrx/store';
-
-import { CityCatalogService } from '../../root/services/city-catalog.service';
-import { Icon } from '../../shared/icon/icon';
-import { selectCollectedIdSet, selectOpenedCount, selectProfile, selectProgress } from '../../state';
-
-@Component({
- selector: 'app-profile-page',
- imports: [Icon, RouterLink],
- templateUrl: './profile-page.html',
- styleUrl: './profile-page.scss',
- changeDetection: ChangeDetectionStrategy.OnPush,
-})
-export class ProfilePage {
- private readonly catalog = inject(CityCatalogService);
- private readonly store = inject(Store);
-
- protected readonly city = this.catalog.city;
- protected readonly profile = this.store.selectSignal(selectProfile);
- protected readonly collectedIds = this.store.selectSignal(selectCollectedIdSet);
- protected readonly openedCount = this.store.selectSignal(selectOpenedCount);
- protected readonly totalCount = this.city.objects.length;
- protected readonly progress = this.store.selectSignal(selectProgress);
- protected readonly initial = computed(() => this.profile().firstName.slice(0, 1));
-}
diff --git a/src/app/shared/audio-guide/audio-guide.html b/src/app/shared/audio-guide/audio-guide.html
new file mode 100644
index 0000000..a1e9506
--- /dev/null
+++ b/src/app/shared/audio-guide/audio-guide.html
@@ -0,0 +1,26 @@
+
+
+
+
+
+
+ Слушать рассказ
+ {{ format(currentTime()) }} / {{ format(duration()) }}
+
+
+
diff --git a/src/app/shared/audio-guide/audio-guide.scss b/src/app/shared/audio-guide/audio-guide.scss
new file mode 100644
index 0000000..2f3a165
--- /dev/null
+++ b/src/app/shared/audio-guide/audio-guide.scss
@@ -0,0 +1,59 @@
+:host {
+ display: block;
+}
+
+.guide {
+ display: flex;
+ align-items: center;
+ gap: 14px;
+ padding: 12px 14px 12px 12px;
+ border: 1px solid var(--color-border);
+ border-radius: 18px;
+ background: var(--color-surface);
+}
+
+.guide__play {
+ display: grid;
+ flex: none;
+ place-items: center;
+ width: 56px;
+ height: 56px;
+ padding: 0;
+ border: 0;
+ border-radius: 50%;
+ background: var(--color-accent);
+ color: var(--color-on-accent);
+ cursor: pointer;
+}
+
+.guide__play svg {
+ width: 22px;
+ height: 22px;
+ fill: currentColor;
+}
+
+.guide__track {
+ flex: 1 1 auto;
+ min-width: 0;
+}
+
+.guide__wave {
+ width: 100%;
+ height: 28px;
+}
+
+.guide__meta {
+ display: flex;
+ align-items: baseline;
+ justify-content: space-between;
+ gap: 12px;
+ margin-top: 2px;
+ color: var(--color-muted);
+ font-size: 14px;
+ line-height: 1.2;
+}
+
+.guide__time {
+ flex: none;
+ font-variant-numeric: tabular-nums;
+}
diff --git a/src/app/shared/audio-guide/audio-guide.ts b/src/app/shared/audio-guide/audio-guide.ts
new file mode 100644
index 0000000..169c89c
--- /dev/null
+++ b/src/app/shared/audio-guide/audio-guide.ts
@@ -0,0 +1,93 @@
+import {
+ ChangeDetectionStrategy,
+ Component,
+ ElementRef,
+ NgZone,
+ effect,
+ inject,
+ input,
+ signal,
+ viewChild,
+} from '@angular/core';
+import WaveSurfer from 'wavesurfer.js';
+
+@Component({
+ selector: 'app-audio-guide',
+ templateUrl: './audio-guide.html',
+ styleUrl: './audio-guide.scss',
+ changeDetection: ChangeDetectionStrategy.OnPush,
+})
+export class AudioGuide {
+ private readonly zone = inject(NgZone);
+ private readonly waveHost = viewChild>('wave');
+ private player: WaveSurfer | null = null;
+
+ readonly src = input.required();
+
+ protected readonly playing = signal(false);
+ protected readonly currentTime = signal(0);
+ protected readonly duration = signal(0);
+
+ constructor() {
+ effect((onCleanup) => {
+ const element = this.waveHost()?.nativeElement;
+ const src = this.src();
+
+ if (!element) {
+ return;
+ }
+
+ const player = this.zone.runOutsideAngular(() =>
+ WaveSurfer.create({
+ container: element,
+ url: src,
+ height: 28,
+ waveColor: '#6a645b',
+ progressColor: '#e0b84f',
+ cursorWidth: 0,
+ barWidth: 3,
+ barGap: 2,
+ barRadius: 2,
+ normalize: true,
+ dragToSeek: true,
+ hideScrollbar: true,
+ interact: true,
+ }),
+ );
+
+ this.player = player;
+
+ const updateTime = (time: number): void => {
+ this.zone.run(() => this.currentTime.set(time));
+ };
+
+ player.on('timeupdate', updateTime);
+ player.on('seeking', updateTime);
+ player.on('ready', (length) => {
+ this.zone.run(() => this.duration.set(length));
+ });
+ player.on('play', () => this.zone.run(() => this.playing.set(true)));
+ player.on('pause', () => this.zone.run(() => this.playing.set(false)));
+ player.on('finish', () => this.zone.run(() => this.playing.set(false)));
+
+ onCleanup(() => {
+ player.destroy();
+
+ if (this.player === player) {
+ this.player = null;
+ }
+ });
+ });
+ }
+
+ protected toggle(): void {
+ void this.player?.playPause();
+ }
+
+ protected format(seconds: number): string {
+ const total = Math.max(0, Math.floor(seconds));
+ const minutes = Math.floor(total / 60);
+ const rest = total % 60;
+ return `${minutes}:${String(rest).padStart(2, '0')}`;
+ }
+}
diff --git a/src/app/state/gorodar.reducer.ts b/src/app/state/gorodar.reducer.ts
index edad36e..3eb1778 100644
--- a/src/app/state/gorodar.reducer.ts
+++ b/src/app/state/gorodar.reducer.ts
@@ -20,7 +20,7 @@ export const initialState: GorodarState = {
firstName: 'Иван',
lastName: 'Иванов',
city: 'Нижний Новгород',
- email: 'ivan.ivanovich@gorodar.app',
+ email: '',
phone: '+7 900 123-45-67',
joinedLabel: 'Сентябрь 2026',
},
@@ -28,46 +28,58 @@ export const initialState: GorodarState = {
const gorodarReducer = createReducer(
initialState,
- on(GorodarActions.photoCaptured, (state, { landmarkId, photo }): GorodarState => ({
- ...state,
- claim: {
- landmarkId,
- photo,
- stage: 'check',
- step: 1,
- },
- })),
- on(GorodarActions.claimStepChanged, (state, { step }): GorodarState => ({
- ...state,
- claim: {
- ...state.claim,
- step,
- },
- })),
- on(GorodarActions.claimCompleted, (state, { landmarkId, photo, collectedAt }): GorodarState => ({
- ...state,
- collectedIds: state.collectedIds.includes(landmarkId)
- ? state.collectedIds
- : [...state.collectedIds, landmarkId],
- photos: {
- ...state.photos,
- [landmarkId]: photo,
- },
- collectedAt: {
- ...state.collectedAt,
- [landmarkId]: collectedAt,
- },
- claim: {
- landmarkId,
- photo,
- stage: 'success',
- step: 3,
- },
- })),
- on(GorodarActions.claimReset, (state): GorodarState => ({
- ...state,
- claim: initialClaim,
- })),
+ on(
+ GorodarActions.photoCaptured,
+ (state, { landmarkId, photo }): GorodarState => ({
+ ...state,
+ claim: {
+ landmarkId,
+ photo,
+ stage: 'check',
+ step: 1,
+ },
+ }),
+ ),
+ on(
+ GorodarActions.claimStepChanged,
+ (state, { step }): GorodarState => ({
+ ...state,
+ claim: {
+ ...state.claim,
+ step,
+ },
+ }),
+ ),
+ on(
+ GorodarActions.claimCompleted,
+ (state, { landmarkId, photo, collectedAt }): GorodarState => ({
+ ...state,
+ collectedIds: state.collectedIds.includes(landmarkId)
+ ? state.collectedIds
+ : [...state.collectedIds, landmarkId],
+ photos: {
+ ...state.photos,
+ [landmarkId]: photo,
+ },
+ collectedAt: {
+ ...state.collectedAt,
+ [landmarkId]: collectedAt,
+ },
+ claim: {
+ landmarkId,
+ photo,
+ stage: 'success',
+ step: 3,
+ },
+ }),
+ ),
+ on(
+ GorodarActions.claimReset,
+ (state): GorodarState => ({
+ ...state,
+ claim: initialClaim,
+ }),
+ ),
);
export const gorodarFeature = createFeature({
diff --git a/src/app/state/gorodar.selectors.ts b/src/app/state/gorodar.selectors.ts
index 9e6695d..b48ce5b 100644
--- a/src/app/state/gorodar.selectors.ts
+++ b/src/app/state/gorodar.selectors.ts
@@ -3,23 +3,16 @@ import { createSelector } from '@ngrx/store';
import { NIZHNY_NOVGOROD } from '../data/nizhny-novgorod';
import { gorodarFeature } from './gorodar.reducer';
-export const {
- selectCollectedIds,
- selectPhotos,
- selectCollectedAt,
- selectClaim,
- selectProfile,
-} = gorodarFeature;
+export const { selectCollectedIds, selectPhotos, selectCollectedAt, selectClaim, selectProfile } =
+ gorodarFeature;
-export const selectCollectedIdSet = createSelector(
- selectCollectedIds,
- (ids) => new Set(ids),
-);
+export const selectCollectedIdSet = createSelector(selectCollectedIds, (ids) => new Set(ids));
export const selectTotalCount = NIZHNY_NOVGOROD.objects.length;
-export const selectOpenedCount = createSelector(selectCollectedIdSet, (ids) =>
- NIZHNY_NOVGOROD.objects.filter((item) => ids.has(item.id) || item.collected).length,
+export const selectOpenedCount = createSelector(
+ selectCollectedIdSet,
+ (ids) => NIZHNY_NOVGOROD.objects.filter((item) => ids.has(item.id) || item.collected).length,
);
export const selectProgress = createSelector(selectOpenedCount, (opened) =>
diff --git a/src/assets/styles/_collection.scss b/src/assets/styles/_collection.scss
index 63933ce..34098f8 100644
--- a/src/assets/styles/_collection.scss
+++ b/src/assets/styles/_collection.scss
@@ -17,6 +17,8 @@
align-items: center;
justify-content: space-between;
gap: 12px;
+ color: inherit;
+ text-decoration: none;
}
.pack h2,
@@ -102,6 +104,8 @@
overflow: hidden;
border-radius: 10px;
background: #171512;
+ color: inherit;
+ text-decoration: none;
}
.pack__stamp img {
diff --git a/src/assets/styles/_object.scss b/src/assets/styles/_object.scss
index 78b5f26..3a78308 100644
--- a/src/assets/styles/_object.scss
+++ b/src/assets/styles/_object.scss
@@ -13,8 +13,8 @@
display: block;
width: 100%;
height: 100%;
- object-fit: contain;
- object-position: center bottom;
+ object-fit: cover;
+ object-position: center top;
}
.object__hero::after {
@@ -27,42 +27,6 @@
background: linear-gradient(to bottom, transparent, var(--color-bg));
}
-.photos {
- display: flex;
- gap: 10px;
- overflow: auto;
-}
-
-.photos figure {
- position: relative;
- flex: none;
- width: 128px;
- height: 168px;
- margin: 0;
- overflow: hidden;
- border: 1px solid var(--color-border);
- border-radius: 14px;
- background: var(--color-surface);
-}
-
-.photos img {
- display: block;
- width: 100%;
- height: 100%;
- object-fit: cover;
-}
-
-.photos span {
- position: absolute;
- left: 8px;
- bottom: 8px;
- padding: 3px 9px;
- border-radius: 8px;
- background: rgb(18 17 15 / 78%);
- font-size: 12px;
- font-weight: 500;
-}
-
.owned-photo {
position: relative;
display: block;
@@ -134,4 +98,3 @@
color: var(--color-text);
cursor: pointer;
}
-
diff --git a/src/types/model-viewer.d.ts b/src/types/model-viewer.d.ts
new file mode 100644
index 0000000..933d05b
--- /dev/null
+++ b/src/types/model-viewer.d.ts
@@ -0,0 +1 @@
+declare module '@google/model-viewer/dist/model-viewer.min.js';
diff --git a/tsconfig.app.json b/tsconfig.app.json
index 264f459..6bd74fc 100644
--- a/tsconfig.app.json
+++ b/tsconfig.app.json
@@ -7,7 +7,8 @@
"types": []
},
"include": [
- "src/**/*.ts"
+ "src/**/*.ts",
+ "src/**/*.d.ts"
],
"exclude": [
"src/**/*.spec.ts"