Skip to content

Commit

Permalink
animation au changement de page
Browse files Browse the repository at this point in the history
Signed-off-by: Bacati <[email protected]>
  • Loading branch information
Bacati committed Oct 2, 2024
1 parent 8a9a834 commit bc2b102
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/layouts/Base.astro
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
---
import Head, { type Props as HeadProps } from './Head.astro'
import 'assets/pages/404/styles/style.scss'
import { ViewTransitions } from 'astro:transitions';
export interface Props extends HeadProps {
class?: string
Expand All @@ -12,6 +13,7 @@ export interface Props extends HeadProps {
<head>
<Head {...Astro.props} />
<slot name="head" />
<ViewTransitions />
</head>
<body class:list={["", Astro.props.class]}>
<slot />
Expand Down
2 changes: 2 additions & 0 deletions src/layouts/MainLayout.astro
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
import Footer from 'components/layouts/Footer.astro'
import Base, { type Props as BaseProps } from './Base.astro'
import Header from 'components/layouts/Header.astro'
import { fade } from 'astro:transitions'
export interface Props extends BaseProps {
/**
Expand All @@ -14,6 +15,7 @@ export interface Props extends BaseProps {
<Base {...Astro.props}>
<slot slot="head" name="head" />
<Header />
<div transition:animate={fade({ duration: '0.2s' })}>
<slot />
</div>
<Footer />
Expand Down

0 comments on commit bc2b102

Please sign in to comment.