mirror of
https://github.com/redphx/better-xcloud.git
synced 2025-06-06 07:37:19 +02:00
Fix duplicated CSS strings
This commit is contained in:
parent
506fd71433
commit
9609d0ae7b
@ -67,8 +67,10 @@ if (BX_FLAGS.SafariWorkaround && document.readyState !== 'loading') {
|
||||
// Stop loading
|
||||
window.stop();
|
||||
|
||||
// Show the reloading overlay
|
||||
const css = compressCss(`
|
||||
// We need to set it to an empty string first to work around Bun's bug
|
||||
// https://github.com/oven-sh/bun/issues/12067
|
||||
let css = '';
|
||||
css += compressCss(`
|
||||
.bx-reload-overlay {
|
||||
position: fixed;
|
||||
top: 0;
|
||||
@ -115,6 +117,7 @@ if (BX_FLAGS.SafariWorkaround && document.readyState !== 'loading') {
|
||||
}, '🤓 ' + t('how-to-fix'));
|
||||
}
|
||||
|
||||
// Show the reloading overlay
|
||||
const $fragment = document.createDocumentFragment();
|
||||
$fragment.appendChild(CE('style', {}, css));
|
||||
$fragment.appendChild(CE('div',{
|
||||
|
@ -44,7 +44,7 @@ export class LoadingScreen {
|
||||
static #hideRocket() {
|
||||
let $bgStyle = LoadingScreen.#$bgStyle;
|
||||
|
||||
const css = compressCss(`
|
||||
$bgStyle.textContent! += compressCss(`
|
||||
#game-stream div[class*=RocketAnimation-module__container] > svg {
|
||||
display: none;
|
||||
}
|
||||
@ -53,7 +53,6 @@ export class LoadingScreen {
|
||||
display: none;
|
||||
}
|
||||
`);
|
||||
$bgStyle.textContent! += css;
|
||||
}
|
||||
|
||||
static #setBackground(imageUrl: string) {
|
||||
@ -63,7 +62,7 @@ export class LoadingScreen {
|
||||
// Limit max width to reduce image size
|
||||
imageUrl = imageUrl + '?w=1920';
|
||||
|
||||
const css = compressCss(`
|
||||
$bgStyle.textContent! += compressCss(`
|
||||
#game-stream {
|
||||
background-color: transparent !important;
|
||||
background-position: center center !important;
|
||||
@ -75,7 +74,6 @@ export class LoadingScreen {
|
||||
transition: opacity 0.3s ease-in-out !important;
|
||||
}
|
||||
`) + `#game-stream {background-image: linear-gradient(#00000033, #000000e6), url(${imageUrl}) !important;}`;
|
||||
$bgStyle.textContent! += css;
|
||||
|
||||
const bg = new Image();
|
||||
bg.onload = e => {
|
||||
|
Loading…
x
Reference in New Issue
Block a user