diff --git a/components/GridRep/index.module.scss b/components/reps/GridRep/index.module.scss similarity index 97% rename from components/GridRep/index.module.scss rename to components/reps/GridRep/index.module.scss index e208225d..b1929dd2 100644 --- a/components/GridRep/index.module.scss +++ b/components/reps/GridRep/index.module.scss @@ -9,6 +9,16 @@ padding: $unit-2x; min-width: 320px; width: 100%; + opacity: 1; + transition: opacity 0.3s ease-in-out; + + &.visible { + opacity: 1; + } + + &.hidden { + opacity: 0; + } &:hover { background: var(--grid-rep-hover); diff --git a/components/GridRep/index.tsx b/components/reps/GridRep/index.tsx similarity index 93% rename from components/GridRep/index.tsx rename to components/reps/GridRep/index.tsx index d720fe25..5be3da86 100644 --- a/components/GridRep/index.tsx +++ b/components/reps/GridRep/index.tsx @@ -40,10 +40,16 @@ const GridRep = (props: Props) => { const locale = router.locale && ['en', 'ja'].includes(router.locale) ? router.locale : 'en' + const [visible, setVisible] = useState(false) const [mainhand, setMainhand] = useState() const [weapons, setWeapons] = useState>({}) const [grid, setGrid] = useState>({}) + const gridRepStyles = classNames({ + [styles.gridRep]: true, + [styles.visible]: visible, + [styles.hidden]: !visible, + }) const titleClass = classNames({ empty: !props.name, }) @@ -68,6 +74,14 @@ const GridRep = (props: Props) => { [styles.grid]: true, }) + useEffect(() => { + setVisible(false) // Trigger fade out + const timeout = setTimeout(() => { + setVisible(true) // Trigger fade in + }, 300) // You can adjust the timing based on your preference + return () => clearTimeout(timeout) + }, []) + useEffect(() => { const newWeapons = Array(numWeapons) const gridWeapons = Array(numWeapons) @@ -249,7 +263,7 @@ const GridRep = (props: Props) => { return ( - + {detailsWithUsername}
{generateMainhandImage()}
diff --git a/components/GridRepCollection/index.module.scss b/components/reps/GridRepCollection/index.module.scss similarity index 100% rename from components/GridRepCollection/index.module.scss rename to components/reps/GridRepCollection/index.module.scss diff --git a/components/GridRepCollection/index.tsx b/components/reps/GridRepCollection/index.tsx similarity index 100% rename from components/GridRepCollection/index.tsx rename to components/reps/GridRepCollection/index.tsx