diff --git a/index.html b/index.html index 738778e..f4576c4 100644 --- a/index.html +++ b/index.html @@ -6,13 +6,25 @@ - تدریسینو + + + + -
+
+
تدریسینو
+
diff --git a/public/app-icon.png b/public/app-icon.png new file mode 100644 index 0000000..a4ad595 Binary files /dev/null and b/public/app-icon.png differ diff --git a/src/app/App.tsx b/src/app/App.tsx index 8faaf74..2900199 100644 --- a/src/app/App.tsx +++ b/src/app/App.tsx @@ -1,4 +1,4 @@ -import { useCallback, useEffect, useRef, useState } from 'react'; +import { useCallback, useEffect, useState } from 'react'; import { AnimatePresence, MotionConfig, motion } from 'motion/react'; import { api, ApiError, http, type Grade, type UserProfile } from '@/api'; import type { Prefetch } from '@/state/AppData'; @@ -24,22 +24,11 @@ type Flow = | { kind: 'main'; profile: UserProfile; grades: Grade[]; prefetch?: Prefetch }; /** - * اسپلش فقط وقتی نشان داده می‌شود که سرور دیرتر از SPLASH_DELAY_MS جواب بدهد؛ اگر زودتر رسید، کاربر - * اسپلش را نمی‌بیند و مستقیم به صفحه‌ی بعدی می‌رود (به‌جای چند صد میلی‌ثانیه چشمک). - * اگر یک بار نشان داده شد، دست‌کم SPLASH_MIN_MS می‌ماند تا خودش چشمک نزند. - * تا آن لحظه فقط پس‌زمینه‌ی هم‌رنگِ اسپلش دیده می‌شود، نه صفحه‌ی سفید. - */ -const SPLASH_DELAY_MS = 350; -const SPLASH_MIN_MS = 700; - -/** - * جریانِ ورود: اسپلش → (معرفی، فقط بارِ اول) → ورود → تکمیلِ پروفایل → اپ. + * جریانِ ورود: اسپلشِ ثابت (تا بررسیِ نشست) → (معرفی، فقط بارِ اول) → ورود → تکمیلِ پروفایل → اپ. * خودِ اپ (تب‌ها و صفحه‌ها) در MainApp است. */ export function App() { const [flow, setFlow] = useState({ kind: 'boot' }); - const [splashVisible, setSplashVisible] = useState(false); - const splashShownAt = useRef(null); /** پروفایل و پایه‌ها را می‌گیرد و تصمیم می‌گیرد کاربر کجا برود. */ const enter = useCallback(async () => { @@ -53,12 +42,6 @@ export function App() { const boot = useCallback(async () => { setFlow({ kind: 'boot' }); - splashShownAt.current = null; - setSplashVisible(false); - const timer = setTimeout(() => { - splashShownAt.current = Date.now(); - setSplashVisible(true); - }, SPLASH_DELAY_MS); let next: Flow | null = null; if (api.auth.isSignedIn()) { try { @@ -72,13 +55,6 @@ export function App() { } else { next = store.get(KEYS.onboarded) ? { kind: 'login' } : { kind: 'onboarding' }; } - clearTimeout(timer); - // اسپلش دیده شده؟ فقط در آن صورت تا کمینه‌ی زمانش نگه دار. - const shownAt = splashShownAt.current; - if (shownAt !== null) { - const wait = SPLASH_MIN_MS - (Date.now() - shownAt); - if (wait > 0) await new Promise((r) => setTimeout(r, wait)); - } if (next) setFlow(next); }, [enter]); @@ -110,17 +86,17 @@ export function App() { - + - {flow.kind === 'boot' && } + {flow.kind === 'boot' && } {flow.kind === 'bootError' && (
void boot()} /> diff --git a/src/screens/SplashScreen.tsx b/src/screens/SplashScreen.tsx index 65b578f..cac9948 100644 --- a/src/screens/SplashScreen.tsx +++ b/src/screens/SplashScreen.tsx @@ -1,45 +1,13 @@ -import { motion } from 'motion/react'; -import { SeyarMascot } from '@/mascots/SeyarMascot'; -import { BrandMark } from '@/components/BrandMark'; - -/** نمادهای ریاضی که آرام از پایینِ صفحه بالا می‌روند؛ فقط CSS (transform/opacity)، بی‌بارِ اضافه. */ -const GLYPHS = [ - { c: 'π', x: 12, d: 0 }, { c: '+', x: 28, d: 2.6 }, { c: '√', x: 46, d: 1.2 }, - { c: '÷', x: 64, d: 3.8 }, { c: '∑', x: 80, d: 0.6 }, { c: '×', x: 90, d: 4.6 }, -]; - /** - * تا وقتی نشستِ قبلی بررسی می‌شود نمایش داده می‌شود. `showContent=false` فقط پس‌زمینه است؛ App - * محتوا را فقط وقتی روشن می‌کند که پاسخِ سرور دیر کرده باشد. + * اسپلشِ ثابت: آیکونِ اپ و نام، بی‌انیمیشن و بی‌همراه (همراهِ انتخابی هنوز معلوم نیست و تکرارش + * بد است). عینِ `.boot-splash` در index.html است تا تحویل از HTML به React دیده نشود؛ استایلش + * هم آن‌جا است چون باید پیش از رسیدنِ CSS و JS کار کند. */ -export function SplashScreen({ showContent }: { showContent: boolean }) { - if (!showContent) return
; +export function SplashScreen() { return ( -
- - -
- -
- -

ریاضی، قدم‌به‌قدم، از روی کتابِ درسی

-
- +
+ + تدریسینو
); } diff --git a/src/styles/index.css b/src/styles/index.css index 5ae878c..cd7daa0 100644 --- a/src/styles/index.css +++ b/src/styles/index.css @@ -117,8 +117,6 @@ .shine { animation: shine 3.2s ease-in-out infinite; will-change: transform; } @keyframes spark { 0%, 100% { opacity: .25; transform: scale(.7); } 50% { opacity: 1; transform: scale(1); } } .spark { animation: spark 2.4s ease-in-out infinite; transform-box: fill-box; transform-origin: center; } -@keyframes rise { 0% { transform: translateY(16px); opacity: 0; } 15%, 85% { opacity: .55; } 100% { transform: translateY(-110px); opacity: 0; } } -.rise { animation: rise 7s linear infinite; will-change: transform, opacity; } /* نوارِ انتظارِ میانِ دو صفحه (MainApp → HoldBar). */ @keyframes hold-bar { 0% { transform: translateX(120%); } 100% { transform: translateX(-320%); } }