add pages

This commit is contained in:
Artem
2026-09-29 01:55:20 +03:00
parent cd0543907b
commit 7e8cb26ddd
110 changed files with 7948 additions and 367 deletions
@@ -0,0 +1,47 @@
import { ChangeDetectionStrategy, Component, computed, inject, input } from '@angular/core';
import { RouterLink } from '@angular/router';
import { MatButton } from '@angular/material/button';
import { Store } from '@ngrx/store';
import { Icon } from '../../shared/icon/icon';
import { GorodarActions } from '../../state';
@Component({
selector: 'app-collect-success',
imports: [Icon, RouterLink, MatButton],
templateUrl: './collect-success.html',
styleUrl: './collect-success.scss',
changeDetection: ChangeDetectionStrategy.OnPush,
})
export class CollectSuccess {
private readonly store = inject(Store);
readonly title = input.required<string>();
readonly cityName = input.required<string>();
readonly opened = input.required<number>();
readonly total = input.required<number>();
readonly matchPercent = input(91);
protected readonly from = computed(() =>
Math.max(0, Math.round(((this.opened() - 1) / this.total()) * 100)),
);
protected readonly to = computed(() => Math.round((this.opened() / this.total()) * 100));
protected readonly rays = Array.from({ length: 24 }, (_, index) => {
const angle = (index / 24) * Math.PI * 2;
const inner = 96;
const outer = index % 2 === 0 ? 168 : 138;
return {
x1: 170 + Math.cos(angle) * inner,
y1: 170 + Math.sin(angle) * inner,
x2: 170 + Math.cos(angle) * outer,
y2: 170 + Math.sin(angle) * outer,
strong: index % 2 === 0,
};
});
protected leave(): void {
this.store.dispatch(GorodarActions.claimReset());
}
}