Skip to content

Dim hidden games #1255

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Apr 30, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 10 additions & 1 deletion src/screens/Library/components/GameCard/index.css
Original file line number Diff line number Diff line change
Expand Up @@ -219,6 +219,11 @@
z-index: 7;
}

.gameImg,
.gameLogo {
transition: all 0.2s, opacity 0.5s;
}

.gameImg:not(.installed),
.gameLogo:not(.installed) {
filter: grayscale(var(--installing-effect));
Expand All @@ -227,7 +232,11 @@
.gameCard:hover .gameImg:not(.installed),
.gameCard:hover .gameLogo:not(.installed) {
filter: grayscale(0);
transition-duration: 0.2s;
}

.gameCard.hidden .gameImg,
.gameCard.hidden .gameLogo {
opacity: 0.2;
}

.icons {
Expand Down
14 changes: 9 additions & 5 deletions src/screens/Library/components/GameCard/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -108,13 +108,8 @@ const GameCard = ({
? `${125 - getProgress(progress)}%`
: '100%'

const instClass = isInstalled ? 'installed' : ''
const imgClasses = `gameImg ${isInstalled ? 'installed' : ''}`
const logoClasses = `gameLogo ${isInstalled ? 'installed' : ''}`
const imageSrc = getImageFormatting()

const wrapperClasses = `${grid ? 'gameCard' : 'gameListItem'} ${instClass}`

async function handleUpdate() {
await handleGameStatus({ appName, runner, status: 'updating' })
await updateGame(appName, runner)
Expand Down Expand Up @@ -289,6 +284,15 @@ const GameCard = ({
}
]

const instClass = isInstalled ? 'installed' : ''
const hiddenClass = isHiddenGame ? 'hidden' : ''
const imgClasses = `gameImg ${isInstalled ? 'installed' : ''}`
const logoClasses = `gameLogo ${isInstalled ? 'installed' : ''}`

const wrapperClasses = `${
grid ? 'gameCard' : 'gameListItem'
} ${instClass} ${hiddenClass}`

return (
<>
<ContextMenu items={items}>
Expand Down