diff --git a/src/components/ContentCard.astro b/src/components/ContentCard.astro index a21dcc5..81bc64d 100644 --- a/src/components/ContentCard.astro +++ b/src/components/ContentCard.astro @@ -4,14 +4,15 @@ interface Props { description: string; published?: Date; path: string; + slug: string; } -const { title, description, published, path } = Astro.props; +const { title, description, published, path, slug } = Astro.props; --- -
-

{title}

+
+

{title}

{description}

diff --git a/src/components/LayoutComponents/ThemeSwitch.astro b/src/components/LayoutComponents/ThemeSwitch.astro index 03c05d5..66d9a4f 100644 --- a/src/components/LayoutComponents/ThemeSwitch.astro +++ b/src/components/LayoutComponents/ThemeSwitch.astro @@ -2,7 +2,7 @@ import { Icon } from "astro-icon"; --- -
+
@@ -26,18 +26,34 @@ import { Icon } from "astro-icon"; const switchThemeDark = () => { document.dispatchEvent(new CustomEvent('set-theme', { detail: 'dark' })); - moons.forEach(m => m.classList.remove("fadeOut")); + moons.forEach(m => m.classList.remove("fadeOut", "fadeOutDone")); moons.forEach(m => m.classList.add("fadeIn")); - suns.forEach(s => s.classList.remove("fadeIn")); + setTimeout(() => moons.forEach(m => { + m.classList.add("fadeInDone"); + m.classList.remove("fadeIn"); + }), 250); // After 0.2s animation is completed + suns.forEach(s => s.classList.remove("fadeIn", "fadeInDone")); suns.forEach(s => s.classList.add("fadeOut")); + setTimeout(() => suns.forEach(s => { + s.classList.add("fadeOutDone"); + s.classList.remove("fadeOut"); + }), 250); // After 0.2s animation is completed } const switchThemeLight = () => { document.dispatchEvent(new CustomEvent('set-theme', { detail: 'light' })); - moons.forEach(m => m.classList.remove("fadeIn")); + moons.forEach(m => m.classList.remove("fadeIn", "fadeInDone")); moons.forEach(m => m.classList.add("fadeOut")); - suns.forEach(s => s.classList.remove("fadeOut")); + setTimeout(() => moons.forEach(m => { + m.classList.add("fadeOutDone"); + m.classList.remove("fadeOut"); + }), 250); // After 0.2s animation is completed + suns.forEach(s => s.classList.remove("fadeOut", "fadeOutDone")); suns.forEach(s => s.classList.add("fadeIn")); + setTimeout(() => suns.forEach(s => { + s.classList.add("fadeInDone"); + s.classList.remove("fadeIn"); + }), 250); // After 0.2s animation is completed } moons.forEach(m => m.addEventListener("click", switchThemeLight)); @@ -66,11 +82,21 @@ import { Icon } from "astro-icon"; animation-fill-mode: forwards; } + .fadeOutDone { + opacity: 0; + transform: translate(0, -100%); + } + .fadeIn { animation: fadeIn 0.2s ease-in-out; animation-fill-mode: forwards; } + .fadeInDone { + opacity: 1; + transform: translate(0, 0); + } + .placeHolder { opacity: 1 !important; transform: translate(0, 0) !important; diff --git a/src/content/config.ts b/src/content/config.ts index 40ce053..2583891 100644 --- a/src/content/config.ts +++ b/src/content/config.ts @@ -5,6 +5,7 @@ const projectsCol = defineCollection({ type: "content", schema: z.object({ title: z.string(), + site_title: z.string().optional(), description: z.string(), descriptionShort: z.string(), repository: z.string().url().optional(), @@ -19,6 +20,7 @@ const diaryMainPages = defineCollection({ type: "content", schema: z.object({ title: z.string(), + site_title: z.string().optional(), description: z.string(), descriptionShort: z.string(), repository: z.string().url().optional(), @@ -33,6 +35,7 @@ const diarySubPages = defineCollection({ type: "content", schema: z.object({ title: z.string(), + site_title: z.string().optional(), repository: z.string().url().optional(), relatedWebsite: z.string().url().optional(), published: z.date().optional(), diff --git a/src/content/diaryMainPages/rust.mdx b/src/content/diaryMainPages/rust.mdx index 7d1aa37..dfd6f90 100644 --- a/src/content/diaryMainPages/rust.mdx +++ b/src/content/diaryMainPages/rust.mdx @@ -6,6 +6,4 @@ descriptionShort: "Me learning Rust (German)." relatedWebsite: https://doc.rust-lang.org/book/ --- -# Learning Rust - In this diary I want to document my progress through the [Rust book](https://doc.rust-lang.org/book/) and documenting some stuff for myself. \ No newline at end of file diff --git a/src/content/projects/infoscreen.mdx b/src/content/projects/infoscreen.mdx index 0877dbf..498cc66 100644 --- a/src/content/projects/infoscreen.mdx +++ b/src/content/projects/infoscreen.mdx @@ -8,8 +8,6 @@ published: 2022-06-13T13:07:27.205Z import { Image } from "astro:assets"; import screenshot from "./data_infoscreen/screenshot.jpg"; -# Infoscreen - This document is about a screen that shows information. Shocking, I know. diff --git a/src/content/projects/ol-git.mdx b/src/content/projects/ol-git.mdx index eb4c805..f1fa906 100644 --- a/src/content/projects/ol-git.mdx +++ b/src/content/projects/ol-git.mdx @@ -1,13 +1,11 @@ --- -title: Overleaf Git Sync +title: Overleaf Sync with Git description: "Overleaf is a LaTeX editor for the web and honestly great to use. But there is no way to back up your project to a cloud drive or git without paying them money. Even the self-hosted community version has no such functionality. I decided that's BS and made my own script to sync a project to git." descriptionShort: "I created a script that pushes Overleaf projects to a git remote." repository: "https://git.c0ntroller.de/c0ntroller/overleaf-git-sync" published: 2022-10-18T17:56:27+02:00 --- -# Overleaf Sync with Git - ## The Problem When I was writing some important stuff for uni I wanted as many backups as possible. diff --git a/src/content/projects/photo-sync.mdx b/src/content/projects/photo-sync.mdx index 7f3fae2..e2171ea 100644 --- a/src/content/projects/photo-sync.mdx +++ b/src/content/projects/photo-sync.mdx @@ -1,13 +1,11 @@ --- -title: Photo Sync +title: Google Photo Sync description: "Giving random apps access to your Google Photos can be bad. To still use an album as screensaver etc. I wrote this script. It syncs all your photos to your drive while giving you maximum privacy." descriptionShort: "A script that syncs a Google Photos album to your drive." repository: https://git.c0ntroller.de/c0ntroller/google-photo-album-sync published: 2022-08-08T12:19:20+02:00 --- -# Google Photo Sync - Why give up privacy for a screensaver? ## Storytime diff --git a/src/content/projects/simple-cb.mdx b/src/content/projects/simple-cb.mdx index fa250d8..459d8c7 100644 --- a/src/content/projects/simple-cb.mdx +++ b/src/content/projects/simple-cb.mdx @@ -6,8 +6,6 @@ repository: "https://git.c0ntroller.de/c0ntroller/simple-callback-server" published: 2022-10-18T17:56:27+02:00 --- -# Simple Callback Server - This is probably my simplest project. ## What is this? diff --git a/src/content/projects/terminal.mdx b/src/content/projects/terminal.mdx index 5ade651..aec99e8 100644 --- a/src/content/projects/terminal.mdx +++ b/src/content/projects/terminal.mdx @@ -6,8 +6,6 @@ repository: https://git.c0ntroller.de/c0ntroller/frontpage published: 2022-10-18T17:56:27+02:00 --- -# Terminal - Hello and welcome to my website. This documentation is for the [cli on my website](https://c0ntroller.de/terminal) so check it out if you haven't! ## Why did I do this? diff --git a/src/content/projects/tufast.mdx b/src/content/projects/tufast.mdx index d492fda..12eab49 100644 --- a/src/content/projects/tufast.mdx +++ b/src/content/projects/tufast.mdx @@ -7,8 +7,6 @@ relatedWebsite: https://tu-fast.de/ published: 2022-06-23T12:53:07.207Z --- -# TUfast - My work on a browser extension that is used by multiple thousand students. ## What is TUfast? diff --git a/src/content/rust/00 - Hello World.mdx b/src/content/rust/00 - Hello World.mdx index 401f9f3..a1f1187 100644 --- a/src/content/rust/00 - Hello World.mdx +++ b/src/content/rust/00 - Hello World.mdx @@ -5,8 +5,6 @@ sorting: 0 slug: hello-world --- -# Hello world! - _[Link zum Buch](https://doc.rust-lang.org/book/ch01-02-hello-world.html)_ ## How to `println!` diff --git a/src/content/rust/01 - Cargo.mdx b/src/content/rust/01 - Cargo.mdx index 32740c8..1b50790 100644 --- a/src/content/rust/01 - Cargo.mdx +++ b/src/content/rust/01 - Cargo.mdx @@ -5,8 +5,6 @@ sorting: 1 slug: cargo --- -# Cargo - _[Link zum Buch](https://doc.rust-lang.org/book/ch01-03-hello-cargo.html)_ ## Was ist Cargo? diff --git a/src/content/rust/02 - Higher-Lower-Spiel.mdx b/src/content/rust/02 - Higher-Lower-Spiel.mdx index 1b58917..ef4773b 100644 --- a/src/content/rust/02 - Higher-Lower-Spiel.mdx +++ b/src/content/rust/02 - Higher-Lower-Spiel.mdx @@ -5,8 +5,6 @@ sorting: 2 slug: higher-lower-game --- -# Erstes Spiel - [Link zum Buch](https://doc.rust-lang.org/book/ch02-00-guessing-game-tutorial.html) ## Projekt erstellen diff --git a/src/content/rust/03 - Concepts.mdx b/src/content/rust/03 - Concepts.mdx index bd448bb..65f5ce8 100644 --- a/src/content/rust/03 - Concepts.mdx +++ b/src/content/rust/03 - Concepts.mdx @@ -5,8 +5,6 @@ sorting: 3 slug: konzepte --- -# Konzepte - [Link zum Buch](https://doc.rust-lang.org/book/ch03-00-common-programming-concepts.html) diff --git a/src/content/rust/04 - Ownership.mdx b/src/content/rust/04 - Ownership.mdx index d503b70..26f63be 100644 --- a/src/content/rust/04 - Ownership.mdx +++ b/src/content/rust/04 - Ownership.mdx @@ -5,8 +5,6 @@ sorting: 4 slug: ownership --- -# Ownership - [Link zum Buch](https://doc.rust-lang.org/book/ch04-00-understanding-ownership.html) ## Was ist das? diff --git a/src/content/rust/05 - Structs.mdx b/src/content/rust/05 - Structs.mdx index 5184271..79572b2 100644 --- a/src/content/rust/05 - Structs.mdx +++ b/src/content/rust/05 - Structs.mdx @@ -5,8 +5,6 @@ sorting: 5 slug: structs --- -# Structs - [Link zum Buch](https://doc.rust-lang.org/book/ch05-00-structs.html) ## Was sind Structs diff --git a/src/content/rust/06 - Enums.mdx b/src/content/rust/06 - Enums.mdx index 76e6c31..e1d5308 100644 --- a/src/content/rust/06 - Enums.mdx +++ b/src/content/rust/06 - Enums.mdx @@ -1,12 +1,11 @@ --- title: Enums & Matching +site_title: Enums und Pattern Matching published: 2022-10-18T17:56:26+02:00 sorting: 6 slug: enums --- -# Enums und Pattern Matching - [Link zum Buch](https://doc.rust-lang.org/book/ch06-00-enums.html) ## Enums diff --git a/src/content/rust/07 - Management.mdx b/src/content/rust/07 - Management.mdx index 23378ad..46cdad4 100644 --- a/src/content/rust/07 - Management.mdx +++ b/src/content/rust/07 - Management.mdx @@ -5,8 +5,6 @@ sorting: 7 slug: projektmanagement --- -# How to: Projektmanagement - [Link zum Buch](https://doc.rust-lang.org/book/ch07-00-managing-growing-projects-with-packages-crates-and-modules.html) ## Packages, Crates, Modules, was? diff --git a/src/content/rust/08 - Collections.mdx b/src/content/rust/08 - Collections.mdx index 727dda2..9742173 100644 --- a/src/content/rust/08 - Collections.mdx +++ b/src/content/rust/08 - Collections.mdx @@ -5,8 +5,6 @@ sorting: 8 slug: collections --- -# Standard Collections - [Link zum Buch](https://doc.rust-lang.org/book/ch08-00-common-collections.html) ## `Vec` - Vektoren diff --git a/src/content/rust/09 - Errors und panic.mdx b/src/content/rust/09 - Errors und panic.mdx index 68242e5..0e7822e 100644 --- a/src/content/rust/09 - Errors und panic.mdx +++ b/src/content/rust/09 - Errors und panic.mdx @@ -5,8 +5,6 @@ sorting: 9 slug: errors-and-panic --- -# Errors und `panic!` - [Link zum Buch](https://doc.rust-lang.org/book/ch09-00-error-handling.html) ## `panic!` diff --git a/src/layouts/Layout.astro b/src/layouts/Layout.astro index b0da56d..22554fe 100644 --- a/src/layouts/Layout.astro +++ b/src/layouts/Layout.astro @@ -1,21 +1,24 @@ --- -import Navbar from "../components/LayoutComponents/Navbar.astro"; +import { ViewTransitions } from 'astro:transitions'; import Themes from "astro-themes"; import Icon from "astro-icon"; +import Navbar from "../components/LayoutComponents/Navbar.astro"; import socials from "../data/socials.json"; interface Props { title: string; showAfterMain?: boolean; + mainTransitionName?: string; } -const { title, showAfterMain } = Astro.props; +const { title, showAfterMain, mainTransitionName } = Astro.props; --- + {title} - -
+ +
-
+
{showAfterMain ?
: null } -
+
diff --git a/src/layouts/MarkdownLayout.astro b/src/layouts/MarkdownLayout.astro index ee763b9..8cb916a 100644 --- a/src/layouts/MarkdownLayout.astro +++ b/src/layouts/MarkdownLayout.astro @@ -4,6 +4,7 @@ import { Icon } from "astro-icon"; interface Props { title: string; + slug: string; published?: Date; srcPath?: string; moreLinks?: { @@ -12,11 +13,11 @@ interface Props { }[]; } -const { title, srcPath, published, moreLinks } = Astro.props; +const { title, srcPath, published, moreLinks, slug } = Astro.props; const gitUrl = `https://git.c0ntroller.de/c0ntroller/frontpage/src/branch/dev/src/content/${srcPath}` --- - + {Astro.slots.has("main-nav") ? : null} @@ -26,6 +27,7 @@ const gitUrl = `https://git.c0ntroller.de/c0ntroller/frontpage/src/branch/dev/sr { moreLinks.map(l => ) }
: null} +

{title}

{ published || srcPath ? <>
diff --git a/src/pages/blog/[diary].astro b/src/pages/blog/[diary].astro index c137f16..bbd2c55 100644 --- a/src/pages/blog/[diary].astro +++ b/src/pages/blog/[diary].astro @@ -38,7 +38,7 @@ if (diaryMain.data.repository) { } --- - +

Pages

diff --git a/src/pages/blog/[diary]/[entry].astro b/src/pages/blog/[diary]/[entry].astro index 4b238e5..efba7de 100644 --- a/src/pages/blog/[diary]/[entry].astro +++ b/src/pages/blog/[diary]/[entry].astro @@ -27,7 +27,7 @@ const { entry } = Astro.props; const { Content } = await entry.render(); --- - + diff --git a/src/pages/blog/[entry].astro b/src/pages/blog/[entry].astro index df32d0c..873c9ba 100644 --- a/src/pages/blog/[entry].astro +++ b/src/pages/blog/[entry].astro @@ -35,6 +35,6 @@ if (entry.data.repository) { --- - + diff --git a/src/pages/index.astro b/src/pages/index.astro index 6c75494..7c5772f 100644 --- a/src/pages/index.astro +++ b/src/pages/index.astro @@ -22,11 +22,11 @@ const diaries = (await getCollection("diaryMainPages")).sort((a, b) => a.data.la

Projects

- { projects.map(p => ) } + { projects.map(p => ) }

Diaries

- { diaries.map(p => ) } + { diaries.map(p => ) }