Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Switch to native VT #496

Merged
merged 6 commits into from
Dec 1, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .changeset/blue-birds-greet.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"homepage": minor
---

Remove ViewTransitions polyfill and move to native transitions
1 change: 0 additions & 1 deletion src/components/About/MeCard/Avatar.astro
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ const { image, class: className } = Astro.props;

<Image
src={image}
transition:name="avatar"
alt="Lukas"
widths={[96, 128, 256]}
loading="eager"
Expand Down
2 changes: 1 addition & 1 deletion src/components/Nav/Navbar.astro
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import NavigationMenu from "./NavigationMenu.astro";
import ThemeSwitcher from "./ThemeSwitcher.astro";
---

<header data-header="collapsed" class="group fixed top-0 z-50 w-full px-5 py-3">
<header data-header="collapsed" transition:name="header" class="group fixed top-0 z-50 w-full px-5 py-3">
<div
class="relative mx-auto flex w-full max-w-screen-xl flex-wrap items-center justify-between lg:flex-nowrap lg:items-center"
>
Expand Down
1 change: 0 additions & 1 deletion src/components/ProjectPage/Aside.astro
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ type Props = {
<aside
id="toc-aside"
popover="auto"
transition:animate="slide"
class:list={[
"bg-background max-w-[500px] p-5 my-0 border rounded-xl grow self-start w-auto right-0 sticky",
"top-[calc(var(--header-height)+var(--offset))] [--offset:theme(spacing.2)] left-2 right-2",
Expand Down
2 changes: 1 addition & 1 deletion src/components/ProjectPage/PageBody.astro
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ const dashedTitle = dash(title);
loading="eager"
sizes={`(max-width: 360px) 240px, (max-width: 480px) 480px, (min-width: 850px) 850px`}
class="aspect-[21/9] w-full rounded-t-xl object-cover"
transition:name={cover.image.src}
transition:name={cover.image?.src}
/>
)
}
Expand Down
5 changes: 5 additions & 0 deletions src/components/ViewTransitions/NativeViewTransitions.astro
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
<style is:inline>
@view-transition {
navigation: auto;
}
</style>
17 changes: 12 additions & 5 deletions src/layouts/Layout.astro
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
---
import Background from "@components/Background/Background.astro";
import Footer from "@components/Footer/Footer.astro";
import Favicon from "@components/Head/Favicon.astro";
import Preload from "@components/Head/Preload.astro";
import Webmentions from "@components/Head/Webmentions.astro";
import Navbar from "@components/Nav/Navbar.astro";
import ThemeProvider from "@components/Nav/ThemeProvider.astro";
import SEO from "@components/SEO.astro";
import NativeViewTransitions from "@components/ViewTransitions/NativeViewTransitions.astro";

import "@fontsource-variable/inter";
import "@fontsource-variable/jetbrains-mono";
import "@fontsource/lobster";
import { ViewTransitions } from "astro:transitions";

interface Props {
title: string;
Expand Down Expand Up @@ -39,14 +39,13 @@ const { title, description = "Lukas' Homepage" } = Astro.props;
<slot name="seo">
<SEO {title} {description} />
</slot>
<ViewTransitions />
<NativeViewTransitions />
<ThemeProvider />
</head>
<body class="antialiased">
<Background />
<Navbar />
<main
transition:name="main-content"
transition:name="main"
class="flex w-full flex-col items-center mt-[--header-height]"
>
<slot />
Expand All @@ -57,6 +56,14 @@ const { title, description = "Lukas' Homepage" } = Astro.props;
@tailwind base;
@tailwind utilities;

::view-transition-group(*) {
animation-duration: 500ms;
}

::view-transition-group(header) {
z-index: 999;
}

@layer base {
:root {
--background: 0 0% 100%;
Expand Down
2 changes: 2 additions & 0 deletions src/pages/index.astro
Original file line number Diff line number Diff line change
@@ -1,11 +1,13 @@
---
import AboutMe from "@components/About/AboutMe.astro";
import Tech from "@components/About/Tech.astro";
import Background from "@components/Background/Background.astro";
import Hero from "@components/Home/Hero/Hero.astro";
import Layout from "@layouts/Layout.astro";
---

<Layout title="Lukas Trombach | Software Engineer">
<Background />
<Hero />
<AboutMe />
<Tech />
Expand Down
Loading