Public Access
feat(dashboard): Steam avatar and a banner from the most played game
This commit is contained in:
1 parent
2c360c9421
commit
23e502bf5b
11 files changed
+222
-37
No files matched your search
@@ -1,20 +1,14 @@
|
||||
import {useState} from 'react';
|
||||
import {coverUrl, heroUrl} from '../utils/games.js';
|
||||
import HeroArt from './HeroArt.jsx';
|
||||
|
||||
/**
|
||||
* Game art behind the whole page, blurred and dimmed so text on it stays readable. Falls back to the store
|
||||
* header for apps without library art. Give it `key={appid}`, so a new game starts with its library art again.
|
||||
* Game art behind the whole page, blurred and dimmed so text on it stays readable.
|
||||
*/
|
||||
export default function PageBackground({appid}) {
|
||||
const [failures, setFailures] = useState(0);
|
||||
|
||||
if (!appid || failures > 1) return null;
|
||||
if (!appid) return null;
|
||||
|
||||
return (
|
||||
<div aria-hidden="true" className="pointer-events-none fixed inset-0 -z-10 overflow-hidden">
|
||||
<img src={failures === 0 ? heroUrl(appid) : coverUrl(appid)} alt=""
|
||||
onError={() => setFailures((count) => count + 1)}
|
||||
className="size-full scale-110 object-cover blur-md"/>
|
||||
<HeroArt key={appid} appid={appid} className="size-full scale-110 object-cover blur-md"/>
|
||||
<div className="absolute inset-0 bg-background/80"/>
|
||||
</div>
|
||||
);
|
||||
|
||||
Reference in new issue
Block a user