fix: randomize quotes, remove CMS idle quote, fix postgres image tag
- Remove hardcoded Dennis Konkol idle quote from rotation - Double quote pool (5 → 12 quotes per locale) - Start at a random quote on page load - Cycle to a random non-repeating quote every 10s instead of sequential - Fix dev-deploy.yml: postgres:15-alpine → postgres:16-alpine Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -68,7 +68,7 @@ jobs:
|
|||||||
|
|
||||||
# Remove old images to force re-pull with correct architecture
|
# Remove old images to force re-pull with correct architecture
|
||||||
echo "🔄 Removing old images to force re-pull..."
|
echo "🔄 Removing old images to force re-pull..."
|
||||||
docker rmi postgres:15-alpine redis:7-alpine 2>/dev/null || true
|
docker rmi postgres:16-alpine redis:7-alpine 2>/dev/null || true
|
||||||
|
|
||||||
# Ensure networks exist before compose starts (network is external)
|
# Ensure networks exist before compose starts (network is external)
|
||||||
echo "🌐 Ensuring networks exist..."
|
echo "🌐 Ensuring networks exist..."
|
||||||
|
|||||||
@@ -126,7 +126,7 @@ const About = () => {
|
|||||||
<h3 className="text-lg sm:text-xl font-black mb-6 sm:mb-8 md:mb-10 flex items-center gap-2 uppercase tracking-widest text-liquid-mint">
|
<h3 className="text-lg sm:text-xl font-black mb-6 sm:mb-8 md:mb-10 flex items-center gap-2 uppercase tracking-widest text-liquid-mint">
|
||||||
<Activity size={20} /> Status
|
<Activity size={20} /> Status
|
||||||
</h3>
|
</h3>
|
||||||
<ActivityFeed idleQuote={cmsMessages["about.quote.idle"]} locale={locale} />
|
<ActivityFeed locale={locale} />
|
||||||
</div>
|
</div>
|
||||||
<div className="absolute top-0 right-0 w-40 h-40 bg-liquid-mint/10 blur-[100px] rounded-full" />
|
<div className="absolute top-0 right-0 w-40 h-40 bg-liquid-mint/10 blur-[100px] rounded-full" />
|
||||||
</motion.div>
|
</motion.div>
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
"use client";
|
"use client";
|
||||||
|
|
||||||
import React, { useEffect, useState } from "react";
|
import { useEffect, useState } from "react";
|
||||||
import { motion, AnimatePresence } from "framer-motion";
|
import { motion, AnimatePresence } from "framer-motion";
|
||||||
import { Disc3, Gamepad2, Zap, Quote as QuoteIcon } from "lucide-react";
|
import { Disc3, Gamepad2, Zap, Quote as QuoteIcon } from "lucide-react";
|
||||||
import { useTranslations } from "next-intl";
|
import { useTranslations } from "next-intl";
|
||||||
@@ -22,14 +22,28 @@ const techQuotes = {
|
|||||||
{ content: "Einfachheit ist die Voraussetzung für Verlässlichkeit.", author: "Edsger W. Dijkstra" },
|
{ content: "Einfachheit ist die Voraussetzung für Verlässlichkeit.", author: "Edsger W. Dijkstra" },
|
||||||
{ content: "Wenn Debugging der Prozess des Entfernens von Fehlern ist, dann muss Programmieren der Prozess des Einbauens sein.", author: "Edsger W. Dijkstra" },
|
{ content: "Wenn Debugging der Prozess des Entfernens von Fehlern ist, dann muss Programmieren der Prozess des Einbauens sein.", author: "Edsger W. Dijkstra" },
|
||||||
{ content: "Gelöschter Code ist gedebuggter Code.", author: "Jeff Sickel" },
|
{ content: "Gelöschter Code ist gedebuggter Code.", author: "Jeff Sickel" },
|
||||||
{ content: "Zuerst löse das Problem. Dann schreibe den Code.", author: "John Johnson" }
|
{ content: "Zuerst löse das Problem. Dann schreibe den Code.", author: "John Johnson" },
|
||||||
|
{ content: "Jedes Programm kann um mindestens einen Faktor zwei vereinfacht werden. Jedes Programm hat mindestens einen Bug.", author: "Kernighan's Law" },
|
||||||
|
{ content: "Code lesen ist schwieriger als Code schreiben — deshalb schreibt jeder neu.", author: "Joel Spolsky" },
|
||||||
|
{ content: "Die beste Performance-Optimierung ist der Übergang von nicht-funktionierend zu funktionierend.", author: "J. Osterhout" },
|
||||||
|
{ content: "Mach es funktionierend, dann mach es schön, dann mach es schnell — in dieser Reihenfolge.", author: "Kent Beck" },
|
||||||
|
{ content: "Software ist wie Entropie: Es ist schwer zu fassen, wiegt nichts und gehorcht dem zweiten Hauptsatz der Thermodynamik.", author: "Norman Augustine" },
|
||||||
|
{ content: "Gute Software ist nicht die, die keine Bugs hat — sondern die, deren Bugs keine Rolle spielen.", author: "Bruce Eckel" },
|
||||||
|
{ content: "Der einzige Weg, schnell zu gehen, ist, gut zu gehen.", author: "Robert C. Martin" },
|
||||||
],
|
],
|
||||||
en: [
|
en: [
|
||||||
{ content: "Computer Science is no more about computers than astronomy is about telescopes.", author: "Edsger W. Dijkstra" },
|
{ 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: "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: "If debugging is the process of removing software bugs, then programming must be the process of putting them in.", author: "Edsger W. Dijkstra" },
|
||||||
{ content: "Deleted code is debugged code.", author: "Jeff Sickel" },
|
{ content: "Deleted code is debugged code.", author: "Jeff Sickel" },
|
||||||
{ content: "First, solve the problem. Then, write the code.", author: "John Johnson" }
|
{ content: "First, solve the problem. Then, write the code.", author: "John Johnson" },
|
||||||
|
{ content: "Any program can be simplified by at least a factor of two. Every program has at least one bug.", author: "Kernighan's Law" },
|
||||||
|
{ content: "It's harder to read code than to write it — that's why everyone rewrites.", author: "Joel Spolsky" },
|
||||||
|
{ content: "The best performance optimization is the transition from a non-working state to a working state.", author: "J. Osterhout" },
|
||||||
|
{ content: "Make it work, make it right, make it fast — in that order.", author: "Kent Beck" },
|
||||||
|
{ content: "Software is like entropy: it is difficult to grasp, weighs nothing, and obeys the second law of thermodynamics.", author: "Norman Augustine" },
|
||||||
|
{ content: "Good software isn't software with no bugs — it's software whose bugs don't matter.", author: "Bruce Eckel" },
|
||||||
|
{ content: "The only way to go fast is to go well.", author: "Robert C. Martin" },
|
||||||
]
|
]
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -41,28 +55,18 @@ function getSafeGamingText(details: string | number | undefined, state: string |
|
|||||||
|
|
||||||
export default function ActivityFeed({
|
export default function ActivityFeed({
|
||||||
onActivityChange,
|
onActivityChange,
|
||||||
idleQuote,
|
|
||||||
locale = 'en'
|
locale = 'en'
|
||||||
}: {
|
}: {
|
||||||
onActivityChange?: (active: boolean) => void;
|
onActivityChange?: (active: boolean) => void;
|
||||||
idleQuote?: string;
|
|
||||||
locale?: string;
|
locale?: string;
|
||||||
}) {
|
}) {
|
||||||
const [data, setData] = useState<StatusData | null>(null);
|
const [data, setData] = useState<StatusData | null>(null);
|
||||||
const [hasActivity, setHasActivity] = useState(false);
|
const [hasActivity, setHasActivity] = useState(false);
|
||||||
const [quoteIndex, setQuoteIndex] = useState(0);
|
const [quoteIndex, setQuoteIndex] = useState(() => Math.floor(Math.random() * (techQuotes[locale as keyof typeof techQuotes] || techQuotes.en).length));
|
||||||
const [loading, setLoading] = useState(true);
|
const [loading, setLoading] = useState(true);
|
||||||
const t = useTranslations("home.about.activity");
|
const t = useTranslations("home.about.activity");
|
||||||
|
|
||||||
const currentQuotes = techQuotes[locale as keyof typeof techQuotes] || techQuotes.en;
|
const allQuotes = techQuotes[locale as keyof typeof techQuotes] || techQuotes.en;
|
||||||
|
|
||||||
// Combine CMS quote with tech quotes if available
|
|
||||||
const allQuotes = React.useMemo(() => {
|
|
||||||
if (idleQuote) {
|
|
||||||
return [{ content: idleQuote, author: "Dennis Konkol" }, ...currentQuotes];
|
|
||||||
}
|
|
||||||
return currentQuotes;
|
|
||||||
}, [idleQuote, currentQuotes]);
|
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
const fetchData = async () => {
|
const fetchData = async () => {
|
||||||
@@ -92,16 +96,20 @@ export default function ActivityFeed({
|
|||||||
fetchData();
|
fetchData();
|
||||||
const statusInterval = setInterval(fetchData, 30000);
|
const statusInterval = setInterval(fetchData, 30000);
|
||||||
|
|
||||||
// Cycle quotes every 10 seconds
|
// Pick a random quote every 10 seconds (never the same one twice in a row)
|
||||||
const quoteInterval = setInterval(() => {
|
const quoteInterval = setInterval(() => {
|
||||||
setQuoteIndex((prev) => (prev + 1) % allQuotes.length);
|
setQuoteIndex((prev) => {
|
||||||
|
let next;
|
||||||
|
do { next = Math.floor(Math.random() * allQuotes.length); } while (next === prev && allQuotes.length > 1);
|
||||||
|
return next;
|
||||||
|
});
|
||||||
}, 10000);
|
}, 10000);
|
||||||
|
|
||||||
return () => {
|
return () => {
|
||||||
clearInterval(statusInterval);
|
clearInterval(statusInterval);
|
||||||
clearInterval(quoteInterval);
|
clearInterval(quoteInterval);
|
||||||
};
|
};
|
||||||
}, [onActivityChange, allQuotes.length]);
|
}, [onActivityChange]);
|
||||||
|
|
||||||
if (loading) {
|
if (loading) {
|
||||||
return <div className="animate-pulse space-y-4">
|
return <div className="animate-pulse space-y-4">
|
||||||
|
|||||||
Reference in New Issue
Block a user