Skip to content
This repository has been archived by the owner on Dec 27, 2024. It is now read-only.

Commit

Permalink
feat: fadeinアニメーションを追加
Browse files Browse the repository at this point in the history
  • Loading branch information
taga3s committed Apr 29, 2024
1 parent 37dfc5b commit d62cf54
Show file tree
Hide file tree
Showing 6 changed files with 66 additions and 45 deletions.
9 changes: 9 additions & 0 deletions src/features/common/components/layouts/FadeInLayout.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
import { ReactNode } from "@tanstack/react-router";
import { FC } from "react";

type Props = {
children: ReactNode;
};
export const FadeInLayout: FC<Props> = ({ children }) => {
return <div className="animate-fadein">{children}</div>;
};
25 changes: 14 additions & 11 deletions src/routes/analytics/index.lazy.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import { createLazyFileRoute } from "@tanstack/react-router";
import { AnalyticsPresenter } from "../../features/analytics/components/AnalyticsPresenter";
import { ContentLayout, Header, Loading, LoadingContainer, Menu } from "../../features/common/components";
import { Suspense } from "react";
import { FadeInLayout } from "../../features/common/components/layouts/FadeInLayout";

export const Route = createLazyFileRoute("/analytics/")({
component: () => <Analytics />,
Expand All @@ -11,17 +12,19 @@ const Analytics = () => {
return (
<>
<Header />
<ContentLayout>
<Suspense
fallback={
<LoadingContainer>
<Loading />
</LoadingContainer>
}
>
<AnalyticsPresenter />
</Suspense>
</ContentLayout>
<FadeInLayout>
<ContentLayout>
<Suspense
fallback={
<LoadingContainer>
<Loading />
</LoadingContainer>
}
>
<AnalyticsPresenter />
</Suspense>
</ContentLayout>
</FadeInLayout>
<Menu />
</>
);
Expand Down
25 changes: 14 additions & 11 deletions src/routes/manage/index.lazy.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import { ContentLayout, Header, Loading, LoadingContainer, Menu } from "../../fe
import { SearchModalIsOpenProvider } from "../../features/common/contexts/searchModalIsOpenContext";
import { ManagePresenter } from "../../features/manage/components/ManagePresenter";
import { Suspense } from "react";
import { FadeInLayout } from "../../features/common/components/layouts/FadeInLayout";

export const Route = createLazyFileRoute("/manage/")({
component: () => <Manage />,
Expand All @@ -12,17 +13,19 @@ const Manage = () => {
return (
<SearchModalIsOpenProvider>
<Header />
<ContentLayout>
<Suspense
fallback={
<LoadingContainer>
<Loading />
</LoadingContainer>
}
>
<ManagePresenter />
</Suspense>
</ContentLayout>
<FadeInLayout>
<ContentLayout>
<Suspense
fallback={
<LoadingContainer>
<Loading />
</LoadingContainer>
}
>
<ManagePresenter />
</Suspense>
</ContentLayout>
</FadeInLayout>
<Menu />
</SearchModalIsOpenProvider>
);
Expand Down
25 changes: 14 additions & 11 deletions src/routes/profile/index.lazy.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import { createLazyFileRoute } from "@tanstack/react-router";
import { ContentLayout, Header, Loading, LoadingContainer, Menu } from "../../features/common/components";
import { ProfilePresenter } from "../../features/profile/components/ProfilePresenter";
import { Suspense } from "react";
import { FadeInLayout } from "../../features/common/components/layouts/FadeInLayout";

export const Route = createLazyFileRoute("/profile/")({
component: () => <Profile />,
Expand All @@ -11,17 +12,19 @@ const Profile = () => {
return (
<>
<Header />
<ContentLayout>
<Suspense
fallback={
<LoadingContainer>
<Loading />
</LoadingContainer>
}
>
<ProfilePresenter />
</Suspense>
</ContentLayout>
<FadeInLayout>
<ContentLayout>
<Suspense
fallback={
<LoadingContainer>
<Loading />
</LoadingContainer>
}
>
<ProfilePresenter />
</Suspense>
</ContentLayout>
</FadeInLayout>
<Menu />
</>
);
Expand Down
25 changes: 14 additions & 11 deletions src/routes/quests/index.lazy.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import { createLazyFileRoute } from "@tanstack/react-router";
import { ContentLayout, Header, Loading, LoadingContainer, Menu } from "../../features/common/components";
import { QuestsPresenter } from "../../features/quests/components/QuestsPresenter";
import { Suspense } from "react";
import { FadeInLayout } from "../../features/common/components/layouts/FadeInLayout";

export const Route = createLazyFileRoute("/quests/")({
component: () => <Quests />,
Expand All @@ -11,17 +12,19 @@ const Quests = () => {
return (
<>
<Header />
<ContentLayout>
<Suspense
fallback={
<LoadingContainer>
<Loading />
</LoadingContainer>
}
>
<QuestsPresenter />
</Suspense>
</ContentLayout>
<FadeInLayout>
<ContentLayout>
<Suspense
fallback={
<LoadingContainer>
<Loading />
</LoadingContainer>
}
>
<QuestsPresenter />
</Suspense>
</ContentLayout>
</FadeInLayout>
<Menu />
</>
);
Expand Down
2 changes: 1 addition & 1 deletion tailwind.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ export default {
},
animation: {
expbar: "expbar 0.5s ease-out 1",
fadein: "fadein 0.2s ease-out 1",
fadein: "fadein 0.24s ease-out 1",
},
},
},
Expand Down

0 comments on commit d62cf54

Please sign in to comment.