update lock img

This commit is contained in:
2026-11-19 17:40:07 +03:00
parent 0119ac291f
commit 33cc27797e
6 changed files with 235 additions and 126 deletions
+15
View File
@@ -0,0 +1,15 @@
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100" fill="none">
<rect x="7" y="7" width="86" height="86" fill="rgba(255,255,255,0.02)" stroke="#4B453B" stroke-width="1.6" stroke-dasharray="3 3"/>
<g transform="translate(34.4 34.4) scale(1.3)" stroke="#8A8172" stroke-width="1.6" fill="none" stroke-linecap="round" stroke-linejoin="round">
<path d="M6 11 H18 V20 H6 Z"/>
<path d="M8.5 11 V8 A3.5 3.5 0 0 1 15.5 8 V11"/>
</g>
<rect x="3.5" y="3.5" width="7" height="7" fill="#14120F" stroke="#4B453B" stroke-width="1"/>
<rect x="89.5" y="3.5" width="7" height="7" fill="#14120F" stroke="#4B453B" stroke-width="1"/>
<rect x="3.5" y="89.5" width="7" height="7" fill="#14120F" stroke="#4B453B" stroke-width="1"/>
<rect x="89.5" y="89.5" width="7" height="7" fill="#14120F" stroke="#4B453B" stroke-width="1"/>
<path d="M50 3.5 L53.5 7 L50 10.5 L46.5 7 Z" fill="#14120F" stroke="#4B453B" stroke-width="1"/>
<path d="M50 89.5 L53.5 93 L50 96.5 L46.5 93 Z" fill="#14120F" stroke="#4B453B" stroke-width="1"/>
<path d="M3.5 50 L7 46.5 L10.5 50 L7 53.5 Z" fill="#14120F" stroke="#4B453B" stroke-width="1"/>
<path d="M89.5 50 L93 46.5 L96.5 50 L93 53.5 Z" fill="#14120F" stroke="#4B453B" stroke-width="1"/>
</svg>

After

Width:  |  Height:  |  Size: 1.2 KiB

@@ -4,7 +4,7 @@
<img <img
class="card__stamp" class="card__stamp"
[src]="!attraction().visited ? lockIcon : attraction().iconUrl || lockIcon" [src]="!attraction().visited ? lockIcon : attraction().iconUrl || lockIcon"
alt="" alt="icon"
width="72" width="72"
height="72" height="72"
/> />
+26 -10
View File
@@ -30,13 +30,21 @@
</p> </p>
</div> </div>
<div class="pack__percent anim-percent" [style.--to-p]="progress(area)" aria-hidden="true"> <div
class="pack__percent anim-percent"
[style.--to-p]="progress(area)"
aria-hidden="true"
>
<span>{{ progress(area) }}%</span> <span>{{ progress(area) }}%</span>
</div> </div>
</div> </div>
<div class="pack__bar" aria-hidden="true"> <div class="pack__bar" aria-hidden="true">
<span class="anim-grow" [style.--from]="'0%'" [style.--to]="progress(area) + '%'"></span> <span
class="anim-grow"
[style.--from]="'0%'"
[style.--to]="progress(area) + '%'"
></span>
</div> </div>
<div class="city-card__cells"> <div class="city-card__cells">
@@ -48,14 +56,22 @@
attraction.name + (obtained(attraction) ? ', получено' : ', не получен') attraction.name + (obtained(attraction) ? ', получено' : ', не получен')
" "
> >
<img @if (obtained(attraction) && attraction.iconUrl) {
[src]=" <img [src]="attraction?.iconUrl" alt="" />
obtained(attraction) && attraction.iconUrl } @else {
? attraction.iconUrl <div
: '/assets/icons/cell-lock.svg' class="icon-wrapper"
" [class.disable-icon]="!obtained(attraction) && attraction.iconUrl"
[alt]="" >
/> <img
class="main-icon"
[src]="attraction?.iconUrl || '/assets/icons/cell-lock.svg'"
alt=""
/>
<img class="lock-icon" src="/assets/icons/cell-lock-line.svg" alt="" />
</div>
}
</span> </span>
} }
</div> </div>
+35 -2
View File
@@ -128,7 +128,7 @@
padding: 0; padding: 0;
border: 0; border: 0;
border-radius: 10px; border-radius: 10px;
background: #171512;
color: inherit; color: inherit;
text-decoration: none; text-decoration: none;
cursor: pointer; cursor: pointer;
@@ -142,7 +142,7 @@
} }
.cell--open { .cell--open {
background: rgb(224 184 79 / 10%); background: rgb(224 184 79 / 10%) !important;
box-shadow: inset 0 0 0 1.5px var(--color-accent); box-shadow: inset 0 0 0 1.5px var(--color-accent);
} }
@@ -185,3 +185,36 @@
gap: 10px; gap: 10px;
} }
} }
.icon-wrapper {
position: relative;
width: 96px;
height: 96px;
.main-icon {
width: 100%;
height: 100%;
object-fit: contain;
}
.lock-icon {
position: absolute;
top: 50%;
left: 50%;
transform: translate(-52.4%, -52.4%);
width: 100%;
height: 100%;
object-fit: contain;
}
}
.disable-icon {
opacity: 0.2;
background-color: #1c1a17;
.main-icon {
filter: brightness(0);
height: 90%;
}
}
+124 -113
View File
@@ -6,125 +6,136 @@
</header> </header>
@if (area(); as city) { @if (area(); as city) {
<div class="page__city"> <div class="page__city">
<img src="/assets/icons/gorodar-mark.svg" alt="" width="96" height="96" /> <img src="/assets/icons/gorodar-mark.svg" alt="" width="96" height="96" />
<div> <div>
<h1>{{ city.name }}</h1> <h1>{{ city.name }}</h1>
<p> <p>
<app-icon name="pin" [size]="18" /> <app-icon name="pin" [size]="18" />
<span> <span>
<b>{{ openedCount() }}/{{ totalCount() }}</b> <b>{{ openedCount() }}/{{ totalCount() }}</b>
объектов объектов
</span> </span>
<span>·</span> <span>·</span>
<b>{{ progress() }}%</b> <b>{{ progress() }}%</b>
</p> </p>
<div class="page__progress" aria-hidden="true"> <div class="page__progress" aria-hidden="true">
<span [style.width.%]="progress()"></span> <span [style.width.%]="progress()"></span>
</div>
</div> </div>
</div> </div>
</div>
<nav class="tabs" aria-label="Разделы города"> <nav class="tabs" aria-label="Разделы города">
<button <button
class="tabs__item" class="tabs__item"
type="button" type="button"
[class.tabs__item--active]="tab() === 'objects'" [class.tabs__item--active]="tab() === 'objects'"
(click)="openObjects()" (click)="openObjects()"
> >
Объекты Объекты
</button> </button>
<button <button
class="tabs__item" class="tabs__item"
type="button" type="button"
[class.tabs__item--active]="tab() === 'map'" [class.tabs__item--active]="tab() === 'map'"
(click)="openMap()" (click)="openMap()"
> >
На карте На карте
</button> </button>
</nav> </nav>
@if (tab() === 'objects' && totalCount() === 0) { @if (tab() === 'objects' && totalCount() === 0) {
<p class="page__status">В этом городе пока нет объектов.</p> <p class="page__status">В этом городе пока нет объектов.</p>
}
@if (tab() === 'objects' && totalCount() > 0) {
<div class="filters">
<button
type="button"
[class.filters__item--active]="filter() === 'all'"
(click)="filter.set('all')"
>
Все · {{ totalCount() }}
</button>
<button
type="button"
[class.filters__item--active]="filter() === 'open'"
(click)="filter.set('open')"
>
Открыты · {{ openedCount() }}
</button>
<button
type="button"
[class.filters__item--active]="filter() === 'closed'"
(click)="filter.set('closed')"
>
Закрыты · {{ closedCount() }}
</button>
</div>
<div class="grid">
@for (landmark of landmarks(); track landmark.id) {
<a class="card" [routerLink]="objectRoute(landmark.id)">
<div class="card__preview" [class.card__preview--open]="isOpen(landmark)">
@if (isOpen(landmark)) {
<svg class="card__rays" viewBox="0 0 112 112" aria-hidden="true">
@for (ray of rays; track $index) {
<line
[attr.x1]="ray.x1"
[attr.y1]="ray.y1"
[attr.x2]="ray.x2"
[attr.y2]="ray.y2"
stroke="#E0B84F"
[attr.stroke-width]="ray.strong ? 2 : 1.2"
[attr.opacity]="ray.strong ? 0.55 : 0.28"
stroke-linecap="round"
/>
}
</svg>
<span class="card__spark card__spark--a"></span>
<span class="card__spark card__spark--b"></span>
<span class="card__spark card__spark--c"></span>
<span class="card__spark card__spark--d"></span>
}
<img
[src]="isOpen(landmark) && landmark.iconUrl ? landmark.iconUrl : '/assets/icons/cell-lock.svg'"
alt=""
/>
</div>
<div class="card__body">
<h2>{{ landmark.name }}</h2>
<span class="card__status" [class.card__status--open]="isOpen(landmark)">
<app-icon [name]="isOpen(landmark) ? 'check' : 'lock'" [size]="15" />
{{ isOpen(landmark) ? 'Получен' : 'Не получен' }}
</span>
</div>
<span class="card__bar" [class.card__bar--open]="isOpen(landmark)"></span>
</a>
} }
</div>
}
@if (mapReady()) { @if (tab() === 'objects' && totalCount() > 0) {
<div class="page__map" [class.page__map--off]="tab() !== 'map'"> <div class="filters">
<app-city-map <button
[embedded]="true" type="button"
[cityName]="city.name" [class.filters__item--active]="filter() === 'all'"
[areaId]="areaId()" (click)="filter.set('all')"
[attractions]="mapAttractions()" >
/> Все · {{ totalCount() }}
</div> </button>
} <button
type="button"
[class.filters__item--active]="filter() === 'open'"
(click)="filter.set('open')"
>
Открыты · {{ openedCount() }}
</button>
<button
type="button"
[class.filters__item--active]="filter() === 'closed'"
(click)="filter.set('closed')"
>
Закрыты · {{ closedCount() }}
</button>
</div>
<div class="grid">
@for (landmark of landmarks(); track landmark.id) {
<a class="card" [routerLink]="objectRoute(landmark.id)">
<div class="card__preview" [class.card__preview--open]="isOpen(landmark)">
@if (isOpen(landmark)) {
<svg class="card__rays" viewBox="0 0 112 112" aria-hidden="true">
@for (ray of rays; track $index) {
<line
[attr.x1]="ray.x1"
[attr.y1]="ray.y1"
[attr.x2]="ray.x2"
[attr.y2]="ray.y2"
stroke="#E0B84F"
[attr.stroke-width]="ray.strong ? 2 : 1.2"
[attr.opacity]="ray.strong ? 0.55 : 0.28"
stroke-linecap="round"
/>
}
</svg>
<span class="card__spark card__spark--a"></span>
<span class="card__spark card__spark--b"></span>
<span class="card__spark card__spark--c"></span>
<span class="card__spark card__spark--d"></span>
}
<div
class="icon-wrapper"
[class.disable-icon]="!isOpen(landmark) && landmark?.iconUrl"
>
<img
class="main-icon"
[src]="landmark?.iconUrl || '/assets/icons/cell-lock.svg'"
alt=""
/>
@if (!isOpen(landmark) && landmark?.iconUrl) {
<img class="lock-icon" src="/assets/icons/cell-lock-line.svg" alt="" />
}
</div>
</div>
<div class="card__body">
<h2>{{ landmark.name }}</h2>
<span class="card__status" [class.card__status--open]="isOpen(landmark)">
<app-icon [name]="isOpen(landmark) ? 'check' : 'lock'" [size]="15" />
{{ isOpen(landmark) ? 'Получен' : 'Не получен' }}
</span>
</div>
<span class="card__bar" [class.card__bar--open]="isOpen(landmark)"></span>
</a>
}
</div>
}
@if (mapReady()) {
<div class="page__map" [class.page__map--off]="tab() !== 'map'">
<app-city-map
[embedded]="true"
[cityName]="city.name"
[areaId]="areaId()"
[attractions]="mapAttractions()"
/>
</div>
}
} @else if (status() === 'loading') { } @else if (status() === 'loading') {
<p class="page__status">Загружаем город…</p> <p class="page__status">Загружаем город…</p>
} @else { } @else {
+34
View File
@@ -315,3 +315,37 @@
grid-template-columns: 1fr; grid-template-columns: 1fr;
} }
} }
.icon-wrapper {
position: relative;
width: 96px;
height: 96px;
.main-icon {
width: 100%;
height: 100%;
object-fit: contain;
}
.lock-icon {
position: absolute;
top: 50%;
left: 50%;
transform: translate(-50%, -50%);
width: 100%;
height: 100%;
object-fit: contain;
}
}
.disable-icon {
opacity: 0.2;
background-color: #1c1a17;
.main-icon {
filter: brightness(0);
height: 90%;
}
}