mirror of
https://github.com/Vikeo/LifeTrinket.git
synced 2025-11-14 23:17:59 +00:00
try enter fullscreen on start
This commit is contained in:
@@ -103,6 +103,7 @@ const Start = ({
|
||||
if (!initialGameSettings) {
|
||||
return;
|
||||
}
|
||||
document.documentElement.requestFullscreen();
|
||||
setInitialGameSettings(initialGameSettings);
|
||||
setPlayers(createInitialPlayers(initialGameSettings));
|
||||
};
|
||||
@@ -115,14 +116,6 @@ const Start = ({
|
||||
return `${value}`;
|
||||
};
|
||||
|
||||
const toggleFullscreen = () => {
|
||||
if (!document.fullscreenElement) {
|
||||
document.documentElement.requestFullscreen();
|
||||
} else if (document.exitFullscreen) {
|
||||
document.exitFullscreen();
|
||||
}
|
||||
};
|
||||
|
||||
const getDefaultLayout = (numberOfPlayers: number) => {
|
||||
switch (numberOfPlayers) {
|
||||
case 1:
|
||||
@@ -213,18 +206,6 @@ const Start = ({
|
||||
setPlayerOptions({ ...playerOptions, gridAreas })
|
||||
}
|
||||
/>
|
||||
<Button
|
||||
style={{
|
||||
marginTop: '0.5rem',
|
||||
marginRight: 'auto',
|
||||
marginLeft: 'auto',
|
||||
}}
|
||||
size="small"
|
||||
variant="contained"
|
||||
onClick={toggleFullscreen}
|
||||
>
|
||||
Toggle fullscreen
|
||||
</Button>
|
||||
</FormControl>
|
||||
<StartButtonFooter>
|
||||
<Button
|
||||
|
||||
Reference in New Issue
Block a user