fix: restore random nerdy quotes and hide empty project links

Re-implemented random quote rotation in activity feed when idle. Added conditional rendering for project links box to declutter project pages.
This commit is contained in:
2026-02-16 01:39:01 +01:00
parent 91eb446ac5
commit 739ee8a825
2 changed files with 81 additions and 29 deletions

View File

@@ -111,26 +111,53 @@ export default function ProjectDetailClient({
</div>
</div>
<div className="lg:col-span-4 space-y-8">
<div className="bg-stone-900 dark:bg-stone-800 rounded-[3rem] p-10 border border-stone-800 dark:border-stone-700 shadow-2xl text-white">
<h3 className="text-xl font-black mb-8 uppercase tracking-widest text-liquid-mint">Links</h3>
<div className="space-y-4">
{project.live && (
<a href={project.live} target="_blank" rel="noopener noreferrer" className="flex items-center justify-between w-full p-5 bg-white text-stone-900 rounded-2xl font-black hover:scale-105 transition-transform group">
<span>{project.button_live_label || tDetail("liveDemo")}</span>
<ExternalLink size={20} className="group-hover:translate-x-1 transition-transform" />
</a>
)}
{project.github && (
<a href={project.github} target="_blank" rel="noopener noreferrer" className="flex items-center justify-between w-full p-5 bg-stone-800 text-white border border-stone-700 rounded-2xl font-black hover:bg-stone-700 transition-colors group">
<span>{project.button_github_label || tDetail("viewSource")}</span>
<GithubIcon size={20} className="group-hover:rotate-12 transition-transform" />
</a>
)}
</div>
</div>
<div className="lg:col-span-4 space-y-8">
<div className="bg-white dark:bg-stone-900 rounded-[3rem] p-10 border border-stone-200/60 dark:border-stone-800/60 shadow-sm">
{/* Quick Links Box - Only show if links exist */}
{((project.live && project.live !== "#") || (project.github && project.github !== "#")) && (
<div className="bg-stone-900 dark:bg-stone-800 rounded-[3rem] p-10 border border-stone-800 dark:border-stone-700 shadow-2xl text-white">
<h3 className="text-xl font-black mb-8 uppercase tracking-widest text-liquid-mint">Links</h3>
<div className="space-y-4">
{project.live && project.live !== "#" && (
<a href={project.live} target="_blank" rel="noopener noreferrer" className="flex items-center justify-between w-full p-5 bg-white text-stone-900 rounded-2xl font-black hover:scale-105 transition-transform group">
<span>{project.button_live_label || tDetail("liveDemo")}</span>
<ExternalLink size={20} className="group-hover:translate-x-1 transition-transform" />
</a>
)}
{project.github && project.github !== "#" && (
<a href={project.github} target="_blank" rel="noopener noreferrer" className="flex items-center justify-between w-full p-5 bg-stone-800 text-white border border-stone-700 rounded-2xl font-black hover:bg-stone-700 transition-colors group">
<span>{project.button_github_label || tDetail("viewSource")}</span>
<GithubIcon size={20} className="group-hover:rotate-12 transition-transform" />
</a>
)}
</div>
</div>
)}
<div className="bg-white dark:bg-stone-900 rounded-[3rem] p-10 border border-stone-200/60 dark:border-stone-800/60 shadow-sm">
<h3 className="text-xl font-black mb-8 uppercase tracking-widest text-stone-400">Stack</h3>
<div className="flex flex-wrap gap-2">
{project.tags.map((tag) => (

View File

@@ -3,7 +3,7 @@
import React, { useEffect, useState } from "react";
import Image from "next/image";
import { motion } from "framer-motion";
import { Code2, Disc3, Gamepad2, Zap, BookOpen, Quote } from "lucide-react";
import { Code2, Disc3, Gamepad2, Zap, Quote as QuoteIcon } from "lucide-react";
interface StatusData {
status: { text: string; color: string; };
@@ -13,17 +13,39 @@ interface StatusData {
customActivities?: Record<string, any>;
}
const techQuotes = [
{ content: "Computer Science is no more about computers than astronomy is about telescopes.", author: "Edsger W. Dijkstra" },
{ content: "Simplicity is prerequisite for reliability.", author: "Edsger W. Dijkstra" },
{ content: "If debugging is the process of removing software bugs, then programming must be the process of putting them in.", author: "Edsger W. Dijkstra" },
{ content: "There are two ways of constructing a software design: One way is to make it so simple that there are obviously no deficiencies, and the other way is to make it so complicated that there are no obvious deficiencies.", author: "Tony Hoare" },
{ content: "Deleted code is debugged code.", author: "Jeff Sickel" },
{ content: "Walking on water and developing software from a specification are easy if both are frozen.", author: "Edward V. Berard" },
{ content: "Code never lies, comments sometimes do.", author: "Ron Jeffries" },
{ content: "I have no special talent. I am only passionately curious.", author: "Albert Einstein" },
{ content: "No code is faster than no code.", author: "Kevlin Henney" },
{ content: "First, solve the problem. Then, write the code.", author: "John Johnson" }
];
function getSafeGamingText(details: string | number | undefined, state: string | number | undefined, fallback: string): string {
if (typeof details === 'string' && details.trim().length > 0) return details;
if (typeof state === 'string' && state.trim().length > 0) return state;
if (typeof details === 'number' && !isNaN(details)) return String(details);
if (typeof state === 'number' && !isNaN(state)) return String(state);
return fallback;
}
export default function ActivityFeed({
onActivityChange,
idleQuote
onActivityChange
}: {
onActivityChange?: (active: boolean) => void;
idleQuote?: string;
}) {
const [data, setData] = useState<StatusData | null>(null);
const [hasActivity, setHasActivity] = useState(false);
const [randomQuote, setRandomQuote] = useState(techQuotes[0]);
useEffect(() => {
setRandomQuote(techQuotes[Math.floor(Math.random() * techQuotes.length)]);
const fetchData = async () => {
try {
const res = await fetch("/api/n8n/status");
@@ -59,13 +81,16 @@ export default function ActivityFeed({
className="h-full flex flex-col justify-center space-y-6"
>
<div className="w-10 h-10 rounded-full bg-liquid-mint/10 flex items-center justify-center">
<Quote size={18} className="text-liquid-mint" />
<QuoteIcon size={18} className="text-liquid-mint" />
</div>
<p className="text-xl md:text-2xl font-light leading-tight text-stone-300 italic">
&ldquo;{idleQuote || "Gerade am Planen des nächsten großen Projekts."}&rdquo;
</p>
<div className="flex items-center gap-2 text-[10px] font-black uppercase tracking-widest text-stone-500">
<span className="w-1.5 h-1.5 rounded-full bg-stone-700" /> Currently Idle
<div className="space-y-4">
<p className="text-xl md:text-2xl font-light leading-tight text-stone-300 italic">
&ldquo;{randomQuote.content}&rdquo;
</p>
<p className="text-xs font-bold text-stone-500 uppercase tracking-widest"> {randomQuote.author}</p>
</div>
<div className="flex items-center gap-2 text-[10px] font-black uppercase tracking-widest text-stone-600">
<span className="w-1.5 h-1.5 rounded-full bg-stone-700" /> Currently Thinking
</div>
</motion.div>
);