mirror of
https://github.com/redphx/better-xcloud.git
synced 2025-08-11 23:55:18 +02:00
Game bar (#392)
* Fix games with custom touch control sometimes not showing touch icon * Create game-bar with screenshot button * Disable Game bar when opening the Guide * Remove SCREENSHOT_BUTTON_POSITION pref * Make the touch control action functional * Show game bar when the game starts * Fix 720p/High not working (#387) * Update icons * Update game bar's animations * Reset states of Game bar actions before playing * Don't show Touch control action on non-touch-supported devices * Clean up * Update translations * Update actions' texts * Clean up
This commit is contained in:
91
src/assets/css/game-bar.styl
Normal file
91
src/assets/css/game-bar.styl
Normal file
@@ -0,0 +1,91 @@
|
||||
#bx-game-bar {
|
||||
z-index: var(--bx-game-bar-z-index);
|
||||
position: fixed;
|
||||
left: 0;
|
||||
bottom: 0;
|
||||
width: 40px;
|
||||
height: 90px;
|
||||
overflow: visible;
|
||||
cursor: pointer;
|
||||
|
||||
> svg {
|
||||
display: none;
|
||||
pointer-events: none;
|
||||
position: absolute;
|
||||
height: 28px;
|
||||
margin-top: 16px;
|
||||
}
|
||||
|
||||
@media (hover: hover) {
|
||||
&:hover {
|
||||
> svg {
|
||||
display: block;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.bx-game-bar-container {
|
||||
opacity: 0;
|
||||
position absolute;
|
||||
display: flex;
|
||||
overflow: hidden;
|
||||
background: #1a1b1ee8;
|
||||
border-radius: 0 10px 10px 0;
|
||||
box-shadow: 0px 0px 6px #1c1c1c;
|
||||
transition: opacity 0.1s ease-in;
|
||||
|
||||
&.bx-show {
|
||||
opacity: 1;
|
||||
|
||||
+ svg {
|
||||
display: none !important;
|
||||
}
|
||||
}
|
||||
|
||||
&.bx-hide {
|
||||
opacity: 0;
|
||||
}
|
||||
|
||||
button {
|
||||
width: 60px;
|
||||
height: 60px;
|
||||
|
||||
svg {
|
||||
width: 28px;
|
||||
height: 28px;
|
||||
transition: transform 0.08s ease 0s;
|
||||
}
|
||||
|
||||
&:hover {
|
||||
border-radius: 0;
|
||||
}
|
||||
|
||||
&:active {
|
||||
svg {
|
||||
transform: scale(0.75);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/* Touch controller buttons */
|
||||
div[data-enabled] {
|
||||
button {
|
||||
display: none;
|
||||
}
|
||||
}
|
||||
|
||||
/* Show disable button */
|
||||
div[data-enabled='true'] {
|
||||
button:last-of-type {
|
||||
display: block;
|
||||
}
|
||||
}
|
||||
|
||||
/* Show enable button */
|
||||
div[data-enabled='false'] {
|
||||
button:first-of-type {
|
||||
display: block;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
@@ -27,8 +27,7 @@
|
||||
--bx-stats-bar-z-index: 9001;
|
||||
--bx-stream-settings-z-index: 9000;
|
||||
--bx-mkb-pointer-lock-msg-z-index: 8999;
|
||||
--bx-screenshot-z-index: 8888;
|
||||
--bx-touch-controller-bar-z-index: 5555;
|
||||
--bx-game-bar-z-index: 8888;
|
||||
--bx-wait-time-box-z-index: 100;
|
||||
}
|
||||
|
||||
|
@@ -1,46 +0,0 @@
|
||||
.bx-screenshot-button {
|
||||
display: none;
|
||||
opacity: 0;
|
||||
position: fixed;
|
||||
bottom: 0;
|
||||
box-sizing: border-box;
|
||||
width: 60px;
|
||||
height: 90px;
|
||||
padding: 16px 16px 46px 16px;
|
||||
background-size: cover;
|
||||
background-repeat: no-repeat;
|
||||
background-origin: content-box;
|
||||
filter: drop-shadow(0 0 2px #000000B0);
|
||||
transition: opacity 0.1s ease-in-out 0s, padding 0.1s ease-in 0s;
|
||||
z-index: var(--bx-screenshot-z-index);
|
||||
|
||||
/* Credit: https://phosphoricons.com */
|
||||
background-image: url('data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIyNCIgaGVpZ2h0PSIyNCIgdmlld0JveD0iMCAwIDMyIDMyIiBmaWxsPSIjZmZmIj48cGF0aCBkPSJNMjguMzA4IDUuMDM4aC00LjI2NWwtMi4wOTctMy4xNDVhMS4yMyAxLjIzIDAgMCAwLTEuMDIzLS41NDhoLTkuODQ2YTEuMjMgMS4yMyAwIDAgMC0xLjAyMy41NDhMNy45NTYgNS4wMzhIMy42OTJBMy43MSAzLjcxIDAgMCAwIDAgOC43MzF2MTcuMjMxYTMuNzEgMy43MSAwIDAgMCAzLjY5MiAzLjY5MmgyNC42MTVBMy43MSAzLjcxIDAgMCAwIDMyIDI1Ljk2MlY4LjczMWEzLjcxIDMuNzEgMCAwIDAtMy42OTItMy42OTJ6bS02Ljc2OSAxMS42OTJjMCAzLjAzOS0yLjUgNS41MzgtNS41MzggNS41MzhzLTUuNTM4LTIuNS01LjUzOC01LjUzOCAyLjUtNS41MzggNS41MzgtNS41MzggNS41MzggMi41IDUuNTM4IDUuNTM4eiIvPjwvc3ZnPgo=');
|
||||
|
||||
&[data-showing=true] {
|
||||
opacity: 0.9;
|
||||
}
|
||||
|
||||
&[data-capturing=true] {
|
||||
padding: 8px 8px 38px 8px;
|
||||
}
|
||||
}
|
||||
|
||||
.bx-screenshot-canvas {
|
||||
display: none;
|
||||
}
|
||||
|
||||
#bx-touch-controller-bar {
|
||||
display: none;
|
||||
opacity: 0;
|
||||
position: fixed;
|
||||
bottom: 0;
|
||||
left: 0;
|
||||
right: 0;
|
||||
height: 6vh;
|
||||
z-index: var(--bx-touch-controller-bar-z-index);
|
||||
|
||||
&[data-showing=true] {
|
||||
display: block;
|
||||
}
|
||||
}
|
@@ -10,7 +10,7 @@
|
||||
|
||||
@import 'stream.styl';
|
||||
@import 'number-stepper.styl';
|
||||
@import 'stream-actions.styl';
|
||||
@import 'game-bar.styl';
|
||||
@import 'stream-stats.styl';
|
||||
@import 'stream-settings.styl';
|
||||
@import 'mkb.styl';
|
||||
|
Reference in New Issue
Block a user