Skip to content
Open
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
30 changes: 19 additions & 11 deletions packages/react-devtools-shell/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,22 @@
gap: 5px;
position: relative;
overflow: hidden;
--divider-size: 5px;
--top-row-height: 50%;
--left-column-width: 50%;
}

#panes.leftright {
grid-template-rows: 1fr;
grid-template-columns: var(--left-column-width) var(--divider-size) 1fr;
}

#panes.topbottom {
grid-template-rows: var(--top-row-height) var(--divider-size) 1fr;
grid-template-columns: 1fr;
}

#divider {
position: absolute;
z-index: 10000002;
background-color: #ccc;
transition: background-color 0.2s;
Expand All @@ -27,12 +39,12 @@

#divider.horizontal-divider {
width: 100%;
height: 5px;
height: var(--divider-size);
cursor: row-resize;
}

#divider.vertical-divider {
width: 5px;
width: var(--divider-size);
height: 100%;
cursor: col-resize;
}
Expand Down Expand Up @@ -129,12 +141,12 @@
const panes = document.getElementById('panes');
if (layoutType === 'topbottom') {
panes.style.setProperty('--top-row-height', `${splitRatio * 100}%`);
panes.style.gridTemplateRows = "var(--top-row-height) 1fr";
panes.style.gridTemplateColumns = null;
panes.classList.remove('leftright');
panes.classList.add('topbottom');
} else if (layoutType === 'leftright') {
panes.style.setProperty('--left-column-width', `${splitRatio * 100}%`);
panes.style.gridTemplateRows = null;
panes.style.gridTemplateColumns = "var(--left-column-width) 1fr";
panes.classList.remove('topbottom');
panes.classList.add('leftright');
}
}
layout.addEventListener('change', () => {
Expand All @@ -149,13 +161,9 @@
if (layoutType === 'topbottom') {
// For top/bottom layout, divider should be horizontal (spanning across)
divider.className = 'horizontal-divider';
divider.style.top = `calc(${splitRatio * 100}%)`;
divider.style.left = '0';
} else {
// For left/right layout, divider should be vertical (spanning down)
divider.className = 'vertical-divider';
divider.style.left = `calc(${splitRatio * 100}%)`;
divider.style.top = '0';
}
}

Expand Down