Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
173a2bc10f | ||
|
|
bc55d55a92 | ||
|
|
b4e61698ce | ||
|
|
ecfd02c671 | ||
|
|
82318aaf6c | ||
|
|
38d58bcf8d | ||
|
|
3a711fb8f0 | ||
|
|
28d0e3edf6 | ||
|
|
deceebd899 | ||
|
|
7e8cb26ddd | ||
|
|
501e890d99 |
@@ -0,0 +1,8 @@
|
||||
node_modules
|
||||
dist
|
||||
.git
|
||||
.angular
|
||||
coverage
|
||||
out-tsc
|
||||
tmp
|
||||
*.md
|
||||
@@ -0,0 +1,18 @@
|
||||
FROM node:20-alpine AS build
|
||||
|
||||
WORKDIR /app
|
||||
|
||||
COPY package.json package-lock.json ./
|
||||
RUN npm i
|
||||
|
||||
COPY . .
|
||||
RUN npm run build
|
||||
|
||||
FROM nginx:1.27-alpine
|
||||
|
||||
COPY nginx.conf /etc/nginx/conf.d/default.conf
|
||||
COPY --from=build /app/dist/gorodar-front/browser /usr/share/nginx/html
|
||||
|
||||
EXPOSE 80
|
||||
|
||||
CMD ["nginx", "-g", "daemon off;"]
|
||||
@@ -3,7 +3,7 @@
|
||||
"version": 1,
|
||||
"newProjectRoot": "projects",
|
||||
"projects": {
|
||||
"maps": {
|
||||
"gorodar-front": {
|
||||
"projectType": "application",
|
||||
"schematics": {
|
||||
"@schematics/angular:component": {
|
||||
@@ -18,20 +18,19 @@
|
||||
"builder": "@angular/build:application",
|
||||
"options": {
|
||||
"browser": "src/main.ts",
|
||||
"polyfills": [
|
||||
"zone.js"
|
||||
],
|
||||
"polyfills": ["zone.js"],
|
||||
"tsConfig": "tsconfig.app.json",
|
||||
"inlineStyleLanguage": "scss",
|
||||
"stylePreprocessorOptions": {
|
||||
"includePaths": ["src/assets/styles"]
|
||||
},
|
||||
"assets": [
|
||||
{
|
||||
"glob": "**/*",
|
||||
"input": "public"
|
||||
}
|
||||
],
|
||||
"styles": [
|
||||
"src/styles.scss"
|
||||
]
|
||||
"styles": ["@angular/material/prebuilt-themes/magenta-violet.css", "src/styles.scss"]
|
||||
},
|
||||
"configurations": {
|
||||
"production": {
|
||||
@@ -47,7 +46,8 @@
|
||||
"maximumError": "8kB"
|
||||
}
|
||||
],
|
||||
"outputHashing": "all"
|
||||
"outputHashing": "all",
|
||||
"serviceWorker": "ngsw-config.json"
|
||||
},
|
||||
"development": {
|
||||
"optimization": false,
|
||||
@@ -61,10 +61,10 @@
|
||||
"builder": "@angular/build:dev-server",
|
||||
"configurations": {
|
||||
"production": {
|
||||
"buildTarget": "maps:build:production"
|
||||
"buildTarget": "gorodar-front:build:production"
|
||||
},
|
||||
"development": {
|
||||
"buildTarget": "maps:build:development"
|
||||
"buildTarget": "gorodar-front:build:development"
|
||||
}
|
||||
},
|
||||
"defaultConfiguration": "development"
|
||||
@@ -75,21 +75,19 @@
|
||||
"test": {
|
||||
"builder": "@angular/build:karma",
|
||||
"options": {
|
||||
"polyfills": [
|
||||
"zone.js",
|
||||
"zone.js/testing"
|
||||
],
|
||||
"polyfills": ["zone.js", "zone.js/testing"],
|
||||
"tsConfig": "tsconfig.spec.json",
|
||||
"inlineStyleLanguage": "scss",
|
||||
"stylePreprocessorOptions": {
|
||||
"includePaths": ["src/assets/styles"]
|
||||
},
|
||||
"assets": [
|
||||
{
|
||||
"glob": "**/*",
|
||||
"input": "public"
|
||||
}
|
||||
],
|
||||
"styles": [
|
||||
"src/styles.scss"
|
||||
]
|
||||
"styles": ["@angular/material/prebuilt-themes/magenta-violet.css", "src/styles.scss"]
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,7 @@
|
||||
services:
|
||||
front:
|
||||
image: front:latest
|
||||
build: .
|
||||
ports:
|
||||
- '82:80'
|
||||
restart: unless-stopped
|
||||
@@ -0,0 +1,11 @@
|
||||
server {
|
||||
listen 80;
|
||||
server_name _;
|
||||
|
||||
root /usr/share/nginx/html;
|
||||
index index.html;
|
||||
|
||||
location / {
|
||||
try_files $uri $uri/ /index.html;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,45 @@
|
||||
{
|
||||
"$schema": "./node_modules/@angular/service-worker/config/schema.json",
|
||||
"index": "/index.html",
|
||||
"assetGroups": [
|
||||
{
|
||||
"name": "app",
|
||||
"installMode": "prefetch",
|
||||
"resources": {
|
||||
"files": [
|
||||
"/favicon.ico",
|
||||
"/favicon.svg",
|
||||
"/index.csr.html",
|
||||
"/index.html",
|
||||
"/manifest.webmanifest",
|
||||
"/*.css",
|
||||
"/*.js"
|
||||
]
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "assets",
|
||||
"installMode": "lazy",
|
||||
"updateMode": "prefetch",
|
||||
"resources": {
|
||||
"files": [
|
||||
"/**/*.(svg|cur|jpg|jpeg|png|apng|webp|avif|gif|otf|ttf|woff|woff2)"
|
||||
]
|
||||
}
|
||||
}
|
||||
],
|
||||
"dataGroups": [
|
||||
{
|
||||
"name": "fonts",
|
||||
"urls": [
|
||||
"https://fonts.googleapis.com/**",
|
||||
"https://fonts.gstatic.com/**"
|
||||
],
|
||||
"cacheConfig": {
|
||||
"maxSize": 20,
|
||||
"maxAge": "30d",
|
||||
"strategy": "performance"
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
@@ -1,5 +1,5 @@
|
||||
{
|
||||
"name": "maps",
|
||||
"name": "gorodar-front",
|
||||
"version": "0.0.0",
|
||||
"scripts": {
|
||||
"ng": "ng",
|
||||
@@ -22,12 +22,23 @@
|
||||
},
|
||||
"private": true,
|
||||
"dependencies": {
|
||||
"@angular/animations": "^20.3.32",
|
||||
"@angular/cdk": "^20.2.14",
|
||||
"@angular/common": "^20.3.0",
|
||||
"@angular/compiler": "^20.3.0",
|
||||
"@angular/core": "^20.3.0",
|
||||
"@angular/forms": "^20.3.0",
|
||||
"@angular/material": "^20.2.14",
|
||||
"@angular/platform-browser": "^20.3.0",
|
||||
"@angular/router": "^20.3.0",
|
||||
"@angular/service-worker": "^20.3.0",
|
||||
"@capacitor/camera": "^8.2.4",
|
||||
"@capacitor/core": "^8.5.2",
|
||||
"@capacitor/geolocation": "^8.2.2",
|
||||
"@ionic/pwa-elements": "^3.4.0",
|
||||
"@ngrx/effects": "^20.1.0",
|
||||
"@ngrx/store": "^20.1.0",
|
||||
"@ngrx/store-devtools": "^20.1.0",
|
||||
"rxjs": "~7.8.0",
|
||||
"tslib": "^2.3.0",
|
||||
"zone.js": "~0.15.0"
|
||||
@@ -36,6 +47,7 @@
|
||||
"@angular/build": "^20.3.37",
|
||||
"@angular/cli": "^20.3.37",
|
||||
"@angular/compiler-cli": "^20.3.0",
|
||||
"@capacitor/cli": "^6.2.2",
|
||||
"@types/jasmine": "~5.1.0",
|
||||
"jasmine-core": "~5.9.0",
|
||||
"karma": "~6.4.0",
|
||||
@@ -45,4 +57,4 @@
|
||||
"karma-jasmine-html-reporter": "~2.1.0",
|
||||
"typescript": "~5.9.2"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,4 @@
|
||||
<svg xmlns="http://www.w3.org/2000/svg" viewBox="-2 -2 28 28" fill="none">
|
||||
<path d="M4 8 H8 L9.5 5.5 H14.5 L16 8 H20 V19 H4 Z" stroke="#fff" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"/>
|
||||
<path d="M8.6 13.2 a3.4 3.4 0 1 0 6.8 0 a3.4 3.4 0 1 0 -6.8 0" stroke="#fff" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"/>
|
||||
</svg>
|
||||
|
After Width: | Height: | Size: 361 B |
@@ -0,0 +1,16 @@
|
||||
<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"/>
|
||||
<rect x="11.5" y="11.5" width="77" height="77" stroke="#4B453B" stroke-width="0.6" opacity="0.6"/>
|
||||
<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.3 KiB |
@@ -0,0 +1,4 @@
|
||||
<svg xmlns="http://www.w3.org/2000/svg" width="40" height="40" viewBox="0 0 40 40" fill="none">
|
||||
<circle cx="20" cy="20" r="17.5" fill="#E0B84F" stroke="#12110F" stroke-width="3"/>
|
||||
<path d="M12 20.4 L17.6 26 L28.4 13.6" stroke="#1A1508" stroke-width="3.2" stroke-linecap="round" stroke-linejoin="round"/>
|
||||
</svg>
|
||||
|
After Width: | Height: | Size: 315 B |
@@ -0,0 +1,3 @@
|
||||
<svg xmlns="http://www.w3.org/2000/svg" viewBox="-2 -2 28 28" fill="none">
|
||||
<path d="M5 12.5 L10 17.5 L19 7.5" stroke="#fff" stroke-width="2.8" stroke-linecap="round" stroke-linejoin="round"/>
|
||||
</svg>
|
||||
|
After Width: | Height: | Size: 201 B |
@@ -0,0 +1,3 @@
|
||||
<svg xmlns="http://www.w3.org/2000/svg" viewBox="-2 -2 28 28" fill="none">
|
||||
<path d="M5 9 L12 16 L19 9" stroke="#fff" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"/>
|
||||
</svg>
|
||||
|
After Width: | Height: | Size: 192 B |
@@ -0,0 +1,3 @@
|
||||
<svg xmlns="http://www.w3.org/2000/svg" viewBox="-2 -2 28 28" fill="none">
|
||||
<path d="M15 5 L8 12 L15 19" stroke="#fff" stroke-width="1.8" stroke-linecap="round" stroke-linejoin="round"/>
|
||||
</svg>
|
||||
|
After Width: | Height: | Size: 195 B |
@@ -0,0 +1,3 @@
|
||||
<svg xmlns="http://www.w3.org/2000/svg" viewBox="-2 -2 28 28" fill="none">
|
||||
<path d="M9 5 L16 12 L9 19" stroke="#fff" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"/>
|
||||
</svg>
|
||||
|
After Width: | Height: | Size: 192 B |
@@ -0,0 +1,6 @@
|
||||
<svg xmlns="http://www.w3.org/2000/svg" viewBox="-2 -2 28 28" fill="none">
|
||||
<path d="M4 4 H10 V10 H4 Z" stroke="#fff" stroke-width="1.7" stroke-linecap="round" stroke-linejoin="round"/>
|
||||
<path d="M14 4 H20 V10 H14 Z" stroke="#fff" stroke-width="1.7" stroke-linecap="round" stroke-linejoin="round"/>
|
||||
<path d="M4 14 H10 V20 H4 Z" stroke="#fff" stroke-width="1.7" stroke-linecap="round" stroke-linejoin="round"/>
|
||||
<path d="M14 14 H20 V20 H14 Z" stroke="#fff" stroke-width="1.7" stroke-linecap="round" stroke-linejoin="round"/>
|
||||
</svg>
|
||||
|
After Width: | Height: | Size: 536 B |
@@ -0,0 +1,4 @@
|
||||
<svg xmlns="http://www.w3.org/2000/svg" viewBox="-2 -2 28 28" fill="none">
|
||||
<path d="M7 9 a5 5 0 1 0 10 0 a5 5 0 1 0 -10 0" stroke="#fff" stroke-width="1.7" stroke-linecap="round" stroke-linejoin="round"/>
|
||||
<path d="M9 13.5 L7 21 L12 18.5 L17 21 L15 13.5" stroke="#fff" stroke-width="1.7" stroke-linecap="round" stroke-linejoin="round"/>
|
||||
</svg>
|
||||
|
After Width: | Height: | Size: 347 B |
@@ -0,0 +1,5 @@
|
||||
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none">
|
||||
<path d="M3 12 a9 9 0 1 0 18 0 a9 9 0 1 0 -18 0" stroke="#fff" stroke-width="1.6" stroke-linecap="round" stroke-linejoin="round"/>
|
||||
<path d="M3 12 H21" stroke="#fff" stroke-width="1.6" stroke-linecap="round" stroke-linejoin="round"/>
|
||||
<path d="M12 3 C8 8 8 16 12 21 C16 16 16 8 12 3" stroke="#fff" stroke-width="1.6" stroke-linecap="round" stroke-linejoin="round"/>
|
||||
</svg>
|
||||
|
After Width: | Height: | Size: 450 B |
@@ -0,0 +1,24 @@
|
||||
<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(224,184,79,0.07)" stroke="#E0B84F" stroke-width="2.2"/>
|
||||
<rect x="11.5" y="11.5" width="77" height="77" stroke="#E0B84F" stroke-width="0.6" opacity="0.6"/>
|
||||
<g transform="translate(18 18)" stroke="#F2D98E" stroke-width="1.7" fill="none" stroke-linecap="round" stroke-linejoin="round">
|
||||
<path d="M8 56 H56"/>
|
||||
<path d="M26 56 V34 M38 56 V34"/>
|
||||
<path d="M25 34 L32 12 L39 34 Z"/>
|
||||
<path d="M32 12 V5 M30 8 H34"/>
|
||||
<path d="M10 56 V42 M18 56 V42"/>
|
||||
<path d="M10 42 C8 34 14 32 14 26 C14 32 20 34 18 42 Z"/>
|
||||
<path d="M14 26 V22"/>
|
||||
<path d="M46 56 V42 M54 56 V42"/>
|
||||
<path d="M46 42 C44 34 50 32 50 26 C50 32 56 34 54 42 Z"/>
|
||||
<path d="M50 26 V22"/>
|
||||
</g>
|
||||
<rect x="3.5" y="3.5" width="7" height="7" fill="#14120F" stroke="#E0B84F" stroke-width="1"/>
|
||||
<rect x="89.5" y="3.5" width="7" height="7" fill="#14120F" stroke="#E0B84F" stroke-width="1"/>
|
||||
<rect x="3.5" y="89.5" width="7" height="7" fill="#14120F" stroke="#E0B84F" stroke-width="1"/>
|
||||
<rect x="89.5" y="89.5" width="7" height="7" fill="#14120F" stroke="#E0B84F" stroke-width="1"/>
|
||||
<path d="M50 3.5 L53.5 7 L50 10.5 L46.5 7 Z" fill="#14120F" stroke="#E0B84F" stroke-width="1"/>
|
||||
<path d="M50 89.5 L53.5 93 L50 96.5 L46.5 93 Z" fill="#14120F" stroke="#E0B84F" stroke-width="1"/>
|
||||
<path d="M3.5 50 L7 46.5 L10.5 50 L7 53.5 Z" fill="#14120F" stroke="#E0B84F" stroke-width="1"/>
|
||||
<path d="M89.5 50 L93 46.5 L96.5 50 L93 53.5 Z" fill="#14120F" stroke="#E0B84F" stroke-width="1"/>
|
||||
</svg>
|
||||
|
After Width: | Height: | Size: 1.6 KiB |
@@ -0,0 +1,7 @@
|
||||
<svg xmlns="http://www.w3.org/2000/svg" width="40" height="40" viewBox="0 0 40 40" fill="none">
|
||||
<circle cx="20" cy="20" r="18" fill="#1C1A17" stroke="#E0B84F" stroke-width="2"/>
|
||||
<g transform="translate(8 8)" stroke="#F2D98E" stroke-width="1.8" 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>
|
||||
</svg>
|
||||
|
After Width: | Height: | Size: 410 B |
@@ -0,0 +1,4 @@
|
||||
<svg xmlns="http://www.w3.org/2000/svg" viewBox="-2 -2 28 28" fill="none">
|
||||
<path d="M6 11 H18 V20 H6 Z" stroke="#fff" stroke-width="1.8" stroke-linecap="round" stroke-linejoin="round"/>
|
||||
<path d="M8.5 11 V8 A3.5 3.5 0 0 1 15.5 8 V11" stroke="#fff" stroke-width="1.8" stroke-linecap="round" stroke-linejoin="round"/>
|
||||
</svg>
|
||||
|
After Width: | Height: | Size: 326 B |
@@ -0,0 +1,5 @@
|
||||
<svg xmlns="http://www.w3.org/2000/svg" width="48" height="58" viewBox="0 0 48 58" fill="none">
|
||||
<path d="M24 0C10.75 0 0 10.75 0 24c0 18 24 34 24 34s24-16 24-34C48 10.75 37.25 0 24 0z" fill="#E0B84F"/>
|
||||
<circle cx="24" cy="24" r="11" fill="#1A1508"/>
|
||||
<circle cx="24" cy="24" r="5" fill="#F2D98E"/>
|
||||
</svg>
|
||||
|
After Width: | Height: | Size: 310 B |
@@ -0,0 +1,4 @@
|
||||
<svg xmlns="http://www.w3.org/2000/svg" viewBox="-2 -2 28 28" fill="none">
|
||||
<path d="M3 6 L9 4 L15 6 L21 4 V18 L15 20 L9 18 L3 20 Z" stroke="#fff" stroke-width="1.7" stroke-linecap="round" stroke-linejoin="round"/>
|
||||
<path d="M9 4 V18 M15 6 V20" stroke="#fff" stroke-width="1.7" stroke-linecap="round" stroke-linejoin="round"/>
|
||||
</svg>
|
||||
|
After Width: | Height: | Size: 336 B |
@@ -0,0 +1,5 @@
|
||||
<svg xmlns="http://www.w3.org/2000/svg" viewBox="-2 -2 28 28" fill="none">
|
||||
<path d="M6 12 a6 6 0 1 0 12 0 a6 6 0 1 0 -12 0" stroke="#fff" stroke-width="1.8" stroke-linecap="round" stroke-linejoin="round"/>
|
||||
<path d="M10.5 12 a1.5 1.5 0 1 0 3 0 a1.5 1.5 0 1 0 -3 0" stroke="#fff" stroke-width="1.8" stroke-linecap="round" stroke-linejoin="round"/>
|
||||
<path d="M12 2 V5 M12 19 V22 M2 12 H5 M19 12 H22" stroke="#fff" stroke-width="1.8" stroke-linecap="round" stroke-linejoin="round"/>
|
||||
</svg>
|
||||
|
After Width: | Height: | Size: 491 B |
@@ -0,0 +1,4 @@
|
||||
<svg xmlns="http://www.w3.org/2000/svg" viewBox="-2 -2 28 28" fill="none">
|
||||
<path d="M12 21 C12 21 5 14.5 5 9.5 A7 7 0 0 1 19 9.5 C19 14.5 12 21 12 21 Z" stroke="#fff" stroke-width="1.8" stroke-linecap="round" stroke-linejoin="round"/>
|
||||
<path d="M9.6 9.5 a2.4 2.4 0 1 0 4.8 0 a2.4 2.4 0 1 0 -4.8 0" stroke="#fff" stroke-width="1.8" stroke-linecap="round" stroke-linejoin="round"/>
|
||||
</svg>
|
||||
|
After Width: | Height: | Size: 390 B |
@@ -0,0 +1,4 @@
|
||||
<svg xmlns="http://www.w3.org/2000/svg" viewBox="-2 -2 28 28" fill="none">
|
||||
<path d="M8 8 a4 4 0 1 0 8 0 a4 4 0 1 0 -8 0" stroke="#fff" stroke-width="1.8" stroke-linecap="round" stroke-linejoin="round"/>
|
||||
<path d="M4 20 C4 15 8 13.5 12 13.5 C16 13.5 20 15 20 20" stroke="#fff" stroke-width="1.8" stroke-linecap="round" stroke-linejoin="round"/>
|
||||
</svg>
|
||||
|
After Width: | Height: | Size: 354 B |
@@ -0,0 +1,4 @@
|
||||
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none">
|
||||
<path d="M5 11 a6 6 0 1 0 12 0 a6 6 0 1 0 -12 0" stroke="#fff" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"/>
|
||||
<path d="M16 16 L21 21" stroke="#fff" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"/>
|
||||
</svg>
|
||||
|
After Width: | Height: | Size: 317 B |
@@ -0,0 +1 @@
|
||||
<svg xmlns="http://www.w3.org/2000/svg" width="390" height="320" viewBox="0 0 390 320"><defs><linearGradient id="nn1" x1="0" y1="0" x2="0" y2="1"><stop offset="0" stop-color="#161B38"></stop><stop offset="0.55" stop-color="#4A3A63"></stop><stop offset="1" stop-color="#C9764C"></stop></linearGradient></defs><rect width="390" height="320" fill="url(#nn1)"></rect><circle cx="46.8" cy="20.5" r="1.1" fill="#FFFFFF" opacity="0.65"></circle><circle cx="117.0" cy="35.8" r="1.1" fill="#FFFFFF" opacity="0.65"></circle><circle cx="280.8" cy="17.9" r="1.1" fill="#FFFFFF" opacity="0.65"></circle><circle cx="335.4" cy="43.5" r="1.1" fill="#FFFFFF" opacity="0.65"></circle><circle cx="78.0" cy="66.6" r="1.1" fill="#FFFFFF" opacity="0.65"></circle><circle cx="358.8" cy="76.8" r="1.1" fill="#FFFFFF" opacity="0.65"></circle><circle cx="31.2" cy="92.2" r="1.1" fill="#FFFFFF" opacity="0.65"></circle><circle cx="304.2" cy="102.4" r="1.1" fill="#FFFFFF" opacity="0.65"></circle><rect x="113.8" y="203.4" width="162.4" height="98.6" fill="#0C0B0A"></rect><rect x="73.2" y="244.0" width="40.6" height="58.0" fill="#0C0B0A"></rect><rect x="276.2" y="244.0" width="40.6" height="58.0" fill="#0C0B0A"></rect><rect x="166.0" y="168.6" width="58.0" height="34.8" fill="#0C0B0A"></rect><path d="M160.2 168.6 C144.9 143.0 183.9 126.4 195.0 93.2 C206.1 126.4 245.1 143.0 229.8 168.6 Z" fill="#0C0B0A"></path><path d="M195.0 64.2 V93.2 M186.3 73.8 H203.7" stroke="#0C0B0A" stroke-width="2.9" fill="none"></path><path d="M76.1 244.0 C68.4 231.2 87.9 222.9 93.5 206.3 C99.1 222.9 118.6 231.2 110.9 244.0 Z" fill="#0C0B0A"></path><path d="M93.5 186.0 V206.3 M87.4 192.7 H99.6" stroke="#0C0B0A" stroke-width="2.0" fill="none"></path><path d="M279.1 244.0 C271.4 231.2 290.9 222.9 296.5 206.3 C302.1 222.9 321.6 231.2 313.9 244.0 Z" fill="#0C0B0A"></path><path d="M296.5 186.0 V206.3 M290.4 192.7 H302.6" stroke="#0C0B0A" stroke-width="2.0" fill="none"></path><ellipse cx="0.0" cy="318.0" rx="29.3" ry="14.4" fill="#0C0B0A"></ellipse><ellipse cx="48.8" cy="318.0" rx="29.3" ry="20.5" fill="#0C0B0A"></ellipse><ellipse cx="97.5" cy="318.0" rx="29.3" ry="26.4" fill="#0C0B0A"></ellipse><ellipse cx="146.2" cy="318.0" rx="29.3" ry="14.4" fill="#0C0B0A"></ellipse><ellipse cx="195.0" cy="318.0" rx="29.3" ry="20.5" fill="#0C0B0A"></ellipse><ellipse cx="243.8" cy="318.0" rx="29.3" ry="26.4" fill="#0C0B0A"></ellipse><ellipse cx="292.5" cy="318.0" rx="29.3" ry="14.4" fill="#0C0B0A"></ellipse><ellipse cx="341.2" cy="318.0" rx="29.3" ry="20.5" fill="#0C0B0A"></ellipse><ellipse cx="390.0" cy="318.0" rx="29.3" ry="26.4" fill="#0C0B0A"></ellipse><rect x="0" y="310.0" width="390" height="10" fill="#0C0B0A"></rect></svg>
|
||||
|
After Width: | Height: | Size: 2.6 KiB |
@@ -0,0 +1 @@
|
||||
<svg xmlns="http://www.w3.org/2000/svg" width="128" height="168" viewBox="0 0 128 168"><defs><linearGradient id="nn2" x1="0" y1="0" x2="0" y2="1"><stop offset="0" stop-color="#6FA8E0"></stop><stop offset="0.55" stop-color="#A9CDEE"></stop><stop offset="1" stop-color="#F0E4CF"></stop></linearGradient></defs><rect width="128" height="168" fill="url(#nn2)"></rect><rect x="27.6" y="109.8" width="72.8" height="44.2" fill="#39444F"></rect><rect x="9.4" y="128.0" width="18.2" height="26.0" fill="#39444F"></rect><rect x="100.4" y="128.0" width="18.2" height="26.0" fill="#39444F"></rect><rect x="51.0" y="94.2" width="26.0" height="15.6" fill="#39444F"></rect><path d="M48.4 94.2 C41.5 82.7 59.0 75.3 64.0 60.4 C69.0 75.3 86.5 82.7 79.6 94.2 Z" fill="#39444F"></path><path d="M64.0 47.4 V60.4 M60.1 51.7 H67.9" stroke="#39444F" stroke-width="1.3" fill="none"></path><path d="M10.7 128.0 C7.3 122.3 16.0 118.5 18.5 111.1 C21.0 118.5 29.7 122.3 26.3 128.0 Z" fill="#39444F"></path><path d="M18.5 102.0 V111.1 M15.8 105.0 H21.2" stroke="#39444F" stroke-width="1.0" fill="none"></path><path d="M101.7 128.0 C98.3 122.3 107.0 118.5 109.5 111.1 C112.0 118.5 120.7 122.3 117.3 128.0 Z" fill="#39444F"></path><path d="M109.5 102.0 V111.1 M106.8 105.0 H112.2" stroke="#39444F" stroke-width="1.0" fill="none"></path><ellipse cx="0.0" cy="166.0" rx="9.6" ry="7.6" fill="#39444F"></ellipse><ellipse cx="16.0" cy="166.0" rx="9.6" ry="10.8" fill="#39444F"></ellipse><ellipse cx="32.0" cy="166.0" rx="9.6" ry="13.9" fill="#39444F"></ellipse><ellipse cx="48.0" cy="166.0" rx="9.6" ry="7.6" fill="#39444F"></ellipse><ellipse cx="64.0" cy="166.0" rx="9.6" ry="10.8" fill="#39444F"></ellipse><ellipse cx="80.0" cy="166.0" rx="9.6" ry="13.9" fill="#39444F"></ellipse><ellipse cx="96.0" cy="166.0" rx="9.6" ry="7.6" fill="#39444F"></ellipse><ellipse cx="112.0" cy="166.0" rx="9.6" ry="10.8" fill="#39444F"></ellipse><ellipse cx="128.0" cy="166.0" rx="9.6" ry="13.9" fill="#39444F"></ellipse><rect x="0" y="158.0" width="128" height="10" fill="#39444F"></rect></svg>
|
||||
|
After Width: | Height: | Size: 2.0 KiB |
@@ -0,0 +1 @@
|
||||
<svg xmlns="http://www.w3.org/2000/svg" width="128" height="168" viewBox="0 0 128 168"><defs><linearGradient id="nn3" x1="0" y1="0" x2="0" y2="1"><stop offset="0" stop-color="#161B38"></stop><stop offset="0.55" stop-color="#4A3A63"></stop><stop offset="1" stop-color="#C9764C"></stop></linearGradient></defs><rect width="128" height="168" fill="url(#nn3)"></rect><circle cx="15.4" cy="10.8" r="1.1" fill="#FFFFFF" opacity="0.65"></circle><circle cx="38.4" cy="18.8" r="1.1" fill="#FFFFFF" opacity="0.65"></circle><circle cx="92.2" cy="9.4" r="1.1" fill="#FFFFFF" opacity="0.65"></circle><circle cx="110.1" cy="22.8" r="1.1" fill="#FFFFFF" opacity="0.65"></circle><circle cx="25.6" cy="34.9" r="1.1" fill="#FFFFFF" opacity="0.65"></circle><circle cx="117.8" cy="40.3" r="1.1" fill="#FFFFFF" opacity="0.65"></circle><circle cx="10.2" cy="48.4" r="1.1" fill="#FFFFFF" opacity="0.65"></circle><circle cx="99.8" cy="53.8" r="1.1" fill="#FFFFFF" opacity="0.65"></circle><rect x="29.0" y="107.5" width="70.0" height="42.5" fill="#0C0B0A"></rect><rect x="11.5" y="125.0" width="17.5" height="25.0" fill="#0C0B0A"></rect><rect x="99.0" y="125.0" width="17.5" height="25.0" fill="#0C0B0A"></rect><rect x="51.5" y="92.5" width="25.0" height="15.0" fill="#0C0B0A"></rect><path d="M49.0 92.5 C42.4 81.5 59.2 74.3 64.0 60.0 C68.8 74.3 85.6 81.5 79.0 92.5 Z" fill="#0C0B0A"></path><path d="M64.0 47.5 V60.0 M60.2 51.6 H67.8" stroke="#0C0B0A" stroke-width="1.2" fill="none"></path><path d="M12.8 125.0 C9.5 119.5 17.9 115.9 20.2 108.8 C22.6 115.9 31.0 119.5 27.8 125.0 Z" fill="#0C0B0A"></path><path d="M20.2 100.0 V108.8 M17.6 102.9 H22.9" stroke="#0C0B0A" stroke-width="1.0" fill="none"></path><path d="M100.2 125.0 C97.0 119.5 105.3 115.9 107.8 108.8 C110.2 115.9 118.5 119.5 115.2 125.0 Z" fill="#0C0B0A"></path><path d="M107.8 100.0 V108.8 M105.1 102.9 H110.4" stroke="#0C0B0A" stroke-width="1.0" fill="none"></path><ellipse cx="0.0" cy="166.0" rx="9.6" ry="7.6" fill="#0C0B0A"></ellipse><ellipse cx="16.0" cy="166.0" rx="9.6" ry="10.8" fill="#0C0B0A"></ellipse><ellipse cx="32.0" cy="166.0" rx="9.6" ry="13.9" fill="#0C0B0A"></ellipse><ellipse cx="48.0" cy="166.0" rx="9.6" ry="7.6" fill="#0C0B0A"></ellipse><ellipse cx="64.0" cy="166.0" rx="9.6" ry="10.8" fill="#0C0B0A"></ellipse><ellipse cx="80.0" cy="166.0" rx="9.6" ry="13.9" fill="#0C0B0A"></ellipse><ellipse cx="96.0" cy="166.0" rx="9.6" ry="7.6" fill="#0C0B0A"></ellipse><ellipse cx="112.0" cy="166.0" rx="9.6" ry="10.8" fill="#0C0B0A"></ellipse><ellipse cx="128.0" cy="166.0" rx="9.6" ry="13.9" fill="#0C0B0A"></ellipse><rect x="0" y="158.0" width="128" height="10" fill="#0C0B0A"></rect></svg>
|
||||
|
After Width: | Height: | Size: 2.6 KiB |
@@ -0,0 +1 @@
|
||||
<svg xmlns="http://www.w3.org/2000/svg" width="128" height="168" viewBox="0 0 128 168"><defs><linearGradient id="nn4" x1="0" y1="0" x2="0" y2="1"><stop offset="0" stop-color="#8F9BA8"></stop><stop offset="0.55" stop-color="#C8CFD6"></stop><stop offset="1" stop-color="#EDEFF1"></stop></linearGradient></defs><rect width="128" height="168" fill="url(#nn4)"></rect><rect x="27.6" y="109.8" width="72.8" height="44.2" fill="#2F353B"></rect><rect x="9.4" y="128.0" width="18.2" height="26.0" fill="#2F353B"></rect><rect x="100.4" y="128.0" width="18.2" height="26.0" fill="#2F353B"></rect><rect x="51.0" y="94.2" width="26.0" height="15.6" fill="#2F353B"></rect><path d="M48.4 94.2 C41.5 82.7 59.0 75.3 64.0 60.4 C69.0 75.3 86.5 82.7 79.6 94.2 Z" fill="#2F353B"></path><path d="M64.0 47.4 V60.4 M60.1 51.7 H67.9" stroke="#2F353B" stroke-width="1.3" fill="none"></path><path d="M10.7 128.0 C7.3 122.3 16.0 118.5 18.5 111.1 C21.0 118.5 29.7 122.3 26.3 128.0 Z" fill="#2F353B"></path><path d="M18.5 102.0 V111.1 M15.8 105.0 H21.2" stroke="#2F353B" stroke-width="1.0" fill="none"></path><path d="M101.7 128.0 C98.3 122.3 107.0 118.5 109.5 111.1 C112.0 118.5 120.7 122.3 117.3 128.0 Z" fill="#2F353B"></path><path d="M109.5 102.0 V111.1 M106.8 105.0 H112.2" stroke="#2F353B" stroke-width="1.0" fill="none"></path><ellipse cx="0.0" cy="166.0" rx="9.6" ry="7.6" fill="#2F353B"></ellipse><ellipse cx="16.0" cy="166.0" rx="9.6" ry="10.8" fill="#2F353B"></ellipse><ellipse cx="32.0" cy="166.0" rx="9.6" ry="13.9" fill="#2F353B"></ellipse><ellipse cx="48.0" cy="166.0" rx="9.6" ry="7.6" fill="#2F353B"></ellipse><ellipse cx="64.0" cy="166.0" rx="9.6" ry="10.8" fill="#2F353B"></ellipse><ellipse cx="80.0" cy="166.0" rx="9.6" ry="13.9" fill="#2F353B"></ellipse><ellipse cx="96.0" cy="166.0" rx="9.6" ry="7.6" fill="#2F353B"></ellipse><ellipse cx="112.0" cy="166.0" rx="9.6" ry="10.8" fill="#2F353B"></ellipse><ellipse cx="128.0" cy="166.0" rx="9.6" ry="13.9" fill="#2F353B"></ellipse><rect x="0" y="158.0" width="128" height="10" fill="#2F353B"></rect></svg>
|
||||
|
After Width: | Height: | Size: 2.0 KiB |
|
Before Width: | Height: | Size: 15 KiB After Width: | Height: | Size: 4.6 KiB |
@@ -0,0 +1,25 @@
|
||||
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100">
|
||||
<rect width="100" height="100" rx="18" fill="#12110F"/>
|
||||
<rect x="7" y="7" width="86" height="86" fill="rgba(224,184,79,0.07)" stroke="#E0B84F" stroke-width="2.2"/>
|
||||
<rect x="11.5" y="11.5" width="77" height="77" stroke="#E0B84F" stroke-width="0.6" opacity="0.6"/>
|
||||
<g transform="translate(18 18)" stroke="#F2D98E" stroke-width="1.7" fill="none" stroke-linecap="round" stroke-linejoin="round">
|
||||
<path d="M8 56 H56"/>
|
||||
<path d="M26 56 V34 M38 56 V34"/>
|
||||
<path d="M25 34 L32 12 L39 34 Z"/>
|
||||
<path d="M32 12 V5 M30 8 H34"/>
|
||||
<path d="M10 56 V42 M18 56 V42"/>
|
||||
<path d="M10 42 C8 34 14 32 14 26 C14 32 20 34 18 42 Z"/>
|
||||
<path d="M14 26 V22"/>
|
||||
<path d="M46 56 V42 M54 56 V42"/>
|
||||
<path d="M46 42 C44 34 50 32 50 26 C50 32 56 34 54 42 Z"/>
|
||||
<path d="M50 26 V22"/>
|
||||
</g>
|
||||
<rect x="3.5" y="3.5" width="7" height="7" fill="#14120F" stroke="#E0B84F" stroke-width="1"/>
|
||||
<rect x="89.5" y="3.5" width="7" height="7" fill="#14120F" stroke="#E0B84F" stroke-width="1"/>
|
||||
<rect x="3.5" y="89.5" width="7" height="7" fill="#14120F" stroke="#E0B84F" stroke-width="1"/>
|
||||
<rect x="89.5" y="89.5" width="7" height="7" fill="#14120F" stroke="#E0B84F" stroke-width="1"/>
|
||||
<path d="M50 3.5 L53.5 7 L50 10.5 L46.5 7 Z" fill="#14120F" stroke="#E0B84F" stroke-width="1"/>
|
||||
<path d="M50 89.5 L53.5 93 L50 96.5 L46.5 93 Z" fill="#14120F" stroke="#E0B84F" stroke-width="1"/>
|
||||
<path d="M3.5 50 L7 46.5 L10.5 50 L7 53.5 Z" fill="#14120F" stroke="#E0B84F" stroke-width="1"/>
|
||||
<path d="M89.5 50 L93 46.5 L96.5 50 L93 53.5 Z" fill="#14120F" stroke="#E0B84F" stroke-width="1"/>
|
||||
</svg>
|
||||
|
After Width: | Height: | Size: 1.6 KiB |
|
After Width: | Height: | Size: 7.0 KiB |
|
After Width: | Height: | Size: 1007 B |
|
After Width: | Height: | Size: 1.5 KiB |
|
After Width: | Height: | Size: 2.0 KiB |
|
After Width: | Height: | Size: 4.6 KiB |
|
After Width: | Height: | Size: 5.3 KiB |
|
After Width: | Height: | Size: 5.8 KiB |
|
After Width: | Height: | Size: 7.4 KiB |
|
After Width: | Height: | Size: 17 KiB |
|
After Width: | Height: | Size: 11 KiB |
|
After Width: | Height: | Size: 2.4 KiB |
|
After Width: | Height: | Size: 3.3 KiB |
@@ -0,0 +1,75 @@
|
||||
{
|
||||
"name": "Городар",
|
||||
"short_name": "Городар",
|
||||
"description": "Коллекция городских объектов. Приезжайте на место, снимайте — объект попадёт в вашу коллекцию.",
|
||||
"lang": "ru",
|
||||
"dir": "ltr",
|
||||
"display": "standalone",
|
||||
"orientation": "portrait",
|
||||
"scope": "./",
|
||||
"start_url": "./",
|
||||
"background_color": "#12110F",
|
||||
"theme_color": "#12110F",
|
||||
"icons": [
|
||||
{
|
||||
"src": "icons/icon-72x72.png",
|
||||
"sizes": "72x72",
|
||||
"type": "image/png",
|
||||
"purpose": "any"
|
||||
},
|
||||
{
|
||||
"src": "icons/icon-96x96.png",
|
||||
"sizes": "96x96",
|
||||
"type": "image/png",
|
||||
"purpose": "any"
|
||||
},
|
||||
{
|
||||
"src": "icons/icon-128x128.png",
|
||||
"sizes": "128x128",
|
||||
"type": "image/png",
|
||||
"purpose": "any"
|
||||
},
|
||||
{
|
||||
"src": "icons/icon-144x144.png",
|
||||
"sizes": "144x144",
|
||||
"type": "image/png",
|
||||
"purpose": "any"
|
||||
},
|
||||
{
|
||||
"src": "icons/icon-152x152.png",
|
||||
"sizes": "152x152",
|
||||
"type": "image/png",
|
||||
"purpose": "any"
|
||||
},
|
||||
{
|
||||
"src": "icons/icon-192x192.png",
|
||||
"sizes": "192x192",
|
||||
"type": "image/png",
|
||||
"purpose": "any"
|
||||
},
|
||||
{
|
||||
"src": "icons/icon-384x384.png",
|
||||
"sizes": "384x384",
|
||||
"type": "image/png",
|
||||
"purpose": "any"
|
||||
},
|
||||
{
|
||||
"src": "icons/icon-512x512.png",
|
||||
"sizes": "512x512",
|
||||
"type": "image/png",
|
||||
"purpose": "any"
|
||||
},
|
||||
{
|
||||
"src": "icons/icon-192x192.png",
|
||||
"sizes": "192x192",
|
||||
"type": "image/png",
|
||||
"purpose": "maskable"
|
||||
},
|
||||
{
|
||||
"src": "icons/icon-512x512.png",
|
||||
"sizes": "512x512",
|
||||
"type": "image/png",
|
||||
"purpose": "maskable"
|
||||
}
|
||||
]
|
||||
}
|
||||
@@ -1,12 +1,28 @@
|
||||
import { ApplicationConfig, provideBrowserGlobalErrorListeners, provideZoneChangeDetection } from '@angular/core';
|
||||
import { provideRouter } from '@angular/router';
|
||||
import { ApplicationConfig, isDevMode, provideBrowserGlobalErrorListeners, provideZoneChangeDetection } from '@angular/core';
|
||||
import { provideAnimationsAsync } from '@angular/platform-browser/animations/async';
|
||||
import { provideRouter, withComponentInputBinding } from '@angular/router';
|
||||
import { provideServiceWorker } from '@angular/service-worker';
|
||||
import { provideEffects } from '@ngrx/effects';
|
||||
import { provideState, provideStore } from '@ngrx/store';
|
||||
import { provideStoreDevtools } from '@ngrx/store-devtools';
|
||||
|
||||
import { routes } from './app.routes';
|
||||
import { GorodarEffects, gorodarFeature } from './state';
|
||||
|
||||
export const appConfig: ApplicationConfig = {
|
||||
providers: [
|
||||
provideBrowserGlobalErrorListeners(),
|
||||
provideZoneChangeDetection({ eventCoalescing: true }),
|
||||
provideRouter(routes)
|
||||
]
|
||||
provideRouter(routes, withComponentInputBinding()),
|
||||
provideAnimationsAsync(),
|
||||
provideStore(),
|
||||
provideState(gorodarFeature),
|
||||
provideEffects(GorodarEffects),
|
||||
provideStoreDevtools({ maxAge: 25, logOnly: !isDevMode() }),
|
||||
provideServiceWorker('ngsw-worker.js', {
|
||||
enabled: !isDevMode(),
|
||||
registrationStrategy: 'registerWhenStable:30000',
|
||||
}),
|
||||
],
|
||||
};
|
||||
|
||||
|
||||
@@ -1,342 +1,9 @@
|
||||
<!-- * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * -->
|
||||
<!-- * * * * * * * * * * * The content below * * * * * * * * * * * -->
|
||||
<!-- * * * * * * * * * * is only a placeholder * * * * * * * * * * -->
|
||||
<!-- * * * * * * * * * * and can be replaced. * * * * * * * * * * -->
|
||||
<!-- * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * -->
|
||||
<!-- * * * * * * * * * Delete the template below * * * * * * * * * -->
|
||||
<!-- * * * * * * * to get started with your project! * * * * * * * -->
|
||||
<!-- * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * -->
|
||||
<div class="app">
|
||||
<main class="app__main">
|
||||
<router-outlet />
|
||||
</main>
|
||||
|
||||
<style>
|
||||
:host {
|
||||
--bright-blue: oklch(51.01% 0.274 263.83);
|
||||
--electric-violet: oklch(53.18% 0.28 296.97);
|
||||
--french-violet: oklch(47.66% 0.246 305.88);
|
||||
--vivid-pink: oklch(69.02% 0.277 332.77);
|
||||
--hot-red: oklch(61.42% 0.238 15.34);
|
||||
--orange-red: oklch(63.32% 0.24 31.68);
|
||||
|
||||
--gray-900: oklch(19.37% 0.006 300.98);
|
||||
--gray-700: oklch(36.98% 0.014 302.71);
|
||||
--gray-400: oklch(70.9% 0.015 304.04);
|
||||
|
||||
--red-to-pink-to-purple-vertical-gradient: linear-gradient(
|
||||
180deg,
|
||||
var(--orange-red) 0%,
|
||||
var(--vivid-pink) 50%,
|
||||
var(--electric-violet) 100%
|
||||
);
|
||||
|
||||
--red-to-pink-to-purple-horizontal-gradient: linear-gradient(
|
||||
90deg,
|
||||
var(--orange-red) 0%,
|
||||
var(--vivid-pink) 50%,
|
||||
var(--electric-violet) 100%
|
||||
);
|
||||
|
||||
--pill-accent: var(--bright-blue);
|
||||
|
||||
font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
|
||||
Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji",
|
||||
"Segoe UI Symbol";
|
||||
box-sizing: border-box;
|
||||
-webkit-font-smoothing: antialiased;
|
||||
-moz-osx-font-smoothing: grayscale;
|
||||
@if (!hideNav()) {
|
||||
<app-bottom-nav />
|
||||
}
|
||||
|
||||
h1 {
|
||||
font-size: 3.125rem;
|
||||
color: var(--gray-900);
|
||||
font-weight: 500;
|
||||
line-height: 100%;
|
||||
letter-spacing: -0.125rem;
|
||||
margin: 0;
|
||||
font-family: "Inter Tight", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
|
||||
Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji",
|
||||
"Segoe UI Symbol";
|
||||
}
|
||||
|
||||
p {
|
||||
margin: 0;
|
||||
color: var(--gray-700);
|
||||
}
|
||||
|
||||
main {
|
||||
width: 100%;
|
||||
min-height: 100%;
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
padding: 1rem;
|
||||
box-sizing: inherit;
|
||||
position: relative;
|
||||
}
|
||||
|
||||
.angular-logo {
|
||||
max-width: 9.2rem;
|
||||
}
|
||||
|
||||
.content {
|
||||
display: flex;
|
||||
justify-content: space-around;
|
||||
width: 100%;
|
||||
max-width: 700px;
|
||||
margin-bottom: 3rem;
|
||||
}
|
||||
|
||||
.content h1 {
|
||||
margin-top: 1.75rem;
|
||||
}
|
||||
|
||||
.content p {
|
||||
margin-top: 1.5rem;
|
||||
}
|
||||
|
||||
.divider {
|
||||
width: 1px;
|
||||
background: var(--red-to-pink-to-purple-vertical-gradient);
|
||||
margin-inline: 0.5rem;
|
||||
}
|
||||
|
||||
.pill-group {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
align-items: start;
|
||||
flex-wrap: wrap;
|
||||
gap: 1.25rem;
|
||||
}
|
||||
|
||||
.pill {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
--pill-accent: var(--bright-blue);
|
||||
background: color-mix(in srgb, var(--pill-accent) 5%, transparent);
|
||||
color: var(--pill-accent);
|
||||
padding-inline: 0.75rem;
|
||||
padding-block: 0.375rem;
|
||||
border-radius: 2.75rem;
|
||||
border: 0;
|
||||
transition: background 0.3s ease;
|
||||
font-family: var(--inter-font);
|
||||
font-size: 0.875rem;
|
||||
font-style: normal;
|
||||
font-weight: 500;
|
||||
line-height: 1.4rem;
|
||||
letter-spacing: -0.00875rem;
|
||||
text-decoration: none;
|
||||
white-space: nowrap;
|
||||
}
|
||||
|
||||
.pill:hover {
|
||||
background: color-mix(in srgb, var(--pill-accent) 15%, transparent);
|
||||
}
|
||||
|
||||
.pill-group .pill:nth-child(6n + 1) {
|
||||
--pill-accent: var(--bright-blue);
|
||||
}
|
||||
.pill-group .pill:nth-child(6n + 2) {
|
||||
--pill-accent: var(--electric-violet);
|
||||
}
|
||||
.pill-group .pill:nth-child(6n + 3) {
|
||||
--pill-accent: var(--french-violet);
|
||||
}
|
||||
|
||||
.pill-group .pill:nth-child(6n + 4),
|
||||
.pill-group .pill:nth-child(6n + 5),
|
||||
.pill-group .pill:nth-child(6n + 6) {
|
||||
--pill-accent: var(--hot-red);
|
||||
}
|
||||
|
||||
.pill-group svg {
|
||||
margin-inline-start: 0.25rem;
|
||||
}
|
||||
|
||||
.social-links {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 0.73rem;
|
||||
margin-top: 1.5rem;
|
||||
}
|
||||
|
||||
.social-links path {
|
||||
transition: fill 0.3s ease;
|
||||
fill: var(--gray-400);
|
||||
}
|
||||
|
||||
.social-links a:hover svg path {
|
||||
fill: var(--gray-900);
|
||||
}
|
||||
|
||||
@media screen and (max-width: 650px) {
|
||||
.content {
|
||||
flex-direction: column;
|
||||
width: max-content;
|
||||
}
|
||||
|
||||
.divider {
|
||||
height: 1px;
|
||||
width: 100%;
|
||||
background: var(--red-to-pink-to-purple-horizontal-gradient);
|
||||
margin-block: 1.5rem;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
|
||||
<main class="main">
|
||||
<div class="content">
|
||||
<div class="left-side">
|
||||
<svg
|
||||
xmlns="http://www.w3.org/2000/svg"
|
||||
viewBox="0 0 982 239"
|
||||
fill="none"
|
||||
class="angular-logo"
|
||||
>
|
||||
<g clip-path="url(#a)">
|
||||
<path
|
||||
fill="url(#b)"
|
||||
d="M388.676 191.625h30.849L363.31 31.828h-35.758l-56.215 159.797h30.848l13.174-39.356h60.061l13.256 39.356Zm-65.461-62.675 21.602-64.311h1.227l21.602 64.311h-44.431Zm126.831-7.527v70.202h-28.23V71.839h27.002v20.374h1.392c2.782-6.71 7.2-12.028 13.255-15.956 6.056-3.927 13.584-5.89 22.503-5.89 8.264 0 15.465 1.8 21.684 5.318 6.137 3.518 10.964 8.673 14.319 15.382 3.437 6.71 5.074 14.81 4.992 24.383v76.175h-28.23v-71.92c0-8.019-2.046-14.237-6.219-18.819-4.173-4.5-9.819-6.791-17.102-6.791-4.91 0-9.328 1.063-13.174 3.272-3.846 2.128-6.792 5.237-9.001 9.328-2.046 4.009-3.191 8.918-3.191 14.728ZM589.233 239c-10.147 0-18.82-1.391-26.103-4.091-7.282-2.7-13.092-6.382-17.511-10.964-4.418-4.582-7.528-9.655-9.164-15.219l25.448-6.136c1.145 2.372 2.782 4.663 4.991 6.954 2.209 2.291 5.155 4.255 8.837 5.81 3.683 1.554 8.428 2.291 14.074 2.291 8.019 0 14.647-1.964 19.884-5.81 5.237-3.845 7.856-10.227 7.856-19.064v-22.665h-1.391c-1.473 2.946-3.601 5.892-6.383 9.001-2.782 3.109-6.464 5.645-10.965 7.691-4.582 2.046-10.228 3.109-17.101 3.109-9.165 0-17.511-2.209-25.039-6.545-7.446-4.337-13.42-10.883-17.757-19.474-4.418-8.673-6.628-19.473-6.628-32.565 0-13.091 2.21-24.301 6.628-33.383 4.419-9.082 10.311-15.955 17.839-20.7 7.528-4.746 15.874-7.037 25.039-7.037 7.037 0 12.846 1.145 17.347 3.518 4.582 2.373 8.182 5.236 10.883 8.51 2.7 3.272 4.746 6.382 6.137 9.327h1.554v-19.8h27.821v121.749c0 10.228-2.454 18.737-7.364 25.447-4.91 6.709-11.538 11.7-20.048 15.055-8.509 3.355-18.165 4.991-28.884 4.991Zm.245-71.266c5.974 0 11.047-1.473 15.302-4.337 4.173-2.945 7.446-7.118 9.573-12.519 2.21-5.482 3.274-12.027 3.274-19.637 0-7.609-1.064-14.155-3.274-19.8-2.127-5.646-5.318-10.064-9.491-13.255-4.174-3.11-9.329-4.746-15.384-4.746s-11.537 1.636-15.792 4.91c-4.173 3.272-7.365 7.772-9.492 13.418-2.128 5.727-3.191 12.191-3.191 19.392 0 7.2 1.063 13.745 3.273 19.228 2.127 5.482 5.318 9.736 9.573 12.764 4.174 3.027 9.41 4.582 15.629 4.582Zm141.56-26.51V71.839h28.23v119.786h-27.412v-21.273h-1.227c-2.7 6.709-7.119 12.191-13.338 16.446-6.137 4.255-13.747 6.382-22.748 6.382-7.855 0-14.81-1.718-20.783-5.237-5.974-3.518-10.72-8.591-14.075-15.382-3.355-6.709-5.073-14.891-5.073-24.464V71.839h28.312v71.921c0 7.609 2.046 13.664 6.219 18.083 4.173 4.5 9.655 6.709 16.365 6.709 4.173 0 8.183-.982 12.111-3.028 3.927-2.045 7.118-5.072 9.655-9.082 2.537-4.091 3.764-9.164 3.764-15.218Zm65.707-109.395v159.796h-28.23V31.828h28.23Zm44.841 162.169c-7.61 0-14.402-1.391-20.457-4.091-6.055-2.7-10.883-6.791-14.32-12.109-3.518-5.319-5.237-11.946-5.237-19.801 0-6.791 1.228-12.355 3.765-16.773 2.536-4.419 5.891-7.937 10.228-10.637 4.337-2.618 9.164-4.664 14.647-6.055 5.4-1.391 11.046-2.373 16.856-3.027 7.037-.737 12.683-1.391 17.102-1.964 4.337-.573 7.528-1.555 9.574-2.782 1.963-1.309 3.027-3.273 3.027-5.973v-.491c0-5.891-1.718-10.391-5.237-13.664-3.518-3.191-8.51-4.828-15.056-4.828-6.955 0-12.356 1.473-16.447 4.5-4.009 3.028-6.71 6.546-8.183 10.719l-26.348-3.764c2.046-7.282 5.483-13.336 10.31-18.328 4.746-4.909 10.638-8.59 17.511-11.045 6.955-2.455 14.565-3.682 22.912-3.682 5.809 0 11.537.654 17.265 2.045s10.965 3.6 15.711 6.71c4.746 3.109 8.51 7.282 11.455 12.6 2.864 5.318 4.337 11.946 4.337 19.883v80.184h-27.166v-16.446h-.9c-1.719 3.355-4.092 6.464-7.201 9.328-3.109 2.864-6.955 5.237-11.619 6.955-4.828 1.718-10.229 2.536-16.529 2.536Zm7.364-20.701c5.646 0 10.556-1.145 14.729-3.354 4.173-2.291 7.364-5.237 9.655-9.001 2.292-3.763 3.355-7.854 3.355-12.273v-14.155c-.9.737-2.373 1.391-4.5 2.046-2.128.654-4.419 1.145-7.037 1.636-2.619.491-5.155.9-7.692 1.227-2.537.328-4.746.655-6.628.901-4.173.572-8.019 1.472-11.292 2.781-3.355 1.31-5.973 3.11-7.855 5.401-1.964 2.291-2.864 5.318-2.864 8.918 0 5.237 1.882 9.164 5.728 11.782 3.682 2.782 8.51 4.091 14.401 4.091Zm64.643 18.328V71.839h27.412v19.965h1.227c2.21-6.955 5.974-12.274 11.292-16.038 5.319-3.763 11.456-5.645 18.329-5.645 1.555 0 3.355.082 5.237.163 1.964.164 3.601.328 4.91.573v25.938c-1.227-.41-3.109-.819-5.646-1.146a58.814 58.814 0 0 0-7.446-.49c-5.155 0-9.738 1.145-13.829 3.354-4.091 2.209-7.282 5.236-9.655 9.164-2.373 3.927-3.519 8.427-3.519 13.5v70.448h-28.312ZM222.077 39.192l-8.019 125.923L137.387 0l84.69 39.192Zm-53.105 162.825-57.933 33.056-57.934-33.056 11.783-28.556h92.301l11.783 28.556ZM111.039 62.675l30.357 73.803H80.681l30.358-73.803ZM7.937 165.115 0 39.192 84.69 0 7.937 165.115Z"
|
||||
/>
|
||||
<path
|
||||
fill="url(#c)"
|
||||
d="M388.676 191.625h30.849L363.31 31.828h-35.758l-56.215 159.797h30.848l13.174-39.356h60.061l13.256 39.356Zm-65.461-62.675 21.602-64.311h1.227l21.602 64.311h-44.431Zm126.831-7.527v70.202h-28.23V71.839h27.002v20.374h1.392c2.782-6.71 7.2-12.028 13.255-15.956 6.056-3.927 13.584-5.89 22.503-5.89 8.264 0 15.465 1.8 21.684 5.318 6.137 3.518 10.964 8.673 14.319 15.382 3.437 6.71 5.074 14.81 4.992 24.383v76.175h-28.23v-71.92c0-8.019-2.046-14.237-6.219-18.819-4.173-4.5-9.819-6.791-17.102-6.791-4.91 0-9.328 1.063-13.174 3.272-3.846 2.128-6.792 5.237-9.001 9.328-2.046 4.009-3.191 8.918-3.191 14.728ZM589.233 239c-10.147 0-18.82-1.391-26.103-4.091-7.282-2.7-13.092-6.382-17.511-10.964-4.418-4.582-7.528-9.655-9.164-15.219l25.448-6.136c1.145 2.372 2.782 4.663 4.991 6.954 2.209 2.291 5.155 4.255 8.837 5.81 3.683 1.554 8.428 2.291 14.074 2.291 8.019 0 14.647-1.964 19.884-5.81 5.237-3.845 7.856-10.227 7.856-19.064v-22.665h-1.391c-1.473 2.946-3.601 5.892-6.383 9.001-2.782 3.109-6.464 5.645-10.965 7.691-4.582 2.046-10.228 3.109-17.101 3.109-9.165 0-17.511-2.209-25.039-6.545-7.446-4.337-13.42-10.883-17.757-19.474-4.418-8.673-6.628-19.473-6.628-32.565 0-13.091 2.21-24.301 6.628-33.383 4.419-9.082 10.311-15.955 17.839-20.7 7.528-4.746 15.874-7.037 25.039-7.037 7.037 0 12.846 1.145 17.347 3.518 4.582 2.373 8.182 5.236 10.883 8.51 2.7 3.272 4.746 6.382 6.137 9.327h1.554v-19.8h27.821v121.749c0 10.228-2.454 18.737-7.364 25.447-4.91 6.709-11.538 11.7-20.048 15.055-8.509 3.355-18.165 4.991-28.884 4.991Zm.245-71.266c5.974 0 11.047-1.473 15.302-4.337 4.173-2.945 7.446-7.118 9.573-12.519 2.21-5.482 3.274-12.027 3.274-19.637 0-7.609-1.064-14.155-3.274-19.8-2.127-5.646-5.318-10.064-9.491-13.255-4.174-3.11-9.329-4.746-15.384-4.746s-11.537 1.636-15.792 4.91c-4.173 3.272-7.365 7.772-9.492 13.418-2.128 5.727-3.191 12.191-3.191 19.392 0 7.2 1.063 13.745 3.273 19.228 2.127 5.482 5.318 9.736 9.573 12.764 4.174 3.027 9.41 4.582 15.629 4.582Zm141.56-26.51V71.839h28.23v119.786h-27.412v-21.273h-1.227c-2.7 6.709-7.119 12.191-13.338 16.446-6.137 4.255-13.747 6.382-22.748 6.382-7.855 0-14.81-1.718-20.783-5.237-5.974-3.518-10.72-8.591-14.075-15.382-3.355-6.709-5.073-14.891-5.073-24.464V71.839h28.312v71.921c0 7.609 2.046 13.664 6.219 18.083 4.173 4.5 9.655 6.709 16.365 6.709 4.173 0 8.183-.982 12.111-3.028 3.927-2.045 7.118-5.072 9.655-9.082 2.537-4.091 3.764-9.164 3.764-15.218Zm65.707-109.395v159.796h-28.23V31.828h28.23Zm44.841 162.169c-7.61 0-14.402-1.391-20.457-4.091-6.055-2.7-10.883-6.791-14.32-12.109-3.518-5.319-5.237-11.946-5.237-19.801 0-6.791 1.228-12.355 3.765-16.773 2.536-4.419 5.891-7.937 10.228-10.637 4.337-2.618 9.164-4.664 14.647-6.055 5.4-1.391 11.046-2.373 16.856-3.027 7.037-.737 12.683-1.391 17.102-1.964 4.337-.573 7.528-1.555 9.574-2.782 1.963-1.309 3.027-3.273 3.027-5.973v-.491c0-5.891-1.718-10.391-5.237-13.664-3.518-3.191-8.51-4.828-15.056-4.828-6.955 0-12.356 1.473-16.447 4.5-4.009 3.028-6.71 6.546-8.183 10.719l-26.348-3.764c2.046-7.282 5.483-13.336 10.31-18.328 4.746-4.909 10.638-8.59 17.511-11.045 6.955-2.455 14.565-3.682 22.912-3.682 5.809 0 11.537.654 17.265 2.045s10.965 3.6 15.711 6.71c4.746 3.109 8.51 7.282 11.455 12.6 2.864 5.318 4.337 11.946 4.337 19.883v80.184h-27.166v-16.446h-.9c-1.719 3.355-4.092 6.464-7.201 9.328-3.109 2.864-6.955 5.237-11.619 6.955-4.828 1.718-10.229 2.536-16.529 2.536Zm7.364-20.701c5.646 0 10.556-1.145 14.729-3.354 4.173-2.291 7.364-5.237 9.655-9.001 2.292-3.763 3.355-7.854 3.355-12.273v-14.155c-.9.737-2.373 1.391-4.5 2.046-2.128.654-4.419 1.145-7.037 1.636-2.619.491-5.155.9-7.692 1.227-2.537.328-4.746.655-6.628.901-4.173.572-8.019 1.472-11.292 2.781-3.355 1.31-5.973 3.11-7.855 5.401-1.964 2.291-2.864 5.318-2.864 8.918 0 5.237 1.882 9.164 5.728 11.782 3.682 2.782 8.51 4.091 14.401 4.091Zm64.643 18.328V71.839h27.412v19.965h1.227c2.21-6.955 5.974-12.274 11.292-16.038 5.319-3.763 11.456-5.645 18.329-5.645 1.555 0 3.355.082 5.237.163 1.964.164 3.601.328 4.91.573v25.938c-1.227-.41-3.109-.819-5.646-1.146a58.814 58.814 0 0 0-7.446-.49c-5.155 0-9.738 1.145-13.829 3.354-4.091 2.209-7.282 5.236-9.655 9.164-2.373 3.927-3.519 8.427-3.519 13.5v70.448h-28.312ZM222.077 39.192l-8.019 125.923L137.387 0l84.69 39.192Zm-53.105 162.825-57.933 33.056-57.934-33.056 11.783-28.556h92.301l11.783 28.556ZM111.039 62.675l30.357 73.803H80.681l30.358-73.803ZM7.937 165.115 0 39.192 84.69 0 7.937 165.115Z"
|
||||
/>
|
||||
</g>
|
||||
<defs>
|
||||
<radialGradient
|
||||
id="c"
|
||||
cx="0"
|
||||
cy="0"
|
||||
r="1"
|
||||
gradientTransform="rotate(118.122 171.182 60.81) scale(205.794)"
|
||||
gradientUnits="userSpaceOnUse"
|
||||
>
|
||||
<stop stop-color="#FF41F8" />
|
||||
<stop offset=".707" stop-color="#FF41F8" stop-opacity=".5" />
|
||||
<stop offset="1" stop-color="#FF41F8" stop-opacity="0" />
|
||||
</radialGradient>
|
||||
<linearGradient
|
||||
id="b"
|
||||
x1="0"
|
||||
x2="982"
|
||||
y1="192"
|
||||
y2="192"
|
||||
gradientUnits="userSpaceOnUse"
|
||||
>
|
||||
<stop stop-color="#F0060B" />
|
||||
<stop offset="0" stop-color="#F0070C" />
|
||||
<stop offset=".526" stop-color="#CC26D5" />
|
||||
<stop offset="1" stop-color="#7702FF" />
|
||||
</linearGradient>
|
||||
<clipPath id="a"><path fill="#fff" d="M0 0h982v239H0z" /></clipPath>
|
||||
</defs>
|
||||
</svg>
|
||||
<h1>Hello, {{ title() }}</h1>
|
||||
<p>Congratulations! Your app is running. 🎉</p>
|
||||
</div>
|
||||
<div class="divider" role="separator" aria-label="Divider"></div>
|
||||
<div class="right-side">
|
||||
<div class="pill-group">
|
||||
@for (item of [
|
||||
{ title: 'Explore the Docs', link: 'https://angular.dev' },
|
||||
{ title: 'Learn with Tutorials', link: 'https://angular.dev/tutorials' },
|
||||
{ title: 'Prompt and best practices for AI', link: 'https://angular.dev/ai/develop-with-ai'},
|
||||
{ title: 'CLI Docs', link: 'https://angular.dev/tools/cli' },
|
||||
{ title: 'Angular Language Service', link: 'https://angular.dev/tools/language-service' },
|
||||
{ title: 'Angular DevTools', link: 'https://angular.dev/tools/devtools' },
|
||||
]; track item.title) {
|
||||
<a
|
||||
class="pill"
|
||||
[href]="item.link"
|
||||
target="_blank"
|
||||
rel="noopener"
|
||||
>
|
||||
<span>{{ item.title }}</span>
|
||||
<svg
|
||||
xmlns="http://www.w3.org/2000/svg"
|
||||
height="14"
|
||||
viewBox="0 -960 960 960"
|
||||
width="14"
|
||||
fill="currentColor"
|
||||
>
|
||||
<path
|
||||
d="M200-120q-33 0-56.5-23.5T120-200v-560q0-33 23.5-56.5T200-840h280v80H200v560h560v-280h80v280q0 33-23.5 56.5T760-120H200Zm188-212-56-56 372-372H560v-80h280v280h-80v-144L388-332Z"
|
||||
/>
|
||||
</svg>
|
||||
</a>
|
||||
}
|
||||
</div>
|
||||
<div class="social-links">
|
||||
<a
|
||||
href="https://github.com/angular/angular"
|
||||
aria-label="Github"
|
||||
target="_blank"
|
||||
rel="noopener"
|
||||
>
|
||||
<svg
|
||||
width="25"
|
||||
height="24"
|
||||
viewBox="0 0 25 24"
|
||||
fill="none"
|
||||
xmlns="http://www.w3.org/2000/svg"
|
||||
alt="Github"
|
||||
>
|
||||
<path
|
||||
d="M12.3047 0C5.50634 0 0 5.50942 0 12.3047C0 17.7423 3.52529 22.3535 8.41332 23.9787C9.02856 24.0946 9.25414 23.7142 9.25414 23.3871C9.25414 23.0949 9.24389 22.3207 9.23876 21.2953C5.81601 22.0377 5.09414 19.6444 5.09414 19.6444C4.53427 18.2243 3.72524 17.8449 3.72524 17.8449C2.61064 17.082 3.81137 17.0973 3.81137 17.0973C5.04697 17.1835 5.69604 18.3647 5.69604 18.3647C6.79321 20.2463 8.57636 19.7029 9.27978 19.3881C9.39052 18.5924 9.70736 18.0499 10.0591 17.7423C7.32641 17.4347 4.45429 16.3765 4.45429 11.6618C4.45429 10.3185 4.9311 9.22133 5.72065 8.36C5.58222 8.04931 5.16694 6.79833 5.82831 5.10337C5.82831 5.10337 6.85883 4.77319 9.2121 6.36459C10.1965 6.09082 11.2424 5.95546 12.2883 5.94931C13.3342 5.95546 14.3801 6.09082 15.3644 6.36459C17.7023 4.77319 18.7328 5.10337 18.7328 5.10337C19.3942 6.79833 18.9789 8.04931 18.8559 8.36C19.6403 9.22133 20.1171 10.3185 20.1171 11.6618C20.1171 16.3888 17.2409 17.4296 14.5031 17.7321C14.9338 18.1012 15.3337 18.8559 15.3337 20.0084C15.3337 21.6552 15.3183 22.978 15.3183 23.3779C15.3183 23.7009 15.5336 24.0854 16.1642 23.9623C21.0871 22.3484 24.6094 17.7341 24.6094 12.3047C24.6094 5.50942 19.0999 0 12.3047 0Z"
|
||||
/>
|
||||
</svg>
|
||||
</a>
|
||||
<a
|
||||
href="https://twitter.com/angular"
|
||||
aria-label="Twitter"
|
||||
target="_blank"
|
||||
rel="noopener"
|
||||
>
|
||||
<svg
|
||||
width="24"
|
||||
height="24"
|
||||
viewBox="0 0 24 24"
|
||||
fill="none"
|
||||
xmlns="http://www.w3.org/2000/svg"
|
||||
alt="Twitter"
|
||||
>
|
||||
<path
|
||||
d="M18.244 2.25h3.308l-7.227 8.26 8.502 11.24H16.17l-5.214-6.817L4.99 21.75H1.68l7.73-8.835L1.254 2.25H8.08l4.713 6.231zm-1.161 17.52h1.833L7.084 4.126H5.117z"
|
||||
/>
|
||||
</svg>
|
||||
</a>
|
||||
<a
|
||||
href="https://www.youtube.com/channel/UCbn1OgGei-DV7aSRo_HaAiw"
|
||||
aria-label="Youtube"
|
||||
target="_blank"
|
||||
rel="noopener"
|
||||
>
|
||||
<svg
|
||||
width="29"
|
||||
height="20"
|
||||
viewBox="0 0 29 20"
|
||||
fill="none"
|
||||
xmlns="http://www.w3.org/2000/svg"
|
||||
alt="Youtube"
|
||||
>
|
||||
<path
|
||||
fill-rule="evenodd"
|
||||
clip-rule="evenodd"
|
||||
d="M27.4896 1.52422C27.9301 1.96749 28.2463 2.51866 28.4068 3.12258C29.0004 5.35161 29.0004 10 29.0004 10C29.0004 10 29.0004 14.6484 28.4068 16.8774C28.2463 17.4813 27.9301 18.0325 27.4896 18.4758C27.0492 18.9191 26.5 19.2389 25.8972 19.4032C23.6778 20 14.8068 20 14.8068 20C14.8068 20 5.93586 20 3.71651 19.4032C3.11363 19.2389 2.56449 18.9191 2.12405 18.4758C1.68361 18.0325 1.36732 17.4813 1.20683 16.8774C0.613281 14.6484 0.613281 10 0.613281 10C0.613281 10 0.613281 5.35161 1.20683 3.12258C1.36732 2.51866 1.68361 1.96749 2.12405 1.52422C2.56449 1.08095 3.11363 0.76113 3.71651 0.596774C5.93586 0 14.8068 0 14.8068 0C14.8068 0 23.6778 0 25.8972 0.596774C26.5 0.76113 27.0492 1.08095 27.4896 1.52422ZM19.3229 10L11.9036 5.77905V14.221L19.3229 10Z"
|
||||
/>
|
||||
</svg>
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</main>
|
||||
|
||||
<!-- * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * -->
|
||||
<!-- * * * * * * * * * * * The content above * * * * * * * * * * * * -->
|
||||
<!-- * * * * * * * * * * is only a placeholder * * * * * * * * * * * -->
|
||||
<!-- * * * * * * * * * * and can be replaced. * * * * * * * * * * * -->
|
||||
<!-- * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * -->
|
||||
<!-- * * * * * * * * * * End of Placeholder * * * * * * * * * * * * -->
|
||||
<!-- * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * -->
|
||||
|
||||
|
||||
<router-outlet />
|
||||
</div>
|
||||
|
||||
@@ -1,3 +1,19 @@
|
||||
import { Routes } from '@angular/router';
|
||||
|
||||
export const routes: Routes = [];
|
||||
import { CitiesPage } from './pages/cities-page/cities-page';
|
||||
import { CollectionPage } from './pages/collection-page/collection-page';
|
||||
import { CollectionsPage } from './pages/collections-page/collections-page';
|
||||
import { MapItemPage } from './pages/map-item-page/map-item-page';
|
||||
import { MapPage } from './pages/map-page/map-page';
|
||||
import { ProfilePage } from './pages/profile-page/profile-page';
|
||||
|
||||
export const routes: Routes = [
|
||||
{ path: '', component: CitiesPage },
|
||||
{ path: 'map', component: MapPage },
|
||||
{ path: 'collections', component: CollectionsPage },
|
||||
{ path: 'collection', component: CollectionPage },
|
||||
{ path: 'profile', component: ProfilePage },
|
||||
{ path: 'items/:id', component: MapItemPage },
|
||||
{ path: 'objects/:id', redirectTo: 'items/:id' },
|
||||
{ path: '**', redirectTo: '' },
|
||||
];
|
||||
|
||||
@@ -0,0 +1,27 @@
|
||||
:host {
|
||||
display: block;
|
||||
height: 100%;
|
||||
}
|
||||
|
||||
.app {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
height: 100%;
|
||||
overflow: hidden;
|
||||
background: var(--color-bg);
|
||||
}
|
||||
|
||||
.app__main {
|
||||
flex: 1;
|
||||
min-height: 0;
|
||||
overflow: auto;
|
||||
}
|
||||
|
||||
.app__main router-outlet {
|
||||
display: none;
|
||||
}
|
||||
|
||||
.app__main > :not(router-outlet) {
|
||||
display: block;
|
||||
min-height: 100%;
|
||||
}
|
||||
|
||||
@@ -1,10 +1,23 @@
|
||||
import { TestBed } from '@angular/core/testing';
|
||||
import { provideRouter } from '@angular/router';
|
||||
import { provideServiceWorker } from '@angular/service-worker';
|
||||
import { provideEffects } from '@ngrx/effects';
|
||||
import { provideState, provideStore } from '@ngrx/store';
|
||||
|
||||
import { App } from './app';
|
||||
import { GorodarEffects, gorodarFeature } from './state';
|
||||
|
||||
describe('App', () => {
|
||||
beforeEach(async () => {
|
||||
await TestBed.configureTestingModule({
|
||||
imports: [App],
|
||||
providers: [
|
||||
provideRouter([]),
|
||||
provideStore(),
|
||||
provideState(gorodarFeature),
|
||||
provideEffects(GorodarEffects),
|
||||
provideServiceWorker('ngsw-worker.js', { enabled: false }),
|
||||
],
|
||||
}).compileComponents();
|
||||
});
|
||||
|
||||
@@ -14,10 +27,10 @@ describe('App', () => {
|
||||
expect(app).toBeTruthy();
|
||||
});
|
||||
|
||||
it('should render title', () => {
|
||||
it('should render bottom navigation', () => {
|
||||
const fixture = TestBed.createComponent(App);
|
||||
fixture.detectChanges();
|
||||
const compiled = fixture.nativeElement as HTMLElement;
|
||||
expect(compiled.querySelector('h1')?.textContent).toContain('Hello, maps');
|
||||
expect(compiled.querySelector('app-bottom-nav')?.textContent).toContain('Города');
|
||||
});
|
||||
});
|
||||
|
||||
@@ -1,12 +1,29 @@
|
||||
import { Component, signal } from '@angular/core';
|
||||
import { RouterOutlet } from '@angular/router';
|
||||
import { Component, computed, inject } from '@angular/core';
|
||||
import { toSignal } from '@angular/core/rxjs-interop';
|
||||
import { NavigationEnd, Router, RouterOutlet } from '@angular/router';
|
||||
import { filter, map, startWith } from 'rxjs';
|
||||
|
||||
import { BottomNav } from './layout/bottom-nav/bottom-nav';
|
||||
|
||||
@Component({
|
||||
selector: 'app-root',
|
||||
imports: [RouterOutlet],
|
||||
imports: [RouterOutlet, BottomNav],
|
||||
templateUrl: './app.html',
|
||||
styleUrl: './app.scss'
|
||||
styleUrl: './app.scss',
|
||||
})
|
||||
export class App {
|
||||
protected readonly title = signal('maps');
|
||||
private readonly router = inject(Router);
|
||||
|
||||
private readonly url = toSignal(
|
||||
this.router.events.pipe(
|
||||
filter((event): event is NavigationEnd => event instanceof NavigationEnd),
|
||||
map(() => this.router.url),
|
||||
startWith(this.router.url),
|
||||
),
|
||||
{ initialValue: this.router.url },
|
||||
);
|
||||
|
||||
protected readonly hideNav = computed(
|
||||
() => this.url().startsWith('/items') || this.url().startsWith('/objects'),
|
||||
);
|
||||
}
|
||||
|
||||
@@ -0,0 +1,10 @@
|
||||
@if (stage() === 'check' && photo(); as image) {
|
||||
<app-photo-check [photo]="image" [title]="landmark().title" [step]="step()" />
|
||||
} @else if (stage() === 'success') {
|
||||
<app-collect-success
|
||||
[title]="landmark().title"
|
||||
[cityName]="city.name"
|
||||
[opened]="openedCount()"
|
||||
[total]="totalCount"
|
||||
/>
|
||||
}
|
||||
@@ -0,0 +1,33 @@
|
||||
import { ChangeDetectionStrategy, Component, inject, input } from '@angular/core';
|
||||
import { Store } from '@ngrx/store';
|
||||
|
||||
import type { Landmark } from '../../data/nizhny-novgorod';
|
||||
import { CityCatalogService } from '../../root/services/city-catalog.service';
|
||||
import {
|
||||
selectClaimPhoto,
|
||||
selectClaimStage,
|
||||
selectClaimStep,
|
||||
selectOpenedCount,
|
||||
} from '../../state';
|
||||
import { CollectSuccess } from '../collect-success/collect-success';
|
||||
import { PhotoCheck } from '../photo-check/photo-check';
|
||||
|
||||
@Component({
|
||||
selector: 'app-claim-flow',
|
||||
imports: [PhotoCheck, CollectSuccess],
|
||||
templateUrl: './claim-flow.html',
|
||||
changeDetection: ChangeDetectionStrategy.OnPush,
|
||||
})
|
||||
export class ClaimFlow {
|
||||
private readonly store = inject(Store);
|
||||
private readonly catalog = inject(CityCatalogService);
|
||||
|
||||
readonly landmark = input.required<Landmark>();
|
||||
|
||||
protected readonly city = this.catalog.city;
|
||||
protected readonly totalCount = this.city.objects.length;
|
||||
protected readonly photo = this.store.selectSignal(selectClaimPhoto);
|
||||
protected readonly stage = this.store.selectSignal(selectClaimStage);
|
||||
protected readonly step = this.store.selectSignal(selectClaimStep);
|
||||
protected readonly openedCount = this.store.selectSignal(selectOpenedCount);
|
||||
}
|
||||
@@ -0,0 +1,59 @@
|
||||
<section class="success">
|
||||
<div class="success__glow"></div>
|
||||
|
||||
<div class="success__stamp">
|
||||
<svg class="success__rays anim-rays" viewBox="0 0 340 340" 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.5 : 1.5"
|
||||
[attr.opacity]="ray.strong ? 0.5 : 0.28"
|
||||
stroke-linecap="round"
|
||||
/>
|
||||
}
|
||||
</svg>
|
||||
<span class="success__spark success__spark--a"></span>
|
||||
<span class="success__spark success__spark--b"></span>
|
||||
<span class="success__spark success__spark--c"></span>
|
||||
<span class="success__spark success__spark--d"></span>
|
||||
<div class="success__mark anim-pop">
|
||||
<img src="/assets/icons/gorodar-mark.svg" alt="" />
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="success__copy">
|
||||
<p class="success__eyebrow">Новое в коллекции</p>
|
||||
<h1>{{ title() }}</h1>
|
||||
<p>Добавлено в коллекцию «{{ cityName() }}»</p>
|
||||
</div>
|
||||
|
||||
<div class="success__card anim-rise">
|
||||
<div class="success__row">
|
||||
<span>{{ cityName() }}</span>
|
||||
<span>
|
||||
<b>{{ opened() }} из {{ total() }}</b>
|
||||
· +1 сегодня
|
||||
</span>
|
||||
</div>
|
||||
<div class="success__bar">
|
||||
<span
|
||||
class="anim-grow"
|
||||
[style.--from]="from() + '%'"
|
||||
[style.--to]="to() + '%'"
|
||||
></span>
|
||||
</div>
|
||||
<p class="success__match">
|
||||
<app-icon name="check" [size]="15" />
|
||||
Совпадение фото {{ matchPercent() }}% (нужно от 78%)
|
||||
</p>
|
||||
</div>
|
||||
|
||||
<div class="success__actions">
|
||||
<a matButton="filled" routerLink="/collection" (click)="leave()">Открыть коллекцию</a>
|
||||
<a class="success__ghost" routerLink="/map" (click)="leave()">Продолжить на карте</a>
|
||||
</div>
|
||||
</section>
|
||||
@@ -0,0 +1,176 @@
|
||||
:host {
|
||||
display: block;
|
||||
min-height: 100%;
|
||||
background: var(--color-bg);
|
||||
}
|
||||
|
||||
.success {
|
||||
position: relative;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
align-items: center;
|
||||
min-height: 100%;
|
||||
padding: 48px 16px 24px;
|
||||
overflow: hidden;
|
||||
}
|
||||
|
||||
.success__glow {
|
||||
position: absolute;
|
||||
inset: 0;
|
||||
background: radial-gradient(circle at 50% 220px, rgb(224 184 79 / 30%), rgb(224 184 79 / 0%) 60%);
|
||||
pointer-events: none;
|
||||
}
|
||||
|
||||
.success__stamp {
|
||||
position: relative;
|
||||
z-index: 1;
|
||||
width: min(340px, 88vw);
|
||||
aspect-ratio: 1;
|
||||
}
|
||||
|
||||
.success__rays {
|
||||
position: absolute;
|
||||
inset: 0;
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
}
|
||||
|
||||
.success__mark {
|
||||
position: absolute;
|
||||
top: 21%;
|
||||
left: 21%;
|
||||
width: 58%;
|
||||
height: 58%;
|
||||
}
|
||||
|
||||
.success__mark img {
|
||||
display: block;
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
}
|
||||
|
||||
.success__spark {
|
||||
position: absolute;
|
||||
width: 10px;
|
||||
height: 10px;
|
||||
background: var(--color-accent-soft);
|
||||
clip-path: polygon(50% 0, 65% 35%, 100% 50%, 65% 65%, 50% 100%, 35% 65%, 0 50%, 35% 35%);
|
||||
}
|
||||
|
||||
.success__spark--a { top: 18%; left: 16%; }
|
||||
.success__spark--b { top: 22%; right: 14%; }
|
||||
.success__spark--c { bottom: 16%; left: 20%; }
|
||||
.success__spark--d { bottom: 18%; right: 16%; }
|
||||
|
||||
.success__copy,
|
||||
.success__card,
|
||||
.success__actions {
|
||||
position: relative;
|
||||
z-index: 1;
|
||||
width: 100%;
|
||||
max-width: 560px;
|
||||
}
|
||||
|
||||
.success__copy {
|
||||
margin-top: 8px;
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
.success__eyebrow {
|
||||
margin: 0;
|
||||
color: var(--color-accent);
|
||||
font-size: 14px;
|
||||
font-weight: 600;
|
||||
letter-spacing: 0.12em;
|
||||
text-transform: uppercase;
|
||||
}
|
||||
|
||||
.success__copy h1 {
|
||||
margin: 8px 0 0;
|
||||
font-family: var(--font-display);
|
||||
font-size: clamp(28px, 8vw, 34px);
|
||||
font-weight: 700;
|
||||
line-height: 1.15;
|
||||
}
|
||||
|
||||
.success__copy p:last-child {
|
||||
margin: 8px 0 0;
|
||||
color: var(--color-muted);
|
||||
font-size: 15px;
|
||||
}
|
||||
|
||||
.success__card {
|
||||
margin-top: 24px;
|
||||
padding: 16px;
|
||||
border: 1px solid var(--color-border);
|
||||
border-radius: 20px;
|
||||
background: var(--color-surface);
|
||||
}
|
||||
|
||||
.success__row {
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
align-items: baseline;
|
||||
gap: 12px;
|
||||
font-weight: 600;
|
||||
}
|
||||
|
||||
.success__row span:last-child {
|
||||
color: var(--color-muted);
|
||||
font-size: 14px;
|
||||
font-weight: 400;
|
||||
}
|
||||
|
||||
.success__row b {
|
||||
color: var(--color-accent-soft);
|
||||
font-weight: 600;
|
||||
}
|
||||
|
||||
.success__bar {
|
||||
height: 8px;
|
||||
margin-top: 10px;
|
||||
overflow: hidden;
|
||||
border-radius: 4px;
|
||||
background: #2e2a24;
|
||||
}
|
||||
|
||||
.success__bar span {
|
||||
display: block;
|
||||
height: 100%;
|
||||
border-radius: 4px;
|
||||
background: var(--color-accent);
|
||||
}
|
||||
|
||||
.success__match {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 6px;
|
||||
margin: 12px 0 0;
|
||||
color: var(--color-success);
|
||||
font-size: 13px;
|
||||
}
|
||||
|
||||
.success__actions {
|
||||
display: flex;
|
||||
flex: 1;
|
||||
flex-direction: column;
|
||||
justify-content: flex-end;
|
||||
gap: 10px;
|
||||
margin-top: 24px;
|
||||
}
|
||||
|
||||
.success__actions a[matButton='filled'] {
|
||||
width: 100%;
|
||||
min-height: 56px;
|
||||
}
|
||||
|
||||
.success__ghost {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
min-height: 48px;
|
||||
color: var(--color-muted);
|
||||
font-size: 15px;
|
||||
font-weight: 500;
|
||||
text-decoration: none;
|
||||
}
|
||||
@@ -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());
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,51 @@
|
||||
<section class="check">
|
||||
<div class="check__frame">
|
||||
<img [src]="photo()" [alt]="title()" />
|
||||
<span class="check__scan anim-scan"></span>
|
||||
</div>
|
||||
|
||||
<h1>Проверяем фото</h1>
|
||||
<p>Обычно это занимает несколько секунд</p>
|
||||
|
||||
<ol class="steps">
|
||||
<li [class.steps__item--done]="step() >= 1">
|
||||
<span class="steps__mark steps__mark--done">
|
||||
<app-icon name="check" [size]="18" />
|
||||
</span>
|
||||
<div>
|
||||
<b>Фото отправлено</b>
|
||||
<span>Снимок получен сервисом</span>
|
||||
</div>
|
||||
</li>
|
||||
|
||||
<li [class.steps__item--done]="step() >= 2" [class.steps__item--active]="step() === 1">
|
||||
@if (step() >= 2) {
|
||||
<span class="steps__mark steps__mark--done">
|
||||
<app-icon name="check" [size]="18" />
|
||||
</span>
|
||||
} @else {
|
||||
<span class="steps__mark steps__mark--spin anim-spinner"></span>
|
||||
}
|
||||
<div>
|
||||
<b>Сравниваем с эталонами</b>
|
||||
<span>Ищем совпадение с {{ title() }}</span>
|
||||
</div>
|
||||
</li>
|
||||
|
||||
<li [class.steps__item--done]="step() >= 3" [class.steps__item--active]="step() === 2">
|
||||
@if (step() >= 3) {
|
||||
<span class="steps__mark steps__mark--done">
|
||||
<app-icon name="check" [size]="18" />
|
||||
</span>
|
||||
} @else if (step() === 2) {
|
||||
<span class="steps__mark steps__mark--spin anim-spinner"></span>
|
||||
} @else {
|
||||
<span class="steps__mark"></span>
|
||||
}
|
||||
<div>
|
||||
<b>Добавляем в коллекцию</b>
|
||||
<span>Объект появится в вашей коллекции</span>
|
||||
</div>
|
||||
</li>
|
||||
</ol>
|
||||
</section>
|
||||
@@ -0,0 +1,116 @@
|
||||
:host {
|
||||
display: block;
|
||||
min-height: 100%;
|
||||
background: var(--color-bg);
|
||||
}
|
||||
|
||||
.check {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
align-items: center;
|
||||
min-height: 100%;
|
||||
padding: 40px 24px 24px;
|
||||
}
|
||||
|
||||
.check__frame {
|
||||
position: relative;
|
||||
width: min(240px, 64vw);
|
||||
height: min(320px, 42vh);
|
||||
overflow: hidden;
|
||||
border: 1px solid var(--color-accent-strong);
|
||||
border-radius: 20px;
|
||||
}
|
||||
|
||||
.check__frame img {
|
||||
display: block;
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
object-fit: cover;
|
||||
}
|
||||
|
||||
.check__scan {
|
||||
position: absolute;
|
||||
left: 0;
|
||||
right: 0;
|
||||
height: 3px;
|
||||
background: var(--color-accent-soft);
|
||||
box-shadow: 0 0 18px 4px rgb(242 217 142 / 55%);
|
||||
}
|
||||
|
||||
.check h1 {
|
||||
margin: 28px 0 0;
|
||||
font-family: var(--font-display);
|
||||
font-size: 28px;
|
||||
font-weight: 700;
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
.check > p {
|
||||
margin: 6px 0 0;
|
||||
color: var(--color-muted);
|
||||
font-size: 15px;
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
.steps {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
align-self: stretch;
|
||||
gap: 18px;
|
||||
margin: 28px 0 0;
|
||||
padding: 20px;
|
||||
border: 1px solid var(--color-border);
|
||||
border-radius: 20px;
|
||||
background: var(--color-surface);
|
||||
list-style: none;
|
||||
}
|
||||
|
||||
.steps li {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 14px;
|
||||
}
|
||||
|
||||
.steps__mark {
|
||||
flex: none;
|
||||
width: 30px;
|
||||
height: 30px;
|
||||
box-sizing: border-box;
|
||||
border: 2px solid #312d27;
|
||||
border-radius: 15px;
|
||||
}
|
||||
|
||||
.steps__mark--spin {
|
||||
border-width: 3px;
|
||||
border-top-color: var(--color-accent);
|
||||
}
|
||||
|
||||
.steps__mark--done {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
border: 0;
|
||||
background: var(--color-accent);
|
||||
color: var(--color-on-accent);
|
||||
}
|
||||
|
||||
.steps b,
|
||||
.steps span {
|
||||
display: block;
|
||||
}
|
||||
|
||||
.steps b {
|
||||
font-weight: 600;
|
||||
color: var(--color-muted);
|
||||
}
|
||||
|
||||
.steps span {
|
||||
margin-top: 2px;
|
||||
color: var(--color-muted);
|
||||
font-size: 13px;
|
||||
}
|
||||
|
||||
.steps__item--done b,
|
||||
.steps__item--active b {
|
||||
color: var(--color-text);
|
||||
}
|
||||
@@ -0,0 +1,16 @@
|
||||
import { ChangeDetectionStrategy, Component, input } from '@angular/core';
|
||||
|
||||
import { Icon } from '../../shared/icon/icon';
|
||||
|
||||
@Component({
|
||||
selector: 'app-photo-check',
|
||||
imports: [Icon],
|
||||
templateUrl: './photo-check.html',
|
||||
styleUrl: './photo-check.scss',
|
||||
changeDetection: ChangeDetectionStrategy.OnPush,
|
||||
})
|
||||
export class PhotoCheck {
|
||||
readonly photo = input.required<string>();
|
||||
readonly title = input.required<string>();
|
||||
readonly step = input(1);
|
||||
}
|
||||
@@ -0,0 +1,113 @@
|
||||
export interface Landmark {
|
||||
id: string;
|
||||
title: string;
|
||||
description: string;
|
||||
address: string;
|
||||
addressHint: string;
|
||||
coordinates: [number, number];
|
||||
collected: boolean;
|
||||
geoCheckEnabled: boolean;
|
||||
geoRadiusMeters: number;
|
||||
facts: string[];
|
||||
photoHint: string;
|
||||
}
|
||||
|
||||
export interface City {
|
||||
id: string;
|
||||
name: string;
|
||||
center: [number, number];
|
||||
objects: Landmark[];
|
||||
}
|
||||
|
||||
export const NIZHNY_NOVGOROD: City = {
|
||||
id: 'nizhny-novgorod',
|
||||
name: 'Нижний Новгород',
|
||||
center: [44.0075, 56.3269],
|
||||
objects: [
|
||||
{
|
||||
id: 'kremlin',
|
||||
title: 'Нижегородский кремль',
|
||||
description: 'Кирпичная крепость на высоком правом берегу, в месте слияния Оки и Волги. Исторический центр города.',
|
||||
address: 'Кремль, Нижний Новгород',
|
||||
addressHint: 'Над слиянием Оки и Волги',
|
||||
coordinates: [44.0031, 56.3285],
|
||||
collected: false,
|
||||
geoCheckEnabled: true,
|
||||
geoRadiusMeters: 300,
|
||||
facts: [
|
||||
'Каменный кремль строили в 1508–1516 годах.',
|
||||
'В крепости 13 башен, а стены тянутся примерно на 2 км.',
|
||||
'Внутри — Михайло-Архангельский собор XVI века и площадь Минина и Пожарского.',
|
||||
],
|
||||
photoHint: 'Снимайте так, чтобы были видны стены и башни кремля.',
|
||||
},
|
||||
{
|
||||
id: 'chkalov-stairs',
|
||||
title: 'Чкаловская лестница',
|
||||
description: 'Лестница в форме восьмёрки соединяет верхнюю и нижнюю набережные Волги. Названа в честь лётчика Валерия Чкалова.',
|
||||
address: 'Верхне-Волжская набережная, Нижний Новгород',
|
||||
addressHint: 'Между верхней и нижней набережными',
|
||||
coordinates: [44.0094, 56.3306],
|
||||
collected: false,
|
||||
geoCheckEnabled: true,
|
||||
geoRadiusMeters: 300,
|
||||
facts: [
|
||||
'Официально в ней 560 ступеней.',
|
||||
'Строить начали в 1943 году, открыли 8 августа 1949 года.',
|
||||
'На верхней площадке стоит памятник Валерию Чкалову.',
|
||||
],
|
||||
photoHint: 'Снимайте так, чтобы лестница читалась целиком.',
|
||||
},
|
||||
{
|
||||
id: 'pokrovka',
|
||||
title: 'Большая Покровская улица',
|
||||
description: 'Главная пешеходная улица города, «нижегородский Арбат». По сторонам — старинные здания, а на улице играют уличные музыканты.',
|
||||
address: 'Большая Покровская ул., Нижний Новгород',
|
||||
addressHint: 'От площади Минина и Пожарского к площади Горького',
|
||||
coordinates: [44.0015, 56.3188],
|
||||
collected: false,
|
||||
geoCheckEnabled: true,
|
||||
geoRadiusMeters: 400,
|
||||
facts: [
|
||||
'Улица идёт от площади Минина и Пожарского к площади Горького.',
|
||||
'Пешеходной её сделали в начале 1980-х годов.',
|
||||
'В советское время она называлась улицей Свердлова.',
|
||||
],
|
||||
photoHint: 'Снимайте так, чтобы узнавалась перспектива улицы.',
|
||||
},
|
||||
{
|
||||
id: 'alexander-nevsky',
|
||||
title: 'Александро-Невский собор',
|
||||
description: 'Новоярмарочный собор на мысе Стрелка, где Ока впадает в Волгу. Стиль сочетает русские, романские и византийские черты.',
|
||||
address: 'ул. Стрелка, 3А, Нижний Новгород',
|
||||
addressHint: 'У слияния Оки и Волги',
|
||||
coordinates: [44.0247, 56.3347],
|
||||
collected: false,
|
||||
geoCheckEnabled: true,
|
||||
geoRadiusMeters: 300,
|
||||
facts: [
|
||||
'Построен в 1868–1881 годах, освящён 20 июля 1881 года.',
|
||||
'Высота собора — 87 метров.',
|
||||
'В 1929 году собор закрыли; с 1992 года он снова у Церкви, а с 2009-го — кафедральный.',
|
||||
],
|
||||
photoHint: 'Снимайте так, чтобы собор был виден целиком.',
|
||||
},
|
||||
{
|
||||
id: 'pechersky',
|
||||
title: 'Печерский монастырь',
|
||||
description: 'Вознесенский Печерский монастырь на высоком берегу Волги, примерно в 3 км ниже по течению от кремля.',
|
||||
address: 'Нижне-Волжская набережная, Нижний Новгород',
|
||||
addressHint: 'На высоком берегу Волги, около 3 км от кремля',
|
||||
coordinates: [44.0499, 56.3225],
|
||||
collected: false,
|
||||
geoCheckEnabled: true,
|
||||
geoRadiusMeters: 100,
|
||||
facts: [
|
||||
'Основал обитель в XIV веке святитель Дионисий.',
|
||||
'В 1597 году оползень разрушил монастырь, и его перенесли на версту выше по Волге.',
|
||||
'Пятиглавый Вознесенский собор построен в 1631–1632 годах.',
|
||||
],
|
||||
photoHint: 'Снимайте так, чтобы были видны собор и колокольня.',
|
||||
},
|
||||
],
|
||||
};
|
||||
@@ -0,0 +1,12 @@
|
||||
<nav class="nav" aria-label="Основная навигация">
|
||||
@for (item of items; track item.path) {
|
||||
<a
|
||||
class="nav__item"
|
||||
[routerLink]="item.path"
|
||||
[class.nav__item--active]="isActive(item.path, item.exact)"
|
||||
>
|
||||
<app-icon [name]="item.icon" [size]="24" />
|
||||
<span>{{ item.label }}</span>
|
||||
</a>
|
||||
}
|
||||
</nav>
|
||||
@@ -0,0 +1,38 @@
|
||||
:host {
|
||||
display: block;
|
||||
flex: none;
|
||||
}
|
||||
|
||||
.nav {
|
||||
display: flex;
|
||||
justify-content: space-around;
|
||||
align-items: stretch;
|
||||
gap: 8px;
|
||||
min-height: var(--nav-height);
|
||||
padding: 8px 12px calc(10px + env(safe-area-inset-bottom));
|
||||
border-top: 1px solid var(--color-border);
|
||||
background: rgb(18 17 15 / 96%);
|
||||
backdrop-filter: blur(16px);
|
||||
}
|
||||
|
||||
.nav__item {
|
||||
display: flex;
|
||||
flex: 1 1 0;
|
||||
flex-direction: column;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
gap: 4px;
|
||||
min-width: 0;
|
||||
min-height: 44px;
|
||||
padding: 4px 2px;
|
||||
border-radius: 12px;
|
||||
color: var(--color-muted);
|
||||
font-size: 12px;
|
||||
font-weight: 500;
|
||||
text-decoration: none;
|
||||
white-space: nowrap;
|
||||
}
|
||||
|
||||
.nav__item--active {
|
||||
color: var(--color-accent);
|
||||
}
|
||||
@@ -0,0 +1,42 @@
|
||||
import { ChangeDetectionStrategy, Component, inject } from '@angular/core';
|
||||
import { toSignal } from '@angular/core/rxjs-interop';
|
||||
import { NavigationEnd, Router, RouterLink } from '@angular/router';
|
||||
import { filter, map, startWith } from 'rxjs';
|
||||
|
||||
import { Icon } from '../../shared/icon/icon';
|
||||
|
||||
@Component({
|
||||
selector: 'app-bottom-nav',
|
||||
imports: [RouterLink, Icon],
|
||||
templateUrl: './bottom-nav.html',
|
||||
styleUrl: './bottom-nav.scss',
|
||||
changeDetection: ChangeDetectionStrategy.OnPush,
|
||||
})
|
||||
export class BottomNav {
|
||||
private readonly router = inject(Router);
|
||||
private readonly url = toSignal(
|
||||
this.router.events.pipe(
|
||||
filter((event): event is NavigationEnd => event instanceof NavigationEnd),
|
||||
map(() => this.router.url.split('?')[0]),
|
||||
startWith(this.router.url.split('?')[0]),
|
||||
),
|
||||
{ initialValue: this.router.url.split('?')[0] },
|
||||
);
|
||||
|
||||
protected readonly items = [
|
||||
{ path: '/', icon: 'cities', label: 'Города', exact: true },
|
||||
{ path: '/map', icon: 'map', label: 'Карта', exact: false },
|
||||
{ path: '/collections', icon: 'collection', label: 'Коллекция', exact: false },
|
||||
];
|
||||
|
||||
protected isActive(path: string, exact: boolean): boolean {
|
||||
const url = this.url();
|
||||
if (path === '/collections') {
|
||||
return url === '/collections' || url === '/collection';
|
||||
}
|
||||
if (exact) {
|
||||
return url === path;
|
||||
}
|
||||
return url === path || url.startsWith(`${path}/`);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,31 @@
|
||||
<div class="city-map">
|
||||
<div #map class="city-map__canvas"></div>
|
||||
|
||||
<div class="city-map__hud">
|
||||
<button
|
||||
class="city-map__chip"
|
||||
type="button"
|
||||
[attr.aria-label]="'Показать центр: ' + city.name"
|
||||
(click)="focusCity()"
|
||||
>
|
||||
<app-icon name="pin" [size]="18" />
|
||||
<span>{{ city.name }}</span>
|
||||
</button>
|
||||
|
||||
<button
|
||||
class="city-map__locate"
|
||||
type="button"
|
||||
[class.city-map__locate--active]="following()"
|
||||
[attr.aria-label]="following() ? 'Остановить навигацию' : 'Моя геопозиция'"
|
||||
(click)="locate()"
|
||||
>
|
||||
<app-icon name="my-location" [size]="22" />
|
||||
</button>
|
||||
</div>
|
||||
|
||||
@if (selected(); as landmark) {
|
||||
<div class="city-map__sheet">
|
||||
<app-map-item-sheet [landmark]="landmark" />
|
||||
</div>
|
||||
}
|
||||
</div>
|
||||
@@ -0,0 +1,82 @@
|
||||
:host {
|
||||
display: block;
|
||||
height: 100%;
|
||||
}
|
||||
|
||||
.city-map {
|
||||
position: relative;
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
overflow: hidden;
|
||||
background: var(--color-bg);
|
||||
}
|
||||
|
||||
.city-map__canvas {
|
||||
position: absolute;
|
||||
inset: 0;
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
}
|
||||
|
||||
.city-map__hud {
|
||||
position: absolute;
|
||||
top: 16px;
|
||||
right: 16px;
|
||||
left: 16px;
|
||||
z-index: 2;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: space-between;
|
||||
gap: 10px;
|
||||
}
|
||||
|
||||
.city-map__chip,
|
||||
.city-map__locate {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
min-height: 48px;
|
||||
border: 1px solid var(--color-border);
|
||||
border-radius: 24px;
|
||||
background: rgb(28 26 23 / 94%);
|
||||
color: var(--color-text);
|
||||
}
|
||||
|
||||
.city-map__chip {
|
||||
gap: 8px;
|
||||
padding: 0 16px;
|
||||
font: inherit;
|
||||
font-size: 16px;
|
||||
font-weight: 600;
|
||||
color: var(--color-accent);
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
.city-map__chip app-icon:last-child {
|
||||
color: var(--color-muted);
|
||||
}
|
||||
|
||||
.city-map__chip span {
|
||||
color: var(--color-text);
|
||||
}
|
||||
|
||||
.city-map__locate {
|
||||
justify-content: center;
|
||||
width: 48px;
|
||||
padding: 0;
|
||||
color: var(--color-accent);
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
.city-map__locate--active {
|
||||
border-color: var(--color-accent-strong);
|
||||
background: var(--color-surface-2);
|
||||
color: var(--color-accent-soft);
|
||||
}
|
||||
|
||||
.city-map__sheet {
|
||||
position: absolute;
|
||||
right: 16px;
|
||||
bottom: 16px;
|
||||
left: 16px;
|
||||
z-index: 3;
|
||||
}
|
||||
@@ -0,0 +1,477 @@
|
||||
import {
|
||||
AfterViewInit,
|
||||
ChangeDetectionStrategy,
|
||||
Component,
|
||||
ElementRef,
|
||||
NgZone,
|
||||
OnDestroy,
|
||||
ViewChild,
|
||||
effect,
|
||||
inject,
|
||||
signal,
|
||||
} from '@angular/core';
|
||||
import { Geolocation, type Position } from '@capacitor/geolocation';
|
||||
import { Store } from '@ngrx/store';
|
||||
|
||||
import { MapItemSheet } from '../map-item-sheet/map-item-sheet';
|
||||
import { CityCatalogService } from '../../root/services/city-catalog.service';
|
||||
import type { Landmark } from '../../data/nizhny-novgorod';
|
||||
import { Icon } from '../../shared/icon/icon';
|
||||
import { selectCollectedIdSet } from '../../state';
|
||||
|
||||
const MAP_KEY = 'bf0a466f-43a6-48c7-b274-7fea5952957b';
|
||||
const CITY_ZOOM = 16;
|
||||
const USER_ZOOM = 20;
|
||||
const LANDMARK_SIZE = 40;
|
||||
const USER_SIZE = 32;
|
||||
|
||||
interface DgPoint {
|
||||
x: number;
|
||||
y: number;
|
||||
}
|
||||
|
||||
interface DgMarker {
|
||||
addTo(map: DgMap): this;
|
||||
setLatLng(latLng: [number, number]): this;
|
||||
setZIndexOffset(offset: number): this;
|
||||
getElement(): HTMLElement | undefined;
|
||||
on(type: string, handler: (event: Event) => void): this;
|
||||
}
|
||||
|
||||
interface DgMap {
|
||||
on(type: string, handler: () => void): this;
|
||||
off(type: string, handler: () => void): this;
|
||||
setView(
|
||||
center: [number, number],
|
||||
zoom: number,
|
||||
options?: { animate?: boolean; duration?: number },
|
||||
): this;
|
||||
getZoom(): number;
|
||||
latLngToContainerPoint(latLng: [number, number]): DgPoint;
|
||||
remove(): void;
|
||||
}
|
||||
|
||||
interface DgLoader {
|
||||
then(resolve: () => void, reject?: (error: unknown) => void): Promise<void>;
|
||||
}
|
||||
|
||||
interface DgApi {
|
||||
map(element: HTMLElement, options: Record<string, unknown>): DgMap;
|
||||
marker(latLng: [number, number], options: Record<string, unknown>): DgMarker;
|
||||
divIcon(options: Record<string, unknown>): unknown;
|
||||
}
|
||||
|
||||
declare global {
|
||||
interface Window {
|
||||
DG?: DgLoader & DgApi;
|
||||
}
|
||||
}
|
||||
|
||||
let rasterApi: Promise<DgApi> | null = null;
|
||||
|
||||
function loadRasterApi(): Promise<DgApi> {
|
||||
if (rasterApi) {
|
||||
return rasterApi;
|
||||
}
|
||||
|
||||
rasterApi = new Promise<DgApi>((resolve, reject) => {
|
||||
const ready = (): void => {
|
||||
const api = window.DG;
|
||||
|
||||
if (!api) {
|
||||
reject(new Error('RasterJS API не загрузился'));
|
||||
return;
|
||||
}
|
||||
|
||||
void api.then(
|
||||
() => {
|
||||
const readyApi = window.DG;
|
||||
|
||||
if (!readyApi?.map || !readyApi.marker || !readyApi.divIcon) {
|
||||
reject(new Error('RasterJS API не загрузился'));
|
||||
return;
|
||||
}
|
||||
|
||||
resolve({
|
||||
map: readyApi.map.bind(readyApi),
|
||||
marker: readyApi.marker.bind(readyApi),
|
||||
divIcon: readyApi.divIcon.bind(readyApi),
|
||||
});
|
||||
},
|
||||
(error: unknown) => reject(error),
|
||||
);
|
||||
};
|
||||
|
||||
if (window.DG) {
|
||||
ready();
|
||||
return;
|
||||
}
|
||||
|
||||
const script = document.createElement('script');
|
||||
script.src = `https://maps.api.2gis.ru/2.0/loader.js?pkg=full&lazy=true&skin=dark&key=${MAP_KEY}`;
|
||||
script.async = true;
|
||||
script.onload = ready;
|
||||
script.onerror = () => reject(new Error('Не удалось загрузить RasterJS API'));
|
||||
document.body.appendChild(script);
|
||||
});
|
||||
|
||||
return rasterApi;
|
||||
}
|
||||
|
||||
@Component({
|
||||
selector: 'app-city-map',
|
||||
imports: [Icon, MapItemSheet],
|
||||
templateUrl: './city-map.html',
|
||||
styleUrl: './city-map.scss',
|
||||
changeDetection: ChangeDetectionStrategy.OnPush,
|
||||
})
|
||||
export class CityMap implements AfterViewInit, OnDestroy {
|
||||
@ViewChild('map', { static: true })
|
||||
private mapElement!: ElementRef<HTMLElement>;
|
||||
|
||||
private readonly catalog = inject(CityCatalogService);
|
||||
private readonly store = inject(Store);
|
||||
private readonly zone = inject(NgZone);
|
||||
private raster: DgApi | null = null;
|
||||
private map: DgMap | null = null;
|
||||
private userMarker: DgMarker | null = null;
|
||||
private userMarkerElement: HTMLElement | null = null;
|
||||
private watchId: string | null = null;
|
||||
private lastPosition: Position | null = null;
|
||||
private zoomOnNextPan = true;
|
||||
private destroyed = false;
|
||||
private programmaticMove = false;
|
||||
private readonly markerElements = new Map<string, HTMLElement>();
|
||||
private readonly markers = new Map<string, DgMarker>();
|
||||
private readonly collectedIds = this.store.selectSignal(selectCollectedIdSet);
|
||||
private readonly stopFollowing = (): void => {
|
||||
this.programmaticMove = false;
|
||||
this.zone.run(() => this.following.set(false));
|
||||
};
|
||||
private readonly onZoomStart = (): void => {
|
||||
if (this.programmaticMove) {
|
||||
return;
|
||||
}
|
||||
|
||||
this.stopFollowing();
|
||||
};
|
||||
private readonly onMoveEnd = (): void => {
|
||||
this.programmaticMove = false;
|
||||
};
|
||||
|
||||
protected readonly city = this.catalog.city;
|
||||
protected readonly selected = signal<Landmark | null>(null);
|
||||
protected readonly following = signal(false);
|
||||
|
||||
constructor() {
|
||||
effect(() => {
|
||||
const ids = this.collectedIds();
|
||||
|
||||
for (const [id, element] of this.markerElements) {
|
||||
this.setMarkerIcon(element, ids.has(id));
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
async ngAfterViewInit(): Promise<void> {
|
||||
const api = await loadRasterApi();
|
||||
this.raster = api;
|
||||
|
||||
if (this.destroyed) {
|
||||
return;
|
||||
}
|
||||
|
||||
this.zone.runOutsideAngular(() => {
|
||||
const raster = this.raster;
|
||||
|
||||
if (this.destroyed || !raster) {
|
||||
return;
|
||||
}
|
||||
|
||||
const map = raster.map(this.mapElement.nativeElement, {
|
||||
center: this.toLatLng(this.city.center),
|
||||
zoom: CITY_ZOOM,
|
||||
key: MAP_KEY,
|
||||
currentLang: 'ru',
|
||||
zoomControl: false,
|
||||
fullscreenControl: false,
|
||||
poi: false,
|
||||
geoclicker: false,
|
||||
});
|
||||
|
||||
if (this.destroyed) {
|
||||
map.remove();
|
||||
return;
|
||||
}
|
||||
|
||||
this.map = map;
|
||||
map.on('dragstart', this.stopFollowing);
|
||||
map.on('zoomstart', this.onZoomStart);
|
||||
map.on('zoom', () => this.syncRadiusSize());
|
||||
map.on('move', () => this.syncRadiusSize());
|
||||
map.on('moveend', this.onMoveEnd);
|
||||
|
||||
for (const landmark of this.city.objects) {
|
||||
this.markers.set(landmark.id, this.createMarker(raster, map, landmark));
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
ngOnDestroy(): void {
|
||||
this.destroyed = true;
|
||||
void this.stopWatching();
|
||||
this.map?.off('dragstart', this.stopFollowing);
|
||||
this.map?.off('zoomstart', this.onZoomStart);
|
||||
this.map?.off('moveend', this.onMoveEnd);
|
||||
this.map?.remove();
|
||||
this.map = null;
|
||||
}
|
||||
|
||||
protected focusCity(): void {
|
||||
this.following.set(false);
|
||||
this.clearSelection();
|
||||
this.moveMap(this.city.center, CITY_ZOOM, 500);
|
||||
}
|
||||
|
||||
protected async locate(): Promise<void> {
|
||||
if (!this.map) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (this.following()) {
|
||||
this.following.set(false);
|
||||
return;
|
||||
}
|
||||
|
||||
if (this.watchId && this.lastPosition) {
|
||||
this.zoomOnNextPan = true;
|
||||
this.following.set(true);
|
||||
this.updateUserPosition(this.lastPosition, true);
|
||||
return;
|
||||
}
|
||||
|
||||
try {
|
||||
const position = await Geolocation.getCurrentPosition({
|
||||
enableHighAccuracy: true,
|
||||
timeout: 30_000,
|
||||
});
|
||||
|
||||
this.zoomOnNextPan = true;
|
||||
this.following.set(true);
|
||||
this.updateUserPosition(position, true);
|
||||
this.watchId = await Geolocation.watchPosition(
|
||||
{ enableHighAccuracy: true },
|
||||
(next, error) => {
|
||||
if (error || !next) {
|
||||
return;
|
||||
}
|
||||
|
||||
this.zone.run(() => this.updateUserPosition(next, this.following()));
|
||||
},
|
||||
);
|
||||
} catch {
|
||||
this.following.set(false);
|
||||
}
|
||||
}
|
||||
|
||||
private updateUserPosition(position: Position, pan: boolean): void {
|
||||
const map = this.map;
|
||||
|
||||
if (!map) {
|
||||
return;
|
||||
}
|
||||
|
||||
this.lastPosition = position;
|
||||
const coordinates: [number, number] = [position.coords.longitude, position.coords.latitude];
|
||||
const heading = position.coords.heading;
|
||||
|
||||
const raster = this.raster;
|
||||
|
||||
if (!this.userMarker && raster) {
|
||||
const markerElement = document.createElement('div');
|
||||
markerElement.className = 'city-map__user';
|
||||
markerElement.innerHTML =
|
||||
'<span class="city-map__user-body"><span class="city-map__user-heading"></span><span class="city-map__user-dot"></span></span>';
|
||||
this.userMarkerElement = markerElement;
|
||||
this.userMarker = this.addHtmlMarker(
|
||||
raster,
|
||||
map,
|
||||
coordinates,
|
||||
markerElement,
|
||||
USER_SIZE,
|
||||
3,
|
||||
false,
|
||||
);
|
||||
} else {
|
||||
this.userMarker?.setLatLng(this.toLatLng(coordinates));
|
||||
}
|
||||
|
||||
if (heading != null && !Number.isNaN(heading) && this.userMarkerElement) {
|
||||
this.userMarkerElement.style.setProperty('--heading', `${heading}deg`);
|
||||
this.userMarkerElement.classList.add('city-map__user--headed');
|
||||
}
|
||||
|
||||
if (pan) {
|
||||
this.moveMap(coordinates, this.zoomOnNextPan ? USER_ZOOM : null, 400);
|
||||
this.zoomOnNextPan = false;
|
||||
}
|
||||
}
|
||||
|
||||
private async stopWatching(): Promise<void> {
|
||||
if (!this.watchId) {
|
||||
return;
|
||||
}
|
||||
|
||||
await Geolocation.clearWatch({ id: this.watchId });
|
||||
this.watchId = null;
|
||||
}
|
||||
|
||||
private createMarker(api: DgApi, map: DgMap, landmark: Landmark): DgMarker {
|
||||
const markerElement = document.createElement('button');
|
||||
markerElement.type = 'button';
|
||||
markerElement.className = 'city-map__marker';
|
||||
markerElement.setAttribute('aria-label', landmark.title);
|
||||
markerElement.innerHTML = `<span class="city-map__radius"></span><img width="40" height="40" alt="" /><span class="city-map__label"></span>`;
|
||||
const label = markerElement.querySelector('.city-map__label');
|
||||
|
||||
if (label) {
|
||||
label.textContent = landmark.title;
|
||||
}
|
||||
|
||||
this.markerElements.set(landmark.id, markerElement);
|
||||
this.setMarkerIcon(markerElement, this.collectedIds().has(landmark.id));
|
||||
|
||||
const marker = this.addHtmlMarker(
|
||||
api,
|
||||
map,
|
||||
landmark.coordinates,
|
||||
markerElement,
|
||||
LANDMARK_SIZE,
|
||||
1,
|
||||
true,
|
||||
);
|
||||
|
||||
marker.on('click', () => {
|
||||
this.zone.run(() => this.selectLandmark(landmark));
|
||||
});
|
||||
|
||||
return marker;
|
||||
}
|
||||
|
||||
private addHtmlMarker(
|
||||
api: DgApi,
|
||||
map: DgMap,
|
||||
coordinates: [number, number],
|
||||
element: HTMLElement,
|
||||
size: number,
|
||||
zIndexOffset: number,
|
||||
interactive: boolean,
|
||||
): DgMarker {
|
||||
const marker = api.marker(this.toLatLng(coordinates), {
|
||||
icon: api.divIcon({
|
||||
className: 'city-map__pin',
|
||||
html: element,
|
||||
iconSize: [size, size],
|
||||
iconAnchor: [size / 2, size / 2],
|
||||
}),
|
||||
interactive,
|
||||
keyboard: false,
|
||||
zIndexOffset,
|
||||
});
|
||||
|
||||
marker.addTo(map);
|
||||
const root = marker.getElement();
|
||||
|
||||
if (root) {
|
||||
root.style.overflow = 'visible';
|
||||
}
|
||||
|
||||
return marker;
|
||||
}
|
||||
|
||||
private setMarkerIcon(element: HTMLElement, collected: boolean): void {
|
||||
const img = element.querySelector('img');
|
||||
|
||||
if (!img) {
|
||||
return;
|
||||
}
|
||||
|
||||
const src = collected ? '/assets/icons/check-marker.svg' : '/assets/icons/lock-marker.svg';
|
||||
|
||||
if (img.getAttribute('src') !== src) {
|
||||
img.setAttribute('src', src);
|
||||
}
|
||||
|
||||
element.classList.toggle('city-map__marker--open', collected);
|
||||
}
|
||||
|
||||
private selectLandmark(landmark: Landmark): void {
|
||||
const alreadySelected = this.selected()?.id === landmark.id;
|
||||
this.selected.set(alreadySelected ? null : landmark);
|
||||
this.syncSelection();
|
||||
this.syncRadiusSize();
|
||||
}
|
||||
|
||||
private clearSelection(): void {
|
||||
this.selected.set(null);
|
||||
this.syncSelection();
|
||||
}
|
||||
|
||||
private syncSelection(): void {
|
||||
const selectedId = this.selected()?.id;
|
||||
|
||||
for (const [id, element] of this.markerElements) {
|
||||
const active = id === selectedId;
|
||||
element.classList.toggle('city-map__marker--active', active);
|
||||
this.markers.get(id)?.setZIndexOffset(active ? 2 : 1);
|
||||
}
|
||||
}
|
||||
|
||||
private syncRadiusSize(): void {
|
||||
const selected = this.selected();
|
||||
const map = this.map;
|
||||
|
||||
if (!selected || !map) {
|
||||
return;
|
||||
}
|
||||
|
||||
const element = this.markerElements.get(selected.id);
|
||||
|
||||
if (!element) {
|
||||
return;
|
||||
}
|
||||
|
||||
const diameter = this.metersToPixels(map, selected.geoRadiusMeters, selected.coordinates) * 2;
|
||||
element.style.setProperty('--radius-px', `${diameter}px`);
|
||||
}
|
||||
|
||||
private metersToPixels(map: DgMap, meters: number, coordinates: [number, number]): number {
|
||||
const [longitude, latitude] = coordinates;
|
||||
const origin = map.latLngToContainerPoint(this.toLatLng(coordinates));
|
||||
const metersPerDegree = 111_320 * Math.cos((latitude * Math.PI) / 180);
|
||||
const shifted = map.latLngToContainerPoint([
|
||||
latitude,
|
||||
longitude + meters / Math.max(metersPerDegree, 1),
|
||||
]);
|
||||
|
||||
return Math.hypot(shifted.x - origin.x, shifted.y - origin.y);
|
||||
}
|
||||
|
||||
private moveMap(center: [number, number], zoom: number | null, durationMs: number): void {
|
||||
const map = this.map;
|
||||
|
||||
if (!map) {
|
||||
return;
|
||||
}
|
||||
|
||||
this.programmaticMove = true;
|
||||
map.setView(this.toLatLng(center), zoom ?? map.getZoom(), {
|
||||
animate: true,
|
||||
duration: durationMs / 1000,
|
||||
});
|
||||
}
|
||||
|
||||
private toLatLng(coordinates: [number, number]): [number, number] {
|
||||
return [coordinates[1], coordinates[0]];
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,23 @@
|
||||
<article class="card">
|
||||
<div class="card__row">
|
||||
<img class="card__stamp" src="/assets/icons/cell-lock.svg" alt="" width="72" height="72" />
|
||||
|
||||
<div class="card__info">
|
||||
<h2>{{ landmark().title }}</h2>
|
||||
|
||||
<p class="card__status">
|
||||
<app-icon name="lock" [size]="16" />
|
||||
Не получен
|
||||
</p>
|
||||
|
||||
<p class="card__geo">
|
||||
<app-icon name="check" [size]="16" />
|
||||
Вы в радиусе {{ landmark().geoRadiusMeters }} м — можно забирать
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<a class="card__action" matButton="filled" [routerLink]="['/items', landmark().id]">
|
||||
Открыть карточку
|
||||
</a>
|
||||
</article>
|
||||
@@ -0,0 +1,59 @@
|
||||
:host {
|
||||
display: block;
|
||||
}
|
||||
|
||||
.card {
|
||||
padding: 16px;
|
||||
border: 1px solid var(--color-border);
|
||||
border-radius: 24px;
|
||||
background: rgb(28 26 23 / 96%);
|
||||
box-shadow: 0 16px 40px rgb(0 0 0 / 40%);
|
||||
backdrop-filter: blur(16px);
|
||||
}
|
||||
|
||||
.card__row {
|
||||
display: flex;
|
||||
align-items: flex-start;
|
||||
gap: 14px;
|
||||
margin-bottom: 16px;
|
||||
}
|
||||
|
||||
.card__stamp {
|
||||
flex: none;
|
||||
width: 72px;
|
||||
height: 72px;
|
||||
object-fit: contain;
|
||||
}
|
||||
|
||||
.card__info h2 {
|
||||
margin: 0;
|
||||
font-size: 22px;
|
||||
font-weight: 700;
|
||||
line-height: 1.2;
|
||||
letter-spacing: -0.03em;
|
||||
}
|
||||
|
||||
.card__status,
|
||||
.card__geo {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 6px;
|
||||
margin: 8px 0 0;
|
||||
font-size: 14px;
|
||||
line-height: 1.35;
|
||||
}
|
||||
|
||||
.card__status {
|
||||
color: var(--color-muted);
|
||||
}
|
||||
|
||||
.card__geo {
|
||||
color: var(--color-success);
|
||||
font-weight: 500;
|
||||
}
|
||||
|
||||
.card__action {
|
||||
width: 100%;
|
||||
min-height: 52px;
|
||||
--mat-button-filled-container-shape: 16px;
|
||||
}
|
||||
@@ -0,0 +1,17 @@
|
||||
import { ChangeDetectionStrategy, Component, input } from '@angular/core';
|
||||
import { MatButton } from '@angular/material/button';
|
||||
import { RouterLink } from '@angular/router';
|
||||
|
||||
import type { Landmark } from '../../data/nizhny-novgorod';
|
||||
import { Icon } from '../../shared/icon/icon';
|
||||
|
||||
@Component({
|
||||
selector: 'app-map-item-sheet',
|
||||
imports: [MatButton, Icon, RouterLink],
|
||||
templateUrl: './map-item-sheet.html',
|
||||
styleUrl: './map-item-sheet.scss',
|
||||
changeDetection: ChangeDetectionStrategy.OnPush,
|
||||
})
|
||||
export class MapItemSheet {
|
||||
readonly landmark = input.required<Landmark>();
|
||||
}
|
||||
@@ -0,0 +1,69 @@
|
||||
<section class="page">
|
||||
<header class="page__header">
|
||||
<div class="page__brand">
|
||||
<img class="page__mark" src="/assets/icons/gorodar-mark.svg" alt="" width="36" height="36" />
|
||||
<span>Городар</span>
|
||||
</div>
|
||||
|
||||
<a class="page__profile" routerLink="/profile" aria-label="Профиль">
|
||||
<app-icon name="profile" [size]="22" />
|
||||
</a>
|
||||
</header>
|
||||
|
||||
<div class="page__intro">
|
||||
<h1>Коллекции городов</h1>
|
||||
<p>Приезжайте на место, снимайте — объект попадёт в вашу коллекцию.</p>
|
||||
</div>
|
||||
|
||||
<a class="page__all" routerLink="/collections">
|
||||
<span class="page__all-label">
|
||||
<app-icon name="collection" [size]="22" />
|
||||
<span>
|
||||
<b>Вся коллекция</b>
|
||||
<span class="page__all-meta"> · {{ openedCount() }} объектов · 1 город</span>
|
||||
</span>
|
||||
</span>
|
||||
<app-icon name="chevron-right" [size]="20" />
|
||||
</a>
|
||||
|
||||
<article class="city-card" [attr.aria-label]="city.name">
|
||||
<div class="city-card__top">
|
||||
<div>
|
||||
<h2>{{ city.name }}</h2>
|
||||
<p>
|
||||
Открыто
|
||||
<strong>{{ openedCount() }} из {{ totalCount }}</strong>
|
||||
объектов
|
||||
</p>
|
||||
</div>
|
||||
|
||||
<div class="city-card__percent" aria-hidden="true">{{ progress() }}%</div>
|
||||
</div>
|
||||
|
||||
<mat-progress-bar mode="determinate" [value]="progress()" />
|
||||
|
||||
<div class="city-card__cells">
|
||||
@for (landmark of city.objects; track landmark.id) {
|
||||
<a
|
||||
class="cell"
|
||||
[routerLink]="['/items', landmark.id]"
|
||||
[class.cell--open]="collectedIds().has(landmark.id)"
|
||||
[attr.aria-label]="landmark.title + (collectedIds().has(landmark.id) ? ', получено' : ', не получен')"
|
||||
>
|
||||
<img
|
||||
[src]="collectedIds().has(landmark.id) ? '/assets/icons/gorodar-mark.svg' : '/assets/icons/cell-lock.svg'"
|
||||
[alt]=""
|
||||
/>
|
||||
</a>
|
||||
}
|
||||
</div>
|
||||
|
||||
<div class="city-card__actions">
|
||||
<a matButton="outlined" routerLink="/collection">Коллекция</a>
|
||||
<a matButton="filled" routerLink="/map">
|
||||
<app-icon name="pin" [size]="20" />
|
||||
На карте
|
||||
</a>
|
||||
</div>
|
||||
</article>
|
||||
</section>
|
||||
@@ -0,0 +1,208 @@
|
||||
:host {
|
||||
display: block;
|
||||
min-height: 100%;
|
||||
}
|
||||
|
||||
.page {
|
||||
width: min(100%, var(--page-max-width));
|
||||
margin: 0 auto;
|
||||
padding: 20px 16px 24px;
|
||||
overflow-x: hidden;
|
||||
}
|
||||
|
||||
.page__header,
|
||||
.page__brand,
|
||||
.page__all,
|
||||
.page__all-label,
|
||||
.city-card__top,
|
||||
.city-card__actions {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
}
|
||||
|
||||
.page__header {
|
||||
justify-content: space-between;
|
||||
gap: 12px;
|
||||
}
|
||||
|
||||
.page__brand {
|
||||
gap: 10px;
|
||||
color: var(--color-accent);
|
||||
font-size: 26px;
|
||||
font-weight: 700;
|
||||
letter-spacing: -0.03em;
|
||||
}
|
||||
|
||||
.page__mark {
|
||||
display: block;
|
||||
width: 36px;
|
||||
height: 36px;
|
||||
}
|
||||
|
||||
.page__profile {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
width: 44px;
|
||||
height: 44px;
|
||||
border: 1px solid var(--color-border);
|
||||
border-radius: 22px;
|
||||
background: var(--color-surface-2);
|
||||
color: var(--color-text);
|
||||
text-decoration: none;
|
||||
}
|
||||
|
||||
.page__intro {
|
||||
margin: 20px 0 16px;
|
||||
}
|
||||
|
||||
.page__intro h1,
|
||||
.city-card h2 {
|
||||
margin: 0;
|
||||
font-family: var(--font-display);
|
||||
font-size: clamp(28px, 6vw, 34px);
|
||||
font-weight: 700;
|
||||
line-height: 1.15;
|
||||
letter-spacing: -0.03em;
|
||||
}
|
||||
|
||||
.page__intro p,
|
||||
.city-card p {
|
||||
margin: 6px 0 0;
|
||||
color: var(--color-muted);
|
||||
font-size: 15px;
|
||||
}
|
||||
|
||||
.page__all,
|
||||
.city-card {
|
||||
border: 1px solid var(--color-border);
|
||||
background: var(--color-surface);
|
||||
}
|
||||
|
||||
.page__all {
|
||||
justify-content: space-between;
|
||||
gap: 12px;
|
||||
min-height: 56px;
|
||||
margin-bottom: 16px;
|
||||
padding: 0 16px;
|
||||
border-radius: 16px;
|
||||
color: var(--color-text);
|
||||
text-decoration: none;
|
||||
}
|
||||
|
||||
.page__all-label {
|
||||
gap: 10px;
|
||||
color: var(--color-accent);
|
||||
}
|
||||
|
||||
.page__all-label b {
|
||||
color: var(--color-text);
|
||||
font-weight: 600;
|
||||
}
|
||||
|
||||
.page__all-meta {
|
||||
color: var(--color-muted);
|
||||
font-weight: 400;
|
||||
}
|
||||
|
||||
.city-card {
|
||||
padding: 16px;
|
||||
border-radius: 24px;
|
||||
}
|
||||
|
||||
.city-card__top {
|
||||
justify-content: space-between;
|
||||
gap: 12px;
|
||||
margin-bottom: 14px;
|
||||
}
|
||||
|
||||
.city-card strong,
|
||||
.city-card__percent {
|
||||
color: var(--color-text);
|
||||
font-weight: 600;
|
||||
}
|
||||
|
||||
.city-card__percent {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
width: 60px;
|
||||
height: 60px;
|
||||
border: 5px solid var(--color-surface-2);
|
||||
border-radius: 50%;
|
||||
font-size: 14px;
|
||||
}
|
||||
|
||||
.city-card mat-progress-bar {
|
||||
--mdc-linear-progress-active-indicator-color: var(--color-accent);
|
||||
--mdc-linear-progress-track-color: var(--color-surface-2);
|
||||
border-radius: 3px;
|
||||
}
|
||||
|
||||
.city-card__cells {
|
||||
display: grid;
|
||||
grid-template-columns: repeat(5, minmax(0, 1fr));
|
||||
gap: 6px;
|
||||
margin: 16px 0;
|
||||
}
|
||||
|
||||
.cell {
|
||||
display: block;
|
||||
aspect-ratio: 1;
|
||||
overflow: hidden;
|
||||
padding: 0;
|
||||
border: 0;
|
||||
border-radius: 10px;
|
||||
background: #171512;
|
||||
color: inherit;
|
||||
text-decoration: none;
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
.cell img {
|
||||
display: block;
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
object-fit: cover;
|
||||
}
|
||||
|
||||
.cell--open {
|
||||
background: rgb(224 184 79 / 10%);
|
||||
box-shadow: inset 0 0 0 1.5px var(--color-accent);
|
||||
}
|
||||
|
||||
.city-card__actions {
|
||||
gap: 10px;
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
.city-card__actions a {
|
||||
flex: 1 1 0;
|
||||
min-width: 0;
|
||||
min-height: 48px;
|
||||
}
|
||||
|
||||
.city-card__actions a[matButton='filled'] {
|
||||
gap: 8px;
|
||||
overflow: visible;
|
||||
}
|
||||
|
||||
@media (max-width: 420px) {
|
||||
.city-card__actions {
|
||||
flex-direction: column;
|
||||
}
|
||||
|
||||
.city-card__actions a {
|
||||
width: 100%;
|
||||
}
|
||||
}
|
||||
|
||||
@media (min-width: 720px) {
|
||||
.page {
|
||||
padding-top: 32px;
|
||||
}
|
||||
|
||||
.city-card__cells {
|
||||
gap: 10px;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,27 @@
|
||||
import { ChangeDetectionStrategy, Component, inject } from '@angular/core';
|
||||
import { MatButton } from '@angular/material/button';
|
||||
import { MatProgressBar } from '@angular/material/progress-bar';
|
||||
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, selectProgress } from '../../state';
|
||||
|
||||
@Component({
|
||||
selector: 'app-cities-page',
|
||||
imports: [RouterLink, MatButton, MatProgressBar, Icon],
|
||||
templateUrl: './cities-page.html',
|
||||
styleUrl: './cities-page.scss',
|
||||
changeDetection: ChangeDetectionStrategy.OnPush,
|
||||
})
|
||||
export class CitiesPage {
|
||||
private readonly catalog = inject(CityCatalogService);
|
||||
private readonly store = inject(Store);
|
||||
|
||||
protected readonly city = this.catalog.city;
|
||||
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);
|
||||
}
|
||||
@@ -0,0 +1,100 @@
|
||||
<section class="page">
|
||||
<header class="page__top">
|
||||
<a class="page__back" routerLink="/" aria-label="Назад">
|
||||
<app-icon name="chevron-left" [size]="22" />
|
||||
</a>
|
||||
<a class="page__all" routerLink="/collections">
|
||||
Вся коллекция
|
||||
<app-icon name="chevron-right" [size]="16" />
|
||||
</a>
|
||||
</header>
|
||||
|
||||
<div class="page__city">
|
||||
<img src="/assets/icons/gorodar-mark.svg" alt="" width="96" height="96" />
|
||||
<div>
|
||||
<h1>{{ city.name }}</h1>
|
||||
<p>
|
||||
<app-icon name="pin" [size]="18" />
|
||||
<span>
|
||||
<b>{{ openedCount() }}/{{ city.objects.length }}</b>
|
||||
объектов
|
||||
</span>
|
||||
<span>·</span>
|
||||
<b>{{ progress() }}%</b>
|
||||
</p>
|
||||
<div class="page__progress" aria-hidden="true">
|
||||
<span [style.width.%]="progress()"></span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<nav class="tabs" aria-label="Разделы города">
|
||||
<span class="tabs__item tabs__item--active">Объекты</span>
|
||||
<a class="tabs__item" routerLink="/map">На карте</a>
|
||||
</nav>
|
||||
|
||||
<div class="filters">
|
||||
<button
|
||||
type="button"
|
||||
[class.filters__item--active]="filter() === 'all'"
|
||||
(click)="filter.set('all')"
|
||||
>
|
||||
Все · {{ city.objects.length }}
|
||||
</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]="['/items', landmark.id]">
|
||||
<div class="card__preview" [class.card__preview--open]="collectedIds().has(landmark.id)">
|
||||
@if (collectedIds().has(landmark.id)) {
|
||||
<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]="collectedIds().has(landmark.id) ? '/assets/icons/gorodar-mark.svg' : '/assets/icons/cell-lock.svg'"
|
||||
alt=""
|
||||
/>
|
||||
</div>
|
||||
<div class="card__body">
|
||||
<h2>{{ landmark.title }}</h2>
|
||||
<span class="card__status" [class.card__status--open]="collectedIds().has(landmark.id)">
|
||||
<app-icon [name]="collectedIds().has(landmark.id) ? 'check' : 'lock'" [size]="15" />
|
||||
{{ collectedIds().has(landmark.id) ? 'Получен' : 'Не получен' }}
|
||||
</span>
|
||||
</div>
|
||||
<span class="card__bar" [class.card__bar--open]="collectedIds().has(landmark.id)"></span>
|
||||
</a>
|
||||
}
|
||||
</div>
|
||||
</section>
|
||||
@@ -0,0 +1,286 @@
|
||||
:host {
|
||||
display: block;
|
||||
min-height: 100%;
|
||||
}
|
||||
|
||||
.page {
|
||||
width: min(100%, 720px);
|
||||
margin: 0 auto;
|
||||
padding: 16px 16px 24px;
|
||||
}
|
||||
|
||||
.page__top,
|
||||
.page__city,
|
||||
.page__city p,
|
||||
.filters,
|
||||
.card__status {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
}
|
||||
|
||||
.page__top {
|
||||
justify-content: space-between;
|
||||
gap: 12px;
|
||||
}
|
||||
|
||||
.page__back,
|
||||
.page__all {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
min-height: 44px;
|
||||
border: 1px solid var(--color-border);
|
||||
color: var(--color-text);
|
||||
text-decoration: none;
|
||||
}
|
||||
|
||||
.page__back {
|
||||
justify-content: center;
|
||||
width: 44px;
|
||||
border-radius: 14px;
|
||||
background: rgb(28 26 23 / 86%);
|
||||
}
|
||||
|
||||
.page__all {
|
||||
gap: 4px;
|
||||
padding: 0 12px 0 16px;
|
||||
border-color: var(--color-accent-strong);
|
||||
border-radius: 22px;
|
||||
background: var(--color-surface);
|
||||
color: var(--color-accent-soft);
|
||||
font-size: 14px;
|
||||
font-weight: 500;
|
||||
}
|
||||
|
||||
.page__city {
|
||||
gap: 16px;
|
||||
margin-top: 20px;
|
||||
}
|
||||
|
||||
.page__city img {
|
||||
flex: none;
|
||||
width: 96px;
|
||||
height: 96px;
|
||||
}
|
||||
|
||||
.page__city > div {
|
||||
flex: 1;
|
||||
min-width: 0;
|
||||
}
|
||||
|
||||
.page__city h1 {
|
||||
margin: 0;
|
||||
font-family: var(--font-display);
|
||||
font-size: clamp(26px, 7vw, 34px);
|
||||
font-weight: 700;
|
||||
line-height: 1.1;
|
||||
}
|
||||
|
||||
.page__city p {
|
||||
gap: 8px;
|
||||
margin: 8px 0 0;
|
||||
color: var(--color-muted);
|
||||
font-size: 14px;
|
||||
}
|
||||
|
||||
.page__city b {
|
||||
color: var(--color-text);
|
||||
font-weight: 600;
|
||||
}
|
||||
|
||||
.page__progress {
|
||||
height: 6px;
|
||||
margin-top: 12px;
|
||||
overflow: hidden;
|
||||
border-radius: 3px;
|
||||
background: #3a352d;
|
||||
}
|
||||
|
||||
.page__progress span {
|
||||
display: block;
|
||||
height: 100%;
|
||||
background: var(--color-accent);
|
||||
}
|
||||
|
||||
.tabs {
|
||||
display: flex;
|
||||
gap: 28px;
|
||||
margin-top: 22px;
|
||||
border-bottom: 1px solid var(--color-border);
|
||||
}
|
||||
|
||||
.tabs__item {
|
||||
padding: 10px 0;
|
||||
color: var(--color-muted);
|
||||
font-weight: 500;
|
||||
text-decoration: none;
|
||||
}
|
||||
|
||||
.tabs__item--active {
|
||||
margin-bottom: -1px;
|
||||
border-bottom: 3px solid var(--color-accent);
|
||||
color: var(--color-text);
|
||||
font-weight: 600;
|
||||
}
|
||||
|
||||
.filters {
|
||||
gap: 8px;
|
||||
margin-top: 16px;
|
||||
overflow: auto;
|
||||
}
|
||||
|
||||
.filters button {
|
||||
flex: none;
|
||||
min-height: 44px;
|
||||
padding: 0 16px;
|
||||
border: 1px solid var(--color-border);
|
||||
border-radius: 22px;
|
||||
background: var(--color-surface);
|
||||
color: var(--color-text);
|
||||
font-size: 14px;
|
||||
font-weight: 500;
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
.filters button.filters__item--active {
|
||||
border-color: var(--color-accent);
|
||||
background: var(--color-accent);
|
||||
color: var(--color-on-accent);
|
||||
}
|
||||
|
||||
.grid {
|
||||
display: grid;
|
||||
grid-template-columns: repeat(2, minmax(0, 1fr));
|
||||
gap: 12px;
|
||||
margin-top: 16px;
|
||||
}
|
||||
|
||||
.card {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
overflow: hidden;
|
||||
border: 1px solid var(--color-border);
|
||||
border-radius: 16px;
|
||||
background: var(--color-surface);
|
||||
color: inherit;
|
||||
text-decoration: none;
|
||||
}
|
||||
|
||||
.card__preview {
|
||||
position: relative;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
height: 112px;
|
||||
overflow: hidden;
|
||||
background:
|
||||
radial-gradient(circle at 50% 42%, rgb(255 255 255 / 5%), rgb(255 255 255 / 0%) 70%),
|
||||
#1a1815;
|
||||
}
|
||||
|
||||
.card__preview img {
|
||||
position: relative;
|
||||
z-index: 1;
|
||||
width: 96px;
|
||||
height: 96px;
|
||||
}
|
||||
|
||||
.card__rays {
|
||||
position: absolute;
|
||||
inset: -12px;
|
||||
width: calc(100% + 24px);
|
||||
height: calc(100% + 24px);
|
||||
opacity: 0;
|
||||
pointer-events: none;
|
||||
}
|
||||
|
||||
.card__spark {
|
||||
position: absolute;
|
||||
z-index: 2;
|
||||
width: 8px;
|
||||
height: 8px;
|
||||
opacity: 0;
|
||||
background: var(--color-accent-soft);
|
||||
clip-path: polygon(50% 0, 65% 35%, 100% 50%, 65% 65%, 50% 100%, 35% 65%, 0 50%, 35% 35%);
|
||||
pointer-events: none;
|
||||
}
|
||||
|
||||
.card__spark--a { top: 10px; left: 12px; }
|
||||
.card__spark--b { top: 14px; right: 14px; }
|
||||
.card__spark--c { bottom: 12px; left: 16px; }
|
||||
.card__spark--d { bottom: 14px; right: 12px; }
|
||||
|
||||
.card__preview--open {
|
||||
background: rgb(224 184 79 / 10%);
|
||||
}
|
||||
|
||||
@media (hover: hover) {
|
||||
.card:hover .card__preview--open .card__rays {
|
||||
opacity: 1;
|
||||
animation: spin 12s linear infinite;
|
||||
}
|
||||
|
||||
.card:hover .card__preview--open img {
|
||||
animation: pop 0.9s cubic-bezier(0.2, 0.9, 0.3, 1.2);
|
||||
}
|
||||
|
||||
.card:hover .card__preview--open .card__spark {
|
||||
opacity: 1;
|
||||
}
|
||||
}
|
||||
|
||||
@media (hover: none) {
|
||||
.card:active .card__preview--open .card__rays {
|
||||
opacity: 1;
|
||||
animation: spin 12s linear infinite;
|
||||
}
|
||||
|
||||
.card:active .card__preview--open img {
|
||||
animation: pop 0.9s cubic-bezier(0.2, 0.9, 0.3, 1.2);
|
||||
}
|
||||
|
||||
.card:active .card__preview--open .card__spark {
|
||||
opacity: 1;
|
||||
}
|
||||
}
|
||||
|
||||
.card__body {
|
||||
display: flex;
|
||||
flex: 1;
|
||||
flex-direction: column;
|
||||
gap: 8px;
|
||||
padding: 12px;
|
||||
}
|
||||
|
||||
.card__body h2 {
|
||||
margin: 0;
|
||||
min-height: 38px;
|
||||
font-size: 15px;
|
||||
font-weight: 600;
|
||||
line-height: 1.25;
|
||||
}
|
||||
|
||||
.card__status {
|
||||
gap: 6px;
|
||||
color: var(--color-muted);
|
||||
font-size: 13px;
|
||||
line-height: 1;
|
||||
}
|
||||
|
||||
.card__status--open {
|
||||
color: var(--color-accent-soft);
|
||||
}
|
||||
|
||||
.card__bar {
|
||||
height: 4px;
|
||||
background: #2e2a24;
|
||||
}
|
||||
|
||||
.card__bar--open {
|
||||
background: var(--color-accent);
|
||||
}
|
||||
|
||||
@media (max-width: 380px) {
|
||||
.grid {
|
||||
grid-template-columns: 1fr;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,58 @@
|
||||
import { ChangeDetectionStrategy, Component, computed, inject, signal } 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, selectProgress } from '../../state';
|
||||
|
||||
type CollectionFilter = 'all' | 'open' | 'closed';
|
||||
|
||||
@Component({
|
||||
selector: 'app-collection-page',
|
||||
imports: [Icon, RouterLink],
|
||||
templateUrl: './collection-page.html',
|
||||
styleUrl: './collection-page.scss',
|
||||
changeDetection: ChangeDetectionStrategy.OnPush,
|
||||
})
|
||||
export class CollectionPage {
|
||||
private readonly catalog = inject(CityCatalogService);
|
||||
private readonly store = inject(Store);
|
||||
|
||||
protected readonly city = this.catalog.city;
|
||||
protected readonly filter = signal<CollectionFilter>('all');
|
||||
protected readonly collectedIds = this.store.selectSignal(selectCollectedIdSet);
|
||||
protected readonly openedCount = this.store.selectSignal(selectOpenedCount);
|
||||
protected readonly progress = this.store.selectSignal(selectProgress);
|
||||
protected readonly closedCount = computed(
|
||||
() => this.city.objects.length - this.openedCount(),
|
||||
);
|
||||
protected readonly landmarks = computed(() => {
|
||||
const items = this.city.objects;
|
||||
const ids = this.collectedIds();
|
||||
|
||||
switch (this.filter()) {
|
||||
case 'open':
|
||||
return items.filter((item) => ids.has(item.id));
|
||||
case 'closed':
|
||||
return items.filter((item) => !ids.has(item.id));
|
||||
default:
|
||||
return items;
|
||||
}
|
||||
});
|
||||
|
||||
protected readonly rays = Array.from({ length: 16 }, (_, index) => {
|
||||
const angle = (index / 16) * Math.PI * 2;
|
||||
const inner = 30;
|
||||
const outer = index % 2 === 0 ? 54 : 46;
|
||||
const center = 56;
|
||||
|
||||
return {
|
||||
x1: center + Math.cos(angle) * inner,
|
||||
y1: center + Math.sin(angle) * inner,
|
||||
x2: center + Math.cos(angle) * outer,
|
||||
y2: center + Math.sin(angle) * outer,
|
||||
strong: index % 2 === 0,
|
||||
};
|
||||
});
|
||||
}
|
||||
@@ -0,0 +1,113 @@
|
||||
<section class="page">
|
||||
<header class="page__top">
|
||||
<a class="page__back" routerLink="/" aria-label="Назад">
|
||||
<app-icon name="chevron-left" [size]="22" />
|
||||
</a>
|
||||
<span class="page__title">Коллекция</span>
|
||||
</header>
|
||||
|
||||
<div class="page__intro">
|
||||
<h1>Вся коллекция</h1>
|
||||
<p>Достопримечательности по городам и странам</p>
|
||||
</div>
|
||||
|
||||
<section class="summary">
|
||||
<div>
|
||||
<b>{{ openedCount() }}</b>
|
||||
<span>{{ objectsLabel() }}</span>
|
||||
</div>
|
||||
<div>
|
||||
<b>1</b>
|
||||
<span>город</span>
|
||||
</div>
|
||||
<div>
|
||||
<b>1</b>
|
||||
<span>страна</span>
|
||||
</div>
|
||||
</section>
|
||||
|
||||
<div class="tabs">
|
||||
<button type="button" [class.tabs__item--active]="tab() === 'russia'" (click)="tab.set('russia')">
|
||||
Россия
|
||||
</button>
|
||||
<button type="button" [class.tabs__item--active]="tab() === 'world'" (click)="tab.set('world')">
|
||||
Страны мира
|
||||
</button>
|
||||
</div>
|
||||
|
||||
@if (tab() === 'russia') {
|
||||
<label class="search">
|
||||
<app-icon name="search" [size]="22" />
|
||||
<input
|
||||
type="search"
|
||||
placeholder="Найти город"
|
||||
[value]="query()"
|
||||
(input)="onQuery($event)"
|
||||
/>
|
||||
</label>
|
||||
|
||||
<p class="section-label">Мои города</p>
|
||||
|
||||
@if (cityVisible()) {
|
||||
<a class="pack" routerLink="/collection">
|
||||
<div class="pack__head">
|
||||
<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>
|
||||
</div>
|
||||
|
||||
<div class="pack__bar" aria-hidden="true">
|
||||
<span
|
||||
class="anim-grow"
|
||||
[style.--from]="'0%'"
|
||||
[style.--to]="progress() + '%'"
|
||||
></span>
|
||||
</div>
|
||||
|
||||
<div class="pack__cells">
|
||||
@for (landmark of city.objects; track landmark.id) {
|
||||
<span class="pack__stamp" [class.pack__stamp--open]="collectedIds().has(landmark.id)">
|
||||
<img
|
||||
[src]="collectedIds().has(landmark.id) ? '/assets/icons/gorodar-mark.svg' : '/assets/icons/cell-lock.svg'"
|
||||
alt=""
|
||||
/>
|
||||
</span>
|
||||
}
|
||||
</div>
|
||||
</a>
|
||||
} @else {
|
||||
<p class="empty">Город не найден.</p>
|
||||
}
|
||||
} @else {
|
||||
<label class="search">
|
||||
<app-icon name="search" [size]="22" />
|
||||
<input type="search" placeholder="Найти страну" disabled />
|
||||
</label>
|
||||
|
||||
<button type="button" class="country" (click)="tab.set('russia')">
|
||||
<span class="country__mark" aria-hidden="true">
|
||||
<app-icon name="globe" [size]="28" />
|
||||
</span>
|
||||
<span class="country__body">
|
||||
<b>Россия</b>
|
||||
<span>Городов: 1 · Собрано {{ openedCount() }} из {{ totalCount }}</span>
|
||||
</span>
|
||||
<span class="pack__go" aria-hidden="true">
|
||||
<app-icon name="chevron-right" [size]="20" />
|
||||
</span>
|
||||
</button>
|
||||
|
||||
<p class="empty">Пока в Городаре одна страна — Россия. Коллекции других стран появятся позже.</p>
|
||||
}
|
||||
</section>
|
||||
@@ -0,0 +1,197 @@
|
||||
:host {
|
||||
display: block;
|
||||
min-height: 100%;
|
||||
}
|
||||
|
||||
.page {
|
||||
width: min(100%, var(--page-max-width));
|
||||
margin: 0 auto;
|
||||
padding: 16px 16px 24px;
|
||||
}
|
||||
|
||||
.page__top {
|
||||
position: relative;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
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-muted);
|
||||
font-size: 15px;
|
||||
font-weight: 500;
|
||||
}
|
||||
|
||||
.page__intro {
|
||||
margin-top: 20px;
|
||||
}
|
||||
|
||||
.page__intro h1,
|
||||
.summary b,
|
||||
.country b {
|
||||
margin: 0;
|
||||
font-family: var(--font-display);
|
||||
font-weight: 700;
|
||||
}
|
||||
|
||||
.summary {
|
||||
b {
|
||||
margin-right: 6px;
|
||||
}
|
||||
}
|
||||
|
||||
.page__intro h1 {
|
||||
font-size: clamp(28px, 7vw, 34px);
|
||||
line-height: 1.15;
|
||||
}
|
||||
|
||||
.page__intro p,
|
||||
.section-label,
|
||||
.empty,
|
||||
.summary span {
|
||||
margin: 6px 0 0;
|
||||
color: var(--color-muted);
|
||||
font-size: 15px;
|
||||
}
|
||||
|
||||
.summary,
|
||||
.search,
|
||||
.country {
|
||||
border: 1px solid var(--color-border);
|
||||
background: var(--color-surface);
|
||||
}
|
||||
|
||||
.summary {
|
||||
display: grid;
|
||||
grid-template-columns: repeat(3, minmax(0, 1fr));
|
||||
gap: 8px;
|
||||
margin-top: 16px;
|
||||
padding: 18px 16px;
|
||||
border-radius: 24px;
|
||||
}
|
||||
|
||||
.summary b {
|
||||
color: var(--color-accent-soft);
|
||||
font-size: 30px;
|
||||
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;
|
||||
}
|
||||
@@ -0,0 +1,53 @@
|
||||
import { ChangeDetectionStrategy, Component, computed, inject, signal } 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, selectProgress } from '../../state';
|
||||
|
||||
@Component({
|
||||
selector: 'app-collections-page',
|
||||
imports: [Icon, RouterLink],
|
||||
templateUrl: './collections-page.html',
|
||||
styleUrl: './collections-page.scss',
|
||||
changeDetection: ChangeDetectionStrategy.OnPush,
|
||||
})
|
||||
export class CollectionsPage {
|
||||
private readonly catalog = inject(CityCatalogService);
|
||||
private readonly store = inject(Store);
|
||||
|
||||
protected readonly city = this.catalog.city;
|
||||
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 objectsLabel = computed(() =>
|
||||
this.plural(this.openedCount(), ['объект', 'объекта', 'объектов']),
|
||||
);
|
||||
|
||||
protected onQuery(event: Event): void {
|
||||
this.query.set((event.target as HTMLInputElement).value);
|
||||
}
|
||||
|
||||
private plural(count: number, forms: [string, string, string]): string {
|
||||
const abs = Math.abs(count) % 100;
|
||||
const last = abs % 10;
|
||||
if (abs > 10 && abs < 20) {
|
||||
return forms[2];
|
||||
}
|
||||
if (last === 1) {
|
||||
return forms[0];
|
||||
}
|
||||
if (last >= 2 && last <= 4) {
|
||||
return forms[1];
|
||||
}
|
||||
return forms[2];
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,132 @@
|
||||
@if (landmark(); as item) {
|
||||
@if (claiming()) {
|
||||
<app-claim-flow [landmark]="item" />
|
||||
} @else {
|
||||
<article class="object" [class.object--owned]="collected()">
|
||||
<header class="object__hero">
|
||||
<img class="object__hero-img" src="/assets/illustrations/object-hero.svg" alt="" />
|
||||
<button class="object__back" type="button" aria-label="Назад" (click)="goBack()">
|
||||
<app-icon name="chevron-left" [size]="22" />
|
||||
</button>
|
||||
<span class="object__city">{{ city.name }}</span>
|
||||
</header>
|
||||
|
||||
<div class="object__intro">
|
||||
<h1>{{ item.title }}</h1>
|
||||
|
||||
<div class="object__chips">
|
||||
<span class="chip" [class.chip--open]="collected()">
|
||||
<app-icon [name]="collected() ? 'check' : 'lock'" [size]="15" />
|
||||
{{ collectedLabel() }}
|
||||
</span>
|
||||
</div>
|
||||
|
||||
<div class="object__address">
|
||||
<app-icon name="pin" [size]="18" />
|
||||
<div>
|
||||
<p>{{ item.address }}</p>
|
||||
<span>{{ item.addressHint }}</span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="object__body">
|
||||
<section>
|
||||
<h2>О месте</h2>
|
||||
<p>{{ item.description }}</p>
|
||||
</section>
|
||||
|
||||
<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 (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>
|
||||
|
||||
<a class="object__map" routerLink="/map">
|
||||
<app-icon name="pin" [size]="20" />
|
||||
Показать на карте
|
||||
</a>
|
||||
} @else {
|
||||
<section>
|
||||
<h2>Примеры фото</h2>
|
||||
<div class="photos">
|
||||
@for (photo of photoExamples; track photo.label) {
|
||||
<figure>
|
||||
<img [src]="photo.src" [alt]="photo.label" />
|
||||
<span>{{ photo.label }}</span>
|
||||
</figure>
|
||||
}
|
||||
</div>
|
||||
<p class="object__hint">{{ item.photoHint }}</p>
|
||||
</section>
|
||||
|
||||
<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 {
|
||||
<section class="object object--empty">
|
||||
<p>Объект не найден.</p>
|
||||
<button matButton="outlined" type="button" (click)="goBack()">Назад</button>
|
||||
</section>
|
||||
}
|
||||
@@ -0,0 +1,295 @@
|
||||
:host {
|
||||
display: block;
|
||||
width: 100%;
|
||||
min-height: 100%;
|
||||
background: var(--color-bg);
|
||||
}
|
||||
|
||||
.object {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
width: 100%;
|
||||
max-width: var(--page-max-width);
|
||||
min-height: 100%;
|
||||
margin-inline: auto;
|
||||
overflow-x: hidden;
|
||||
}
|
||||
|
||||
@media (min-width: 720px) {
|
||||
:host {
|
||||
padding: 24px 16px 32px;
|
||||
}
|
||||
|
||||
.object {
|
||||
min-height: auto;
|
||||
overflow: hidden;
|
||||
border: 1px solid var(--color-border);
|
||||
border-radius: 24px;
|
||||
background: var(--color-bg);
|
||||
}
|
||||
|
||||
.object__bar {
|
||||
border-radius: 0 0 24px 24px;
|
||||
}
|
||||
}
|
||||
|
||||
.object__back,
|
||||
.object__city {
|
||||
position: absolute;
|
||||
z-index: 1;
|
||||
top: 16px;
|
||||
min-height: 44px;
|
||||
border: 1px solid var(--color-border);
|
||||
background: rgb(28 26 23 / 86%);
|
||||
color: var(--color-text);
|
||||
}
|
||||
|
||||
.object__back {
|
||||
left: 16px;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
width: 44px;
|
||||
padding: 0;
|
||||
border-radius: 14px;
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
.object__city {
|
||||
right: 16px;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
max-width: min(58%, 220px);
|
||||
padding: 0 14px;
|
||||
overflow: hidden;
|
||||
border-radius: 20px;
|
||||
font-size: 14px;
|
||||
font-weight: 500;
|
||||
text-overflow: ellipsis;
|
||||
white-space: nowrap;
|
||||
}
|
||||
|
||||
.object__intro {
|
||||
position: relative;
|
||||
z-index: 1;
|
||||
margin-top: -44px;
|
||||
padding: 0 16px;
|
||||
}
|
||||
|
||||
.object__intro h1,
|
||||
.object__body h2,
|
||||
.facts {
|
||||
margin: 0;
|
||||
|
||||
&__number {
|
||||
font-family: var(--font-display);
|
||||
font-weight: 700;
|
||||
}
|
||||
|
||||
&__value {
|
||||
margin: 0;
|
||||
}
|
||||
}
|
||||
|
||||
.object__intro h1 {
|
||||
font-size: clamp(26px, 6.5vw, 32px);
|
||||
line-height: 1.12;
|
||||
letter-spacing: -0.03em;
|
||||
overflow-wrap: break-word;
|
||||
}
|
||||
|
||||
.object__chips,
|
||||
.object__address,
|
||||
.facts li,
|
||||
.steps li {
|
||||
display: flex;
|
||||
gap: 8px;
|
||||
}
|
||||
|
||||
.object__chips {
|
||||
flex-wrap: wrap;
|
||||
margin-top: 12px;
|
||||
}
|
||||
|
||||
.chip,
|
||||
.facts li {
|
||||
border: 1px solid var(--color-border);
|
||||
border-radius: 16px;
|
||||
background: var(--color-surface-2);
|
||||
}
|
||||
|
||||
.chip {
|
||||
display: inline-flex;
|
||||
align-items: center;
|
||||
gap: 6px;
|
||||
padding: 6px 12px;
|
||||
overflow: visible;
|
||||
color: var(--color-muted);
|
||||
font-size: 14px;
|
||||
font-weight: 500;
|
||||
line-height: 1;
|
||||
}
|
||||
|
||||
.chip--open {
|
||||
background: rgb(224 184 79 / 14%);
|
||||
border-color: var(--color-accent-strong);
|
||||
color: var(--color-accent-soft);
|
||||
font-weight: 600;
|
||||
}
|
||||
|
||||
.object__address {
|
||||
align-items: center;
|
||||
margin-top: 16px;
|
||||
color: var(--color-accent);
|
||||
font-size: 14px;
|
||||
}
|
||||
|
||||
.object__address p {
|
||||
margin: 0;
|
||||
color: var(--color-text);
|
||||
}
|
||||
|
||||
.object__address span,
|
||||
.object__hint,
|
||||
.object__bar p {
|
||||
color: var(--color-muted);
|
||||
}
|
||||
|
||||
.object__body {
|
||||
display: flex;
|
||||
flex: 1;
|
||||
flex-direction: column;
|
||||
gap: 28px;
|
||||
padding: 28px 16px 120px;
|
||||
}
|
||||
|
||||
.object--owned .object__body {
|
||||
padding-bottom: 40px;
|
||||
}
|
||||
|
||||
.object__body h2 {
|
||||
margin-bottom: 12px;
|
||||
font-size: 22px;
|
||||
}
|
||||
|
||||
.object__body p {
|
||||
margin: 0;
|
||||
color: var(--color-text-soft);
|
||||
font-size: 16px;
|
||||
line-height: 1.6;
|
||||
}
|
||||
|
||||
.steps,
|
||||
.facts {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
gap: 12px;
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
list-style: none;
|
||||
}
|
||||
|
||||
.steps {
|
||||
counter-reset: step;
|
||||
}
|
||||
|
||||
.steps li {
|
||||
align-items: center;
|
||||
gap: 12px;
|
||||
font-size: 15px;
|
||||
}
|
||||
|
||||
.steps li::before {
|
||||
counter-increment: step;
|
||||
content: counter(step);
|
||||
display: flex;
|
||||
flex: none;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
width: 32px;
|
||||
height: 32px;
|
||||
border: 1px solid var(--color-accent-strong);
|
||||
border-radius: 16px;
|
||||
color: var(--color-accent);
|
||||
font-weight: 600;
|
||||
}
|
||||
|
||||
.facts {
|
||||
gap: 10px;
|
||||
}
|
||||
|
||||
.facts li {
|
||||
align-items: flex-start;
|
||||
gap: 14px;
|
||||
padding: 14px 16px;
|
||||
background: var(--color-surface);
|
||||
font-size: 15px;
|
||||
line-height: 1.5;
|
||||
}
|
||||
|
||||
.facts {
|
||||
&__number {
|
||||
min-width: 18px;
|
||||
color: var(--color-accent);
|
||||
font-size: 24px;
|
||||
line-height: 1;
|
||||
}
|
||||
}
|
||||
|
||||
.object__hint {
|
||||
margin: 10px 0 0;
|
||||
font-size: 14px;
|
||||
}
|
||||
|
||||
.object__body .object__hint {
|
||||
color: var(--color-muted);
|
||||
font-size: 14px;
|
||||
}
|
||||
|
||||
.object__map {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
gap: 10px;
|
||||
width: 100%;
|
||||
min-height: 52px;
|
||||
overflow: visible;
|
||||
border: 1px solid var(--color-border);
|
||||
border-radius: 16px;
|
||||
background: var(--color-surface-2);
|
||||
color: var(--color-text);
|
||||
font-size: 16px;
|
||||
font-weight: 500;
|
||||
text-decoration: none;
|
||||
}
|
||||
|
||||
.object__map app-icon {
|
||||
color: var(--color-accent);
|
||||
}
|
||||
|
||||
.object__bar {
|
||||
position: sticky;
|
||||
bottom: 0;
|
||||
padding: 20px 16px calc(16px + env(safe-area-inset-bottom));
|
||||
background: linear-gradient(to bottom, transparent, rgb(18 17 15 / 96%) 30%);
|
||||
}
|
||||
|
||||
.object__claim {
|
||||
width: 100%;
|
||||
min-height: 56px;
|
||||
overflow: visible;
|
||||
--mat-button-filled-container-shape: 16px;
|
||||
}
|
||||
|
||||
.object__bar p {
|
||||
margin: 8px 0 0;
|
||||
font-size: 13px;
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
.object--empty {
|
||||
gap: 16px;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
padding: 48px 16px;
|
||||
}
|
||||
@@ -0,0 +1,109 @@
|
||||
import { Location } from '@angular/common';
|
||||
import { ChangeDetectionStrategy, Component, computed, HostListener, inject, input, signal } from '@angular/core';
|
||||
import { Router, RouterLink } from '@angular/router';
|
||||
import { MatButton } from '@angular/material/button';
|
||||
import { Store } from '@ngrx/store';
|
||||
|
||||
import { ClaimFlow } from '../../claim/claim-flow/claim-flow';
|
||||
import { CityCatalogService } from '../../root/services/city-catalog.service';
|
||||
import { Icon } from '../../shared/icon/icon';
|
||||
import {
|
||||
GorodarActions,
|
||||
selectClaim,
|
||||
selectCollectedAt,
|
||||
selectCollectedIdSet,
|
||||
selectPhotos,
|
||||
} from '../../state';
|
||||
|
||||
@Component({
|
||||
selector: 'app-map-item-page',
|
||||
imports: [MatButton, Icon, ClaimFlow, RouterLink],
|
||||
templateUrl: './map-item-page.html',
|
||||
styleUrl: './map-item-page.scss',
|
||||
changeDetection: ChangeDetectionStrategy.OnPush,
|
||||
})
|
||||
export class MapItemPage {
|
||||
private readonly catalog = inject(CityCatalogService);
|
||||
private readonly store = inject(Store);
|
||||
private readonly location = inject(Location);
|
||||
private readonly router = inject(Router);
|
||||
|
||||
readonly id = input.required<string>();
|
||||
|
||||
protected readonly city = this.catalog.city;
|
||||
protected readonly landmark = computed(() => this.catalog.landmarkById(this.id()));
|
||||
protected readonly collectedIds = this.store.selectSignal(selectCollectedIdSet);
|
||||
protected readonly photos = this.store.selectSignal(selectPhotos);
|
||||
protected readonly collectedAtMap = this.store.selectSignal(selectCollectedAt);
|
||||
protected readonly claim = this.store.selectSignal(selectClaim);
|
||||
|
||||
protected readonly collected = computed(() => {
|
||||
const item = this.landmark();
|
||||
return item ? this.collectedIds().has(item.id) || item.collected : false;
|
||||
});
|
||||
|
||||
protected readonly userPhoto = computed(() => {
|
||||
const item = this.landmark();
|
||||
return item ? (this.photos()[item.id] ?? null) : null;
|
||||
});
|
||||
|
||||
protected readonly collectedLabel = computed(() => {
|
||||
if (!this.collected()) {
|
||||
return 'Не получен';
|
||||
}
|
||||
|
||||
const item = this.landmark();
|
||||
const at = item ? this.collectedAtMap()[item.id] : undefined;
|
||||
|
||||
if (!at) {
|
||||
return 'Получен';
|
||||
}
|
||||
|
||||
const formatted = new Intl.DateTimeFormat('ru-RU', {
|
||||
day: 'numeric',
|
||||
month: 'long',
|
||||
}).format(new Date(at));
|
||||
|
||||
return `Получено · ${formatted}`;
|
||||
});
|
||||
|
||||
protected readonly claiming = computed(() => {
|
||||
const claim = this.claim();
|
||||
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 {
|
||||
if (window.history.length > 1) {
|
||||
this.location.back();
|
||||
return;
|
||||
}
|
||||
|
||||
void this.router.navigateByUrl('/map');
|
||||
}
|
||||
|
||||
protected claimItem(): void {
|
||||
this.store.dispatch(GorodarActions.takePhoto({ landmarkId: this.id() }));
|
||||
}
|
||||
|
||||
protected openPhoto(): void {
|
||||
if (this.userPhoto()) {
|
||||
this.photoOpen.set(true);
|
||||
}
|
||||
}
|
||||
|
||||
protected closePhoto(): void {
|
||||
this.photoOpen.set(false);
|
||||
}
|
||||
|
||||
@HostListener('document:keydown.escape')
|
||||
protected onEscape(): void {
|
||||
this.closePhoto();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1 @@
|
||||
<app-city-map />
|
||||
@@ -0,0 +1,4 @@
|
||||
:host {
|
||||
display: block;
|
||||
height: 100%;
|
||||
}
|
||||
@@ -0,0 +1,12 @@
|
||||
import { ChangeDetectionStrategy, Component } from '@angular/core';
|
||||
|
||||
import { CityMap } from '../../map/city-map/city-map';
|
||||
|
||||
@Component({
|
||||
selector: 'app-map-page',
|
||||
imports: [CityMap],
|
||||
templateUrl: './map-page.html',
|
||||
styleUrl: './map-page.scss',
|
||||
changeDetection: ChangeDetectionStrategy.OnPush,
|
||||
})
|
||||
export class MapPage {}
|
||||
@@ -0,0 +1,80 @@
|
||||
<section class="page">
|
||||
<header class="page__top">
|
||||
<a class="page__back" routerLink="/" aria-label="Назад">
|
||||
<app-icon name="chevron-left" [size]="22" />
|
||||
</a>
|
||||
<span class="page__title">Профиль</span>
|
||||
</header>
|
||||
|
||||
<div class="hero">
|
||||
<div class="hero__avatar" aria-hidden="true">{{ initial() }}</div>
|
||||
<h1>{{ profile().displayName }}</h1>
|
||||
<p>
|
||||
<app-icon name="pin" [size]="18" />
|
||||
{{ profile().city }}
|
||||
</p>
|
||||
</div>
|
||||
|
||||
<section class="collections">
|
||||
<h2>Коллекции</h2>
|
||||
<p>Пока доступна коллекция Нижнего Новгорода. Другие города появятся позже.</p>
|
||||
|
||||
<a class="pack" routerLink="/collection">
|
||||
<div class="pack__head">
|
||||
<div>
|
||||
<h3>{{ city.name }}</h3>
|
||||
<p>Собрано {{ openedCount() }} из {{ totalCount }}</p>
|
||||
</div>
|
||||
<div
|
||||
class="pack__percent anim-percent"
|
||||
[style.--to-p]="progress()"
|
||||
aria-hidden="true"
|
||||
>
|
||||
<span>{{ progress() }}%</span>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="pack__bar" aria-hidden="true">
|
||||
<span
|
||||
class="anim-grow"
|
||||
[style.--from]="'0%'"
|
||||
[style.--to]="progress() + '%'"
|
||||
></span>
|
||||
</div>
|
||||
|
||||
<div class="pack__cells">
|
||||
@for (landmark of city.objects; track landmark.id) {
|
||||
<span class="pack__stamp" [class.pack__stamp--open]="collectedIds().has(landmark.id)">
|
||||
<img
|
||||
[src]="collectedIds().has(landmark.id) ? '/assets/icons/gorodar-mark.svg' : '/assets/icons/cell-lock.svg'"
|
||||
alt=""
|
||||
/>
|
||||
</span>
|
||||
}
|
||||
</div>
|
||||
</a>
|
||||
</section>
|
||||
|
||||
<ul class="info">
|
||||
<li>
|
||||
<span>Имя</span>
|
||||
<b>{{ profile().firstName }} {{ profile().lastName }}</b>
|
||||
</li>
|
||||
<li>
|
||||
<span>Город</span>
|
||||
<b>{{ profile().city }}</b>
|
||||
</li>
|
||||
<li>
|
||||
<span>Почта</span>
|
||||
<b>{{ profile().email }}</b>
|
||||
</li>
|
||||
<li>
|
||||
<span>Телефон</span>
|
||||
<b>{{ profile().phone }}</b>
|
||||
</li>
|
||||
<li>
|
||||
<span>В Городаре с</span>
|
||||
<b>{{ profile().joinedLabel }}</b>
|
||||
</li>
|
||||
</ul>
|
||||
</section>
|
||||
@@ -0,0 +1,147 @@
|
||||
: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;
|
||||
}
|
||||
@@ -0,0 +1,27 @@
|
||||
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));
|
||||
}
|
||||
@@ -0,0 +1,50 @@
|
||||
import { Injectable } from '@angular/core';
|
||||
import { Camera } from '@capacitor/camera';
|
||||
|
||||
@Injectable({
|
||||
providedIn: 'root',
|
||||
})
|
||||
export class CameraService {
|
||||
async takePhoto(): Promise<string | null> {
|
||||
try {
|
||||
const result = await Camera.takePhoto({ quality: 80 });
|
||||
|
||||
try {
|
||||
const dataUrl = await this.toDataUrl(result.webPath);
|
||||
if (dataUrl) {
|
||||
return dataUrl;
|
||||
}
|
||||
} catch {
|
||||
// webPath can be a short-lived blob; thumbnail is the durable fallback.
|
||||
}
|
||||
|
||||
return this.fromThumbnail(result.thumbnail);
|
||||
} catch {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
private async toDataUrl(src?: string): Promise<string | null> {
|
||||
if (!src) {
|
||||
return null;
|
||||
}
|
||||
|
||||
const response = await fetch(src);
|
||||
const blob = await response.blob();
|
||||
|
||||
return await new Promise((resolve, reject) => {
|
||||
const reader = new FileReader();
|
||||
reader.onload = () => resolve(String(reader.result));
|
||||
reader.onerror = () => reject(reader.error);
|
||||
reader.readAsDataURL(blob);
|
||||
});
|
||||
}
|
||||
|
||||
private fromThumbnail(thumbnail?: string): string | null {
|
||||
if (!thumbnail) {
|
||||
return null;
|
||||
}
|
||||
|
||||
return thumbnail.startsWith('data:') ? thumbnail : `data:image/jpeg;base64,${thumbnail}`;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,14 @@
|
||||
import { Injectable } from '@angular/core';
|
||||
|
||||
import { NIZHNY_NOVGOROD, type City, type Landmark } from '../../data/nizhny-novgorod';
|
||||
|
||||
@Injectable({
|
||||
providedIn: 'root',
|
||||
})
|
||||
export class CityCatalogService {
|
||||
readonly city: City = NIZHNY_NOVGOROD;
|
||||
|
||||
landmarkById(id: string): Landmark | undefined {
|
||||
return this.city.objects.find((item) => item.id === id);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,21 @@
|
||||
import { Injectable, signal } from '@angular/core';
|
||||
|
||||
export interface MapItem {
|
||||
title: string;
|
||||
description: string;
|
||||
}
|
||||
|
||||
@Injectable({
|
||||
providedIn: 'root',
|
||||
})
|
||||
export class MapModalService {
|
||||
readonly item = signal<MapItem | null>(null);
|
||||
|
||||
open(item: MapItem): void {
|
||||
this.item.set(item);
|
||||
}
|
||||
|
||||
close(): void {
|
||||
this.item.set(null);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,8 @@
|
||||
<span
|
||||
class="icon"
|
||||
[style.width.px]="size()"
|
||||
[style.height.px]="size()"
|
||||
[style.mask-image]="maskImage()"
|
||||
[style.webkit-mask-image]="maskImage()"
|
||||
aria-hidden="true"
|
||||
></span>
|
||||
@@ -0,0 +1,22 @@
|
||||
:host {
|
||||
display: inline-flex;
|
||||
flex: none;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
overflow: visible;
|
||||
line-height: 0;
|
||||
vertical-align: middle;
|
||||
}
|
||||
|
||||
.icon {
|
||||
display: block;
|
||||
overflow: visible;
|
||||
background-color: currentColor;
|
||||
mask-repeat: no-repeat;
|
||||
mask-position: center;
|
||||
mask-size: contain;
|
||||
mask-mode: alpha;
|
||||
-webkit-mask-repeat: no-repeat;
|
||||
-webkit-mask-position: center;
|
||||
-webkit-mask-size: contain;
|
||||
}
|
||||
@@ -0,0 +1,14 @@
|
||||
import { ChangeDetectionStrategy, Component, computed, input } from '@angular/core';
|
||||
|
||||
@Component({
|
||||
selector: 'app-icon',
|
||||
templateUrl: './icon.html',
|
||||
styleUrl: './icon.scss',
|
||||
changeDetection: ChangeDetectionStrategy.OnPush,
|
||||
})
|
||||
export class Icon {
|
||||
readonly name = input.required<string>();
|
||||
readonly size = input(24);
|
||||
|
||||
protected readonly maskImage = computed(() => `url("/assets/icons/${this.name()}.svg")`);
|
||||
}
|
||||
@@ -0,0 +1,13 @@
|
||||
import { createActionGroup, emptyProps, props } from '@ngrx/store';
|
||||
|
||||
export const GorodarActions = createActionGroup({
|
||||
source: 'Gorodar',
|
||||
events: {
|
||||
'Take Photo': props<{ landmarkId: string }>(),
|
||||
'Photo Captured': props<{ landmarkId: string; photo: string }>(),
|
||||
'Photo Cancelled': emptyProps(),
|
||||
'Claim Step Changed': props<{ step: number }>(),
|
||||
'Claim Completed': props<{ landmarkId: string; photo: string; collectedAt: string }>(),
|
||||
'Claim Reset': emptyProps(),
|
||||
},
|
||||
});
|
||||
@@ -0,0 +1,47 @@
|
||||
import { inject, Injectable } from '@angular/core';
|
||||
import { Actions, createEffect, ofType } from '@ngrx/effects';
|
||||
import { catchError, concat, delay, exhaustMap, from, map, of, switchMap, takeUntil } from 'rxjs';
|
||||
|
||||
import { CameraService } from '../root/services/camera.service';
|
||||
import { GorodarActions } from './gorodar.actions';
|
||||
|
||||
@Injectable()
|
||||
export class GorodarEffects {
|
||||
private readonly actions$ = inject(Actions);
|
||||
private readonly camera = inject(CameraService);
|
||||
|
||||
readonly takePhoto$ = createEffect(() =>
|
||||
this.actions$.pipe(
|
||||
ofType(GorodarActions.takePhoto),
|
||||
exhaustMap(({ landmarkId }) =>
|
||||
from(this.camera.takePhoto()).pipe(
|
||||
map((photo) =>
|
||||
photo
|
||||
? GorodarActions.photoCaptured({ landmarkId, photo })
|
||||
: GorodarActions.photoCancelled(),
|
||||
),
|
||||
catchError(() => of(GorodarActions.photoCancelled())),
|
||||
),
|
||||
),
|
||||
),
|
||||
);
|
||||
|
||||
readonly runCheck$ = createEffect(() =>
|
||||
this.actions$.pipe(
|
||||
ofType(GorodarActions.photoCaptured),
|
||||
switchMap(({ landmarkId, photo }) =>
|
||||
concat(
|
||||
of(GorodarActions.claimStepChanged({ step: 2 })).pipe(delay(6_000)),
|
||||
of(GorodarActions.claimStepChanged({ step: 3 })).pipe(delay(3_000)),
|
||||
of(
|
||||
GorodarActions.claimCompleted({
|
||||
landmarkId,
|
||||
photo,
|
||||
collectedAt: new Date().toISOString(),
|
||||
}),
|
||||
).pipe(delay(1_000)),
|
||||
).pipe(takeUntil(this.actions$.pipe(ofType(GorodarActions.claimReset)))),
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
@@ -0,0 +1,26 @@
|
||||
export type ClaimStage = 'idle' | 'check' | 'success';
|
||||
|
||||
export interface ClaimState {
|
||||
landmarkId: string | null;
|
||||
photo: string | null;
|
||||
stage: ClaimStage;
|
||||
step: number;
|
||||
}
|
||||
|
||||
export interface ProfileState {
|
||||
displayName: string;
|
||||
firstName: string;
|
||||
lastName: string;
|
||||
city: string;
|
||||
email: string;
|
||||
phone: string;
|
||||
joinedLabel: string;
|
||||
}
|
||||
|
||||
export interface GorodarState {
|
||||
collectedIds: string[];
|
||||
photos: Record<string, string>;
|
||||
collectedAt: Record<string, string>;
|
||||
claim: ClaimState;
|
||||
profile: ProfileState;
|
||||
}
|
||||
@@ -0,0 +1,76 @@
|
||||
import { createFeature, createReducer, on } from '@ngrx/store';
|
||||
|
||||
import { GorodarActions } from './gorodar.actions';
|
||||
import type { ClaimState, GorodarState } from './gorodar.models';
|
||||
|
||||
const initialClaim: ClaimState = {
|
||||
landmarkId: null,
|
||||
photo: null,
|
||||
stage: 'idle',
|
||||
step: 1,
|
||||
};
|
||||
|
||||
export const initialState: GorodarState = {
|
||||
collectedIds: [],
|
||||
photos: {},
|
||||
collectedAt: {},
|
||||
claim: initialClaim,
|
||||
profile: {
|
||||
displayName: 'Иван Иванович',
|
||||
firstName: 'Иван',
|
||||
lastName: 'Иванов',
|
||||
city: 'Нижний Новгород',
|
||||
email: 'ivan.ivanovich@gorodar.app',
|
||||
phone: '+7 900 123-45-67',
|
||||
joinedLabel: 'Сентябрь 2026',
|
||||
},
|
||||
};
|
||||
|
||||
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,
|
||||
})),
|
||||
);
|
||||
|
||||
export const gorodarFeature = createFeature({
|
||||
name: 'gorodar',
|
||||
reducer: gorodarReducer,
|
||||
});
|
||||
@@ -0,0 +1,31 @@
|
||||
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 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 selectProgress = createSelector(selectOpenedCount, (opened) =>
|
||||
Math.round((opened / selectTotalCount) * 100),
|
||||
);
|
||||
|
||||
export const selectClaimPhoto = createSelector(selectClaim, (claim) => claim.photo);
|
||||
export const selectClaimStage = createSelector(selectClaim, (claim) => claim.stage);
|
||||
export const selectClaimStep = createSelector(selectClaim, (claim) => claim.step);
|
||||
@@ -0,0 +1,5 @@
|
||||
export { GorodarActions } from './gorodar.actions';
|
||||
export { GorodarEffects } from './gorodar.effects';
|
||||
export { gorodarFeature, initialState } from './gorodar.reducer';
|
||||
export * from './gorodar.models';
|
||||
export * from './gorodar.selectors';
|
||||