mirror of
https://github.com/timmypidashev/web.git
synced 2026-04-14 02:53:51 +00:00
bugfixes
This commit is contained in:
@@ -1,4 +1,4 @@
|
|||||||
import React, { useState, useEffect } from "react";
|
import { useState, useEffect } from "react";
|
||||||
|
|
||||||
const GlitchText = () => {
|
const GlitchText = () => {
|
||||||
const originalText = 'Error 404';
|
const originalText = 'Error 404';
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
import React, { useEffect, useRef, useState } from "react";
|
import { useEffect, useRef, useState } from "react";
|
||||||
import { ChevronDownIcon } from "@/components/icons";
|
import { ChevronDown } from "lucide-react";
|
||||||
|
|
||||||
export default function Intro() {
|
export default function Intro() {
|
||||||
const [visible, setVisible] = useState(false);
|
const [visible, setVisible] = useState(false);
|
||||||
@@ -97,7 +97,7 @@ export default function Intro() {
|
|||||||
className="text-foreground/50 hover:text-yellow-bright transition-colors duration-300"
|
className="text-foreground/50 hover:text-yellow-bright transition-colors duration-300"
|
||||||
aria-label="Scroll to next section"
|
aria-label="Scroll to next section"
|
||||||
>
|
>
|
||||||
<ChevronDownIcon size={40} className="animate-bounce" />
|
<ChevronDown size={40} className="animate-bounce" />
|
||||||
</button>
|
</button>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -1,4 +1,3 @@
|
|||||||
import React from "react";
|
|
||||||
|
|
||||||
interface ActivityDay {
|
interface ActivityDay {
|
||||||
grand_total: { total_seconds: number };
|
grand_total: { total_seconds: number };
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
import React, { useEffect, useRef, useState } from "react";
|
import { useEffect, useRef, useState } from "react";
|
||||||
|
|
||||||
interface AnimateInProps {
|
interface AnimateInProps {
|
||||||
children: React.ReactNode;
|
children: React.ReactNode;
|
||||||
|
|||||||
@@ -1,9 +1,9 @@
|
|||||||
import type { AnimationEngine } from "@/lib/animations/types";
|
import type { AnimationEngine } from "@/lib/animations/types";
|
||||||
import { GameOfLifeEngine } from "./game-of-life";
|
import { GameOfLifeEngine } from "@/components/background/engines/game-of-life";
|
||||||
import { LavaLampEngine } from "./lava-lamp";
|
import { LavaLampEngine } from "@/components/background/engines/lava-lamp";
|
||||||
import { ConfettiEngine } from "./confetti";
|
import { ConfettiEngine } from "@/components/background/engines/confetti";
|
||||||
import { AsciiquariumEngine } from "./asciiquarium";
|
import { AsciiquariumEngine } from "@/components/background/engines/asciiquarium";
|
||||||
import { PipesEngine } from "./pipes";
|
import { PipesEngine } from "@/components/background/engines/pipes";
|
||||||
|
|
||||||
type ChildId = "game-of-life" | "lava-lamp" | "confetti" | "asciiquarium" | "pipes";
|
type ChildId = "game-of-life" | "lava-lamp" | "confetti" | "asciiquarium" | "pipes";
|
||||||
|
|
||||||
|
|||||||
@@ -1,10 +1,10 @@
|
|||||||
import { useEffect, useRef } from "react";
|
import { useEffect, useRef } from "react";
|
||||||
import { GameOfLifeEngine } from "./engines/game-of-life";
|
import { GameOfLifeEngine } from "@/components/background/engines/game-of-life";
|
||||||
import { LavaLampEngine } from "./engines/lava-lamp";
|
import { LavaLampEngine } from "@/components/background/engines/lava-lamp";
|
||||||
import { ConfettiEngine } from "./engines/confetti";
|
import { ConfettiEngine } from "@/components/background/engines/confetti";
|
||||||
import { AsciiquariumEngine } from "./engines/asciiquarium";
|
import { AsciiquariumEngine } from "@/components/background/engines/asciiquarium";
|
||||||
import { PipesEngine } from "./engines/pipes";
|
import { PipesEngine } from "@/components/background/engines/pipes";
|
||||||
import { ShuffleEngine } from "./engines/shuffle";
|
import { ShuffleEngine } from "@/components/background/engines/shuffle";
|
||||||
import { getStoredAnimationId } from "@/lib/animations/engine";
|
import { getStoredAnimationId } from "@/lib/animations/engine";
|
||||||
import type { AnimationEngine } from "@/lib/animations/types";
|
import type { AnimationEngine } from "@/lib/animations/types";
|
||||||
import type { AnimationId } from "@/lib/animations";
|
import type { AnimationId } from "@/lib/animations";
|
||||||
|
|||||||
@@ -1,4 +1,3 @@
|
|||||||
import React from "react";
|
|
||||||
import { RssIcon, TagIcon, TrendingUpIcon } from "lucide-react";
|
import { RssIcon, TagIcon, TrendingUpIcon } from "lucide-react";
|
||||||
import { AnimateIn } from "@/components/animate-in";
|
import { AnimateIn } from "@/components/animate-in";
|
||||||
|
|
||||||
|
|||||||
@@ -1,4 +1,3 @@
|
|||||||
import React from "react";
|
|
||||||
import { AnimateIn } from "@/components/animate-in";
|
import { AnimateIn } from "@/components/animate-in";
|
||||||
|
|
||||||
type BlogPost = {
|
type BlogPost = {
|
||||||
|
|||||||
@@ -1,4 +1,3 @@
|
|||||||
import React from "react";
|
|
||||||
import { Links } from "@/components/footer/links";
|
import { Links } from "@/components/footer/links";
|
||||||
|
|
||||||
export default function Footer({ fixed = false }) {
|
export default function Footer({ fixed = false }) {
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
import React, { useState, useEffect } from "react";
|
import { useState, useEffect, useRef } from "react";
|
||||||
import { Links } from "@/components/header/links";
|
import { Links } from "@/components/header/links";
|
||||||
|
|
||||||
export default function Header({ transparent = false }: { transparent?: boolean }) {
|
export default function Header({ transparent = false }: { transparent?: boolean }) {
|
||||||
|
|||||||
@@ -1,4 +1,3 @@
|
|||||||
import React from "react";
|
|
||||||
import Typewriter from "typewriter-effect";
|
import Typewriter from "typewriter-effect";
|
||||||
|
|
||||||
const html = (strings: TemplateStringsArray, ...values: any[]) => {
|
const html = (strings: TemplateStringsArray, ...values: any[]) => {
|
||||||
|
|||||||
@@ -1,7 +0,0 @@
|
|||||||
import React from "react";
|
|
||||||
|
|
||||||
import { ChevronDown } from "lucide-react";
|
|
||||||
|
|
||||||
export const ChevronDownIcon = (props: React.ComponentProps<typeof ChevronDown>) => {
|
|
||||||
return <ChevronDown {...props} />;
|
|
||||||
};
|
|
||||||
@@ -1 +0,0 @@
|
|||||||
export { ChevronDownIcon } from "@/components/icons/chevron-down";
|
|
||||||
@@ -1,4 +1,3 @@
|
|||||||
import React from "react";
|
|
||||||
import type { CollectionEntry } from "astro:content";
|
import type { CollectionEntry } from "astro:content";
|
||||||
import { AnimateIn } from "@/components/animate-in";
|
import { AnimateIn } from "@/components/animate-in";
|
||||||
|
|
||||||
|
|||||||
@@ -1,6 +1,4 @@
|
|||||||
---
|
---
|
||||||
const { content } = Astro.props;
|
|
||||||
|
|
||||||
import "@/style/globals.css";
|
import "@/style/globals.css";
|
||||||
|
|
||||||
import { ClientRouter } from "astro:transitions";
|
import { ClientRouter } from "astro:transitions";
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
import { ANIMATION_IDS, DEFAULT_ANIMATION_ID } from "./index";
|
import { ANIMATION_IDS, DEFAULT_ANIMATION_ID } from "@/lib/animations";
|
||||||
import type { AnimationId } from "./index";
|
import type { AnimationId } from "@/lib/animations";
|
||||||
|
|
||||||
export function getStoredAnimationId(): AnimationId {
|
export function getStoredAnimationId(): AnimationId {
|
||||||
if (typeof window === "undefined") return DEFAULT_ANIMATION_ID;
|
if (typeof window === "undefined") return DEFAULT_ANIMATION_ID;
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
import { ANIMATION_IDS, DEFAULT_ANIMATION_ID } from "./index";
|
import { ANIMATION_IDS, DEFAULT_ANIMATION_ID } from "@/lib/animations";
|
||||||
|
|
||||||
const VALID_IDS = JSON.stringify(ANIMATION_IDS);
|
const VALID_IDS = JSON.stringify(ANIMATION_IDS);
|
||||||
|
|
||||||
|
|||||||
@@ -1,14 +0,0 @@
|
|||||||
import readingTime from "reading-time";
|
|
||||||
|
|
||||||
type Post = {
|
|
||||||
title: string
|
|
||||||
file: string
|
|
||||||
rawContent: () => string
|
|
||||||
}
|
|
||||||
|
|
||||||
export default function getPostData(post: Post) {
|
|
||||||
return {
|
|
||||||
slug: post.file.split('/').pop().split('.').shift(),
|
|
||||||
readingTime: readingTime(post.rawContent()).text,
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,6 +1,6 @@
|
|||||||
import { THEMES, DEFAULT_THEME_ID } from "./index";
|
import { THEMES, DEFAULT_THEME_ID } from "@/lib/themes";
|
||||||
import { CSS_PROPS } from "./props";
|
import { CSS_PROPS } from "@/lib/themes/props";
|
||||||
import type { Theme } from "./types";
|
import type { Theme } from "@/lib/themes/types";
|
||||||
|
|
||||||
export function getStoredThemeId(): string {
|
export function getStoredThemeId(): string {
|
||||||
if (typeof window === "undefined") return DEFAULT_THEME_ID;
|
if (typeof window === "undefined") return DEFAULT_THEME_ID;
|
||||||
|
|||||||
@@ -3,8 +3,8 @@
|
|||||||
* Called at build time in Astro frontmatter.
|
* Called at build time in Astro frontmatter.
|
||||||
* The script reads "theme" from localStorage, looks up colors, injects a <style> tag.
|
* The script reads "theme" from localStorage, looks up colors, injects a <style> tag.
|
||||||
*/
|
*/
|
||||||
import { THEMES } from "./index";
|
import { THEMES } from "@/lib/themes";
|
||||||
import { CSS_PROPS } from "./props";
|
import { CSS_PROPS } from "@/lib/themes/props";
|
||||||
|
|
||||||
// Pre-build a { prop: value } map for each theme at build time
|
// Pre-build a { prop: value } map for each theme at build time
|
||||||
const themeVars: Record<string, Record<string, string>> = {};
|
const themeVars: Record<string, Record<string, string>> = {};
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
import type { ThemeColors } from "./types";
|
import type { ThemeColors } from "@/lib/themes/types";
|
||||||
|
|
||||||
export const CSS_PROPS: [keyof ThemeColors, string][] = [
|
export const CSS_PROPS: [keyof ThemeColors, string][] = [
|
||||||
["background", "--color-background"],
|
["background", "--color-background"],
|
||||||
|
|||||||
@@ -4,7 +4,7 @@ import GlitchText from "@/components/404/glitched-text";
|
|||||||
const title = "404 Not Found";
|
const title = "404 Not Found";
|
||||||
---
|
---
|
||||||
|
|
||||||
<IndexLayout content={{ title: "404 | Timothy Pidashev" }}>
|
<IndexLayout title="404 | Timothy Pidashev" description="Page not found">
|
||||||
<main class="min-h-screen flex flex-col items-center justify-center p-4 text-center">
|
<main class="min-h-screen flex flex-col items-center justify-center p-4 text-center">
|
||||||
<GlitchText client:only />
|
<GlitchText client:only />
|
||||||
<p class="text-xl text-orange mb-8">Whoops! This page doesn't exist :(</p>
|
<p class="text-xl text-orange mb-8">Whoops! This page doesn't exist :(</p>
|
||||||
|
|||||||
@@ -3,7 +3,9 @@ import { getCollection } from "astro:content";
|
|||||||
import type { APIContext } from "astro";
|
import type { APIContext } from "astro";
|
||||||
|
|
||||||
export async function GET(context: APIContext) {
|
export async function GET(context: APIContext) {
|
||||||
const blog = await getCollection("blog");
|
const blog = await getCollection("blog", ({ data }) => {
|
||||||
|
return import.meta.env.DEV || data.isDraft !== true;
|
||||||
|
});
|
||||||
|
|
||||||
const sortedPosts = blog
|
const sortedPosts = blog
|
||||||
.sort((a, b) => b.data.date.valueOf() - a.data.date.valueOf());
|
.sort((a, b) => b.data.date.valueOf() - a.data.date.valueOf());
|
||||||
|
|||||||
Reference in New Issue
Block a user