diff --git a/package.json b/package.json index f6e3574..7659d5f 100644 --- a/package.json +++ b/package.json @@ -20,6 +20,7 @@ "newpost": "pnpm run blogtool newpost" }, "dependencies": { + "@hayao/next-view-transitions": "0.2.1", "clsx": "^2.1.1", "framer-motion": "^11.2.10", "gray-matter": "^4.0.3", diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index d418412..b14181b 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -5,6 +5,9 @@ settings: excludeLinksFromLockfile: false dependencies: + '@hayao/next-view-transitions': + specifier: 0.2.1 + version: 0.2.1(next@14.2.4)(react-dom@18.3.1)(react@18.3.1) clsx: specifier: ^2.1.1 version: 2.1.1 @@ -267,6 +270,18 @@ packages: resolution: {integrity: sha512-k2Ty1JcVojjJFwrg/ThKi2ujJ7XNLYaFGNB/bWT9wGR+oSMJHMa5w+CUq6p/pVrKeNNgA7pCqEcjSnHVoqJQFw==} dev: true + /@hayao/next-view-transitions@0.2.1(next@14.2.4)(react-dom@18.3.1)(react@18.3.1): + resolution: {integrity: sha512-yEL9fI6gXT8ZzFz6GAMRsKQLgPoPzfE1mXUbmRUlTZaoF0WcBNM5onzENQ1dufiwtwdUt2pgz09plzv9+kAftg==} + peerDependencies: + next: ^14.0.0 + react: ^18.2.0 + react-dom: ^18.2.0 + dependencies: + next: 14.2.4(react-dom@18.3.1)(react@18.3.1)(sass@1.77.6) + react: 18.3.1 + react-dom: 18.3.1(react@18.3.1) + dev: false + /@humanwhocodes/config-array@0.11.14: resolution: {integrity: sha512-3T8LkOmg45BV5FICb15QQMsyUSWrQ8AygVfC7ZG32zOalnqrilm018ZVCw0eapXux8FtA33q8PSRSstjee3jSg==} engines: {node: '>=10.10.0'} diff --git a/src/app/layout.tsx b/src/app/layout.tsx index ba8f776..0306556 100644 --- a/src/app/layout.tsx +++ b/src/app/layout.tsx @@ -1,6 +1,7 @@ import "@/style/global.css"; import "@/style/prism.css"; +import { ViewTransitions } from "@hayao/next-view-transitions"; import { Metadata as NextMetadata } from "next"; import React, { ReactNode, Suspense } from "react"; @@ -18,9 +19,7 @@ export default function RootLayout({ children }: { children: ReactNode }) { - {/* ページ内リンクで正常に動作しない */} - {/*{children}*/} - {children} + {children} ); diff --git a/src/components/elements/Link.tsx b/src/components/elements/Link.tsx index 52257f1..d93779e 100644 --- a/src/components/elements/Link.tsx +++ b/src/components/elements/Link.tsx @@ -1,5 +1,6 @@ "use client"; +import { Link as ViewTransitionLink } from "@hayao/next-view-transitions"; import classNames from "clsx"; import { motion } from "framer-motion"; import { default as NextLink } from "next/link"; @@ -15,7 +16,7 @@ export default function DaisyLink(props: NextLinkProps) { } export const Link = (props: NextLinkProps) => { - return ; + return ; }; export function AnimatedLink(props: NextLinkProps) {