mirror of
https://github.com/isledecomp/isle.pizza.git
synced 2026-01-11 10:41:15 +00:00
Disable Window options on iPhone
This commit is contained in:
parent
6a1b545887
commit
6dab86d976
51
index.html
51
index.html
@ -722,7 +722,7 @@
|
|||||||
</select>
|
</select>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="form-group">
|
<div class="form-group" id="window-form">
|
||||||
<label class="form-group-label">Window</label>
|
<label class="form-group-label">Window</label>
|
||||||
<div class="radio-group option-list">
|
<div class="radio-group option-list">
|
||||||
<div class="option-item">
|
<div class="option-item">
|
||||||
@ -1248,31 +1248,36 @@
|
|||||||
history.replaceState({ page: 'main' }, '', window.location.pathname);
|
history.replaceState({ page: 'main' }, '', window.location.pathname);
|
||||||
}
|
}
|
||||||
|
|
||||||
const fullscreenElement = document.getElementById('window-fullscreen');
|
if (document.documentElement.requestFullscreen) {
|
||||||
const windowedElement = document.getElementById('window-windowed');
|
const fullscreenElement = document.getElementById('window-fullscreen');
|
||||||
|
const windowedElement = document.getElementById('window-windowed');
|
||||||
|
|
||||||
fullscreenElement.addEventListener('change', () => {
|
fullscreenElement.addEventListener('change', () => {
|
||||||
if (fullscreenElement.checked) {
|
if (fullscreenElement.checked) {
|
||||||
document.documentElement.requestFullscreen().catch(err => {
|
document.documentElement.requestFullscreen().catch(err => {
|
||||||
console.error(`Error attempting to enable full-screen mode: ${err.message} (${err.name})`);
|
console.error(`Error attempting to enable full-screen mode: ${err.message} (${err.name})`);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
windowedElement.addEventListener('change', () => {
|
windowedElement.addEventListener('change', () => {
|
||||||
if (windowedElement.checked && document.fullscreenElement) {
|
if (windowedElement.checked && document.fullscreenElement) {
|
||||||
document.exitFullscreen();
|
document.exitFullscreen();
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
// Event listener for changes in fullscreen state (e.g., F11 or Esc key)
|
// Event listener for changes in fullscreen state (e.g., F11 or Esc key)
|
||||||
document.addEventListener('fullscreenchange', () => {
|
document.addEventListener('fullscreenchange', () => {
|
||||||
if (document.fullscreenElement) {
|
if (document.fullscreenElement) {
|
||||||
fullscreenElement.checked = true;
|
fullscreenElement.checked = true;
|
||||||
} else {
|
} else {
|
||||||
windowedElement.checked = true;
|
windowedElement.checked = true;
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
document.getElementById('window-form').style.display = 'none';
|
||||||
|
}
|
||||||
});
|
});
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user