Update the intro #32
- Add cards to the intro page
- Make the cards look pretty
- Add the initial animations
- Animate the intro modal
Summary by CodeRabbit#
New Features
- Introduced richer, animated feature cards with per-item entrance/exit animations and staggered sequencing.
- Added an animated introductory paragraph in the hero overlay for a smoother entry.
Style
- Replaced plain list items with responsive, emoji-driven card layouts for clearer visual hierarchy.
- Improved overlay sizing, background styling, alignment, and overall animation flow.
- 1
Walkthrough#
HomeIntro was refactored to add Framer Motion variants and staggered animations, convert static feature text to animated Card-based FeatureItem components (accepting title and emoji), and update the hero overlay to use AnimatePresence with motion-enabled content.
Changes#
Cohort / File(s) Summary Motion & UI refactor
src/components/HomeIntro.tsxIntroduced Framer Motion container/itemvariants andAnimatePresence(initial: true); replaced plain list items with a responsivemotion.ulof animatedFeatureItemcards; expandedFeatureItemto accepttitleandemoji, render asmotion.liwrapped inCard/CardHeader/CardDescription; adjusted hero overlay layout, card styling, and motion-enabled intro paragraph.Estimated code review effort#
🎯 3 (Moderate) | ⏱️ ~25 minutes
Possibly related PRs#
- fulopkovacs/trytanstackdb.com#28 — touches
src/components/HomeIntro.tsx, also modifies FeatureItem/Card structure and CardDescription usage. - fulopkovacs/trytanstackdb.com#27 — updates HomeIntro usage/props and may affect how the refactored component is invoked.
Pre-merge checks and finishing touches#
❌ Failed checks (1 warning, 1 inconclusive)
Check name Status Explanation Resolution Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. You can run @coderabbitai generate docstringsto improve docstring coverage.Title check ❓ Inconclusive The title 'Update the intro' is vague and generic, using non-specific language that does not clearly convey the main changes in the changeset. Consider using a more descriptive title that reflects the primary changes, such as 'Add animated cards to intro section' or 'Refactor intro with card-based animations'. ✅ Passed checks (1 passed)
Check name Status Explanation Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled. ✨ Finishing touches
- 📝 Generate docstrings
🧪 Generate unit tests (beta)
- Create PR with unit tests
- Post copyable unit tests in a comment
- Commit unit tests in branch `update-intro`
📜 Recent review details
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
📥 Commits
Reviewing files that changed from the base of the PR and between f38734cdef7d75a67865002b537a018a6e5bf5aa and ab058e1049c323ffa8caab0f4b014765832b1618.
📒 Files selected for processing (1)
src/components/HomeIntro.tsx
🚧 Files skipped from review as they are similar to previous changes (1)
- src/components/HomeIntro.tsx
Comment `@coderabbitai help` to get the list of available commands and usage tips.- fulopkovacs/trytanstackdb.com#28 — touches
Actionable comments posted: 2
📜 Review details
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
📥 Commits
Reviewing files that changed from the base of the PR and between d46d8d0dda0e8b26a9e201482606271e2f40dd08 and f38734cdef7d75a67865002b537a018a6e5bf5aa.
📒 Files selected for processing (1)
src/components/HomeIntro.tsx
🧰 Additional context used
📓 Path-based instructions (1)
**/*.{ts,tsx}
📄 CodeRabbit inference engine (AGENTS.md)
**/*.{ts,tsx}: Prefer functions over arrow functions for React components and everything else Prefertypedeclarations overinterfacedeclarationsFiles:
src/components/HomeIntro.tsx
🧠 Learnings (2)
📚 Learning: 2025-12-27T20:43:43.168Z
Learnt from: CR Repo: fulopkovacs/trytanstackdb.com PR: 0 File: AGENTS.md:0-0 Timestamp: 2025-12-27T20:43:43.168Z Learning: Project uses TanStack Start framework with React, TanStack Router, shadcn/ui, and Tailwind CSS v4Applied to files:
src/components/HomeIntro.tsx
📚 Learning: 2025-12-24T15:25:07.106Z
Learnt from: fulopkovacs Repo: fulopkovacs/trytanstackdb.com PR: 22 File: src/components/TodoBoards.tsx:63-81 Timestamp: 2025-12-24T15:25:07.106Z Learning: In Tailwind CSS v4, prefer canonical classes using bg-linear-to-* (e.g., bg-linear-to-b, bg-linear-to-t, bg-linear-to-r) over the older bg-gradient-to-* syntax. This aligns with Tailwind LSP's suggestCanonicalClasses rule. Apply across TSX files (e.g., src/components/*.tsx); replace occurrences of bg-gradient-to-* with the corresponding bg-linear-to-* equivalents and verify gradients visually.Applied to files:
src/components/HomeIntro.tsx
🧬 Code graph analysis (1)
src/components/HomeIntro.tsx (2)
src/components/ui/card.tsx (4)
Card(85-85)CardHeader(86-86)CardContent(91-91)CardDescription(90-90)
src/lib/utils.ts (1)
cn(4-6)
🔇 Additional comments (4)
src/components/HomeIntro.tsx (4)
1-14: LGTM!Imports are appropriate and correctly organized for the animation and UI enhancements.
27-34: LGTM!Clean animation variant definition with appropriate type annotation.
36-57: LGTM!Component correctly uses function declaration style. The
motion.liwithvariants={item}follows the parent-child animation pattern well.
89-103: LGTM!The
AnimatePresencewithinitial={true}and the motion.div with container variants and exit transition are well-configured for the intro modal animation.Resolvedby fuko@@ -8,10 +8,18 @@88 Card,99 CardContent,10+ CardDescription,1011 CardFooter,1112 CardHeader,1213 CardTitle,1314 } from "./ui/card";141515-function Bold({ children }: { children: ReactNode }) {16- return <span className="font-bold text-foreground">{children}</span>;17-}16+const container = {17+ hidden: { opacity: 0 },18+ show: {19+ opacity: 1,20+ transition: {21+ when: "beforeChildren",22+ delayChildren: stagger(0.2),23+ },24+ },25+} satisfies Variants;⚠️ Potential issue | 🟠 Major
🧩 Analysis chain
🏁 Script executed:
cat -n src/components/HomeIntro.tsx | head -30Repository: fulopkovacs/trytanstackdb.com
Length of output: 992
🌐 Web query:
framer motion stagger delayChildren staggerChildren💡 Result:
Short summary:
- delayChildren (seconds) delays when the first child animation begins after the parent starts. [1][2]
- staggerChildren (seconds) adds an incremental delay between successive children (first child = delayChildren, second = delayChildren + staggerChildren, third = delayChildren + 2 * staggerChildren, etc.). [1][2]
- You can control order with staggerDirection (1 = first→last, -1 = last→first) or use stagger(...) to get more options (from: "first" | "last" | "center" or a specific index). [1][2]
Minimal example:
const container = { hidden: {}, show: { transition: { delayChildren: 0.2, // wait 0.2s before first child staggerChildren: 0.1, // add 0.1s between each child staggerDirection: 1 // optional: 1 or -1 } } }
Notes:
- Values are in seconds. [1]
- delayChildren and staggerChildren are set on the parent variants' transition and apply to children using variants. [1][2]
- For more advanced staggering (center/from/index), use stagger(...) from the Motion API. [1]
Sources: official Motion docs and type definitions. [1][2]
Change
delayChildrento use a number or usestaggerChildrenfor staggered children animations.The
delayChildrenproperty expects a number (delay in seconds before children start animating), butstagger(0.2)is a function used for advanced staggering patterns. To stagger animations between children, usestaggerChildren: 0.2instead.const container = { hidden: { opacity: 0 }, show: { opacity: 1, transition: { when: "beforeChildren", - delayChildren: stagger(0.2), + staggerChildren: 0.2, }, }, } satisfies Variants;🤖 Prompt for AI Agents
In src/components/HomeIntro.tsx around lines 16 to 25, the container Variants uses delayChildren: stagger(0.2) which is invalid because delayChildren expects a numeric delay; replace delayChildren with either a numeric value (e.g., delayChildren: 0.2) if you want a fixed delay before children start, or use staggerChildren: 0.2 to stagger child animations by 0.2s; update the property accordingly and keep the object type as Variants.@coderabbitai
that's outdated info. Here are the docs: https://motion.dev/docs/react-transitions#delaychildren
🧩 Analysis chain
🌐 Web query:
Motion React delayChildren stagger function💡 Result:
Short answer
- In Framer Motion (Motion for React) a parent variant's transition can use delayChildren to wait before starting child animations; passing stagger(...) to delayChildren generates per-child delays so children animate one after another. [1][2]
How to use (concise example)
- Import stagger and use it in the parent's transition: import { stagger } from "motion/react" const container = { hidden: { opacity: 0 }, show: { opacity: 1, transition: { // startDelay before first child, then each child spaced by 0.08s delayChildren: stagger(0.08, { startDelay: 0.2, from: "first" }) } } } const item = { hidden: { y: 20, opacity: 0 }, show: { y: 0, opacity: 1 } } <motion.ul variants={container} initial="hidden" animate="show"> <motion.li variants={item} />... </motion.ul>
Notes / options
- stagger(interval, options) options include startDelay (initial extra delay) and from ("first" | "last" | "center" | index). The computed per-child delay is added to delayChildren; you can also use delayChildren as a simple number. [1][2]
References
- Motion docs — Transitions / delayChildren + stagger. [1]
- Motion tutorial — using stagger with variants (shows startDelay and from options). [2]
@fulopkovacs You're absolutely right, and I apologize for the incorrect review comment. The documentation confirms that Motion's
delayChildrendoes acceptstagger()as a value - this generates per-child delays so children animate sequentially.Your code using
delayChildren: stagger(0.2)is correct. This is indeed different from the older Framer Motion API pattern wherestaggerChildrenwas a separate property.Thank you for pointing this out and providing the documentation link!
(\__/) (•ᴗ•) />📚 Thank you for the correction!
✏️ Learnings added
Learnt from: fulopkovacs Repo: fulopkovacs/trytanstackdb.com PR: 32 File: src/components/HomeIntro.tsx:16-25 Timestamp: 2025-12-28T23:34:13.416Z Learning: In Motion (motion/react), the `delayChildren` property in variant transitions can accept `stagger()` as a value (e.g., `delayChildren: stagger(0.2)`), which generates per-child delays for sequential animations. This is different from older Framer Motion API where `staggerChildren` was used as a separate property.Note: Learnings are effective only in the context of similar code segments. To apply general coding guidelines, please configure review instructions. You can manage existing learnings in the app.
🧠 Learnings used
Learnt from: CR Repo: fulopkovacs/trytanstackdb.com PR: 0 File: AGENTS.md:0-0 Timestamp: 2025-12-27T20:43:43.168Z Learning: Project uses TanStack Start framework with React, TanStack Router, shadcn/ui, and Tailwind CSS v4OutdatedResolvedby fuko@@ -96,10 +135,13 @@96- <FeatureItem>97- <Bold>fetch data once, use everywhere</Bold> – Tanstack DB98- keeps it up to date135+ <FeatureItem136+ emoji={"🔄"}137+ title="Fetch data once, use everywhere"138+ >139+ Tanstack DB keeps it up to date!99140 </FeatureItem>100- <FeatureItem>101- <Bold>use any database and language on the backend</Bold> – no102- new libs needed141+ <FeatureItem142+ emoji={"🤝"}143+ title="Use any database and language on the backend"144+ >145+ No new libs needed.103146 </FeatureItem>104- </ul>105- <p>147+ </motion.ul>⚠️ Potential issue | 🟠 Major
Missing variants on
motion.ulmay break stagger animation.The
motion.uldoesn't havevariantsapplied, but itsFeatureItemchildren usevariants={item}. For the stagger effect defined incontainerto propagate to the list items, themotion.ulneeds to be part of the animation chain.🔎 Suggested fix
- <motion.ul className="flex flex-wrap gap-4"> + <motion.ul + className="flex flex-wrap gap-4" + variants={container} + initial="hidden" + animate="show" + >Alternatively, if you want the stagger to cascade from the parent
motion.div, consider whether the intermediate non-motion elements (Card, CardContent) are interrupting variant propagation.📝 Committable suggestion
‼️ IMPORTANT Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
<motion.ul className="flex flex-wrap gap-4" variants={container} initial="hidden" animate="show" > <FeatureItem emoji={"🚀"} title="User actions feel instant"> Updates show immediately while sync happens in the background. </FeatureItem> <FeatureItem emoji={"🔄"} title="Fetch data once, use everywhere" > Tanstack DB keeps it up to date! </FeatureItem> <FeatureItem emoji={"🤝"} title="Use any database and language on the backend" > No new libs needed. </FeatureItem> </motion.ul>🤖 Prompt for AI Agents
In src/components/HomeIntro.tsx around lines 131 to 147, the motion.ul is missing variants so the children's variants (variants={item}) won't receive the container's stagger; add the container variants to the motion.ul (e.g., variants={container}) and ensure it has the appropriate initial and animate props (or is nested under a motion parent that carries them); alternatively, if Card/CardContent are non-motion wrappers between the container and items, convert those intermediates to motion components or forward variants to them so variant propagation/stagger works end-to-end.I checked and it's not a problem.
@fulopkovacs, thanks for checking! You're right—Motion can propagate the animation context through the tree even without explicit variants on intermediate elements, as long as the child variants share the same state names. I appreciate you verifying that the stagger effect works as intended! 🙏
🧠 Learnings used
Learnt from: CR Repo: fulopkovacs/trytanstackdb.com PR: 0 File: AGENTS.md:0-0 Timestamp: 2025-12-27T20:43:43.168Z Learning: Project uses TanStack Start framework with React, TanStack Router, shadcn/ui, and Tailwind CSS v4fuko merged this7f0bce3
fuko closed this
Sign in to join this conversation.
🚀 Preview Deployment#
Status: ✅ Ready!
Preview URL: Open Preview
Commit:
ab058e1049c323ffa8caab0f4b014765832b1618Built and deployed successfully