Skip to content

Move game menu next to the title #1899

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 2 commits into from
Oct 13, 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
138 changes: 71 additions & 67 deletions src/frontend/screens/Game/GamePage/index.scss
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,77 @@
justify-content: stretch;
position: relative;

.title {
font-weight: var(--medium);
font-size: var(--text-xl);
line-height: 30px;
color: var(--text-default);
text-align: left;
.titleWrapper {
display: flex;
.title {
font-weight: var(--medium);
font-size: var(--text-xl);
line-height: 30px;
color: var(--text-default);
text-align: left;
flex-basis: 100%;
align-self: center;
}

.game-actions {
position: relative;
display: flex;
flex-direction: column;

.toggle {
align-self: flex-end;
background-color: transparent;
border: none;
color: var(--accent);
font-size: var(--text-2xl);
padding: var(--space-xs-fixed);
cursor: pointer;
position: relative;
transition: background-color 0.2s;
display: flex;
}

&:focus-within .toggle,
&:hover .toggle,
.toggle:hover {
color: var(--text-title);
}

.gameTools {
position: absolute;
opacity: 0;
pointer-events: none;
transition: opacity 0.2s, max-height 0.2s;
background: var(--navbar-background);
border-radius: 5px;
z-index: 2;
padding: 1rem;
max-height: 0px;
overflow: hidden;
right: 0;
top: 100%;
}

.gameTools .link {
width: 100%;
padding: 0 0 0.5rem;
text-align: left;
white-space: nowrap;
font-size: 1rem;

&:last-child {
padding-bottom: 0;
}
}

&:focus-within .gameTools,
&:hover .gameTools {
opacity: 1;
pointer-events: all;
max-height: 100vh;
box-shadow: 4px 5px 5px -2px rgba(0, 0, 0, 0.2);
}
}
}

.store-icon {
Expand Down Expand Up @@ -250,64 +315,3 @@
background-position: -100px 0px;
}
}

.game-actions {
position: absolute;
right: 1rem;
top: var(--space-xs-fixed);
display: flex;
flex-direction: column;

.toggle {
align-self: flex-end;
background-color: transparent;
border: none;
color: var(--accent);
font-size: var(--text-2xl);
padding: var(--space-xs-fixed);
cursor: pointer;
position: relative;
transition: background-color 0.2s;
}

&:focus-within .toggle,
&:hover .toggle,
.toggle:hover {
color: var(--text-title);
}

.gameTools {
position: absolute;
opacity: 0;
pointer-events: none;
transition: opacity 0.2s, max-height 0.2s;
background: var(--navbar-background);
border-radius: 5px;
z-index: 2;
padding: 1rem;
max-height: 0px;
overflow: hidden;
right: 0;
top: 100%;
}

.gameTools .link {
width: 100%;
padding: 0 0 0.5rem;
text-align: left;
white-space: nowrap;
font-size: 1rem;

&:last-child {
padding-bottom: 0;
}
}

&:focus-within .gameTools,
&:hover .gameTools {
opacity: 1;
pointer-events: all;
max-height: 100vh;
box-shadow: 4px 5px 5px -2px rgba(0, 0, 0, 0.2);
}
}
44 changes: 24 additions & 20 deletions src/frontend/screens/Game/GamePage/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -256,27 +256,31 @@ export default function GamePage(): JSX.Element | null {
<div className="store-icon">
{runner === 'legendary' ? <EpicLogo /> : <GOGLogo />}
</div>
<div className="game-actions">
<button className="toggle">
<FontAwesomeIcon icon={faEllipsisV} />
</button>

<GameSubMenu
appName={appName}
isInstalled={is_installed}
title={title}
storeUrl={gameInfo.store_url}
runner={gameInfo.runner}
handleUpdate={handleUpdate}
disableUpdate={updateRequested || isUpdating}
steamImageUrl={gameInfo.art_cover}
onShowRequirements={
hasRequirements ? () => setShowRequirements(true) : undefined
}
/>
</div>
<div className="gameInfo">
<h1 className="title">{title}</h1>
<div className="titleWrapper">
<h1 className="title">{title}</h1>
<div className="game-actions">
<button className="toggle">
<FontAwesomeIcon icon={faEllipsisV} />
</button>

<GameSubMenu
appName={appName}
isInstalled={is_installed}
title={title}
storeUrl={gameInfo.store_url}
runner={gameInfo.runner}
handleUpdate={handleUpdate}
disableUpdate={updateRequested || isUpdating}
steamImageUrl={gameInfo.art_cover}
onShowRequirements={
hasRequirements
? () => setShowRequirements(true)
: undefined
}
/>
</div>
</div>
<div className="infoWrapper">
<div className="developer">{developer}</div>
<div className="summary">
Expand Down