Rename UI to LED Editor and improve mobile editor layout
Use "LED Editor" in page titles and the home heading. On narrow viewports, make the file tree an off-canvas drawer with backdrop, hamburger toggle, Escape to close, and auto-close after opening a file. Add safe-area and tap-target tweaks, cache-bust static assets. Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -9,12 +9,45 @@ body {
|
||||
background-color: #f5f5f5;
|
||||
height: 100dvh;
|
||||
overflow: hidden;
|
||||
-webkit-text-size-adjust: 100%;
|
||||
overscroll-behavior: none;
|
||||
}
|
||||
|
||||
button,
|
||||
.tab,
|
||||
.file-item,
|
||||
.mode-btn {
|
||||
touch-action: manipulation;
|
||||
}
|
||||
|
||||
.container {
|
||||
display: flex;
|
||||
height: 100dvh;
|
||||
overflow: hidden;
|
||||
position: relative;
|
||||
}
|
||||
|
||||
.sidebar-toggle {
|
||||
display: none;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
width: 40px;
|
||||
height: 40px;
|
||||
border: 1px solid #cbd5e0;
|
||||
background: white;
|
||||
color: #2d3748;
|
||||
border-radius: 8px;
|
||||
font-size: 1.2rem;
|
||||
cursor: pointer;
|
||||
flex-shrink: 0;
|
||||
}
|
||||
|
||||
.sidebar-toggle:hover {
|
||||
background: #f7fafc;
|
||||
}
|
||||
|
||||
.sidebar-backdrop {
|
||||
display: none;
|
||||
}
|
||||
|
||||
/* Sidebar */
|
||||
@@ -543,86 +576,155 @@ body {
|
||||
|
||||
/* Responsive design */
|
||||
@media (max-width: 768px) {
|
||||
body {
|
||||
height: 100dvh;
|
||||
overflow: hidden;
|
||||
}
|
||||
|
||||
.container {
|
||||
flex-direction: column;
|
||||
height: 100dvh;
|
||||
overflow: hidden;
|
||||
}
|
||||
|
||||
/* Sidebar becomes an off-canvas drawer. */
|
||||
.sidebar {
|
||||
width: 100%;
|
||||
max-height: 30vh;
|
||||
min-height: 170px;
|
||||
position: fixed;
|
||||
top: 0;
|
||||
left: 0;
|
||||
bottom: 0;
|
||||
width: min(82vw, 320px);
|
||||
height: 100dvh;
|
||||
transform: translateX(-100%);
|
||||
transition: transform 0.2s ease;
|
||||
z-index: 50;
|
||||
box-shadow: 2px 0 16px rgba(0, 0, 0, 0.25);
|
||||
padding-top: env(safe-area-inset-top);
|
||||
padding-bottom: env(safe-area-inset-bottom);
|
||||
}
|
||||
|
||||
.sidebar-header {
|
||||
padding: 0.7rem 0.8rem;
|
||||
.sidebar.is-open {
|
||||
transform: translateX(0);
|
||||
}
|
||||
|
||||
.file-tree {
|
||||
min-height: 100px;
|
||||
.sidebar-backdrop {
|
||||
display: block;
|
||||
position: fixed;
|
||||
inset: 0;
|
||||
background: rgba(0, 0, 0, 0.45);
|
||||
z-index: 40;
|
||||
opacity: 0;
|
||||
pointer-events: none;
|
||||
transition: opacity 0.2s ease;
|
||||
}
|
||||
|
||||
.sidebar-backdrop.is-open {
|
||||
opacity: 1;
|
||||
pointer-events: auto;
|
||||
}
|
||||
|
||||
.sidebar-backdrop[hidden] {
|
||||
/* Even when the JS hasn't toggled it yet, hide on desktop only. Mobile keeps it
|
||||
in the layer for transitions; explicit [hidden] still wins via display:none below. */
|
||||
display: none;
|
||||
}
|
||||
|
||||
.sidebar-toggle {
|
||||
display: inline-flex;
|
||||
}
|
||||
|
||||
.sidebar-actions button {
|
||||
min-width: 40px;
|
||||
min-height: 40px;
|
||||
font-size: 1.15rem;
|
||||
}
|
||||
|
||||
.main-content {
|
||||
width: 100%;
|
||||
min-height: 0;
|
||||
}
|
||||
|
||||
.editor-header {
|
||||
padding: 0.65rem;
|
||||
padding: 0.55rem 0.65rem;
|
||||
flex-wrap: wrap;
|
||||
gap: 0.55rem;
|
||||
align-items: stretch;
|
||||
gap: 0.45rem;
|
||||
align-items: center;
|
||||
padding-top: max(0.55rem, env(safe-area-inset-top));
|
||||
}
|
||||
|
||||
.file-info {
|
||||
width: 100%;
|
||||
justify-content: space-between;
|
||||
flex: 1 1 auto;
|
||||
min-width: 0;
|
||||
gap: 0.5rem;
|
||||
flex-wrap: wrap;
|
||||
}
|
||||
|
||||
.file-info .runtime-hint {
|
||||
font-size: 0.7rem;
|
||||
padding: 0.15rem 0.4rem;
|
||||
}
|
||||
|
||||
.mode-toggle {
|
||||
order: 3;
|
||||
}
|
||||
|
||||
.mode-btn {
|
||||
min-height: 36px;
|
||||
padding: 0.5rem 0.85rem;
|
||||
}
|
||||
|
||||
.editor-actions {
|
||||
width: 100%;
|
||||
order: 4;
|
||||
flex-wrap: wrap;
|
||||
gap: 0.4rem;
|
||||
}
|
||||
|
||||
.editor-actions button {
|
||||
flex: 1 1 100px;
|
||||
flex: 1 1 110px;
|
||||
min-height: 40px;
|
||||
font-size: 0.95rem;
|
||||
}
|
||||
|
||||
.run-main-toggle {
|
||||
width: 100%;
|
||||
justify-content: flex-start;
|
||||
flex: 1 1 100%;
|
||||
flex: 1 1 calc(50% - 0.4rem);
|
||||
min-height: 40px;
|
||||
font-size: 0.85rem;
|
||||
}
|
||||
|
||||
.tabs {
|
||||
padding: 0.3rem 0.35rem;
|
||||
gap: 0.3rem;
|
||||
-webkit-overflow-scrolling: touch;
|
||||
}
|
||||
|
||||
.tab {
|
||||
padding: 0.45rem 0.55rem;
|
||||
}
|
||||
|
||||
.tab-title {
|
||||
max-width: 150px;
|
||||
max-width: 140px;
|
||||
}
|
||||
|
||||
.tab-close {
|
||||
font-size: 18px;
|
||||
padding: 0 0.25rem;
|
||||
}
|
||||
|
||||
.editor-container {
|
||||
min-height: 46vh;
|
||||
min-height: 42vh;
|
||||
}
|
||||
|
||||
.cm-editor {
|
||||
font-size: 13px;
|
||||
font-size: 14px; /* >=16px would prevent iOS zoom but feels too large here; CM is contenteditable so no zoom anyway. */
|
||||
}
|
||||
|
||||
|
||||
.modal-content {
|
||||
width: 90%;
|
||||
margin: 20% auto;
|
||||
width: min(92vw, 420px);
|
||||
margin: 18vh auto;
|
||||
padding: 1.25rem;
|
||||
}
|
||||
|
||||
.modal-content input {
|
||||
font-size: 16px; /* prevent iOS focus zoom */
|
||||
}
|
||||
|
||||
.modal-actions button {
|
||||
min-height: 40px;
|
||||
flex: 1 1 100px;
|
||||
}
|
||||
|
||||
.led-grid {
|
||||
@@ -640,8 +742,24 @@ body {
|
||||
flex-wrap: wrap;
|
||||
}
|
||||
|
||||
.led-sim-actions button {
|
||||
flex: 1 1 80px;
|
||||
min-height: 36px;
|
||||
}
|
||||
|
||||
.console-container {
|
||||
height: 180px;
|
||||
height: 160px;
|
||||
}
|
||||
|
||||
.file-item {
|
||||
padding: 0.65rem 0.5rem;
|
||||
}
|
||||
}
|
||||
|
||||
/* Hide drawer affordances entirely on desktop, even with [hidden] flipped off. */
|
||||
@media (min-width: 769px) {
|
||||
.sidebar-backdrop {
|
||||
display: none !important;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user