From: Rito Rhymes via ffmpeg-devel <ffmpeg-devel@ffmpeg.org>
To: ffmpeg-devel@ffmpeg.org
Cc: rito@ritovision.com
Subject: [FFmpeg-devel] [PATCH] prevent sidebar from causing horizontal page scroll on mobile
Date: Fri, 6 Feb 2026 07:26:01 -0500
Message-ID: <20260206122811.88856-1-rito@ritovision.com> (raw)
When the sidebar is opened on mobile devices, it currently pushes the page content to the right, expanding the entire page width and causing horizontal scroll.
Horizontal page scrolling on mobile can be disorienting for users, impede a11y and lead to unpredictable browser behaviors.
This patch modifies the sidebar behavior on mobile to position it over / occluding the left side of the page, instead of pushing the content aside.
Additionally, because the sidebar now directly occludes page content and the hamburger icon:
- an additional overlay element covers the content to enforce separation and focus
- a close button is added to the sidebar (on mobile only) for clear dismissal
Tapping the overlay or the close button will close the sidebar and remove the overlay.
---
| 56 ++++++++++++++++++++++++++++++-----
| 12 +++++++-
src/template_head2 | 3 ++
3 files changed, 63 insertions(+), 8 deletions(-)
--git a/htdocs/css/simple-sidebar.css b/htdocs/css/simple-sidebar.css
index 71a8a39..d0d6306 100644
--- a/htdocs/css/simple-sidebar.css
+++ b/htdocs/css/simple-sidebar.css
@@ -89,6 +89,15 @@
padding: 20px;
}
+/* Overlay and close button - hidden on desktop */
+.sidebar-overlay {
+ display: none;
+}
+
+.sidebar-close {
+ display: none;
+}
+
@media (max-width:767px) {
#wrapper {
@@ -97,17 +106,50 @@
#sidebar-wrapper {
left: 0;
+ margin-left: 0;
+ height: 100vh;
+ transform: translateX(-200px);
+ transition: transform 0.3s ease;
+ z-index: 1001;
}
-#wrapper.active {
- position: relative;
- left: 200px;
+#wrapper.active #sidebar-wrapper {
+ transform: translateX(0);
}
-#wrapper.active #sidebar-wrapper {
- left: 200px;
- width: 200px;
- transition: all 0.4s ease 0s;
+.sidebar-close {
+ display: block;
+ position: absolute;
+ top: 0;
+ right: 0;
+ color: #999;
+ font-size: 24px;
+ text-decoration: none;
+ z-index: 1001;
+ line-height: 1;
+ padding: 20px;
+}
+
+.sidebar-close:hover,
+.sidebar-close:active,
+.sidebar-close:focus {
+ color: #fff;
+ text-decoration: none;
+}
+
+.sidebar-overlay {
+ display: none;
+ position: fixed;
+ top: 0;
+ left: 0;
+ width: 100%;
+ height: 100vh;
+ background: rgba(0, 0, 0, 0.5);
+ z-index: 999;
+}
+
+#wrapper.active .sidebar-overlay {
+ display: block;
}
#menu-toggle {
--git a/src/template_footer2 b/src/template_footer2
index 735d540..958b963 100644
--- a/src/template_footer2
+++ b/src/template_footer2
@@ -1,8 +1,18 @@
<!-- Custom JavaScript for the Menu Toggle -->
<script>
+ function openSidebar() {
+ $("#wrapper").addClass("active");
+ }
+ function closeSidebar() {
+ $("#wrapper").removeClass("active");
+ }
$("#menu-toggle").click(function(e) {
e.preventDefault();
- $("#wrapper").toggleClass("active");
+ openSidebar();
+ });
+ $(".sidebar-close, .sidebar-overlay").click(function(e) {
+ e.preventDefault();
+ closeSidebar();
});
</script>
diff --git a/src/template_head2 b/src/template_head2
index 4f61b62..8277e3f 100644
--- a/src/template_head2
+++ b/src/template_head2
@@ -12,6 +12,7 @@
<div id="wrapper">
<nav id="sidebar-wrapper">
+ <a class="sidebar-close" href="#">×</a>
<ul class="sidebar-nav">
<li class="sidebar-brand"><a href=".">
<img src="img/ffmpeg3d_white_20.png" alt="FFmpeg" />
@@ -54,6 +55,8 @@
</ul>
</nav>
+ <div class="sidebar-overlay"></div>
+
<div id="page-content-wrapper">
<header class="content-header">
<h1>
--
2.51.0
_______________________________________________
ffmpeg-devel mailing list -- ffmpeg-devel@ffmpeg.org
To unsubscribe send an email to ffmpeg-devel-leave@ffmpeg.org
next reply other threads:[~2026-02-06 12:29 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-02-06 12:26 Rito Rhymes via ffmpeg-devel [this message]
2026-02-09 11:59 ` [FFmpeg-devel] " Michael Niedermayer via ffmpeg-devel
2026-02-09 13:03 ` Matthew Pellerito via ffmpeg-devel
2026-02-17 20:46 ` Rito Rhymes via ffmpeg-devel
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20260206122811.88856-1-rito@ritovision.com \
--to=ffmpeg-devel@ffmpeg.org \
--cc=rito@ritovision.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Git Inbox Mirror of the ffmpeg-devel mailing list - see https://ffmpeg.org/mailman/listinfo/ffmpeg-devel
This inbox may be cloned and mirrored by anyone:
git clone --mirror https://master.gitmailbox.com/ffmpegdev/0 ffmpegdev/git/0.git
# If you have public-inbox 1.1+ installed, you may
# initialize and index your mirror using the following commands:
public-inbox-init -V2 ffmpegdev ffmpegdev/ https://master.gitmailbox.com/ffmpegdev \
ffmpegdev@gitmailbox.com
public-inbox-index ffmpegdev
Example config snippet for mirrors.
AGPL code for this site: git clone https://public-inbox.org/public-inbox.git