@@ -2,12 +2,7 @@ import "tippy.js/dist/tippy.css";
2
2
3
3
import { msg , Trans } from "@lingui/macro" ;
4
4
import { useLingui } from "@lingui/react" ;
5
- import {
6
- animated ,
7
- config as springConfig ,
8
- useSpring ,
9
- useTransition ,
10
- } from "@react-spring/web" ;
5
+ import { animated , config as springConfig , useSpring } from "@react-spring/web" ;
11
6
import Tippy from "@tippyjs/react" ;
12
7
import classNames from "classnames" ;
13
8
import { ReactNode , useEffect , useState } from "react" ;
@@ -458,36 +453,33 @@ const WildsInfo = () => {
458
453
palifico &&
459
454
( step === "play" || ( step === "revealed" && ( ! iHaveRolled || ! iAmAlive ) ) ) ;
460
455
461
- const palificoTrans = useTransition ( shouldSeePalifico , {
456
+ const style = useSpring ( {
457
+ opacity : shouldSeePalifico ? 1 : 0 ,
458
+ transform : shouldSeePalifico
459
+ ? "scale(1) rotate(-5deg)"
460
+ : "scale(0) rotate(12deg)" ,
461
+ immediate : ! shouldSeePalifico ,
462
462
config : {
463
- tension : 200 ,
464
- friction : 22 ,
465
- clamp : true ,
463
+ tension : 500 ,
464
+ friction : 12 ,
465
+ precision : 0.02 ,
466
466
} ,
467
- from : { opacity : 0 , transform : "scale(4) rotate(12deg)" } ,
468
- enter : { opacity : 1 , transform : "scale(1) rotate(-5deg)" } ,
469
- leave : { opacity : 0 } ,
470
467
} ) ;
471
468
472
469
return (
473
470
< div className = "w-full h-full flex justify-end" >
474
- { palificoTrans (
475
- ( style , item ) =>
476
- item && (
477
- < div className = "ml auto w-24 h-full relative" >
478
- { /* absolute so that it doesn't influence the height of the container. */ }
479
- < div className = "absolute right-0 top-0 bottom-0 flex items-center" >
480
- < animated . div
481
- className = "my-auto ml-auto mr-1 opacity-0"
482
- style = { { ...style } }
483
- >
484
- < Palifico />
485
- </ animated . div >
486
- </ div >
487
- </ div >
488
- ) ,
489
- ) }
490
- < div className = "flex-1 w-0 max-w-60 flex" >
471
+ < div className = "ml auto w-24 h-full relative" >
472
+ { /* absolute so that it doesn't influence the height of the container. */ }
473
+ < div className = "absolute right-0 top-0 bottom-0 flex items-center" >
474
+ < animated . div
475
+ className = "my-auto ml-auto mr-1 opacity-0"
476
+ style = { { ...style } }
477
+ >
478
+ < Palifico />
479
+ </ animated . div >
480
+ </ div >
481
+ </ div >
482
+ < div className = "flex" >
491
483
< div className = "ml-auto my-auto inline-block text-gray-600 py-0.5 pl-1 pr-1.5 leading-5" >
492
484
{ shouldSeePalifico ? (
493
485
< Trans >
@@ -879,13 +871,13 @@ const Board = () => {
879
871
` }
880
872
>
881
873
< Header />
882
- < div className = "panel" >
874
+ < div className = "panel pb-1 vsm:pb-2.5 " >
883
875
< div className = "space-y-1 vsm:space-y-1.5" >
884
876
{ playerOrder . map ( ( u ) => (
885
877
< Player userId = { u } key = { u } />
886
878
) ) }
887
879
</ div >
888
- < div className = "h-11 vsm:mt-2 flex items-center" >
880
+ < div className = "h-11 mt-1 vsm:mt-2 flex items-center" >
889
881
< WildsInfo />
890
882
</ div >
891
883
</ div >
0 commit comments