add logic

This commit is contained in:
2026-10-07 17:32:25 +03:00
parent cdcdd22526
commit f86777e2cd
69 changed files with 1519 additions and 637 deletions
@@ -1,10 +1,12 @@
<section class="page">
<header class="account">
<p class="account__email">{{ accountEmail() }}</p>
<button class="account__logout" type="button" aria-label="Выйти" (click)="logout()">
<app-icon name="logout" [size]="22" />
</button>
</header>
@if (authenticated()) {
<header class="account">
<p class="account__email">{{ accountEmail() }}</p>
<button class="account__logout" type="button" aria-label="Выйти" (click)="logout()">
<app-icon name="logout" [size]="22" />
</button>
</header>
}
<div class="page__intro">
<h1>Вся коллекция</h1>
@@ -17,46 +19,48 @@
<span>{{ objectsLabel() }}</span>
</div>
<div>
<b>1</b>
<span>город</span>
<b>{{ packs().length }}</b>
<span>{{ citiesLabel() }}</span>
</div>
</section>
<p class="section-label">Мои города</p>
@if (collectedLandmarks().length > 0) {
<article class="pack">
<a class="pack__head" routerLink="/city" [attr.aria-label]="'Объекты: ' + city.name">
<div>
<h2>{{ city.name }}</h2>
<p>Собрано {{ openedCount() }} из {{ totalCount }}</p>
</div>
<div class="pack__percent anim-percent" [style.--to-p]="progress()" aria-hidden="true">
<span>{{ progress() }}%</span>
</div>
<span class="pack__go" aria-hidden="true">
<app-icon name="chevron-right" [size]="20" />
</span>
</a>
@if (packs().length > 0) {
@for (pack of packs(); track pack.area.id) {
<article class="pack">
<a class="pack__head" [routerLink]="['/city', pack.area.id]" [attr.aria-label]="'Объекты: ' + pack.area.name">
<div>
<h2>{{ pack.area.name }}</h2>
<p>Собрано {{ pack.opened }} из {{ pack.total }}</p>
</div>
<div class="pack__percent anim-percent" [style.--to-p]="pack.progress" aria-hidden="true">
<span>{{ pack.progress }}%</span>
</div>
<span class="pack__go" aria-hidden="true">
<app-icon name="chevron-right" [size]="20" />
</span>
</a>
<div class="pack__bar" aria-hidden="true">
<span class="anim-grow" [style.--from]="'0%'" [style.--to]="progress() + '%'"></span>
</div>
<div class="pack__bar" aria-hidden="true">
<span class="anim-grow" [style.--from]="'0%'" [style.--to]="pack.progress + '%'"></span>
</div>
<div class="picked">
@for (landmark of collectedLandmarks(); track landmark.id) {
<a class="picked__card" [routerLink]="objectRoute(landmark.id)">
<div class="picked__preview">
<img [src]="landmark.achievement" alt="" />
</div>
<div class="picked__body">
<h3>{{ landmark.title }}</h3>
</div>
<span class="picked__bar" aria-hidden="true"></span>
</a>
}
</div>
</article>
<div class="picked">
@for (landmark of pack.items; track landmark.id) {
<a class="picked__card" [routerLink]="objectRoute(pack.area.id, landmark)">
<div class="picked__preview">
<img [src]="landmark.iconUrl" alt="" />
</div>
<div class="picked__body">
<h3>{{ landmark.name }}</h3>
</div>
<span class="picked__bar" aria-hidden="true"></span>
</a>
}
</div>
</article>
}
} @else {
<p class="empty">Пока нет полученных объектов.</p>
}