[feat]: Integrate M3 Expressive's stiffness and damping

Aperta
#2,403 1 commento 0 reazioni 0 assegnatari Vedi su GitHub

I maintainer di solito rispondono entro 1 giorno

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
5/5
Tempo stimato
Più di una settimana
Idoneità per principianti
35/100
Tipo di issue
Funzionalità
Chiarezza
Da chiarire
Stato di attività
Tranquilla
Stack tecnologico
react, typescript
Ambito
frontend

Direzione di ricerca

Inizia con il CodeSandbox collegato e il relativo esempio App.js, quindi leggi la documentazione di riferimento di M3 Expressive motion-physics. Confronta i valori proposti di stiffness, damping, tension e friction attraverso animazioni rappresentative. Il lavoro è completato quando sono stati concordati l’ambito dell’API o della conversione e un esempio riproducibile che mostri il comportamento previsto.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

template: request
A clear and concise description of what the feature is

Hi, take a look at M3 Expressive's motion physics system.

It's a design pattern for animating objects in UI. Main parts are stiffness and damping take a look at the image below

Image

I've come to realize that we can adapt stiffness and damping from M3 Expressive to React Spring. I'm facing some obstacles with adapting damping though.

I see that tension is good as stiffness value from m3 expressive, but friction needs some factor like this
`
const mass = 1;
const stiffness = 1800;
const damping = 0.6;

const tension = stiffness;
const friction = 2 * damping * Math.sqrt(stiffness * mass);
`

I'm not sure that i'm doing right with the formula, what do u think?

https://codesandbox.io/p/sandbox/staging-snow-sqlvdx?file=%2FApp.js%3A15%2C31

Why should this feature be included?

M3 Expressive is a great standard for spring animations. It makes UI alive and fluid

Please provide an example for how this would work

https://codesandbox.io/p/sandbox/staging-snow-sqlvdx?file=%2FApp.js%3A15%2C31

Lingua principale
TypeScript
Stelle
29.3k
Fork
1.2k
Merge medio
3g 15h
PR unite (30g)
17

Preparare l'ambiente

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di pmndrs/react-spring

Tutte le issue di pmndrs/react-spring

Issue simili

Altre issue su TypeScript

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.