From 05db0e128a51ab94e8aad1c107122cb8def49f7d Mon Sep 17 00:00:00 2001 From: ghassan Date: Sat, 16 May 2026 11:16:42 +0300 Subject: [PATCH] Add playlist controls: prev/next, shuffle, loop, autoplay toggle MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Controls bar added to playlist sidebar header with: - Prev/Next skip buttons (disabled when at bounds) - Shuffle toggle (Fisher-Yates order stored in localStorage) - Loop 3-state: off → loop all → loop one - Autoplay toggle (default on, persists per playlist in localStorage) All state is instant — no page reload on toggle. Co-Authored-By: Claude Sonnet 4.6 --- resources/views/videos/show.blade.php | 269 +++++++++++++++++++++++--- 1 file changed, 245 insertions(+), 24 deletions(-) diff --git a/resources/views/videos/show.blade.php b/resources/views/videos/show.blade.php index 9d7ac75..7613500 100644 --- a/resources/views/videos/show.blade.php +++ b/resources/views/videos/show.blade.php @@ -312,6 +312,58 @@ color: var(--text-secondary); } + /* Playlist controls bar */ + .pl-controls-bar { + display: flex; + align-items: center; + gap: 4px; + margin-bottom: 10px; + padding: 6px 8px; + background: var(--bg-secondary); + border-radius: 8px; + border: 1px solid var(--border-color); + } + .pl-ctrl-btn { + display: flex; + align-items: center; + gap: 5px; + background: none; + border: none; + color: var(--text-secondary); + cursor: pointer; + padding: 5px 8px; + border-radius: 6px; + font-size: 15px; + transition: color .15s, background .15s; + white-space: nowrap; + } + .pl-ctrl-btn:hover:not(:disabled) { + color: var(--text-primary); + background: rgba(255,255,255,.07); + } + .pl-ctrl-btn:disabled { + opacity: .35; + cursor: default; + } + .pl-ctrl-btn.pl-ctrl-active { + color: var(--brand-red); + } + .pl-ctrl-divider { + width: 1px; + height: 18px; + background: var(--border-color); + margin: 0 2px; + flex-shrink: 0; + } + .pl-ctrl-autoplay { + margin-left: auto; + font-size: 13px; + } + .pl-autoplay-label { + font-size: 12px; + font-weight: 500; + } + /* Responsive */ @media (max-width: 1300px) { .yt-sidebar-container { @@ -685,14 +737,39 @@
@if ($playlist && $playlistVideos && $playlistVideos->count() > 0) -

+

{{ $playlist->name }} ({{ $playlistVideos->count() }} videos)

-