Skip to content

Add floating heart icons with animation#4

Open
Gashaal wants to merge 2 commits into
GIVESocialMovement:mainfrom
Gashaal:floating-hearts
Open

Add floating heart icons with animation#4
Gashaal wants to merge 2 commits into
GIVESocialMovement:mainfrom
Gashaal:floating-hearts

Conversation

@Gashaal

@Gashaal Gashaal commented Apr 6, 2024

Copy link
Copy Markdown

No description provided.

Comment thread app/page.tsx
<DonateFlow />
<FloatingHearts />
</>
<FloatingHeartsContext.Provider value={state}>

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Use React context to avoid props drilling, but we use Redux, Mobs, etc.

Comment thread app/globals.css

body {
color: rgb(var(--foreground-rgb));
background: linear-gradient(

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks weird, so I removed it.

export const HeartIcon: React.FC<IconSvgProps> = ({ size = '128', className, color = '#000000' }) => (
<svg stroke={color} fill={color} stroke-width="0" viewBox="0 0 512 512" height={size} width={size} xmlns="http://www.w3.org/2000/svg" className={className}><path d="M256 448a32 32 0 0 1-18-5.57c-78.59-53.35-112.62-89.93-131.39-112.8-40-48.75-59.15-98.8-58.61-153C48.63 114.52 98.46 64 159.08 64c44.08 0 74.61 24.83 92.39 45.51a6 6 0 0 0 9.06 0C278.31 88.81 308.84 64 352.92 64c60.62 0 110.45 50.52 111.08 112.64.54 54.21-18.63 104.26-58.61 153-18.77 22.87-52.8 59.45-131.39 112.8a32 32 0 0 1-18 5.56z"></path></svg>
); No newline at end of file
<svg stroke={color} fill={color} strokeWidth="0" viewBox="0 0 512 512" height={size} width={size} xmlns="http://www.w3.org/2000/svg" className={className}><path d="M256 448a32 32 0 0 1-18-5.57c-78.59-53.35-112.62-89.93-131.39-112.8-40-48.75-59.15-98.8-58.61-153C48.63 114.52 98.46 64 159.08 64c44.08 0 74.61 24.83 92.39 45.51a6 6 0 0 0 9.06 0C278.31 88.81 308.84 64 352.92 64c60.62 0 110.45 50.52 111.08 112.64.54 54.21-18.63 104.26-58.61 153-18.77 22.87-52.8 59.45-131.39 112.8a32 32 0 0 1-18 5.56z"></path></svg>

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fix warning about stroke-width

}

20% {
transform: translateY(-50px) rotate(30deg);

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hardcoded 50px just for the test task.


const MIN_ICON_SIZE = 14;
const MAX_ICON_SIZE = 48;
const ICONS_NUMBER = 35;

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Probably, the number of icons should depends on width.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant