-
Notifications
You must be signed in to change notification settings - Fork 0
feat: Add motion design system and typography updates #2
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
2 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,206 @@ | ||
| /** | ||
| * Palengkatts — Motion Design Tokens | ||
| * Reusable Framer Motion variants and transition presets. | ||
| * All animations respect prefers-reduced-motion via the MotionConfig in App.jsx. | ||
| */ | ||
|
|
||
| // --- Transitions --- | ||
|
|
||
| export const springGentle = { | ||
| type: 'spring', | ||
| stiffness: 200, | ||
| damping: 28, | ||
| } | ||
|
|
||
| export const springBouncy = { | ||
| type: 'spring', | ||
| stiffness: 300, | ||
| damping: 24, | ||
| } | ||
|
|
||
| export const easeEnter = { | ||
| duration: 0.35, | ||
| ease: [0.0, 0.0, 0.2, 1.0], | ||
| } | ||
|
|
||
| export const easeExit = { | ||
| duration: 0.2, | ||
| ease: [0.4, 0.0, 1.0, 1.0], | ||
| } | ||
|
|
||
| // --- Page Transitions --- | ||
|
|
||
| export const pageVariants = { | ||
| initial: { opacity: 0, y: 8 }, | ||
| animate: { opacity: 1, y: 0 }, | ||
| exit: { opacity: 0, y: -4 }, | ||
| } | ||
|
|
||
| export const pageTransition = { | ||
| initial: 'initial', | ||
| animate: 'animate', | ||
| exit: 'exit', | ||
| variants: pageVariants, | ||
| transition: easeEnter, | ||
| } | ||
|
|
||
| // --- Staggered Container --- | ||
|
|
||
| export const staggerContainer = (staggerDelay = 0.06) => ({ | ||
| hidden: { opacity: 0 }, | ||
| visible: { | ||
| opacity: 1, | ||
| transition: { | ||
| staggerChildren: staggerDelay, | ||
| delayChildren: 0.1, | ||
| }, | ||
| }, | ||
| }) | ||
|
|
||
| // --- Staggered Items --- | ||
|
|
||
| export const staggerItem = { | ||
| hidden: { opacity: 0, y: 20 }, | ||
| visible: { | ||
| opacity: 1, | ||
| y: 0, | ||
| transition: springGentle, | ||
| }, | ||
| } | ||
|
|
||
| // --- Hero Text Reveal --- | ||
|
|
||
| export const heroContainer = { | ||
| hidden: { opacity: 0 }, | ||
| visible: { | ||
| opacity: 1, | ||
| transition: { | ||
| staggerChildren: 0.08, | ||
| delayChildren: 0.2, | ||
| }, | ||
| }, | ||
| } | ||
|
|
||
| export const heroLine = { | ||
| hidden: { opacity: 0, y: 24 }, | ||
| visible: { | ||
| opacity: 1, | ||
| y: 0, | ||
| transition: springGentle, | ||
| }, | ||
| } | ||
|
|
||
| // --- Scroll Reveal (for whileInView) --- | ||
|
|
||
| export const scrollReveal = { | ||
| hidden: { opacity: 0, y: 30 }, | ||
| visible: { | ||
| opacity: 1, | ||
| y: 0, | ||
| transition: { ...easeEnter, duration: 0.5 }, | ||
| }, | ||
| } | ||
|
|
||
| // --- Card Hover --- | ||
|
|
||
| export const cardHover = { | ||
| rest: { | ||
| y: 0, | ||
| boxShadow: '0 0 0 1px var(--color-border)', | ||
| }, | ||
| hover: { | ||
| y: -3, | ||
| boxShadow: '0 12px 32px rgba(232, 115, 109, 0.12)', | ||
| transition: { duration: 0.25, ease: [0.0, 0.0, 0.2, 1.0] }, | ||
| }, | ||
| } | ||
|
|
||
| // --- Button Press --- | ||
|
|
||
| export const buttonTap = { | ||
| scale: 0.97, | ||
| transition: { duration: 0.1 }, | ||
| } | ||
|
|
||
| // --- Filter Chip --- | ||
|
|
||
| export const chipTap = { | ||
| scale: 0.95, | ||
| transition: springBouncy, | ||
| } | ||
|
|
||
| // --- Dialog --- | ||
|
|
||
| export const dialogOverlay = { | ||
| initial: { opacity: 0 }, | ||
| animate: { opacity: 1 }, | ||
| exit: { opacity: 0 }, | ||
| transition: { duration: 0.2 }, | ||
| } | ||
|
|
||
| export const dialogContent = { | ||
| initial: { opacity: 0, scale: 0.95, y: 8 }, | ||
| animate: { | ||
| opacity: 1, | ||
| scale: 1, | ||
| y: 0, | ||
| transition: springBouncy, | ||
| }, | ||
| exit: { | ||
| opacity: 0, | ||
| scale: 0.97, | ||
| y: 4, | ||
| transition: easeExit, | ||
| }, | ||
| } | ||
|
|
||
| // --- Mobile Menu --- | ||
|
|
||
| export const mobileMenuContainer = { | ||
| hidden: { opacity: 0, height: 0 }, | ||
| visible: { | ||
| opacity: 1, | ||
| height: 'auto', | ||
| transition: { | ||
| height: { duration: 0.3, ease: [0.0, 0.0, 0.2, 1.0] }, | ||
| opacity: { duration: 0.2, delay: 0.05 }, | ||
| staggerChildren: 0.04, | ||
| delayChildren: 0.1, | ||
| }, | ||
| }, | ||
| exit: { | ||
| opacity: 0, | ||
| height: 0, | ||
| transition: { | ||
| height: { duration: 0.2, ease: [0.4, 0.0, 1.0, 1.0] }, | ||
| opacity: { duration: 0.15 }, | ||
| }, | ||
| }, | ||
| } | ||
|
|
||
| export const mobileMenuItem = { | ||
| hidden: { opacity: 0, x: -12 }, | ||
| visible: { | ||
| opacity: 1, | ||
| x: 0, | ||
| transition: springGentle, | ||
| }, | ||
| } | ||
|
|
||
| // --- Fade In (generic utility) --- | ||
|
|
||
| export const fadeIn = (delay = 0) => ({ | ||
| initial: { opacity: 0 }, | ||
| animate: { opacity: 1, transition: { duration: 0.3, delay } }, | ||
| }) | ||
|
|
||
| // --- Scale In (for badges, toasts) --- | ||
|
|
||
| export const scaleIn = { | ||
| initial: { opacity: 0, scale: 0.85 }, | ||
| animate: { | ||
| opacity: 1, | ||
| scale: 1, | ||
| transition: springBouncy, | ||
| }, | ||
| } |
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
On any public route change, the exiting
motion.divstill renders a live<Outlet />. Because<Outlet />reads the current router context, the destination route is mounted inside the exiting wrapper and then mounted again whenmode="wait"admits the entering wrapper, so pages with mount effects such asHomeandAdoptioncan refetch and briefly render under the exit animation. Storeconst outlet = useOutlet()and render that captured element inside the keyed motion node.Useful? React with 👍 / 👎.