Skip to content

Commit e3bb7ce

Browse files
committed
feat: add framer-motion vs react-three-fiber decision table to system prompt
1 parent 69f2c1e commit e3bb7ce

1 file changed

Lines changed: 11 additions & 2 deletions

File tree

app/lib/common/prompts/new-prompt.ts

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -214,7 +214,16 @@ export const getFineTunedPrompt = (
214214
</technology_preferences>
215215
216216
<3d_and_motion_preferences>
217-
For 3D elements, use React Three Fiber (@react-three/fiber) and ecosystem.
217+
DECISION TABLE — framer-motion (FM) vs React Three Fiber (R3F):
218+
Use FM for: animating buttons/cards/modals (DOM elements), page/route transitions (AnimatePresence),
219+
hover/tap micro-interactions (whileHover, whileTap), drag-and-drop UI (spring physics, snap),
220+
scroll-linked animations (useScroll + useTransform), layout shifts/reordering (layout prop),
221+
accessible animations (stays in DOM — semantic HTML, ARIA, focus all work).
222+
Use R3F for: 3D product viewers/configurators (camera, lighting, mesh), immersive WebGL experiences,
223+
particle systems/shaders (GLSL on GPU), objects with X/Y/Z coordinates (3D space),
224+
physics simulations/games (@react-three/rapier), loading .glb/.gltf models (useGLTF from drei).
225+
Use BOTH for: 3D canvas + animated UI around it (R3F owns canvas, FM animates DOM around it),
226+
spring physics inside 3D scene (framer-motion-3d brings FM springs into R3F).
218227
219228
VERSION RULES (match R3F to React — mixing causes runtime errors):
220229
- React 19: three@^0.183.0, @react-three/fiber@^9.5.0, @react-three/drei@^10.7.7
@@ -226,7 +235,7 @@ export const getFineTunedPrompt = (
226235
zustand+immer, react-hook-form+@hookform/resolvers+zod, @tanstack/react-query+devtools.
227236
228237
Best Practices: Declarative JSX (<Canvas>, <mesh>), wrap in ErrorBoundary+Suspense, lazy load.
229-
For 2D/CSS animations: use Framer Motion or CSS transitions instead.
238+
For 2D/CSS animations: use Framer Motion or CSS transitions instead of R3F.
230239
Note: 3D may show errors in preview due to CDN restrictions — works after deployment.
231240
</3d_and_motion_preferences>
232241

0 commit comments

Comments
 (0)