Lépj be a Google-fiókoddal. Ha még nincs fiókod, az első belépéskor létrejön.
+
Üdv újra! Lépj be a fiókodba.
{config === null ? (
@@ -60,6 +60,7 @@ export default async function LoginPage({ searchParams }: { searchParams: Promis
A Google-belépés még nincs beállítva (a backend GOOGLE_CLIENT_IDS változója üres).
)}
+
Még nincs fiókod? Az első belépéskor létrejön.
A belépéssel elfogadod, hogy a születési adataidat a képleted kiszámításához tároljuk. Bármikor törölheted
őket a profilodban.
diff --git a/services/frontend/src/app/globals.css b/services/frontend/src/app/globals.css
index 54322bb..5e25197 100644
--- a/services/frontend/src/app/globals.css
+++ b/services/frontend/src/app/globals.css
@@ -143,9 +143,27 @@ td.num { font-variant-numeric: tabular-nums; white-space: nowrap; }
}
.auth-main { flex: 1 1 480px; display: flex; align-items: center; justify-content: center; padding: 48px 24px; }
.auth-box { width: 100%; max-width: 420px; display: flex; flex-direction: column; gap: 28px; }
-.wheel { width: min(380px, 80%); aspect-ratio: 1; margin: 0 auto; }
-.tagline { font-family: var(--font-display); font-size: 36px; font-weight: 600; line-height: 1.1; }
-.gsi-slot { min-height: 44px; display: flex; justify-content: center; }
+.wheel { width: min(440px, 80%); aspect-ratio: 1; margin: 0 auto; }
+.tagline { font-family: var(--font-display); font-size: 38px; font-weight: 600; line-height: 1.1; }
+.auth-foot { font-size: 15px; color: var(--muted); text-align: center; }
+
+/* Social login buttons; Google's own button lies invisibly on top (.gsi-overlay). */
+.social-login { position: relative; }
+.btn-social {
+ position: relative; width: 100%; min-height: 48px; padding: 0 52px;
+ display: flex; align-items: center; justify-content: center; gap: 12px;
+ border: 1px solid var(--line-2); border-radius: var(--radius); background: transparent;
+ color: var(--ink); font: 500 15px var(--font-body);
+}
+.btn-social-icon { position: absolute; left: 16px; top: 50%; margin-top: -10px; width: 20px; height: 20px; display: flex; }
+.social-login:hover .btn-social { border-color: #5a6790; background: rgba(255, 255, 255, 0.03); }
+.social-login:focus-within .btn-social { outline: 2px solid var(--gold); outline-offset: 2px; }
+.social-login[data-ready="false"] .btn-social { opacity: 0.6; }
+.gsi-overlay {
+ position: absolute; inset: 0; display: flex; align-items: center; justify-content: center;
+ opacity: 0.001; overflow: hidden; cursor: pointer;
+}
+.gsi-overlay > div, .gsi-overlay iframe { transform: scale(1.06, 1.2); }
/* Detailed analysis */
.analysis-card { gap: 14px; }
diff --git a/services/frontend/src/components/ZodiacWheel.tsx b/services/frontend/src/components/ZodiacWheel.tsx
index ac36294..051bb2d 100644
--- a/services/frontend/src/components/ZodiacWheel.tsx
+++ b/services/frontend/src/components/ZodiacWheel.tsx
@@ -1,36 +1,74 @@
-// Decorative zodiac wheel for the login page (pure SVG, no data needed).
+// Decorative chart wheel for the login page (pure SVG, sample sky from the design canvas).
-const GLYPHS = ["♈", "♉", "♊", "♋", "♌", "♍", "♎", "♏", "♐", "♑", "♒", "♓"];
-// A few planets of a sample sky, for the aspect lines in the middle.
-const SAMPLE = [12, 75, 131, 200, 247, 302, 338];
+const SIGNS = ["♈", "♉", "♊", "♋", "♌", "♍", "♎", "♏", "♐", "♑", "♒", "♓"];
+const ASC = 182.73;
+const PLANETS: [string, number][] = [
+ ["☉", 53.61],
+ ["☽", 204.02],
+ ["☿", 46.72],
+ ["♀", 62.71],
+ ["♂", 334.49],
+ ["♃", 311.71],
+ ["♄", 80.06],
+ ["♅", 199.7],
+ ["♆", 246.42],
+ ["♇", 181.88],
+];
+// angle, orb, colour, dash (conjunctions are not drawn)
+const ASPECTS: [number, number, string, string | undefined][] = [
+ [0, 7, "", undefined],
+ [60, 5, "#7fb0ff", "1.2 1"],
+ [90, 6, "#f08a4b", undefined],
+ [120, 6, "#7fb0ff", undefined],
+ [180, 7, "#f08a4b", "1.8 1"],
+];
+const VS = "︎"; // text presentation, not emoji
-function point(deg: number, r: number) {
- const t = ((180 - deg) * Math.PI) / 180;
+const norm = (a: number) => ((a % 360) + 360) % 360;
+
+function point(lon: number, r: number) {
+ const t = ((180 + lon - ASC) * Math.PI) / 180;
return { x: 50 + r * Math.cos(t), y: 50 - r * Math.sin(t) };
}
-export function ZodiacWheel({ className }: { className?: string }) {
- const lines: { a: number; b: number; hard: boolean }[] = [];
- SAMPLE.forEach((a, i) =>
- SAMPLE.slice(i + 1).forEach((b) => {
- let d = Math.abs(a - b) % 360;
+/** Glyph positions pushed at least 12° apart. */
+function spread(): { g: string; lon: number; at: number }[] {
+ const out = PLANETS.map(([g, lon]) => ({ g, lon, at: lon })).sort((a, b) => a.at - b.at);
+ for (let it = 0; it < 14; it++) {
+ for (let k = 0; k < out.length; k++) {
+ const a = out[k];
+ const b = out[(k + 1) % out.length];
+ const gap = norm(b.at - a.at);
+ if (gap < 12) {
+ a.at -= (12 - gap) / 2;
+ b.at += (12 - gap) / 2;
+ }
+ }
+ }
+ return out;
+}
+
+function aspectLines() {
+ const lines: { a: number; b: number; color: string; dash?: string }[] = [];
+ PLANETS.forEach(([, a], i) =>
+ PLANETS.slice(i + 1).forEach(([, b]) => {
+ let d = Math.abs(norm(a) - norm(b));
if (d > 180) d = 360 - d;
- if (Math.abs(d - 120) < 8 || Math.abs(d - 60) < 6) lines.push({ a, b, hard: false });
- else if (Math.abs(d - 90) < 7 || Math.abs(d - 180) < 8) lines.push({ a, b, hard: true });
+ const hit = ASPECTS.find(([angle, orb]) => Math.abs(d - angle) <= orb);
+ if (hit && hit[0] > 0) lines.push({ a, b, color: hit[2], dash: hit[3] });
}),
);
+ return lines;
+}
+
+export function ZodiacWheel({ className }: { className?: string }) {
return (
);
--
2.54.0
From 24f9024d245fdf0b559078ec08bbfc2cc0446bcd Mon Sep 17 00:00:00 2001
From: feco
Date: Tue, 17 Nov 2026 06:06:02 +0000
Subject: [PATCH 2/5] CI: deploy only from the prod branch
main builds images tagged with the commit hash and `main`; prod also tags
`prod` and `latest` and deploys. A prod run without DEPLOY_HOST now fails
instead of skipping silently.
Co-Authored-By: Claude Opus 5.5
Claude-Session: https://claude.ai/code/session_012vLHzh5qUhFtmJhzkcTbXL
---
.gitea/workflows/ci.yml | 24 +++++++++++++++++-------
deploy/README.md | 11 ++++++++---
2 files changed, 25 insertions(+), 10 deletions(-)
diff --git a/.gitea/workflows/ci.yml b/.gitea/workflows/ci.yml
index 16b00ce..faf607f 100644
--- a/.gitea/workflows/ci.yml
+++ b/.gitea/workflows/ci.yml
@@ -1,12 +1,14 @@
-# Tests, image build and deployment on every push to main.
+# main: tests and image build (tags: commit hash, `main`).
+# prod: the same, then deployment to the server (tags: commit hash, `prod`, `latest`).
#
# Runs on the self-hosted runner in ci/runner (label `linux`). Jobs use the
-# host's Docker daemon, so image builds share its BuildKit cache.
+# host's Docker daemon, so image builds share its BuildKit cache; a commit
+# already built on main is rebuilt from cache in seconds.
#
# Repository settings (Settings → Actions):
# secrets.REGISTRY_TOKEN Gitea access token with package write access
# secrets.DEPLOY_SSH_KEY private key of the deploy user on the server
-# vars.DEPLOY_HOST user@host of the server; deployment is skipped when unset
+# vars.DEPLOY_HOST user@host of the server
# vars.DEPLOY_KNOWN_HOSTS `ssh-keyscan ` output
# vars.DEPLOY_PATH directory on the server (default /opt/sorsfonalak)
@@ -14,7 +16,7 @@ name: CI
on:
push:
- branches: [main]
+ branches: [main, prod]
workflow_dispatch:
env:
@@ -77,11 +79,16 @@ jobs:
run: |
set -eu
tag=$(echo "${{ github.sha }}" | cut -c1-12)
+ extra="${{ github.ref_name }}"
+ [ "$extra" = prod ] && extra="prod latest"
build() {
image="$IMAGE_PREFIX-$1"; shift
- docker build --label sorsfonalak.ci=1 -t "$image:$tag" -t "$image:latest" "$@"
+ docker build --label sorsfonalak.ci=1 -t "$image:$tag" "$@"
docker push -q "$image:$tag"
- docker push -q "$image:latest"
+ for t in $extra; do
+ docker tag "$image:$tag" "$image:$t"
+ docker push -q "$image:$t"
+ done
}
build horoscope-api -f services/horoscope-api/Dockerfile .
build backend -f services/backend/Dockerfile .
@@ -95,9 +102,12 @@ jobs:
deploy:
needs: build
- if: vars.DEPLOY_HOST != ''
+ if: github.ref == 'refs/heads/prod'
runs-on: linux
steps:
+ - name: Check settings
+ run: |
+ [ -n "${{ vars.DEPLOY_HOST }}" ] || { echo "vars.DEPLOY_HOST is not set (Settings → Actions → Variables)" >&2; exit 1; }
- name: Checkout
run: |
apk add --no-cache -q git openssh-client
diff --git a/deploy/README.md b/deploy/README.md
index 4094442..c179a86 100644
--- a/deploy/README.md
+++ b/deploy/README.md
@@ -1,10 +1,15 @@
# Build és telepítés
-Minden `main`-re pusholt commit után lefut a `.gitea/workflows/ci.yml` (Gitea Actions):
+A `.gitea/workflows/ci.yml` (Gitea Actions) két ágra fut:
+
+- **main**: tesztek, majd image-build. Címkék: a commit hash első 12 karaktere és `main`.
+- **prod**: ugyanez, majd telepítés a szerverre. Címkék: hash, `prod` és `latest`. Élesíteni tehát úgy kell, hogy a main-t a prod-ba mergeled (vagy pusholod).
+
+A lépések:
1. **test**: `cargo test` a backendre, a workerre, a db-re, a horoscope-clientre és a service-kitre, egy Postgres szolgáltatás-konténerrel.
-2. **build**: megépíti a négy image-et, és feltölti őket a `registry.sagifer.com/sagifer/sorsfonalak-` címre. A címke a commit hash első 12 karaktere, plusz `latest`. A frontend buildje a TypeScript-típusokat is ellenőrzi.
-3. **deploy** (csak ha a `DEPLOY_HOST` be van állítva): felmásolja a `docker-compose.yml`-t és a `Caddyfile`-t a szerverre, beírja az új `TAG`-et a szerveren lévő `.env`-be, majd `docker compose pull && up -d`. Az adatbázis-migrációk a backend indulásakor futnak le.
+2. **build**: megépíti a négy image-et, és feltölti őket a `registry.sagifer.com/sagifer/sorsfonalak-` címre. A frontend buildje a TypeScript-típusokat is ellenőrzi. Egy main-en már megépült commit a cache-ből pár mp alatt újraépül.
+3. **deploy** (csak prod): felmásolja a `docker-compose.yml`-t és a `Caddyfile`-t a szerverre, beírja az új `TAG`-et a szerveren lévő `.env`-be, majd `docker compose pull && up -d`. Az adatbázis-migrációk a backend indulásakor futnak le.
Kézzel is indítható a repó Actions oldaláról (workflow_dispatch).
--
2.54.0
From a937b6f0ff5a749edb3bf8639493d801b8c09cf1 Mon Sep 17 00:00:00 2001
From: feco
Date: Tue, 17 Nov 2026 06:11:19 +0000
Subject: [PATCH 3/5] CI: create a tagged Gitea release after every prod
deployment
Tag v-, body lists the commits since the previous
release; skipped when the release already exists (redeploy).
Co-Authored-By: Claude Opus 5.5
Claude-Session: https://claude.ai/code/session_012vLHzh5qUhFtmJhzkcTbXL
---
.gitea/workflows/ci.yml | 24 ++++++++++++++++++++++++
deploy/README.md | 1 +
2 files changed, 25 insertions(+)
diff --git a/.gitea/workflows/ci.yml b/.gitea/workflows/ci.yml
index faf607f..0769418 100644
--- a/.gitea/workflows/ci.yml
+++ b/.gitea/workflows/ci.yml
@@ -135,3 +135,27 @@ jobs:
(grep -q '^TAG=' .env && sed -i 's/^TAG=.*/TAG=$tag/' .env || echo 'TAG=$tag' >> .env) && \
docker compose pull -q && docker compose up -d --remove-orphans --wait && \
docker image prune -f >/dev/null"
+ # A release (and its tag, e.g. v2026.11.17-163612e) for every deployment,
+ # listing the commits since the previous one.
+ - name: Release
+ env:
+ TOKEN: ${{ secrets.GITEA_TOKEN }}
+ API: ${{ github.server_url }}/api/v1/repos/${{ github.repository }}
+ run: |
+ set -eu
+ apk add --no-cache -q curl jq
+ git fetch -q --unshallow --tags origin
+ short=$(echo "${{ github.sha }}" | cut -c1-7)
+ name="v$(date -u +%Y.%m.%d)-$short"
+ if curl -fsS -o /dev/null -H "Authorization: token $TOKEN" "$API/releases/tags/$name" 2>/dev/null; then
+ echo "release $name already exists (redeploy)"; exit 0
+ fi
+ prev=$(git describe --tags --abbrev=0 --match 'v*' HEAD 2>/dev/null || true)
+ if [ -n "$prev" ]; then range="$prev..HEAD"; since="since $prev"; else range="-20 HEAD"; since="(last 20 commits)"; fi
+ changes=$(git log --no-merges --pretty='- %s (%h)' $range)
+ body=$(printf 'Deployed to production on %s UTC.\nImages: `registry.sagifer.com/sagifer/sorsfonalak-*:%s`\n\nChanges %s:\n%s\n' \
+ "$(date -u '+%Y-%m-%d %H:%M')" "$(echo "${{ github.sha }}" | cut -c1-12)" "$since" "$changes")
+ jq -n --arg tag "$name" --arg sha "${{ github.sha }}" --arg body "$body" \
+ '{tag_name: $tag, target_commitish: $sha, name: $tag, body: $body}' \
+ | curl -fsS -X POST -H "Authorization: token $TOKEN" -H 'Content-Type: application/json' -d @- "$API/releases" \
+ | jq -r '"created release " + .name + ": " + .html_url'
diff --git a/deploy/README.md b/deploy/README.md
index c179a86..55d210a 100644
--- a/deploy/README.md
+++ b/deploy/README.md
@@ -10,6 +10,7 @@ A lépések:
1. **test**: `cargo test` a backendre, a workerre, a db-re, a horoscope-clientre és a service-kitre, egy Postgres szolgáltatás-konténerrel.
2. **build**: megépíti a négy image-et, és feltölti őket a `registry.sagifer.com/sagifer/sorsfonalak-` címre. A frontend buildje a TypeScript-típusokat is ellenőrzi. Egy main-en már megépült commit a cache-ből pár mp alatt újraépül.
3. **deploy** (csak prod): felmásolja a `docker-compose.yml`-t és a `Caddyfile`-t a szerverre, beírja az új `TAG`-et a szerveren lévő `.env`-be, majd `docker compose pull && up -d`. Az adatbázis-migrációk a backend indulásakor futnak le.
+4. **release** (csak prod, a deploy után): létrehoz egy `v<év.hónap.nap>-` taget és Gitea-release-t az előző release óta bekerült commitok listájával (repó → Releases).
Kézzel is indítható a repó Actions oldaláról (workflow_dispatch).
--
2.54.0
From 85337f2c79fb0eb18b7c6f1015d0a68a81533f36 Mon Sep 17 00:00:00 2001
From: feco
Date: Tue, 17 Nov 2026 06:17:02 +0000
Subject: [PATCH 4/5] Chart wheel: readable aspect lines
- only the major aspects between the ten planets, ASC and MC (the rest
stays in the aspect table)
- one style per aspect: trine blue, sextile blue dashed, square orange,
opposition red; width and opacity by orb, tight aspects on top
- line ends at the spread-out glyph angles, so neighbouring planets'
lines no longer meet in one point
- hovering or focusing a planet shows only its aspects (CSS :has)
- shared legend, also on the example page
Co-Authored-By: Claude Opus 5.5
Claude-Session: https://claude.ai/code/session_012vLHzh5qUhFtmJhzkcTbXL
---
services/frontend/src/app/globals.css | 23 ++++--
.../frontend/src/app/kepletek/[id]/page.tsx | 7 +-
services/frontend/src/app/pelda/page.tsx | 3 +-
.../frontend/src/components/ChartWheel.tsx | 79 +++++++++++++++----
4 files changed, 84 insertions(+), 28 deletions(-)
diff --git a/services/frontend/src/app/globals.css b/services/frontend/src/app/globals.css
index 5e25197..6c87341 100644
--- a/services/frontend/src/app/globals.css
+++ b/services/frontend/src/app/globals.css
@@ -15,6 +15,7 @@
--ok: #9fd8b0;
--harmonic: #7fb0e0;
--tense: #e38b8b;
+ --square: #f0a35e;
--radius: 10px;
--font-display: var(--font-cormorant), "Cormorant Garamond", Georgia, serif;
--font-body: var(--font-inter), Inter, system-ui, sans-serif;
@@ -195,10 +196,14 @@ td.num { font-variant-numeric: tabular-nums; white-space: nowrap; }
.chart-wheel-card { padding: 16px; gap: 10px; }
.chart-wheel { width: 100%; height: auto; display: block; max-width: 680px; margin: 0 auto; }
.chart-layout .big3 { grid-template-columns: 1fr; }
-.wheel-legend { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; justify-content: center; }
-.legend-line { display: inline-block; width: 22px; height: 2px; border-radius: 1px; margin-left: 6px; }
-.legend-harmonic { background: var(--harmonic); }
-.legend-tense { background: var(--tense); }
+.wheel-legend { display: flex; flex-direction: column; align-items: center; gap: 4px; text-align: center; }
+.wheel-legend-items { display: flex; flex-wrap: wrap; justify-content: center; gap: 4px 16px; }
+.legend-item { display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; }
+.legend-line { display: inline-block; width: 24px; height: 2px; border-radius: 1px; }
+.legend-trine { background: var(--harmonic); }
+.legend-sextile { background: repeating-linear-gradient(90deg, var(--harmonic) 0 5px, transparent 5px 9px); }
+.legend-square { background: var(--square); }
+.legend-opposition { background: var(--tense); }
.aspect-tag { white-space: nowrap; }
.aspect-harmonic { color: var(--harmonic); }
.aspect-tense { color: var(--tense); }
@@ -219,9 +224,13 @@ td.num { font-variant-numeric: tabular-nums; white-space: nowrap; }
.w-axis-label { fill: var(--gold); font: 600 14px var(--font-body); letter-spacing: 0.5px; }
.w-house-num { fill: var(--muted); font: 500 12px var(--font-body); }
.w-aspect { stroke-linecap: round; }
-.w-harmonic { stroke: var(--harmonic); }
-.w-tense { stroke: var(--tense); }
-.w-neutral { stroke: var(--gold); }
+.w-aspect { transition: stroke-opacity 0.15s; }
+.w-asp-trine { stroke: var(--harmonic); }
+.w-asp-sextile { stroke: var(--harmonic); stroke-dasharray: 5 4; }
+.w-asp-square { stroke: var(--square); }
+.w-asp-opposition { stroke: var(--tense); }
+.w-point { outline: none; cursor: default; }
+.w-point:focus-visible .w-point-glyph { fill: var(--gold); }
.w-point-tick { stroke: var(--ink); stroke-width: 1.6; }
.w-leader { stroke: var(--muted); stroke-width: 0.7; stroke-opacity: 0.6; }
.w-point-glyph { fill: var(--ink); font-family: var(--font-symbols); font-size: 22px; }
diff --git a/services/frontend/src/app/kepletek/[id]/page.tsx b/services/frontend/src/app/kepletek/[id]/page.tsx
index 1a6c828..e117e47 100644
--- a/services/frontend/src/app/kepletek/[id]/page.tsx
+++ b/services/frontend/src/app/kepletek/[id]/page.tsx
@@ -5,7 +5,7 @@ import { notFound } from "next/navigation";
import { BigThree, ChartTables } from "@/components/ChartTables";
import { ChartSummary } from "@/components/ChartSummary";
import { DetailedAnalysis } from "@/components/DetailedAnalysis";
-import { ChartWheel } from "@/components/ChartWheel";
+import { ChartWheel, WheelLegend } from "@/components/ChartWheel";
import { ELEMENTS, MODALITIES, MOON_PHASES, countryName, formatBirthDate, pointName } from "@/lib/astro";
import { backendGet, requireMe } from "@/lib/server";
import type { Analysis, Chart } from "@/lib/types";
@@ -59,10 +59,7 @@ export default async function ChartPage({ params }: { params: Promise<{ id: stri
+ );
+}
diff --git a/services/frontend/src/components/ChartSummary.tsx b/services/frontend/src/components/ChartSummary.tsx
index a73d4c7..b971365 100644
--- a/services/frontend/src/components/ChartSummary.tsx
+++ b/services/frontend/src/components/ChartSummary.tsx
@@ -5,6 +5,7 @@ import { useEffect, useState } from "react";
import { api } from "@/lib/api";
import type { Analysis } from "@/lib/types";
+import { AnalysisLoading } from "./AnalysisLoading";
import { Rich } from "./Rich";
const POLL_MS = 3000;
@@ -62,17 +63,12 @@ export function ChartSummary({ chartId, initial }: { chartId: string; initial: A
Rövid összefoglaló
-
- {gaveUp || summary?.status === "failed"
- ? "Az összefoglaló most nem készült el. Töltsd újra az oldalt egy kicsit később."
- : "Az összefoglalód készül, ez néhány másodperc…"}
-
- {!gaveUp && summary?.status !== "failed" && (
-
-
-
-
-
+ {gaveUp || summary?.status === "failed" ? (
+
+ Az összefoglaló most nem készült el. Töltsd újra az oldalt egy kicsit később.
+
Vastagabb vonal: szorosabb fényszög. Egy bolygóra mutatva csak az ő fényszögei látszanak.
+
Vastagabb vonal: szorosabb fényszög.
A körön a bolygók, az ASC és az MC főfényszögei vannak; az összes fényszög a táblázatban.
);
diff --git a/services/frontend/src/components/DetailedAnalysis.tsx b/services/frontend/src/components/DetailedAnalysis.tsx
index 3f19ef5..5d9f949 100644
--- a/services/frontend/src/components/DetailedAnalysis.tsx
+++ b/services/frontend/src/components/DetailedAnalysis.tsx
@@ -6,27 +6,35 @@ import { useEffect, useState } from "react";
import { api, errorText } from "@/lib/api";
import type { Analysis } from "@/lib/types";
+import { AnalysisLoading } from "./AnalysisLoading";
import { AnalysisView } from "./AnalysisView";
const POLL_MS = 5000;
const MAX_POLLS = 120; // 10 minutes
+type Step = "offer" | "confirm" | "pay";
+
/**
- * The paid detailed analysis of a chart: offer (with the units left),
- * confirmation, progress while the worker writes it, and the finished text.
+ * The detailed analysis of a chart. A saved one is shown at once; otherwise
+ * the offer: admins start it free, users with units confirm, others pay
+ * (a stand-in payment for now). While the worker writes it, a loading wheel.
*/
export function DetailedAnalysis({
chartId,
initial,
left,
+ isAdmin,
+ canPay,
}: {
chartId: string;
initial: Analysis | null;
left: number;
+ isAdmin: boolean;
+ /** The stand-in payment is on (MOCK_PAYMENTS). */
+ canPay: boolean;
}) {
const [analysis, setAnalysis] = useState(initial);
- const [remaining, setRemaining] = useState(left);
- const [confirming, setConfirming] = useState(false);
+ const [step, setStep] = useState("offer");
const [busy, setBusy] = useState(false);
const [error, setError] = useState(null);
const waiting = analysis?.status === "pending" || analysis?.status === "running";
@@ -54,14 +62,13 @@ export function DetailedAnalysis({
};
}, [waiting, analysis]);
- async function request() {
+ async function start(pay: boolean) {
setBusy(true);
setError(null);
try {
- const next = await api(`/charts/${chartId}/analyses`, { method: "POST" });
- setAnalysis(next);
- if (next.credits_charged > 0) setRemaining((n) => n - 1);
- setConfirming(false);
+ if (pay) await api("/payments/mock", { body: { unit: "natal" } });
+ setAnalysis(await api(`/charts/${chartId}/analyses`, { method: "POST" }));
+ setStep("offer");
} catch (e) {
setError(errorText(e));
} finally {
@@ -78,67 +85,97 @@ export function DetailedAnalysis({
);
}
+ if (waiting) {
+ return (
+
+ Részletes elemzés
+
+
+ );
+ }
+
return (
-
+ Részletes elemzés
- {waiting ? (
- <>
-
Készül az elemzésed
-
- A mesterséges intelligencia most írja meg a hat fejezetet a képleted alapján. Ez általában 1–2 perc; nyugodtan
- elhagyhatod az oldalt, az elemzés elkészül és itt vár.
-
-
-
-
-
+
Az egész képleted, fejezetekre bontva
+
+ Kb. 1500 szó hat fejezetben: személyiség, érzelmek, gondolkodás, szerelem és kapcsolatok, hivatás, fejlődési út.
+ A végén erősségek, kihívások és útravaló. Csak a képleted pozíciói alapján készül.
+
+ {analysis?.status === "failed" && (
+
+ Az előző kérés nem sikerült{isAdmin ? "" : ", az elemzést visszaadtuk a keretedbe"}. Próbáld újra.
+
+ )}
+ {error && (
+
+ {error}
+
+ )}
+
+ {isAdmin ? (
+
+
+ Adminként ingyenes.
+
+ ) : left > 0 ? (
+ step === "confirm" ? (
+
+
+
+ Ez felhasznál 1-et a {left} képletelemzésedből.
- >
- ) : (
- <>
-
Az egész képleted, fejezetekre bontva
-
- Kb. 1500 szó hat fejezetben: személyiség, érzelmek, gondolkodás, szerelem és kapcsolatok, hivatás, fejlődési
- út. A végén erősségek, kihívások és útravaló. Csak a képleted pozíciói alapján készül.
-
- {analysis?.status === "failed" && (
-
- Az előző kérés nem sikerült, az elemzést visszaadtuk a keretedbe. Próbáld újra.
-
- )}
- {error && (
-
- {error}
-
- )}
- {remaining > 0 ? (
- confirming ? (
-
-
-
- Ez felhasznál 1-et a {remaining} képletelemzésedből.
-
- ) : (
-
-
- Még {remaining} képletelemzésed van.
-
- )
- ) : (
-
-
- Példa megtekintése
-
- A részletes elemzés fizetős; a csomagok hamarosan elérhetők.
+ ) : (
+
+
+ Még {left} képletelemzésed van.
+
+ )
+ ) : canPay ? (
+ step === "pay" ? (
+
+
+ Részletes képletelemzés
+ 1 db
- )}
- >
+
+
+
+
+
Tesztüzem: a fizetés még nincs bekötve, a gomb nem terhel semmit.
+
+ ) : (
+
+
+
+ Példa megtekintése
+
+
+ )
+ ) : (
+
+
+ Példa megtekintése
+
+ A részletes elemzés fizetős; a csomagok hamarosan elérhetők.
+
)}
);
diff --git a/services/frontend/src/lib/types.ts b/services/frontend/src/lib/types.ts
index 7f5cc1d..12cfe8f 100644
--- a/services/frontend/src/lib/types.ts
+++ b/services/frontend/src/lib/types.ts
@@ -17,6 +17,14 @@ export interface Me {
providers: string[];
primary_chart_id: string | null;
analyses_left: UnitBalance;
+ birth_change: BirthChange;
+}
+
+/** Limit on changing the own birth data (the notice text comes from the backend). */
+export interface BirthChange {
+ limited: boolean;
+ next_change_at: string | null;
+ notice: string | null;
}
/** Detailed analyses left, per kind. */
@@ -32,6 +40,7 @@ export interface PublicConfig {
summary_model: string;
password_login: boolean;
password_min_length: number;
+ mock_payments: boolean;
}
export interface Position {
--
2.54.0