Refactor UI components for consistency and clarity across the application
All checks were successful
Deploy / deploy (push) Successful in 18m31s
All checks were successful
Deploy / deploy (push) Successful in 18m31s
- Updated AGENTS.md with new guidelines for UI consistency, including badge and modal styles. - Refactored layout.tsx to improve the placement of the progressive blur effect. - Enhanced NotFound component text for better user guidance. - Replaced HeroFocusButton with HeroBaslik and KapanisCta in the Home component for improved clarity. - Added SiteFooter to multiple pages for consistent footer display. - Removed ListemSekmeleri component and adjusted ListemPage to streamline functionality. - Updated various components to ensure consistent styling and user experience.
This commit is contained in:
@@ -5,17 +5,14 @@
|
||||
// ayrıca korunur). Amaç: satın alma / giriş / kredi durumlarını tek
|
||||
// tıkla taklit edip uygulamanın tüm sayfalarını gerçek akışta gezmek.
|
||||
//
|
||||
// Hareket dili (Apple "Designing Fluid Interfaces"): panel DEV çipinden
|
||||
// büyür ve yine ona küçülür (paylaşılan layoutId ile mekânsal bağ), yay
|
||||
// kritik sönümlüdür (bounce 0) — açılış ortasında kapatılırsa mevcut
|
||||
// değerden geri döner. Yüzey opak kutu değil, yarı saydam malzemedir.
|
||||
// Yüzey opak kutu değil, yarı saydam malzemedir.
|
||||
|
||||
import { useCallback, useEffect, useState } from "react";
|
||||
import { useRouter } from "next/navigation";
|
||||
import { Wrench, X } from "lucide-react";
|
||||
import { AnimatePresence, motion, useReducedMotion } from "motion/react";
|
||||
import { toast } from "sonner";
|
||||
import { authClient } from "@/lib/auth-client";
|
||||
import { tercihProfiliSil } from "@/lib/sihirbaz";
|
||||
import {
|
||||
devAnindaGiris,
|
||||
devAyarla,
|
||||
@@ -27,6 +24,7 @@ import {
|
||||
|
||||
const SAYFALAR: { ad: string; href: string }[] = [
|
||||
{ ad: "Ana sayfa", href: "/" },
|
||||
{ ad: "Sonuç (sırasız)", href: "/sonuc" },
|
||||
{ ad: "Sonuç (85k · SAY)", href: "/sonuc?sira=85000&tur=say&sihirbaz=1" },
|
||||
{ ad: "Sonuç (girişsiz hazır)", href: "/sonuc?sira=85000&tur=say&hazir=1" },
|
||||
{ ad: "Listem", href: "/listem" },
|
||||
@@ -34,6 +32,13 @@ const SAYFALAR: { ad: string; href: string }[] = [
|
||||
{ ad: "Paket", href: "/paket" },
|
||||
{ ad: "Paket (ödeme hatası)", href: "/paket?hata=token" },
|
||||
{ ad: "PDF / yazdır", href: "/rapor/yazdir" },
|
||||
{ ad: "Bölümler", href: "/bolumler" },
|
||||
{ ad: "Bölüm (bilg. müh.)", href: "/bolum/bilgisayar-muhendisligi" },
|
||||
{ ad: "Üniversiteler", href: "/universiteler" },
|
||||
{ ad: "Üniversite (Boğaziçi)", href: "/universite/bogazici-universitesi" },
|
||||
{ ad: "Rehber", href: "/rehber" },
|
||||
{ ad: "Rehber (devlet/vakıf)", href: "/rehber/devlet-mi-vakif-mi" },
|
||||
{ ad: "Meraklısına", href: "/meraklisina" },
|
||||
{ ad: "Giriş", href: "/giris" },
|
||||
{ ad: "Gizlilik", href: "/gizlilik" },
|
||||
{ ad: "Koşullar", href: "/kosullar" },
|
||||
@@ -41,10 +46,6 @@ const SAYFALAR: { ad: string; href: string }[] = [
|
||||
{ ad: "404", href: "/boyle-bir-sayfa-yok" },
|
||||
];
|
||||
|
||||
// Apple değerleri: damping 1.0 (bounce 0), response ~0.35 sn.
|
||||
// Yay süreli değildir; hedef değişirse mevcut değer + hızdan devam eder.
|
||||
const YAY = { type: "spring", bounce: 0, duration: 0.35 } as const;
|
||||
|
||||
// Basış anında tepki (pointer-down feedback) — bırakınca değil.
|
||||
const BASIS =
|
||||
"active:scale-[0.97] transition-[transform,background-color,border-color,opacity] duration-150 ease-out";
|
||||
@@ -60,7 +61,6 @@ export function DevPanel() {
|
||||
const [email, setEmail] = useState("test@kolaytercih.dev");
|
||||
const [mesgul, setMesgul] = useState(false);
|
||||
const router = useRouter();
|
||||
const azMotion = useReducedMotion();
|
||||
|
||||
const yenile = useCallback(async () => {
|
||||
try {
|
||||
@@ -131,50 +131,27 @@ export function DevPanel() {
|
||||
|
||||
const g = durum?.girisli ? durum : null;
|
||||
|
||||
// Azaltılmış hareket: morph yerine kısa çapraz solma (yaysız, kaymasız).
|
||||
const paylasilan = azMotion ? {} : { layoutId: "dev-panel" };
|
||||
const gecis = azMotion ? { duration: 0.15 } : YAY;
|
||||
|
||||
return (
|
||||
<AnimatePresence initial={false}>
|
||||
<>
|
||||
{!acik ? (
|
||||
<motion.button
|
||||
key="cip"
|
||||
{...paylasilan}
|
||||
<button
|
||||
type="button"
|
||||
onClick={paneliAc}
|
||||
title="Dev süperadmin paneli"
|
||||
style={{ borderRadius: 18 }}
|
||||
transition={gecis}
|
||||
initial={{ opacity: 0 }}
|
||||
animate={{ opacity: 1 }}
|
||||
exit={{ opacity: 0, transition: { duration: 0.15, ease: "easeOut" } }}
|
||||
className={`fixed bottom-20 left-4 z-50 inline-flex h-9 cursor-pointer items-center gap-1.5 px-3 text-xs font-bold tracking-wide text-white ${MALZEME} !bg-slate-900/85 print:hidden ${BASIS} hover:!bg-slate-800/85`}
|
||||
>
|
||||
<Wrench className="size-3.5 text-violet-300" aria-hidden />
|
||||
DEV
|
||||
</motion.button>
|
||||
</button>
|
||||
) : (
|
||||
<motion.div
|
||||
key="panel"
|
||||
{...paylasilan}
|
||||
<div
|
||||
role="dialog"
|
||||
aria-label="Dev süperadmin paneli"
|
||||
style={{ borderRadius: 24, transformOrigin: "bottom left" }}
|
||||
transition={gecis}
|
||||
initial={{ opacity: 0 }}
|
||||
animate={{ opacity: 1 }}
|
||||
exit={{ opacity: 0, transition: { duration: 0.15, ease: "easeOut" } }}
|
||||
style={{ borderRadius: 24 }}
|
||||
className={`fixed bottom-20 left-4 z-50 flex max-h-[72vh] w-80 flex-col overflow-hidden ${MALZEME} print:hidden`}
|
||||
>
|
||||
{/* İçerik morph sırasında bozulmasın: yüzey oturduktan hemen
|
||||
sonra belirir (malzeme önce, içerik sonra). */}
|
||||
<motion.div
|
||||
initial={azMotion ? false : { opacity: 0 }}
|
||||
animate={{ opacity: 1 }}
|
||||
transition={{ duration: 0.2, delay: azMotion ? 0 : 0.12 }}
|
||||
className="flex min-h-0 flex-col"
|
||||
>
|
||||
<div className="flex min-h-0 flex-col">
|
||||
{/* Başlık: opak şerit değil, aynı malzemenin üstünde ince
|
||||
bir kenar çizgisiyle ayrışan katman. */}
|
||||
<div className="flex items-center justify-between border-b border-slate-900/5 px-4 py-3">
|
||||
@@ -319,6 +296,24 @@ export function DevPanel() {
|
||||
gider
|
||||
</span>
|
||||
</button>
|
||||
{/* Sıra + sihirbaz profili localStorage'ta yaşar; girişten
|
||||
bağımsızdır — bu yüzden !g ile kilitlenmez. */}
|
||||
<button
|
||||
type="button"
|
||||
disabled={mesgul}
|
||||
onClick={() => {
|
||||
tercihProfiliSil();
|
||||
toast.success("Sıralama ve tercih profili temizlendi.");
|
||||
router.refresh();
|
||||
}}
|
||||
className={`mt-1.5 w-full cursor-pointer rounded-xl border border-rose-600/15 bg-rose-50/80 px-2.5 py-2 text-left text-xs font-semibold text-rose-800 hover:bg-rose-100/80 disabled:cursor-default disabled:opacity-40 ${BASIS}`}
|
||||
>
|
||||
Sıralamayı temizle
|
||||
<span className="block text-[10px] font-normal text-rose-700">
|
||||
localStorage'taki sıra + sihirbaz profilini siler
|
||||
(navbar rozeti dahil)
|
||||
</span>
|
||||
</button>
|
||||
</section>
|
||||
|
||||
{/* Sayfalar */}
|
||||
@@ -339,9 +334,9 @@ export function DevPanel() {
|
||||
</div>
|
||||
</section>
|
||||
</div>
|
||||
</motion.div>
|
||||
</motion.div>
|
||||
</div>
|
||||
</div>
|
||||
)}
|
||||
</AnimatePresence>
|
||||
</>
|
||||
);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user