Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion index.html
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ <h1 class="brand-title">Ruh Al Tarikh</h1>
<i class="fas fa-bookmark" aria-hidden="true"></i>
<span class="badge" id="watchLaterBadge">0</span>
</button>
<button id="dashboardBtn" class="action-btn" aria-label="View Dashboard" title="View Dashboard">
<button id="dashboardBtn" class="action-btn" aria-label="View Dashboard" title="View Dashboard (D)">
<i class="fas fa-chart-line" aria-hidden="true"></i>
</button>
<a href="https://www.youtube.com/@Ruh-Al-Tarikh" target="_blank" rel="noopener noreferrer" class="action-btn" aria-label="Visit YouTube Channel" title="Visit YouTube Channel">
Expand Down
22 changes: 17 additions & 5 deletions js/app.js
Original file line number Diff line number Diff line change
Expand Up @@ -436,18 +436,18 @@ function renderCard(video, index = 0) {
tabindex="0"
aria-label="Watch ${Utils.sanitize(t.title)}">
<div class="card-thumb-wrapper">
<img data-src="${o}"
src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAQAAAC1HAwCAAAAC0lEQVR42mNkYAAAAAYAAjCB0C8AAAAASUVORK5CYII="
<img data-src="${o}"
src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAQAAAC1HAwCAAAAC0lEQVR42mNkYAAAAAYAAjCB0C8AAAAASUVORK5CYII="
alt=""
class="lazy-img"
class="lazy-img"
loading="lazy">
<div class="card-thumb-overlay">
<i class="fa-solid fa-play play-icon" aria-hidden="true"></i>
</div>
<div class="duration-badge">HD</div>
${s?`<div class="progress-bar-container"><div class="progress-bar-fill" style="width:${s.percent}%"></div></div>`:""}
<button class="watch-later-btn ${a?"active":""}"
data-id="${t.id}"
<button class="watch-later-btn ${a?"active":""}"
data-id="${t.id}"
aria-label="${a?"Remove from Watch Later":"Save for later"}"
title="${a?"Remove from Watch Later":"Save for later"}">
<i class="fa-${a?"solid":"regular"} fa-bookmark"></i>
Expand Down Expand Up @@ -1329,11 +1329,13 @@ function bindEvents() {

// Theme toggle
if (key === 't') {
e.preventDefault();
toggleTheme();
}

// Watch Later toggle
if (key === 'b') {
e.preventDefault();
if (AppState.current) {
toggleWatchLater(AppState.current);
} else if (DOM.watchLaterPage) {
Expand All @@ -1344,6 +1346,16 @@ function bindEvents() {
}
}
}

// Dashboard toggle
if (key === 'd' && DOM.dashboardModal) {
e.preventDefault();
if (DOM.dashboardModal.style.display === 'block') {
closeDashboard();
} else {
openDashboard();

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Do not open dashboard over an active panel

When another overlay is already open, this global shortcut still calls openDashboard() instead of closing or ignoring the existing panel. For example, open Watch Later, press D, then press D again: closeDashboard() clears body.modal-open/overflow and restores lastFocused even though Watch Later is still visible, leaving the background scrollable and focus state inconsistent. Please guard against other active panels/modals or close them before opening the dashboard.

Useful? React with πŸ‘Β / πŸ‘Ž.

}
}
});

// Mouse move effect for cards
Expand Down
Loading
Loading