Files
front/src/app/pages/map-item-page/map-item-page.html
T
2026-10-07 17:32:25 +03:00

137 lines
4.4 KiB
HTML
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
@if (landmark(); as item) {
@if (claiming()) {
<app-claim-flow
[landmark]="item"
[cityName]="area()?.name ?? ''"
[opened]="openedCount()"
[total]="totalCount()"
[areaId]="areaId()"
/>
} @else {
<article class="object" [class.object--owned]="collected()">
<header class="object__hero">
@if (item.backgroundUrl || item.photoUrl) {
<img class="object__hero-img" [src]="item.backgroundUrl || item.photoUrl" alt="" />
}
<button class="object__back" type="button" aria-label="Назад" (click)="goBack()">
<app-icon name="chevron-left" [size]="22" />
</button>
<span class="object__city">{{ area()?.name }}</span>
</header>
<div class="object__intro">
<h1>{{ item.name }}</h1>
<div class="object__chips">
<span class="chip" [class.chip--open]="collected()">
<app-icon [name]="collected() ? 'check' : 'lock'" [size]="15" />
{{ collectedLabel() }}
</span>
</div>
@if (item.address) {
<div class="object__address">
<app-icon name="pin" [size]="18" />
<div>
<p>{{ item.address }}</p>
</div>
</div>
}
</div>
<div class="object__body">
@if (item.about) {
<section>
<h2>О месте</h2>
<p>{{ item.about }}</p>
</section>
}
@if (item.facts.length > 0) {
<section>
<h2>Интересные факты</h2>
<ol class="facts">
@for (fact of item.facts; track fact; let index = $index) {
<li>
<span class="facts__number">{{ index + 1 }}</span>
<span class="facts__value">{{ fact }}</span>
</li>
}
</ol>
</section>
}
@if (item.audioUrl) {
<section>
<h2>Аудиогид</h2>
<app-audio-guide [src]="item.audioUrl" />
</section>
}
@if (collected()) {
<section>
<h2>Ваше фото</h2>
<button class="owned-photo" type="button" (click)="openPhoto()">
<img
[src]="userPhoto() ?? '/assets/illustrations/photo-day.svg'"
alt="Ваше фото объекта"
/>
<span class="owned-photo__badge">
<app-icon name="check" [size]="14" />
Подтверждено
</span>
</button>
<p class="object__hint">
Этот объект уже в вашей коллекции. Повторно его получить нельзя.
</p>
</section>
} @else {
<section>
<h2>Как забрать</h2>
<ol class="steps">
<li>Приезжайте на место и найдите объект</li>
<li>Нажмите «Забрать» и сфотографируйте объект</li>
<li>Получите объект в свою коллекцию</li>
</ol>
</section>
}
</div>
@if (!collected()) {
<footer class="object__bar">
<button class="object__claim" matButton="filled" type="button" (click)="claimItem()">
<app-icon name="camera" [size]="22" />
Забрать
</button>
<p>Понадобится доступ к камере</p>
</footer>
}
</article>
}
@if (photoOpen()) {
@if (userPhoto(); as image) {
<div class="photo-viewer" (click)="closePhoto()">
<button
class="photo-viewer__close"
type="button"
aria-label="Закрыть"
(click)="closePhoto()"
>
<app-icon name="chevron-left" [size]="22" />
</button>
<img [src]="image" alt="Ваше фото объекта" (click)="$event.stopPropagation()" />
</div>
}
}
} @else if (status() === 'loading') {
<section class="object object--empty">
<p>Загружаем…</p>
</section>
} @else {
<section class="object object--empty">
<p>{{ error() || 'Объект не найден.' }}</p>
<button matButton="outlined" type="button" (click)="goBack()">Назад</button>
</section>
}