Public Access
fix(ux): apply UX quick wins (#54)
Get started links to registration and says an admin approves accounts. Back navigation restores the library scroll; search no longer fills history. Steam and PSN unlink ask first. Any close marks news as seen. Confetti plays only when the level rises on the page. Count-ups respect reduced motion. Html lang follows the UI language. Add a 404 page, translated role and dialog close label.
This commit is contained in:
1 parent
60dcfe8992
commit
a60010e055
28 files changed
+427
-58
No files matched your search
@@ -4,15 +4,21 @@ import {useTranslation} from 'react-i18next';
|
||||
import {ArrowRight, Gamepad2} from 'lucide-react';
|
||||
|
||||
import {Card} from '@/components/ui/card';
|
||||
import useReducedMotion from '../hooks/useReducedMotion.js';
|
||||
|
||||
const DURATION_MS = 1000;
|
||||
const COUNT_CLASS = 'block text-5xl font-bold tracking-tight tabular-nums';
|
||||
|
||||
const SteamGameCount = ({targetCount}) => {
|
||||
const {t} = useTranslation();
|
||||
const reduce = useReducedMotion();
|
||||
const [count, setCount] = useState(0);
|
||||
|
||||
useEffect(() => {
|
||||
if (reduce) {
|
||||
setCount(targetCount);
|
||||
return undefined;
|
||||
}
|
||||
let frame;
|
||||
let startTime;
|
||||
const animate = (timestamp) => {
|
||||
@@ -25,7 +31,7 @@ const SteamGameCount = ({targetCount}) => {
|
||||
};
|
||||
frame = requestAnimationFrame(animate);
|
||||
return () => cancelAnimationFrame(frame);
|
||||
}, [targetCount]);
|
||||
}, [targetCount, reduce]);
|
||||
|
||||
return (
|
||||
<Card className="relative justify-between overflow-hidden p-6">
|
||||
|
||||
Reference in new issue
Block a user