Hide mobile viewer chrome on fullscreen tap and restore it on page tap.

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
2026-08-19 18:29:00 +03:30
co-authored by Cursor
parent d25841aa16
commit 06bcba125f
2 changed files with 24 additions and 15 deletions
+11 -10
View File
@@ -107,9 +107,12 @@ function togglePlay() {
} }
} }
function onFab() { function onTapExit() {
hideChrome.value = false; hideChrome.value = false;
if (playing.value) togglePlay(); waiting.value = false;
if (!playing.value) return;
playing.value = false;
stopLoop();
} }
function onKey(ev: KeyboardEvent) { function onKey(ev: KeyboardEvent) {
@@ -132,7 +135,8 @@ function fullscreenElement() {
async function toggleFullscreen() { async function toggleFullscreen() {
if (singlePage.value) { if (singlePage.value) {
hideChrome.value = !hideChrome.value; hideChrome.value = true;
waiting.value = false;
return; return;
} }
const el = stage.value as const el = stage.value as
@@ -227,14 +231,11 @@ watch(
</div> </div>
</div> </div>
<button <div
v-if="immersive" v-if="immersive"
class="fab-pause" class="tap-exit"
type="button" @click.prevent="onTapExit"
@click="onFab" ></div>
>
{{ playing ? "توقف" : "منو" }}
</button>
<div v-if="waiting && playing" class="auto-hint"> <div v-if="waiting && playing" class="auto-hint">
<span>تا لحظه‌ای دیگر خودبه‌خود ورق می‌خورد</span> <span>تا لحظه‌ای دیگر خودبه‌خود ورق می‌خورد</span>
+13 -5
View File
@@ -410,15 +410,23 @@ a {
.stage-page.immersive > .page-chrome, .stage-page.immersive > .page-chrome,
.viewer-wrap.immersive > .page-chrome, .viewer-wrap.immersive > .page-chrome,
.viewer-wrap.immersive .thumbs, .viewer-wrap.immersive .thumbs,
.viewer-wrap.immersive .auto-hint { .viewer-wrap.immersive .auto-hint,
display: none; .viewer-wrap.immersive .fab-pause {
display: none !important;
} }
.stage-page.immersive .viewer-wrap { .stage-page.immersive .viewer-wrap {
padding: 0; padding: 0 !important;
border-radius: 0; border-radius: 0;
} }
.tap-exit {
position: absolute;
inset: 0;
z-index: 15;
touch-action: manipulation;
}
@media (max-width: 900px) { @media (max-width: 900px) {
.stage-bar { .stage-bar {
gap: 8px; gap: 8px;
@@ -442,7 +450,7 @@ a {
display: inline; display: inline;
} }
.viewer-wrap.cinematic > .stage-bar { .viewer-wrap.cinematic:not(.immersive) > .stage-bar {
display: flex; display: flex;
flex-wrap: wrap; flex-wrap: wrap;
justify-content: space-between; justify-content: space-between;
@@ -459,7 +467,7 @@ a {
margin-inline-start: 0; margin-inline-start: 0;
} }
.viewer-wrap { .viewer-wrap:not(.immersive) {
padding: 10px 8px 16px; padding: 10px 8px 16px;
} }
} }