Skip to content

Commit

Permalink
Merge pull request #496 from Trombach/feature/native-vt
Browse files Browse the repository at this point in the history
Switch to native VT
  • Loading branch information
Trombach authored Dec 1, 2024
2 parents beac0b9 + 05956d6 commit 22eeb0b
Show file tree
Hide file tree
Showing 8 changed files with 26 additions and 9 deletions.
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

1 comment on commit 22eeb0b

@vercel
Copy link

@vercel vercel bot commented on 22eeb0b Dec 1, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Successfully deployed to the following URLs:

astro-homepage – ./

astro-homepage-git-main-trombachs-projects.vercel.app
astro-homepage-trombachs-projects.vercel.app

Please sign in to comment.