mirror of
https://github.com/redphx/better-xcloud.git
synced 2025-06-06 15:47:18 +02:00
Optimize CSS selectors
This commit is contained in:
parent
e45537adf0
commit
5ce7ade574
18
dist/better-xcloud.pretty.user.js
vendored
18
dist/better-xcloud.pretty.user.js
vendored
File diff suppressed because one or more lines are too long
8
dist/better-xcloud.user.js
vendored
8
dist/better-xcloud.user.js
vendored
File diff suppressed because one or more lines are too long
@ -51,7 +51,7 @@ button_color(name, normal, hover, active, disabled)
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* Fix Stream menu buttons not hiding */
|
/* Fix Stream menu buttons not hiding */
|
||||||
div[class^=HUDButton-module__hiddenContainer] ~ div:not([class^=HUDButton-module__hiddenContainer]) {
|
#StreamHud div[class^=HUDButton-module__hiddenContainer] ~ div:not([class^=HUDButton-module__hiddenContainer]) {
|
||||||
opacity: 0;
|
opacity: 0;
|
||||||
pointer-events: none !important;
|
pointer-events: none !important;
|
||||||
position: absolute;
|
position: absolute;
|
||||||
@ -182,7 +182,8 @@ select[multiple], select[multiple]:focus {
|
|||||||
display: none;
|
display: none;
|
||||||
}
|
}
|
||||||
|
|
||||||
div[class*=NotFocusedDialog] {
|
#game-stream {
|
||||||
|
div[class^=NotFocusedDialog] {
|
||||||
position: absolute !important;
|
position: absolute !important;
|
||||||
top: -9999px !important;
|
top: -9999px !important;
|
||||||
left: -9999px !important;
|
left: -9999px !important;
|
||||||
@ -190,9 +191,10 @@ div[class*=NotFocusedDialog] {
|
|||||||
height: 0px !important;
|
height: 0px !important;
|
||||||
}
|
}
|
||||||
|
|
||||||
#game-stream video:not([src]) {
|
video:not([src]) {
|
||||||
visibility: hidden;
|
visibility: hidden;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
.bx-game-tile-wait-time {
|
.bx-game-tile-wait-time {
|
||||||
position: absolute;
|
position: absolute;
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
div[class*=StreamMenu-module__menuContainer] > div[class*=Menu-module] {
|
#game-stream div[class^=StreamMenu-module__menuContainer] > div[class^=Menu-module] {
|
||||||
overflow: visible;
|
overflow: visible;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -744,16 +744,8 @@ true` + text;
|
|||||||
// Don't render "All Games" sections
|
// Don't render "All Games" sections
|
||||||
ignoreAllGamesSection(str: string) {
|
ignoreAllGamesSection(str: string) {
|
||||||
let index = str.indexOf('className:"AllGamesRow-module__allGamesRowContainer');
|
let index = str.indexOf('className:"AllGamesRow-module__allGamesRowContainer');
|
||||||
if (index < 0) {
|
index > -1 && (index = PatcherUtils.indexOf(str, 'grid:!0,', index, 1500));
|
||||||
return false;
|
index > -1 && (index = PatcherUtils.lastIndexOf(str, '(0,', index, 70));
|
||||||
}
|
|
||||||
|
|
||||||
index = PatcherUtils.indexOf(str, 'grid:!0,', index, 1500);
|
|
||||||
if (index < 0) {
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
index = PatcherUtils.lastIndexOf(str, '(0,', index, 70);
|
|
||||||
if (index < 0) {
|
if (index < 0) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
@ -15,8 +15,8 @@ export function addCss() {
|
|||||||
|
|
||||||
if (isLiteVersion()) {
|
if (isLiteVersion()) {
|
||||||
// Hide Controller icon in Game tiles
|
// Hide Controller icon in Game tiles
|
||||||
selectorToHide.push('div[class*=SupportedInputsBadge] svg:first-of-type');
|
selectorToHide.push('div[role=img][class*=SupportedInputsBadge] svg:first-of-type');
|
||||||
selectorToHide.push('div[class*=SupportedInputsBadge]:not(:has(:nth-child(2)))');
|
selectorToHide.push('div[role=img][class*=SupportedInputsBadge]:not(:has(:nth-child(2)))');
|
||||||
}
|
}
|
||||||
|
|
||||||
// Hide "News" section
|
// Hide "News" section
|
||||||
@ -76,11 +76,11 @@ body[data-theme=dark] {
|
|||||||
--gds-containerSolidAppBackground: #000 !important;
|
--gds-containerSolidAppBackground: #000 !important;
|
||||||
}
|
}
|
||||||
|
|
||||||
div[class*=ProductDetailPage-module__backgroundImageGradient]:after {
|
div[aria-hidden=true][class^=BackgroundImageAbsoluteContainer][class*=ProductDetailPage-module__backgroundImageGradient]:after {
|
||||||
background: radial-gradient(ellipse 100% 100% at 50% 0, #1515178c 0, #1a1b1ea6 32%, #000000 100%) !important;
|
background: radial-gradient(ellipse 100% 100% at 50% 0, #1515178c 0, #1a1b1ea6 32%, #000000 100%) !important;
|
||||||
}
|
}
|
||||||
|
|
||||||
a[class*=AllGamesRow-module__seeAllCloudGames] {
|
a[href="/play/gallery/all-games"][class*=AllGamesRow-module__seeAllCloudGames] {
|
||||||
background: none !important;
|
background: none !important;
|
||||||
}
|
}
|
||||||
`);
|
`);
|
||||||
@ -89,10 +89,10 @@ a[class*=AllGamesRow-module__seeAllCloudGames] {
|
|||||||
// Reduce animations
|
// Reduce animations
|
||||||
if (getGlobalPref(GlobalPref.UI_REDUCE_ANIMATIONS)) {
|
if (getGlobalPref(GlobalPref.UI_REDUCE_ANIMATIONS)) {
|
||||||
css += compressCss(`
|
css += compressCss(`
|
||||||
div[class*=GameCard-module__gameTitleInnerWrapper],
|
/*div[class*=GameCard-module__card],*/
|
||||||
div[class*=GameCard-module__card],
|
div[class^=GameCard-module__gameTitleInnerWrapper],
|
||||||
div[class*=ScrollArrows-module],
|
div[class^=ScrollArrows-module],
|
||||||
div[class*=Dropdown-module__dropdownWrapper] {
|
div[class^=ContextMenu-module__][class*=Dropdown-module__dropdownWrapper] {
|
||||||
animation: none !important;
|
animation: none !important;
|
||||||
transition: none !important;
|
transition: none !important;
|
||||||
}
|
}
|
||||||
@ -102,32 +102,32 @@ div[class*=Dropdown-module__dropdownWrapper] {
|
|||||||
// Hide the top-left dots icon while playing
|
// Hide the top-left dots icon while playing
|
||||||
if (getGlobalPref(GlobalPref.UI_HIDE_SYSTEM_MENU_ICON)) {
|
if (getGlobalPref(GlobalPref.UI_HIDE_SYSTEM_MENU_ICON)) {
|
||||||
css += compressCss(`
|
css += compressCss(`
|
||||||
div[class*=Grip-module__container] {
|
#StreamHud div[class^=Grip-module__container] {
|
||||||
visibility: hidden;
|
visibility: hidden;
|
||||||
}
|
}
|
||||||
|
|
||||||
@media (hover: hover) {
|
@media (hover: hover) {
|
||||||
button[class*=GripHandle-module__container]:hover div[class*=Grip-module__container] {
|
#StreamHud button[class^=GripHandle-module__container]:hover div[class^=Grip-module__container] {
|
||||||
visibility: visible;
|
visibility: visible;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
button[class*=GripHandle-module__container][aria-expanded=true] div[class*=Grip-module__container] {
|
#StreamHud button[class^=GripHandle-module__container][aria-expanded=true] div[class^=Grip-module__container] {
|
||||||
visibility: visible;
|
visibility: visible;
|
||||||
}
|
}
|
||||||
|
|
||||||
button[class*=GripHandle-module__container][aria-expanded=false] {
|
#StreamHud button[class^=GripHandle-module__container][aria-expanded=false] {
|
||||||
background-color: transparent !important;
|
background-color: transparent !important;
|
||||||
}
|
}
|
||||||
|
|
||||||
div[class*=StreamHUD-module__buttonsContainer] {
|
#StreamHud div[class^=StreamHUD-module__buttonsContainer] {
|
||||||
padding: 0px !important;
|
padding: 0px !important;
|
||||||
}
|
}
|
||||||
`);
|
`);
|
||||||
}
|
}
|
||||||
|
|
||||||
css += compressCss(`
|
css += compressCss(`
|
||||||
div[class*=StreamMenu-module__menu] {
|
#game-stream div[class*=StreamMenu-module__menu] {
|
||||||
min-width: 100vw !important;
|
min-width: 100vw !important;
|
||||||
}
|
}
|
||||||
`);
|
`);
|
||||||
@ -135,7 +135,7 @@ div[class*=StreamMenu-module__menu] {
|
|||||||
// Simplify Stream's menu
|
// Simplify Stream's menu
|
||||||
if (getGlobalPref(GlobalPref.UI_SIMPLIFY_STREAM_MENU)) {
|
if (getGlobalPref(GlobalPref.UI_SIMPLIFY_STREAM_MENU)) {
|
||||||
css += compressCss(`
|
css += compressCss(`
|
||||||
div[class*=Menu-module__scrollable] {
|
#game-stream div[class*=Menu-module__scrollable] {
|
||||||
--bxStreamMenuItemSize: 80px;
|
--bxStreamMenuItemSize: 80px;
|
||||||
--streamMenuItemSize: calc(var(--bxStreamMenuItemSize) + 40px) !important;
|
--streamMenuItemSize: calc(var(--bxStreamMenuItemSize) + 40px) !important;
|
||||||
}
|
}
|
||||||
@ -148,18 +148,18 @@ body[data-media-type=tv] .bx-badges {
|
|||||||
top: calc(var(--streamMenuItemSize) - 10px) !important;
|
top: calc(var(--streamMenuItemSize) - 10px) !important;
|
||||||
}
|
}
|
||||||
|
|
||||||
button[class*=MenuItem-module__container] {
|
#game-stream button[class*=MenuItem-module__container] {
|
||||||
min-width: auto !important;
|
min-width: auto !important;
|
||||||
min-height: auto !important;
|
min-height: auto !important;
|
||||||
width: var(--bxStreamMenuItemSize) !important;
|
width: var(--bxStreamMenuItemSize) !important;
|
||||||
height: var(--bxStreamMenuItemSize) !important;
|
height: var(--bxStreamMenuItemSize) !important;
|
||||||
}
|
}
|
||||||
|
|
||||||
div[class*=MenuItem-module__label] {
|
#game-stream div[class*=MenuItem-module__label] {
|
||||||
display: none !important;
|
display: none !important;
|
||||||
}
|
}
|
||||||
|
|
||||||
svg[class*=MenuItem-module__icon] {
|
#game-stream svg[class*=MenuItem-module__icon] {
|
||||||
width: 36px;
|
width: 36px;
|
||||||
height: 100% !important;
|
height: 100% !important;
|
||||||
padding: 0 !important;
|
padding: 0 !important;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user