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

fix(dataroom): Counter animation responsiveness #454

Open
wants to merge 5 commits into
base: main
Choose a base branch
from

Conversation

Malayvasa
Copy link
Contributor

Addresses Issue #433

Copy link
Member

@DiogoSoaress DiogoSoaress left a comment

Choose a reason for hiding this comment

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

The Counter is responsive but the text style has a regression and the spaces between the numbers in the counter also seem weird

before

Screenshot 2024-09-11 at 10 32 34 ### now Screenshot 2024-09-11 at 10 32 16

Comment on lines +13 to +14
let placeValue = latest % 10
let offset = (10 + number - placeValue) % 10
Copy link
Member

Choose a reason for hiding this comment

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

why did you change these variables to let ?

const Number = ({ mv, number }: NumberProps) => {
const height = useIsMediumScreen() ? DIGIT_HEIGHT_SM : DIGIT_HEIGHT_MD
const yPosition = useTransform(mv, (latest: number) => calculateYPosition(latest, number, height))
function Number({ mv, number }: { mv: MotionValue<number>; number: number }) {
Copy link
Member

Choose a reason for hiding this comment

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

Why did you modified the function signature?

const height = useIsMediumScreen() ? DIGIT_HEIGHT_SM : DIGIT_HEIGHT_MD
const yPosition = useTransform(mv, (latest: number) => calculateYPosition(latest, number, height))
function Number({ mv, number }: { mv: MotionValue<number>; number: number }) {
let y = useTransform(mv, (latest) => calculateYPosition(latest, number))
Copy link
Member

Choose a reason for hiding this comment

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

Why starting to use let ?

Comment on lines 22 to 24
function Digit({ place, value }: { place: number; value: number }) {
let valueRoundedToPlace = Math.floor(value / place) % 10
let animatedValue = useSpring(valueRoundedToPlace, {
Copy link
Member

Choose a reason for hiding this comment

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

no need to change the const nor the function signature

@DiogoSoaress DiogoSoaress changed the title Fix Counter Animation Responsiveness fix(dataroom): Counter animation responsiveness Oct 10, 2024
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