-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
ref: improve workflows for dice gameplay
- Loading branch information
Showing
36 changed files
with
530 additions
and
263 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
import React, { useRef, useLayoutEffect } from "react" | ||
import { gsap } from "gsap" | ||
import "twin.macro" | ||
|
||
interface IBounceFromTop { | ||
children: React.ReactNode | React.ReactNode[] | ||
} | ||
const BounceFromTop: React.FC<IBounceFromTop> = ({ children }) => { | ||
const wrapperRef = useRef<any>(null) | ||
useLayoutEffect(() => { | ||
const context = gsap.context(() => { | ||
gsap.from(wrapperRef.current, { y: "100%", ease: "elastic.out(1.2, 0.4)" }) | ||
}, wrapperRef) | ||
|
||
return () => context.revert(); | ||
}, []) | ||
return ( | ||
<div tw="w-[max-content] h-[max-content]" ref={wrapperRef}> | ||
{children} | ||
</div> | ||
) | ||
} | ||
export default BounceFromTop |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.