feat(v2): 9–10 Ekim çalışma ağacı — deneyim dili 1. dalga, PWA manifest, revizyon niyet modeli, listem/tadımlık bileşen denetimi
9–10 Ekim oturumlarının commit'lenmemiş işi tek parça alındı (raporlar: docs/ekip-raporlari/2026-10-09, 2026-10-10): - Landing deneyim dili 1. dalga: sayfa geçişi (ViewTransition), piksel morf/şerit, sorun sahneleri, adım akışı, sayan sayı, mobil menü, adım göstergesi, logoya tepki; DESIGN.md §11 ve AGENTS.md kuralları, tasarım denetimine yeni kurallar - Tema: tema ikonu, D kısayolu, tema geçişi - PWA: manifest.ts ve ikonlar - Danışman: revizyon niyet modeli (OPENROUTER_NIYET_MODEL), sohbet geçmişi, soru API'si - /listem ve /sonuc tadımlığı bileşen denetimi düzeltmeleri - eslint: .venv-tts/ yok sayılır tsc, eslint ve tasarım denetimi sıfır hata. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
This commit is contained in:
@@ -43,6 +43,8 @@ import {
|
||||
DialogTitle,
|
||||
} from "@/components/ui/dialog";
|
||||
import { Kbd, KbdGroup } from "@/components/ui/kbd";
|
||||
import { SayiRulo } from "@/components/ui/sayi-rulo";
|
||||
import { ARAMA_AC_OLAYI } from "@/components/mobil-menu";
|
||||
import { ProgressiveBlur } from "@/components/ui/skiper-ui/skiper41";
|
||||
|
||||
type BolumSonucu = {
|
||||
@@ -172,6 +174,13 @@ export function KatalogArama({ rehberler }: { rehberler: RehberAramaKaydi[] }) {
|
||||
// modal her açılıp kapandığında remove/add döngüsü dönmesin
|
||||
// (client-event-listeners)
|
||||
const kisayolTetiklendi = useEffectEvent(() => modalDegisti(!acik));
|
||||
// Telefon menüsündeki "Ara" hapı (mobil-menu.tsx) pencereyi olayla açtırır.
|
||||
const aramaIstendi = useEffectEvent(() => modalDegisti(true));
|
||||
useEffect(() => {
|
||||
window.addEventListener(ARAMA_AC_OLAYI, aramaIstendi);
|
||||
return () => window.removeEventListener(ARAMA_AC_OLAYI, aramaIstendi);
|
||||
}, []);
|
||||
|
||||
useEffect(() => {
|
||||
function kisayolDinle(event: KeyboardEvent) {
|
||||
if ((event.metaKey || event.ctrlKey) && event.key.toLowerCase() === "k") {
|
||||
@@ -279,9 +288,7 @@ export function KatalogArama({ rehberler }: { rehberler: RehberAramaKaydi[] }) {
|
||||
>
|
||||
<Trophy className="size-4 shrink-0 text-orange-500" aria-hidden />
|
||||
<span className="font-semibold tracking-tight text-slate-900">
|
||||
<span className="tabular-nums">
|
||||
{profil.sira.toLocaleString("tr-TR")}
|
||||
</span>
|
||||
<SayiRulo deger={profil.sira} className="tabular-nums" />
|
||||
<span className="font-medium text-slate-500">
|
||||
{" "}
|
||||
· {PUAN_TURU_ETIKET[profil.tur] ?? profil.tur}
|
||||
@@ -331,58 +338,42 @@ export function KatalogArama({ rehberler }: { rehberler: RehberAramaKaydi[] }) {
|
||||
</button>
|
||||
</nav>
|
||||
|
||||
{/* lg altında 2. satır: sıralama + ara (header flex-wrap + order-3) */}
|
||||
<div className="order-3 flex w-full basis-full items-center gap-1.5 lg:hidden">
|
||||
{profil ? (
|
||||
<button
|
||||
type="button"
|
||||
onClick={profilDuzenlemeyiAc}
|
||||
onPointerEnter={preloadTercihProfiliKapisi}
|
||||
onFocus={preloadTercihProfiliKapisi}
|
||||
aria-label={`Sıralamanı ve tercihlerini değiştir (${profil.sira.toLocaleString("tr-TR")} · ${PUAN_TURU_ETIKET[profil.tur] ?? profil.tur})`}
|
||||
className="flex h-9 min-w-0 flex-1 cursor-pointer items-center gap-1.5 rounded-full border border-slate-200 bg-card py-1 pl-2.5 pr-1.5 text-xs font-semibold text-slate-900 transition-[background-color,transform] duration-150 hover:bg-slate-100 active:scale-[0.96] sm:h-12 sm:gap-2 sm:pl-3.5 sm:pr-2 sm:text-sm"
|
||||
>
|
||||
<Trophy
|
||||
className="size-3.5 shrink-0 text-orange-500 sm:size-4"
|
||||
aria-hidden
|
||||
/>
|
||||
<span className="truncate tracking-tight">
|
||||
<span className="tabular-nums">
|
||||
{profil.sira.toLocaleString("tr-TR")}
|
||||
</span>
|
||||
<span className="font-medium text-slate-500">
|
||||
{" "}
|
||||
· {PUAN_TURU_ETIKET[profil.tur] ?? profil.tur}
|
||||
</span>
|
||||
</span>
|
||||
<span className="inline-flex shrink-0 items-center gap-1 rounded-full bg-slate-100 px-2 py-0.5 text-xs font-medium text-slate-500">
|
||||
<SquarePen className="size-3" aria-hidden />
|
||||
Değiştir
|
||||
</span>
|
||||
</button>
|
||||
) : (
|
||||
<button
|
||||
type="button"
|
||||
onClick={siralamaGirVeyaSonucaGit}
|
||||
onPointerEnter={preloadTercihProfiliKapisi}
|
||||
onFocus={preloadTercihProfiliKapisi}
|
||||
aria-label="Başarı sıralamanı gir"
|
||||
className="flex h-9 min-w-0 flex-1 cursor-pointer items-center gap-1.5 rounded-full border border-slate-200 bg-card py-1 pl-2.5 pr-2.5 text-xs font-semibold text-slate-900 transition-[background-color,transform] duration-150 hover:bg-slate-100 active:scale-[0.96] sm:h-12 sm:gap-2 sm:pl-3.5 sm:pr-3 sm:text-sm"
|
||||
>
|
||||
<Trophy
|
||||
className="size-3.5 shrink-0 text-orange-500 sm:size-4"
|
||||
aria-hidden
|
||||
/>
|
||||
<span className="truncate">Sıralama gir</span>
|
||||
</button>
|
||||
)}
|
||||
{/* lg altı: tek satırın ortasındaki sıralama hapı (DESIGN.md §4.36).
|
||||
Arama ve geri kalan her şey sağdaki baloncuk menüde. Sayfa başlığı
|
||||
çubuğa çıkınca (NavBaslik) hap yalnız kupaya iner, başlığa yer açar. */}
|
||||
<div className="order-2 flex shrink-0 items-center lg:hidden">
|
||||
<button
|
||||
type="button"
|
||||
onClick={() => modalDegisti(true)}
|
||||
aria-label="Bölüm, üniversite veya rehber ara"
|
||||
className="flex size-9 shrink-0 cursor-pointer items-center justify-center rounded-full border border-slate-200 bg-card text-slate-700 transition-[background-color,transform] duration-150 hover:bg-slate-100 active:scale-[0.96] sm:size-12"
|
||||
onClick={profil ? profilDuzenlemeyiAc : siralamaGirVeyaSonucaGit}
|
||||
onPointerEnter={preloadTercihProfiliKapisi}
|
||||
onFocus={preloadTercihProfiliKapisi}
|
||||
aria-label={
|
||||
profil
|
||||
? `Sıralamanı ve tercihlerini değiştir (${profil.sira.toLocaleString("tr-TR")} · ${PUAN_TURU_ETIKET[profil.tur] ?? profil.tur})`
|
||||
: "Başarı sıralamanı gir"
|
||||
}
|
||||
className="flex h-9 max-w-40 cursor-pointer items-center gap-1.5 rounded-full border border-slate-200 bg-card px-2.5 text-xs font-semibold text-slate-900 transition-[background-color,transform] duration-150 hover:bg-slate-100 active:scale-[0.96] motion-reduce:transition-none sm:h-12 sm:max-w-none sm:gap-2 sm:px-4 sm:text-sm"
|
||||
>
|
||||
<Search className="size-4" aria-hidden />
|
||||
<Trophy className="size-3.5 shrink-0 text-orange-500 sm:size-4" aria-hidden />
|
||||
<span className="truncate tracking-tight in-data-[nav-baslik]:hidden">
|
||||
{profil ? (
|
||||
<>
|
||||
<SayiRulo deger={profil.sira} className="tabular-nums" />
|
||||
<span className="hidden font-medium text-slate-500 sm:inline">
|
||||
{" "}
|
||||
· {PUAN_TURU_ETIKET[profil.tur] ?? profil.tur}
|
||||
</span>
|
||||
</>
|
||||
) : (
|
||||
"Sıralama gir"
|
||||
)}
|
||||
</span>
|
||||
{profil ? (
|
||||
<SquarePen
|
||||
className="size-3 shrink-0 text-slate-400 in-data-[nav-baslik]:hidden"
|
||||
aria-hidden
|
||||
/>
|
||||
) : null}
|
||||
</button>
|
||||
</div>
|
||||
|
||||
|
||||
@@ -55,6 +55,7 @@ import {
|
||||
AcilisSahnesi,
|
||||
LOGO_SLOTLARI,
|
||||
logoKareStili,
|
||||
LOGO_KAP_BOYU,
|
||||
} from "@/components/ui/acilis-sahnesi";
|
||||
import {
|
||||
Table,
|
||||
@@ -183,7 +184,15 @@ export function ProgramAyrintiButonu({
|
||||
<span className="sr-only">Kapat</span>
|
||||
</AltSayfaKapat>
|
||||
<AltSayfaGovde className="px-4 pt-3 pb-[max(1.25rem,env(safe-area-inset-bottom))] sm:px-6">
|
||||
<AltSayfaBaslik className="px-10 text-center font-heading text-2xl font-bold text-slate-900">
|
||||
{/* Başlık veri gelene dek görünmez: logo kareleri küçülüp buraya
|
||||
uçar, yazı onlardan netleşir (AcilisSahnesi `data-logo-hedef`). */}
|
||||
<AltSayfaBaslik
|
||||
data-logo-hedef
|
||||
className={cn(
|
||||
"px-10 text-center font-heading text-2xl font-bold text-slate-900",
|
||||
(durum === "bekliyor" || durum === "yukleniyor") && "opacity-0",
|
||||
)}
|
||||
>
|
||||
{isim}
|
||||
</AltSayfaBaslik>
|
||||
<AltSayfaAciklama className="mx-auto mt-1 max-w-md px-4 text-center text-sm text-slate-500">
|
||||
@@ -226,14 +235,20 @@ function AyrintiIcerik({ durum, veri }: { durum: Durum; veri: ProgramAyrintisi |
|
||||
</p>
|
||||
);
|
||||
}
|
||||
// Sıra = AcilisSahnesi'nin `data-sonra` sırası: logo söner, bloklar
|
||||
// yukarıdan aşağıya 0,05 s arayla netleşir.
|
||||
// Sıra = AcilisSahnesi'nin `data-sonra` sırası: logo küçülerek başlığa
|
||||
// dönüşür, bloklar yukarıdan aşağıya 0,05 s arayla netleşir.
|
||||
return (
|
||||
<>
|
||||
{/* Logo kareleri: sahne sırasında görünür, sönünce kap sıfır boya iner. */}
|
||||
<div data-logo className="relative mx-auto h-16 w-16" aria-hidden>
|
||||
{/* Logo kareleri: sahne sırasında görünür, küçülerek başlığa uçar; kap
|
||||
sıfır boya iner. */}
|
||||
<div data-logo className="relative mx-auto size-44" aria-hidden>
|
||||
{LOGO_SLOTLARI.map((slot) => (
|
||||
<span key={slot} data-logo-kare={slot} className="absolute" style={logoKareStili(slot)} />
|
||||
<span
|
||||
key={slot}
|
||||
data-logo-kare={slot}
|
||||
className="absolute"
|
||||
style={logoKareStili(slot, LOGO_KAP_BOYU)}
|
||||
/>
|
||||
))}
|
||||
</div>
|
||||
<Kunye veri={veri} />
|
||||
|
||||
@@ -33,7 +33,7 @@ import { Button } from "@/components/ui/button";
|
||||
*/
|
||||
const AUTH_GUVENLI_YOL = /^\/(?!\/|\\)[\w\-./+@]*$/;
|
||||
|
||||
export function GirisLinki() {
|
||||
export function GirisLinki({ menu = false }: { /** Telefon menüsündeki iri hap (DESIGN.md §4.36). */ menu?: boolean }) {
|
||||
const pathname = usePathname();
|
||||
// /giris kendine callback veremez (döngü); pathname yoksa sade hedef.
|
||||
const href =
|
||||
@@ -44,7 +44,11 @@ export function GirisLinki() {
|
||||
return (
|
||||
<Button
|
||||
asChild
|
||||
className="h-9 cursor-pointer rounded-full bg-slate-900 px-3.5 text-sm font-medium text-slate-50 transition-colors duration-200 hover:bg-slate-700 sm:h-12 sm:px-7 sm:text-base"
|
||||
className={
|
||||
menu
|
||||
? "h-14 w-full max-w-xs cursor-pointer rounded-full bg-slate-900 px-8 font-heading text-xl font-bold text-slate-50 transition-[background-color,transform] duration-200 hover:bg-slate-700 active:scale-[0.97]"
|
||||
: "h-9 cursor-pointer rounded-full bg-slate-900 px-3.5 text-sm font-medium text-slate-50 transition-colors duration-200 hover:bg-slate-700 sm:h-12 sm:px-7 sm:text-base"
|
||||
}
|
||||
>
|
||||
<Link href={href}>Giriş yap</Link>
|
||||
</Button>
|
||||
|
||||
@@ -5,8 +5,23 @@ import { LogOut } from "lucide-react";
|
||||
import { authClient } from "@/lib/auth-client";
|
||||
import { Button } from "@/components/ui/button";
|
||||
|
||||
export function SignOutButton() {
|
||||
export function SignOutButton({ menu = false }: { /** Telefon menüsündeki yazılı hap (DESIGN.md §4.36). */ menu?: boolean }) {
|
||||
const router = useRouter();
|
||||
if (menu) {
|
||||
return (
|
||||
<Button
|
||||
variant="ghost"
|
||||
className="h-12 cursor-pointer rounded-full border border-slate-200 bg-card px-6 text-base font-semibold text-slate-700 transition-[background-color,transform] duration-200 hover:bg-slate-50 active:scale-[0.97]"
|
||||
onClick={async () => {
|
||||
await authClient.signOut();
|
||||
router.refresh();
|
||||
}}
|
||||
>
|
||||
<LogOut className="size-4" aria-hidden />
|
||||
Çıkış yap
|
||||
</Button>
|
||||
);
|
||||
}
|
||||
return (
|
||||
<Button
|
||||
size="sm"
|
||||
|
||||
@@ -7,6 +7,7 @@ import { ListeSenkron } from "@/features/liste/components/liste-senkron";
|
||||
import { RybbitIdentify } from "@/components/rybbit-identify";
|
||||
import { GirisLinki } from "./giris-linki";
|
||||
import { SignOutButton } from "./sign-out-button";
|
||||
import { MobilMenu } from "@/components/mobil-menu";
|
||||
|
||||
/**
|
||||
* Suspense fallback'i: girişsiz görünümle aynı yükseklik/genişlikte sessiz
|
||||
@@ -15,10 +16,11 @@ import { SignOutButton } from "./sign-out-button";
|
||||
export function UserNavFallback() {
|
||||
return (
|
||||
<div
|
||||
className="order-2 flex shrink-0 items-center gap-1.5 sm:gap-2"
|
||||
className="order-3 flex shrink-0 items-center gap-1.5 sm:gap-2"
|
||||
aria-hidden
|
||||
>
|
||||
<div className="h-9 w-16 rounded-full bg-slate-900/10 sm:h-12 sm:w-28" />
|
||||
{/* lg altı: menü baloncuğunun yeri; lg+: "Giriş yap" hapının yeri */}
|
||||
<div className="size-9 rounded-full bg-slate-900/10 sm:size-12 lg:h-12 lg:w-28" />
|
||||
</div>
|
||||
);
|
||||
}
|
||||
@@ -29,19 +31,29 @@ export async function UserNav() {
|
||||
// Manuel liste localStorage'ta yaşadığı için Listem girişsiz de çalışır
|
||||
if (!u) {
|
||||
return (
|
||||
<div className="order-2 flex shrink-0 items-center gap-1.5 sm:gap-2">
|
||||
<div className="order-3 flex shrink-0 items-center gap-1.5 sm:gap-2">
|
||||
<RybbitIdentify kullaniciId={null} />
|
||||
<ListeSenkron userId={null} />
|
||||
<ListemButonu />
|
||||
<GirisLinki />
|
||||
{/* lg altında her şey baloncuk menüde (DESIGN.md §4.36) */}
|
||||
<div className="hidden items-center gap-2 lg:flex">
|
||||
<ListemButonu />
|
||||
<GirisLinki />
|
||||
</div>
|
||||
<div className="lg:hidden">
|
||||
<MobilMenu kredi={null} girisSlotu={<GirisLinki menu />} />
|
||||
</div>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
|
||||
return (
|
||||
<div className="order-2 flex shrink-0 items-center gap-1.5 sm:gap-2">
|
||||
<div className="order-3 flex shrink-0 items-center gap-1.5 sm:gap-2">
|
||||
<RybbitIdentify kullaniciId={u.id} />
|
||||
<ListeSenkron userId={u.id} />
|
||||
<div className="lg:hidden">
|
||||
<MobilMenu kredi={u.creditBalance} girisSlotu={<SignOutButton menu />} />
|
||||
</div>
|
||||
<div className="hidden items-center gap-2 lg:flex">
|
||||
<ListemButonu />
|
||||
{/* Yapay Zeka raporunun kalıcı kapısı: girişli kullanıcı /listem'i
|
||||
navbar'dan bulamıyordu (çekmece butonu manuel liste boşken hiç
|
||||
@@ -79,6 +91,7 @@ export async function UserNav() {
|
||||
<span className="hidden md:inline lg:hidden">kredi</span>
|
||||
</Link>
|
||||
<SignOutButton />
|
||||
</div>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
|
||||
@@ -21,8 +21,8 @@ export function preloadListeCekmecesi() {
|
||||
export function ListeCekmecesiLazy() {
|
||||
const acik = useCekmeceAcik();
|
||||
const liste = useManuelListe();
|
||||
// "+" uçuş animasyon katmanı da çekmece modülünde yaşadığı için liste
|
||||
// doluysa (çekmece kapalı olsa da) mount kalır; yalnızca boş+kapalı durumda
|
||||
// atlanır — ilk ziyaretin en yaygın hâli.
|
||||
// Liste doluysa çekmece kapalıyken de mount kalır (açılış gecikmesin);
|
||||
// yalnız boş+kapalı durumda atlanır — ilk ziyaretin en yaygın hâli.
|
||||
// ("+" uçuşu ayrı katmanda: ucus-katmani.tsx.)
|
||||
return acik || liste.length > 0 ? <ListeCekmecesiIc /> : null;
|
||||
}
|
||||
|
||||
@@ -16,10 +16,17 @@ import {
|
||||
* Liste localStorage'da yaşadığı için hidrasyondan önce yer tutucu çizilir,
|
||||
* satır zıplamasın.
|
||||
*/
|
||||
export function ListeDurumuSatiri() {
|
||||
export function ListeDurumuSatiri({
|
||||
varyant = "sayfa",
|
||||
}: {
|
||||
/** "hero": ana sayfada yalnız liste doluyken görünür, her genişlikte ortalı. */
|
||||
varyant?: "sayfa" | "hero";
|
||||
}) {
|
||||
const hidre = useListeHidreMi();
|
||||
const liste = useManuelListe();
|
||||
const hero = varyant === "hero";
|
||||
|
||||
if (hero && (!hidre || liste.length === 0)) return null;
|
||||
if (!hidre) return <div className="mt-5 h-11" aria-hidden />;
|
||||
|
||||
if (liste.length === 0) {
|
||||
@@ -36,7 +43,7 @@ export function ListeDurumuSatiri() {
|
||||
|
||||
const kalan = MANUEL_LISTE_MAX - liste.length;
|
||||
return (
|
||||
<div className="mt-5 flex justify-center lg:justify-start">
|
||||
<div className={hero ? "mt-4 flex justify-center" : "mt-5 flex justify-center lg:justify-start"}>
|
||||
<button
|
||||
type="button"
|
||||
onClick={cekmeceAc}
|
||||
|
||||
@@ -4,7 +4,10 @@
|
||||
// taşır, tıklanınca çekmeceyi açar/kapatır. ("Listem" adı Yapay Zeka raporunun
|
||||
// yaşadığı /listem sayfasına aittir — isim çakışmasın.)
|
||||
|
||||
import { motion, useReducedMotion } from "motion/react";
|
||||
import { ListChecks } from "lucide-react";
|
||||
import { YAY } from "@/lib/hareket";
|
||||
import { cn } from "@/lib/utils";
|
||||
import { SayiRulo } from "@/components/ui/sayi-rulo";
|
||||
import {
|
||||
MANUEL_LISTE_MAX,
|
||||
@@ -18,9 +21,10 @@ export function ListemButonu() {
|
||||
const liste = useManuelListe();
|
||||
const acik = useCekmeceAcik();
|
||||
|
||||
// Liste boşken buton gürültü: tabloya (+) ulaşmamış ziyaretçiye "0/24"
|
||||
// bir şey ifade etmez. İlk program eklenince belirir, liste boşalınca gider.
|
||||
if (liste.length === 0) return null;
|
||||
const azalt = useReducedMotion();
|
||||
// Boşken de görünür (DESIGN.md §4.37): halka boş, sayı soluk — hedef (24)
|
||||
// ilk bakışta okunur ve ilk eklemede uçan karenin konacağı yer hazırdır.
|
||||
const dolu = liste.length > 0;
|
||||
|
||||
return (
|
||||
<button
|
||||
@@ -31,6 +35,7 @@ export function ListemButonu() {
|
||||
aria-expanded={acik}
|
||||
aria-label={`Kendi listem — ${liste.length}/${MANUEL_LISTE_MAX} program`}
|
||||
title="Tablodan seçtiğin programlar"
|
||||
data-ucus-hedefi="masaustu"
|
||||
className="relative inline-flex h-9 cursor-pointer items-center gap-1.5 whitespace-nowrap rounded-full border border-slate-200 bg-card px-3 text-xs font-semibold text-slate-700 transition-[color,background-color,border-color,transform] duration-200 hover:border-slate-300 hover:bg-slate-50 active:scale-[0.97] sm:h-12 sm:gap-2 sm:px-5 sm:text-sm"
|
||||
>
|
||||
<ListChecks className="size-3.5 text-primary sm:size-4" aria-hidden />
|
||||
@@ -38,13 +43,35 @@ export function ListemButonu() {
|
||||
hiçbir kırılma noktasında etikete yer yok — ikon + rozet + yukarıdaki
|
||||
aria-label anlamı taşıyor. UserNav'daki pill'le aynı desen. */}
|
||||
<span className="hidden">Kendi Listem</span>
|
||||
{liste.length > 0 ? (
|
||||
// Rozet yerinde durur, rakam rulo gibi döner (eklemede yukarı,
|
||||
// çıkarmada aşağı) — Arc "Number field" rulosu, bkz. sayi-rulo.tsx.
|
||||
<span className="flex h-6 min-w-6 items-center justify-center rounded-full bg-orange-500 px-1.5 font-heading text-xs font-bold text-white">
|
||||
{/* Rozet yerinde durur, rakam rulo gibi döner (sayi-rulo.tsx). Çevresinde
|
||||
24'lük doluluk halkası: yay ile dolar; sayı her zaman yazılı, halka
|
||||
tek başına anlam taşımaz. */}
|
||||
<span data-ucus-rozet className="relative flex size-8 items-center justify-center">
|
||||
<svg viewBox="0 0 32 32" aria-hidden className="absolute inset-0 size-full -rotate-90">
|
||||
<circle cx="16" cy="16" r="14.5" fill="none" strokeWidth="2.5" className="stroke-slate-200" />
|
||||
<motion.circle
|
||||
cx="16"
|
||||
cy="16"
|
||||
r="14.5"
|
||||
fill="none"
|
||||
strokeWidth="2.5"
|
||||
strokeLinecap="round"
|
||||
className="stroke-primary"
|
||||
pathLength={1}
|
||||
initial={false}
|
||||
animate={{ pathLength: liste.length / MANUEL_LISTE_MAX, opacity: dolu ? 1 : 0 }}
|
||||
transition={azalt ? { duration: 0 } : YAY.akici}
|
||||
/>
|
||||
</svg>
|
||||
<span
|
||||
className={cn(
|
||||
"flex size-[22px] items-center justify-center rounded-full font-heading text-xs font-bold transition-colors duration-200",
|
||||
dolu ? "bg-orange-500 text-white" : "bg-slate-100 text-slate-500",
|
||||
)}
|
||||
>
|
||||
<SayiRulo deger={liste.length} />
|
||||
</span>
|
||||
) : null}
|
||||
</span>
|
||||
</button>
|
||||
);
|
||||
}
|
||||
|
||||
@@ -1,10 +1,14 @@
|
||||
"use client";
|
||||
|
||||
import { SATIR_DUGME_BOYU } from "@/components/liste-satiri";
|
||||
import { ArrowRight, Check, Plus } from "lucide-react";
|
||||
import { useState } from "react";
|
||||
import { motion, useReducedMotion } from "motion/react";
|
||||
import { ArrowRight, Plus } from "lucide-react";
|
||||
import { toast } from "@/components/ui/bildirim";
|
||||
import type { Program } from "@/types/yokatlas";
|
||||
import { olay } from "@/lib/analitik";
|
||||
import { YAY } from "@/lib/hareket";
|
||||
import { logoTepkisi } from "@/lib/logo-tepkisi";
|
||||
import {
|
||||
MANUEL_LISTE_MAX,
|
||||
cekmeceAc,
|
||||
@@ -18,6 +22,7 @@ import {
|
||||
programEkleIste,
|
||||
} from "../hooks/use-tercih-profili";
|
||||
import { preloadTercihProfiliKapisi } from "./tercih-profili-kapisi-lazy";
|
||||
import { ucusBaslat } from "./ucus-katmani";
|
||||
|
||||
type ProgramOzet = Pick<
|
||||
Program,
|
||||
@@ -51,10 +56,15 @@ export function ProgramEkleButonu({
|
||||
// taramanın listedeMi ile ikinci kez yapılması vardı).
|
||||
const listede = useListedeMi(program.id);
|
||||
const doldu = useListeDoluMu();
|
||||
const azalt = useReducedMotion();
|
||||
// Tik yalnız bu düğmeyle eklenince kendini çizer; sayfa açılışında zaten
|
||||
// listede olan satırlar çizim oynatmaz.
|
||||
const [yeniEklendi, setYeniEklendi] = useState(false);
|
||||
|
||||
function handleClick(e: React.MouseEvent) {
|
||||
e.preventDefault();
|
||||
e.stopPropagation();
|
||||
const dugme = e.currentTarget;
|
||||
const sonuc = programEkleIste({ program, kaynak, adaySira, adayTur });
|
||||
if (sonuc.doldu) {
|
||||
// Ne olduğunu ve ne yapılacağını söyle (DESIGN.md §10)
|
||||
@@ -75,6 +85,12 @@ export function ProgramEkleButonu({
|
||||
// olur, navbar sayacı artar). Profilsiz eklemede aşağıdaki toast
|
||||
// zaten açıklama taşıyor.
|
||||
const adet = listeOku().length;
|
||||
// Eylemin kendi cevabı (§4.37): kare rozete uçar, logo döner, parmak
|
||||
// hafifçe titrer. Bildirim değil; her eklemede olur.
|
||||
setYeniEklendi(true);
|
||||
ucusBaslat(dugme);
|
||||
logoTepkisi(adet === MANUEL_LISTE_MAX ? "tamam" : "ekle");
|
||||
navigator.vibrate?.(8);
|
||||
if (!sonuc.profilsiz && adet === 1) {
|
||||
toast.success(`İlk programın listende · 1/${MANUEL_LISTE_MAX}`, {
|
||||
description: "Beğendiklerini ekledikçe sırasını çekmeceden değiştirebilirsin.",
|
||||
@@ -139,7 +155,23 @@ export function ProgramEkleButonu({
|
||||
} ${className}`}
|
||||
>
|
||||
{listede ? (
|
||||
<Check className="size-4" aria-hidden />
|
||||
<svg
|
||||
viewBox="0 0 24 24"
|
||||
fill="none"
|
||||
stroke="currentColor"
|
||||
strokeWidth={2.5}
|
||||
strokeLinecap="round"
|
||||
strokeLinejoin="round"
|
||||
className="size-4"
|
||||
aria-hidden
|
||||
>
|
||||
<motion.path
|
||||
d="M4 12.5 9.5 18 20 6.5"
|
||||
initial={yeniEklendi && !azalt ? { pathLength: 0 } : false}
|
||||
animate={{ pathLength: 1 }}
|
||||
transition={YAY.donusum}
|
||||
/>
|
||||
</svg>
|
||||
) : (
|
||||
<Plus className="size-4" aria-hidden />
|
||||
)}
|
||||
|
||||
@@ -94,12 +94,15 @@ const BOS_EKSTRA: Record<DilimKey, ProgramListeSatiri[]> = {
|
||||
garanti: [],
|
||||
};
|
||||
|
||||
// Dengeli ve hayal dilimleri tamamen boşsa (sıralama çok gerideyse) boş bir
|
||||
// "dengeli" sekmesi yerine dolu olan "garanti" ile açılır.
|
||||
// Açılış sekmesi hiçbir zaman boş bir dilim olmaz (Bilal, 10 Eki 2026:
|
||||
// "dengeli 0 dahi olsa tab aktif oluyor"): önce dengeli, o boşsa güvenli,
|
||||
// o da boşsa hayal. Üçü de boşsa dengeli kalır — tek boş mesaj orada okunur.
|
||||
function varsayilanDilim(sonuclar: RankResultsListe): DilimKey {
|
||||
return sonuclar.toplam.dengeli === 0 && sonuclar.toplam.hayal === 0
|
||||
? "garanti"
|
||||
: "dengeli";
|
||||
const { toplam } = sonuclar;
|
||||
if (toplam.dengeli > 0) return "dengeli";
|
||||
if (toplam.garanti > 0) return "garanti";
|
||||
if (toplam.hayal > 0) return "hayal";
|
||||
return "dengeli";
|
||||
}
|
||||
|
||||
export function ProgramTablosu({
|
||||
@@ -133,9 +136,10 @@ export function ProgramTablosu({
|
||||
if (veriAnahtari !== oncekiAnahtar) {
|
||||
setOncekiAnahtar(veriAnahtari);
|
||||
setEkstra(BOS_EKSTRA);
|
||||
// Yeni sıra/türde dengeli+hayal boş kaldıysa boş sekmede bırakma
|
||||
if (varsayilanDilim(sonuclar) === "garanti" && aktifDilim !== "garanti") {
|
||||
setAktifDilim("garanti");
|
||||
// Yeni sıra/tür/filtrede açık sekme boşaldıysa dolu olana geç; kullanıcı
|
||||
// bilerek dolu bir sekmedeyse (0 değilse) seçimi korunur.
|
||||
if (sonuclar.toplam[aktifDilim] === 0) {
|
||||
setAktifDilim(varsayilanDilim(sonuclar));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
"use client";
|
||||
|
||||
import { logoTepkisi } from "@/lib/logo-tepkisi";
|
||||
import { useEffect, useRef, useState } from "react";
|
||||
import { useRouter } from "next/navigation";
|
||||
import { ArrowRight, Trophy } from "lucide-react";
|
||||
@@ -7,6 +8,7 @@ import { useReducedMotion } from "motion/react";
|
||||
import useMeasure from "react-use-measure";
|
||||
import { toast } from "@/components/ui/bildirim";
|
||||
import { TransitionPanel } from "@/components/core/transition-panel";
|
||||
import { adimGecisi, adimGecisiVaryantlari } from "@/lib/adim-gecisi";
|
||||
import { Button } from "@/components/ui/button";
|
||||
import { Input } from "@/components/ui/input";
|
||||
import {
|
||||
@@ -230,6 +232,8 @@ function KapıIcerik({
|
||||
if (sira == null) return;
|
||||
const yeniProfil: TercihProfili = { sira, tur, secimler };
|
||||
tercihProfiliYaz(yeniProfil);
|
||||
// Üst çubuktaki logo kürsüye döner (DESIGN.md §4.34).
|
||||
logoTepkisi("sira");
|
||||
const bekleyenVar = Boolean(bekleyen);
|
||||
const yonlendir = profilTamamlandi(yeniProfil, girisli);
|
||||
// "sihirbaz" hedefinde akış /sonuc'ta devam eder (üretim ya da giriş
|
||||
@@ -255,42 +259,11 @@ function KapıIcerik({
|
||||
<TransitionPanel
|
||||
activeIndex={ADIM_SIRASI[adim]}
|
||||
custom={yon}
|
||||
variants={{
|
||||
enter: (gecisYonu: number) => ({
|
||||
x: hareketiAzalt ? 0 : gecisYonu > 0 ? "100%" : "-100%",
|
||||
opacity: 0,
|
||||
height: panelYuksekligi,
|
||||
position: "relative",
|
||||
}),
|
||||
center: {
|
||||
zIndex: 1,
|
||||
x: 0,
|
||||
opacity: 1,
|
||||
height: panelYuksekligi,
|
||||
},
|
||||
exit: (gecisYonu: number) => ({
|
||||
zIndex: 0,
|
||||
x: hareketiAzalt ? 0 : gecisYonu < 0 ? "100%" : "-100%",
|
||||
opacity: 0,
|
||||
position: "absolute",
|
||||
top: 0,
|
||||
left: 0,
|
||||
width: "100%",
|
||||
}),
|
||||
}}
|
||||
transition={
|
||||
hareketiAzalt
|
||||
? {
|
||||
opacity: { duration: 0.12 },
|
||||
x: { duration: 0 },
|
||||
height: { duration: 0 },
|
||||
}
|
||||
: {
|
||||
x: { type: "spring", stiffness: 300, damping: 30 },
|
||||
height: { type: "spring", stiffness: 300, damping: 30 },
|
||||
opacity: { duration: 0.2 },
|
||||
}
|
||||
}
|
||||
variants={adimGecisiVaryantlari({
|
||||
hareketiAzalt: !!hareketiAzalt,
|
||||
yukseklik: panelYuksekligi,
|
||||
})}
|
||||
transition={adimGecisi(!!hareketiAzalt)}
|
||||
>
|
||||
{/* p-1: geçiş paneli taşmayı kırpar; alanların 3 px odak halkası
|
||||
(Input/Select/Button ring-3) sığsın (Bilal, 24 Eyl 2026). */}
|
||||
@@ -330,7 +303,7 @@ function KapıIcerik({
|
||||
type="button"
|
||||
disabled={yukleniyor}
|
||||
onClick={() => void giristenIlerle()}
|
||||
className="cursor-pointer bg-orange-500 text-white hover:bg-orange-600"
|
||||
variant="cta"
|
||||
>
|
||||
{yukleniyor ? "Hazırlanıyor…" : "Tercihlerimi belirle"}
|
||||
<ArrowRight className="size-4" aria-hidden />
|
||||
@@ -423,7 +396,7 @@ function KapıIcerik({
|
||||
<Button
|
||||
type="submit"
|
||||
disabled={yukleniyor}
|
||||
className="cursor-pointer bg-orange-500 text-white hover:bg-orange-600"
|
||||
variant="cta"
|
||||
>
|
||||
{yukleniyor ? "Hazırlanıyor…" : "Tercihlere geç"}
|
||||
<ArrowRight className="size-4" aria-hidden />
|
||||
|
||||
111
src/features/liste/components/ucus-katmani.tsx
Normal file
111
src/features/liste/components/ucus-katmani.tsx
Normal file
@@ -0,0 +1,111 @@
|
||||
"use client";
|
||||
|
||||
// Listeye ekleme uçuşu (DESIGN.md §4.37, §11.2 "her eylemin cevabı var"):
|
||||
// "+" düğmesine basılınca düğmenin yerinden bir piksel kare, üst çubuktaki
|
||||
// Listem rozetine (telefonda menü baloncuğuna) uçar; varışta rozet bir kez
|
||||
// nabız atar. Katman tektir ve layout'ta durur; düğmeler `ucusBaslat` ile
|
||||
// pencereye olay atar. Hareketi azalt'ta uçuş yok (rozet sayısı yine değişir).
|
||||
|
||||
import { useEffect, useRef } from "react";
|
||||
import { animate } from "motion/react";
|
||||
import { EGRI } from "@/lib/hareket";
|
||||
|
||||
const UCUS_OLAYI = "kt-ucus";
|
||||
const KARE = 10;
|
||||
const UCUS_SURE = 0.55;
|
||||
|
||||
/** "+" düğmesi çağırır: uçuş `kaynak` öğesinin ortasından başlar. */
|
||||
export function ucusBaslat(kaynak: Element) {
|
||||
if (typeof window === "undefined") return;
|
||||
const r = kaynak.getBoundingClientRect();
|
||||
window.dispatchEvent(
|
||||
new CustomEvent(UCUS_OLAYI, {
|
||||
detail: { x: r.left + r.width / 2, y: r.top + r.height / 2 },
|
||||
}),
|
||||
);
|
||||
}
|
||||
|
||||
/** Ekranda görünen hedef: masaüstünde Listem düğmesi, telefonda menü baloncuğu. */
|
||||
function hedefBul(): HTMLElement | null {
|
||||
for (const el of document.querySelectorAll<HTMLElement>("[data-ucus-hedefi]")) {
|
||||
const r = el.getBoundingClientRect();
|
||||
if (r.width > 0 && r.height > 0) return el;
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
function rozetNabzi(hedef: HTMLElement) {
|
||||
const rozet = hedef.querySelector<HTMLElement>("[data-ucus-rozet]") ?? hedef;
|
||||
rozet.classList.remove("kt-piksel-nabiz");
|
||||
// Yeniden tetiklemek için yerleşimi oku (animasyon sıfırlanır).
|
||||
void rozet.offsetWidth;
|
||||
rozet.classList.add("kt-piksel-nabiz");
|
||||
rozet.addEventListener(
|
||||
"animationend",
|
||||
() => rozet.classList.remove("kt-piksel-nabiz"),
|
||||
{ once: true },
|
||||
);
|
||||
}
|
||||
|
||||
export function UcusKatmani() {
|
||||
const kareRef = useRef<HTMLSpanElement>(null);
|
||||
|
||||
useEffect(() => {
|
||||
let surenUcus: { stop: () => void } | null = null;
|
||||
const azalt = window.matchMedia("(prefers-reduced-motion: reduce)");
|
||||
|
||||
function uc(e: Event) {
|
||||
const { x, y } = (e as CustomEvent<{ x: number; y: number }>).detail;
|
||||
const kare = kareRef.current;
|
||||
// Rozet sayısı store'dan bir kare sonra güncellenir; hedef o zaman aranır
|
||||
// (ilk eklemede rozet yeni belirir).
|
||||
requestAnimationFrame(() => {
|
||||
const hedef = hedefBul();
|
||||
if (!hedef) return;
|
||||
if (azalt.matches || !kare) {
|
||||
return;
|
||||
}
|
||||
const h = hedef.getBoundingClientRect();
|
||||
const hx = h.left + h.width / 2;
|
||||
const hy = h.top + h.height / 2;
|
||||
// Aynı anda tek kare: süren uçuş kesilir, yenisi kendi yerinden çıkar.
|
||||
surenUcus?.stop();
|
||||
kare.style.left = `${x - KARE / 2}px`;
|
||||
kare.style.top = `${y - KARE / 2}px`;
|
||||
// Yatay düz, dikey gecikmeli: iki eğrinin farkı yayı çizer.
|
||||
surenUcus = animate(
|
||||
kare,
|
||||
{
|
||||
x: [0, hx - x],
|
||||
y: [0, hy - y],
|
||||
opacity: [0, 1, 1, 0],
|
||||
scale: [0.6, 1.4, 1, 0.5],
|
||||
},
|
||||
{
|
||||
duration: UCUS_SURE,
|
||||
x: { duration: UCUS_SURE, ease: EGRI.standart },
|
||||
y: { duration: UCUS_SURE, ease: [0.5, 0, 0.75, 0] },
|
||||
opacity: { duration: UCUS_SURE, times: [0, 0.12, 0.85, 1], ease: "linear" },
|
||||
scale: { duration: UCUS_SURE, times: [0, 0.15, 0.8, 1], ease: "easeOut" },
|
||||
onComplete: () => rozetNabzi(hedef),
|
||||
},
|
||||
);
|
||||
});
|
||||
}
|
||||
|
||||
window.addEventListener(UCUS_OLAYI, uc);
|
||||
return () => {
|
||||
window.removeEventListener(UCUS_OLAYI, uc);
|
||||
surenUcus?.stop();
|
||||
};
|
||||
}, []);
|
||||
|
||||
return (
|
||||
<span
|
||||
ref={kareRef}
|
||||
aria-hidden
|
||||
className="pointer-events-none fixed z-[70] block rounded-[2px] bg-orange-500 opacity-0 print:hidden"
|
||||
style={{ width: KARE, height: KARE, left: 0, top: 0 }}
|
||||
/>
|
||||
);
|
||||
}
|
||||
277
src/features/pazarlama/components/adim-akisi.tsx
Normal file
277
src/features/pazarlama/components/adim-akisi.tsx
Normal file
@@ -0,0 +1,277 @@
|
||||
"use client";
|
||||
|
||||
// Ana sayfa "Nasıl çalışır"ın üç adımı (DESIGN.md §4.32). Adım numarası
|
||||
// hero'nun piksel diliyle yazılmış iri rakamdır; bölüm ekrana girince her
|
||||
// rakam sırayla, kısa bir an o adımın biçimine dönüşüp geri toplanır
|
||||
// (logonun yaptığının aynısı, §4.34):
|
||||
// 1 → sıra şeridi (herkes tek sırada, turuncu kare sensin)
|
||||
// 2 → yıl yıl çubuklar (taranan veri; en yenisinin tepesi turuncu)
|
||||
// 3 → 6×4 = 24 kare (listen)
|
||||
// Rakam geri toplanınca sıradaki adıma giden çizgi dolar; hareketler sırayla
|
||||
// konuşur (§11.2-3). Sonrasında imleçle adıma gelince biçim yeniden açılır,
|
||||
// telefonda dokununca bir kez oynar. Hareketi azalt'ta rakamlar durağandır.
|
||||
|
||||
import { useEffect, useMemo, useRef, useState } from "react";
|
||||
import { useReducedMotion } from "motion/react";
|
||||
import { PikselMorf, type MorfPiksel } from "@/components/piksel-morf";
|
||||
import { RAKAMLAR, dokuOpakligi } from "@/components/pixel-decor";
|
||||
import { Reveal } from "@/features/pazarlama/components/reveal";
|
||||
|
||||
export type Adim = {
|
||||
no: keyof typeof RAKAMLAR;
|
||||
baslik: string;
|
||||
aciklama: string;
|
||||
};
|
||||
|
||||
// Sahne: rakam (5×7) ortada, biçim iki yanına taşabilir.
|
||||
const SUTUN = 11;
|
||||
const SATIR = 7;
|
||||
const RAKAM_X = (SUTUN - 5) / 2;
|
||||
|
||||
/** Biçimde kalma (dönüşüm dahil) ve rakama dönüş süreleri (ms). */
|
||||
const BICIM_TUT = 1300;
|
||||
const DONUS = 650;
|
||||
const ILK_BEKLEME = 350;
|
||||
|
||||
type Hucre = { x: number; y: number; vurgu?: boolean };
|
||||
|
||||
function rakamHucreleri(no: Adim["no"]): Hucre[] {
|
||||
return RAKAMLAR[no].flatMap((satir, y) =>
|
||||
[...satir].flatMap((c, x) => (c === "#" ? [{ x: x + RAKAM_X, y }] : [])),
|
||||
);
|
||||
}
|
||||
|
||||
function bicimHucreleri(no: Adim["no"], yilSayisi: number): Hucre[] {
|
||||
if (no === 1) {
|
||||
// Sıra şeridi (PixelSira dili): dokuz kare tek sırada, biri sen
|
||||
return Array.from({ length: 9 }, (_, i) => ({
|
||||
x: 1 + i,
|
||||
y: 3,
|
||||
vurgu: i === 2,
|
||||
}));
|
||||
}
|
||||
if (no === 2) {
|
||||
// Yıl başına bir çubuk; sahne 6 çubuk alır
|
||||
const n = Math.min(Math.max(yilSayisi, 3), 6);
|
||||
const boylar = [3, 2, 4, 3, 5, 4].slice(-n);
|
||||
const sol = (SUTUN - (2 * n - 1)) / 2;
|
||||
return boylar.flatMap((boy, b) =>
|
||||
Array.from({ length: boy }, (_, r) => ({
|
||||
x: sol + b * 2,
|
||||
y: SATIR - 1 - r,
|
||||
vurgu: b === n - 1 && r === boy - 1,
|
||||
})),
|
||||
);
|
||||
}
|
||||
// 24'lük liste: 6×4, kapanıştaki piksel listeyle aynı dizilim
|
||||
return Array.from({ length: 24 }, (_, i) => ({
|
||||
x: (SUTUN - 6) / 2 + (i % 6),
|
||||
y: (SATIR - 4) / 2 + Math.floor(i / 6),
|
||||
}));
|
||||
}
|
||||
|
||||
type Eslesme = { rakam?: Hucre; bicim?: Hucre; op: number };
|
||||
|
||||
/** Rakam pikselleri en yakın biçim hücresine gider; artanlar yerinde belirir/söner. */
|
||||
function esle(rakam: Hucre[], bicim: Hucre[]): Eslesme[] {
|
||||
const ciftler = rakam
|
||||
.flatMap((r, ri) =>
|
||||
bicim.map((b, bi) => ({ ri, bi, d: (r.x - b.x) ** 2 + (r.y - b.y) ** 2 })),
|
||||
)
|
||||
.sort((a, b) => a.d - b.d);
|
||||
const rakamdan = new Map<number, number>();
|
||||
const bicimden = new Set<number>();
|
||||
for (const c of ciftler) {
|
||||
if (rakamdan.has(c.ri) || bicimden.has(c.bi)) continue;
|
||||
rakamdan.set(c.ri, c.bi);
|
||||
bicimden.add(c.bi);
|
||||
}
|
||||
// "Dolgun" ton (PixelSahne ile aynı): okunması gereken şekil
|
||||
const dolgun = (h: Hucre) =>
|
||||
0.4 + dokuOpakligi(Math.abs(Math.round(h.x - RAKAM_X)), Math.round(h.y)) * 2;
|
||||
return [
|
||||
...rakam.map((r, ri) => {
|
||||
const bi = rakamdan.get(ri);
|
||||
return { rakam: r, bicim: bi === undefined ? undefined : bicim[bi], op: dolgun(r) };
|
||||
}),
|
||||
...bicim
|
||||
.filter((_, bi) => !bicimden.has(bi))
|
||||
.map((b) => ({ bicim: b, op: dolgun(b) })),
|
||||
];
|
||||
}
|
||||
|
||||
function RakamMorfu({
|
||||
no,
|
||||
yilSayisi,
|
||||
bicimde,
|
||||
}: {
|
||||
no: Adim["no"];
|
||||
yilSayisi: number;
|
||||
bicimde: boolean;
|
||||
}) {
|
||||
const eslesmeler = useMemo(
|
||||
() => esle(rakamHucreleri(no), bicimHucreleri(no, yilSayisi)),
|
||||
[no, yilSayisi],
|
||||
);
|
||||
const pikseller = useMemo<MorfPiksel[]>(
|
||||
() =>
|
||||
eslesmeler.map((e, i) => {
|
||||
const hedef = bicimde ? e.bicim : e.rakam;
|
||||
// Bu hâlde yeri olmayan piksel öbür hâldeki yerinde gizli bekler
|
||||
const yer = hedef ?? e.bicim ?? e.rakam!;
|
||||
return {
|
||||
id: String(i),
|
||||
x: yer.x,
|
||||
y: yer.y,
|
||||
op: e.op,
|
||||
ton: !hedef ? "gizli" : bicimde && hedef.vurgu ? "vurgu" : "doku",
|
||||
// Kareler sırayla yola çıkar (logo biçimlerindeki gibi)
|
||||
gecikme: i * 14,
|
||||
};
|
||||
}),
|
||||
[eslesmeler, bicimde],
|
||||
);
|
||||
return (
|
||||
<PikselMorf
|
||||
pikseller={pikseller}
|
||||
sutun={SUTUN}
|
||||
satir={SATIR}
|
||||
yaricap={22}
|
||||
// Biçimde turuncu kare anlam taşır ("sen", "bu yıl"): fırça karışmasın
|
||||
firca={!bicimde}
|
||||
className="h-24 w-auto"
|
||||
/>
|
||||
);
|
||||
}
|
||||
|
||||
export function AdimAkisi({
|
||||
adimlar,
|
||||
yilSayisi,
|
||||
}: {
|
||||
adimlar: readonly Adim[];
|
||||
/** "Son N yıl": ikinci adımın biçimindeki çubuk sayısı */
|
||||
yilSayisi: number;
|
||||
}) {
|
||||
const azalt = useReducedMotion();
|
||||
const ogeler = useRef<(HTMLLIElement | null)[]>([]);
|
||||
/** Şu an biçimini gösteren adım */
|
||||
const [bicimde, setBicimde] = useState<number | null>(null);
|
||||
/** Dolan çizgi sayısı (adım i ile i+1 arası: i < dolan) */
|
||||
const [dolan, setDolan] = useState(0);
|
||||
// Açılış sırası: kaç adım oynadı, şu an oynuyor mu
|
||||
const oynanan = useRef(0);
|
||||
const mesgul = useRef(false);
|
||||
const gorunur = useRef<boolean[]>([]);
|
||||
const zamanlayicilar = useRef<number[]>([]);
|
||||
|
||||
useEffect(() => {
|
||||
if (azalt || typeof IntersectionObserver === "undefined") return;
|
||||
const bekle = (ms: number, is: () => void) => {
|
||||
zamanlayicilar.current.push(window.setTimeout(is, ms));
|
||||
};
|
||||
// Adım, kendisi ekrandaysa ve öncekiler bittiyse oynar: geniş ekranda
|
||||
// 1 → 2 → 3 peş peşe, telefonda her biri görününce.
|
||||
const ilerlet = () => {
|
||||
const i = oynanan.current;
|
||||
if (mesgul.current || i >= adimlar.length || !gorunur.current[i]) return;
|
||||
mesgul.current = true;
|
||||
bekle(i === 0 ? ILK_BEKLEME : 0, () => {
|
||||
setBicimde(i);
|
||||
bekle(BICIM_TUT, () => {
|
||||
setBicimde(null);
|
||||
setDolan(i + 1);
|
||||
bekle(DONUS, () => {
|
||||
oynanan.current = i + 1;
|
||||
mesgul.current = false;
|
||||
ilerlet();
|
||||
});
|
||||
});
|
||||
});
|
||||
};
|
||||
const io = new IntersectionObserver(
|
||||
(kayitlar) => {
|
||||
for (const k of kayitlar) {
|
||||
const i = ogeler.current.indexOf(k.target as HTMLLIElement);
|
||||
if (i >= 0) gorunur.current[i] = k.isIntersecting;
|
||||
}
|
||||
ilerlet();
|
||||
},
|
||||
// Rakam ekranın alt kenarından biraz içeri girince
|
||||
{ rootMargin: "0px 0px -120px 0px" },
|
||||
);
|
||||
ogeler.current.forEach((el) => el && io.observe(el));
|
||||
const bekleyenler = zamanlayicilar.current;
|
||||
return () => {
|
||||
io.disconnect();
|
||||
bekleyenler.forEach((z) => window.clearTimeout(z));
|
||||
bekleyenler.length = 0;
|
||||
mesgul.current = false;
|
||||
};
|
||||
}, [azalt, adimlar.length]);
|
||||
|
||||
// Açılışı bitmiş adım bakana cevap verir: imleç üstündeyken biçim açık
|
||||
// kalır, dokunmada bir kez oynar. Açılış sürerken karışmaz.
|
||||
const serbest = (i: number) => !azalt && !mesgul.current && oynanan.current > i;
|
||||
const dokun = (i: number) => {
|
||||
if (!serbest(i)) return;
|
||||
mesgul.current = true;
|
||||
setBicimde(i);
|
||||
zamanlayicilar.current.push(
|
||||
window.setTimeout(() => {
|
||||
setBicimde(null);
|
||||
mesgul.current = false;
|
||||
}, BICIM_TUT),
|
||||
);
|
||||
};
|
||||
|
||||
return (
|
||||
<ol className="grid gap-12 md:grid-cols-3 md:gap-8">
|
||||
{adimlar.map((s, i) => (
|
||||
<li
|
||||
key={s.no}
|
||||
ref={(el) => {
|
||||
ogeler.current[i] = el;
|
||||
}}
|
||||
onPointerEnter={(e) => {
|
||||
if (e.pointerType === "mouse" && serbest(i)) setBicimde(i);
|
||||
}}
|
||||
onPointerLeave={(e) => {
|
||||
if (e.pointerType === "mouse" && !mesgul.current) {
|
||||
setBicimde((b) => (b === i ? null : b));
|
||||
}
|
||||
}}
|
||||
onPointerDown={(e) => {
|
||||
if (e.pointerType !== "mouse") dokun(i);
|
||||
}}
|
||||
>
|
||||
<Reveal
|
||||
delay={i * 0.08}
|
||||
className="relative flex flex-col items-center text-center"
|
||||
>
|
||||
<RakamMorfu no={s.no} yilSayisi={yilSayisi} bicimde={bicimde === i} />
|
||||
{i < adimlar.length - 1 ? (
|
||||
<span
|
||||
aria-hidden
|
||||
className="absolute top-12 left-[calc(50%+5.25rem)] hidden h-0.5 w-[calc(100%-8.5rem)] -translate-y-1/2 overflow-hidden rounded-full bg-slate-200 md:block"
|
||||
>
|
||||
{/* Adım göstergesiyle aynı mavi dolum (§4.35): rakam biçiminden
|
||||
dönünce sıradaki adıma doğru dolar. */}
|
||||
<span
|
||||
data-dolu={dolan > i ? "" : undefined}
|
||||
className="kt-cizgi-dol block h-full rounded-full bg-primary"
|
||||
/>
|
||||
</span>
|
||||
) : null}
|
||||
<h3 className="mt-6 font-heading text-xl font-bold text-balance">
|
||||
<span className="sr-only">{s.no}. adım: </span>
|
||||
{s.baslik}
|
||||
</h3>
|
||||
<p className="mt-2 max-w-sm text-base leading-relaxed text-slate-600">
|
||||
{s.aciklama}
|
||||
</p>
|
||||
</Reveal>
|
||||
</li>
|
||||
))}
|
||||
</ol>
|
||||
);
|
||||
}
|
||||
61
src/features/pazarlama/components/bolum-gecisi.tsx
Normal file
61
src/features/pazarlama/components/bolum-gecisi.tsx
Normal file
@@ -0,0 +1,61 @@
|
||||
// Ana sayfa bölüm geçişi (DESIGN.md §4.38): bölümler arasında piksel ayraç
|
||||
// yerine tek bir piksel şeridi durur. Şerit hero haritasının serpintisinden
|
||||
// başlar ve her bölüm arasında yeniden görünür; kaydırdıkça turuncuya ısınarak
|
||||
// aşağı iner — sayfanın bölümlerini birbirine bağlayan iplik. Bölümlerin
|
||||
// içinde çizilmez (yazının arkasına piksel serilmez, §4.31), yalnız aradaki
|
||||
// boşlukta durur.
|
||||
|
||||
import { Parallax } from "@/components/parallax";
|
||||
import { PikselSerit } from "@/components/piksel-serit";
|
||||
|
||||
/** Geçişin akışta kapladığı boy (hücre): eski ayracın yüksekliği, bölümler
|
||||
* arasındaki mesafe değişmesin. Şerit bunun üstüne ve altına taşar. */
|
||||
const ORTA = 2;
|
||||
|
||||
export function BolumGecisi({
|
||||
tohum,
|
||||
ust = 4,
|
||||
alt = 4,
|
||||
ustTelefon = 3,
|
||||
altTelefon = 3,
|
||||
ustKisaTelefon = ustTelefon,
|
||||
}: {
|
||||
/** Şeridin doku deseni; sayfadaki her geçişte farklı */
|
||||
tohum: number;
|
||||
/** Şeridin geçiş çizgisinin üstünde ve altında kalan boyu (hücre ≈ 18,7 px) */
|
||||
ust?: number;
|
||||
alt?: number;
|
||||
/** Telefonda bölüm boşluğu dardır (üstte 112, altta 96 px; app/page.tsx
|
||||
* `BOLUM_BOSLUGU`): şerit daha kısa çizilir. */
|
||||
ustTelefon?: number;
|
||||
altTelefon?: number;
|
||||
/** Kısa telefonda (yükseklik < 760 px) üstte kalan boy. Hero'nun altındaki
|
||||
* boşluk ekran boyuna bağlıdır; şerit forma değmesin. */
|
||||
ustKisaTelefon?: number;
|
||||
}) {
|
||||
const uzunluk = ust + ORTA + alt;
|
||||
const hucreSinifi = Array.from({ length: uzunluk }, (_, i) => {
|
||||
const ustten = ust - i; // orta kısmın kaç hücre üstünde (1 = hemen üstü)
|
||||
const alttan = i - (ust + ORTA) + 1;
|
||||
if (ustten > ustTelefon || alttan > altTelefon) return "max-sm:hidden";
|
||||
if (ustten > ustKisaTelefon) {
|
||||
return "max-sm:[@media(max-height:759px)]:hidden";
|
||||
}
|
||||
return undefined;
|
||||
});
|
||||
|
||||
return (
|
||||
// Bir hücre = 14rem / 12 (hero'dan sonraki en iri piksel; eski ayraçla aynı)
|
||||
<div aria-hidden className="mx-auto h-[calc(14rem/6)] w-[calc(14rem/12)]">
|
||||
<Parallax strength={26} className="relative">
|
||||
<PikselSerit
|
||||
uzunluk={uzunluk}
|
||||
tohum={tohum}
|
||||
hucreSinifi={hucreSinifi}
|
||||
className="pointer-events-none absolute inset-x-0"
|
||||
style={{ top: `calc(${-ust} * 14rem / 12)` }}
|
||||
/>
|
||||
</Parallax>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
@@ -10,7 +10,9 @@ export function HeroBaslik() {
|
||||
const profil = useTercihProfili();
|
||||
|
||||
return (
|
||||
<h1 className="max-w-3xl font-heading text-5xl font-bold tracking-[0.015em] sm:text-6xl">
|
||||
// Sayfanın tek orkestre girişi (DESIGN.md §6, §11.2): başlık, ardından
|
||||
// form netleşerek gelir (globals.css `.kt-hero-gir`).
|
||||
<h1 className="kt-hero-gir max-w-3xl font-heading text-5xl font-bold tracking-[0.015em] sm:text-6xl">
|
||||
{profil ? (
|
||||
<>
|
||||
Sıralaman kayıtlı, <br className="hidden sm:block" />
|
||||
|
||||
@@ -22,7 +22,8 @@ export function HeroFocusButton() {
|
||||
type="button"
|
||||
size="lg"
|
||||
onClick={handleClick}
|
||||
className="mt-8 cursor-pointer bg-orange-500 text-white transition-colors duration-200 hover:bg-orange-600"
|
||||
variant="cta"
|
||||
className="mt-8"
|
||||
>
|
||||
Ücretsiz dene
|
||||
<ArrowRight className="size-4" aria-hidden />
|
||||
@@ -47,7 +48,8 @@ export function KapanisCta() {
|
||||
<Button
|
||||
asChild
|
||||
size="lg"
|
||||
className="mt-8 cursor-pointer bg-orange-500 text-white transition-colors duration-200 hover:bg-orange-600"
|
||||
variant="cta"
|
||||
className="mt-8"
|
||||
>
|
||||
<Link href={sonucHref()}>
|
||||
Üniversitelere göz at
|
||||
|
||||
@@ -1,7 +1,9 @@
|
||||
import { CheckCircle2, X } from "lucide-react";
|
||||
import { X } from "lucide-react";
|
||||
|
||||
// Ana sayfadaki karşılaştırma tablosunun hücresi: metin değeri düz yazılır,
|
||||
// boolean değer Var/Yok ikonuna çevrilir.
|
||||
// boolean değer Var/Yok ikonuna çevrilir. "Var" tiki tablo ekrana girince
|
||||
// kendini çizer (DESIGN.md §5.2.3, §11.2-6; globals.css `.kt-tik-ciz`):
|
||||
// lucide `circle-check` ile aynı geometri, iki parça `pathLength="1"`.
|
||||
export function ComparisonCell({
|
||||
value,
|
||||
vurgu = false,
|
||||
@@ -20,7 +22,24 @@ export function ComparisonCell({
|
||||
);
|
||||
}
|
||||
return value ? (
|
||||
<CheckCircle2 className="mx-auto size-6 text-primary" aria-label="Var" />
|
||||
<svg
|
||||
viewBox="0 0 24 24"
|
||||
fill="none"
|
||||
stroke="currentColor"
|
||||
strokeWidth={2}
|
||||
strokeLinecap="round"
|
||||
strokeLinejoin="round"
|
||||
role="img"
|
||||
aria-label="Var"
|
||||
className="mx-auto size-6 text-primary"
|
||||
>
|
||||
<circle cx={12} cy={12} r={10} pathLength={1} className="kt-tik-ciz" />
|
||||
<path
|
||||
d="m9 12 2 2 4-4"
|
||||
pathLength={1}
|
||||
className="kt-tik-ciz kt-tik-isaret"
|
||||
/>
|
||||
</svg>
|
||||
) : (
|
||||
<X className="mx-auto size-5 text-slate-300" aria-label="Yok" />
|
||||
);
|
||||
|
||||
61
src/features/pazarlama/components/sayan-sayi.tsx
Normal file
61
src/features/pazarlama/components/sayan-sayi.tsx
Normal file
@@ -0,0 +1,61 @@
|
||||
"use client";
|
||||
|
||||
// Landing'deki iri sayılar ekrana girince rulo gibi dönerek yerine oturur
|
||||
// (DESIGN.md §11.2 "değişimi göster"; rulo: ui/sayi-rulo.tsx). Sunucu HTML'i
|
||||
// ve ilk boyama gerçek değeri taşır; sayı ekran dışındayken sessizce biraz
|
||||
// geriye alınır, görünüme girince gerçek değere döner. Hareketi azalt'ta ve
|
||||
// zaten ekrandayken hiç oynamaz.
|
||||
|
||||
import { useEffect, useRef, useState } from "react";
|
||||
import { SayiRulo } from "@/components/ui/sayi-rulo";
|
||||
|
||||
/** "20.000+", "%100", "5" → önek, sayı, sonek. Sayı yoksa `null`. */
|
||||
function ayir(metin: string) {
|
||||
const m = /^(\D*)([\d.]+)(\D*)$/.exec(metin);
|
||||
if (!m) return null;
|
||||
const sayi = Number(m[2].replace(/\./g, ""));
|
||||
return Number.isFinite(sayi) ? { onek: m[1], sayi, sonek: m[3] } : null;
|
||||
}
|
||||
|
||||
export function SayanSayi({ deger }: { deger: string }) {
|
||||
const ref = useRef<HTMLSpanElement>(null);
|
||||
const parca = ayir(deger);
|
||||
const hedef = parca?.sayi ?? 0;
|
||||
const [gosterilen, setGosterilen] = useState(hedef);
|
||||
|
||||
useEffect(() => {
|
||||
const el = ref.current;
|
||||
if (!el || !parca || typeof IntersectionObserver === "undefined") return;
|
||||
if (window.matchMedia("(prefers-reduced-motion: reduce)").matches) return;
|
||||
let ilk = true;
|
||||
const io = new IntersectionObserver(
|
||||
([giris]) => {
|
||||
if (ilk) {
|
||||
ilk = false;
|
||||
// İlk ölçümde zaten ekrandaysa dokunma; değilse geriye al ve bekle.
|
||||
if (giris.isIntersecting) return io.disconnect();
|
||||
setGosterilen(Math.floor(hedef * 0.9));
|
||||
return;
|
||||
}
|
||||
if (giris.isIntersecting) {
|
||||
setGosterilen(hedef);
|
||||
io.disconnect();
|
||||
}
|
||||
},
|
||||
{ rootMargin: "0px 0px -80px 0px" },
|
||||
);
|
||||
io.observe(el);
|
||||
return () => io.disconnect();
|
||||
// `parca` her render'da yeni nesne; hedef sayı değişmedikçe yeniden kurma.
|
||||
// eslint-disable-next-line react-hooks/exhaustive-deps
|
||||
}, [hedef]);
|
||||
|
||||
if (!parca) return <>{deger}</>;
|
||||
return (
|
||||
<span ref={ref}>
|
||||
{parca.onek}
|
||||
<SayiRulo deger={gosterilen} />
|
||||
{parca.sonek}
|
||||
</span>
|
||||
);
|
||||
}
|
||||
328
src/features/pazarlama/components/sorun-sahneleri.tsx
Normal file
328
src/features/pazarlama/components/sorun-sahneleri.tsx
Normal file
@@ -0,0 +1,328 @@
|
||||
"use client";
|
||||
|
||||
// Ana sayfa "Sorun" kartlarının canlı sahneleri (DESIGN.md §4.31, §4.38).
|
||||
// Üç sahne de eskiden durağan duran ızgaranın aynısıdır; artık kartın
|
||||
// söylediğini hareketle söyler:
|
||||
// ihtimal → binlerce karenin içinde 24'ü ısınır, söner, başka 24'ü ısınır
|
||||
// (hangi 24? — her seferinde başka bir ihtimal)
|
||||
// yillar → çubuklar her yıl bir sola kayar, sağdan başka boyda yeni yıl girer
|
||||
// fiyat → merdiven basamak basamak kurulur, turuncu tepe yukarı tırmanır
|
||||
//
|
||||
// Sahneler sırayla konuşur (§11.2-3): modül seviyesindeki tek orkestra aynı
|
||||
// anda yalnız bir sahneyi oynatır. İmleçle karta gelmek ya da karta dokunmak
|
||||
// o sahneyi hemen oynatır (bakana cevap). Sunucu HTML'i ve hareketi azalt
|
||||
// eski durağan resmi gösterir.
|
||||
|
||||
import { useEffect, useMemo, useRef, useState } from "react";
|
||||
import { useReducedMotion } from "motion/react";
|
||||
import {
|
||||
PikselMorf,
|
||||
type MorfPiksel,
|
||||
} from "@/components/piksel-morf";
|
||||
import { dokuOpakligi, pikselHash } from "@/components/pixel-decor";
|
||||
|
||||
export type SorunSahnesiTuru = "ihtimal" | "yillar" | "fiyat";
|
||||
|
||||
const SUTUN = 24;
|
||||
const SATIR = 8;
|
||||
|
||||
/* ------------------------------------------------------------------ */
|
||||
/* Orkestra: aynı anda tek sahne */
|
||||
/* ------------------------------------------------------------------ */
|
||||
|
||||
/** İki sahnenin söze başlaması arasındaki en kısa süre. */
|
||||
const SOZ_ARASI = 2400;
|
||||
/** Bir sahne oynadıktan sonra en az bu kadar durur. */
|
||||
const DINLENME = 6600;
|
||||
/** Elle (imleç/dokunma) tetiklemede aynı sahnenin tekrar aralığı. */
|
||||
const ELLE_ARASI = 2600;
|
||||
const TIK = 600;
|
||||
|
||||
type Kayit = {
|
||||
sira: number;
|
||||
gorunur: boolean;
|
||||
sonBaslangic: number;
|
||||
oynat: () => void;
|
||||
};
|
||||
|
||||
const kayitlar = new Set<Kayit>();
|
||||
let sayac = 0;
|
||||
let sonSoz = -Infinity;
|
||||
let siradaki = 0;
|
||||
|
||||
function sozVer(k: Kayit, simdi: number) {
|
||||
k.sonBaslangic = simdi;
|
||||
sonSoz = simdi;
|
||||
k.oynat();
|
||||
}
|
||||
|
||||
function tik() {
|
||||
if (document.hidden) return;
|
||||
const simdi = performance.now();
|
||||
if (simdi - sonSoz < SOZ_ARASI) return;
|
||||
const adaylar = [...kayitlar]
|
||||
.filter((k) => k.gorunur && simdi - k.sonBaslangic >= DINLENME)
|
||||
.sort((a, b) => a.sira - b.sira);
|
||||
if (adaylar.length === 0) return;
|
||||
const secilen = adaylar.find((k) => k.sira >= siradaki) ?? adaylar[0];
|
||||
siradaki = secilen.sira + 1;
|
||||
sozVer(secilen, simdi);
|
||||
}
|
||||
|
||||
function saatiAyarla() {
|
||||
const gorunenVar = [...kayitlar].some((k) => k.gorunur);
|
||||
if (gorunenVar && !sayac) sayac = window.setInterval(tik, TIK);
|
||||
if (!gorunenVar && sayac) {
|
||||
window.clearInterval(sayac);
|
||||
sayac = 0;
|
||||
}
|
||||
}
|
||||
|
||||
/* ------------------------------------------------------------------ */
|
||||
/* Sahne 1 — 24 tercih, binlerce ihtimal */
|
||||
/* ------------------------------------------------------------------ */
|
||||
|
||||
// Doku alanı (`o` eski durağan resimdeki 24 turuncu kare: ilk seçim).
|
||||
const IHTIMAL = [
|
||||
"o#o#######o##o##o#######",
|
||||
"####o###o#########o###o#",
|
||||
"######o####o###o########",
|
||||
"#o##o###################",
|
||||
"######o##o####o####o##o#",
|
||||
"#o##########o####o######",
|
||||
".###..o#......####.#..o.",
|
||||
"..#...###...##......#...",
|
||||
];
|
||||
|
||||
const ihtimalHucreleri = IHTIMAL.flatMap((satir, y) =>
|
||||
[...satir].flatMap((c, x) => (c === "." ? [] : [{ x, y, ilk: c === "o" }])),
|
||||
);
|
||||
|
||||
/** Her biri tam 24 hücrelik seçimler; sıra, karelerin ısınma sırasıdır. */
|
||||
const SECIMLER: string[][] = [
|
||||
ihtimalHucreleri.filter((h) => h.ilk).map((h) => `${h.x}-${h.y}`),
|
||||
...[3, 8].map((tohum) =>
|
||||
ihtimalHucreleri
|
||||
// Alt iki seyrek satır seçime girmez: 24 kare alanın içinde kalsın
|
||||
.filter((h) => h.y < 6)
|
||||
.map((h) => ({ h, r: pikselHash(h.x, h.y, tohum) }))
|
||||
.sort((a, b) => a.r - b.r)
|
||||
.slice(0, 24)
|
||||
.map(({ h }) => `${h.x}-${h.y}`),
|
||||
),
|
||||
];
|
||||
|
||||
/** `adim` 0: hepsi soğur (binlerce ihtimal). `adim` 1: yeni 24 tek tek ısınır. */
|
||||
function ihtimalSahnesi(dongu: number, adim: number): MorfPiksel[] {
|
||||
const secim = adim === 0 ? [] : SECIMLER[dongu % SECIMLER.length];
|
||||
const sira = new Map(secim.map((id, i) => [id, i]));
|
||||
return ihtimalHucreleri.map((h) => {
|
||||
const id = `${h.x}-${h.y}`;
|
||||
const s = sira.get(id);
|
||||
return {
|
||||
id,
|
||||
x: h.x,
|
||||
y: h.y,
|
||||
op: dokuOpakligi(h.x, h.y),
|
||||
ton: s === undefined ? "doku" : "vurgu",
|
||||
// İlk boyamada (dongu 0) gecikme yok: resim hazır gelir
|
||||
gecikme: s !== undefined && dongu > 0 ? s * 42 : undefined,
|
||||
};
|
||||
});
|
||||
}
|
||||
|
||||
/* ------------------------------------------------------------------ */
|
||||
/* Sahne 2 — Geçen yılın puanı yetmiyor */
|
||||
/* ------------------------------------------------------------------ */
|
||||
|
||||
// Yıl yıl çubuk boyları; ilk altısı eski durağan resim (5·3·6·4·7·4).
|
||||
const BOYLAR = [5, 3, 6, 4, 7, 4, 6, 3, 5, 2, 7];
|
||||
const GORUNEN = 6;
|
||||
// Görünen altı yuva + solda çıkan + sağda sırasını bekleyen = 8 çubuk döner.
|
||||
const CUBUK = GORUNEN + 2;
|
||||
const EN_BOY = 7;
|
||||
|
||||
function yillarSahnesi(dongu: number): MorfPiksel[] {
|
||||
const pikseller: MorfPiksel[] = [];
|
||||
for (let b = 0; b < CUBUK; b++) {
|
||||
// Bu çubuğun şu an taşıdığı yıl: dongu-1 … dongu+6 aralığında, b ile denk
|
||||
const yil = dongu - 1 + ((((b - (dongu - 1)) % CUBUK) + CUBUK) % CUBUK);
|
||||
const yuva = yil - dongu; // -1 (çıktı) … 6 (bekliyor)
|
||||
const sahnede = yuva >= 0 && yuva < GORUNEN;
|
||||
const boy = BOYLAR[((yil % BOYLAR.length) + BOYLAR.length) % BOYLAR.length];
|
||||
for (let c = 0; c < 2; c++) {
|
||||
for (let r = 0; r < EN_BOY; r++) {
|
||||
pikseller.push({
|
||||
id: `${b}-${c}-${r}`,
|
||||
x: 1 + yuva * 4 + c,
|
||||
y: SATIR - 1 - r,
|
||||
op: dokuOpakligi(b * 2 + c, r),
|
||||
ton:
|
||||
!sahnede || r >= boy
|
||||
? "gizli"
|
||||
: // Yalnız en yeni yılın tepesi turuncu (bu yılın tabanı)
|
||||
yuva === GORUNEN - 1 && r === boy - 1
|
||||
? "vurgu"
|
||||
: "doku",
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
return pikseller;
|
||||
}
|
||||
|
||||
/* ------------------------------------------------------------------ */
|
||||
/* Sahne 3 — Danışman lüks haline geldi */
|
||||
/* ------------------------------------------------------------------ */
|
||||
|
||||
const BASAMAK = 8;
|
||||
|
||||
/** `adim`: turuncu tepenin durduğu basamak (0 en alt, 7 en üst = eski resim). */
|
||||
function fiyatSahnesi(adim: number): MorfPiksel[] {
|
||||
const pikseller: MorfPiksel[] = [];
|
||||
for (let k = 0; k < BASAMAK; k++) {
|
||||
for (let c = 0; c < 3; c++) {
|
||||
const x = k * 3 + c;
|
||||
const ustY = SATIR - 1 - k;
|
||||
// Basamağın üstü: tepe buradan geçtikten sonra dolu doku
|
||||
pikseller.push({
|
||||
id: `u-${k}-${c}`,
|
||||
x,
|
||||
y: ustY,
|
||||
op: dokuOpakligi(x, ustY),
|
||||
ton: k < adim ? "doku" : "gizli",
|
||||
});
|
||||
// Basamağın altındaki silik dolgu
|
||||
for (let r = 1; r <= k; r++) {
|
||||
pikseller.push({
|
||||
id: `d-${k}-${c}-${r}`,
|
||||
x,
|
||||
y: ustY + r,
|
||||
op: dokuOpakligi(x, ustY + r),
|
||||
ton: k <= adim ? "silik" : "gizli",
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
// Turuncu tepe: üç piksel, basamaktan basamağa süzülür
|
||||
for (let c = 0; c < 3; c++) {
|
||||
pikseller.push({
|
||||
id: `tepe-${c}`,
|
||||
x: adim * 3 + c,
|
||||
y: SATIR - 1 - adim,
|
||||
op: 0.3,
|
||||
ton: "vurgu",
|
||||
});
|
||||
}
|
||||
return pikseller;
|
||||
}
|
||||
|
||||
/* ------------------------------------------------------------------ */
|
||||
|
||||
const SAHNE: Record<
|
||||
SorunSahnesiTuru,
|
||||
{
|
||||
adimSayisi: number;
|
||||
adimMs: number;
|
||||
/** Kayma süresi (sn); verilmezse ilkelin varsayılanı */
|
||||
sure?: number;
|
||||
ciz: (dongu: number, adim: number) => MorfPiksel[];
|
||||
}
|
||||
> = {
|
||||
// Önce hepsi soğur (vurgunun soğuması 1,2 sn), sonra yeni 24 ısınır
|
||||
ihtimal: { adimSayisi: 2, adimMs: 1100, ciz: ihtimalSahnesi },
|
||||
yillar: { adimSayisi: 1, adimMs: 0, ciz: (dongu) => yillarSahnesi(dongu) },
|
||||
fiyat: {
|
||||
adimSayisi: BASAMAK,
|
||||
adimMs: 300,
|
||||
sure: 0.3,
|
||||
ciz: (_dongu, adim) => fiyatSahnesi(adim),
|
||||
},
|
||||
};
|
||||
|
||||
export function SorunSahnesi({
|
||||
tur,
|
||||
sira,
|
||||
}: {
|
||||
tur: SorunSahnesiTuru;
|
||||
/** Kartın sırası (0, 1, 2): sahneler bu sırayla konuşur. */
|
||||
sira: number;
|
||||
}) {
|
||||
const azalt = useReducedMotion();
|
||||
const kapRef = useRef<HTMLDivElement>(null);
|
||||
const sahne = SAHNE[tur];
|
||||
// Başlangıç (sunucu HTML'i, hareketi azalt): eski durağan resim = son adım.
|
||||
const [an, setAn] = useState({ dongu: 0, adim: sahne.adimSayisi - 1 });
|
||||
|
||||
useEffect(() => {
|
||||
const kap = kapRef.current;
|
||||
if (azalt || !kap || typeof IntersectionObserver === "undefined") return;
|
||||
|
||||
let zamanlayicilar: number[] = [];
|
||||
const kayit: Kayit = {
|
||||
sira,
|
||||
gorunur: false,
|
||||
sonBaslangic: -Infinity,
|
||||
oynat: () => {
|
||||
zamanlayicilar.forEach((z) => window.clearTimeout(z));
|
||||
zamanlayicilar = [];
|
||||
setAn((o) => ({ dongu: o.dongu + 1, adim: 0 }));
|
||||
for (let a = 1; a < sahne.adimSayisi; a++) {
|
||||
zamanlayicilar.push(
|
||||
window.setTimeout(
|
||||
() => setAn((o) => ({ ...o, adim: a })),
|
||||
a * sahne.adimMs,
|
||||
),
|
||||
);
|
||||
}
|
||||
},
|
||||
};
|
||||
kayitlar.add(kayit);
|
||||
|
||||
const io = new IntersectionObserver(
|
||||
([k]) => {
|
||||
kayit.gorunur = k.isIntersecting;
|
||||
saatiAyarla();
|
||||
},
|
||||
{ threshold: 0.6 },
|
||||
);
|
||||
io.observe(kap);
|
||||
|
||||
// Bakana cevap: karta imleç gelince ya da dokununca sahne hemen oynar.
|
||||
const kart = kap.closest<HTMLElement>("[data-sahne-karti]") ?? kap;
|
||||
const elle = () => {
|
||||
const simdi = performance.now();
|
||||
if (simdi - kayit.sonBaslangic < ELLE_ARASI) return;
|
||||
sozVer(kayit, simdi);
|
||||
};
|
||||
kart.addEventListener("pointerenter", elle);
|
||||
|
||||
return () => {
|
||||
kart.removeEventListener("pointerenter", elle);
|
||||
io.disconnect();
|
||||
zamanlayicilar.forEach((z) => window.clearTimeout(z));
|
||||
kayitlar.delete(kayit);
|
||||
saatiAyarla();
|
||||
};
|
||||
}, [azalt, sira, sahne]);
|
||||
|
||||
const pikseller = useMemo(
|
||||
() => sahne.ciz(an.dongu, an.adim),
|
||||
[sahne, an.dongu, an.adim],
|
||||
);
|
||||
|
||||
return (
|
||||
<div ref={kapRef}>
|
||||
<PikselMorf
|
||||
pikseller={pikseller}
|
||||
sutun={SUTUN}
|
||||
satir={SATIR}
|
||||
style={
|
||||
sahne.sure
|
||||
? ({ "--morf-sure": `${sahne.sure}s` } as React.CSSProperties)
|
||||
: undefined
|
||||
}
|
||||
/>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
@@ -118,10 +118,12 @@ function ArkaKare({
|
||||
// Arka katman ters yöne ve daha çok kayar: derinlik hissi
|
||||
const x = useTransform(mx, (v) => -v * GUC * 1.4);
|
||||
const y = useTransform(my, (v) => -v * GUC);
|
||||
// Odak dışı: kareler bulanık durur, net olan yalnız haplardır. Bulanıklık
|
||||
// karenin kendisindedir (kapta değil) — kayarken yeniden çizilmez.
|
||||
return (
|
||||
<motion.span
|
||||
className={cn(
|
||||
"absolute rounded",
|
||||
"absolute rounded blur-xs",
|
||||
kare.sicak ? "bg-orange-500/70" : "bg-primary/15",
|
||||
)}
|
||||
style={{ left: `${kare.x}%`, top: `${kare.y}%`, width: kare.boy, height: kare.boy, x, y }}
|
||||
|
||||
@@ -19,6 +19,10 @@
|
||||
*
|
||||
* İmleç gelmese de rastgele pikseller tek tük, seyrek aralıklarla turuncuya
|
||||
* ısınıp söner (usePixelHeat `kirpisma`); "hareketi azalt"ta kapalıdır.
|
||||
*
|
||||
* Kıyının altındaki serpinti canlıdır: piksellerin bir kısmı yerinden kopup
|
||||
* aşağı düşer ve yeniden belirir (CSS, `.kt-serpinti`). Telefonda imleç
|
||||
* olmadığı için haritanın hareketi budur.
|
||||
*/
|
||||
|
||||
import { useRef } from "react";
|
||||
@@ -137,8 +141,16 @@ const MAP_MARKUP = (() => {
|
||||
const op =
|
||||
Math.round(opacityFor(x, y) * (1 - d / (SCATTER_DEPTH + 1)) * 100) /
|
||||
100;
|
||||
// Serpintinin üçte biri damlar (globals.css `.kt-serpinti`): piksel
|
||||
// yerinden kopup 1–3 hücre düşerken söner, sonra yerinde yeniden
|
||||
// belirir. Harita bitmez, dökülür (DESIGN.md §11.1 V2); süre ve faz
|
||||
// pikselden piksele farklı ki yağmur gibi sıralı düşmesin.
|
||||
const damla =
|
||||
hash(x, y, 57) > 0.67
|
||||
? ` class="kt-serpinti" style="--d:${10 + Math.round(hash(x, y, 61) * 20)};animation-duration:${(4.5 + hash(x, y, 67) * 4).toFixed(2)}s;animation-delay:-${(hash(x, y, 71) * 8).toFixed(2)}s"`
|
||||
: "";
|
||||
parts.push(
|
||||
`<rect data-px data-cx="${x * CELL + CELL / 2}" data-cy="${y * CELL + CELL / 2}" data-op="${op}" ${rectAttrs(x, y)} fill="currentColor" fill-opacity="${op}"/>`,
|
||||
`<rect data-px data-cx="${x * CELL + CELL / 2}" data-cy="${y * CELL + CELL / 2}" data-op="${op}" ${rectAttrs(x, y)} fill="currentColor" fill-opacity="${op}"${damla}/>`,
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -8,9 +8,13 @@
|
||||
//
|
||||
// Kartsız ve zeminsizdir (Bilal, 7 Eki 2026): sayfa zemininde açıkta durur,
|
||||
// eskiden altında duran sayılar ve dürüstlük notu geniş ekranda iki yanına
|
||||
// dizilir (yerleşim app/page.tsx'te). Ortadaki işaret site başlığındaki
|
||||
// logonun animasyonunu oynar: kareler sırayla birbirinin yerine süzülür
|
||||
// (`AnimasyonluMark` "rota").
|
||||
// dizilir (yerleşim app/page.tsx'te).
|
||||
//
|
||||
// Ortadaki işaret danışmanın kendisidir (Bilal, 11 Eki 2026): bir süre
|
||||
// DanışmanlaKonuş başlığındaki gibi nabız atar (danışman düşünüyor), sonra
|
||||
// üç kare girdilerden çıkan şeye dönüşür, durur ve logoya toplanır — sırayla
|
||||
// liste, trend çubukları, sohbet balonları (`AnimasyonluMark` `bicimler`,
|
||||
// §4.34). Eski "rota" (kareler birbirinin yerine süzülür) kaldırıldı.
|
||||
//
|
||||
// Esin: React Bits "Center Flow" (merkezden çevreye akan çizgiler). Kod bize
|
||||
// ait: parlama/bulanıklık yok (§2.2), akış yönü içeri doğrudur ve yalnız
|
||||
@@ -18,9 +22,14 @@
|
||||
|
||||
import { useEffect, useRef, useState, type CSSProperties } from "react";
|
||||
import { Compass, MapPin, PieChart, TrendingUp, Trophy, Users } from "lucide-react";
|
||||
import { AnimasyonluMark } from "@/components/animasyonlu-mark";
|
||||
import { AnimasyonluMark, type Bicim } from "@/components/animasyonlu-mark";
|
||||
import { cn } from "@/lib/utils";
|
||||
|
||||
// Girdilerden çıkanlar, paketin verdiği sırayla: 24'lük liste, her tercihin
|
||||
// trend analizi, danışmana soru. Bileşen dışında sabit: dizi değişirse sıra
|
||||
// başa döner (animasyonlu-mark.tsx).
|
||||
const CIKTILAR: readonly Bicim[] = ["deste", "trend", "sohbet"];
|
||||
|
||||
// Sağ yarı (−60°, 0°, 60°) veri; sol yarı (120°, 180°, 240°) öğrencinin seçimi.
|
||||
const DUGUMLER = [
|
||||
{ etiket: "Taban sıralamaları", ikon: TrendingUp, aci: -60, kaynak: "veri" },
|
||||
@@ -40,9 +49,15 @@ const IC_BOSLUK = 15.5;
|
||||
/** Akan karenin kenarı (hero noktasının viewBox karşılığı). */
|
||||
const KARE = 2.4;
|
||||
|
||||
// Üç ondalığa yuvarlanır: sunucu (Node) ile tarayıcının sin/cos'u son
|
||||
// basamakta ayrışıyor, yuvarlanmazsa hidrasyon uyuşmazlığı çıkıyor.
|
||||
const yuvarla = (v: number) => Math.round(v * 1000) / 1000;
|
||||
const nokta = (aci: number, r: number) => {
|
||||
const rad = (aci * Math.PI) / 180;
|
||||
return { x: 50 + Math.cos(rad) * r, y: 50 + Math.sin(rad) * r };
|
||||
return {
|
||||
x: yuvarla(50 + Math.cos(rad) * r),
|
||||
y: yuvarla(50 + Math.sin(rad) * r),
|
||||
};
|
||||
};
|
||||
|
||||
export function VeriAkisi({ className }: { className?: string }) {
|
||||
@@ -143,9 +158,14 @@ export function VeriAkisi({ className }: { className?: string }) {
|
||||
})}
|
||||
|
||||
<div className="absolute top-1/2 left-1/2 flex size-24 -translate-x-1/2 -translate-y-1/2 items-center justify-center rounded-3xl border border-slate-200 bg-card">
|
||||
{/* Site başlığındaki logonun animasyonu (rota): orada üzerine
|
||||
gelince, burada ekrandayken sürekli oynar. */}
|
||||
<AnimasyonluMark oynat={oynuyor} className="size-14" />
|
||||
{/* Danışmanın nabzı, aralıklarla çıktıya dönüşür (liste → trend →
|
||||
sohbet) ve logoya toplanır; yalnız ekrandayken oynar. */}
|
||||
<AnimasyonluMark
|
||||
oynat={oynuyor}
|
||||
varyant="nabiz"
|
||||
bicimler={CIKTILAR}
|
||||
className="size-14"
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
<figcaption className="mt-8 text-center text-sm leading-relaxed text-slate-500">
|
||||
|
||||
@@ -274,11 +274,7 @@ export function ListeUretici({
|
||||
? "Liste üretimi 3 kredi. +30 kredi yüklediğinde listen ve sohbet geçmişin duruyor, kaldığın yerden devam edersin."
|
||||
: "Liste üretimi 3 kredi. Tercih Dönemi Paketi'yle 60 kredi, tam liste, PDF ve revizyon hakları birlikte gelir."}
|
||||
</p>
|
||||
<Button
|
||||
asChild
|
||||
size="lg"
|
||||
className="mt-6 cursor-pointer bg-orange-500 text-white transition-colors duration-200 hover:bg-orange-600"
|
||||
>
|
||||
<Button asChild size="lg" variant="cta" className="mt-6">
|
||||
<Link href="/paket?kaynak=kredi_bitti">
|
||||
{hasPaket ? "+30 kredi yükle — 129 TL" : "Paketi aktive et — 299 TL"}
|
||||
<ArrowRight className="size-4" aria-hidden />
|
||||
@@ -301,8 +297,9 @@ export function ListeUretici({
|
||||
</p>
|
||||
<Button
|
||||
size="lg"
|
||||
variant="cta"
|
||||
onClick={() => profil && void uret(profil)}
|
||||
className="mt-6 cursor-pointer bg-orange-500 text-white transition-colors duration-200 hover:bg-orange-600"
|
||||
className="mt-6"
|
||||
>
|
||||
Tekrar dene
|
||||
<RefreshCcw className="size-4" aria-hidden />
|
||||
@@ -354,9 +351,10 @@ function SunucuYokEkrani() {
|
||||
</p>
|
||||
<Button
|
||||
size="lg"
|
||||
variant="cta"
|
||||
onClick={() => void dene()}
|
||||
disabled={deniyor}
|
||||
className="mt-6 cursor-pointer bg-orange-500 text-white transition-colors duration-200 hover:bg-orange-600"
|
||||
className="mt-6"
|
||||
>
|
||||
{deniyor ? "Kontrol ediliyor…" : "Listemi aç"}
|
||||
<ArrowRight className="size-4" aria-hidden />
|
||||
@@ -381,11 +379,7 @@ function SuruyorEkrani() {
|
||||
Bunu başka bir sekmede başlatmışsın. İki kez kurmayalım — kredin bu
|
||||
denemede harcanmadı. Hazır olunca listende görünecek.
|
||||
</p>
|
||||
<Button
|
||||
asChild
|
||||
size="lg"
|
||||
className="mt-6 cursor-pointer bg-orange-500 text-white transition-colors duration-200 hover:bg-orange-600"
|
||||
>
|
||||
<Button asChild size="lg" variant="cta" className="mt-6">
|
||||
<Link href="/listem">
|
||||
Listeme git
|
||||
<ArrowRight className="size-4" aria-hidden />
|
||||
@@ -417,9 +411,10 @@ function UretimGovdesi({ uzunSurdu }: { uzunSurdu: boolean }) {
|
||||
tıkalı olduğundan router.refresh burada işe yaramaz. replace:
|
||||
geri tuşu ?uret=1'e dönüp üretimi yeniden başlatmasın. */}
|
||||
<Button
|
||||
variant="outline"
|
||||
variant="ikincil"
|
||||
size="lg"
|
||||
onClick={() => window.location.replace("/listem")}
|
||||
className="mt-2 cursor-pointer"
|
||||
className="mt-2"
|
||||
>
|
||||
Listemi kontrol et
|
||||
<ArrowRight className="size-4" aria-hidden />
|
||||
|
||||
@@ -9,8 +9,8 @@ import {
|
||||
useTercihProfili,
|
||||
} from "@/features/liste/hooks/use-tercih-profili";
|
||||
|
||||
// Her iki dalın butonu da aynı CTA: sınıf seti tek yerde dursun.
|
||||
const CTA_SINIF = "mt-6 cursor-pointer bg-orange-500 text-white hover:bg-orange-600";
|
||||
// Her iki dalın butonu da kanonik CTA (`variant="cta"`, §4.1); burada yalnız yerleşim.
|
||||
const CTA_SINIF = "mt-6";
|
||||
|
||||
/**
|
||||
* /listem boş hâlinin metni + CTA'sı: seçimleri zaten hazır olan adayı
|
||||
@@ -31,7 +31,7 @@ export function ListemBosCta() {
|
||||
</p>
|
||||
<PagePixelDivider seed={67} className="mx-auto mt-6" />
|
||||
{profil ? (
|
||||
<Button asChild size="lg" className={CTA_SINIF}>
|
||||
<Button asChild size="lg" variant="cta" className={CTA_SINIF}>
|
||||
<Link href="/listem?uret=1&kaynak=bos_durum">
|
||||
Yapay Zeka listeni kur
|
||||
<ArrowRight className="size-4" aria-hidden />
|
||||
@@ -41,6 +41,7 @@ export function ListemBosCta() {
|
||||
<Button
|
||||
type="button"
|
||||
size="lg"
|
||||
variant="cta"
|
||||
className={CTA_SINIF}
|
||||
onClick={() => profilToplamaAc("sihirbaz", true, "listem_bos")}
|
||||
>
|
||||
|
||||
@@ -58,9 +58,9 @@ const SUTUN_ARALIGI = 24;
|
||||
const kolonTabani = () =>
|
||||
window.matchMedia("(min-width: 1280px)").matches ? 440 : 380;
|
||||
|
||||
// Başlık satırındaki ikincil düğmeler: 44 px, hover tek turuncu (§4.1, §2.1)
|
||||
const IKINCIL_BUTON =
|
||||
"h-11 cursor-pointer px-4 transition-[background-color,border-color,color,transform] duration-150 hover:border-orange-500 hover:bg-orange-50/60 hover:text-orange-500 active:scale-[0.97]";
|
||||
// Başlık satırındaki ikincil düğmeler: `variant="ikincil"` (hover ve basma
|
||||
// tepkisi varyanttan, §4.1); burada yalnız 44 px boy ve yatay boşluk kalır.
|
||||
const IKINCIL_BUTON = "h-11 px-4";
|
||||
|
||||
export function ListemGovde({
|
||||
rapor,
|
||||
@@ -293,7 +293,10 @@ export function ListemGovde({
|
||||
)}
|
||||
</p>
|
||||
</div>
|
||||
<div className="flex shrink-0 flex-wrap gap-2">
|
||||
{/* `shrink-0` yok: üç düğme 375 px'te 343 px'lik sütuna sığmıyor,
|
||||
grup küçülemeyince PDF sağdan taşıyordu (10 Eki 2026, ölçüldü);
|
||||
grup daralır, düğmeler alt satıra sarar. */}
|
||||
<div className="flex max-w-full flex-wrap gap-2">
|
||||
{/* Tercih düzenleme her kullanıcıya açık: kapı (layout'ta monte
|
||||
TercihProfiliKapisi) profili günceller, /listem'e döner.
|
||||
Profil kayıtlı listeden ayrıldığı anda bu buton "Tercihlerin
|
||||
@@ -316,7 +319,7 @@ export function ListemGovde({
|
||||
) : (
|
||||
<Button
|
||||
type="button"
|
||||
variant="outline"
|
||||
variant="ikincil"
|
||||
onClick={profilDuzenlemeyiAc}
|
||||
className={IKINCIL_BUTON}
|
||||
>
|
||||
@@ -332,7 +335,7 @@ export function ListemGovde({
|
||||
yeniden kurar. Sayı sınırı yok (7 Eki 2026). */}
|
||||
<Button
|
||||
type="button"
|
||||
variant="outline"
|
||||
variant="ikincil"
|
||||
onClick={() => sohbetiOdakla("Listemde şunu değiştir: ")}
|
||||
className={IKINCIL_BUTON}
|
||||
>
|
||||
@@ -341,7 +344,7 @@ export function ListemGovde({
|
||||
</Button>
|
||||
<Button
|
||||
asChild
|
||||
variant="outline"
|
||||
variant="ikincil"
|
||||
className={IKINCIL_BUTON}
|
||||
>
|
||||
<Link href="/rapor/yazdir" target="_blank">
|
||||
@@ -372,8 +375,10 @@ export function ListemGovde({
|
||||
className="flex flex-col items-start gap-3 sm:flex-row sm:items-center sm:justify-between"
|
||||
>
|
||||
<div className="flex gap-3">
|
||||
<span className="flex size-10 shrink-0 items-center justify-center rounded-full bg-orange-100 text-orange-700">
|
||||
<Lock className="size-4" aria-hidden />
|
||||
{/* §4.4 ikon kutusu (fark modalındaki kutuyla aynı dil);
|
||||
orange-100/700 §2.1'in "tek turuncu" kuralı dışındaydı */}
|
||||
<span className="flex size-11 shrink-0 items-center justify-center rounded-xl bg-primary/10">
|
||||
<Lock className="size-5 text-primary" aria-hidden />
|
||||
</span>
|
||||
<div>
|
||||
<p className="font-heading font-bold text-slate-900">
|
||||
@@ -389,11 +394,13 @@ export function ListemGovde({
|
||||
</div>
|
||||
<Button
|
||||
asChild
|
||||
className="h-11 w-full shrink-0 cursor-pointer bg-orange-500 text-white transition-[background-color,transform] duration-200 active:scale-[0.97] hover:bg-orange-600 sm:w-auto"
|
||||
size="lg"
|
||||
variant="cta"
|
||||
className="w-full shrink-0 sm:w-auto"
|
||||
>
|
||||
<Link href="/paket?kaynak=kilit">
|
||||
Analizleri aç — {paketFiyati} TL
|
||||
<ArrowRight data-icon="inline-end" aria-hidden />
|
||||
<ArrowRight className="size-4" aria-hidden />
|
||||
</Link>
|
||||
</Button>
|
||||
</div>
|
||||
@@ -489,7 +496,7 @@ export function ListemGovde({
|
||||
{[
|
||||
"24 tercihin tamamında kişisel risk analizi",
|
||||
"Her program için kısa, gerekçeli Yapay Zeka yorumu",
|
||||
"2 liste revizyonu ve paylaşılabilir PDF",
|
||||
"Sınırsız liste revizyonu ve paylaşılabilir PDF",
|
||||
`${paketKredi} Yapay Zeka danışman sorusu`,
|
||||
].map((ozellik) => (
|
||||
<li key={ozellik} className="flex items-start gap-2.5">
|
||||
@@ -509,14 +516,10 @@ export function ListemGovde({
|
||||
</p>
|
||||
</div>
|
||||
|
||||
<Button
|
||||
asChild
|
||||
size="lg"
|
||||
className="mt-5 w-full cursor-pointer bg-orange-500 text-white transition-[background-color,transform] duration-200 active:scale-[0.97] hover:bg-orange-600"
|
||||
>
|
||||
<Button asChild size="lg" variant="cta" className="mt-5 w-full">
|
||||
<Link href="/paket?kaynak=kilit">
|
||||
Kişisel analizi aç
|
||||
<ArrowRight data-icon="inline-end" aria-hidden />
|
||||
<ArrowRight className="size-4" aria-hidden />
|
||||
</Link>
|
||||
</Button>
|
||||
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
import { cookies } from "next/headers";
|
||||
import { redirect } from "next/navigation";
|
||||
import { Sparkles } from "lucide-react";
|
||||
import { Check } from "lucide-react";
|
||||
import { AnimasyonluMark } from "@/components/animasyonlu-mark";
|
||||
import { verifySession, getCurrentUser } from "@/lib/session";
|
||||
import {
|
||||
PROFIL_CEREZ_ADI,
|
||||
@@ -69,7 +70,9 @@ export async function ListemIcerik({
|
||||
if (!raporVar) {
|
||||
const bosDurum = (
|
||||
<section className="mx-auto flex max-w-2xl flex-col items-center px-4 py-16 text-center">
|
||||
<Sparkles className="size-10 text-primary" aria-hidden />
|
||||
{/* Boş durumun tepesinde yıldız değil marka işareti (§7 "AI izi";
|
||||
§11.2 "önce imza, sonra içerik"); durağan. */}
|
||||
<AnimasyonluMark oynat={false} className="size-10" />
|
||||
<h1 className="mt-4 font-heading text-2xl font-bold">
|
||||
Henüz Yapay Zeka listen yok
|
||||
</h1>
|
||||
@@ -148,7 +151,7 @@ export async function ListemIcerik({
|
||||
role="status"
|
||||
className="mb-6 flex items-center gap-3 rounded-2xl border border-emerald-200 bg-emerald-50 px-4 py-3 text-sm font-medium text-emerald-800"
|
||||
>
|
||||
<Sparkles className="size-4 shrink-0" aria-hidden />
|
||||
<Check className="size-4 shrink-0" aria-hidden />
|
||||
Paketin aktif — listendeki tercihlerin tamamı, gerekçeler, riskler ve
|
||||
PDF artık açık.
|
||||
</div>
|
||||
|
||||
@@ -82,6 +82,7 @@ export function RaporSatirDetayi({
|
||||
riskNotu,
|
||||
trendOzeti,
|
||||
oneCikan,
|
||||
sikistir,
|
||||
}: {
|
||||
dilim: string;
|
||||
risk: RiskSeviyesi;
|
||||
@@ -91,11 +92,18 @@ export function RaporSatirDetayi({
|
||||
trendOzeti: string;
|
||||
/** Koddan hesaplanan "öne çıkan" veriler (uyum puanı); yoksa satır çizilmez */
|
||||
oneCikan?: string[];
|
||||
/** Sıkı ölçü (tadımlık, dar sütun): metin bir kademe küçük, kutu dolgusu
|
||||
* bir kademe az. Aynı iskelet, aynı etiketler — yalnız ölçü değişir. */
|
||||
sikistir?: boolean;
|
||||
}) {
|
||||
const stil = RISK_STIL[risk];
|
||||
// Risk etiketi yalnızca dilimin varsayılanından farklıysa yazılır; yoksa
|
||||
// üçüncü dilimde başlık "Güvenli · Güvenli" olurdu (bkz. risk.ts).
|
||||
const farkliRisk = dilimdenFarkliRiskEtiketi(dilim, risk);
|
||||
const kutu = cn(
|
||||
"rounded-xl border border-slate-200 bg-card",
|
||||
sikistir ? "p-3" : "p-4",
|
||||
);
|
||||
return (
|
||||
<>
|
||||
<div className="mb-3 flex flex-wrap items-center gap-2 text-sm text-slate-500">
|
||||
@@ -108,8 +116,13 @@ export function RaporSatirDetayi({
|
||||
<span>· {UNITUR_ETIKET[unitur]?.cip ?? unitur}</span>
|
||||
) : null}
|
||||
</div>
|
||||
<dl className="grid gap-3 text-base leading-relaxed sm:grid-cols-2">
|
||||
<div className="rounded-xl border border-slate-200 bg-card p-4">
|
||||
<dl
|
||||
className={cn(
|
||||
"grid leading-relaxed sm:grid-cols-2",
|
||||
sikistir ? "gap-2 text-sm" : "gap-3 text-base",
|
||||
)}
|
||||
>
|
||||
<div className={kutu}>
|
||||
<dt className="text-sm font-semibold text-slate-900">
|
||||
Neden listede?
|
||||
</dt>
|
||||
@@ -121,7 +134,7 @@ export function RaporSatirDetayi({
|
||||
</dd>
|
||||
) : null}
|
||||
</div>
|
||||
<div className="rounded-xl border border-slate-200 bg-card p-4">
|
||||
<div className={kutu}>
|
||||
<dt className="text-sm font-semibold text-slate-900">
|
||||
Risk ve Yapay Zeka yorumu
|
||||
</dt>
|
||||
|
||||
@@ -5,20 +5,21 @@ import { useChat } from "@ai-sdk/react";
|
||||
import { DefaultChatTransport, type ChatTransport, type UIMessage } from "ai";
|
||||
import Link from "next/link";
|
||||
import { useRouter } from "next/navigation";
|
||||
import { animate, useReducedMotion } from "motion/react";
|
||||
import { AnimatePresence, animate, motion, useReducedMotion } from "motion/react";
|
||||
import {
|
||||
ArrowRight,
|
||||
ArrowUp,
|
||||
Coins,
|
||||
Info,
|
||||
Lock,
|
||||
Maximize2,
|
||||
Minimize2,
|
||||
Sparkles,
|
||||
Trash2,
|
||||
X,
|
||||
} from "lucide-react";
|
||||
import { toast } from "@/components/ui/bildirim";
|
||||
import { cn } from "@/lib/utils";
|
||||
import { YAY } from "@/lib/hareket";
|
||||
import { SayiRulo } from "@/components/ui/sayi-rulo";
|
||||
import { AnimasyonluMark } from "@/components/animasyonlu-mark";
|
||||
import { AracPilleri, aracPilleri } from "./arac-pilleri";
|
||||
@@ -168,8 +169,10 @@ function cevapAnahtari(mesajlar: UIMessage[], i: number): string {
|
||||
|
||||
// Araç adı → öğrenci dili eşlemesi ve "…bakıyorum" hapları arac-pilleri.tsx'te.
|
||||
|
||||
/** Panelin boyut geçişi: sekmesiz yay (DESIGN.md §6); listem-govde ızgarası aynı yayı kullanır. */
|
||||
export const SOHBET_GENISLEME_GECISI = { type: "spring", bounce: 0, duration: 0.35 } as const;
|
||||
/** Panelin boyut geçişi: sihirbaz adım paneliyle AYNI yay (`YAY.adim`,
|
||||
* adim-gecisi.ts; Bilal, 10 Eki 2026: "danışmanla konuş'taki motion wizard
|
||||
* ile aynı olsun"). listem-govde ızgarası ve sayfa kaydırması da bunu kullanır. */
|
||||
export const SOHBET_GENISLEME_GECISI = YAY.adim;
|
||||
|
||||
/**
|
||||
* Genişletilmiş panel üstten `top-28` (7rem; listem sütununun sticky ofseti)
|
||||
@@ -198,6 +201,28 @@ const GENIS_EN_AZ_PX = 380;
|
||||
/** /dev/sohbet gibi sticky'siz yerlerde de aynı hesap; sabit yükseklik istenirse `genisYukseklik`. */
|
||||
const GENIS_YUKSEKLIK = "";
|
||||
|
||||
/**
|
||||
* Panel başlığındaki ikon düğmeleri (genişlet / bilgi / temizle): görünür
|
||||
* 32 px (paneldeki h-8 çip ve araç haplarıyla aynı boy), dokunma alanı
|
||||
* görünmez taşmayla 44 px (§8) — eski `size-7` hem 44'ün altındaydı hem ikonu
|
||||
* çip boyutunda bırakıyordu. 36 px (`size-9`) denendi (10 Eki 2026): 375 px'te
|
||||
* başlık "DanışmanlaK…" diye kırpılıyordu; 32 px'te üç düğme + kredi hapı +
|
||||
* başlık yan yana sığıyor.
|
||||
*/
|
||||
const BASLIK_DUGMESI =
|
||||
"relative inline-flex size-8 shrink-0 cursor-pointer items-center justify-center rounded-full border border-slate-200 bg-card text-slate-600 transition-[background-color,color,transform] duration-150 before:absolute before:-inset-1.5 before:content-[''] hover:bg-slate-100 hover:text-slate-800 active:scale-[0.96] motion-reduce:active:scale-100";
|
||||
|
||||
/**
|
||||
* Kredi hapı: üst çubuktaki kredi hapının sınıf dizisi (user-nav.tsx; §11.1 V4
|
||||
* "çubuk kullanıcının durumudur" — aynı durum burada da aynı biçimde durur),
|
||||
* yalnız boy panelin ölçeğinde (h-8, başlık düğmeleri ve çiplerle aynı).
|
||||
* Eski amber hap bu üründe risk dilinin "az riskli"
|
||||
* tonuydu (tercih-degisti-modali.tsx notu), kredi için yanlış sinyaldi.
|
||||
* "kredi" sözcüğü yalnız sm'den itibaren: 375 px'te başlık kırpılmasın.
|
||||
*/
|
||||
const KREDI_HAPI =
|
||||
"inline-flex h-8 shrink-0 items-center gap-1.5 whitespace-nowrap rounded-full border border-slate-200 bg-card px-2.5 text-xs font-semibold text-slate-700 transition-colors duration-200 hover:border-slate-300 hover:bg-slate-50 sm:px-3";
|
||||
|
||||
type Red = { status: number; error?: string };
|
||||
|
||||
/**
|
||||
@@ -725,31 +750,35 @@ export function SohbetClient({
|
||||
Temizle butonu ikon-only — metinli hâli başlıkla yarışıp taşıyordu. */}
|
||||
<div className="flex items-center gap-2 border-b border-slate-100 px-4 py-3">
|
||||
<DanismanBaslik />
|
||||
<div className="flex shrink-0 items-center gap-1.5">
|
||||
<div className="flex shrink-0 items-center gap-1">
|
||||
<button
|
||||
type="button"
|
||||
onClick={genisligiDegistir}
|
||||
aria-pressed={genis}
|
||||
aria-label={genis ? "Sohbeti daralt" : "Sohbeti genişlet"}
|
||||
title={genis ? "Daralt" : "Genişlet"}
|
||||
className="inline-flex size-7 cursor-pointer items-center justify-center rounded-full border border-slate-200 bg-card text-slate-600 transition-[background-color,color,transform] duration-150 hover:bg-slate-100 hover:text-slate-800 active:scale-[0.96]"
|
||||
className={BASLIK_DUGMESI}
|
||||
>
|
||||
{genis ? (
|
||||
<Minimize2 className="size-3.5" aria-hidden />
|
||||
<Minimize2 className="size-4" aria-hidden />
|
||||
) : (
|
||||
<Maximize2 className="size-3.5" aria-hidden />
|
||||
<Maximize2 className="size-4" aria-hidden />
|
||||
)}
|
||||
</button>
|
||||
{bildikleri?.length ? (
|
||||
<TooltipProvider delayDuration={120}>
|
||||
<Tooltip>
|
||||
<TooltipTrigger asChild>
|
||||
{/* Telefonda (sm altı) gizli: ipucu hover/odakla açılır,
|
||||
dokunmatikte zaten açılmıyordu (ölü düğme) ve 375 px'te
|
||||
başlığı kırpıyordu. Dokunmayla açılan karşılığı (popover)
|
||||
ayrı iş — raporda. */}
|
||||
<button
|
||||
type="button"
|
||||
aria-label="Danışmanın bildikleri"
|
||||
className="inline-flex size-7 cursor-help items-center justify-center rounded-full border border-slate-200 bg-card text-slate-600 transition-colors hover:bg-slate-100 hover:text-slate-800"
|
||||
className={cn(BASLIK_DUGMESI, "cursor-help max-sm:hidden")}
|
||||
>
|
||||
<Info className="size-3.5" aria-hidden />
|
||||
<Info className="size-4" aria-hidden />
|
||||
</button>
|
||||
</TooltipTrigger>
|
||||
<TooltipContent
|
||||
@@ -778,19 +807,25 @@ export function SohbetClient({
|
||||
onClick={() => setTemizleAcik(true)}
|
||||
disabled={bekliyor || temizleniyor}
|
||||
aria-label="Sohbeti temizle"
|
||||
className="inline-flex size-7 cursor-pointer items-center justify-center rounded-full border border-slate-200 bg-card text-slate-600 transition-[background-color,transform] duration-150 hover:bg-slate-100 hover:text-slate-800 active:scale-[0.96] disabled:cursor-not-allowed disabled:opacity-50"
|
||||
className={cn(
|
||||
BASLIK_DUGMESI,
|
||||
"disabled:cursor-not-allowed disabled:opacity-50",
|
||||
)}
|
||||
title="Sohbet geçmişini sil"
|
||||
>
|
||||
<Trash2 className="size-3.5" aria-hidden />
|
||||
<Trash2 className="size-4" aria-hidden />
|
||||
</button>
|
||||
) : null}
|
||||
<Link
|
||||
href="/paket?kaynak=danisman_rozet"
|
||||
className="inline-flex items-center gap-1.5 rounded-full border border-amber-200 bg-amber-50 px-2.5 py-1 text-xs font-semibold text-amber-700 transition-colors hover:bg-amber-100"
|
||||
className={KREDI_HAPI}
|
||||
title="Kredilerin — yüklemek için tıkla"
|
||||
>
|
||||
<Coins className="size-3.5" aria-hidden />
|
||||
<SayiRulo deger={kredi} /> kredi
|
||||
<Coins className="size-3.5 text-amber-500" aria-hidden />
|
||||
<span className="tabular-nums">
|
||||
<SayiRulo deger={kredi} />
|
||||
</span>
|
||||
<span className="hidden sm:inline">kredi</span>
|
||||
</Link>
|
||||
</div>
|
||||
</div>
|
||||
@@ -804,26 +839,39 @@ export function SohbetClient({
|
||||
<span className="text-xs font-semibold text-slate-500">
|
||||
Kaydettiklerim
|
||||
</span>
|
||||
{profil.map((s) => (
|
||||
// Etkileşimli çip (§4.17 kalıbı, kompakt h-8): rozet değil.
|
||||
<span
|
||||
key={s.alan}
|
||||
className="inline-flex h-8 items-center gap-1 rounded-full border border-slate-200 bg-card pr-1 pl-3 text-xs font-semibold text-slate-700"
|
||||
>
|
||||
{s.metin}
|
||||
<button
|
||||
type="button"
|
||||
onClick={() => profilAlaniSil(s.alan)}
|
||||
aria-label={`Sil: ${s.metin}`}
|
||||
className="inline-flex size-6 cursor-pointer items-center justify-center rounded-full text-slate-500 transition-[background-color,color,transform] duration-150 hover:bg-slate-100 hover:text-orange-500 active:scale-[0.96]"
|
||||
{/* Çip silinince yerinden küçülerek söner, komşular kayarak yerini
|
||||
kapatır (§11.2 "değişimi göster"; anında kaybolan çip sessiz
|
||||
eylemdi). Hareketi azalt'ta yalnız opaklık. */}
|
||||
<AnimatePresence initial={false}>
|
||||
{profil.map((s) => (
|
||||
// Etkileşimli çip (§4.17 kalıbı, kompakt h-8): rozet değil.
|
||||
<motion.span
|
||||
key={s.alan}
|
||||
layout={!hareketAz}
|
||||
initial={{ opacity: 0, scale: hareketAz ? 1 : 0.9 }}
|
||||
animate={{ opacity: 1, scale: 1 }}
|
||||
exit={{ opacity: 0, scale: hareketAz ? 1 : 0.9 }}
|
||||
transition={YAY.varsayilan}
|
||||
className="inline-flex h-8 items-center gap-1 rounded-full border border-slate-200 bg-card pr-1 pl-3 text-xs font-semibold text-slate-700"
|
||||
>
|
||||
<X className="size-3.5" aria-hidden />
|
||||
</button>
|
||||
</span>
|
||||
))}
|
||||
{s.metin}
|
||||
{/* Görünür 24 px, dokunma alanı taşmayla 44 px (§8) */}
|
||||
<button
|
||||
type="button"
|
||||
onClick={() => profilAlaniSil(s.alan)}
|
||||
aria-label={`Sil: ${s.metin}`}
|
||||
className="relative inline-flex size-6 cursor-pointer items-center justify-center rounded-full text-slate-500 transition-[background-color,color,transform] duration-150 before:absolute before:-inset-2.5 before:content-[''] hover:bg-slate-100 hover:text-orange-500 active:scale-[0.96] motion-reduce:active:scale-100"
|
||||
>
|
||||
<X className="size-3.5" aria-hidden />
|
||||
</button>
|
||||
</motion.span>
|
||||
))}
|
||||
</AnimatePresence>
|
||||
</div>
|
||||
) : null}
|
||||
|
||||
{/* Onay modalı: yüzey ve başlık DialogContent/DialogTitle varsayılanı
|
||||
(§4.4 sade kutu, §3 h3); aksiyonlar tek kaynak varyantlar (§4.1). */}
|
||||
<Dialog open={temizleAcik} onOpenChange={setTemizleAcik}>
|
||||
<DialogContent>
|
||||
<DialogHeader>
|
||||
@@ -836,15 +884,16 @@ export function SohbetClient({
|
||||
</DialogHeader>
|
||||
<DialogFooter>
|
||||
<Button
|
||||
variant="outline"
|
||||
className="cursor-pointer"
|
||||
variant="ikincil"
|
||||
size="lg"
|
||||
onClick={() => setTemizleAcik(false)}
|
||||
disabled={temizleniyor}
|
||||
>
|
||||
Vazgeç
|
||||
</Button>
|
||||
<Button
|
||||
className="cursor-pointer bg-orange-500 text-white hover:bg-orange-600"
|
||||
variant="cta"
|
||||
size="lg"
|
||||
onClick={sohbetiTemizle}
|
||||
disabled={temizleniyor}
|
||||
>
|
||||
@@ -920,9 +969,12 @@ export function SohbetClient({
|
||||
>
|
||||
{!ozet ? (
|
||||
<>
|
||||
<Sparkles
|
||||
className="mx-auto size-7 text-primary"
|
||||
aria-hidden
|
||||
{/* Boş durumda yıldız değil marka işareti: önce imza,
|
||||
sonra içerik (§11.2); durağan — hareket "düşünüyor" demek. */}
|
||||
<AnimasyonluMark
|
||||
oynat={false}
|
||||
renk="turuncu"
|
||||
className="mx-auto size-8"
|
||||
/>
|
||||
<div>
|
||||
<p className="font-heading font-bold">
|
||||
@@ -1058,16 +1110,17 @@ export function SohbetClient({
|
||||
|
||||
<div className="border-t border-slate-100 p-3">
|
||||
{krediYok ? (
|
||||
<div className="flex flex-wrap items-center justify-between gap-3 rounded-2xl border border-amber-200 bg-amber-50 px-4 py-3">
|
||||
<p className="text-sm font-medium text-amber-800">
|
||||
// Uyarı kutusu (§2 tablo: amber bilgilendirme notu) + kanonik CTA;
|
||||
// eski h-7 buton 44 px'in altındaydı (§8).
|
||||
<div className="flex flex-col gap-3 rounded-2xl border border-amber-200 bg-amber-50 px-4 py-4">
|
||||
<p className="text-sm font-medium text-amber-900">
|
||||
Kredin bitti — sohbete devam etmek için kredi yükle.
|
||||
</p>
|
||||
<Button
|
||||
asChild
|
||||
size="sm"
|
||||
className="cursor-pointer bg-orange-500 text-white hover:bg-orange-600"
|
||||
>
|
||||
<Link href="/paket?kaynak=danisman_kredi_bitti">Kredi yükle</Link>
|
||||
<Button asChild size="lg" variant="cta" className="w-full">
|
||||
<Link href="/paket?kaynak=danisman_kredi_bitti">
|
||||
Kredi yükle
|
||||
<ArrowRight className="size-4" aria-hidden />
|
||||
</Link>
|
||||
</Button>
|
||||
</div>
|
||||
) : (
|
||||
@@ -1102,9 +1155,9 @@ export function SohbetClient({
|
||||
<PromptInputAction tooltip="Gönder (Enter)">
|
||||
<Button
|
||||
size="icon"
|
||||
variant="cta"
|
||||
onClick={() => gonder(girdi)}
|
||||
disabled={bekliyor || !girdi.trim()}
|
||||
className="size-9 cursor-pointer rounded-full bg-orange-500 text-white hover:bg-orange-600"
|
||||
aria-label="Gönder"
|
||||
>
|
||||
{bekliyor ? <DotsLoader size="sm" /> : <ArrowUp className="size-4" aria-hidden />}
|
||||
|
||||
@@ -7,10 +7,17 @@
|
||||
// SSR "genel" satırı render eder (prop), mount sonrası sihirbaz kategorisi
|
||||
// varsa /api/tadimlik'ten kategoriye özel satır çekilip yerinde değiştirilir
|
||||
// (seçim sunucuda kalır). Havuzda içerik yoksa hiç render edilmez.
|
||||
//
|
||||
// Yerleşim (10 Eki 2026, Bilal: "tadımlık çok büyük yer kaplıyor, pazarlama
|
||||
// tarafı eksik"): tek kart, iki sütun — solda öğrencinin kendi sırasına bağlı
|
||||
// başlık + üç kanıt satırı + CTA (PikselCtaYuzeyi'nin "metin solda, kreatif
|
||||
// sağda" kurgusu), sağda örnek satır. Telefonda sıra: başlık → örnek → CTA.
|
||||
// Kutu içinde kutu yok: örnek alanı kartın kendi bandı (border + bg-slate-50),
|
||||
// ayrı yuvarlatılmış iç kutu değil. Ölçüm 1280 px: 599 → ~370 px.
|
||||
|
||||
import { useEffect, useRef, useState } from "react";
|
||||
import Link from "next/link";
|
||||
import { ArrowRight } from "lucide-react";
|
||||
import { ArrowRight, Check } from "lucide-react";
|
||||
import { Button } from "@/components/ui/button";
|
||||
import { UniLogo } from "@/components/uni-logo";
|
||||
import { SectionEyebrow } from "@/components/pixel-decor";
|
||||
@@ -23,9 +30,10 @@ import {
|
||||
} from "@/components/program-liste-verileri";
|
||||
import { useGorunumOlayi } from "@/components/use-gorunum-olayi";
|
||||
import { olay, siraKovasi } from "@/lib/analitik";
|
||||
import { dilimdenRisk, riskHesapla } from "@/lib/risk";
|
||||
import { DILIM_ETIKET, dilimdenRisk, riskHesapla } from "@/lib/risk";
|
||||
import { ilSayfaHref, trBaslikDuzeni, turkishSlugify } from "@/lib/slug";
|
||||
import { cn } from "@/lib/utils";
|
||||
import { VERI_ARALIGI, VERI_YIL_SAYISI } from "@/lib/veri-yillari";
|
||||
import { TurCipi } from "@/components/tur-cipi";
|
||||
import {
|
||||
SATIR_ALT_AD,
|
||||
@@ -47,6 +55,16 @@ function tipeUyar(program: TadimlikSatir["program"], tip: TadimlikTip): boolean
|
||||
return program.unitur != null && program.unitur !== "DEVLET";
|
||||
}
|
||||
|
||||
// Üç kanıt satırı: marka mesaj mimarisinin üç sütunu (docs/ekip-raporlari/
|
||||
// 2026-10-07/founder-arastirma-06 §2: veri, yöntem açıklığı, dürüst vaat).
|
||||
// Rakamlar tek kaynaktan: dilim adları risk.ts, veri yılları veri-yillari.ts.
|
||||
// Vaat cümlesi yok (§10, §7). Her satır 18 rem sütunda tek satıra sığacak
|
||||
// kadar kısa tutulur (sütun 21 rem, ölçüm 1280 px) — uzatınca kart yeniden uzar.
|
||||
const KANITLAR: readonly string[] = [
|
||||
`3 risk dilimi: ${Object.values(DILIM_ETIKET).join(" · ")}`,
|
||||
`${VERI_ARALIGI} YÖK Atlas verisi, ${VERI_YIL_SAYISI} yıl`,
|
||||
];
|
||||
|
||||
export function TadimlikSatiri({
|
||||
sira,
|
||||
tur,
|
||||
@@ -58,6 +76,12 @@ export function TadimlikSatiri({
|
||||
ilk: TadimlikSatir | null;
|
||||
}) {
|
||||
const [satir, setSatir] = useState<TadimlikSatir | null>(ilk);
|
||||
// Gösterilen satır sihirbaz seçimine (alan / devlet-vakıf) göre mi seçildi?
|
||||
// Etiket bunu söyler (DESIGN.md §11.2 md. 1: kullanıcının durumu yansır).
|
||||
const [secimeOzel, setSecimeOzel] = useState(false);
|
||||
// Satır mount sonrası değiştiyse yeni satır blur çözülerek belirir
|
||||
// (§11.2 md. 6: değişimi göster); ilk boyada sahne yok (§11.2 md. 8).
|
||||
const [degisti, setDegisti] = useState(false);
|
||||
const yuklenenAnahtar = useRef(`${GENEL}|${GENEL}`);
|
||||
|
||||
// Sihirbaz kategorisi ve devlet/vakıf tercihi yalnızca localStorage'da
|
||||
@@ -78,6 +102,8 @@ export function TadimlikSatiri({
|
||||
yuklenenAnahtar.current = anahtar;
|
||||
if (slug === GENEL && tip === GENEL) {
|
||||
setSatir(ilk);
|
||||
setSecimeOzel(false);
|
||||
setDegisti(true);
|
||||
return;
|
||||
}
|
||||
// SSR "genel" satırı seçilen tipe uymuyorsa fetch bitene kadar gizle
|
||||
@@ -94,6 +120,8 @@ export function TadimlikSatiri({
|
||||
if (yuklenenAnahtar.current !== anahtar) return;
|
||||
if (veri?.tadimlik) {
|
||||
setSatir(veri.tadimlik);
|
||||
setSecimeOzel(true);
|
||||
setDegisti(true);
|
||||
} else if (tip !== GENEL) {
|
||||
// Uygun tipte satır yok: yanlış tip göstermektense gizle
|
||||
setSatir(null);
|
||||
@@ -128,97 +156,139 @@ export function TadimlikSatiri({
|
||||
const girisUrl = `/giris?callback=${encodeURIComponent(listemUretHref("tadimlik"))}`;
|
||||
|
||||
return (
|
||||
// /sonuc'ta artık ilk öğe sonuç başlığı (h1); tadımlık onun altında
|
||||
// (listesi olanda haritanın ve tablonun altında) mt-12 ile durur.
|
||||
// Tadımlığın render edilmediği durumlarda (girişli kullanıcı, boş havuz)
|
||||
// bu bileşen hiç dönmez.
|
||||
<section ref={gorunumRef} className="mt-12 min-w-0">
|
||||
<div className="flex flex-col items-center text-center">
|
||||
<SectionEyebrow>Yapay zekâdan örnek satır</SectionEyebrow>
|
||||
<h2 className="mt-4 font-heading text-2xl font-bold sm:text-3xl">
|
||||
Yapay zekâ listendeki her satırı böyle anlatır
|
||||
</h2>
|
||||
{/* "ilk üçü" = rapor-maske.ts içindeki ACIK_SATIR (3). O dosya
|
||||
`server-only`, bu dosya "use client" — sabit buraya import
|
||||
edilemiyor, sayı elle yazıldı. ACIK_SATIR değişirse bu cümle de
|
||||
aynı commit'te değişmeli. Cümle kasten "her satır bu formatta
|
||||
kurulur"u sınırlıyor: maske girişsiz/paketsiz kullanıcıya 3 satır
|
||||
açıyor, kalan 21'in gerekçe/risk/trend metni maskeli geliyor. */}
|
||||
<p className="mx-auto mt-3 max-w-xl text-slate-600">
|
||||
Sıralamana uygun bir programın gerekçesi, yerleşme riski ve taban
|
||||
trendi — 24 tercihlik listenin her satırı bu formatta kurulur, ilk
|
||||
üçü hemen açılır.
|
||||
</p>
|
||||
</div>
|
||||
|
||||
<div className="mt-6 rounded-2xl border border-slate-200 bg-card p-4 shadow-sm sm:p-6">
|
||||
{/* Rapor listesinin satırıyla aynı düzen (§4.15): ad sarar,
|
||||
üniversite adı altında, taban sıra sağda iri. */}
|
||||
<div className="flex items-start gap-3">
|
||||
<UniLogo ad={p.universite} boy="sm" />
|
||||
<span className="min-w-0 flex-1">
|
||||
<span className={SATIR_AD_DUZ}>{p.isim}</span>
|
||||
<span className={SATIR_ALT_GRUP}>
|
||||
<span className={SATIR_ALT_AD}>
|
||||
{trBaslikDuzeni(p.universite)}
|
||||
</span>
|
||||
<span className={SATIR_META}>
|
||||
<TurCipi unitur={p.unitur} />
|
||||
{p.il ? (
|
||||
<Link
|
||||
href={ilSayfaHref(p.il)}
|
||||
className={cn("shrink-0", SATIR_IKINCIL_LINK)}
|
||||
title={`${trBaslikDuzeni(p.il)} üniversiteleri`}
|
||||
>
|
||||
{trBaslikDuzeni(p.il)}
|
||||
</Link>
|
||||
) : null}
|
||||
</span>
|
||||
</span>
|
||||
</span>
|
||||
<span className="hidden text-right md:inline-flex">
|
||||
<ProgramSiraGecmisi program={seri} />
|
||||
</span>
|
||||
<span className="inline-flex shrink-0 items-center gap-1.5 text-base font-semibold tabular-nums text-slate-900">
|
||||
<ProgramTabanTrendi program={seri} />
|
||||
{taban != null ? `~${taban.toLocaleString("tr-TR")}.` : "—"}
|
||||
</span>
|
||||
</div>
|
||||
|
||||
<div className="mt-4 rounded-xl bg-slate-50 px-4 py-5">
|
||||
<RaporSatirDetayi
|
||||
dilim={satir.dilim}
|
||||
risk={risk}
|
||||
unitur={p.unitur}
|
||||
gerekce={satir.gerekce}
|
||||
riskNotu={satir.riskNotu}
|
||||
trendOzeti={satir.trendOzeti}
|
||||
/>
|
||||
</div>
|
||||
|
||||
<div className="mt-5 flex flex-col items-start gap-3 border-t border-slate-100 pt-4 sm:flex-row sm:items-center sm:justify-between">
|
||||
<p className="text-sm text-slate-600">
|
||||
Bu, 24 satırlık Yapay Zeka listenden yalnızca bir örnek.
|
||||
<span className="block text-xs text-slate-500">
|
||||
Kredi kartı gerekmez · Google ya da e-posta ile 30 saniyede ·
|
||||
Giriş sonrası liste hemen üretilir
|
||||
</span>
|
||||
</p>
|
||||
<Button
|
||||
asChild
|
||||
className="h-12 w-full shrink-0 cursor-pointer bg-orange-500 text-white transition-[background-color,transform] duration-200 active:scale-[0.97] hover:bg-orange-600 sm:w-auto"
|
||||
>
|
||||
<Link
|
||||
href={girisUrl}
|
||||
onClick={() => olay("giris_cta_tiklandi", { kaynak: "tadimlik" })}
|
||||
// /sonuc'ta ilk öğe sonuç başlığı (h1); tadımlık onun altında (listesi
|
||||
// olanda haritanın ve tablonun altında) durur. Tadımlığın render
|
||||
// edilmediği durumlarda (girişli kullanıcı, boş havuz) bileşen hiç dönmez.
|
||||
// data-tadimlik: QA/ölçüm kancası (yükseklik ölçümü), stil taşımaz.
|
||||
<section
|
||||
ref={gorunumRef}
|
||||
data-tadimlik
|
||||
aria-labelledby="tadimlik-baslik"
|
||||
className="mt-10 min-w-0"
|
||||
>
|
||||
<div className="overflow-hidden rounded-2xl border border-slate-200 bg-card shadow-sm">
|
||||
<div className="grid lg:grid-cols-[minmax(0,21rem)_minmax(0,1fr)] lg:grid-rows-[1fr_auto]">
|
||||
{/* Sol üst: öğrencinin sırasına bağlı başlık + üç kanıt.
|
||||
Sayı kahraman (§1.1): sıra başlıkta mavi vurguyla. */}
|
||||
<div className="p-5 lg:pb-0">
|
||||
<SectionEyebrow>Yapay zekâ listesi</SectionEyebrow>
|
||||
<h2
|
||||
id="tadimlik-baslik"
|
||||
className="mt-4 font-heading text-2xl font-bold leading-tight text-balance text-slate-900"
|
||||
>
|
||||
{/* Buton metni listenin tamamını vaat etmez: maske girişsiz
|
||||
kullanıcıya 24 satırdan yalnız ilk birkaçının analizini
|
||||
açıyor (rapor-maske.ts), gerisi teslim edilmiyor. */}
|
||||
Kendi listemi oluştur
|
||||
<ArrowRight className="size-4" aria-hidden />
|
||||
</Link>
|
||||
</Button>
|
||||
<span className="text-primary">{sira.toLocaleString("tr-TR")}.</span>{" "}
|
||||
sıra için 24 tercih, her satırı böyle gerekçeli
|
||||
</h2>
|
||||
<ul className="mt-4 space-y-2 text-sm leading-snug text-slate-600">
|
||||
{KANITLAR.map((kanit) => (
|
||||
<li key={kanit} className="flex items-start gap-2">
|
||||
<Check className="mt-0.5 size-4 shrink-0 text-primary" aria-hidden />
|
||||
<span>{kanit}</span>
|
||||
</li>
|
||||
))}
|
||||
{/* Üçüncü kanıt: dürüst vaat + yöntem açıklığı tek satırda;
|
||||
link ne açtığını söyler (§10.4). */}
|
||||
<li className="flex items-start gap-2">
|
||||
<Check className="mt-0.5 size-4 shrink-0 text-primary" aria-hidden />
|
||||
<span>
|
||||
Garanti, komisyon, reklam yok;{" "}
|
||||
{/* nowrap: telefonda satır sonunda "açık" tek başına kalmasın */}
|
||||
<Link
|
||||
href="/meraklisina"
|
||||
className="whitespace-nowrap text-primary underline"
|
||||
>
|
||||
yöntem açık
|
||||
</Link>
|
||||
</span>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
|
||||
{/* Sağ: gerçek rapor satırı — kartın kendi bandı (§4.15 satır +
|
||||
RaporSatirDetayi), yuvarlatılmış iç kutu değil. lg'de iki
|
||||
satır boyu, sol sütunun yanında. */}
|
||||
<div className="border-t border-slate-200 bg-slate-50 p-4 sm:p-5 lg:row-span-2 lg:border-t-0 lg:border-l">
|
||||
<p className="text-xs font-semibold text-slate-500">
|
||||
{secimeOzel
|
||||
? "Sırana ve seçimlerine uygun örnek satır"
|
||||
: "Sırana uygun örnek satır"}
|
||||
</p>
|
||||
<div
|
||||
key={`${p.universite}|${p.isim}`}
|
||||
className={cn("mt-3", degisti && "kt-unblur")}
|
||||
>
|
||||
<div className="flex items-start gap-3">
|
||||
{/* Telefonda logo gizli — rapor listesiyle aynı karar (§4.15:
|
||||
logo adı üç satıra sıkıştırıyordu). */}
|
||||
<UniLogo ad={p.universite} boy="sm" className="hidden sm:flex" />
|
||||
<span className="min-w-0 flex-1">
|
||||
<span className={SATIR_AD_DUZ}>{p.isim}</span>
|
||||
<span className={SATIR_ALT_GRUP}>
|
||||
<span className={SATIR_ALT_AD}>
|
||||
{trBaslikDuzeni(p.universite)}
|
||||
</span>
|
||||
<span className={SATIR_META}>
|
||||
<TurCipi unitur={p.unitur} />
|
||||
{p.il ? (
|
||||
<Link
|
||||
href={ilSayfaHref(p.il)}
|
||||
className={cn("shrink-0", SATIR_IKINCIL_LINK)}
|
||||
title={`${trBaslikDuzeni(p.il)} üniversiteleri`}
|
||||
>
|
||||
{trBaslikDuzeni(p.il)}
|
||||
</Link>
|
||||
) : null}
|
||||
</span>
|
||||
</span>
|
||||
</span>
|
||||
<span className="hidden text-right md:inline-flex">
|
||||
<ProgramSiraGecmisi program={seri} />
|
||||
</span>
|
||||
<span className="inline-flex shrink-0 items-center gap-1.5 text-base font-semibold tabular-nums text-slate-900">
|
||||
<ProgramTabanTrendi program={seri} />
|
||||
{taban != null ? `~${taban.toLocaleString("tr-TR")}.` : "—"}
|
||||
</span>
|
||||
</div>
|
||||
|
||||
<div className="mt-4">
|
||||
<RaporSatirDetayi
|
||||
dilim={satir.dilim}
|
||||
risk={risk}
|
||||
unitur={p.unitur}
|
||||
gerekce={satir.gerekce}
|
||||
riskNotu={satir.riskNotu}
|
||||
trendOzeti={satir.trendOzeti}
|
||||
sikistir
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
{/* Sol alt: CTA. Telefonda örneğin altına iner (önce kanıt, sonra
|
||||
eylem); lg'de sol sütunun dibinde, örnekle aynı hizada biter. */}
|
||||
<div className="border-t border-slate-200 p-5 lg:border-t-0 lg:pt-4">
|
||||
<Button asChild size="lg" variant="cta" className="w-full">
|
||||
<Link
|
||||
href={girisUrl}
|
||||
onClick={() => olay("giris_cta_tiklandi", { kaynak: "tadimlik" })}
|
||||
>
|
||||
{/* Buton metni listenin tamamını vaat etmez: maske girişsiz
|
||||
kullanıcıya 24 satırdan yalnız ilk birkaçının analizini
|
||||
açıyor (rapor-maske.ts), gerisi teslim edilmiyor. */}
|
||||
Kendi listemi oluştur
|
||||
<ArrowRight className="size-4" aria-hidden />
|
||||
</Link>
|
||||
</Button>
|
||||
{/* "İlk 3 satır" = rapor-maske.ts içindeki ACIK_SATIR (3). O dosya
|
||||
`server-only`, bu dosya "use client" — sabit buraya import
|
||||
edilemiyor, sayı elle yazıldı. ACIK_SATIR değişirse bu cümle de
|
||||
aynı commit'te değişmeli. Cümle kasten sınırlıyor: maske
|
||||
girişsiz/paketsiz kullanıcıya 3 satır açıyor, kalan 21'in
|
||||
gerekçe/risk/trend metni maskeli geliyor. */}
|
||||
<p className="mt-3 text-center text-xs leading-relaxed text-slate-500">
|
||||
Kredi kartı gerekmez · 30 saniyede giriş · İlk 3 satır hemen açık
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
|
||||
@@ -161,7 +161,7 @@ export function TercihDegistiModali({
|
||||
<Check className="size-5" aria-hidden />
|
||||
</span>
|
||||
<div className="flex flex-col gap-1.5">
|
||||
<DialogTitle className="text-lg">Listen güncellendi</DialogTitle>
|
||||
<DialogTitle>Listen güncellendi</DialogTitle>
|
||||
<DialogDescription>
|
||||
Yeni tercihlerine göre yeniden kuruldu — arkadaki liste birkaç
|
||||
saniye içinde tazelenir.
|
||||
@@ -169,8 +169,10 @@ export function TercihDegistiModali({
|
||||
</div>
|
||||
<Button
|
||||
type="button"
|
||||
size="lg"
|
||||
variant="cta"
|
||||
onClick={() => onOpenChange(false)}
|
||||
className="cursor-pointer self-start transition-[background-color,transform] duration-200 active:scale-[0.97]"
|
||||
className="self-start"
|
||||
>
|
||||
Listeme dön
|
||||
<ArrowRight className="size-4" aria-hidden />
|
||||
@@ -183,9 +185,7 @@ export function TercihDegistiModali({
|
||||
<SlidersHorizontal className="size-5" aria-hidden />
|
||||
</span>
|
||||
<div className="flex min-w-0 flex-col gap-1.5">
|
||||
<DialogTitle className="text-lg">
|
||||
Tercihlerin değişmiş
|
||||
</DialogTitle>
|
||||
<DialogTitle>Tercihlerin değişmiş</DialogTitle>
|
||||
{/* Hangi alanların değiştiği hemen altındaki diff
|
||||
tablosunda zaten duruyor; açıklama yalnızca sonucu ve
|
||||
bedeli söylüyor. */}
|
||||
@@ -265,27 +265,31 @@ export function TercihDegistiModali({
|
||||
Güncelleme {raporKredi} kredi; bakiyen {kredi} kredi.
|
||||
</p>
|
||||
) : null}
|
||||
<div className="flex flex-wrap items-center justify-end gap-2">
|
||||
{/* Telefonda alt alta tam genişlik (ana aksiyon üstte), sm'den
|
||||
itibaren sağa yaslı; 44 px dokunma hedefi (§8). */}
|
||||
<div className="flex flex-col-reverse gap-2 sm:flex-row sm:flex-wrap sm:justify-end">
|
||||
<Button
|
||||
type="button"
|
||||
variant="outline"
|
||||
size="lg"
|
||||
variant="ikincil"
|
||||
onClick={() => onOpenChange(false)}
|
||||
className="cursor-pointer transition-[background-color,transform] duration-200 active:scale-[0.97]"
|
||||
>
|
||||
Şimdilik kalsın
|
||||
</Button>
|
||||
{durum.ad === "hata" ? (
|
||||
<Button
|
||||
size="lg"
|
||||
variant="cta"
|
||||
onClick={() => void guncelle()}
|
||||
className="cursor-pointer bg-orange-500 text-white transition-[background-color,transform] duration-200 active:scale-[0.97] hover:bg-orange-600"
|
||||
>
|
||||
<RefreshCcw className="size-4" aria-hidden />
|
||||
Tekrar dene
|
||||
<RefreshCcw className="size-4" aria-hidden />
|
||||
</Button>
|
||||
) : krediYeter ? (
|
||||
<Button
|
||||
size="lg"
|
||||
variant="cta"
|
||||
onClick={() => void guncelle()}
|
||||
className="cursor-pointer bg-orange-500 text-white transition-[background-color,transform] duration-200 active:scale-[0.97] hover:bg-orange-600"
|
||||
>
|
||||
{ucretsiz
|
||||
? "Listemi güncelle"
|
||||
@@ -293,10 +297,7 @@ export function TercihDegistiModali({
|
||||
<ArrowRight className="size-4" aria-hidden />
|
||||
</Button>
|
||||
) : (
|
||||
<Button
|
||||
asChild
|
||||
className="cursor-pointer bg-orange-500 text-white transition-[background-color,transform] duration-200 active:scale-[0.97] hover:bg-orange-600"
|
||||
>
|
||||
<Button asChild size="lg" variant="cta">
|
||||
<Link href="/paket?kaynak=tercih_degisti">
|
||||
{hasPaket
|
||||
? "Kredi yükle ve güncelle"
|
||||
@@ -345,10 +346,7 @@ function KrediYetersiz({
|
||||
? `Güncelleme ${raporKredi} kredi ve bakiyen yetmedi. Kredi yüklediğinde listen ve sohbet geçmişin duruyor, kaldığın yerden devam edersin.`
|
||||
: `Güncelleme ${raporKredi} kredi ve bakiyen yetmedi. Tercih Dönemi Paketi'yle kredilerin, tam liste, PDF ve revizyon hakları birlikte gelir.`}
|
||||
</p>
|
||||
<Button
|
||||
asChild
|
||||
className="cursor-pointer bg-orange-500 text-white transition-[background-color,transform] duration-200 active:scale-[0.97] hover:bg-orange-600"
|
||||
>
|
||||
<Button asChild size="lg" variant="cta" className="w-full sm:w-auto">
|
||||
<Link href="/paket?kaynak=tercih_degisti_yetersiz">
|
||||
{hasPaket ? "Kredi yükle" : "Paketi aktive et"}
|
||||
<ArrowRight className="size-4" aria-hidden />
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
"use client";
|
||||
|
||||
import { logoTepkisi } from "@/lib/logo-tepkisi";
|
||||
import { useId, useState } from "react";
|
||||
import Link from "next/link";
|
||||
import { useRouter } from "next/navigation";
|
||||
@@ -211,6 +212,8 @@ export function CtaSiraForm({
|
||||
if (sira == null) return;
|
||||
const yeniProfil = { sira, tur, secimler };
|
||||
tercihProfiliYaz(yeniProfil);
|
||||
// Üst çubuktaki logo kürsüye döner (DESIGN.md §4.34).
|
||||
logoTepkisi("sira");
|
||||
setAcik(false);
|
||||
router.push(sonucHref(girisli ? { sihirbaz: "1", kaynak: "cta" } : { hazir: "1" }));
|
||||
}
|
||||
|
||||
@@ -1,11 +1,13 @@
|
||||
"use client";
|
||||
|
||||
import { logoTepkisi } from "@/lib/logo-tepkisi";
|
||||
import { useState } from "react";
|
||||
import Link from "next/link";
|
||||
import { useRouter } from "next/navigation";
|
||||
import { ArrowRight } from "lucide-react";
|
||||
import { ArrowRight, Trophy } from "lucide-react";
|
||||
import { Button } from "@/components/ui/button";
|
||||
import { Input } from "@/components/ui/input";
|
||||
import { SayiRulo } from "@/components/ui/sayi-rulo";
|
||||
import { SecimHaplari } from "@/components/ui/secim-haplari";
|
||||
import {
|
||||
Dialog,
|
||||
@@ -22,7 +24,8 @@ import { olay, siraKovasi } from "@/lib/analitik";
|
||||
import { onbellekliJsonGetir } from "@/lib/istek-cache";
|
||||
import { useTercihProfili } from "@/features/liste/hooks/use-tercih-profili";
|
||||
import type { SihirbazFacetleri } from "@/types/yokatlas";
|
||||
import { sonucHref, type SihirbazSecimleri } from "@/features/sihirbaz/sihirbaz-sabitler";
|
||||
import { PUAN_TURU_ETIKET, sonucHref, type SihirbazSecimleri } from "@/features/sihirbaz/sihirbaz-sabitler";
|
||||
import { ListeDurumuSatiri } from "@/features/liste/components/liste-durumu-satiri";
|
||||
import { tercihProfiliYaz } from "@/features/sihirbaz/sihirbaz-profil";
|
||||
|
||||
// lib/db sunucu tarafı; etiketler client bundle'a sızmasın diye burada.
|
||||
@@ -99,6 +102,8 @@ export function HeroForm() {
|
||||
if (!sira) return;
|
||||
const profil = { sira, tur, secimler };
|
||||
tercihProfiliYaz(profil);
|
||||
// Üst çubuktaki logo kürsüye döner (DESIGN.md §4.34).
|
||||
logoTepkisi("sira");
|
||||
setModalAcik(false);
|
||||
router.push(sonucHref(girisli ? { sihirbaz: "1", kaynak: "hero" } : { hazir: "1" }));
|
||||
}
|
||||
@@ -108,16 +113,27 @@ export function HeroForm() {
|
||||
if (kayitliProfil) {
|
||||
return (
|
||||
<div className="flex w-full max-w-md flex-col items-center">
|
||||
{/* Üst çubuktaki sıralama hapının iri hâli (DESIGN.md §1.1 "sayı
|
||||
kahramandır", §11.2 "durumu yansıt"): site seni tanıyor. */}
|
||||
<p className="mb-5 flex items-center gap-2.5 font-heading text-3xl leading-none font-bold tracking-tight text-slate-900 sm:text-4xl">
|
||||
<Trophy className="size-6 shrink-0 text-orange-500 sm:size-7" aria-hidden />
|
||||
<SayiRulo deger={kayitliProfil.sira} />
|
||||
<span className="font-sans text-base font-semibold tracking-normal text-slate-500">
|
||||
· {PUAN_TURU_ETIKET[kayitliProfil.tur] ?? kayitliProfil.tur}
|
||||
</span>
|
||||
</p>
|
||||
<Button
|
||||
asChild
|
||||
size="lg"
|
||||
className="w-full cursor-pointer bg-orange-500 text-white transition-colors duration-200 hover:bg-orange-600 sm:w-auto"
|
||||
variant="cta"
|
||||
className="w-full sm:w-auto"
|
||||
>
|
||||
<Link href={sonucHref()}>
|
||||
Üniversitelere göz at
|
||||
<ArrowRight className="size-4" aria-hidden />
|
||||
</Link>
|
||||
</Button>
|
||||
<ListeDurumuSatiri varyant="hero" />
|
||||
</div>
|
||||
);
|
||||
}
|
||||
@@ -161,9 +177,9 @@ export function HeroForm() {
|
||||
type="submit"
|
||||
size="lg"
|
||||
disabled={yukleniyor}
|
||||
className="cursor-pointer bg-orange-500 text-white transition-colors duration-200 hover:bg-orange-600"
|
||||
variant="cta"
|
||||
>
|
||||
Yapay Zeka listemi kur
|
||||
{yukleniyor ? "Hazırlanıyor…" : "Yapay Zeka listemi kur"}
|
||||
<ArrowRight className="size-4" aria-hidden />
|
||||
</Button>
|
||||
</form>
|
||||
|
||||
@@ -5,6 +5,7 @@
|
||||
// dynamic import: hem hero-form hem sonuc/sihirbaz-modal burayı kullanır.
|
||||
|
||||
import dynamic from "next/dynamic";
|
||||
import { AdimGostergesiIskeleti } from "@/components/ui/adim-gostergesi";
|
||||
import { Skeleton } from "@/components/ui/skeleton";
|
||||
|
||||
function SihirbazAdimlarSkeleton() {
|
||||
@@ -14,11 +15,8 @@ function SihirbazAdimlarSkeleton() {
|
||||
aria-live="polite"
|
||||
className="flex min-h-64 flex-col gap-5"
|
||||
>
|
||||
<div className="flex items-center gap-1.5">
|
||||
<Skeleton className="h-1.5 w-6 rounded-full" />
|
||||
<Skeleton className="size-1.5 rounded-full" />
|
||||
<Skeleton className="size-1.5 rounded-full" />
|
||||
<Skeleton className="ml-2 h-3 w-14" />
|
||||
<div className="pr-12">
|
||||
<AdimGostergesiIskeleti adet={3} />
|
||||
</div>
|
||||
|
||||
<div>
|
||||
@@ -36,8 +34,8 @@ function SihirbazAdimlarSkeleton() {
|
||||
</div>
|
||||
|
||||
<div className="flex items-center justify-between border-t border-slate-100 pt-4">
|
||||
<Skeleton className="h-9 w-20 rounded-lg" />
|
||||
<Skeleton className="h-9 w-24 rounded-lg" />
|
||||
<Skeleton className="h-11 w-20 rounded-full" />
|
||||
<Skeleton className="h-11 w-24 rounded-full" />
|
||||
</div>
|
||||
</div>
|
||||
);
|
||||
|
||||
@@ -15,6 +15,7 @@ import { toast } from "@/components/ui/bildirim";
|
||||
import { cities } from "turkey-map-react/lib/data";
|
||||
import { TransitionPanel } from "@/components/core/transition-panel";
|
||||
import { adimGecisi, adimGecisiVaryantlari } from "@/lib/adim-gecisi";
|
||||
import { AdimGostergesi } from "@/components/ui/adim-gostergesi";
|
||||
import { Button } from "@/components/ui/button";
|
||||
import { IlSecimHaritasi } from "./il-secim-haritasi";
|
||||
import { normalizeIlAdi } from "@/lib/harita";
|
||||
@@ -214,41 +215,16 @@ export function SihirbazAdimlar({
|
||||
|
||||
return (
|
||||
<div className="flex flex-col gap-5">
|
||||
{/* Adım göstergesi (DESIGN.md §10): üç parçalı çubuk + adların
|
||||
kendisi; öğrenci nerede olduğunu ve ne kaldığını görür. Değişim
|
||||
ekran okuyucuya duyurulur (WCAG 4.1.3). */}
|
||||
<div>
|
||||
<ol className="grid grid-cols-3 gap-2" aria-label="Sihirbaz adımları">
|
||||
{ADIM_ADLARI.map((ad, i) => (
|
||||
<li key={ad} className="flex flex-col gap-1.5">
|
||||
{/* Dolum transform ile (yalnız transform/opaklık canlandırılır);
|
||||
soldan dolar, güçlü ease-out 300 ms. */}
|
||||
<span className="h-1.5 overflow-hidden rounded-full bg-slate-200" aria-hidden>
|
||||
<span
|
||||
className={`block h-full origin-left rounded-full bg-primary transition-transform duration-300 ease-[cubic-bezier(0.23,1,0.32,1)] motion-reduce:transition-none ${
|
||||
i <= adim ? "scale-x-100" : "scale-x-0"
|
||||
}`}
|
||||
/>
|
||||
</span>
|
||||
<span
|
||||
className={`text-sm ${
|
||||
i === adim
|
||||
? "font-semibold text-slate-900"
|
||||
: i < adim
|
||||
? "font-medium text-slate-600"
|
||||
: "text-slate-400"
|
||||
}`}
|
||||
aria-current={i === adim ? "step" : undefined}
|
||||
>
|
||||
{ad}
|
||||
</span>
|
||||
</li>
|
||||
))}
|
||||
</ol>
|
||||
<p role="status" className="sr-only">
|
||||
Adım {adim + 1} / 3: {ADIM_ADLARI[adim]}
|
||||
</p>
|
||||
</div>
|
||||
{/* Adım göstergesi (DESIGN.md §4.35, §10.2): numaralı, adlı; tamamlanan
|
||||
adıma dokunarak geri dönülür. Değişimi ekran okuyucuya kendisi duyurur. */}
|
||||
<AdimGostergesi
|
||||
adimlar={ADIM_ADLARI}
|
||||
aktif={adim}
|
||||
onAdimSec={adimaGit}
|
||||
ariaLabel="Sihirbaz adımları"
|
||||
// Sağ üstteki kapatma çarpısına (size-9) yer bırakır
|
||||
className="pr-12"
|
||||
/>
|
||||
|
||||
{/* Geçiş sabitleri soru formuyla ortak (lib/adim-gecisi.ts) */}
|
||||
<TransitionPanel
|
||||
@@ -536,7 +512,8 @@ export function SihirbazAdimlar({
|
||||
type="button"
|
||||
onClick={() => adimaGit(adim + 1)}
|
||||
disabled={!adimGecerli}
|
||||
className="h-11 cursor-pointer bg-orange-500 px-5 text-white transition-[background-color,transform] duration-200 hover:bg-orange-600 active:scale-[0.97]"
|
||||
variant="cta"
|
||||
className="h-11 px-5"
|
||||
>
|
||||
Devam
|
||||
<ArrowRight className="size-4" aria-hidden />
|
||||
@@ -555,7 +532,8 @@ export function SihirbazAdimlar({
|
||||
onTamamla({ kategoriler, iller, universiteTipi, oncelikler, ozelDurum });
|
||||
}}
|
||||
disabled={kategoriler.length === 0}
|
||||
className="h-11 cursor-pointer bg-orange-500 px-5 text-white transition-[background-color,transform] duration-200 hover:bg-orange-600 active:scale-[0.97]"
|
||||
variant="cta"
|
||||
className="h-11 px-5"
|
||||
>
|
||||
{sonButonEtiketi}
|
||||
<ArrowRight className="size-4" aria-hidden />
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
"use client";
|
||||
|
||||
import { logoTepkisi } from "@/lib/logo-tepkisi";
|
||||
import { useEffect, useRef, useState, useSyncExternalStore } from "react";
|
||||
import Link from "next/link";
|
||||
import { useRouter } from "next/navigation";
|
||||
@@ -182,6 +183,8 @@ export function SihirbazBolumu({
|
||||
*/
|
||||
async function ilerle(secimler: SihirbazSecimleri) {
|
||||
tercihProfiliYaz({ sira, tur, secimler });
|
||||
// Üst çubuktaki logo kürsüye döner (DESIGN.md §4.34).
|
||||
logoTepkisi("sira");
|
||||
await modalCikisiniOynat();
|
||||
setElleAcik(false);
|
||||
if (!girisliMi) {
|
||||
|
||||
Reference in New Issue
Block a user