Skip to content
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

feat(Label): celebration animation #2032

Merged
merged 6 commits into from
Mar 27, 2024
Merged

feat(Label): celebration animation #2032

merged 6 commits into from
Mar 27, 2024

Conversation

talkor
Copy link
Member

@talkor talkor commented Mar 21, 2024

@talkor talkor requested a review from a team as a code owner March 21, 2024 16:32
@talkor talkor changed the title Feat/label/celebration feat(Label): celebration animation Mar 21, 2024
@@ -62,12 +65,12 @@ const Label: VibeComponent<LabelProps> & {
getStyle(styles, camelCase("kind" + "-" + kind)),
getStyle(styles, camelCase("color" + "-" + color)),
{
[styles.withAnimation]: !isAnimationDisabled,
[styles.withAnimation]: !isAnimationDisabled && !celebration,
Copy link
Member Author

@talkor talkor Mar 21, 2024

Choose a reason for hiding this comment

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

It shouldn't work with the regular animation that we have today

type={Text.types.TEXT2}
className={classNames}
color={Text.colors.ON_INVERTED}
data-celebration-text={celebration}
Copy link
Member Author

@talkor talkor Mar 21, 2024

Choose a reason for hiding this comment

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

Need this to style the text, couldn't find a better way

Copy link
Contributor

Choose a reason for hiding this comment

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

Why not class?

Copy link
Member Author

Choose a reason for hiding this comment

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

I can't use a moduled class because I'm targeting the selector from the animation wrapper component

stroke-dashoffset: var(--container-perimeter);

&.base {
stroke: #ffcc00;
Copy link
Member Author

Choose a reason for hiding this comment

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

Need to discuss colors with designers as they are legacy colors, will be replaced with variables

Copy link
Contributor

Choose a reason for hiding this comment

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

After we will change all the colors let's QA how it looks in all the different products themes :)


export default LabelCelebrationAnimation;

function getPath({
Copy link
Member Author

Choose a reason for hiding this comment

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

This is all just math haha

<Text element="span" type={Text.types.TEXT2} className={classNames} color={Text.colors.ON_INVERTED}>
<Text element="span" type={Text.types.TEXT2} color={Text.colors.INHERIT}>
{text}
<LabelCelebrationAnimation active={celebration && kind === "line"}>
Copy link
Member Author

Choose a reason for hiding this comment

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

It shouldn't work in the fill variant

Copy link
Contributor

@shaharzil shaharzil left a comment

Choose a reason for hiding this comment

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

Very very impressive work!!

packages/core/src/components/Label/Label.tsx Outdated Show resolved Hide resolved
packages/core/src/components/Label/Label.tsx Outdated Show resolved Hide resolved
type={Text.types.TEXT2}
className={classNames}
color={Text.colors.ON_INVERTED}
data-celebration-text={celebration}
Copy link
Contributor

Choose a reason for hiding this comment

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

Why not class?

@talkor talkor requested a review from shaharzil March 25, 2024 16:55
To celebrate new feature, outline label can be highlighted by adding celebrate animation.

<Canvas>
<Story of={LabelStories.Celebration} />
Copy link
Contributor

Choose a reason for hiding this comment

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

I saw Yossi opened a PR with the deletion of the tag, maybe change it to <Canvas of=

@talkor talkor merged commit 1af527c into master Mar 27, 2024
10 checks passed
@talkor talkor deleted the feat/label/celebration branch March 27, 2024 08:53
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.

2 participants