Move bx-events/exposed/flags files to utils/

This commit is contained in:
redphx
2024-04-25 17:57:34 +07:00
parent 51102a7687
commit 293e3c8d73
16 changed files with 19 additions and 19 deletions

26
src/utils/bx-exposed.ts Normal file
View File

@@ -0,0 +1,26 @@
import { STATES } from "./global";
export const BxExposed = {
onPollingModeChanged: (mode: 'All' | 'None') => {
if (!STATES.isPlaying) {
return false;
}
const $screenshotBtn = document.querySelector('.bx-screenshot-button');
const $touchControllerBar = document.getElementById('bx-touch-controller-bar');
if (mode !== 'None') {
// Hide screenshot button
$screenshotBtn && $screenshotBtn.classList.add('bx-gone');
// Hide touch controller bar
$touchControllerBar && $touchControllerBar.classList.add('bx-gone');
} else {
// Show screenshot button
$screenshotBtn && $screenshotBtn.classList.remove('bx-gone');
// Show touch controller bar
$touchControllerBar && $touchControllerBar.classList.remove('bx-gone');
}
},
};