From c7573c35bf0f6af92a4d29c17615c7df45105b87 Mon Sep 17 00:00:00 2001 From: Replit Agent Date: Fri, 5 Jun 2026 19:11:34 +0000 Subject: [PATCH] Task #14: Black Ayah & Scroll Reveal (EHSAN POC) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Two refinements to match ehsan.sa on artifacts/ehsan-poc: 1. Black ayah: the ayah artwork below the hero («وأحسنوا إنّ الله يحبّ المحسنين») now renders solid black instead of green via Tailwind `brightness-0` on the . Ornaments and centered layout unchanged. 2. Scroll-reveal motion: added a reusable Reveal component (src/components/Reveal.tsx) built on the existing framer-motion dependency. It fades + translates children up (y:28 -> 0) when they scroll into view, animates once (viewport once:true, amount 0.2), supports an optional stagger `delay`, and falls back to a plain div when prefers-reduced-motion is set. Applied on: - home.tsx: stats row (2 cards, staggered), featured opportunity cards grid (staggered by column), workflow-steps grid (staggered by column). - opportunities.tsx: opportunity cards grid (staggered). Added `h-full` to the OpportunityCard root and to the Reveal wrappers / wrapped Cards so the motion wrapper becoming the grid item does not break equal-height cards. Out of scope (unchanged): two-card stats layout, nav, services mega-menu, hero slider/carousel, copy. No scroll animation on header/nav or hero. Verified: tsc --noEmit passes; restarted ehsan-poc web workflow to clear HMR; screenshot confirms the ayah is black. --- .../src/components/OpportunityCard.tsx | 2 +- artifacts/ehsan-poc/src/components/Reveal.tsx | 28 +++++++ artifacts/ehsan-poc/src/pages/home.tsx | 83 ++++++++++--------- .../ehsan-poc/src/pages/opportunities.tsx | 7 +- 4 files changed, 80 insertions(+), 40 deletions(-) create mode 100644 artifacts/ehsan-poc/src/components/Reveal.tsx diff --git a/artifacts/ehsan-poc/src/components/OpportunityCard.tsx b/artifacts/ehsan-poc/src/components/OpportunityCard.tsx index e8f4569..8a3c098 100644 --- a/artifacts/ehsan-poc/src/components/OpportunityCard.tsx +++ b/artifacts/ehsan-poc/src/components/OpportunityCard.tsx @@ -39,7 +39,7 @@ export function OpportunityCard({ request }: OpportunityCardProps) { }; return ( -
+
{/* Photo + progress bar */}
{children}
; + } + + return ( + + {children} + + ); +} diff --git a/artifacts/ehsan-poc/src/pages/home.tsx b/artifacts/ehsan-poc/src/pages/home.tsx index 1f74706..fe6bfdd 100644 --- a/artifacts/ehsan-poc/src/pages/home.tsx +++ b/artifacts/ehsan-poc/src/pages/home.tsx @@ -6,6 +6,7 @@ import { Button } from "@/components/ui/button"; import { Input } from "@/components/ui/input"; import { Skeleton } from "@/components/ui/skeleton"; import { OpportunityCard } from "../components/OpportunityCard"; +import { Reveal } from "../components/Reveal"; import { Riyal } from "@/components/Riyal"; import { Link } from "wouter"; import { Search, Pause, Play } from "lucide-react"; @@ -141,7 +142,7 @@ export default function Home() { وأحسنوا إن الله يحب المحسنين @@ -157,30 +158,34 @@ export default function Home() {
) : (
- - - - {t.home.totalCollected} - - - -
- {stats?.totalCollected?.toLocaleString() || 0} -
-
-
- - - - {t.home.totalClosed} - - - -
- {stats?.totalClosed || 0} -
-
-
+ + + + + {t.home.totalCollected} + + + +
+ {stats?.totalCollected?.toLocaleString() || 0} +
+
+
+
+ + + + + {t.home.totalClosed} + + + +
+ {stats?.totalClosed || 0} +
+
+
+
)} @@ -221,8 +226,10 @@ export default function Home() {
) : (
- {filtered.slice(0, 6).map((request) => ( - + {filtered.slice(0, 6).map((request, i) => ( + + + ))}
)} @@ -233,16 +240,18 @@ export default function Home() {

{t.home.workflowTitle}

{Array.from({ length: 10 }).map((_, i) => ( - - -
- {i + 1} -
-
- {t.workflow[`step${i + 1}` as keyof typeof t.workflow]} -
-
-
+ + + +
+ {i + 1} +
+
+ {t.workflow[`step${i + 1}` as keyof typeof t.workflow]} +
+
+
+
))}
diff --git a/artifacts/ehsan-poc/src/pages/opportunities.tsx b/artifacts/ehsan-poc/src/pages/opportunities.tsx index c730589..0ff051f 100644 --- a/artifacts/ehsan-poc/src/pages/opportunities.tsx +++ b/artifacts/ehsan-poc/src/pages/opportunities.tsx @@ -3,6 +3,7 @@ import { useLanguage } from "../contexts/LanguageContext"; import { useListPublishedRequests } from "@workspace/api-client-react"; import { Skeleton } from "@/components/ui/skeleton"; import { OpportunityCard } from "../components/OpportunityCard"; +import { Reveal } from "../components/Reveal"; type NeedTypeKey = | "electricity" | "water" | "food" | "health" @@ -70,8 +71,10 @@ export default function Opportunities() { ) : (
- {filtered.map((request) => ( - + {filtered.map((request, i) => ( + + + ))}
)}