Skip to content

Commit e672c11

Browse files
feat(remote): enhance menu headers with icons, sort main menu and new updates icon
1 parent 1110865 commit e672c11

File tree

4 files changed

+80
-6
lines changed

4 files changed

+80
-6
lines changed

img/main_screenshot.png

268 Bytes
Loading

remote.css

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -76,6 +76,10 @@ body {
7676
box-sizing: border-box;
7777
}
7878

79+
.header-icon {
80+
display: none;
81+
}
82+
7983
.header-title {
8084
flex: 1;
8185
text-align: center;
@@ -85,6 +89,37 @@ body {
8589
text-overflow: ellipsis;
8690
}
8791

92+
.header-title::before {
93+
font-family: FontAwesome, sans-serif;
94+
margin-right: 0.5em;
95+
opacity: 0.9;
96+
}
97+
98+
.header-title.icon-power::before {
99+
content: "\f011";
100+
}
101+
.header-title.icon-edit::before {
102+
content: "\f26c";
103+
}
104+
.header-title.icon-settings::before {
105+
content: "\f0ad";
106+
}
107+
.header-title.icon-classes::before {
108+
content: "\f247";
109+
}
110+
.header-title.icon-update::before {
111+
content: "\f019";
112+
}
113+
.header-title.icon-alert::before {
114+
content: "\f003";
115+
}
116+
.header-title.icon-links::before {
117+
content: "\f0c1";
118+
}
119+
.header-title.icon-add::before {
120+
content: "\f067";
121+
}
122+
88123
.header-spacer {
89124
width: var(--touch-target);
90125
flex-shrink: 0;
@@ -1126,6 +1161,7 @@ pre {
11261161
.module-description {
11271162
font-size: 0.8em;
11281163
-webkit-line-clamp: 3;
1164+
line-clamp: 3;
11291165
}
11301166

11311167
.module-info {

remote.html

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@
7777
<span class="fa fa-fw fa-angle-right" aria-hidden="true"></span>
7878
</div>
7979
<div id="update-button" class="button" role="button" tabindex="0">
80-
<span class="fa fa-fw fa-toggle-up" aria-hidden="true"></span>
80+
<span class="fa fa-fw fa-download" aria-hidden="true"></span>
8181
<span class="text">%%TRANSLATE:UPDATE_MENU_NAME%%</span>
8282
<span class="fa fa-fw fa-angle-right" aria-hidden="true"></span>
8383
</div>
@@ -86,6 +86,11 @@
8686
<span class="text">%%TRANSLATE:ALERT_MENU_NAME%%</span>
8787
<span class="fa fa-fw fa-angle-right" aria-hidden="true"></span>
8888
</div>
89+
<div id="links-button" class="button" role="button" tabindex="0">
90+
<span class="fa fa-fw fa-link" aria-hidden="true"></span>
91+
<span class="text">%%TRANSLATE:LINKS%%</span>
92+
<span class="fa fa-fw fa-angle-right" aria-hidden="true"></span>
93+
</div>
8994
<div
9095
id="mirror-link-button"
9196
class="button"
@@ -95,10 +100,6 @@
95100
<span class="fa fa-fw fa-external-link" aria-hidden="true"></span>
96101
<span class="text">%%TRANSLATE:VIEW_MIRROR%%</span>
97102
</div>
98-
<div id="links-button" class="button" role="button" tabindex="0">
99-
<span class="fa fa-fw fa-link" aria-hidden="true"></span>
100-
<span class="text">%%TRANSLATE:LINKS%%</span>
101-
</div>
102103
</nav>
103104
<!-- Power menu navigation -->
104105
<nav class="menu-nav menu-element hidden power-menu">

remote.js

Lines changed: 38 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -425,11 +425,27 @@ const Remote = {
425425
"add-module-menu": "ADD_MODULE",
426426
"update-menu": "UPDATE_MENU_NAME",
427427
"alert-menu": "ALERT_MENU_NAME",
428-
"links-menu": "LINKS"
428+
"links-menu": "LINKS",
429+
"classes-menu": "CLASSES_MENU_NAME"
429430
};
430431
return menuTitleMap[menuName];
431432
},
432433

434+
getMenuIcon (menuName) {
435+
const menuIconMap = {
436+
"main-menu": null,
437+
"power-menu": "fa-power-off",
438+
"edit-menu": "fa-television",
439+
"settings-menu": "fa-wrench",
440+
"add-module-menu": "fa-plus",
441+
"update-menu": "fa-toggle-up",
442+
"alert-menu": "fa-envelope-o",
443+
"links-menu": "fa-link",
444+
"classes-menu": "fa-object-group"
445+
};
446+
return menuIconMap[menuName];
447+
},
448+
433449
updateHeaderTitle (menuName) {
434450
try {
435451
const headerTitleElement = document.querySelector(".header .header-title");
@@ -451,6 +467,27 @@ const Remote = {
451467
if (titleText) {
452468
headerTitleElement.textContent = titleText;
453469
}
470+
471+
// Update header icon via CSS class
472+
const iconClassMap = {
473+
"power-menu": "icon-power",
474+
"edit-menu": "icon-edit",
475+
"settings-menu": "icon-settings",
476+
"classes-menu": "icon-classes",
477+
"update-menu": "icon-update",
478+
"alert-menu": "icon-alert",
479+
"links-menu": "icon-links",
480+
"add-module-menu": "icon-add"
481+
};
482+
483+
// Remove all icon classes
484+
headerTitleElement.classList.remove("icon-power", "icon-edit", "icon-settings", "icon-classes", "icon-update", "icon-alert", "icon-links", "icon-add");
485+
486+
// Add icon class for current menu
487+
const iconCssClass = iconClassMap[key];
488+
if (iconCssClass) {
489+
headerTitleElement.classList.add(iconCssClass);
490+
}
454491
} catch (error) {
455492
console.warn("Failed to update header title:", error);
456493
}

0 commit comments

Comments
 (0)