Skip to content

Commit 21646c5

Browse files
authored
fix: make routing table scrollable on smaller screens (#140)
Previously, the routing table content would get cut off on smaller screens. Now, it becomes scrollable when needed, ensuring all data remains accessible. Improved the `right-bar-toggle-button` hover effect by adding a smooth transition and slight zoom effect for better UX. ![image](https://github.com/user-attachments/assets/d8c93f2c-0198-4099-aec6-20da5c28c53b)
1 parent 491c2fd commit 21646c5

File tree

3 files changed

+20
-2
lines changed

3 files changed

+20
-2
lines changed

src/graphics/right_bar.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -140,6 +140,8 @@ export function createRoutingTable(
140140
deviceId: number,
141141
) {
142142
const container = document.createElement("div");
143+
const tableWrapper = document.createElement("div");
144+
tableWrapper.classList.add("table-wrapper");
143145
const tableClasses = ["right-bar-table", "hidden", "toggle-table"];
144146
const buttonClass = "right-bar-toggle-button";
145147

@@ -150,8 +152,9 @@ export function createRoutingTable(
150152
table.classList.add(...tableClasses);
151153
const button = createToggleButton(title, buttonClass, table);
152154

155+
tableWrapper.appendChild(table);
153156
container.appendChild(button);
154-
container.appendChild(table);
157+
container.appendChild(tableWrapper);
155158
return container;
156159
}
157160

src/styles/right-bar-buttons.css

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,14 +50,22 @@
5050
width: 100%;
5151
box-sizing: border-box;
5252
position: relative; /* Needed for positioning arrow */
53+
transition:
54+
background-color 0.3s ease,
55+
transform 0.2s ease; /* Smooth hover effect */
56+
}
57+
58+
.right-bar-toggle-button:hover {
59+
background-color: #162a6d; /* Darker blue on hover */
60+
transform: scale(1.02); /* Slight zoom effect */
5361
}
5462

5563
/* 🔹 Dropdown arrow styling */
5664
.right-bar-toggle-button::after {
5765
content: ""; /* Adds an empty element for the arrow */
5866
display: inline-block;
5967
position: absolute;
60-
right: 2vw; /* Positions the arrow */
68+
right: 1vw; /* Positions the arrow */
6169
width: 0;
6270
height: 0;
6371
border-left: 0.6rem solid transparent; /* Creates arrow effect */

src/styles/table.css

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,10 @@
1+
.table-wrapper {
2+
width: 100%;
3+
overflow-x: auto;
4+
display: block;
5+
max-width: 100%;
6+
}
7+
18
/* table.css - Table in the sidebar */
29
.right-bar-table {
310
width: 100%; /* Ensures the container takes full width */

0 commit comments

Comments
 (0)