Merge branch 'feature/mobile-version'
Merge android version
This commit is contained in:
@@ -1,24 +1,54 @@
|
||||
/* ChoiceSelect.css */
|
||||
/* ------ root ------ */
|
||||
|
||||
.choice-select {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
min-width: 0;
|
||||
min-height: 0;
|
||||
flex: 1 1 auto;
|
||||
|
||||
position: relative;
|
||||
display: flex;
|
||||
|
||||
container-type: size;
|
||||
height: var(--card-control-height);
|
||||
align-items: stretch;
|
||||
|
||||
color: var(--accent-brand);
|
||||
box-sizing: border-box;
|
||||
border: var(--border-width) solid var(--border-hairline);
|
||||
border-radius: var(--radius-sm);
|
||||
background: transparent;
|
||||
}
|
||||
|
||||
.choice-select[data-disabled] {
|
||||
opacity: 0.5;
|
||||
}
|
||||
|
||||
/* ------ label ------ */
|
||||
|
||||
.choice-select__label {
|
||||
flex: 1 1 auto;
|
||||
min-width: 0;
|
||||
width: 100%;
|
||||
|
||||
font-family: var(--font-mono);
|
||||
font-size: var(--font--sm);
|
||||
font-weight: var(--font-weight-normal);
|
||||
text-align: left;
|
||||
|
||||
background: transparent;
|
||||
border: none;
|
||||
|
||||
white-space: nowrap;
|
||||
overflow: hidden;
|
||||
text-overflow: ellipsis;
|
||||
}
|
||||
|
||||
/* ------ trigger ------ */
|
||||
|
||||
.choice-select__trigger {
|
||||
/* Keep the existing outer dimensions and border */
|
||||
flex: 1 1 auto;
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
min-width: 0;
|
||||
min-height: 0;
|
||||
|
||||
display: flex;
|
||||
align-items: center;
|
||||
@@ -28,6 +58,7 @@
|
||||
padding-left: 5%;
|
||||
padding-right: 1%;
|
||||
|
||||
box-sizing: border-box;
|
||||
background: transparent;
|
||||
border: var(--border-width) solid var(--border-hairline);
|
||||
border-radius: var(--radius-sm);
|
||||
@@ -49,16 +80,6 @@
|
||||
cursor: not-allowed;
|
||||
}
|
||||
|
||||
.choice-select__label {
|
||||
flex: 1 1 auto;
|
||||
min-width: 0;
|
||||
|
||||
text-align: left;
|
||||
overflow: hidden;
|
||||
text-overflow: ellipsis;
|
||||
white-space: nowrap;
|
||||
}
|
||||
|
||||
.choice-select__chevron {
|
||||
flex: 0 0 auto;
|
||||
align-self: stretch;
|
||||
@@ -81,29 +102,11 @@
|
||||
.choice-select__chevron svg {
|
||||
display: block;
|
||||
width: auto;
|
||||
height: 100%;
|
||||
height: 85%;
|
||||
max-width: none;
|
||||
}
|
||||
|
||||
.choice-select__option {
|
||||
padding: 1%;
|
||||
border-radius: var(--radius-sm);
|
||||
font-size: 100%;
|
||||
color: var(--text-primary);
|
||||
cursor: pointer;
|
||||
white-space: nowrap;
|
||||
overflow: hidden;
|
||||
text-overflow: ellipsis;
|
||||
}
|
||||
|
||||
.choice-select__option--highlight {
|
||||
background: var(--bg-raised);
|
||||
}
|
||||
|
||||
.choice-select__option--selected {
|
||||
color: var(--accent-brand);
|
||||
font-weight: var(--font-weight-semibold);
|
||||
}
|
||||
/* ------ listbox ------ */
|
||||
|
||||
.choice-select__listbox {
|
||||
position: absolute;
|
||||
@@ -133,5 +136,27 @@
|
||||
|
||||
.choice-select__listbox--portal {
|
||||
position: fixed;
|
||||
z-index: 1000; /* clear of any local stacking contexts in the panel */
|
||||
z-index: 1000;
|
||||
}
|
||||
|
||||
/* ------ listbox options ------ */
|
||||
|
||||
.choice-select__option {
|
||||
padding: 1%;
|
||||
border-radius: var(--radius-sm);
|
||||
font-size: 100%;
|
||||
color: var(--text-primary);
|
||||
cursor: pointer;
|
||||
white-space: nowrap;
|
||||
overflow: hidden;
|
||||
text-overflow: ellipsis;
|
||||
}
|
||||
|
||||
.choice-select__option--highlight {
|
||||
background: var(--bg-raised);
|
||||
}
|
||||
|
||||
.choice-select__option--selected {
|
||||
color: var(--accent-brand);
|
||||
font-weight: var(--font-weight-semibold);
|
||||
}
|
||||
|
||||
+139
-160
@@ -5,6 +5,7 @@
|
||||
top: var(--topbar-h);
|
||||
left: 0;
|
||||
bottom: 0;
|
||||
z-index: 30;
|
||||
|
||||
width: var(--sidebar-width-collapsed);
|
||||
|
||||
@@ -14,9 +15,7 @@
|
||||
background: var(--bg-void);
|
||||
border-right: var(--border-width) solid var(--border-hairline);
|
||||
|
||||
z-index: 30;
|
||||
overflow: visible;
|
||||
|
||||
transition: width var(--dur-base) var(--ease-standard);
|
||||
|
||||
user-select: none;
|
||||
@@ -53,15 +52,14 @@
|
||||
|
||||
aspect-ratio: 1;
|
||||
height: calc(var(--header-height) * 0.7);
|
||||
padding: 0;
|
||||
|
||||
border: var(--border-width-active) solid transparent;
|
||||
border-radius: var(--radius-pill);
|
||||
|
||||
background: var(--bg-void);
|
||||
color: var(--text-muted);
|
||||
|
||||
cursor: pointer;
|
||||
padding: 0;
|
||||
|
||||
transition:
|
||||
background var(--dur-base) var(--ease-standard),
|
||||
@@ -85,6 +83,8 @@
|
||||
transform: rotate(180deg);
|
||||
}
|
||||
|
||||
/* ---------- App combobox ---------- */
|
||||
|
||||
.sidebar-app-combobox {
|
||||
position: relative;
|
||||
flex: 1 1 auto;
|
||||
@@ -106,13 +106,9 @@
|
||||
transition-delay: var(--dur-fast);
|
||||
}
|
||||
|
||||
.sidebar-app-trigger {
|
||||
.sidebar-app-trigger,
|
||||
.sidebar-app-input {
|
||||
width: 100%;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: space-between;
|
||||
gap: var(--space-2);
|
||||
|
||||
height: calc(var(--header-height) * 0.6);
|
||||
padding: 0 var(--space-2);
|
||||
|
||||
@@ -124,6 +120,13 @@
|
||||
font-family: var(--font-ui);
|
||||
font-size: var(--font-xs);
|
||||
font-weight: var(--font-weight-semibold);
|
||||
}
|
||||
|
||||
.sidebar-app-trigger {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: space-between;
|
||||
gap: var(--space-2);
|
||||
|
||||
cursor: pointer;
|
||||
transition: border-color var(--dur-base) var(--ease-standard);
|
||||
@@ -134,6 +137,11 @@
|
||||
border-color: var(--accent-brand);
|
||||
}
|
||||
|
||||
.sidebar-app-input {
|
||||
border-color: var(--accent-brand);
|
||||
outline: none;
|
||||
}
|
||||
|
||||
.sidebar-app-trigger-label {
|
||||
overflow: hidden;
|
||||
text-overflow: ellipsis;
|
||||
@@ -150,23 +158,6 @@
|
||||
transform: rotate(180deg);
|
||||
}
|
||||
|
||||
.sidebar-app-input {
|
||||
width: 100%;
|
||||
height: calc(var(--header-height) * 0.6);
|
||||
padding: 0 var(--space-2);
|
||||
|
||||
background: var(--bg-panel);
|
||||
border: var(--border-width) solid var(--accent-brand);
|
||||
border-radius: var(--radius-sm);
|
||||
|
||||
color: var(--text-primary);
|
||||
font-family: var(--font-ui);
|
||||
font-size: var(--font-xs);
|
||||
font-weight: var(--font-weight-semibold);
|
||||
|
||||
outline: none;
|
||||
}
|
||||
|
||||
.sidebar-app-listbox {
|
||||
position: absolute;
|
||||
top: calc(100% + var(--space-1));
|
||||
@@ -206,17 +197,14 @@
|
||||
color: var(--accent-brand);
|
||||
font-weight: var(--font-weight-semibold);
|
||||
}
|
||||
.sidebar-rail--expanded .sidebar-app-select {
|
||||
opacity: 1;
|
||||
max-width: 200px;
|
||||
padding-inline: var(--space-2);
|
||||
pointer-events: auto;
|
||||
transition-delay: var(--dur-fast);
|
||||
}
|
||||
|
||||
/* ---------- Scroll ---------- */
|
||||
|
||||
.sidebar-scroll {
|
||||
/* Fade sizes are toggled by data-fade-top / data-fade-bottom */
|
||||
--fade-top: 0px;
|
||||
--fade-bottom: 0px;
|
||||
|
||||
flex: 1 1 auto;
|
||||
min-height: 0;
|
||||
|
||||
@@ -228,8 +216,28 @@
|
||||
padding-block: var(--space-1) var(--space-3);
|
||||
overflow-y: auto;
|
||||
|
||||
-webkit-mask-image: linear-gradient(to bottom, transparent, black 0);
|
||||
mask-image: linear-gradient(to bottom, transparent, black 0);
|
||||
-webkit-mask-image: linear-gradient(
|
||||
to bottom,
|
||||
transparent,
|
||||
black var(--fade-top),
|
||||
black calc(100% - var(--fade-bottom)),
|
||||
transparent
|
||||
);
|
||||
mask-image: linear-gradient(
|
||||
to bottom,
|
||||
transparent,
|
||||
black var(--fade-top),
|
||||
black calc(100% - var(--fade-bottom)),
|
||||
transparent
|
||||
);
|
||||
}
|
||||
|
||||
.sidebar-scroll[data-fade-top='true'] {
|
||||
--fade-top: 24px;
|
||||
}
|
||||
|
||||
.sidebar-scroll[data-fade-bottom='true'] {
|
||||
--fade-bottom: 24px;
|
||||
}
|
||||
|
||||
.sidebar-rail--expanded .sidebar-scroll {
|
||||
@@ -237,54 +245,26 @@
|
||||
padding-inline: var(--space-2);
|
||||
}
|
||||
|
||||
.sidebar-scroll[data-fade-top='true'] {
|
||||
-webkit-mask-image: linear-gradient(
|
||||
to bottom,
|
||||
transparent,
|
||||
black 24px,
|
||||
black calc(100% - 24px),
|
||||
black
|
||||
);
|
||||
mask-image: linear-gradient(to bottom, transparent, black 24px, black calc(100% - 24px), black);
|
||||
}
|
||||
.sidebar-scroll[data-fade-bottom='true'] {
|
||||
-webkit-mask-image: linear-gradient(to bottom, black, black calc(100% - 24px), transparent);
|
||||
mask-image: linear-gradient(to bottom, black, black calc(100% - 24px), transparent);
|
||||
}
|
||||
.sidebar-scroll[data-fade-top='true'][data-fade-bottom='true'] {
|
||||
-webkit-mask-image: linear-gradient(
|
||||
to bottom,
|
||||
transparent,
|
||||
black 24px,
|
||||
black calc(100% - 24px),
|
||||
transparent
|
||||
);
|
||||
mask-image: linear-gradient(
|
||||
to bottom,
|
||||
transparent,
|
||||
black 24px,
|
||||
black calc(100% - 24px),
|
||||
transparent
|
||||
);
|
||||
}
|
||||
|
||||
/* ---------- Item ---------- */
|
||||
|
||||
.sidebar-item {
|
||||
.sidebar-item,
|
||||
.sidebar-item--editing {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
flex: 0 0 auto; /* never shrink: let the list scroll instead */
|
||||
gap: var(--sidebar-item-gap);
|
||||
|
||||
aspect-ratio: 1;
|
||||
height: calc(var(--header-height) * 0.7);
|
||||
}
|
||||
|
||||
.sidebar-item {
|
||||
border: var(--border-width-active) solid transparent;
|
||||
border-radius: var(--radius-lg);
|
||||
|
||||
background: transparent;
|
||||
color: var(--text-muted);
|
||||
|
||||
cursor: pointer;
|
||||
|
||||
transition:
|
||||
@@ -296,7 +276,7 @@
|
||||
.sidebar-item:hover {
|
||||
background: var(--bg-raised);
|
||||
color: var(--text-primary);
|
||||
border: var(--border-width-active) solid var(--accent-brand);
|
||||
border-color: var(--accent-brand);
|
||||
}
|
||||
|
||||
.sidebar-item--active {
|
||||
@@ -310,6 +290,47 @@
|
||||
padding-inline: var(--space-2);
|
||||
}
|
||||
|
||||
/* Editing state */
|
||||
|
||||
.sidebar-item--editing {
|
||||
padding: 0;
|
||||
border: none;
|
||||
background: transparent;
|
||||
}
|
||||
|
||||
.sidebar-item-input {
|
||||
width: 0;
|
||||
flex: 1 1 auto;
|
||||
min-width: 0;
|
||||
max-width: 0;
|
||||
|
||||
appearance: none;
|
||||
-webkit-appearance: none;
|
||||
background: transparent;
|
||||
border: none;
|
||||
outline: none;
|
||||
box-shadow: none;
|
||||
|
||||
text-align: center;
|
||||
|
||||
color: var(--text-primary);
|
||||
font-family: var(--font-ui);
|
||||
font-size: var(--font-sm);
|
||||
font-weight: var(--font-weight-semibold);
|
||||
|
||||
opacity: 0;
|
||||
|
||||
transition:
|
||||
opacity var(--dur-fast) var(--ease-standard),
|
||||
max-width var(--dur-base) var(--ease-standard);
|
||||
}
|
||||
|
||||
.sidebar-rail--expanded .sidebar-item-input {
|
||||
width: auto;
|
||||
max-width: 200px;
|
||||
opacity: 1;
|
||||
}
|
||||
|
||||
/* ---------- Icon ---------- */
|
||||
|
||||
.sidebar-icon {
|
||||
@@ -335,15 +356,15 @@
|
||||
/* ---------- Label ---------- */
|
||||
|
||||
.sidebar-label {
|
||||
flex: 1 1 auto;
|
||||
min-width: 0;
|
||||
max-width: 0;
|
||||
|
||||
font-size: var(--font-sm);
|
||||
white-space: nowrap;
|
||||
overflow: hidden;
|
||||
|
||||
flex: 1 1 auto;
|
||||
min-width: 0;
|
||||
|
||||
opacity: 0;
|
||||
max-width: 0;
|
||||
|
||||
transition:
|
||||
opacity var(--dur-fast) var(--ease-standard),
|
||||
@@ -351,11 +372,11 @@
|
||||
}
|
||||
|
||||
.sidebar-rail--expanded .sidebar-label {
|
||||
opacity: 1;
|
||||
max-width: 200px;
|
||||
opacity: 1;
|
||||
}
|
||||
|
||||
/* ---------- Content ---------- */
|
||||
/* ---------- Content offset ---------- */
|
||||
|
||||
.stage--with-sidebar {
|
||||
margin-left: var(--sidebar-width-collapsed);
|
||||
@@ -366,58 +387,7 @@
|
||||
margin-left: var(--sidebar-width-expanded);
|
||||
}
|
||||
|
||||
/* ---------- Item (editing state) ---------- */
|
||||
|
||||
.sidebar-item--editing {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
gap: var(--sidebar-item-gap);
|
||||
|
||||
aspect-ratio: 1;
|
||||
height: calc(var(--header-height) * 0.7);
|
||||
|
||||
border: none;
|
||||
|
||||
background: transparent;
|
||||
padding: 0;
|
||||
}
|
||||
|
||||
.sidebar-item-input {
|
||||
width: 0;
|
||||
flex: 1 1 auto;
|
||||
min-width: 0;
|
||||
|
||||
appearance: none;
|
||||
-webkit-appearance: none;
|
||||
background: transparent;
|
||||
border: none;
|
||||
outline: none;
|
||||
box-shadow: none;
|
||||
|
||||
text-align: center;
|
||||
|
||||
color: var(--text-primary);
|
||||
font-family: var(--font-ui);
|
||||
font-size: var(--font-sm);
|
||||
font-weight: var(--font-weight-semibold);
|
||||
|
||||
opacity: 0;
|
||||
max-width: 0;
|
||||
|
||||
transition:
|
||||
opacity var(--dur-fast) var(--ease-standard),
|
||||
max-width var(--dur-base) var(--ease-standard);
|
||||
}
|
||||
|
||||
.sidebar-rail--expanded .sidebar-item-input {
|
||||
width: auto;
|
||||
opacity: 1;
|
||||
max-width: 200px;
|
||||
border: none;
|
||||
}
|
||||
|
||||
/* ---------- Phone / touch ---------- */
|
||||
/* ---------- Touch devices ---------- */
|
||||
|
||||
.sidebar-backdrop {
|
||||
display: none;
|
||||
@@ -444,32 +414,30 @@
|
||||
}
|
||||
|
||||
@media (pointer: coarse) {
|
||||
/* Cancel the global 44px min-height, sizes are set explicitly below */
|
||||
/* Cancel the global 44px min-height; sizes are set explicitly below */
|
||||
.sidebar-rail button {
|
||||
min-height: 0;
|
||||
}
|
||||
|
||||
/* No iOS/Android callout menu on long-press (we use it for rename) */
|
||||
/* No iOS/Android callout menu on long-press (used for rename) */
|
||||
.sidebar-item,
|
||||
.sidebar-app-trigger {
|
||||
-webkit-touch-callout: none;
|
||||
}
|
||||
}
|
||||
|
||||
@media (max-width: 768px) {
|
||||
/* ---------- Phone (portrait + landscape) ---------- */
|
||||
|
||||
@media (max-width: 768px), (max-height: 500px) and (pointer: coarse) {
|
||||
.sidebar-rail {
|
||||
top: var(--topbar-h);
|
||||
bottom: 0;
|
||||
z-index: 50; /* above .sidebar-backdrop (45) */
|
||||
padding-bottom: var(--safe-bottom);
|
||||
padding-left: var(--safe-left);
|
||||
width: calc(var(--sidebar-width-collapsed) + var(--safe-left));
|
||||
width: var(--sidebar-rail-w);
|
||||
}
|
||||
|
||||
/* Expanded = drawer on top of the content, not pushing it */
|
||||
.sidebar-rail--expanded {
|
||||
width: calc(var(--sidebar-width-expanded) + var(--safe-left));
|
||||
z-index: 50;
|
||||
box-shadow: 8px 0 24px rgba(0, 0, 0, 0.45);
|
||||
}
|
||||
|
||||
.app-root--sidebar-expanded .sidebar-backdrop {
|
||||
@@ -479,8 +447,8 @@
|
||||
left: 0;
|
||||
right: 0;
|
||||
bottom: 0;
|
||||
background: rgba(0, 0, 0, 0.5);
|
||||
z-index: 45;
|
||||
background: rgba(0, 0, 0, 0.5);
|
||||
}
|
||||
|
||||
.sidebar-scroll {
|
||||
@@ -488,46 +456,57 @@
|
||||
-webkit-overflow-scrolling: touch;
|
||||
}
|
||||
|
||||
/* Touch-sized items */
|
||||
.sidebar-item,
|
||||
.sidebar-item--editing {
|
||||
height: var(--touch-target);
|
||||
/* Items: touch-sized, grow with content, fixed-size icon.
|
||||
`.sidebar-rail` prefix beats `.sidebar-rail button { min-height: 0 }` */
|
||||
.sidebar-rail .sidebar-item,
|
||||
.sidebar-rail .sidebar-item--editing {
|
||||
aspect-ratio: auto;
|
||||
height: auto;
|
||||
min-height: var(--touch-target);
|
||||
width: var(--touch-target);
|
||||
}
|
||||
.sidebar-rail--expanded .sidebar-item {
|
||||
|
||||
.sidebar-rail--expanded .sidebar-item,
|
||||
.sidebar-rail--expanded .sidebar-item--editing {
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
.sidebar-icon {
|
||||
aspect-ratio: auto;
|
||||
width: calc(var(--touch-target) * 0.5);
|
||||
height: calc(var(--touch-target) * 0.5);
|
||||
}
|
||||
|
||||
.sidebar-label,
|
||||
.sidebar-item-input {
|
||||
font-size: max(16px, var(--font-sm)); /* >= 16px prevents iOS focus-zoom */
|
||||
}
|
||||
|
||||
.sidebar-toggle {
|
||||
height: calc(var(--touch-target) * 0.9);
|
||||
}
|
||||
|
||||
/* Preset dropdown */
|
||||
/* App dropdown */
|
||||
.sidebar-app-trigger,
|
||||
.sidebar-app-input {
|
||||
height: calc(var(--touch-target) * 0.9);
|
||||
}
|
||||
.sidebar-app-input,
|
||||
.sidebar-item-input {
|
||||
|
||||
.sidebar-app-trigger {
|
||||
font-size: max(13px, var(--font-xs));
|
||||
}
|
||||
|
||||
.sidebar-app-input {
|
||||
font-size: 16px; /* prevents iOS focus-zoom */
|
||||
}
|
||||
|
||||
.sidebar-app-listbox {
|
||||
max-height: min(240px, 50dvh);
|
||||
-webkit-overflow-scrolling: touch;
|
||||
}
|
||||
|
||||
.sidebar-app-option {
|
||||
padding: var(--space-3) var(--space-2);
|
||||
font-size: var(--font-sm);
|
||||
}
|
||||
}
|
||||
|
||||
@media (max-width: 768px), (max-height: 500px) and (pointer: coarse) {
|
||||
.sidebar-label,
|
||||
.sidebar-item-input {
|
||||
font-size: max(20px, var(--font-sm));
|
||||
}
|
||||
|
||||
.sidebar-app-trigger,
|
||||
.sidebar-app-input,
|
||||
.sidebar-app-option {
|
||||
font-size: max(13px, var(--font-xs));
|
||||
font-size: max(13px, var(--font-sm));
|
||||
}
|
||||
}
|
||||
@@ -309,27 +309,31 @@
|
||||
}
|
||||
}
|
||||
|
||||
@media (max-width: 768px) {
|
||||
@media (max-width: 768px), (max-height: 500px) and (pointer: coarse) {
|
||||
.topbar {
|
||||
--header-height: 56px;
|
||||
--tab-height: 40px;
|
||||
gap: var(--space-2);
|
||||
padding-inline: var(--space-2);
|
||||
}
|
||||
/* delete: --header-height: 56px; (it differs from the sidebar's 3.1rem) */
|
||||
--tab-height: 40px;
|
||||
--logo-size: 2.2rem;
|
||||
gap: 0;
|
||||
padding-left: 0;
|
||||
padding-right: calc(var(--space-2) + var(--safe-right));
|
||||
box-sizing: border-box;
|
||||
min-width: 0;
|
||||
}
|
||||
|
||||
.logo-slot {
|
||||
height: 70%;
|
||||
flex: 0 0 auto;
|
||||
}
|
||||
/* Logo centred in the rail area; tabstrip's border-left lands exactly on the sidebar's right border */
|
||||
.logo-slot {
|
||||
flex: 0 0 auto;
|
||||
height: var(--logo-size);
|
||||
width: var(--logo-size);
|
||||
margin-left: calc(var(--safe-left) + (var(--sidebar-width-collapsed) - 1px - var(--logo-size)) / 2);
|
||||
margin-right: calc((var(--sidebar-width-collapsed) - 1px - var(--logo-size)) / 2);
|
||||
}
|
||||
|
||||
.tabstrip {
|
||||
gap: var(--space-2);
|
||||
padding-left: var(--space-2);
|
||||
scroll-snap-type: x mandatory;
|
||||
scrollbar-width: none;
|
||||
-webkit-overflow-scrolling: touch;
|
||||
overscroll-behavior-x: contain;
|
||||
}
|
||||
.tabstrip {
|
||||
margin-right: var(--space-2); /* replaces the gap we removed */
|
||||
/* keep your existing gap / padding-left / scroll rules here */
|
||||
}
|
||||
.tabstrip::-webkit-scrollbar {
|
||||
display: none;
|
||||
}
|
||||
|
||||
@@ -49,6 +49,7 @@ function formatValueDefault(v: number, decimals: number) {
|
||||
return v.toFixed(decimals);
|
||||
}
|
||||
|
||||
const TOUCH_INTENT_PX = 20;
|
||||
const MIN_TICKS = 3;
|
||||
const MAX_TICK_SPACING_PX = 16;
|
||||
const WHEEL_COMMIT_DELAY_MS = 250;
|
||||
@@ -214,6 +215,7 @@ export default function VerticalSlider({
|
||||
// --- per-input-method "is the user still doing something" flags --------
|
||||
const dragging = useRef(false);
|
||||
const activePointerId = useRef<number | null>(null);
|
||||
const pendingTouch = useRef<{ id: number; x: number; y: number } | null>(null);
|
||||
const keysHeld = useRef<Set<string>>(new Set());
|
||||
const wheelTimeout = useRef<ReturnType<typeof setTimeout> | null>(null);
|
||||
|
||||
@@ -353,6 +355,7 @@ export default function VerticalSlider({
|
||||
|
||||
dragging.current = false;
|
||||
activePointerId.current = null;
|
||||
pendingTouch.current = null;
|
||||
keysHeld.current.clear();
|
||||
pendingCommit.current = null;
|
||||
if (wheelTimeout.current) {
|
||||
@@ -482,6 +485,30 @@ export default function VerticalSlider({
|
||||
|
||||
// --- pointer / mouse ---------------------------------------------------
|
||||
|
||||
function handlePointerMove(e: React.PointerEvent<HTMLDivElement>) {
|
||||
const pending = pendingTouch.current;
|
||||
if (pending && e.pointerId === pending.id) {
|
||||
const dx = e.clientX - pending.x;
|
||||
const dy = e.clientY - pending.y;
|
||||
if (Math.abs(dx) < TOUCH_INTENT_PX && Math.abs(dy) < TOUCH_INTENT_PX) return;
|
||||
|
||||
pendingTouch.current = null;
|
||||
|
||||
if (Math.abs(dy) > Math.abs(dx)) {
|
||||
// Vertical intent: start the drag now
|
||||
dragging.current = true;
|
||||
activePointerId.current = e.pointerId;
|
||||
e.currentTarget.setPointerCapture(e.pointerId);
|
||||
valueFromPointer(e.clientY);
|
||||
}
|
||||
// Horizontal intent: do nothing, the browser scrolls the strip
|
||||
return;
|
||||
}
|
||||
|
||||
if (!dragging.current || e.pointerId !== activePointerId.current) return;
|
||||
valueFromPointer(e.clientY);
|
||||
}
|
||||
|
||||
function valueFromPointer(clientY: number) {
|
||||
if (!sliderRef.current) return;
|
||||
const rect = sliderRef.current.getBoundingClientRect();
|
||||
@@ -492,6 +519,14 @@ export default function VerticalSlider({
|
||||
|
||||
function startDrag(e: React.PointerEvent<HTMLDivElement>) {
|
||||
if (disabled) return;
|
||||
|
||||
// Touch: don't move anything yet. Wait to see if the gesture is vertical
|
||||
// (fader) or horizontal (the strip scrolling).
|
||||
if (e.pointerType === 'touch') {
|
||||
if (dragging.current || pendingTouch.current) return;
|
||||
pendingTouch.current = { id: e.pointerId, x: e.clientX, y: e.clientY };
|
||||
return;
|
||||
}
|
||||
if (e.pointerType === 'mouse' && e.button !== 0) return;
|
||||
// Ignore a second pointer (multi-touch) while one is already dragging.
|
||||
if (dragging.current) return;
|
||||
@@ -503,12 +538,11 @@ export default function VerticalSlider({
|
||||
valueFromPointer(e.clientY);
|
||||
}
|
||||
|
||||
function handlePointerMove(e: React.PointerEvent<HTMLDivElement>) {
|
||||
if (!dragging.current || e.pointerId !== activePointerId.current) return;
|
||||
valueFromPointer(e.clientY);
|
||||
}
|
||||
|
||||
function endDrag(e: React.PointerEvent<HTMLDivElement>) {
|
||||
if (pendingTouch.current?.id === e.pointerId) {
|
||||
pendingTouch.current = null;
|
||||
return;
|
||||
}
|
||||
if (!dragging.current || e.pointerId !== activePointerId.current) return;
|
||||
|
||||
// Release the gesture synchronously. The old code awaited onChange first,
|
||||
|
||||
@@ -1,4 +1,35 @@
|
||||
/* InputSection.css */
|
||||
/* ChannelSection.css */
|
||||
|
||||
/* Font-size hooks: desktop uses the cqh values, the phone block below
|
||||
overrides them with fixed px sizes.
|
||||
--ch-fs main text in the control strip (titles, steppers, buttons)
|
||||
--ch-fs-action buttons in the Actions group
|
||||
--ch-fs-label small labels under the sliders */
|
||||
|
||||
/* ---------- Page wrapper ---------- */
|
||||
|
||||
.channel-page {
|
||||
display: contents; /* invisible on desktop; a flex column on phones */
|
||||
}
|
||||
|
||||
.channel-tabs,
|
||||
.channel-rotate-hint {
|
||||
display: none; /* phones only */
|
||||
}
|
||||
|
||||
.channel-panel__label-short,
|
||||
.peq-band-list__label-short {
|
||||
display: none;
|
||||
}
|
||||
|
||||
/* Invisible wrappers on desktop (layout identical to before) */
|
||||
.peq-block,
|
||||
.crossover-panel__slider {
|
||||
display: contents;
|
||||
}
|
||||
|
||||
/* ---------- Graph ---------- */
|
||||
|
||||
.channel-graph-section {
|
||||
flex: 0 0 calc(100% - var(--dsp-control-heigth));
|
||||
min-height: 0;
|
||||
@@ -65,9 +96,55 @@
|
||||
min-height: 0;
|
||||
}
|
||||
|
||||
/* Bottom control bar — same pattern as .compressor-section: absolute,
|
||||
.channel-graph-panel__magnitude-wrap {
|
||||
flex: 1 1 0;
|
||||
min-height: 0;
|
||||
min-width: 0;
|
||||
position: relative;
|
||||
}
|
||||
|
||||
.channel-graph__title-row {
|
||||
flex: 0 0 auto;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: space-between;
|
||||
padding: 1cqh 1.5cqh;
|
||||
}
|
||||
|
||||
.channel-graph__title-row .channel-graph__title {
|
||||
padding: 0; /* was on the standalone title element; row now owns spacing */
|
||||
}
|
||||
|
||||
.channel-graph-view-toggle {
|
||||
display: flex;
|
||||
gap: 0.4cqh;
|
||||
border: var(--border-width) solid var(--border-hairline);
|
||||
border-radius: var(--radius-sm);
|
||||
padding: 0.3cqh;
|
||||
background: var(--bg-void);
|
||||
}
|
||||
|
||||
.channel-graph-view-toggle__btn {
|
||||
font-family: var(--font-ui);
|
||||
font-size: 2cqh;
|
||||
padding: 0.6cqh 1.2cqh;
|
||||
background: transparent;
|
||||
color: var(--text-muted);
|
||||
border: none;
|
||||
border-radius: var(--radius-sm);
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
.channel-graph-view-toggle__btn.active {
|
||||
background: var(--accent-brand);
|
||||
color: var(--bg-void);
|
||||
}
|
||||
|
||||
/* ---------- Control strip ----------
|
||||
Bottom control bar — same pattern as .compressor-section: absolute,
|
||||
bottom-anchored, panels flow in a row and scroll horizontally instead
|
||||
of squeezing into a fixed max-width. */
|
||||
|
||||
.channel-control-section {
|
||||
container-type: size;
|
||||
position: absolute;
|
||||
@@ -105,7 +182,8 @@
|
||||
padding: 2cqh;
|
||||
}
|
||||
|
||||
/* Peq Sliders */
|
||||
/* ---------- PEQ sliders ---------- */
|
||||
|
||||
.channel-panel {
|
||||
position: relative;
|
||||
height: 100%;
|
||||
@@ -129,7 +207,7 @@
|
||||
width: 100%;
|
||||
text-align: center;
|
||||
font-family: var(--font-ui);
|
||||
font-size: 4cqh;
|
||||
font-size: var(--ch-fs, 4cqh);
|
||||
font-weight: var(--font-weight-semibold);
|
||||
padding-top: 2cqh;
|
||||
padding-bottom: 2cqh;
|
||||
@@ -167,11 +245,13 @@
|
||||
.channel-panel__cell-label {
|
||||
flex: 0 0 auto;
|
||||
font-family: var(--font-ui);
|
||||
font-size: 3.2cqh;
|
||||
font-size: var(--ch-fs-label, 3.2cqh);
|
||||
color: var(--text-muted);
|
||||
white-space: nowrap;
|
||||
}
|
||||
|
||||
/* ---------- Crossover ---------- */
|
||||
|
||||
.crossover-panel {
|
||||
position: relative;
|
||||
height: 100%;
|
||||
@@ -196,7 +276,7 @@
|
||||
width: 100%;
|
||||
text-align: center;
|
||||
font-family: var(--font-ui);
|
||||
font-size: 4cqh;
|
||||
font-size: var(--ch-fs, 4cqh);
|
||||
font-weight: var(--font-weight-semibold);
|
||||
padding-top: 2cqh;
|
||||
padding-bottom: 2cqh;
|
||||
@@ -207,36 +287,20 @@
|
||||
text-overflow: ellipsis;
|
||||
}
|
||||
|
||||
/* Now the root of a ChoiceSelect rather than a native <select>. */
|
||||
/* Root of a ChoiceSelect rather than a native <select>. */
|
||||
.crossover-panel__select {
|
||||
flex: 0 0 auto;
|
||||
width: 85%;
|
||||
height: auto;
|
||||
min-height: 0;
|
||||
|
||||
font-family: var(--font-ui);
|
||||
}
|
||||
font-size: var(--ch-fs, 4cqh);
|
||||
|
||||
.crossover-panel__select .choice-select__input,
|
||||
.crossover-panel__select .choice-select__input option {
|
||||
font-size: 4cqh;
|
||||
color: var(--accent-brand);
|
||||
/* padding-left: 1cqh; */
|
||||
}
|
||||
|
||||
.crossover-panel__select {
|
||||
flex: 0 0 auto;
|
||||
width: 85%;
|
||||
font-family: var(--font-ui);
|
||||
font-size: 4cqh;
|
||||
}
|
||||
|
||||
.crossover-panel__select .choice-select__input,
|
||||
.crossover-panel__select .choice-select__input option {
|
||||
height: 100%;
|
||||
padding: 0;
|
||||
padding-left: 2cqh;
|
||||
font-size: 4cqh;
|
||||
color: var(--accent-brand);
|
||||
border-radius: var(--radius-sm);
|
||||
}
|
||||
/* ---------- PEQ band list ---------- */
|
||||
|
||||
.peq-band-list {
|
||||
flex: 1 1 auto;
|
||||
@@ -267,6 +331,8 @@
|
||||
align-items: stretch;
|
||||
gap: 1cqh;
|
||||
|
||||
color: var(--accent-brand);
|
||||
|
||||
box-sizing: border-box;
|
||||
}
|
||||
|
||||
@@ -274,7 +340,7 @@
|
||||
flex: 0 0 auto;
|
||||
|
||||
font-family: var(--font-ui);
|
||||
font-size: 4cqh;
|
||||
font-size: var(--ch-fs, 4cqh);
|
||||
color: var(--text-primary);
|
||||
text-align: center;
|
||||
font-weight: var(--font-weight-semibold);
|
||||
@@ -334,66 +400,494 @@
|
||||
min-height: 0;
|
||||
|
||||
font-family: var(--font-ui);
|
||||
font-size: 4cqh;
|
||||
font-size: var(--ch-fs, 4cqh);
|
||||
}
|
||||
|
||||
.channel-graph-panel__magnitude-wrap {
|
||||
flex: 1 1 0;
|
||||
min-height: 0;
|
||||
min-width: 0;
|
||||
position: relative;
|
||||
}
|
||||
|
||||
.channel-graph__title-row {
|
||||
flex: 0 0 auto;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: space-between;
|
||||
padding: 1cqh 1.5cqh;
|
||||
}
|
||||
|
||||
.channel-graph__title-row .channel-graph__title {
|
||||
padding: 0; /* was on the standalone title element; row now owns spacing */
|
||||
}
|
||||
|
||||
.channel-graph-view-toggle {
|
||||
display: flex;
|
||||
gap: 0.4cqh;
|
||||
border: var(--border-width) solid var(--border-hairline);
|
||||
border-radius: var(--radius-sm);
|
||||
padding: 0.3cqh;
|
||||
background: var(--bg-void);
|
||||
}
|
||||
|
||||
.channel-graph-view-toggle__btn {
|
||||
font-family: var(--font-ui);
|
||||
font-size: 2cqh;
|
||||
padding: 0.6cqh 1.2cqh;
|
||||
background: transparent;
|
||||
color: var(--text-muted);
|
||||
border: none;
|
||||
border-radius: var(--radius-sm);
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
.channel-graph-view-toggle__btn.active {
|
||||
background: var(--accent-brand);
|
||||
color: var(--bg-void);
|
||||
}
|
||||
|
||||
.peq-band-list__stepper .choice-stepper__input,
|
||||
.peq-band-list__select .choice-select__input {
|
||||
.peq-channel-selector {
|
||||
width: 80px;
|
||||
height: 100%;
|
||||
min-height: 0;
|
||||
align-self: stretch;
|
||||
|
||||
font-family: var(--font-mono);
|
||||
font-size: 4cqh;
|
||||
color: var(--accent-brand);
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
justify-content: center;
|
||||
align-items: stretch;
|
||||
|
||||
background: transparent;
|
||||
|
||||
text-align: center;
|
||||
text-align-last: center;
|
||||
padding: 0;
|
||||
margin: 0;
|
||||
gap: var(--space-1);
|
||||
box-sizing: border-box;
|
||||
}
|
||||
|
||||
/* ---------- Phone (shared) ----------
|
||||
Landscape: tabs (Controls / Filter response), one view at a time.
|
||||
Portrait: controls only + a hint to rotate for the graphs. */
|
||||
|
||||
@media (max-width: 768px), (max-height: 500px) and (pointer: coarse) {
|
||||
.channel-page {
|
||||
--ch-fs: 11px;
|
||||
--ch-fs-action: 12px;
|
||||
--ch-fs-label: 10px;
|
||||
--peq-list-width: 480px;
|
||||
|
||||
flex: 1 1 0;
|
||||
min-height: 0;
|
||||
width: 100%;
|
||||
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
background: var(--bg-panel);
|
||||
}
|
||||
|
||||
/* ----- Tabs ----- */
|
||||
|
||||
.channel-tabs {
|
||||
flex: 0 0 auto;
|
||||
display: flex;
|
||||
gap: var(--space-1);
|
||||
padding: var(--space-1) var(--space-2);
|
||||
border-bottom: var(--border-width) solid var(--border-hairline);
|
||||
}
|
||||
|
||||
.channel-page .channel-tabs__tab {
|
||||
flex: 1 1 0;
|
||||
min-width: 0;
|
||||
min-height: 0;
|
||||
height: 34px;
|
||||
padding: 0 var(--space-2);
|
||||
|
||||
font-family: var(--font-ui);
|
||||
font-size: var(--font-xs);
|
||||
font-weight: var(--font-weight-semibold);
|
||||
white-space: nowrap;
|
||||
overflow: hidden;
|
||||
text-overflow: ellipsis;
|
||||
|
||||
background: var(--bg-void);
|
||||
color: var(--text-muted);
|
||||
border: var(--border-width) solid var(--border-hairline);
|
||||
border-radius: var(--radius-sm);
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
.channel-page .channel-tabs__tab[aria-selected='true'] {
|
||||
background: var(--bg-raised);
|
||||
color: var(--text-primary);
|
||||
border-color: var(--accent-brand);
|
||||
}
|
||||
|
||||
/* ----- Which view is visible ----- */
|
||||
|
||||
.channel-page[data-view='controls'] .channel-graph-section,
|
||||
.channel-page:not([data-view='controls']) .channel-control-section {
|
||||
display: none;
|
||||
}
|
||||
|
||||
/* ----- Magnitude / Phase tabs: one graph fills everything ----- */
|
||||
|
||||
.channel-graph-section {
|
||||
flex: 1 1 0;
|
||||
min-height: 0;
|
||||
gap: var(--space-1);
|
||||
padding: var(--space-1);
|
||||
}
|
||||
|
||||
.channel-graph__title {
|
||||
padding: 0;
|
||||
font-size: var(--font-xs);
|
||||
}
|
||||
|
||||
.channel-graph__title-row {
|
||||
padding: var(--space-1);
|
||||
gap: var(--space-2);
|
||||
}
|
||||
|
||||
.channel-graph-view-toggle {
|
||||
gap: 2px;
|
||||
padding: 2px;
|
||||
}
|
||||
|
||||
.channel-graph-view-toggle__btn {
|
||||
font-size: 11px;
|
||||
padding: 4px 10px;
|
||||
}
|
||||
|
||||
.channel-bypass-overlay span {
|
||||
font-size: 28px;
|
||||
}
|
||||
|
||||
/* ----- Controls view: groups, swipe sideways, snap per group ----- */
|
||||
|
||||
.channel-control-section {
|
||||
position: relative;
|
||||
z-index: auto;
|
||||
flex: 1 1 0;
|
||||
height: auto;
|
||||
min-height: 0;
|
||||
|
||||
align-items: stretch;
|
||||
justify-content: flex-start;
|
||||
border-top: none;
|
||||
}
|
||||
|
||||
.channel-control-panel {
|
||||
display: flex;
|
||||
justify-content: flex-start; /* desktop's "center" would clip the left side on overflow */
|
||||
width: 100%;
|
||||
min-width: 0;
|
||||
height: auto;
|
||||
gap: var(--space-3);
|
||||
padding: var(--space-2);
|
||||
box-sizing: border-box;
|
||||
|
||||
overflow-x: auto;
|
||||
overflow-y: hidden;
|
||||
scroll-snap-type: x proximity;
|
||||
overscroll-behavior-x: contain;
|
||||
-webkit-overflow-scrolling: touch;
|
||||
}
|
||||
|
||||
/* Each group is as wide as its content (never shrunk to the viewport),
|
||||
so .channel-control-panel is the only thing that scrolls. */
|
||||
.channel-control-section .channel-group {
|
||||
flex: 0 0 auto;
|
||||
width: max-content;
|
||||
max-width: none;
|
||||
margin: 0;
|
||||
padding: 30px var(--space-2) var(--space-2);
|
||||
scroll-snap-align: start;
|
||||
}
|
||||
|
||||
.channel-control-section .channel-group__label {
|
||||
top: 7px;
|
||||
font-size: var(--font-sm);
|
||||
}
|
||||
|
||||
.channel-control-section .channel-group__items {
|
||||
height: auto;
|
||||
align-self: stretch;
|
||||
justify-content: flex-start;
|
||||
gap: var(--space-2);
|
||||
overflow: visible; /* no nested scroller: it would fight with .channel-control-panel */
|
||||
}
|
||||
|
||||
/* Centered when everything fits, left-aligned and scrollable when it doesn't */
|
||||
.channel-control-panel > .channel-group:first-child {
|
||||
margin-left: auto;
|
||||
}
|
||||
|
||||
.channel-control-panel > .channel-group:last-child {
|
||||
margin-right: auto;
|
||||
}
|
||||
|
||||
/* PEQ group: band table + slider panel side by side (landscape) */
|
||||
.peq-block {
|
||||
display: flex;
|
||||
flex-direction: row;
|
||||
align-items: stretch;
|
||||
gap: var(--space-2);
|
||||
min-height: 0;
|
||||
}
|
||||
|
||||
.peq-band-list {
|
||||
flex: 0 0 auto;
|
||||
width: var(--peq-list-width);
|
||||
gap: 3px;
|
||||
padding: 3px;
|
||||
}
|
||||
|
||||
.peq-band-list__row {
|
||||
gap: 3px;
|
||||
}
|
||||
|
||||
.peq-band-list__row--header {
|
||||
padding-block: 3px;
|
||||
}
|
||||
|
||||
.channel-panel {
|
||||
flex: 0 0 auto;
|
||||
width: clamp(210px, 28vw, 260px);
|
||||
height: auto; /* stretches to the row */
|
||||
aspect-ratio: auto;
|
||||
}
|
||||
|
||||
.channel-panel__title {
|
||||
padding-block: var(--space-1);
|
||||
}
|
||||
|
||||
.channel-panel__grid {
|
||||
gap: var(--space-1);
|
||||
padding: var(--space-2) var(--space-1);
|
||||
}
|
||||
|
||||
.channel-panel__cell {
|
||||
gap: var(--space-1);
|
||||
}
|
||||
|
||||
.channel-panel__cell-label {
|
||||
max-width: 100%;
|
||||
overflow: hidden;
|
||||
text-overflow: ellipsis;
|
||||
}
|
||||
|
||||
/* Crossover: two narrow strips */
|
||||
.crossover-panel {
|
||||
flex: 0 0 auto;
|
||||
width: clamp(80px, 8vw, 100px);
|
||||
height: auto; /* stretches to the row */
|
||||
aspect-ratio: auto;
|
||||
gap: var(--space-2);
|
||||
padding-bottom: var(--space-2);
|
||||
}
|
||||
|
||||
.peq-channel-selector {
|
||||
width: 80px;
|
||||
height: 100%;
|
||||
align-self: stretch;
|
||||
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
justify-content: center;
|
||||
align-items: stretch;
|
||||
|
||||
gap: var(--space-2);
|
||||
box-sizing: border-box;
|
||||
}
|
||||
|
||||
.crossover-panel__title {
|
||||
padding-block: var(--space-1);
|
||||
}
|
||||
|
||||
.crossover-panel__slider > * {
|
||||
min-height: 0;
|
||||
}
|
||||
|
||||
.peq-band-list__label-long {
|
||||
display: none;
|
||||
}
|
||||
|
||||
.peq-band-list__label-short {
|
||||
display: inline;
|
||||
}
|
||||
|
||||
.channel-panel__label-long {
|
||||
display: none;
|
||||
}
|
||||
|
||||
.channel-panel__label-short {
|
||||
display: inline;
|
||||
}
|
||||
|
||||
/* pan-x: vertical drags move the fader, horizontal swipes still scroll the strip.
|
||||
Applied to the thumb/track too so a swipe that starts on them scrolls. */
|
||||
.channel-panel__cell > :first-child,
|
||||
.channel-panel__cell > :first-child *,
|
||||
.crossover-panel__slider,
|
||||
.crossover-panel__slider * {
|
||||
touch-action: pan-x !important;
|
||||
}
|
||||
}
|
||||
|
||||
/* ---------- Portrait phone: controls only, no groups ----------
|
||||
Row 1: PEQ band table (full width)
|
||||
Row 2: PEQ sliders | HighPass | LowPass | Actions (all on the same row)
|
||||
The groups are flattened (display: contents) so panels from different
|
||||
groups can share a row. Nothing scrolls. */
|
||||
|
||||
@media (max-width: 768px) and (orientation: portrait) {
|
||||
.channel-page {
|
||||
--ch-fs: 11px;
|
||||
--ch-fs-action: 13px;
|
||||
}
|
||||
|
||||
.channel-tabs {
|
||||
display: none;
|
||||
}
|
||||
|
||||
.channel-rotate-hint {
|
||||
flex: 0 0 auto;
|
||||
display: block;
|
||||
padding: var(--space-1) var(--space-2);
|
||||
|
||||
font-family: var(--font-ui);
|
||||
font-size: 11px;
|
||||
text-align: center;
|
||||
color: var(--text-muted);
|
||||
|
||||
border-bottom: var(--border-width) solid var(--border-hairline);
|
||||
}
|
||||
|
||||
/* Whatever tab was active in landscape, portrait always shows the controls */
|
||||
.channel-page[data-view] .channel-graph-section {
|
||||
display: none;
|
||||
}
|
||||
|
||||
.channel-page[data-view] .channel-control-section {
|
||||
display: flex;
|
||||
}
|
||||
|
||||
.channel-control-panel {
|
||||
flex: 1 1 auto;
|
||||
display: grid;
|
||||
width: 100%;
|
||||
min-width: 0;
|
||||
box-sizing: border-box;
|
||||
|
||||
/* Fixed widths (same idea as the 40px GEQ cells): the strip scrolls instead of shrinking.
|
||||
Total ≈ the landscape band-table width (--peq-list-width), so the table stays readable. */
|
||||
grid-template-columns:
|
||||
210px /* PEQ sliders */
|
||||
100px /* HighPass */
|
||||
100px /* LowPass */
|
||||
110px; /* Actions */
|
||||
grid-template-rows: minmax(0, 1.15fr) minmax(0, 1fr);
|
||||
justify-content: start; /* desktop's "center" would clip the left side on overflow */
|
||||
gap: var(--space-1);
|
||||
padding: var(--space-1) var(--space-2);
|
||||
|
||||
overflow-x: auto;
|
||||
overflow-y: hidden;
|
||||
scroll-snap-type: none;
|
||||
overscroll-behavior-x: contain;
|
||||
-webkit-overflow-scrolling: touch;
|
||||
}
|
||||
|
||||
/* Flatten the groups (and hide their labels) */
|
||||
.channel-control-section .channel-group,
|
||||
.channel-control-section .channel-group__items,
|
||||
.peq-block {
|
||||
display: contents;
|
||||
}
|
||||
|
||||
.channel-control-section .channel-group__label {
|
||||
display: none;
|
||||
}
|
||||
|
||||
/* Each panel is its own size container (like the panels in CompressorSection):
|
||||
the cqh sizes inside (slider thumb, track, readout, paddings) scale to the panel. */
|
||||
.peq-band-list {
|
||||
grid-row: 1;
|
||||
grid-column: 1 / -1;
|
||||
width: auto;
|
||||
min-width: var(--peq-list-width); /* 480px, same as landscape */
|
||||
min-height: 0;
|
||||
container-type: size;
|
||||
--peq-cols: 0.45fr 0.9fr 0.55fr 0.9fr 1.1fr 0.55fr;
|
||||
}
|
||||
|
||||
.peq-band-list__row {
|
||||
grid-template-columns: var(--peq-cols);
|
||||
}
|
||||
|
||||
/* Row 2: columns fill in DOM order = PEQ sliders, HighPass, LowPass, Actions */
|
||||
.channel-panel,
|
||||
.crossover-panel {
|
||||
grid-row: 2;
|
||||
width: auto; /* fills its fixed grid column */
|
||||
min-width: 0;
|
||||
min-height: 0;
|
||||
height: auto;
|
||||
margin: 0;
|
||||
container-type: size;
|
||||
}
|
||||
|
||||
.channel-panel__title,
|
||||
.crossover-panel__title {
|
||||
padding-block: 4px;
|
||||
}
|
||||
|
||||
.channel-panel__grid {
|
||||
gap: 2px;
|
||||
padding: 4px;
|
||||
|
||||
position: relative;
|
||||
z-index: 1; /* paint above the title if a thumb still reaches it */
|
||||
}
|
||||
|
||||
/* The thumb sticks out of the track by half its height at min/max: leave that
|
||||
room inside the cell instead of clipping it or letting it slide under the title. */
|
||||
.channel-panel__cell {
|
||||
overflow: visible;
|
||||
padding-block: 3cqh;
|
||||
box-sizing: border-box;
|
||||
gap: 2px;
|
||||
}
|
||||
|
||||
.channel-panel__cell > :first-child {
|
||||
min-height: 0;
|
||||
max-height: 100%;
|
||||
}
|
||||
|
||||
.crossover-panel {
|
||||
gap: 4px;
|
||||
padding-bottom: 4px;
|
||||
}
|
||||
|
||||
.crossover-panel__slider {
|
||||
display: contents;
|
||||
}
|
||||
|
||||
.crossover-panel__select {
|
||||
width: 90%;
|
||||
}
|
||||
|
||||
/* Actions: its own panel in the 4th column, Bypass above Reset */
|
||||
.channel-control-section .peq-channel-selector {
|
||||
grid-row: 2;
|
||||
width: auto;
|
||||
height: auto;
|
||||
min-width: 0;
|
||||
min-height: 0;
|
||||
align-self: stretch;
|
||||
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
justify-content: center;
|
||||
gap: var(--space-1);
|
||||
|
||||
padding: var(--space-1);
|
||||
box-sizing: border-box;
|
||||
background: var(--bg-void);
|
||||
border: var(--border-width) solid var(--border-hairline);
|
||||
border-radius: var(--radius-md);
|
||||
}
|
||||
|
||||
.channel-control-section .peq-channel-selector > * {
|
||||
flex: 1 1 0;
|
||||
min-height: 0;
|
||||
max-height: 64px;
|
||||
width: 100% !important;
|
||||
padding: 0 !important; /* inline paddings are in cqh: too big on a phone */
|
||||
font-size: var(--ch-fs-action) !important;
|
||||
overflow: hidden;
|
||||
text-overflow: ellipsis;
|
||||
}
|
||||
}
|
||||
|
||||
/* ---------- Landscape phone: thinner strips ---------- */
|
||||
|
||||
@media (max-height: 500px) and (pointer: coarse) {
|
||||
.channel-control-panel {
|
||||
padding: var(--space-1) var(--space-2);
|
||||
}
|
||||
|
||||
.channel-control-section .channel-group {
|
||||
padding-top: 24px;
|
||||
}
|
||||
|
||||
.channel-control-section .channel-group__label {
|
||||
top: 4px;
|
||||
font-size: var(--font-xs);
|
||||
}
|
||||
|
||||
.channel-panel {
|
||||
width: clamp(200px, 26vw, 240px);
|
||||
}
|
||||
|
||||
.channel-panel__title,
|
||||
.crossover-panel__title {
|
||||
padding-block: var(--space-1);
|
||||
}
|
||||
|
||||
.channel-panel__grid {
|
||||
padding: var(--space-1);
|
||||
}
|
||||
}
|
||||
@@ -28,6 +28,10 @@ import {
|
||||
} from '../../constants';
|
||||
import { MagnitudeGraph, PhaseGraph } from './ChannelGraph';
|
||||
|
||||
// Font size used by the buttons below. On desktop it falls back to the cqh value;
|
||||
// the mobile CSS overrides --ch-fs with a fixed px size.
|
||||
const BTN_FS = 'var(--ch-fs, 4cqh)';
|
||||
|
||||
function nearestQValue(q: number, values: readonly number[] = PEAK_Q_VALUES): number {
|
||||
return values.reduce((nearest, current) =>
|
||||
Math.abs(current - q) < Math.abs(nearest - q) ? current : nearest
|
||||
@@ -36,6 +40,32 @@ function nearestQValue(q: number, values: readonly number[] = PEAK_Q_VALUES): nu
|
||||
|
||||
type GraphView = 'both' | 'magnitude' | 'phase';
|
||||
|
||||
// Phone only: one view at a time (CSS hides the tabs on desktop)
|
||||
type ChannelView = 'controls' | 'magnitude' | 'phase';
|
||||
|
||||
const CHANNEL_VIEWS: { id: ChannelView; label: string }[] = [
|
||||
{ id: 'controls', label: 'Controls' },
|
||||
{ id: 'magnitude', label: 'Magnitude' },
|
||||
{ id: 'phase', label: 'Phase' },
|
||||
];
|
||||
|
||||
// Must match the phone media query in ChannelSection.css
|
||||
const MOBILE_QUERY = '(max-width: 768px), (max-height: 500px) and (pointer: coarse)';
|
||||
|
||||
function useIsMobile(): boolean {
|
||||
const [matches, setMatches] = useState(() => window.matchMedia(MOBILE_QUERY).matches);
|
||||
|
||||
useEffect(() => {
|
||||
const mql = window.matchMedia(MOBILE_QUERY);
|
||||
const onChange = () => setMatches(mql.matches);
|
||||
onChange();
|
||||
mql.addEventListener('change', onChange);
|
||||
return () => mql.removeEventListener('change', onChange);
|
||||
}, []);
|
||||
|
||||
return matches;
|
||||
}
|
||||
|
||||
function GraphViewToggle({
|
||||
view,
|
||||
onChange,
|
||||
@@ -77,14 +107,14 @@ function ChannelActions({
|
||||
onReset: () => void;
|
||||
}) {
|
||||
return (
|
||||
<div className="geq-channel-selector">
|
||||
<div className="peq-channel-selector">
|
||||
<Button
|
||||
variant="toggle"
|
||||
className={bypass ? 'active-warning' : ''}
|
||||
onClick={onBypass}
|
||||
style={{
|
||||
width: '100%',
|
||||
fontSize: '3.5cqh',
|
||||
fontSize: 'var(--ch-fs-action, 3.5cqh)',
|
||||
paddingTop: '2cqh',
|
||||
paddingBottom: '2cqh',
|
||||
minHeight: 0,
|
||||
@@ -100,7 +130,7 @@ function ChannelActions({
|
||||
disabled={resetting}
|
||||
style={{
|
||||
width: '100%',
|
||||
fontSize: '3.5cqh',
|
||||
fontSize: 'var(--ch-fs-action, 3.5cqh)',
|
||||
paddingTop: '2cqh',
|
||||
paddingBottom: '2cqh',
|
||||
minHeight: 0,
|
||||
@@ -160,7 +190,10 @@ function PeqPanelSliders({
|
||||
style={{ width: '100%', flex: '1 1 auto' }}
|
||||
/>
|
||||
|
||||
<div className="channel-panel__cell-label">Frequency</div>
|
||||
<div className="channel-panel__cell-label">
|
||||
<span className="channel-panel__label-long">Frequency</span>
|
||||
<span className="channel-panel__label-short">Freq</span>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div className="channel-panel__cell channel-panel__cell--q">
|
||||
@@ -249,21 +282,24 @@ function CrossoverPanel({
|
||||
<div className="crossover-panel">
|
||||
<div className="crossover-panel__title">{title}</div>
|
||||
|
||||
<VerticalSlider
|
||||
min={FREQUENCY_MIN}
|
||||
max={FREQUENCY_MAX}
|
||||
scale="log"
|
||||
step={makeLogStep(FREQUENCY_MIN, FREQUENCY_MAX, FREQUENCY_QUANTIZATION)}
|
||||
quantize={makeLogQuantize(FREQUENCY_MIN, FREQUENCY_MAX, FREQUENCY_QUANTIZATION)}
|
||||
unit={(value) => (value >= 1000 ? 'kHz' : 'Hz')}
|
||||
value={frequency}
|
||||
formatValue={(value) =>
|
||||
value >= 1000 ? `${(value / 1000).toFixed(2)}` : `${value.toFixed(1)}`
|
||||
}
|
||||
onChange={(value) => commit({ frequency: value })}
|
||||
onInput={(value) => onLiveValue(value)}
|
||||
style={{ width: '100%', flex: '1 1 auto' }}
|
||||
/>
|
||||
{/* display: contents on desktop; lets the mobile CSS target the slider for touch-action */}
|
||||
<div className="crossover-panel__slider">
|
||||
<VerticalSlider
|
||||
min={FREQUENCY_MIN}
|
||||
max={FREQUENCY_MAX}
|
||||
scale="log"
|
||||
step={makeLogStep(FREQUENCY_MIN, FREQUENCY_MAX, FREQUENCY_QUANTIZATION)}
|
||||
quantize={makeLogQuantize(FREQUENCY_MIN, FREQUENCY_MAX, FREQUENCY_QUANTIZATION)}
|
||||
unit={(value) => (value >= 1000 ? 'kHz' : 'Hz')}
|
||||
value={frequency}
|
||||
formatValue={(value) =>
|
||||
value >= 1000 ? `${(value / 1000).toFixed(2)}` : `${value.toFixed(1)}`
|
||||
}
|
||||
onChange={(value) => commit({ frequency: value })}
|
||||
onInput={(value) => onLiveValue(value)}
|
||||
style={{ width: '100%', flex: '1 1 auto' }}
|
||||
/>
|
||||
</div>
|
||||
|
||||
<ChoiceSelect
|
||||
className="crossover-panel__select"
|
||||
@@ -283,7 +319,7 @@ function CrossoverPanel({
|
||||
width: '85%',
|
||||
paddingLeft: 0,
|
||||
paddingRight: 0,
|
||||
fontSize: '4cqh',
|
||||
fontSize: BTN_FS,
|
||||
paddingTop: '2cqh',
|
||||
paddingBottom: '2cqh',
|
||||
minHeight: 0,
|
||||
@@ -363,7 +399,6 @@ function PeqBandList({
|
||||
onClick={() => setActiveBand(band)}
|
||||
style={{
|
||||
minHeight: 0,
|
||||
fontSize: '4cqh',
|
||||
}}
|
||||
>
|
||||
{`B${i + 1}`}
|
||||
@@ -423,9 +458,10 @@ function PeqBandList({
|
||||
variant="toggle"
|
||||
className={peq.bypass ? 'active-warning' : ''}
|
||||
onClick={() => commit(band, { bypass: !peq.bypass })}
|
||||
style={{ minHeight: 0, fontSize: '4cqh', paddingInline: 0 }}
|
||||
style={{ minHeight: 0, fontSize: BTN_FS, paddingInline: 0 }}
|
||||
>
|
||||
{peq.bypass ? 'Bypassed' : 'Bypass'}
|
||||
<span className="peq-band-list__label-long">{peq.bypass ? 'Bypassed' : 'Bypass'}</span>
|
||||
<span className="peq-band-list__label-short">Byp</span>
|
||||
</Button>
|
||||
</div>
|
||||
);
|
||||
@@ -468,6 +504,15 @@ function ChannelSection({
|
||||
const [graphView, setGraphView] = useState<GraphView>('both');
|
||||
const [resetting, setResetting] = useState(false);
|
||||
const [isResetConfirmOpen, setIsResetConfirmOpen] = useState(false);
|
||||
const [view, setView] = useState<ChannelView>('controls');
|
||||
const isMobile = useIsMobile();
|
||||
|
||||
// Phone: one tab per graph, so the Both / Mag / Phase toggle is not shown
|
||||
const shownGraph: GraphView = isMobile
|
||||
? view === 'phase'
|
||||
? 'phase'
|
||||
: 'magnitude'
|
||||
: graphView;
|
||||
|
||||
// Live values
|
||||
const [liveHpFreq, setLiveHpFreq] = useState<number>(FREQUENCY_MIN);
|
||||
@@ -595,72 +640,98 @@ function ChannelSection({
|
||||
|
||||
return (
|
||||
<>
|
||||
<div className="channel-graph-section">
|
||||
<div className="channel-graph-panel">
|
||||
<div className="channel-graph__title-row">
|
||||
<div className="channel-graph__title">{activeChannelState.name} - Filters</div>
|
||||
<GraphViewToggle view={graphView} onChange={setGraphView} />
|
||||
</div>
|
||||
|
||||
{(graphView === 'both' || graphView === 'magnitude') && (
|
||||
<div className="channel-graph-panel__magnitude-wrap">
|
||||
<MagnitudeGraph {...graphProps} />
|
||||
</div>
|
||||
)}
|
||||
|
||||
{(graphView === 'both' || graphView === 'phase') && <PhaseGraph {...graphProps} />}
|
||||
|
||||
{ActivePeq.bypass && (
|
||||
<div className="channel-bypass-overlay">
|
||||
<span>BYPASSED</span>
|
||||
</div>
|
||||
)}
|
||||
<div className="channel-page" data-view={view}>
|
||||
{/* Phone only (hidden on desktop by CSS): one view at a time */}
|
||||
<div className="channel-tabs" role="tablist" aria-label="Channel views">
|
||||
{CHANNEL_VIEWS.map((v) => (
|
||||
<button
|
||||
key={v.id}
|
||||
type="button"
|
||||
role="tab"
|
||||
aria-selected={view === v.id}
|
||||
className="channel-tabs__tab"
|
||||
onClick={() => setView(v.id)}
|
||||
>
|
||||
{v.label}
|
||||
</button>
|
||||
))}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div className="channel-control-section">
|
||||
<div className="channel-control-panel">
|
||||
<ChannelGroup title="PEQ">
|
||||
<PeqBandList
|
||||
bands={ActivePeq.bands}
|
||||
liveBands={livePeq}
|
||||
activeBand={activeBand}
|
||||
setActiveBand={setActiveBand}
|
||||
setPEQ={commitPEQ}
|
||||
bandsOrder={bandsOrder}
|
||||
/>
|
||||
<PeqPanelSliders
|
||||
peq={ActivePeq.bands[activeBand]}
|
||||
setPEQ={(gain, frequency, q, filter_type, bypass) =>
|
||||
commitPEQ(activeBand, gain, frequency, q, filter_type, bypass)
|
||||
}
|
||||
onLiveValue={(value) => handleLivePEQValue(activeBand, value)}
|
||||
/>
|
||||
</ChannelGroup>
|
||||
{/* Portrait phone only (CSS): the graphs need the width of landscape */}
|
||||
<div className="channel-rotate-hint">
|
||||
Rotate your phone to landscape to see the filter graphs.
|
||||
</div>
|
||||
|
||||
<ChannelGroup title="CrossOver">
|
||||
<CrossoverPanel
|
||||
crossover={ActiveHighPassFilter}
|
||||
title="HighPass"
|
||||
setCrossover={commitHighPass}
|
||||
onLiveValue={handleLiveHighPassValue}
|
||||
/>
|
||||
<CrossoverPanel
|
||||
crossover={ActiveLowPassFilter}
|
||||
title="LowPass"
|
||||
setCrossover={commitLowPass}
|
||||
onLiveValue={handleLiveLowPassValue}
|
||||
/>
|
||||
</ChannelGroup>
|
||||
<div className="channel-graph-section">
|
||||
<div className="channel-graph-panel">
|
||||
<div className="channel-graph__title-row">
|
||||
<div className="channel-graph__title">{activeChannelState.name} - Filters</div>
|
||||
{!isMobile && <GraphViewToggle view={graphView} onChange={setGraphView} />}
|
||||
</div>
|
||||
|
||||
<ChannelGroup title="Actions">
|
||||
<ChannelActions
|
||||
bypass={ActivePeq.bypass}
|
||||
resetting={resetting}
|
||||
onBypass={handleBypassClick}
|
||||
onReset={handleResetClick}
|
||||
/>
|
||||
</ChannelGroup>
|
||||
{(shownGraph === 'both' || shownGraph === 'magnitude') && (
|
||||
<div className="channel-graph-panel__magnitude-wrap">
|
||||
<MagnitudeGraph {...graphProps} />
|
||||
</div>
|
||||
)}
|
||||
|
||||
{(shownGraph === 'both' || shownGraph === 'phase') && <PhaseGraph {...graphProps} />}
|
||||
|
||||
{ActivePeq.bypass && (
|
||||
<div className="channel-bypass-overlay">
|
||||
<span>BYPASSED</span>
|
||||
</div>
|
||||
)}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div className="channel-control-section">
|
||||
<div className="channel-control-panel">
|
||||
<ChannelGroup title="PEQ">
|
||||
{/* display: contents on desktop; a row (landscape) / column (portrait) on phones */}
|
||||
<div className="peq-block">
|
||||
<PeqBandList
|
||||
bands={ActivePeq.bands}
|
||||
liveBands={livePeq}
|
||||
activeBand={activeBand}
|
||||
setActiveBand={setActiveBand}
|
||||
setPEQ={commitPEQ}
|
||||
bandsOrder={bandsOrder}
|
||||
/>
|
||||
<PeqPanelSliders
|
||||
peq={ActivePeq.bands[activeBand]}
|
||||
setPEQ={(gain, frequency, q, filter_type, bypass) =>
|
||||
commitPEQ(activeBand, gain, frequency, q, filter_type, bypass)
|
||||
}
|
||||
onLiveValue={(value) => handleLivePEQValue(activeBand, value)}
|
||||
/>
|
||||
</div>
|
||||
</ChannelGroup>
|
||||
|
||||
<ChannelGroup title="CrossOver">
|
||||
<CrossoverPanel
|
||||
crossover={ActiveHighPassFilter}
|
||||
title="HighPass"
|
||||
setCrossover={commitHighPass}
|
||||
onLiveValue={handleLiveHighPassValue}
|
||||
/>
|
||||
<CrossoverPanel
|
||||
crossover={ActiveLowPassFilter}
|
||||
title="LowPass"
|
||||
setCrossover={commitLowPass}
|
||||
onLiveValue={handleLiveLowPassValue}
|
||||
/>
|
||||
</ChannelGroup>
|
||||
|
||||
<ChannelGroup title="Actions">
|
||||
<ChannelActions
|
||||
bypass={ActivePeq.bypass}
|
||||
resetting={resetting}
|
||||
onBypass={handleBypassClick}
|
||||
onReset={handleResetClick}
|
||||
/>
|
||||
</ChannelGroup>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -688,4 +759,4 @@ function ChannelSection({
|
||||
);
|
||||
}
|
||||
|
||||
export default ChannelSection;
|
||||
export default ChannelSection;
|
||||
@@ -1,3 +1,22 @@
|
||||
/* CompressorSection.css */
|
||||
|
||||
/* ---------- Page wrapper ---------- */
|
||||
|
||||
.compressor-page {
|
||||
display: contents; /* invisible on desktop; a flex column on phones */
|
||||
}
|
||||
|
||||
.compressor-tabs,
|
||||
.compressor-rotate-hint {
|
||||
display: none; /* phones only */
|
||||
}
|
||||
|
||||
.compressor-panel__label-short {
|
||||
display: none;
|
||||
}
|
||||
|
||||
/* ---------- Control strip ---------- */
|
||||
|
||||
.compressor-section {
|
||||
container-type: size;
|
||||
position: absolute;
|
||||
@@ -146,6 +165,20 @@
|
||||
white-space: nowrap;
|
||||
}
|
||||
|
||||
.compressor-panel__stepper--centered .choice-stepper__input {
|
||||
text-align: center;
|
||||
padding: 0;
|
||||
margin: 0;
|
||||
}
|
||||
|
||||
.compressor-panel__stepper--centered .choice-stepper__arrows {
|
||||
flex: 0 0 20%;
|
||||
width: 20%;
|
||||
padding-right: 0;
|
||||
}
|
||||
|
||||
/* ---------- Graph ---------- */
|
||||
|
||||
.compressor-graph__channel {
|
||||
font-size: var(--font-xs);
|
||||
color: var(--text-muted);
|
||||
@@ -230,14 +263,350 @@
|
||||
min-height: 0;
|
||||
}
|
||||
|
||||
.compressor-panel__stepper--centered .choice-stepper__input {
|
||||
text-align: center;
|
||||
padding: 0;
|
||||
margin: 0;
|
||||
/* ---------- Phone (shared) ----------
|
||||
Landscape: tabs (Controls / Compressor response), one view at a time.
|
||||
Portrait: controls only + a hint to rotate for the graph. */
|
||||
|
||||
@media (max-width: 768px), (max-height: 500px) and (pointer: coarse) {
|
||||
.compressor-page {
|
||||
flex: 1 1 0;
|
||||
min-height: 0;
|
||||
width: 100%;
|
||||
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
background: var(--bg-panel);
|
||||
}
|
||||
|
||||
/* ----- Tabs ----- */
|
||||
|
||||
.compressor-tabs {
|
||||
flex: 0 0 auto;
|
||||
display: flex;
|
||||
gap: var(--space-1);
|
||||
padding: var(--space-1) var(--space-2);
|
||||
border-bottom: var(--border-width) solid var(--border-hairline);
|
||||
}
|
||||
|
||||
.compressor-page .compressor-tabs__tab {
|
||||
flex: 1 1 0;
|
||||
min-width: 0;
|
||||
min-height: 0;
|
||||
height: 34px;
|
||||
padding: 0 var(--space-2);
|
||||
|
||||
font-family: var(--font-ui);
|
||||
font-size: var(--font-xs);
|
||||
font-weight: var(--font-weight-semibold);
|
||||
white-space: nowrap;
|
||||
overflow: hidden;
|
||||
text-overflow: ellipsis;
|
||||
|
||||
background: var(--bg-void);
|
||||
color: var(--text-muted);
|
||||
border: var(--border-width) solid var(--border-hairline);
|
||||
border-radius: var(--radius-sm);
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
.compressor-page .compressor-tabs__tab[aria-selected='true'] {
|
||||
background: var(--bg-raised);
|
||||
color: var(--text-primary);
|
||||
border-color: var(--accent-brand);
|
||||
}
|
||||
|
||||
/* ----- Which view is visible ----- */
|
||||
|
||||
.compressor-page[data-view='controls'] .compressor-linear-graph-section,
|
||||
.compressor-page[data-view='response'] .compressor-section {
|
||||
display: none;
|
||||
}
|
||||
|
||||
/* ----- Response view: graph + meters fill everything ----- */
|
||||
|
||||
.compressor-linear-graph-section {
|
||||
flex: 1 1 0;
|
||||
min-height: 0;
|
||||
gap: var(--space-1);
|
||||
padding: var(--space-1);
|
||||
}
|
||||
|
||||
.compressor-graph__title {
|
||||
padding: var(--space-1);
|
||||
font-size: var(--font-xs);
|
||||
}
|
||||
|
||||
.compressor-graph__meters {
|
||||
gap: var(--space-1);
|
||||
padding: var(--space-1);
|
||||
}
|
||||
|
||||
/* ----- Controls view: strips, swipe sideways, snap per panel ----- */
|
||||
|
||||
.compressor-section {
|
||||
position: relative;
|
||||
z-index: auto;
|
||||
flex: 1 1 0;
|
||||
height: auto;
|
||||
min-height: 0;
|
||||
|
||||
align-items: stretch;
|
||||
justify-content: flex-start;
|
||||
border-top: none;
|
||||
}
|
||||
|
||||
.compressor-panels {
|
||||
display: flex;
|
||||
justify-content: flex-start; /* desktop's "center" would clip the left side on overflow */
|
||||
width: 100%;
|
||||
min-width: 0;
|
||||
height: auto;
|
||||
gap: var(--space-3);
|
||||
padding: var(--space-2);
|
||||
box-sizing: border-box;
|
||||
|
||||
overflow-x: auto;
|
||||
overflow-y: hidden;
|
||||
scroll-snap-type: x proximity;
|
||||
overscroll-behavior-x: contain;
|
||||
-webkit-overflow-scrolling: touch;
|
||||
}
|
||||
|
||||
/* The group is as wide as its strips (never shrunk to the viewport),
|
||||
so .compressor-panels is the only thing that scrolls. */
|
||||
.compressor-section .channel-group {
|
||||
flex: 0 0 auto;
|
||||
width: max-content;
|
||||
max-width: none;
|
||||
margin: 0;
|
||||
padding: 30px var(--space-2) var(--space-2);
|
||||
scroll-snap-align: start;
|
||||
}
|
||||
|
||||
.compressor-section .channel-group__label {
|
||||
top: 7px;
|
||||
font-size: var(--font-sm);
|
||||
}
|
||||
|
||||
.compressor-section .channel-group__items {
|
||||
height: auto;
|
||||
align-self: stretch;
|
||||
justify-content: flex-start;
|
||||
gap: var(--space-2);
|
||||
overflow: visible; /* no nested scroller: it would fight with .compressor-panels */
|
||||
}
|
||||
|
||||
/* Centered when everything fits, left-aligned and scrollable when it doesn't */
|
||||
.compressor-panels > .channel-group:first-child {
|
||||
margin-left: auto;
|
||||
}
|
||||
|
||||
.compressor-panels > .channel-group:last-child {
|
||||
margin-right: auto;
|
||||
}
|
||||
|
||||
/* One strip per output: 3 faders + a column with the Ratio / Knee steppers */
|
||||
.compressor-panel {
|
||||
flex: 0 0 auto;
|
||||
width: clamp(260px, 34vw, 320px);
|
||||
height: auto; /* stretches to the row */
|
||||
aspect-ratio: auto;
|
||||
scroll-snap-align: start;
|
||||
}
|
||||
|
||||
.compressor-panel__title {
|
||||
padding-block: var(--space-2);
|
||||
font-size: var(--font-xs);
|
||||
}
|
||||
|
||||
.compressor-panel__grid {
|
||||
grid-template-columns: repeat(3, minmax(0, 1fr)) minmax(0, 1.8fr);
|
||||
grid-template-rows: minmax(0, 1fr);
|
||||
grid-template-areas: 'threshold attack release steppers';
|
||||
gap: var(--space-1);
|
||||
padding: var(--space-2) var(--space-1);
|
||||
}
|
||||
|
||||
.compressor-panel__cell {
|
||||
gap: var(--space-1);
|
||||
}
|
||||
|
||||
.compressor-panel__cell--steppers {
|
||||
gap: var(--space-2);
|
||||
}
|
||||
|
||||
.compressor-panel__stepper {
|
||||
font-size: 11px;
|
||||
}
|
||||
|
||||
.compressor-panel__cell-label {
|
||||
max-width: 100%;
|
||||
font-size: 10px;
|
||||
overflow: hidden;
|
||||
text-overflow: ellipsis;
|
||||
}
|
||||
|
||||
.compressor-panel__label-long {
|
||||
display: none;
|
||||
}
|
||||
|
||||
.compressor-panel__label-short {
|
||||
display: inline;
|
||||
}
|
||||
|
||||
/* pan-x: vertical drags move the fader, horizontal swipes still scroll the strip.
|
||||
Applied to the thumb/track too so a swipe that starts on them scrolls. */
|
||||
.compressor-panel__cell:not(.compressor-panel__cell--steppers) > :first-child,
|
||||
.compressor-panel__cell:not(.compressor-panel__cell--steppers) > :first-child * {
|
||||
touch-action: pan-x !important;
|
||||
}
|
||||
}
|
||||
|
||||
.compressor-panel__stepper--centered .choice-stepper__arrows {
|
||||
flex: 0 0 20%;
|
||||
width: 20%;
|
||||
padding-right: 0;
|
||||
/* ---------- Portrait phone: controls only, 8 panels in 2 rows, each with 2x2 controls ---------- */
|
||||
|
||||
@media (max-width: 768px) and (orientation: portrait) {
|
||||
.compressor-tabs {
|
||||
display: none;
|
||||
}
|
||||
|
||||
.compressor-rotate-hint {
|
||||
flex: 0 0 auto;
|
||||
display: block;
|
||||
padding: var(--space-1) var(--space-2);
|
||||
|
||||
font-family: var(--font-ui);
|
||||
font-size: 11px;
|
||||
text-align: center;
|
||||
color: var(--text-muted);
|
||||
|
||||
border-bottom: var(--border-width) solid var(--border-hairline);
|
||||
}
|
||||
|
||||
/* Whatever tab was active in landscape, portrait always shows the controls */
|
||||
.compressor-page[data-view] .compressor-linear-graph-section {
|
||||
display: none;
|
||||
}
|
||||
|
||||
.compressor-page[data-view] .compressor-section {
|
||||
display: flex;
|
||||
}
|
||||
|
||||
/* Swipe sideways: both rows move together (Out1-4 on top, Out5-8 below) */
|
||||
.compressor-panels {
|
||||
padding: var(--space-1);
|
||||
gap: 0;
|
||||
}
|
||||
|
||||
.compressor-section .channel-group {
|
||||
padding: 28px var(--space-1) var(--space-1);
|
||||
}
|
||||
|
||||
.compressor-section .channel-group__label {
|
||||
top: 6px;
|
||||
font-size: var(--font-xs);
|
||||
}
|
||||
|
||||
.compressor-section .channel-group__items {
|
||||
flex: 1 1 auto;
|
||||
min-height: 0;
|
||||
|
||||
display: grid;
|
||||
grid-template-columns: repeat(4, clamp(150px, 46vw, 200px));
|
||||
grid-template-rows: repeat(2, minmax(0, 1fr));
|
||||
gap: var(--space-1);
|
||||
}
|
||||
|
||||
.compressor-panel {
|
||||
width: 100%;
|
||||
min-width: 0;
|
||||
min-height: 0;
|
||||
margin: 0;
|
||||
|
||||
/* Each panel is its own size container (like the rows in GainSection):
|
||||
the slider's cqh sizes (thumb, track, readout) scale to the panel height. */
|
||||
container-type: size;
|
||||
}
|
||||
|
||||
.compressor-panel__title {
|
||||
padding-block: 4px;
|
||||
font-size: 11px;
|
||||
}
|
||||
|
||||
/* Each panel keeps its 2x2 layout: Thr | Atk, steppers | Rel */
|
||||
.compressor-panel__grid {
|
||||
grid-template-columns: repeat(2, minmax(0, 1fr));
|
||||
grid-template-rows: repeat(2, minmax(0, 1fr));
|
||||
grid-template-areas:
|
||||
'threshold attack'
|
||||
'steppers release';
|
||||
gap: 2px;
|
||||
padding: 4px;
|
||||
|
||||
position: relative;
|
||||
z-index: 1; /* paint above the title if a thumb still reaches it */
|
||||
}
|
||||
|
||||
.compressor-panel__label-long {
|
||||
display: inline;
|
||||
}
|
||||
|
||||
.compressor-panel__label-short {
|
||||
display: none;
|
||||
}
|
||||
|
||||
.compressor-panel__cell {
|
||||
gap: 2px;
|
||||
}
|
||||
|
||||
/* The thumb sticks out of the track by half its height at min/max: leave that
|
||||
room inside the cell instead of clipping it or letting it slide under the title. */
|
||||
.compressor-panel__cell:not(.compressor-panel__cell--steppers) {
|
||||
overflow: visible;
|
||||
padding-block: 3cqh;
|
||||
box-sizing: border-box;
|
||||
}
|
||||
|
||||
.compressor-panel__cell > :first-child {
|
||||
min-height: 0;
|
||||
max-height: 100%;
|
||||
}
|
||||
|
||||
.compressor-panel__cell--steppers {
|
||||
justify-content: space-around;
|
||||
}
|
||||
|
||||
.compressor-panel__cell-label {
|
||||
font-size: 10px;
|
||||
line-height: 1.1;
|
||||
}
|
||||
}
|
||||
|
||||
/* ---------- Landscape phone: thinner strips ---------- */
|
||||
|
||||
@media (max-height: 500px) and (pointer: coarse) {
|
||||
.compressor-panels {
|
||||
padding: var(--space-1) var(--space-2);
|
||||
}
|
||||
|
||||
.compressor-section .channel-group {
|
||||
padding-top: 24px;
|
||||
}
|
||||
|
||||
.compressor-section .channel-group__label {
|
||||
top: 4px;
|
||||
font-size: var(--font-xs);
|
||||
}
|
||||
|
||||
.compressor-panel {
|
||||
width: clamp(240px, 30vw, 300px);
|
||||
}
|
||||
|
||||
.compressor-panel__title {
|
||||
padding-block: var(--space-1);
|
||||
font-size: 11px;
|
||||
}
|
||||
|
||||
.compressor-panel__grid {
|
||||
padding: var(--space-1);
|
||||
}
|
||||
}
|
||||
@@ -11,9 +11,9 @@ import './CompressorSection.css';
|
||||
import { RATIO_ORDER, RATIO_LABEL, KNEE_VALUES } from '../../constants';
|
||||
|
||||
const COMPRESSOR_SLIDER_PARAMS = [
|
||||
{ key: 'threshold', label: 'Threshold', min: -90, max: 20, step: 0.5, unit: ' dB' },
|
||||
{ key: 'attack', label: 'Attack', min: 1, max: 999, step: 1, unit: ' ms' },
|
||||
{ key: 'release', label: 'Release', min: 10, max: 3000, step: 1, unit: ' ms' },
|
||||
{ key: 'threshold', label: 'Threshold', short: 'Thr', min: -90, max: 20, step: 0.5, unit: ' dB' },
|
||||
{ key: 'attack', label: 'Attack', short: 'Atk', min: 1, max: 999, step: 1, unit: ' ms' },
|
||||
{ key: 'release', label: 'Release', short: 'Rel', min: 10, max: 3000, step: 1, unit: ' ms' },
|
||||
] as const;
|
||||
|
||||
type CompressorParamKey = 'ratio' | 'attack' | 'release' | 'knee' | 'threshold';
|
||||
@@ -35,6 +35,14 @@ type SetCompressorFn = (
|
||||
threshold: number
|
||||
) => Promise<boolean>;
|
||||
|
||||
// Phone only: one view at a time (CSS hides the tabs on desktop)
|
||||
type CompressorView = 'controls' | 'response';
|
||||
|
||||
const COMPRESSOR_VIEWS: { id: CompressorView; label: string }[] = [
|
||||
{ id: 'controls', label: 'Controls' },
|
||||
{ id: 'response', label: 'Compressor response' },
|
||||
];
|
||||
|
||||
function CompressorPanel({
|
||||
channel,
|
||||
dsp,
|
||||
@@ -74,7 +82,10 @@ function CompressorPanel({
|
||||
onChange={(value) => commit({ [param.key]: value } as Partial<CompressorValues>)}
|
||||
style={{ width: '100%', flex: '1 1 auto' }}
|
||||
/>
|
||||
<div className="compressor-panel__cell-label">{param.label}</div>
|
||||
<div className="compressor-panel__cell-label">
|
||||
<span className="compressor-panel__label-long">{param.label}</span>
|
||||
<span className="compressor-panel__label-short">{param.short}</span>
|
||||
</div>
|
||||
</div>
|
||||
))}
|
||||
|
||||
@@ -112,8 +123,6 @@ function CompressorPanel({
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
|
||||
function CompressorSection({ dsp, set_compressor }: { dsp: DSP; set_compressor: SetCompressorFn }) {
|
||||
const outputs = [
|
||||
OutputChannel.Out1,
|
||||
@@ -128,6 +137,7 @@ function CompressorSection({ dsp, set_compressor }: { dsp: DSP; set_compressor:
|
||||
|
||||
const [activeChannel, setActiveChannel] = useState<OutputChannel>(outputs[0]);
|
||||
const [liveComp, setLiveComp] = useState<Partial<Record<OutputChannel, CompressorValues>>>({});
|
||||
const [view, setView] = useState<CompressorView>('controls');
|
||||
|
||||
const handleLiveValue = (
|
||||
channel: OutputChannel,
|
||||
@@ -170,7 +180,28 @@ function CompressorSection({ dsp, set_compressor }: { dsp: DSP; set_compressor:
|
||||
const activeComp = liveComp[activeChannel] ?? (activeOutputState.compressor as CompressorValues);
|
||||
|
||||
return (
|
||||
<>
|
||||
<div className="compressor-page" data-view={view}>
|
||||
{/* Phone only (hidden on desktop by CSS): one view at a time */}
|
||||
<div className="compressor-tabs" role="tablist" aria-label="Compressor views">
|
||||
{COMPRESSOR_VIEWS.map((v) => (
|
||||
<button
|
||||
key={v.id}
|
||||
type="button"
|
||||
role="tab"
|
||||
aria-selected={view === v.id}
|
||||
className="compressor-tabs__tab"
|
||||
onClick={() => setView(v.id)}
|
||||
>
|
||||
{v.label}
|
||||
</button>
|
||||
))}
|
||||
</div>
|
||||
|
||||
{/* Portrait phone only (CSS): the graph needs the width of landscape */}
|
||||
<div className="compressor-rotate-hint">
|
||||
Rotate your phone to landscape to see the compressor graph.
|
||||
</div>
|
||||
|
||||
<div className="compressor-linear-graph-section">
|
||||
<div className="compressor-graph-panel">
|
||||
<div className="compressor-graph__title">{activeOutputState.name} - RMS Compressor</div>
|
||||
@@ -191,7 +222,7 @@ function CompressorSection({ dsp, set_compressor }: { dsp: DSP; set_compressor:
|
||||
key={output}
|
||||
label={outputState.name}
|
||||
meter={dsp.output_meters.meters[output]}
|
||||
variant='output'
|
||||
variant="output"
|
||||
/>
|
||||
);
|
||||
})}
|
||||
@@ -214,8 +245,8 @@ function CompressorSection({ dsp, set_compressor }: { dsp: DSP; set_compressor:
|
||||
</ChannelGroup>
|
||||
</div>
|
||||
</div>
|
||||
</>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
|
||||
export default CompressorSection;
|
||||
export default CompressorSection;
|
||||
@@ -15,12 +15,9 @@ function ConnectionPanel({
|
||||
onDisconnect: () => void;
|
||||
}) {
|
||||
|
||||
const statusLabel =
|
||||
isConnected(dsp)
|
||||
? 'Connected'
|
||||
: dsp.isConnecting
|
||||
? 'Connecting…'
|
||||
: 'Disconnected';
|
||||
const connected = isConnected(dsp);
|
||||
const status = dsp.isConnecting ? 'connecting' : connected ? 'connected' : 'disconnected';
|
||||
const statusLabel = { connecting: 'Connecting…', connected: 'Connected', disconnected: 'Disconnected' }[status];
|
||||
|
||||
return (
|
||||
<div className="connection-section">
|
||||
@@ -36,7 +33,7 @@ function ConnectionPanel({
|
||||
|
||||
<div className="connection-panel__status">
|
||||
<span className="connection-panel__led">
|
||||
<Led status={dsp.isConnecting ? "connecting" : isConnected(dsp) ? "connected" : "disconnected"} />
|
||||
<Led status={status} />
|
||||
</span>
|
||||
|
||||
<span>{statusLabel}</span>
|
||||
@@ -65,7 +62,7 @@ function ConnectionPanel({
|
||||
</dl>
|
||||
|
||||
<div className="connection-panel__actions">
|
||||
{isConnected(dsp) ? (
|
||||
{connected ? (
|
||||
<Button variant="outline" onClick={onDisconnect}>
|
||||
Disconnect
|
||||
</Button>
|
||||
|
||||
@@ -40,7 +40,7 @@
|
||||
display: none;
|
||||
}
|
||||
|
||||
@media (max-width: 768px) {
|
||||
@media (max-width: 768px), (max-height: 500px) and (pointer: coarse) {
|
||||
.dsp-content,
|
||||
.dsp-loading-overlay,
|
||||
.app-root:has(.sidebar-rail--expanded) .dsp-content,
|
||||
|
||||
@@ -1,3 +1,22 @@
|
||||
/* DelaySection.css */
|
||||
|
||||
/* ---------- Page wrapper ---------- */
|
||||
|
||||
.delay-page {
|
||||
display: contents; /* invisible on desktop; a flex column on phones */
|
||||
}
|
||||
|
||||
.delay-tabs,
|
||||
.delay-rotate-hint {
|
||||
display: none; /* phones only */
|
||||
}
|
||||
|
||||
.delay-graph-wrap {
|
||||
display: contents; /* invisible on desktop: the graphs stay direct flex children */
|
||||
}
|
||||
|
||||
/* ---------- Fader strip ---------- */
|
||||
|
||||
.delay-section {
|
||||
container-type: size;
|
||||
|
||||
@@ -80,6 +99,8 @@
|
||||
box-sizing: border-box;
|
||||
}
|
||||
|
||||
/* ---------- Graphs ---------- */
|
||||
|
||||
.delay-linear-graph-section {
|
||||
flex: 0 0 calc(100% - var(--dsp-control-heigth));
|
||||
min-height: 0;
|
||||
@@ -123,3 +144,337 @@
|
||||
flex: 1;
|
||||
min-height: 0;
|
||||
}
|
||||
|
||||
/* ---------- Phone (shared) ----------
|
||||
Landscape: tabs (Faders / Input delay / Output delay), one view at a time.
|
||||
Portrait: faders only + a hint to rotate for the graphs. */
|
||||
|
||||
@media (max-width: 768px), (max-height: 500px) and (pointer: coarse) {
|
||||
.delay-page {
|
||||
flex: 1 1 0;
|
||||
min-height: 0;
|
||||
width: 100%;
|
||||
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
background: var(--bg-panel);
|
||||
}
|
||||
|
||||
/* ----- Tabs ----- */
|
||||
|
||||
.delay-tabs {
|
||||
flex: 0 0 auto;
|
||||
display: flex;
|
||||
gap: var(--space-1);
|
||||
padding: var(--space-1) var(--space-2);
|
||||
border-bottom: var(--border-width) solid var(--border-hairline);
|
||||
}
|
||||
|
||||
.delay-page .delay-tabs__tab {
|
||||
flex: 1 1 0;
|
||||
min-width: 0;
|
||||
min-height: 0;
|
||||
height: 34px;
|
||||
padding: 0 var(--space-2);
|
||||
|
||||
font-family: var(--font-ui);
|
||||
font-size: var(--font-xs);
|
||||
font-weight: var(--font-weight-semibold);
|
||||
white-space: nowrap;
|
||||
overflow: hidden;
|
||||
text-overflow: ellipsis;
|
||||
|
||||
background: var(--bg-void);
|
||||
color: var(--text-muted);
|
||||
border: var(--border-width) solid var(--border-hairline);
|
||||
border-radius: var(--radius-sm);
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
.delay-page .delay-tabs__tab[aria-selected='true'] {
|
||||
background: var(--bg-raised);
|
||||
color: var(--text-primary);
|
||||
border-color: var(--accent-brand);
|
||||
}
|
||||
|
||||
/* ----- Which view is visible ----- */
|
||||
|
||||
.delay-page[data-view='faders'] .delay-linear-graph-section,
|
||||
.delay-page:not([data-view='faders']) .delay-section,
|
||||
.delay-page[data-view='input'] .delay-graph-wrap[data-panel='output'],
|
||||
.delay-page[data-view='output'] .delay-graph-wrap[data-panel='input'] {
|
||||
display: none;
|
||||
}
|
||||
|
||||
/* ----- Curve views: graph fills everything ----- */
|
||||
|
||||
.delay-linear-graph-section {
|
||||
flex: 1 1 0;
|
||||
min-height: 0;
|
||||
flex-direction: column;
|
||||
gap: 0;
|
||||
padding: var(--space-1);
|
||||
}
|
||||
|
||||
.delay-graph-wrap {
|
||||
flex: 1 1 0;
|
||||
min-height: 0;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
}
|
||||
|
||||
.delay-graph-wrap .delay-graph-panel {
|
||||
flex: 1 1 0;
|
||||
height: auto;
|
||||
}
|
||||
|
||||
.delay-graph-title {
|
||||
display: none; /* the tab already says which graph this is */
|
||||
}
|
||||
|
||||
/* ----- Faders view: mixer strips, swipe sideways, snap per group ----- */
|
||||
|
||||
.delay-section {
|
||||
position: relative;
|
||||
z-index: auto;
|
||||
flex: 1 1 0;
|
||||
height: auto;
|
||||
min-height: 0;
|
||||
|
||||
align-items: stretch;
|
||||
justify-content: flex-start;
|
||||
border-top: none;
|
||||
}
|
||||
|
||||
.delay-panels {
|
||||
display: flex;
|
||||
justify-content: flex-start; /* desktop's "center" would clip the left side on overflow */
|
||||
width: 100%;
|
||||
min-width: 0;
|
||||
height: auto;
|
||||
gap: var(--space-3);
|
||||
padding: var(--space-2);
|
||||
box-sizing: border-box;
|
||||
|
||||
overflow-x: auto;
|
||||
overflow-y: hidden;
|
||||
scroll-snap-type: x proximity;
|
||||
overscroll-behavior-x: contain;
|
||||
-webkit-overflow-scrolling: touch;
|
||||
}
|
||||
|
||||
.delay-section .channel-group {
|
||||
flex: 0 0 auto;
|
||||
width: max-content;
|
||||
max-width: none;
|
||||
margin: 0;
|
||||
padding: 30px var(--space-2) var(--space-2);
|
||||
scroll-snap-align: start;
|
||||
}
|
||||
|
||||
.delay-section .channel-group__label {
|
||||
top: 7px;
|
||||
font-size: var(--font-sm);
|
||||
}
|
||||
|
||||
.delay-section .channel-group__items {
|
||||
height: auto;
|
||||
align-self: stretch;
|
||||
justify-content: flex-start;
|
||||
overflow: visible; /* no nested scroller: it would fight with .delay-panels */
|
||||
}
|
||||
|
||||
/* Centered when everything fits, left-aligned and scrollable when it doesn't */
|
||||
.delay-panels > .channel-group:first-child {
|
||||
margin-left: auto;
|
||||
}
|
||||
|
||||
.delay-panels > .channel-group:last-child {
|
||||
margin-right: auto;
|
||||
}
|
||||
|
||||
.delay-panel {
|
||||
flex: 0 0 auto;
|
||||
width: clamp(72px, 10vw, 90px);
|
||||
height: auto; /* stretches to the row */
|
||||
aspect-ratio: auto;
|
||||
gap: var(--space-2);
|
||||
padding-bottom: var(--space-2);
|
||||
}
|
||||
|
||||
.delay-panel__title {
|
||||
padding-block: var(--space-2);
|
||||
font-size: var(--font-xs);
|
||||
}
|
||||
|
||||
/* The fader (element right after the title) takes all remaining height.
|
||||
pan-x: vertical drags move the fader, horizontal swipes still scroll the strip. */
|
||||
.delay-panel__title + * {
|
||||
flex: 1 1 0;
|
||||
min-height: 0;
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
.delay-panel__title + *,
|
||||
.delay-panel__title + * * {
|
||||
touch-action: pan-x !important;
|
||||
}
|
||||
|
||||
/* Unit selector: ms / m / ft stacked */
|
||||
.delay-unit-selector {
|
||||
width: 72px;
|
||||
height: auto;
|
||||
align-self: center;
|
||||
gap: var(--space-2);
|
||||
}
|
||||
|
||||
.delay-unit-selector .delay-unit-selector__btn {
|
||||
width: 100% !important;
|
||||
min-height: 44px !important;
|
||||
padding: 0 !important;
|
||||
font-size: var(--font-xs) !important;
|
||||
}
|
||||
}
|
||||
|
||||
/* ---------- Portrait phone: faders only, Input row + Output row + Unit row ---------- */
|
||||
|
||||
@media (max-width: 768px) and (orientation: portrait) {
|
||||
.delay-tabs {
|
||||
display: none;
|
||||
}
|
||||
|
||||
.delay-rotate-hint {
|
||||
flex: 0 0 auto;
|
||||
display: block;
|
||||
padding: var(--space-2) var(--space-3);
|
||||
|
||||
font-family: var(--font-ui);
|
||||
font-size: var(--font-xs);
|
||||
text-align: center;
|
||||
color: var(--text-muted);
|
||||
|
||||
border-bottom: var(--border-width) solid var(--border-hairline);
|
||||
}
|
||||
|
||||
/* Whatever tab was active in landscape, portrait always shows the faders */
|
||||
.delay-page[data-view] .delay-linear-graph-section {
|
||||
display: none;
|
||||
}
|
||||
|
||||
.delay-page[data-view] .delay-section {
|
||||
display: flex;
|
||||
}
|
||||
|
||||
/* Rows: Input on top, Output below (scrolls on its own), Unit at the bottom */
|
||||
.delay-panels {
|
||||
flex-direction: column;
|
||||
gap: var(--space-2);
|
||||
overflow: hidden;
|
||||
scroll-snap-type: none;
|
||||
}
|
||||
|
||||
.delay-section .channel-group {
|
||||
flex: 1 1 0;
|
||||
min-height: 0;
|
||||
width: 100%;
|
||||
box-sizing: border-box;
|
||||
padding: 28px var(--space-2) var(--space-2);
|
||||
scroll-snap-align: none;
|
||||
}
|
||||
|
||||
/* Input and Output rows are their own size containers: everything the slider
|
||||
sizes in cqh (thumb, track, readout) scales to the row height, like in landscape. */
|
||||
.delay-section .channel-group:not(:last-child) {
|
||||
container-type: size;
|
||||
}
|
||||
|
||||
.delay-section .channel-group__label {
|
||||
top: 6px;
|
||||
font-size: var(--font-xs);
|
||||
}
|
||||
|
||||
.delay-section .channel-group__items {
|
||||
flex: 1 1 auto;
|
||||
width: 100%;
|
||||
min-width: 0;
|
||||
gap: var(--space-1);
|
||||
|
||||
overflow-x: auto;
|
||||
overflow-y: hidden;
|
||||
scroll-snap-type: x proximity;
|
||||
overscroll-behavior-x: contain;
|
||||
-webkit-overflow-scrolling: touch;
|
||||
}
|
||||
|
||||
.delay-section .channel-group__items > :first-child {
|
||||
margin-left: auto;
|
||||
}
|
||||
|
||||
.delay-section .channel-group__items > :last-child {
|
||||
margin-right: auto;
|
||||
}
|
||||
|
||||
.delay-panel {
|
||||
width: clamp(64px, 18vw, 76px);
|
||||
gap: var(--space-1);
|
||||
padding-bottom: var(--space-1);
|
||||
scroll-snap-align: start;
|
||||
}
|
||||
|
||||
.delay-panel__title {
|
||||
padding-block: var(--space-1);
|
||||
font-size: 11px;
|
||||
}
|
||||
|
||||
/* Unit row: compact, buttons side by side, sized by its content */
|
||||
.delay-section .channel-group:last-child {
|
||||
flex: 0 0 auto;
|
||||
padding-top: 24px;
|
||||
}
|
||||
|
||||
.delay-unit-selector {
|
||||
flex-direction: row;
|
||||
width: 100%;
|
||||
gap: var(--space-2);
|
||||
align-self: stretch;
|
||||
}
|
||||
|
||||
.delay-unit-selector .delay-unit-selector__btn {
|
||||
flex: 1 1 0;
|
||||
min-height: 36px !important;
|
||||
font-size: 11px !important;
|
||||
}
|
||||
}
|
||||
|
||||
/* ---------- Landscape phone: thinner strips ---------- */
|
||||
|
||||
@media (max-height: 500px) and (pointer: coarse) {
|
||||
.delay-panels {
|
||||
padding: var(--space-1) var(--space-2);
|
||||
}
|
||||
|
||||
.delay-section .channel-group {
|
||||
padding-top: 24px;
|
||||
}
|
||||
|
||||
.delay-section .channel-group__label {
|
||||
top: 4px;
|
||||
font-size: var(--font-xs);
|
||||
}
|
||||
|
||||
.delay-panel {
|
||||
width: clamp(64px, 8vw, 84px);
|
||||
gap: var(--space-1);
|
||||
padding-bottom: var(--space-1);
|
||||
}
|
||||
|
||||
.delay-panel__title {
|
||||
padding-block: var(--space-1);
|
||||
font-size: 11px;
|
||||
}
|
||||
|
||||
.delay-unit-selector .delay-unit-selector__btn {
|
||||
min-height: 36px !important;
|
||||
font-size: 11px !important;
|
||||
}
|
||||
}
|
||||
@@ -19,6 +19,15 @@ const DELAY_STEP: Record<DelayUnit, number> = {
|
||||
|
||||
type SetDelayFn = (channel: Channel, delay: number) => Promise<boolean>;
|
||||
|
||||
// Phone only: one view at a time (CSS hides the tabs on desktop)
|
||||
type DelayView = 'faders' | 'input' | 'output';
|
||||
|
||||
const DELAY_VIEWS: { id: DelayView; label: string }[] = [
|
||||
{ id: 'faders', label: 'Faders' },
|
||||
{ id: 'input', label: 'Input delay' },
|
||||
{ id: 'output', label: 'Output delay' },
|
||||
];
|
||||
|
||||
function channelKey(channel: Channel): string {
|
||||
return 'Input' in channel ? `Input:${channel.Input}` : `Output:${channel.Output}`;
|
||||
}
|
||||
@@ -76,7 +85,7 @@ function DelayUnitSelector({
|
||||
<Button
|
||||
key={u}
|
||||
variant="toggle"
|
||||
className={u === unit ? 'active-info' : ''}
|
||||
className={`delay-unit-selector__btn${u === unit ? ' active-info' : ''}`}
|
||||
onClick={() => onSelect(u)}
|
||||
style={{
|
||||
width: '100%',
|
||||
@@ -123,6 +132,7 @@ function DelaySection({
|
||||
];
|
||||
|
||||
const [liveDelay, setLiveDelay] = useState<Partial<Record<string, number>>>({});
|
||||
const [view, setView] = useState<DelayView>('faders');
|
||||
|
||||
const handleLiveValue = (channel: Channel, value: number) => {
|
||||
setLiveDelay((prev) => ({
|
||||
@@ -181,10 +191,35 @@ function DelaySection({
|
||||
}));
|
||||
|
||||
return (
|
||||
<>
|
||||
<div className="delay-page" data-view={view}>
|
||||
{/* Phone only (hidden on desktop by CSS): one view at a time */}
|
||||
<div className="delay-tabs" role="tablist" aria-label="Delay views">
|
||||
{DELAY_VIEWS.map((v) => (
|
||||
<button
|
||||
key={v.id}
|
||||
type="button"
|
||||
role="tab"
|
||||
aria-selected={view === v.id}
|
||||
className="delay-tabs__tab"
|
||||
onClick={() => setView(v.id)}
|
||||
>
|
||||
{v.label}
|
||||
</button>
|
||||
))}
|
||||
</div>
|
||||
|
||||
{/* Portrait phone only (CSS): graphs need the width of landscape */}
|
||||
<div className="delay-rotate-hint">
|
||||
Rotate your phone to landscape to see the delay graphs.
|
||||
</div>
|
||||
|
||||
<div className="delay-linear-graph-section">
|
||||
<DelayGraph title="Input Delay" rows={inputRows} unit={unit} />
|
||||
<DelayGraph title="Output Delay" rows={outputRows} unit={unit} />
|
||||
<div className="delay-graph-wrap" data-panel="input">
|
||||
<DelayGraph title="Input Delay" rows={inputRows} unit={unit} />
|
||||
</div>
|
||||
<div className="delay-graph-wrap" data-panel="output">
|
||||
<DelayGraph title="Output Delay" rows={outputRows} unit={unit} />
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div className="delay-section">
|
||||
@@ -218,8 +253,8 @@ function DelaySection({
|
||||
</ChannelGroup>
|
||||
</div>
|
||||
</div>
|
||||
</>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
|
||||
export default DelaySection;
|
||||
export default DelaySection;
|
||||
@@ -1,3 +1,24 @@
|
||||
/* ---------- Page wrapper ---------- */
|
||||
|
||||
.gain-page {
|
||||
display: contents; /* invisible on desktop; a flex column on phones */
|
||||
}
|
||||
|
||||
.gain-tabs,
|
||||
.gain-rotate-hint {
|
||||
display: none; /* phones only */
|
||||
}
|
||||
|
||||
.gain-panel__btns {
|
||||
display: contents; /* desktop: buttons stay direct children of the panel */
|
||||
}
|
||||
|
||||
.gain-panel__btn-short {
|
||||
display: none;
|
||||
}
|
||||
|
||||
/* ---------- Fader strip ---------- */
|
||||
|
||||
.gain-section {
|
||||
container-type: size;
|
||||
|
||||
@@ -5,6 +26,7 @@
|
||||
left: 0;
|
||||
right: 0;
|
||||
bottom: 0;
|
||||
z-index: 20;
|
||||
|
||||
height: var(--dsp-control-heigth);
|
||||
|
||||
@@ -13,12 +35,9 @@
|
||||
justify-content: center;
|
||||
|
||||
box-sizing: border-box;
|
||||
|
||||
background: var(--bg-panel);
|
||||
|
||||
z-index: 20;
|
||||
|
||||
border-top: var(--border-width) solid var(--border-hairline);
|
||||
|
||||
user-select: none;
|
||||
-webkit-user-select: none;
|
||||
}
|
||||
@@ -33,39 +52,50 @@
|
||||
|
||||
.gain-panel {
|
||||
position: relative;
|
||||
flex: 0 0 auto;
|
||||
height: 100%;
|
||||
aspect-ratio: 1 / 4;
|
||||
flex: 0 0 auto;
|
||||
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
align-items: center;
|
||||
justify-content: flex-start;
|
||||
gap: 2cqh;
|
||||
|
||||
padding-bottom: 2cqh;
|
||||
box-sizing: border-box;
|
||||
|
||||
background: var(--bg-void);
|
||||
border: var(--border-width) solid var(--border-hairline);
|
||||
border-radius: var(--radius-md);
|
||||
box-sizing: border-box;
|
||||
gap: 2cqh;
|
||||
background: var(--bg-void);
|
||||
padding-bottom: 2cqh;
|
||||
}
|
||||
|
||||
.gain-panel__title {
|
||||
flex: 0 0 auto;
|
||||
width: 100%;
|
||||
text-align: center;
|
||||
min-width: 0;
|
||||
|
||||
padding-block: 2cqh;
|
||||
|
||||
font-family: var(--font-ui);
|
||||
font-size: 4cqh;
|
||||
font-weight: var(--font-weight-semibold);
|
||||
padding-top: 2cqh;
|
||||
padding-bottom: 2cqh;
|
||||
border-bottom: var(--border-width) solid var(--border-hairline);
|
||||
text-align: center;
|
||||
|
||||
min-width: 0;
|
||||
border-bottom: var(--border-width) solid var(--border-hairline);
|
||||
overflow: hidden;
|
||||
text-overflow: ellipsis;
|
||||
}
|
||||
|
||||
.gain-panel .gain-panel__btn {
|
||||
width: 85%;
|
||||
min-height: 0;
|
||||
padding: 2cqh 0;
|
||||
font-size: 4cqh;
|
||||
}
|
||||
|
||||
/* ---------- Graphs ---------- */
|
||||
|
||||
.gain-linear-graph-section {
|
||||
flex: 0 0 calc(100% - var(--dsp-control-heigth));
|
||||
min-height: 0;
|
||||
@@ -94,17 +124,6 @@
|
||||
border-radius: var(--radius-md);
|
||||
}
|
||||
|
||||
.gain-graph-title {
|
||||
flex: 0 0 auto;
|
||||
|
||||
text-align: center;
|
||||
padding: 1cqh;
|
||||
|
||||
font-family: var(--font-ui);
|
||||
font-size: 2.5cqh;
|
||||
font-weight: var(--font-weight-semibold);
|
||||
}
|
||||
|
||||
.gain-graph-panel > .container {
|
||||
flex: 1;
|
||||
min-height: 0;
|
||||
@@ -112,42 +131,49 @@
|
||||
|
||||
.gain-graph-title-row {
|
||||
flex: 0 0 auto;
|
||||
min-width: 0;
|
||||
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
align-items: stretch;
|
||||
|
||||
gap: 0.75cqh;
|
||||
padding: 1cqh 1.5cqh;
|
||||
|
||||
min-width: 0;
|
||||
padding: 1cqh 1.5cqh;
|
||||
overflow: hidden;
|
||||
}
|
||||
|
||||
/* First row: title left, Show stages right */
|
||||
/* Title left, "Show stages" right */
|
||||
.gain-graph-title-line {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: space-between;
|
||||
gap: 1cqh;
|
||||
|
||||
width: 100%;
|
||||
min-width: 0;
|
||||
gap: 1cqh;
|
||||
}
|
||||
|
||||
.gain-graph-title {
|
||||
flex: 0 0 auto;
|
||||
padding: 1cqh;
|
||||
|
||||
font-family: var(--font-ui);
|
||||
font-size: 2.5cqh;
|
||||
font-weight: var(--font-weight-semibold);
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
.gain-graph-title-line .gain-graph-title {
|
||||
flex: 1 1 auto;
|
||||
min-width: 0;
|
||||
|
||||
padding: 0;
|
||||
|
||||
text-align: left;
|
||||
white-space: nowrap;
|
||||
overflow: hidden;
|
||||
text-overflow: ellipsis;
|
||||
white-space: nowrap;
|
||||
}
|
||||
|
||||
/* Compact button on the right */
|
||||
.gain-stages-toggle {
|
||||
flex: 0 0 auto;
|
||||
|
||||
@@ -157,11 +183,11 @@
|
||||
padding: 0.4cqh 1cqh;
|
||||
font-size: 1.8cqh;
|
||||
line-height: 1.2;
|
||||
|
||||
white-space: nowrap;
|
||||
}
|
||||
|
||||
/* Channel Selector */
|
||||
/* ---------- Channel selector ---------- */
|
||||
|
||||
.magnitude-selector {
|
||||
width: 100%;
|
||||
min-width: 0;
|
||||
@@ -169,7 +195,6 @@
|
||||
display: flex;
|
||||
align-items: center;
|
||||
flex-wrap: nowrap;
|
||||
|
||||
gap: 0.5cqh;
|
||||
|
||||
overflow: hidden;
|
||||
@@ -183,24 +208,21 @@
|
||||
|
||||
display: flex;
|
||||
align-items: center;
|
||||
|
||||
gap: 0.6cqh;
|
||||
|
||||
font-family: var(--font-ui);
|
||||
font-size: 1.8cqh;
|
||||
|
||||
padding: 0.4cqh 1cqh;
|
||||
|
||||
font-family: var(--font-ui);
|
||||
font-size: 1.8cqh;
|
||||
white-space: nowrap;
|
||||
|
||||
background: var(--bg-void);
|
||||
color: var(--text-muted);
|
||||
|
||||
border: var(--border-width) solid var(--border-hairline);
|
||||
border-radius: var(--radius-sm);
|
||||
|
||||
cursor: pointer;
|
||||
opacity: 0.5;
|
||||
|
||||
white-space: nowrap;
|
||||
cursor: pointer;
|
||||
overflow: hidden;
|
||||
}
|
||||
|
||||
@@ -211,19 +233,384 @@
|
||||
}
|
||||
|
||||
.magnitude-selector__swatch {
|
||||
flex: 0 0 auto;
|
||||
width: 1.2cqh;
|
||||
height: 1.2cqh;
|
||||
|
||||
border-radius: 50%;
|
||||
background: var(--chip-color);
|
||||
|
||||
flex: 0 0 auto;
|
||||
}
|
||||
|
||||
.magnitude-selector__label {
|
||||
min-width: 0;
|
||||
|
||||
white-space: nowrap;
|
||||
overflow: hidden;
|
||||
text-overflow: ellipsis;
|
||||
white-space: nowrap;
|
||||
}
|
||||
|
||||
/* ---------- Phone (shared) ----------
|
||||
Landscape: tabs (Faders / Input curve / Output curve), one view at a time.
|
||||
Portrait: faders only + a hint to rotate for the graphs. */
|
||||
|
||||
@media (max-width: 768px), (max-height: 500px) and (pointer: coarse) {
|
||||
.gain-page {
|
||||
flex: 1 1 0;
|
||||
min-height: 0;
|
||||
width: 100%;
|
||||
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
background: var(--bg-panel);
|
||||
}
|
||||
|
||||
/* ----- Tabs ----- */
|
||||
|
||||
.gain-tabs {
|
||||
flex: 0 0 auto;
|
||||
display: flex;
|
||||
gap: var(--space-1);
|
||||
padding: var(--space-1) var(--space-2);
|
||||
border-bottom: var(--border-width) solid var(--border-hairline);
|
||||
}
|
||||
|
||||
.gain-page .gain-tabs__tab {
|
||||
flex: 1 1 0;
|
||||
min-width: 0;
|
||||
min-height: 0;
|
||||
height: 34px;
|
||||
padding: 0 var(--space-2);
|
||||
|
||||
font-family: var(--font-ui);
|
||||
font-size: var(--font-xs);
|
||||
font-weight: var(--font-weight-semibold);
|
||||
white-space: nowrap;
|
||||
overflow: hidden;
|
||||
text-overflow: ellipsis;
|
||||
|
||||
background: var(--bg-void);
|
||||
color: var(--text-muted);
|
||||
border: var(--border-width) solid var(--border-hairline);
|
||||
border-radius: var(--radius-sm);
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
.gain-page .gain-tabs__tab[aria-selected='true'] {
|
||||
background: var(--bg-raised);
|
||||
color: var(--text-primary);
|
||||
border-color: var(--accent-brand);
|
||||
}
|
||||
|
||||
/* ----- Which view is visible ----- */
|
||||
|
||||
.gain-page[data-view='faders'] .gain-linear-graph-section,
|
||||
.gain-page:not([data-view='faders']) .gain-section,
|
||||
.gain-page[data-view='input'] .gain-graph-panel[data-panel='output'],
|
||||
.gain-page[data-view='output'] .gain-graph-panel[data-panel='input'] {
|
||||
display: none;
|
||||
}
|
||||
|
||||
/* ----- Curve views: graph fills everything ----- */
|
||||
|
||||
.gain-linear-graph-section {
|
||||
flex: 1 1 0;
|
||||
min-height: 0;
|
||||
flex-direction: column;
|
||||
gap: 0;
|
||||
padding: var(--space-1);
|
||||
}
|
||||
|
||||
.gain-graph-panel {
|
||||
flex: 1 1 0;
|
||||
height: auto;
|
||||
}
|
||||
|
||||
/* Compact header: chips scroll on the left, "Show stages" on the right */
|
||||
.gain-graph-title-row {
|
||||
flex-direction: row;
|
||||
align-items: center;
|
||||
gap: var(--space-2);
|
||||
padding: var(--space-1) var(--space-2);
|
||||
}
|
||||
|
||||
.gain-graph-title-line {
|
||||
order: 2;
|
||||
flex: 0 0 auto;
|
||||
width: auto;
|
||||
}
|
||||
|
||||
.gain-graph-title-line .gain-graph-title {
|
||||
display: none; /* the tab already says which graph this is */
|
||||
}
|
||||
|
||||
.gain-stages-toggle {
|
||||
min-height: 0;
|
||||
height: 32px;
|
||||
padding: 0 var(--space-3);
|
||||
font-size: var(--font-xs);
|
||||
}
|
||||
|
||||
.magnitude-selector {
|
||||
order: 1;
|
||||
flex: 1 1 auto;
|
||||
width: auto;
|
||||
gap: var(--space-1);
|
||||
|
||||
overflow-x: auto;
|
||||
overflow-y: hidden;
|
||||
scrollbar-width: none;
|
||||
-webkit-overflow-scrolling: touch;
|
||||
}
|
||||
|
||||
.magnitude-selector::-webkit-scrollbar {
|
||||
display: none;
|
||||
}
|
||||
|
||||
.magnitude-selector__chip {
|
||||
flex: 0 0 auto;
|
||||
min-height: 0;
|
||||
height: 32px;
|
||||
padding: 0 var(--space-3);
|
||||
gap: var(--space-2);
|
||||
font-size: var(--font-xs);
|
||||
}
|
||||
|
||||
.magnitude-selector__swatch {
|
||||
width: 10px;
|
||||
height: 10px;
|
||||
}
|
||||
|
||||
/* ----- Faders view: mixer strips, swipe sideways, snap per group ----- */
|
||||
|
||||
.gain-section {
|
||||
position: relative;
|
||||
z-index: auto;
|
||||
flex: 1 1 0;
|
||||
height: auto;
|
||||
min-height: 0;
|
||||
|
||||
align-items: stretch;
|
||||
justify-content: flex-start;
|
||||
border-top: none;
|
||||
}
|
||||
|
||||
.gain-panels {
|
||||
display: flex;
|
||||
width: 100%;
|
||||
gap: var(--space-3);
|
||||
padding: var(--space-2);
|
||||
box-sizing: border-box;
|
||||
|
||||
overflow-x: auto;
|
||||
overflow-y: hidden;
|
||||
scroll-snap-type: x proximity;
|
||||
overscroll-behavior-x: contain;
|
||||
-webkit-overflow-scrolling: touch;
|
||||
}
|
||||
|
||||
.gain-section .channel-group {
|
||||
flex: 0 0 auto;
|
||||
margin: 0;
|
||||
padding: 30px var(--space-2) var(--space-2);
|
||||
scroll-snap-align: start;
|
||||
}
|
||||
|
||||
.gain-section .channel-group__label {
|
||||
top: 7px;
|
||||
font-size: var(--font-sm);
|
||||
}
|
||||
|
||||
.gain-section .channel-group__items {
|
||||
height: auto;
|
||||
align-self: stretch;
|
||||
}
|
||||
|
||||
.gain-panel {
|
||||
flex: 0 0 auto;
|
||||
width: clamp(64px, 10vw, 80px);
|
||||
height: auto; /* stretches to the row */
|
||||
aspect-ratio: auto;
|
||||
gap: var(--space-2);
|
||||
padding-bottom: var(--space-2);
|
||||
}
|
||||
|
||||
.gain-panel__title {
|
||||
padding-block: var(--space-2);
|
||||
font-size: var(--font-xs);
|
||||
}
|
||||
|
||||
/* The fader (element right after the title) takes all remaining height.
|
||||
pan-x: vertical drags move the fader, horizontal swipes still scroll the strip. */
|
||||
.gain-panel__title + * {
|
||||
flex: 1 1 0;
|
||||
min-height: 0;
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
/* Applied to the thumb/track too: a swipe that starts on them must scroll the
|
||||
strip, not drag the fader. */
|
||||
.gain-panel__title + *,
|
||||
.gain-panel__title + * * {
|
||||
touch-action: pan-x !important;
|
||||
}
|
||||
|
||||
/* Centered when everything fits, left-aligned and scrollable when it doesn't
|
||||
(auto margins collapse to 0 on overflow, unlike justify-content: center) */
|
||||
.gain-panels > .channel-group:first-child {
|
||||
margin-left: auto;
|
||||
}
|
||||
|
||||
.gain-panels > .channel-group:last-child {
|
||||
margin-right: auto;
|
||||
}
|
||||
|
||||
.gain-panel__btns {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
gap: var(--space-2);
|
||||
width: calc(100% - var(--space-3));
|
||||
}
|
||||
|
||||
.gain-panel .gain-panel__btns .gain-panel__btn {
|
||||
flex: 1 1 auto;
|
||||
width: 100%;
|
||||
min-height: 44px;
|
||||
padding: 0;
|
||||
font-size: var(--font-xs);
|
||||
}
|
||||
}
|
||||
|
||||
/* ---------- Portrait phone: faders only, 2 rows (Input on top, Output below) ---------- */
|
||||
|
||||
@media (max-width: 768px) and (orientation: portrait) {
|
||||
.gain-tabs {
|
||||
display: none;
|
||||
}
|
||||
|
||||
.gain-rotate-hint {
|
||||
flex: 0 0 auto;
|
||||
display: block;
|
||||
padding: var(--space-2) var(--space-3);
|
||||
|
||||
font-family: var(--font-ui);
|
||||
font-size: var(--font-xs);
|
||||
text-align: center;
|
||||
color: var(--text-muted);
|
||||
|
||||
border-bottom: var(--border-width) solid var(--border-hairline);
|
||||
}
|
||||
|
||||
/* Whatever tab was active in landscape, portrait always shows the faders */
|
||||
.gain-page[data-view] .gain-linear-graph-section {
|
||||
display: none;
|
||||
}
|
||||
|
||||
.gain-page[data-view] .gain-section {
|
||||
display: flex;
|
||||
}
|
||||
|
||||
/* Two rows: each group is a row that scrolls sideways on its own */
|
||||
.gain-panels {
|
||||
flex-direction: column;
|
||||
gap: var(--space-2);
|
||||
overflow: hidden;
|
||||
scroll-snap-type: none;
|
||||
}
|
||||
|
||||
/* Each row is its own size container: everything sized in cqh inside
|
||||
(fader thumb, track, readout) scales to the row height, like in landscape,
|
||||
instead of to the whole screen. */
|
||||
.gain-section .channel-group {
|
||||
container-type: size;
|
||||
flex: 1 1 0;
|
||||
min-height: 0;
|
||||
width: 100%;
|
||||
box-sizing: border-box;
|
||||
padding: 28px var(--space-2) var(--space-2);
|
||||
scroll-snap-align: none;
|
||||
}
|
||||
|
||||
.gain-section .channel-group__label {
|
||||
top: 6px;
|
||||
font-size: var(--font-xs);
|
||||
}
|
||||
|
||||
.gain-section .channel-group__items {
|
||||
flex: 1 1 auto;
|
||||
width: 100%;
|
||||
min-width: 0;
|
||||
gap: var(--space-1);
|
||||
|
||||
overflow-x: auto;
|
||||
overflow-y: hidden;
|
||||
scroll-snap-type: x proximity;
|
||||
overscroll-behavior-x: contain;
|
||||
-webkit-overflow-scrolling: touch;
|
||||
}
|
||||
|
||||
.gain-section .channel-group__items > :first-child {
|
||||
margin-left: auto;
|
||||
}
|
||||
|
||||
.gain-section .channel-group__items > :last-child {
|
||||
margin-right: auto;
|
||||
}
|
||||
|
||||
/* Same strip as landscape: narrow, compact, buttons stacked */
|
||||
.gain-panel {
|
||||
width: clamp(60px, 17vw, 72px);
|
||||
gap: var(--space-1);
|
||||
padding-bottom: var(--space-1);
|
||||
scroll-snap-align: start;
|
||||
}
|
||||
|
||||
.gain-panel__title {
|
||||
padding-block: var(--space-1);
|
||||
font-size: 11px;
|
||||
}
|
||||
|
||||
.gain-panel__btns {
|
||||
gap: var(--space-1);
|
||||
}
|
||||
|
||||
.gain-panel .gain-panel__btns .gain-panel__btn {
|
||||
min-height: 36px;
|
||||
font-size: 11px;
|
||||
}
|
||||
}
|
||||
|
||||
/* ---------- Landscape phone: thinner strips, buttons stacked ---------- */
|
||||
|
||||
@media (max-height: 500px) and (pointer: coarse) {
|
||||
.gain-panels {
|
||||
padding: var(--space-1) var(--space-2);
|
||||
}
|
||||
|
||||
.gain-section .channel-group {
|
||||
padding-top: 24px;
|
||||
}
|
||||
|
||||
.gain-section .channel-group__label {
|
||||
top: 4px;
|
||||
font-size: var(--font-xs);
|
||||
}
|
||||
|
||||
.gain-panel {
|
||||
width: clamp(56px, 7.5vw, 76px);
|
||||
gap: var(--space-1);
|
||||
padding-bottom: var(--space-1);
|
||||
}
|
||||
|
||||
.gain-panel__title {
|
||||
padding-block: var(--space-1);
|
||||
font-size: 11px;
|
||||
}
|
||||
|
||||
.gain-panel__btns {
|
||||
gap: var(--space-1);
|
||||
}
|
||||
|
||||
.gain-panel .gain-panels .gain-panel__btn,
|
||||
.gain-panel .gain-panel__btns .gain-panel__btn {
|
||||
min-height: 36px;
|
||||
font-size: 11px;
|
||||
}
|
||||
}
|
||||
@@ -19,6 +19,34 @@ import { getPeqCurvePoints } from '../../utils/graph/peq';
|
||||
import { getCrossoverCurvePoints } from '../../utils/graph/crossover';
|
||||
import { ChannelCurves, formatY, ResponseGraph } from './GainGraph';
|
||||
|
||||
// ---- Helpers ------------------------------------------------------------
|
||||
|
||||
type GainView = 'faders' | 'input' | 'output';
|
||||
|
||||
const GAIN_VIEWS: { id: GainView; label: string }[] = [
|
||||
{ id: 'faders', label: 'Faders' },
|
||||
{ id: 'input', label: 'Input curve' },
|
||||
{ id: 'output', label: 'Output curve' },
|
||||
];
|
||||
|
||||
function toggleInSet<T>(set: Set<T>, value: T): Set<T> {
|
||||
const next = new Set(set);
|
||||
if (next.has(value)) next.delete(value);
|
||||
else next.add(value);
|
||||
return next;
|
||||
}
|
||||
|
||||
function withLiveValue<K extends string | number>(
|
||||
prev: Partial<Record<K, number>>,
|
||||
key: K,
|
||||
value: number | null
|
||||
): Partial<Record<K, number>> {
|
||||
const next = { ...prev };
|
||||
if (value === null) delete next[key];
|
||||
else next[key] = value;
|
||||
return next;
|
||||
}
|
||||
|
||||
// ---- Curve construction -----------------------------------------------
|
||||
|
||||
function getGainCurvePoints(freqs: number[], gainDb: number): CurvePoint[] {
|
||||
@@ -131,15 +159,9 @@ function GainPanel({
|
||||
await setInverse(channel, !inverted);
|
||||
};
|
||||
|
||||
const handleLiveValue = (value: number) => {
|
||||
onLiveGain(value);
|
||||
};
|
||||
|
||||
const commitGain = async (value: number) => {
|
||||
const success = await setGain(channel, value);
|
||||
if (success) {
|
||||
onLiveGain(null);
|
||||
}
|
||||
if (success) onLiveGain(null);
|
||||
return success;
|
||||
};
|
||||
|
||||
@@ -154,42 +176,29 @@ function GainPanel({
|
||||
unit=" dB"
|
||||
value={gain}
|
||||
formatValue={(v, d) => (v > 0 ? `+${v.toFixed(d)}` : v.toFixed(d))}
|
||||
onInput={handleLiveValue}
|
||||
onInput={onLiveGain}
|
||||
onChange={commitGain}
|
||||
/>
|
||||
|
||||
<Button
|
||||
variant="toggle"
|
||||
className={muted ? 'active-danger' : ''}
|
||||
onClick={toggleMute}
|
||||
style={{
|
||||
width: '85%',
|
||||
paddingLeft: 0,
|
||||
paddingRight: 0,
|
||||
fontSize: '4cqh',
|
||||
paddingTop: '2cqh',
|
||||
paddingBottom: '2cqh',
|
||||
minHeight: 0,
|
||||
}}
|
||||
>
|
||||
{muted ? 'Muted' : 'Mute '}
|
||||
</Button>
|
||||
<Button
|
||||
variant="toggle"
|
||||
className={inverted ? 'active-warning' : ''}
|
||||
onClick={toggleInverse}
|
||||
style={{
|
||||
width: '85%',
|
||||
paddingLeft: 0,
|
||||
paddingRight: 0,
|
||||
fontSize: '4cqh',
|
||||
paddingTop: '2cqh',
|
||||
paddingBottom: '2cqh',
|
||||
minHeight: 0,
|
||||
}}
|
||||
>
|
||||
{inverted ? 'Inverted' : 'Invert'}
|
||||
</Button>
|
||||
<div className="gain-panel__btns">
|
||||
<Button
|
||||
variant="toggle"
|
||||
className={`gain-panel__btn${muted ? ' active-danger' : ''}`}
|
||||
onClick={toggleMute}
|
||||
>
|
||||
<span className="gain-panel__btn-long">{muted ? 'Muted' : 'Mute'}</span>
|
||||
<span className="gain-panel__btn-short">Mute</span>
|
||||
</Button>
|
||||
|
||||
<Button
|
||||
variant="toggle"
|
||||
className={`gain-panel__btn${inverted ? ' active-warning' : ''}`}
|
||||
onClick={toggleInverse}
|
||||
>
|
||||
<span className="gain-panel__btn-long">{inverted ? 'Inverted' : 'Invert'}</span>
|
||||
<span className="gain-panel__btn-short">Inv</span>
|
||||
</Button>
|
||||
</div>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
@@ -241,7 +250,11 @@ function GainSection({
|
||||
setInverse: (channel: Channel, inverted: boolean) => Promise<boolean>;
|
||||
}) {
|
||||
const [selectedInputs, setSelectedInputs] = useState<Set<InputChannel>>(new Set(INPUT_ORDER));
|
||||
const [selectedOutputs, setSelectedOutputs] = useState<Set<OutputChannel>>(new Set(OUTPUT_ORDER));
|
||||
const [selectedOutputs, setSelectedOutputs] = useState<Set<OutputChannel>>(
|
||||
new Set(OUTPUT_ORDER)
|
||||
);
|
||||
|
||||
const [view, setView] = useState<GainView>('faders');
|
||||
|
||||
const [showInputStages, setShowInputStages] = useState(false);
|
||||
const [showOutputStages, setShowOutputStages] = useState(false);
|
||||
@@ -251,70 +264,54 @@ function GainSection({
|
||||
{}
|
||||
);
|
||||
|
||||
const setLiveInputGain = (channel: InputChannel, value: number | null) => {
|
||||
setLiveInputGains((prev) => {
|
||||
if (value === null) {
|
||||
const next = { ...prev };
|
||||
delete next[channel];
|
||||
return next;
|
||||
}
|
||||
return { ...prev, [channel]: value };
|
||||
});
|
||||
};
|
||||
const setLiveInputGain = (channel: InputChannel, value: number | null) =>
|
||||
setLiveInputGains((prev) => withLiveValue(prev, channel, value));
|
||||
|
||||
const setLiveOutputGain = (channel: OutputChannel, value: number | null) => {
|
||||
setLiveOutputGains((prev) => {
|
||||
if (value === null) {
|
||||
const next = { ...prev };
|
||||
delete next[channel];
|
||||
return next;
|
||||
}
|
||||
return { ...prev, [channel]: value };
|
||||
});
|
||||
};
|
||||
const setLiveOutputGain = (channel: OutputChannel, value: number | null) =>
|
||||
setLiveOutputGains((prev) => withLiveValue(prev, channel, value));
|
||||
|
||||
const inputLabels: Record<InputChannel, string> = INPUT_ORDER.reduce(
|
||||
(acc, channel) => ({
|
||||
...acc,
|
||||
[channel]: dsp.state.current_config.input_states[channel].name,
|
||||
}),
|
||||
{} as Record<InputChannel, string>
|
||||
);
|
||||
const inputStates = dsp.state.current_config.input_states;
|
||||
const outputStates = dsp.state.current_config.output_states;
|
||||
|
||||
const outputLabels: Record<OutputChannel, string> = OUTPUT_ORDER.reduce(
|
||||
(acc, channel) => ({
|
||||
...acc,
|
||||
[channel]: dsp.state.current_config.output_states[channel].name,
|
||||
}),
|
||||
{} as Record<OutputChannel, string>
|
||||
);
|
||||
const inputLabels = Object.fromEntries(
|
||||
INPUT_ORDER.map((channel) => [channel, inputStates[channel].name])
|
||||
) as Record<InputChannel, string>;
|
||||
|
||||
const toggleInput = (channel: InputChannel) => {
|
||||
setSelectedInputs((prev) => {
|
||||
const next = new Set(prev);
|
||||
next.has(channel) ? next.delete(channel) : next.add(channel);
|
||||
return next;
|
||||
});
|
||||
};
|
||||
|
||||
const toggleOutput = (channel: OutputChannel) => {
|
||||
setSelectedOutputs((prev) => {
|
||||
const next = new Set(prev);
|
||||
next.has(channel) ? next.delete(channel) : next.add(channel);
|
||||
return next;
|
||||
});
|
||||
};
|
||||
const outputLabels = Object.fromEntries(
|
||||
OUTPUT_ORDER.map((channel) => [channel, outputStates[channel].name])
|
||||
) as Record<OutputChannel, string>;
|
||||
|
||||
return (
|
||||
<>
|
||||
<div className="gain-page" data-view={view}>
|
||||
{/* Phone only (hidden on desktop by CSS): one view at a time */}
|
||||
<div className="gain-tabs" role="tablist" aria-label="Gain views">
|
||||
{GAIN_VIEWS.map((v) => (
|
||||
<button
|
||||
key={v.id}
|
||||
type="button"
|
||||
role="tab"
|
||||
aria-selected={view === v.id}
|
||||
className="gain-tabs__tab"
|
||||
onClick={() => setView(v.id)}
|
||||
>
|
||||
{v.label}
|
||||
</button>
|
||||
))}
|
||||
</div>
|
||||
|
||||
{/* Portrait phone only (CSS): graphs need the width of landscape */}
|
||||
<div className="gain-rotate-hint">
|
||||
Rotate your phone to landscape to see the response graphs.
|
||||
</div>
|
||||
|
||||
<div className="gain-linear-graph-section">
|
||||
<div className="gain-graph-panel">
|
||||
<div className="gain-graph-panel" data-panel="input">
|
||||
<div className="gain-graph-title-row">
|
||||
<div className="gain-graph-title-line">
|
||||
<div className="gain-graph-title">Input Response</div>
|
||||
<Button
|
||||
variant="toggle"
|
||||
className={`gain-stages-toggle ${showInputStages ? 'active-info' : ''}`}
|
||||
className={`gain-stages-toggle${showInputStages ? ' active-info' : ''}`}
|
||||
onClick={() => setShowInputStages((v) => !v)}
|
||||
>
|
||||
Show stages
|
||||
@@ -325,12 +322,12 @@ function GainSection({
|
||||
labels={inputLabels}
|
||||
colors={INPUT_COLORS}
|
||||
selected={selectedInputs}
|
||||
onToggle={toggleInput}
|
||||
onToggle={(c) => setSelectedInputs((prev) => toggleInSet(prev, c))}
|
||||
/>
|
||||
</div>
|
||||
<ResponseGraph
|
||||
channels={INPUT_ORDER}
|
||||
states={dsp.state.current_config.input_states}
|
||||
states={inputStates}
|
||||
selected={selectedInputs}
|
||||
colors={INPUT_COLORS}
|
||||
showStages={showInputStages}
|
||||
@@ -340,30 +337,29 @@ function GainSection({
|
||||
/>
|
||||
</div>
|
||||
|
||||
<div className="gain-graph-panel">
|
||||
<div className="gain-graph-panel" data-panel="output">
|
||||
<div className="gain-graph-title-row">
|
||||
<div className="gain-graph-title-line">
|
||||
<div className="gain-graph-title">Output Response</div>
|
||||
<Button
|
||||
variant={showOutputStages ? 'outline' : 'ghost'}
|
||||
className="gain-stages-toggle"
|
||||
variant="toggle"
|
||||
className={`gain-stages-toggle${showOutputStages ? ' active-info' : ''}`}
|
||||
onClick={() => setShowOutputStages((v) => !v)}
|
||||
>
|
||||
Show stages
|
||||
</Button>
|
||||
</div>
|
||||
|
||||
<ChannelSelector
|
||||
channels={OUTPUT_ORDER}
|
||||
labels={outputLabels}
|
||||
colors={OUTPUT_COLORS}
|
||||
selected={selectedOutputs}
|
||||
onToggle={toggleOutput}
|
||||
onToggle={(c) => setSelectedOutputs((prev) => toggleInSet(prev, c))}
|
||||
/>
|
||||
</div>
|
||||
<ResponseGraph
|
||||
channels={OUTPUT_ORDER}
|
||||
states={dsp.state.current_config.output_states}
|
||||
states={outputStates}
|
||||
selected={selectedOutputs}
|
||||
colors={OUTPUT_COLORS}
|
||||
showStages={showOutputStages}
|
||||
@@ -382,7 +378,7 @@ function GainSection({
|
||||
key={channel}
|
||||
dsp={dsp}
|
||||
channel={{ Input: channel }}
|
||||
title={dsp.state.current_config.input_states[channel].name}
|
||||
title={inputStates[channel].name}
|
||||
setGain={setGain}
|
||||
setMute={setMute}
|
||||
setInverse={setInverse}
|
||||
@@ -397,7 +393,7 @@ function GainSection({
|
||||
key={channel}
|
||||
dsp={dsp}
|
||||
channel={{ Output: channel }}
|
||||
title={dsp.state.current_config.output_states[channel].name}
|
||||
title={outputStates[channel].name}
|
||||
setGain={setGain}
|
||||
setMute={setMute}
|
||||
setInverse={setInverse}
|
||||
@@ -407,8 +403,8 @@ function GainSection({
|
||||
</ChannelGroup>
|
||||
</div>
|
||||
</div>
|
||||
</>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
|
||||
export default GainSection;
|
||||
export default GainSection;
|
||||
@@ -1,4 +1,22 @@
|
||||
/* GateSection.css */
|
||||
|
||||
/* ---------- Page wrapper ---------- */
|
||||
|
||||
.gate-page {
|
||||
display: contents; /* invisible on desktop; a flex column on phones */
|
||||
}
|
||||
|
||||
.gate-tabs,
|
||||
.gate-rotate-hint {
|
||||
display: none; /* phones only */
|
||||
}
|
||||
|
||||
.gate-panel__label-short {
|
||||
display: none;
|
||||
}
|
||||
|
||||
/* ---------- Control strip ---------- */
|
||||
|
||||
.gate-section {
|
||||
container-type: size;
|
||||
|
||||
@@ -98,6 +116,8 @@
|
||||
white-space: nowrap;
|
||||
}
|
||||
|
||||
/* ---------- Graph ---------- */
|
||||
|
||||
.gate-linear-graph-section {
|
||||
flex: 0 0 calc(100% - var(--dsp-control-heigth));
|
||||
min-height: 0;
|
||||
@@ -165,3 +185,367 @@
|
||||
gap: 1cqh;
|
||||
padding: 1cqh;
|
||||
}
|
||||
|
||||
/* ---------- Phone (shared) ----------
|
||||
Landscape: tabs (Controls / Gate response), one view at a time.
|
||||
Portrait: controls only + a hint to rotate for the graph. */
|
||||
|
||||
@media (max-width: 768px), (max-height: 500px) and (pointer: coarse) {
|
||||
.gate-page {
|
||||
flex: 1 1 0;
|
||||
min-height: 0;
|
||||
width: 100%;
|
||||
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
background: var(--bg-panel);
|
||||
}
|
||||
|
||||
/* ----- Tabs ----- */
|
||||
|
||||
.gate-tabs {
|
||||
flex: 0 0 auto;
|
||||
display: flex;
|
||||
gap: var(--space-1);
|
||||
padding: var(--space-1) var(--space-2);
|
||||
border-bottom: var(--border-width) solid var(--border-hairline);
|
||||
}
|
||||
|
||||
.gate-page .gate-tabs__tab {
|
||||
flex: 1 1 0;
|
||||
min-width: 0;
|
||||
min-height: 0;
|
||||
height: 34px;
|
||||
padding: 0 var(--space-2);
|
||||
|
||||
font-family: var(--font-ui);
|
||||
font-size: var(--font-xs);
|
||||
font-weight: var(--font-weight-semibold);
|
||||
white-space: nowrap;
|
||||
overflow: hidden;
|
||||
text-overflow: ellipsis;
|
||||
|
||||
background: var(--bg-void);
|
||||
color: var(--text-muted);
|
||||
border: var(--border-width) solid var(--border-hairline);
|
||||
border-radius: var(--radius-sm);
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
.gate-page .gate-tabs__tab[aria-selected='true'] {
|
||||
background: var(--bg-raised);
|
||||
color: var(--text-primary);
|
||||
border-color: var(--accent-brand);
|
||||
}
|
||||
|
||||
/* ----- Which view is visible ----- */
|
||||
|
||||
.gate-page[data-view='controls'] .gate-linear-graph-section,
|
||||
.gate-page[data-view='response'] .gate-section {
|
||||
display: none;
|
||||
}
|
||||
|
||||
/* ----- Response view: graph + meters fill everything ----- */
|
||||
|
||||
.gate-linear-graph-section {
|
||||
flex: 1 1 0;
|
||||
min-height: 0;
|
||||
gap: var(--space-1);
|
||||
padding: var(--space-1);
|
||||
}
|
||||
|
||||
.gate-graph-title {
|
||||
display: none; /* the tab already says which graph this is */
|
||||
}
|
||||
|
||||
.gate-graph__meters {
|
||||
gap: var(--space-1);
|
||||
padding: var(--space-1);
|
||||
}
|
||||
|
||||
/* ----- Controls view: strips, swipe sideways, snap per panel ----- */
|
||||
|
||||
.gate-section {
|
||||
position: relative;
|
||||
z-index: auto;
|
||||
flex: 1 1 0;
|
||||
height: auto;
|
||||
min-height: 0;
|
||||
|
||||
align-items: stretch;
|
||||
justify-content: flex-start;
|
||||
border-top: none;
|
||||
}
|
||||
|
||||
.gate-panels {
|
||||
display: flex;
|
||||
justify-content: flex-start; /* desktop's "center" would clip the left side on overflow */
|
||||
width: 100%;
|
||||
min-width: 0;
|
||||
height: auto;
|
||||
gap: var(--space-3);
|
||||
padding: var(--space-2);
|
||||
box-sizing: border-box;
|
||||
|
||||
overflow-x: auto;
|
||||
overflow-y: hidden;
|
||||
scroll-snap-type: x proximity;
|
||||
overscroll-behavior-x: contain;
|
||||
-webkit-overflow-scrolling: touch;
|
||||
}
|
||||
|
||||
/* The group is as wide as its 4 strips (never shrunk to the viewport),
|
||||
so .gate-panels is the only thing that scrolls. */
|
||||
.gate-section .channel-group {
|
||||
flex: 0 0 auto;
|
||||
width: max-content;
|
||||
max-width: none;
|
||||
margin: 0;
|
||||
padding: 30px var(--space-2) var(--space-2);
|
||||
scroll-snap-align: start;
|
||||
}
|
||||
|
||||
.gate-section .channel-group__label {
|
||||
top: 7px;
|
||||
font-size: var(--font-sm);
|
||||
}
|
||||
|
||||
.gate-section .channel-group__items {
|
||||
height: auto;
|
||||
align-self: stretch;
|
||||
justify-content: flex-start;
|
||||
gap: var(--space-2);
|
||||
overflow: visible; /* no nested scroller: it would fight with .gate-panels */
|
||||
}
|
||||
|
||||
/* Centered when everything fits, left-aligned and scrollable when it doesn't */
|
||||
.gate-panels > .channel-group:first-child {
|
||||
margin-left: auto;
|
||||
}
|
||||
|
||||
.gate-panels > .channel-group:last-child {
|
||||
margin-right: auto;
|
||||
}
|
||||
|
||||
/* One strip per input: 4 faders side by side, full height */
|
||||
.gate-panel {
|
||||
flex: 0 0 auto;
|
||||
width: clamp(200px, 30vw, 260px);
|
||||
height: auto; /* stretches to the row */
|
||||
aspect-ratio: auto;
|
||||
scroll-snap-align: start;
|
||||
}
|
||||
|
||||
.gate-panel__title {
|
||||
padding-block: var(--space-2);
|
||||
font-size: var(--font-xs);
|
||||
}
|
||||
|
||||
.gate-panel__grid {
|
||||
grid-template-columns: repeat(4, minmax(0, 1fr));
|
||||
grid-template-rows: minmax(0, 1fr);
|
||||
gap: var(--space-1);
|
||||
padding: var(--space-2) var(--space-1);
|
||||
}
|
||||
|
||||
.gate-panel__cell {
|
||||
gap: var(--space-1);
|
||||
}
|
||||
|
||||
.gate-panel__cell-label {
|
||||
max-width: 100%;
|
||||
font-size: 10px;
|
||||
overflow: hidden;
|
||||
text-overflow: ellipsis;
|
||||
}
|
||||
|
||||
.gate-panel__label-long {
|
||||
display: none;
|
||||
}
|
||||
|
||||
.gate-panel__label-short {
|
||||
display: inline;
|
||||
}
|
||||
|
||||
/* pan-x: vertical drags move the fader, horizontal swipes still scroll the strip.
|
||||
Applied to the thumb/track too so a swipe that starts on them scrolls. */
|
||||
.gate-panel__cell > :first-child,
|
||||
.gate-panel__cell > :first-child * {
|
||||
touch-action: pan-x !important;
|
||||
}
|
||||
}
|
||||
|
||||
/* ---------- Portrait phone: controls only, 2x2 panels, each with 2x2 sliders ---------- */
|
||||
|
||||
@media (max-width: 768px) and (orientation: portrait) {
|
||||
.gate-tabs {
|
||||
display: none;
|
||||
}
|
||||
|
||||
.gate-rotate-hint {
|
||||
flex: 0 0 auto;
|
||||
display: block;
|
||||
padding: var(--space-2) var(--space-3);
|
||||
|
||||
font-family: var(--font-ui);
|
||||
font-size: var(--font-xs);
|
||||
text-align: center;
|
||||
color: var(--text-muted);
|
||||
|
||||
border-bottom: var(--border-width) solid var(--border-hairline);
|
||||
}
|
||||
|
||||
/* Whatever tab was active in landscape, portrait always shows the controls */
|
||||
.gate-page[data-view] .gate-linear-graph-section {
|
||||
display: none;
|
||||
}
|
||||
|
||||
.gate-page[data-view] .gate-section {
|
||||
display: flex;
|
||||
}
|
||||
|
||||
/* Everything fits on screen: no horizontal scroll */
|
||||
.gate-panels {
|
||||
overflow: hidden;
|
||||
scroll-snap-type: none;
|
||||
padding: var(--space-1);
|
||||
gap: 0;
|
||||
}
|
||||
|
||||
.gate-section .channel-group {
|
||||
flex: 1 1 auto;
|
||||
width: 100%;
|
||||
min-width: 0;
|
||||
min-height: 0;
|
||||
box-sizing: border-box;
|
||||
padding: 28px var(--space-1) var(--space-1);
|
||||
scroll-snap-align: none;
|
||||
}
|
||||
|
||||
.gate-section .channel-group__label {
|
||||
top: 6px;
|
||||
font-size: var(--font-xs);
|
||||
}
|
||||
|
||||
/* The 4 input panels in a 2x2 grid */
|
||||
.gate-section .channel-group__items {
|
||||
flex: 1 1 auto;
|
||||
width: 100%;
|
||||
min-width: 0;
|
||||
min-height: 0;
|
||||
|
||||
display: grid;
|
||||
grid-template-columns: repeat(2, minmax(0, 1fr));
|
||||
grid-template-rows: repeat(2, minmax(0, 1fr));
|
||||
gap: var(--space-1);
|
||||
}
|
||||
|
||||
.gate-panel {
|
||||
width: 100%;
|
||||
min-width: 0;
|
||||
min-height: 0;
|
||||
scroll-snap-align: none;
|
||||
margin: 0;
|
||||
}
|
||||
|
||||
.gate-panel__title {
|
||||
padding-block: var(--space-1);
|
||||
font-size: 11px;
|
||||
}
|
||||
|
||||
/* Each panel keeps its 2x2 sliders */
|
||||
.gate-panel__grid {
|
||||
grid-template-columns: repeat(2, minmax(0, 1fr));
|
||||
grid-template-rows: repeat(2, minmax(0, 1fr));
|
||||
gap: var(--space-1);
|
||||
padding: var(--space-1);
|
||||
}
|
||||
|
||||
.gate-panel__label-long {
|
||||
display: inline;
|
||||
}
|
||||
|
||||
.gate-panel__label-short {
|
||||
display: none;
|
||||
}
|
||||
|
||||
/* Each panel is its own size container (like the rows in GainSection):
|
||||
the slider's cqh sizes (thumb, track, readout) scale to the panel height,
|
||||
which is bigger than a single cell but never the whole screen. */
|
||||
.gate-panel {
|
||||
container-type: size;
|
||||
}
|
||||
|
||||
/* The thumb sticks out of the track by half its height at min/max: leave that
|
||||
room inside the cell (padding) instead of clipping it or letting it slide
|
||||
under the title. */
|
||||
.gate-panel__cell {
|
||||
overflow: visible;
|
||||
padding-block: 3cqh;
|
||||
box-sizing: border-box;
|
||||
}
|
||||
|
||||
.gate-panel__grid {
|
||||
position: relative;
|
||||
z-index: 1; /* paint above the title if a thumb still reaches it */
|
||||
}
|
||||
|
||||
.gate-panel__cell > :first-child {
|
||||
min-height: 0;
|
||||
max-height: 100%;
|
||||
}
|
||||
|
||||
/* Give the height back to the sliders: tighter hint, title, gaps and label */
|
||||
.gate-rotate-hint {
|
||||
padding: var(--space-1) var(--space-2);
|
||||
font-size: 11px;
|
||||
}
|
||||
|
||||
.gate-panel__title {
|
||||
padding-block: 4px;
|
||||
}
|
||||
|
||||
.gate-panel__grid {
|
||||
gap: 2px;
|
||||
padding: 4px;
|
||||
}
|
||||
|
||||
.gate-panel__cell {
|
||||
gap: 2px;
|
||||
}
|
||||
|
||||
.gate-panel__cell-label {
|
||||
font-size: 10px;
|
||||
line-height: 1.1;
|
||||
}
|
||||
}
|
||||
|
||||
/* ---------- Landscape phone: thinner strips ---------- */
|
||||
|
||||
@media (max-height: 500px) and (pointer: coarse) {
|
||||
.gate-panels {
|
||||
padding: var(--space-1) var(--space-2);
|
||||
}
|
||||
|
||||
.gate-section .channel-group {
|
||||
padding-top: 24px;
|
||||
}
|
||||
|
||||
.gate-section .channel-group__label {
|
||||
top: 4px;
|
||||
font-size: var(--font-xs);
|
||||
}
|
||||
|
||||
.gate-panel {
|
||||
width: clamp(190px, 24vw, 240px);
|
||||
}
|
||||
|
||||
.gate-panel__title {
|
||||
padding-block: var(--space-1);
|
||||
font-size: 11px;
|
||||
}
|
||||
|
||||
.gate-panel__grid {
|
||||
padding: var(--space-1);
|
||||
}
|
||||
}
|
||||
@@ -9,10 +9,10 @@ import { useState } from 'react';
|
||||
import './GateSection.css';
|
||||
|
||||
const GATE_PARAMS = [
|
||||
{ key: 'threshold', label: 'Threshold', min: -90, max: 0, step: 0.5, unit: ' dB' },
|
||||
{ key: 'attack', label: 'Attack', min: 1, max: 999, step: 1, unit: ' ms' },
|
||||
{ key: 'hold', label: 'Hold', min: 10, max: 999, step: 1, unit: ' ms' },
|
||||
{ key: 'release', label: 'Release', min: 10, max: 3000, step: 1, unit: ' ms' },
|
||||
{ key: 'threshold', label: 'Threshold', short: 'Thr', min: -90, max: 0, step: 0.5, unit: ' dB' },
|
||||
{ key: 'attack', label: 'Attack', short: 'Atk', min: 1, max: 999, step: 1, unit: ' ms' },
|
||||
{ key: 'hold', label: 'Hold', short: 'Hld', min: 10, max: 999, step: 1, unit: ' ms' },
|
||||
{ key: 'release', label: 'Release', short: 'Rel', min: 10, max: 3000, step: 1, unit: ' ms' },
|
||||
] as const;
|
||||
|
||||
type GateParamKey = (typeof GATE_PARAMS)[number]['key'];
|
||||
@@ -32,6 +32,14 @@ type SetGateFn = (
|
||||
release: number
|
||||
) => Promise<boolean>;
|
||||
|
||||
// Phone only: one view at a time (CSS hides the tabs on desktop)
|
||||
type GateView = 'controls' | 'response';
|
||||
|
||||
const GATE_VIEWS: { id: GateView; label: string }[] = [
|
||||
{ id: 'controls', label: 'Controls' },
|
||||
{ id: 'response', label: 'Gate response' },
|
||||
];
|
||||
|
||||
function GatePanel({
|
||||
channel,
|
||||
dsp,
|
||||
@@ -71,7 +79,10 @@ function GatePanel({
|
||||
}}
|
||||
style={{ width: '100%', flex: '1 1 auto' }}
|
||||
/>
|
||||
<div className="gate-panel__cell-label">{param.label}</div>
|
||||
<div className="gate-panel__cell-label">
|
||||
<span className="gate-panel__label-long">{param.label}</span>
|
||||
<span className="gate-panel__label-short">{param.short}</span>
|
||||
</div>
|
||||
</div>
|
||||
))}
|
||||
</div>
|
||||
@@ -84,6 +95,7 @@ function GateSection({ dsp, set_gate }: { dsp: DSP; set_gate: SetGateFn }) {
|
||||
|
||||
const [activeChannel, setActiveChannel] = useState<InputChannel>(inputs[0]);
|
||||
const [liveGate, setLiveGate] = useState<Partial<Record<InputChannel, GateValues>>>({});
|
||||
const [view, setView] = useState<GateView>('controls');
|
||||
|
||||
const handleLiveValue = (channel: InputChannel, key: GateParamKey, value: number) => {
|
||||
setActiveChannel(channel);
|
||||
@@ -113,7 +125,28 @@ function GateSection({ dsp, set_gate }: { dsp: DSP; set_gate: SetGateFn }) {
|
||||
const activeGate = liveGate[activeChannel] ?? activeInputState.gate;
|
||||
|
||||
return (
|
||||
<>
|
||||
<div className="gate-page" data-view={view}>
|
||||
{/* Phone only (hidden on desktop by CSS): one view at a time */}
|
||||
<div className="gate-tabs" role="tablist" aria-label="Gate views">
|
||||
{GATE_VIEWS.map((v) => (
|
||||
<button
|
||||
key={v.id}
|
||||
type="button"
|
||||
role="tab"
|
||||
aria-selected={view === v.id}
|
||||
className="gate-tabs__tab"
|
||||
onClick={() => setView(v.id)}
|
||||
>
|
||||
{v.label}
|
||||
</button>
|
||||
))}
|
||||
</div>
|
||||
|
||||
{/* Portrait phone only (CSS): the graph needs the width of landscape */}
|
||||
<div className="gate-rotate-hint">
|
||||
Rotate your phone to landscape to see the gate response graph.
|
||||
</div>
|
||||
|
||||
<div className="gate-linear-graph-section">
|
||||
<div className="gate-graph-panel">
|
||||
<div className="gate-graph-title">Gate Response</div>
|
||||
@@ -135,7 +168,7 @@ function GateSection({ dsp, set_gate }: { dsp: DSP; set_gate: SetGateFn }) {
|
||||
key={input}
|
||||
label={inputState.name}
|
||||
meter={dsp.input_meters.meters[input]}
|
||||
variant='input'
|
||||
variant="input"
|
||||
/>
|
||||
);
|
||||
})}
|
||||
@@ -158,7 +191,8 @@ function GateSection({ dsp, set_gate }: { dsp: DSP; set_gate: SetGateFn }) {
|
||||
</ChannelGroup>
|
||||
</div>
|
||||
</div>
|
||||
</>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
export default GateSection;
|
||||
|
||||
export default GateSection;
|
||||
@@ -1,3 +1,18 @@
|
||||
/* GeqSection.css */
|
||||
|
||||
/* ---------- Page wrapper ---------- */
|
||||
|
||||
.geq-page {
|
||||
display: contents; /* invisible on desktop; a flex column on phones */
|
||||
}
|
||||
|
||||
.geq-tabs,
|
||||
.geq-rotate-hint {
|
||||
display: none; /* phones only */
|
||||
}
|
||||
|
||||
/* ---------- Control strip ---------- */
|
||||
|
||||
.geq-section {
|
||||
container-type: size;
|
||||
|
||||
@@ -45,8 +60,6 @@
|
||||
flex-direction: row;
|
||||
align-items: stretch;
|
||||
|
||||
/* padding: 2cqh 1.5cqh; */
|
||||
|
||||
border: var(--border-width) solid var(--border-hairline);
|
||||
border-radius: var(--radius-md);
|
||||
box-sizing: border-box;
|
||||
@@ -106,6 +119,8 @@
|
||||
min-height: 0;
|
||||
}
|
||||
|
||||
/* ---------- Graph ---------- */
|
||||
|
||||
.geq-linear-graph-section {
|
||||
flex: 0 0 calc(100% - var(--dsp-control-heigth));
|
||||
min-height: 0;
|
||||
@@ -175,3 +190,378 @@
|
||||
opacity: 0.85;
|
||||
user-select: none;
|
||||
}
|
||||
|
||||
/* ---------- Phone (shared) ----------
|
||||
Landscape: tabs (Faders / GEQ curve), one view at a time.
|
||||
Portrait: faders only + a hint to rotate for the graph. */
|
||||
|
||||
@media (max-width: 768px), (max-height: 500px) and (pointer: coarse) {
|
||||
.geq-page {
|
||||
flex: 1 1 0;
|
||||
min-height: 0;
|
||||
width: 100%;
|
||||
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
background: var(--bg-panel);
|
||||
}
|
||||
|
||||
/* ----- Tabs ----- */
|
||||
|
||||
.geq-tabs {
|
||||
flex: 0 0 auto;
|
||||
display: flex;
|
||||
gap: var(--space-1);
|
||||
padding: var(--space-1) var(--space-2);
|
||||
border-bottom: var(--border-width) solid var(--border-hairline);
|
||||
}
|
||||
|
||||
.geq-page .geq-tabs__tab {
|
||||
flex: 1 1 0;
|
||||
min-width: 0;
|
||||
min-height: 0;
|
||||
height: 34px;
|
||||
padding: 0 var(--space-2);
|
||||
|
||||
font-family: var(--font-ui);
|
||||
font-size: var(--font-xs);
|
||||
font-weight: var(--font-weight-semibold);
|
||||
white-space: nowrap;
|
||||
overflow: hidden;
|
||||
text-overflow: ellipsis;
|
||||
|
||||
background: var(--bg-void);
|
||||
color: var(--text-muted);
|
||||
border: var(--border-width) solid var(--border-hairline);
|
||||
border-radius: var(--radius-sm);
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
.geq-page .geq-tabs__tab[aria-selected='true'] {
|
||||
background: var(--bg-raised);
|
||||
color: var(--text-primary);
|
||||
border-color: var(--accent-brand);
|
||||
}
|
||||
|
||||
/* ----- Which view is visible ----- */
|
||||
|
||||
.geq-page[data-view='faders'] .geq-linear-graph-section,
|
||||
.geq-page[data-view='curve'] .geq-section {
|
||||
display: none;
|
||||
}
|
||||
|
||||
/* ----- Curve view: graph fills everything ----- */
|
||||
|
||||
.geq-linear-graph-section {
|
||||
flex: 1 1 0;
|
||||
min-height: 0;
|
||||
gap: 0;
|
||||
padding: var(--space-1);
|
||||
}
|
||||
|
||||
.geq-graph-panel {
|
||||
flex: 1 1 0;
|
||||
height: auto;
|
||||
}
|
||||
|
||||
.geq-graph-title {
|
||||
padding: var(--space-1);
|
||||
font-size: var(--font-xs);
|
||||
}
|
||||
|
||||
/* ----- Faders view: [Input | Actions] then 31 bands, all in one sideways swipe ----- */
|
||||
|
||||
.geq-section {
|
||||
position: relative;
|
||||
z-index: auto;
|
||||
flex: 1 1 0;
|
||||
height: auto;
|
||||
min-height: 0;
|
||||
|
||||
align-items: stretch;
|
||||
justify-content: flex-start;
|
||||
border-top: none;
|
||||
}
|
||||
|
||||
.geq-panels {
|
||||
display: flex;
|
||||
justify-content: flex-start; /* desktop's "center" would clip the left side on overflow */
|
||||
width: 100%;
|
||||
min-width: 0;
|
||||
height: auto;
|
||||
gap: var(--space-3);
|
||||
padding: var(--space-2);
|
||||
box-sizing: border-box;
|
||||
|
||||
overflow-x: auto;
|
||||
overflow-y: hidden;
|
||||
scroll-snap-type: x proximity;
|
||||
overscroll-behavior-x: contain;
|
||||
-webkit-overflow-scrolling: touch;
|
||||
}
|
||||
|
||||
.geq-section .channel-group {
|
||||
flex: 0 0 auto;
|
||||
width: max-content;
|
||||
max-width: none;
|
||||
margin: 0;
|
||||
padding: 30px var(--space-2) var(--space-2);
|
||||
}
|
||||
|
||||
.geq-section .channel-group__label {
|
||||
top: 7px;
|
||||
font-size: var(--font-sm);
|
||||
}
|
||||
|
||||
.geq-section .channel-group__items {
|
||||
height: auto;
|
||||
align-self: stretch;
|
||||
justify-content: flex-start;
|
||||
overflow: visible; /* no nested scroller: it would fight with .geq-panels */
|
||||
}
|
||||
|
||||
/* Input selector + actions come first so they are always one swipe away */
|
||||
.geq-side-panels {
|
||||
order: -1;
|
||||
flex: 0 0 auto;
|
||||
height: auto;
|
||||
align-self: stretch;
|
||||
gap: var(--space-2);
|
||||
}
|
||||
|
||||
.geq-side-panels > :first-child,
|
||||
.geq-side-panels > :last-child {
|
||||
flex: 1 1 0;
|
||||
min-height: 0;
|
||||
}
|
||||
|
||||
.geq-side-panels .channel-group {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
}
|
||||
|
||||
/* Input: 2x2 buttons. Actions: Bypass above Reset. */
|
||||
.geq-channel-selector {
|
||||
width: 124px;
|
||||
height: auto;
|
||||
align-self: stretch;
|
||||
justify-content: center;
|
||||
gap: var(--space-1);
|
||||
}
|
||||
|
||||
.geq-side-panels > :first-child .geq-channel-selector {
|
||||
display: grid;
|
||||
grid-template-columns: repeat(2, minmax(0, 1fr));
|
||||
align-content: center;
|
||||
}
|
||||
|
||||
.geq-channel-selector .geq-btn {
|
||||
width: 100% !important;
|
||||
height: 34px !important;
|
||||
min-height: 0 !important;
|
||||
padding: 0 !important;
|
||||
font-size: 11px !important;
|
||||
overflow: hidden;
|
||||
text-overflow: ellipsis;
|
||||
}
|
||||
|
||||
/* The 31 bands: fixed width per band so they stay usable, the strip scrolls */
|
||||
.geq-band-panel {
|
||||
flex: 0 0 auto;
|
||||
width: calc(var(--geq-bands, 31) * 40px + 8px);
|
||||
height: auto; /* stretches to the row */
|
||||
aspect-ratio: auto;
|
||||
padding-block: var(--space-1);
|
||||
}
|
||||
|
||||
.geq-band-cell {
|
||||
flex: 0 0 40px;
|
||||
min-width: 40px;
|
||||
gap: var(--space-1);
|
||||
}
|
||||
|
||||
.geq-band-cell__label {
|
||||
font-size: 10px;
|
||||
}
|
||||
|
||||
/* pan-x: vertical drags move the fader, horizontal swipes still scroll the strip.
|
||||
Applied to the thumb/track too so a swipe that starts on them scrolls. */
|
||||
.geq-band-cell > :first-child,
|
||||
.geq-band-cell > :first-child * {
|
||||
touch-action: pan-x !important;
|
||||
}
|
||||
}
|
||||
|
||||
/* ---------- Portrait phone: buttons on top, bands in 2 rows below ---------- */
|
||||
|
||||
@media (max-width: 768px) and (orientation: portrait) {
|
||||
.geq-tabs {
|
||||
display: none;
|
||||
}
|
||||
|
||||
.geq-rotate-hint {
|
||||
flex: 0 0 auto;
|
||||
display: block;
|
||||
padding: var(--space-2) var(--space-3);
|
||||
|
||||
font-family: var(--font-ui);
|
||||
font-size: var(--font-xs);
|
||||
text-align: center;
|
||||
color: var(--text-muted);
|
||||
|
||||
border-bottom: var(--border-width) solid var(--border-hairline);
|
||||
}
|
||||
|
||||
/* Whatever tab was active in landscape, portrait always shows the faders */
|
||||
.geq-page[data-view] .geq-linear-graph-section {
|
||||
display: none;
|
||||
}
|
||||
|
||||
.geq-page[data-view] .geq-section {
|
||||
display: flex;
|
||||
}
|
||||
|
||||
/* Column: [Input | Actions] bar on top, bands below taking all the rest */
|
||||
.geq-panels {
|
||||
flex-direction: column;
|
||||
gap: var(--space-2);
|
||||
overflow: hidden;
|
||||
scroll-snap-type: none;
|
||||
padding: var(--space-1) var(--space-2);
|
||||
}
|
||||
|
||||
.geq-section .channel-group {
|
||||
padding: 24px var(--space-2) var(--space-2);
|
||||
}
|
||||
|
||||
.geq-section .channel-group__label {
|
||||
top: 5px;
|
||||
font-size: var(--font-xs);
|
||||
}
|
||||
|
||||
/* ----- Buttons bar ----- */
|
||||
|
||||
.geq-side-panels {
|
||||
flex-direction: row;
|
||||
flex: 0 0 auto;
|
||||
align-self: stretch;
|
||||
width: 100%;
|
||||
height: auto;
|
||||
gap: var(--space-2);
|
||||
}
|
||||
|
||||
.geq-side-panels > :first-child {
|
||||
flex: 2 1 0;
|
||||
}
|
||||
|
||||
.geq-side-panels > :last-child {
|
||||
flex: 1 1 0;
|
||||
}
|
||||
|
||||
.geq-side-panels .channel-group {
|
||||
width: auto;
|
||||
height: auto;
|
||||
min-width: 0;
|
||||
box-sizing: border-box;
|
||||
}
|
||||
|
||||
.geq-side-panels .channel-group__items {
|
||||
width: 100%;
|
||||
height: auto;
|
||||
}
|
||||
|
||||
.geq-channel-selector {
|
||||
width: 100%;
|
||||
height: auto;
|
||||
gap: var(--space-1);
|
||||
}
|
||||
|
||||
/* Input: 4 buttons in a row. Actions: Bypass | Reset in a row. */
|
||||
.geq-side-panels > :first-child .geq-channel-selector {
|
||||
display: grid;
|
||||
grid-template-columns: repeat(4, minmax(0, 1fr));
|
||||
}
|
||||
|
||||
.geq-side-panels > :last-child .geq-channel-selector {
|
||||
display: grid;
|
||||
grid-template-columns: repeat(2, minmax(0, 1fr));
|
||||
}
|
||||
|
||||
.geq-channel-selector .geq-btn {
|
||||
height: 40px !important;
|
||||
font-size: 12px !important;
|
||||
}
|
||||
|
||||
/* ----- Bands: 2 rows, both rows scroll together ----- */
|
||||
|
||||
.geq-panels > .channel-group {
|
||||
flex: 1 1 0;
|
||||
min-height: 0;
|
||||
width: 100%;
|
||||
box-sizing: border-box;
|
||||
}
|
||||
|
||||
.geq-panels > .channel-group .channel-group__items {
|
||||
flex: 1 1 auto;
|
||||
width: 100%;
|
||||
min-width: 0;
|
||||
|
||||
overflow-x: auto;
|
||||
overflow-y: hidden;
|
||||
scroll-snap-type: none;
|
||||
overscroll-behavior-x: contain;
|
||||
-webkit-overflow-scrolling: touch;
|
||||
}
|
||||
|
||||
/* Bands 1-16 on the first row, 17-31 on the second: column N holds band N and N+16 */
|
||||
.geq-band-panel {
|
||||
display: grid;
|
||||
grid-template-columns: repeat(var(--geq-cols, 16), 40px);
|
||||
grid-template-rows: repeat(2, minmax(0, 1fr));
|
||||
grid-auto-flow: row;
|
||||
gap: var(--space-1) 0;
|
||||
|
||||
width: calc(var(--geq-cols, 16) * 40px + 8px);
|
||||
padding: var(--space-1);
|
||||
}
|
||||
|
||||
/* Each slider cell is its own size container: the slider's cqh sizes
|
||||
(thumb, track, readout) scale to this cell, i.e. about half the height. */
|
||||
.geq-band-cell {
|
||||
width: auto;
|
||||
min-width: 0;
|
||||
min-height: 0;
|
||||
container-type: size;
|
||||
|
||||
/* room for the thumb sticking out of the track at min/max */
|
||||
padding-block: 8px;
|
||||
box-sizing: border-box;
|
||||
overflow: visible;
|
||||
}
|
||||
|
||||
.geq-band-cell > :first-child {
|
||||
min-height: 0;
|
||||
max-height: 100%;
|
||||
}
|
||||
}
|
||||
|
||||
/* ---------- Landscape phone: thinner strips ---------- */
|
||||
|
||||
@media (max-height: 500px) and (pointer: coarse) {
|
||||
.geq-panels {
|
||||
padding: var(--space-1) var(--space-2);
|
||||
}
|
||||
|
||||
.geq-section .channel-group {
|
||||
padding-top: 24px;
|
||||
}
|
||||
|
||||
.geq-section .channel-group__label {
|
||||
top: 4px;
|
||||
font-size: var(--font-xs);
|
||||
}
|
||||
|
||||
.geq-channel-selector .geq-btn {
|
||||
height: 32px !important;
|
||||
}
|
||||
}
|
||||
@@ -24,6 +24,14 @@ type SetGeqBandFn = (
|
||||
|
||||
type SetGeqBypassFn = (input: InputChannel, bypass: boolean) => Promise<boolean>;
|
||||
|
||||
// Phone only: one view at a time (CSS hides the tabs on desktop)
|
||||
type GeqView = 'faders' | 'curve';
|
||||
|
||||
const GEQ_VIEWS: { id: GeqView; label: string }[] = [
|
||||
{ id: 'faders', label: 'Faders' },
|
||||
{ id: 'curve', label: 'GEQ curve' },
|
||||
];
|
||||
|
||||
function GeqBandPanel({
|
||||
channel,
|
||||
dsp,
|
||||
@@ -39,7 +47,15 @@ function GeqBandPanel({
|
||||
const geq = inputState.geq;
|
||||
|
||||
return (
|
||||
<div className="geq-band-panel">
|
||||
<div
|
||||
className="geq-band-panel"
|
||||
style={
|
||||
{
|
||||
'--geq-bands': GEQ_BANDS_LABEL.length,
|
||||
'--geq-cols': Math.ceil(GEQ_BANDS_LABEL.length / 2),
|
||||
} as React.CSSProperties
|
||||
}
|
||||
>
|
||||
{GEQ_BANDS_LABEL.map(({ frequency, label }) => (
|
||||
<div className="geq-band-cell" key={frequency}>
|
||||
<VerticalSlider
|
||||
@@ -76,7 +92,7 @@ function GeqChannelSelector({
|
||||
<Button
|
||||
key={c}
|
||||
variant="toggle"
|
||||
className={c === channel ? 'active-info' : ''}
|
||||
className={`geq-btn${c === channel ? ' active-info' : ''}`}
|
||||
onClick={() => onSelect(c)}
|
||||
style={{
|
||||
width: '100%',
|
||||
@@ -109,7 +125,7 @@ function GeqActions({
|
||||
<div className="geq-channel-selector">
|
||||
<Button
|
||||
variant="toggle"
|
||||
className={bypass ? 'active-warning' : ''}
|
||||
className={`geq-btn${bypass ? ' active-warning' : ''}`}
|
||||
onClick={onBypass}
|
||||
style={{
|
||||
width: '100%',
|
||||
@@ -125,6 +141,7 @@ function GeqActions({
|
||||
|
||||
<Button
|
||||
variant="toggle"
|
||||
className="geq-btn"
|
||||
onClick={onReset}
|
||||
disabled={resetting}
|
||||
style={{
|
||||
@@ -154,6 +171,7 @@ function GeqSection({
|
||||
const [liveGeq, setLiveGeq] = useState<Partial<Record<InputChannel, LiveBands>>>({});
|
||||
const [resetting, setResetting] = useState(false);
|
||||
const [isResetConfirmOpen, setIsResetConfirmOpen] = useState(false);
|
||||
const [view, setView] = useState<GeqView>('faders');
|
||||
|
||||
useEffect(() => {
|
||||
if (!isResetConfirmOpen) return;
|
||||
@@ -228,7 +246,26 @@ function GeqSection({
|
||||
}));
|
||||
|
||||
return (
|
||||
<>
|
||||
<div className="geq-page" data-view={view}>
|
||||
{/* Phone only (hidden on desktop by CSS): one view at a time */}
|
||||
<div className="geq-tabs" role="tablist" aria-label="GEQ views">
|
||||
{GEQ_VIEWS.map((v) => (
|
||||
<button
|
||||
key={v.id}
|
||||
type="button"
|
||||
role="tab"
|
||||
aria-selected={view === v.id}
|
||||
className="geq-tabs__tab"
|
||||
onClick={() => setView(v.id)}
|
||||
>
|
||||
{v.label}
|
||||
</button>
|
||||
))}
|
||||
</div>
|
||||
|
||||
{/* Portrait phone only (CSS): the graph needs the width of landscape */}
|
||||
<div className="geq-rotate-hint">Rotate your phone to landscape to see the GEQ graph.</div>
|
||||
|
||||
<div className="geq-linear-graph-section">
|
||||
<GeqGraph
|
||||
title={`${activeInputState.name} - GEQ`}
|
||||
@@ -290,8 +327,8 @@ function GeqSection({
|
||||
</div>
|
||||
</div>
|
||||
)}
|
||||
</>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
|
||||
export default GeqSection;
|
||||
export default GeqSection;
|
||||
@@ -1,3 +1,22 @@
|
||||
/* LimiterSection.css */
|
||||
|
||||
/* ---------- Page wrapper ---------- */
|
||||
|
||||
.limiter-page {
|
||||
display: contents; /* invisible on desktop; a flex column on phones */
|
||||
}
|
||||
|
||||
.limiter-tabs,
|
||||
.limiter-rotate-hint {
|
||||
display: none; /* phones only */
|
||||
}
|
||||
|
||||
.limiter-panel__label-short {
|
||||
display: none;
|
||||
}
|
||||
|
||||
/* ---------- Control strip ---------- */
|
||||
|
||||
.limiter-section {
|
||||
container-type: size;
|
||||
position: absolute;
|
||||
@@ -110,6 +129,8 @@
|
||||
white-space: nowrap;
|
||||
}
|
||||
|
||||
/* ---------- Graph ---------- */
|
||||
|
||||
.limiter-linear-graph-section {
|
||||
flex: 0 0 calc(100% - var(--dsp-control-heigth));
|
||||
min-height: 0;
|
||||
@@ -177,3 +198,338 @@
|
||||
flex: 1;
|
||||
min-height: 0;
|
||||
}
|
||||
|
||||
/* ---------- Phone (shared) ----------
|
||||
Landscape: tabs (Controls / Limiter response), one view at a time.
|
||||
Portrait: controls only + a hint to rotate for the graph. */
|
||||
|
||||
@media (max-width: 768px), (max-height: 500px) and (pointer: coarse) {
|
||||
.limiter-page {
|
||||
flex: 1 1 0;
|
||||
min-height: 0;
|
||||
width: 100%;
|
||||
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
background: var(--bg-panel);
|
||||
}
|
||||
|
||||
/* ----- Tabs ----- */
|
||||
|
||||
.limiter-tabs {
|
||||
flex: 0 0 auto;
|
||||
display: flex;
|
||||
gap: var(--space-1);
|
||||
padding: var(--space-1) var(--space-2);
|
||||
border-bottom: var(--border-width) solid var(--border-hairline);
|
||||
}
|
||||
|
||||
.limiter-page .limiter-tabs__tab {
|
||||
flex: 1 1 0;
|
||||
min-width: 0;
|
||||
min-height: 0;
|
||||
height: 34px;
|
||||
padding: 0 var(--space-2);
|
||||
|
||||
font-family: var(--font-ui);
|
||||
font-size: var(--font-xs);
|
||||
font-weight: var(--font-weight-semibold);
|
||||
white-space: nowrap;
|
||||
overflow: hidden;
|
||||
text-overflow: ellipsis;
|
||||
|
||||
background: var(--bg-void);
|
||||
color: var(--text-muted);
|
||||
border: var(--border-width) solid var(--border-hairline);
|
||||
border-radius: var(--radius-sm);
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
.limiter-page .limiter-tabs__tab[aria-selected='true'] {
|
||||
background: var(--bg-raised);
|
||||
color: var(--text-primary);
|
||||
border-color: var(--accent-brand);
|
||||
}
|
||||
|
||||
/* ----- Which view is visible ----- */
|
||||
|
||||
.limiter-page[data-view='controls'] .limiter-linear-graph-section,
|
||||
.limiter-page[data-view='response'] .limiter-section {
|
||||
display: none;
|
||||
}
|
||||
|
||||
/* ----- Response view: graph + meters fill everything ----- */
|
||||
|
||||
.limiter-linear-graph-section {
|
||||
flex: 1 1 0;
|
||||
min-height: 0;
|
||||
gap: var(--space-1);
|
||||
padding: var(--space-1);
|
||||
}
|
||||
|
||||
.limiter-graph__title {
|
||||
padding: var(--space-1);
|
||||
font-size: var(--font-xs);
|
||||
}
|
||||
|
||||
.limiter-graph__meters {
|
||||
gap: var(--space-1);
|
||||
padding: var(--space-1);
|
||||
}
|
||||
|
||||
/* ----- Controls view: strips, swipe sideways, snap per panel ----- */
|
||||
|
||||
.limiter-section {
|
||||
position: relative;
|
||||
z-index: auto;
|
||||
flex: 1 1 0;
|
||||
height: auto;
|
||||
min-height: 0;
|
||||
|
||||
align-items: stretch;
|
||||
justify-content: flex-start;
|
||||
border-top: none;
|
||||
}
|
||||
|
||||
.limiter-panels {
|
||||
display: flex;
|
||||
justify-content: flex-start; /* desktop's "center" would clip the left side on overflow */
|
||||
width: 100%;
|
||||
min-width: 0;
|
||||
height: auto;
|
||||
gap: var(--space-3);
|
||||
padding: var(--space-2);
|
||||
box-sizing: border-box;
|
||||
|
||||
overflow-x: auto;
|
||||
overflow-y: hidden;
|
||||
scroll-snap-type: x proximity;
|
||||
overscroll-behavior-x: contain;
|
||||
-webkit-overflow-scrolling: touch;
|
||||
}
|
||||
|
||||
/* The group is as wide as its strips (never shrunk to the viewport),
|
||||
so .limiter-panels is the only thing that scrolls. */
|
||||
.limiter-section .channel-group {
|
||||
flex: 0 0 auto;
|
||||
width: max-content;
|
||||
max-width: none;
|
||||
margin: 0;
|
||||
padding: 30px var(--space-2) var(--space-2);
|
||||
scroll-snap-align: start;
|
||||
}
|
||||
|
||||
.limiter-section .channel-group__label {
|
||||
top: 7px;
|
||||
font-size: var(--font-sm);
|
||||
}
|
||||
|
||||
.limiter-section .channel-group__items {
|
||||
height: auto;
|
||||
align-self: stretch;
|
||||
justify-content: flex-start;
|
||||
gap: var(--space-2);
|
||||
overflow: visible; /* no nested scroller: it would fight with .limiter-panels */
|
||||
}
|
||||
|
||||
/* Centered when everything fits, left-aligned and scrollable when it doesn't */
|
||||
.limiter-panels > .channel-group:first-child {
|
||||
margin-left: auto;
|
||||
}
|
||||
|
||||
.limiter-panels > .channel-group:last-child {
|
||||
margin-right: auto;
|
||||
}
|
||||
|
||||
/* One strip per output: 3 faders side by side, full height */
|
||||
.limiter-panel {
|
||||
flex: 0 0 auto;
|
||||
width: clamp(160px, 22vw, 200px);
|
||||
height: auto; /* stretches to the row */
|
||||
aspect-ratio: auto;
|
||||
scroll-snap-align: start;
|
||||
}
|
||||
|
||||
.limiter-panel__title {
|
||||
padding-block: var(--space-2);
|
||||
font-size: var(--font-xs);
|
||||
}
|
||||
|
||||
.limiter-panel__grid {
|
||||
grid-template-columns: repeat(3, minmax(0, 1fr));
|
||||
grid-template-rows: minmax(0, 1fr);
|
||||
grid-template-areas: 'threshold attack release';
|
||||
gap: var(--space-1);
|
||||
padding: var(--space-2) var(--space-1);
|
||||
}
|
||||
|
||||
.limiter-panel__cell {
|
||||
gap: var(--space-1);
|
||||
}
|
||||
|
||||
.limiter-panel__cell-label {
|
||||
max-width: 100%;
|
||||
font-size: 10px;
|
||||
overflow: hidden;
|
||||
text-overflow: ellipsis;
|
||||
}
|
||||
|
||||
.limiter-panel__label-long {
|
||||
display: none;
|
||||
}
|
||||
|
||||
.limiter-panel__label-short {
|
||||
display: inline;
|
||||
}
|
||||
|
||||
/* pan-x: vertical drags move the fader, horizontal swipes still scroll the strip.
|
||||
Applied to the thumb/track too so a swipe that starts on them scrolls. */
|
||||
.limiter-panel__cell > :first-child,
|
||||
.limiter-panel__cell > :first-child * {
|
||||
touch-action: pan-x !important;
|
||||
}
|
||||
}
|
||||
|
||||
/* ---------- Portrait phone: controls only, 8 panels in 2 rows, each with its own layout ---------- */
|
||||
|
||||
@media (max-width: 768px) and (orientation: portrait) {
|
||||
.limiter-tabs {
|
||||
display: none;
|
||||
}
|
||||
|
||||
.limiter-rotate-hint {
|
||||
flex: 0 0 auto;
|
||||
display: block;
|
||||
padding: var(--space-1) var(--space-2);
|
||||
|
||||
font-family: var(--font-ui);
|
||||
font-size: 11px;
|
||||
text-align: center;
|
||||
color: var(--text-muted);
|
||||
|
||||
border-bottom: var(--border-width) solid var(--border-hairline);
|
||||
}
|
||||
|
||||
/* Whatever tab was active in landscape, portrait always shows the controls */
|
||||
.limiter-page[data-view] .limiter-linear-graph-section {
|
||||
display: none;
|
||||
}
|
||||
|
||||
.limiter-page[data-view] .limiter-section {
|
||||
display: flex;
|
||||
}
|
||||
|
||||
/* Swipe sideways: both rows move together (Out1-4 on top, Out5-8 below) */
|
||||
.limiter-panels {
|
||||
padding: var(--space-1);
|
||||
gap: 0;
|
||||
}
|
||||
|
||||
.limiter-section .channel-group {
|
||||
padding: 28px var(--space-1) var(--space-1);
|
||||
}
|
||||
|
||||
.limiter-section .channel-group__label {
|
||||
top: 6px;
|
||||
font-size: var(--font-xs);
|
||||
}
|
||||
|
||||
.limiter-section .channel-group__items {
|
||||
flex: 1 1 auto;
|
||||
min-height: 0;
|
||||
|
||||
display: grid;
|
||||
grid-template-columns: repeat(4, clamp(150px, 46vw, 200px));
|
||||
grid-template-rows: repeat(2, minmax(0, 1fr));
|
||||
gap: var(--space-1);
|
||||
}
|
||||
|
||||
.limiter-panel {
|
||||
width: 100%;
|
||||
min-width: 0;
|
||||
min-height: 0;
|
||||
margin: 0;
|
||||
|
||||
/* Each panel is its own size container (like the rows in GainSection):
|
||||
the slider's cqh sizes (thumb, track, readout) scale to the panel height. */
|
||||
container-type: size;
|
||||
}
|
||||
|
||||
.limiter-panel__title {
|
||||
padding-block: 4px;
|
||||
font-size: 11px;
|
||||
}
|
||||
|
||||
/* Each panel keeps its desktop layout: Threshold tall on the left,
|
||||
Attack above Release on the right */
|
||||
.limiter-panel__grid {
|
||||
grid-template-columns: repeat(2, minmax(0, 1fr));
|
||||
grid-template-rows: repeat(2, minmax(0, 1fr));
|
||||
grid-template-areas:
|
||||
'threshold attack'
|
||||
'threshold release';
|
||||
gap: 2px;
|
||||
padding: 4px;
|
||||
|
||||
position: relative;
|
||||
z-index: 1; /* paint above the title if a thumb still reaches it */
|
||||
}
|
||||
|
||||
.limiter-panel__label-long {
|
||||
display: inline;
|
||||
}
|
||||
|
||||
.limiter-panel__label-short {
|
||||
display: none;
|
||||
}
|
||||
|
||||
.limiter-panel__cell {
|
||||
gap: 2px;
|
||||
|
||||
/* The thumb sticks out of the track by half its height at min/max: leave that
|
||||
room inside the cell instead of clipping it or letting it slide under the title. */
|
||||
overflow: visible;
|
||||
padding-block: 3cqh;
|
||||
box-sizing: border-box;
|
||||
}
|
||||
|
||||
.limiter-panel__cell > :first-child {
|
||||
min-height: 0;
|
||||
max-height: 100%;
|
||||
}
|
||||
|
||||
.limiter-panel__cell-label {
|
||||
font-size: 10px;
|
||||
line-height: 1.1;
|
||||
}
|
||||
}
|
||||
|
||||
/* ---------- Landscape phone: thinner strips ---------- */
|
||||
|
||||
@media (max-height: 500px) and (pointer: coarse) {
|
||||
.limiter-panels {
|
||||
padding: var(--space-1) var(--space-2);
|
||||
}
|
||||
|
||||
.limiter-section .channel-group {
|
||||
padding-top: 24px;
|
||||
}
|
||||
|
||||
.limiter-section .channel-group__label {
|
||||
top: 4px;
|
||||
font-size: var(--font-xs);
|
||||
}
|
||||
|
||||
.limiter-panel {
|
||||
width: clamp(150px, 19vw, 190px);
|
||||
}
|
||||
|
||||
.limiter-panel__title {
|
||||
padding-block: var(--space-1);
|
||||
font-size: 11px;
|
||||
}
|
||||
|
||||
.limiter-panel__grid {
|
||||
padding: var(--space-1);
|
||||
}
|
||||
}
|
||||
@@ -9,9 +9,9 @@ import { useState } from 'react';
|
||||
import './LimiterSection.css';
|
||||
|
||||
const LIMITER_SLIDER_PARAMS = [
|
||||
{ key: 'threshold', label: 'Threshold', min: -90, max: 20, step: 0.5, unit: ' dB' },
|
||||
{ key: 'attack', label: 'Attack', min: 1, max: 999, step: 1, unit: ' ms' },
|
||||
{ key: 'release', label: 'Release', min: 10, max: 3000, step: 1, unit: ' ms' },
|
||||
{ key: 'threshold', label: 'Threshold', short: 'Thr', min: -90, max: 20, step: 0.5, unit: ' dB' },
|
||||
{ key: 'attack', label: 'Attack', short: 'Atk', min: 1, max: 999, step: 1, unit: ' ms' },
|
||||
{ key: 'release', label: 'Release', short: 'Rel', min: 10, max: 3000, step: 1, unit: ' ms' },
|
||||
] as const;
|
||||
|
||||
type LimiterParamKey = 'threshold' | 'attack' | 'release';
|
||||
@@ -29,6 +29,14 @@ type SetLimiterFn = (
|
||||
release: number
|
||||
) => Promise<boolean>;
|
||||
|
||||
// Phone only: one view at a time (CSS hides the tabs on desktop)
|
||||
type LimiterView = 'controls' | 'response';
|
||||
|
||||
const LIMITER_VIEWS: { id: LimiterView; label: string }[] = [
|
||||
{ id: 'controls', label: 'Controls' },
|
||||
{ id: 'response', label: 'Limiter response' },
|
||||
];
|
||||
|
||||
function LimiterPanel({
|
||||
channel,
|
||||
dsp,
|
||||
@@ -66,7 +74,10 @@ function LimiterPanel({
|
||||
onChange={(value) => commit({ [param.key]: value } as Partial<LimiterValues>)}
|
||||
style={{ width: '100%', flex: '1 1 auto' }}
|
||||
/>
|
||||
<div className="limiter-panel__cell-label">{param.label}</div>
|
||||
<div className="limiter-panel__cell-label">
|
||||
<span className="limiter-panel__label-long">{param.label}</span>
|
||||
<span className="limiter-panel__label-short">{param.short}</span>
|
||||
</div>
|
||||
</div>
|
||||
))}
|
||||
</div>
|
||||
@@ -88,6 +99,7 @@ function LimiterSection({ dsp, set_limiter }: { dsp: DSP; set_limiter: SetLimite
|
||||
|
||||
const [activeChannel, setActiveChannel] = useState<OutputChannel>(outputs[0]);
|
||||
const [liveLim, setLiveLim] = useState<Partial<Record<OutputChannel, LimiterValues>>>({});
|
||||
const [view, setView] = useState<LimiterView>('controls');
|
||||
|
||||
const handleLiveValue = (channel: OutputChannel, key: LimiterParamKey, value: number) => {
|
||||
setActiveChannel(channel);
|
||||
@@ -118,7 +130,28 @@ function LimiterSection({ dsp, set_limiter }: { dsp: DSP; set_limiter: SetLimite
|
||||
const activeLim = liveLim[activeChannel] ?? (activeOutputState.limiter as LimiterValues);
|
||||
|
||||
return (
|
||||
<>
|
||||
<div className="limiter-page" data-view={view}>
|
||||
{/* Phone only (hidden on desktop by CSS): one view at a time */}
|
||||
<div className="limiter-tabs" role="tablist" aria-label="Limiter views">
|
||||
{LIMITER_VIEWS.map((v) => (
|
||||
<button
|
||||
key={v.id}
|
||||
type="button"
|
||||
role="tab"
|
||||
aria-selected={view === v.id}
|
||||
className="limiter-tabs__tab"
|
||||
onClick={() => setView(v.id)}
|
||||
>
|
||||
{v.label}
|
||||
</button>
|
||||
))}
|
||||
</div>
|
||||
|
||||
{/* Portrait phone only (CSS): the graph needs the width of landscape */}
|
||||
<div className="limiter-rotate-hint">
|
||||
Rotate your phone to landscape to see the limiter graph.
|
||||
</div>
|
||||
|
||||
<div className="limiter-linear-graph-section">
|
||||
<div className="limiter-graph-panel">
|
||||
<div className="limiter-graph__title">{activeOutputState.name} - Limiter</div>
|
||||
@@ -135,7 +168,7 @@ function LimiterSection({ dsp, set_limiter }: { dsp: DSP; set_limiter: SetLimite
|
||||
key={output}
|
||||
label={outputState.name}
|
||||
meter={dsp.output_meters.meters[output]}
|
||||
variant='output'
|
||||
variant="output"
|
||||
/>
|
||||
);
|
||||
})}
|
||||
@@ -158,8 +191,8 @@ function LimiterSection({ dsp, set_limiter }: { dsp: DSP; set_limiter: SetLimite
|
||||
</ChannelGroup>
|
||||
</div>
|
||||
</div>
|
||||
</>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
|
||||
export default LimiterSection;
|
||||
export default LimiterSection;
|
||||
@@ -1,4 +1,18 @@
|
||||
/* MatrixSection.css */
|
||||
/* Matrixsection.css (imported as './Matrixsection.css') */
|
||||
|
||||
/* ---------- Page wrapper ---------- */
|
||||
|
||||
.matrix-page {
|
||||
display: contents; /* invisible on desktop; a flex column on phones */
|
||||
}
|
||||
|
||||
.matrix-tabs,
|
||||
.matrix-rotate-hint {
|
||||
display: none; /* phones only */
|
||||
}
|
||||
|
||||
/* ---------- Routing strip ---------- */
|
||||
|
||||
.matrix-section {
|
||||
container-type: size;
|
||||
position: absolute;
|
||||
@@ -96,6 +110,19 @@
|
||||
flex: 0 0 auto;
|
||||
}
|
||||
|
||||
.matrix-gain-stepper .choice-stepper__input {
|
||||
font-size: 2.8cqh;
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
.matrix-gain-stepper .choice-stepper__arrows {
|
||||
flex: 0 0 20%;
|
||||
width: 20%;
|
||||
padding-right: 0;
|
||||
}
|
||||
|
||||
/* ---------- Signal flow ---------- */
|
||||
|
||||
.matrix-flow {
|
||||
flex: 0 0 calc(100% - var(--dsp-control-heigth));
|
||||
min-height: 0;
|
||||
@@ -107,13 +134,291 @@
|
||||
-webkit-user-select: none;
|
||||
}
|
||||
|
||||
.matrix-gain-stepper .choice-stepper__input {
|
||||
font-size: 2.8cqh;
|
||||
text-align: center;
|
||||
/* ---------- Phone (shared) ----------
|
||||
Landscape: tabs (Routing / Signal flow), one view at a time.
|
||||
Portrait: routing only + a hint to rotate for the signal flow. */
|
||||
|
||||
@media (max-width: 768px), (max-height: 500px) and (pointer: coarse) {
|
||||
.matrix-page {
|
||||
flex: 1 1 0;
|
||||
min-height: 0;
|
||||
width: 100%;
|
||||
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
background: var(--bg-panel);
|
||||
}
|
||||
|
||||
/* ----- Tabs ----- */
|
||||
|
||||
.matrix-tabs {
|
||||
flex: 0 0 auto;
|
||||
display: flex;
|
||||
gap: var(--space-1);
|
||||
padding: var(--space-1) var(--space-2);
|
||||
border-bottom: var(--border-width) solid var(--border-hairline);
|
||||
}
|
||||
|
||||
.matrix-page .matrix-tabs__tab {
|
||||
flex: 1 1 0;
|
||||
min-width: 0;
|
||||
min-height: 0;
|
||||
height: 34px;
|
||||
padding: 0 var(--space-2);
|
||||
|
||||
font-family: var(--font-ui);
|
||||
font-size: var(--font-xs);
|
||||
font-weight: var(--font-weight-semibold);
|
||||
white-space: nowrap;
|
||||
overflow: hidden;
|
||||
text-overflow: ellipsis;
|
||||
|
||||
background: var(--bg-void);
|
||||
color: var(--text-muted);
|
||||
border: var(--border-width) solid var(--border-hairline);
|
||||
border-radius: var(--radius-sm);
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
.matrix-page .matrix-tabs__tab[aria-selected='true'] {
|
||||
background: var(--bg-raised);
|
||||
color: var(--text-primary);
|
||||
border-color: var(--accent-brand);
|
||||
}
|
||||
|
||||
/* ----- Which view is visible ----- */
|
||||
|
||||
.matrix-page[data-view='controls'] .matrix-flow,
|
||||
.matrix-page[data-view='flow'] .matrix-section {
|
||||
display: none;
|
||||
}
|
||||
|
||||
/* ----- Flow view: fills everything ----- */
|
||||
|
||||
.matrix-flow {
|
||||
flex: 1 1 0;
|
||||
min-height: 0;
|
||||
padding: var(--space-1);
|
||||
border-bottom: none;
|
||||
}
|
||||
|
||||
/* ----- Routing view: strips, swipe sideways, snap per panel ----- */
|
||||
|
||||
.matrix-section {
|
||||
position: relative;
|
||||
z-index: auto;
|
||||
flex: 1 1 0;
|
||||
height: auto;
|
||||
min-height: 0;
|
||||
|
||||
align-items: stretch;
|
||||
justify-content: flex-start;
|
||||
border-top: none;
|
||||
}
|
||||
|
||||
.matrix-panels {
|
||||
display: flex;
|
||||
justify-content: flex-start; /* desktop's "center" would clip the left side on overflow */
|
||||
width: 100%;
|
||||
min-width: 0;
|
||||
height: auto;
|
||||
gap: var(--space-3);
|
||||
padding: var(--space-2);
|
||||
box-sizing: border-box;
|
||||
|
||||
overflow-x: auto;
|
||||
overflow-y: hidden;
|
||||
scroll-snap-type: x proximity;
|
||||
overscroll-behavior-x: contain;
|
||||
-webkit-overflow-scrolling: touch;
|
||||
}
|
||||
|
||||
/* The group is as wide as its strips (never shrunk to the viewport),
|
||||
so .matrix-panels is the only thing that scrolls. */
|
||||
.matrix-section .channel-group {
|
||||
flex: 0 0 auto;
|
||||
width: max-content;
|
||||
max-width: none;
|
||||
margin: 0;
|
||||
padding: 30px var(--space-2) var(--space-2);
|
||||
scroll-snap-align: start;
|
||||
}
|
||||
|
||||
.matrix-section .channel-group__label {
|
||||
top: 7px;
|
||||
font-size: var(--font-sm);
|
||||
}
|
||||
|
||||
.matrix-section .channel-group__items {
|
||||
height: auto;
|
||||
align-self: stretch;
|
||||
justify-content: flex-start;
|
||||
gap: var(--space-2);
|
||||
overflow: visible; /* no nested scroller: it would fight with .matrix-panels */
|
||||
}
|
||||
|
||||
/* Centered when everything fits, left-aligned and scrollable when it doesn't */
|
||||
.matrix-panels > .channel-group:first-child {
|
||||
margin-left: auto;
|
||||
}
|
||||
|
||||
.matrix-panels > .channel-group:last-child {
|
||||
margin-right: auto;
|
||||
}
|
||||
|
||||
/* One strip per output: 4 rows of [input button | gain stepper] */
|
||||
.matrix-panel {
|
||||
flex: 0 0 auto;
|
||||
width: clamp(180px, 26vw, 220px);
|
||||
height: auto; /* stretches to the row */
|
||||
aspect-ratio: auto;
|
||||
scroll-snap-align: start;
|
||||
}
|
||||
|
||||
.matrix-panel__title {
|
||||
padding-block: var(--space-1);
|
||||
font-size: var(--font-xs);
|
||||
}
|
||||
|
||||
.matrix-panel__rows {
|
||||
gap: var(--space-1);
|
||||
padding: var(--space-1);
|
||||
}
|
||||
|
||||
.matrix-panel__row {
|
||||
grid-template-columns: minmax(0, 1fr) minmax(0, 1.6fr);
|
||||
gap: var(--space-1);
|
||||
padding-inline: 0;
|
||||
align-items: center;
|
||||
}
|
||||
|
||||
/* Input toggle: fixed readable size, overrides the desktop inline cqh styles */
|
||||
.matrix-panel .matrix-panel__btn {
|
||||
width: 100%;
|
||||
height: 36px !important;
|
||||
min-height: 0 !important;
|
||||
margin: 0 !important;
|
||||
padding: 0 !important;
|
||||
font-size: 11px !important;
|
||||
overflow: hidden;
|
||||
text-overflow: ellipsis;
|
||||
white-space: nowrap;
|
||||
}
|
||||
|
||||
.matrix-panel__row .choice-stepper {
|
||||
aspect-ratio: auto;
|
||||
width: 100%;
|
||||
height: 36px;
|
||||
min-height: 0;
|
||||
}
|
||||
|
||||
.matrix-gain-stepper .choice-stepper__input {
|
||||
font-size: 11px;
|
||||
}
|
||||
}
|
||||
|
||||
.matrix-gain-stepper .choice-stepper__arrows {
|
||||
flex: 0 0 20%;
|
||||
width: 20%;
|
||||
padding-right: 0;
|
||||
/* ---------- Portrait phone: routing only, 8 panels in 2 rows ---------- */
|
||||
|
||||
@media (max-width: 768px) and (orientation: portrait) {
|
||||
.matrix-tabs {
|
||||
display: none;
|
||||
}
|
||||
|
||||
.matrix-rotate-hint {
|
||||
flex: 0 0 auto;
|
||||
display: block;
|
||||
padding: var(--space-1) var(--space-2);
|
||||
|
||||
font-family: var(--font-ui);
|
||||
font-size: 11px;
|
||||
text-align: center;
|
||||
color: var(--text-muted);
|
||||
|
||||
border-bottom: var(--border-width) solid var(--border-hairline);
|
||||
}
|
||||
|
||||
/* Whatever tab was active in landscape, portrait always shows the routing */
|
||||
.matrix-page[data-view] .matrix-flow {
|
||||
display: none;
|
||||
}
|
||||
|
||||
.matrix-page[data-view] .matrix-section {
|
||||
display: flex;
|
||||
}
|
||||
|
||||
/* Swipe sideways: both rows move together (Out1-4 on top, Out5-8 below) */
|
||||
.matrix-panels {
|
||||
padding: var(--space-1);
|
||||
gap: 0;
|
||||
}
|
||||
|
||||
.matrix-section .channel-group {
|
||||
padding: 28px var(--space-1) var(--space-1);
|
||||
}
|
||||
|
||||
.matrix-section .channel-group__label {
|
||||
top: 6px;
|
||||
font-size: var(--font-xs);
|
||||
}
|
||||
|
||||
.matrix-section .channel-group__items {
|
||||
flex: 1 1 auto;
|
||||
min-height: 0;
|
||||
|
||||
display: grid;
|
||||
grid-template-columns: repeat(4, clamp(170px, 50vw, 210px));
|
||||
grid-template-rows: repeat(2, minmax(0, 1fr));
|
||||
gap: var(--space-1);
|
||||
}
|
||||
|
||||
.matrix-panel {
|
||||
width: 100%;
|
||||
min-width: 0;
|
||||
min-height: 0;
|
||||
margin: 0;
|
||||
}
|
||||
|
||||
.matrix-panel__title {
|
||||
padding-block: 4px;
|
||||
font-size: 11px;
|
||||
}
|
||||
|
||||
.matrix-panel__rows {
|
||||
grid-template-rows: repeat(4, minmax(0, 1fr));
|
||||
gap: 2px;
|
||||
padding: 4px;
|
||||
}
|
||||
|
||||
.matrix-panel .matrix-panel__btn {
|
||||
height: min(36px, 100%) !important;
|
||||
}
|
||||
|
||||
.matrix-panel__row .choice-stepper {
|
||||
height: min(36px, 100%);
|
||||
}
|
||||
}
|
||||
|
||||
/* ---------- Landscape phone: thinner strips ---------- */
|
||||
|
||||
@media (max-height: 500px) and (pointer: coarse) {
|
||||
.matrix-panels {
|
||||
padding: var(--space-1) var(--space-2);
|
||||
}
|
||||
|
||||
.matrix-section .channel-group {
|
||||
padding-top: 24px;
|
||||
}
|
||||
|
||||
.matrix-section .channel-group__label {
|
||||
top: 4px;
|
||||
font-size: var(--font-xs);
|
||||
}
|
||||
|
||||
.matrix-panel {
|
||||
width: clamp(170px, 24vw, 210px);
|
||||
}
|
||||
|
||||
.matrix-panel__title {
|
||||
font-size: 11px;
|
||||
}
|
||||
}
|
||||
@@ -24,6 +24,14 @@ const GAIN_VALUES: number[] = (() => {
|
||||
return values;
|
||||
})();
|
||||
|
||||
// Phone only: one view at a time (CSS hides the tabs on desktop)
|
||||
type MatrixView = 'controls' | 'flow';
|
||||
|
||||
const MATRIX_VIEWS: { id: MatrixView; label: string }[] = [
|
||||
{ id: 'controls', label: 'Routing' },
|
||||
{ id: 'flow', label: 'Signal flow' },
|
||||
];
|
||||
|
||||
function getMatrixRoutes(dsp: DSP, output: OutputChannel): MatrixRoutes {
|
||||
return dsp.state.current_config.output_states[output].matrix_routes;
|
||||
}
|
||||
@@ -61,6 +69,8 @@ function MatrixSection({
|
||||
) => Promise<boolean>;
|
||||
setActiveSidebar: React.Dispatch<React.SetStateAction<SidebarId>>;
|
||||
}) {
|
||||
const [view, setView] = useState<MatrixView>('controls');
|
||||
|
||||
const handleToggle = (output: OutputChannel, input: InputChannel) => {
|
||||
const current = getRoutedInputs(dsp, output);
|
||||
|
||||
@@ -91,7 +101,28 @@ function MatrixSection({
|
||||
};
|
||||
|
||||
return (
|
||||
<>
|
||||
<div className="matrix-page" data-view={view}>
|
||||
{/* Phone only (hidden on desktop by CSS): one view at a time */}
|
||||
<div className="matrix-tabs" role="tablist" aria-label="Matrix views">
|
||||
{MATRIX_VIEWS.map((v) => (
|
||||
<button
|
||||
key={v.id}
|
||||
type="button"
|
||||
role="tab"
|
||||
aria-selected={view === v.id}
|
||||
className="matrix-tabs__tab"
|
||||
onClick={() => setView(v.id)}
|
||||
>
|
||||
{v.label}
|
||||
</button>
|
||||
))}
|
||||
</div>
|
||||
|
||||
{/* Portrait phone only (CSS): the signal flow needs the width of landscape */}
|
||||
<div className="matrix-rotate-hint">
|
||||
Rotate your phone to landscape to see the signal flow.
|
||||
</div>
|
||||
|
||||
<div className="matrix-flow">
|
||||
<SignalFlowMatrix
|
||||
dsp={dsp}
|
||||
@@ -119,7 +150,7 @@ function MatrixSection({
|
||||
<div className="matrix-panel__row" key={String(input)}>
|
||||
<Button
|
||||
variant="toggle"
|
||||
className={connected ? 'active-info' : ''}
|
||||
className={`matrix-panel__btn${connected ? ' active-info' : ''}`}
|
||||
style={{
|
||||
fontSize: '4cqh',
|
||||
padding: 0,
|
||||
@@ -148,8 +179,8 @@ function MatrixSection({
|
||||
</ChannelGroup>
|
||||
</div>
|
||||
</div>
|
||||
</>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
|
||||
export default MatrixSection;
|
||||
export default MatrixSection;
|
||||
@@ -137,20 +137,92 @@
|
||||
margin-top: var(--space-2);
|
||||
}
|
||||
|
||||
/* Mobile */
|
||||
/* ---------- Phone (shared) ---------- */
|
||||
|
||||
@media (max-width: 600px) {
|
||||
@media (max-width: 768px), (max-height: 500px) and (pointer: coarse) {
|
||||
.copy-channel-overlay {
|
||||
padding: var(--space-2);
|
||||
box-sizing: border-box;
|
||||
}
|
||||
|
||||
.copy-channel-modal {
|
||||
--card-control-height: 44px;
|
||||
|
||||
width: 100%;
|
||||
max-width: 440px;
|
||||
max-height: calc(100dvh - var(--space-4));
|
||||
box-sizing: border-box;
|
||||
|
||||
overflow-x: hidden;
|
||||
overflow-y: auto;
|
||||
}
|
||||
|
||||
/* From / arrow / To stacked */
|
||||
.copy-channel-modal__transfer {
|
||||
flex-direction: column;
|
||||
align-items: stretch;
|
||||
gap: var(--space-2);
|
||||
}
|
||||
|
||||
.copy-channel-modal__arrow {
|
||||
width: 100%;
|
||||
height: auto;
|
||||
}
|
||||
|
||||
/* Rotate the SVG only, so the container keeps a sensible size */
|
||||
.copy-channel-modal__arrow svg {
|
||||
transform: rotate(90deg);
|
||||
}
|
||||
|
||||
.copy-channel-modal__actions {
|
||||
justify-content: flex-start;
|
||||
flex-wrap: wrap;
|
||||
flex-direction: column-reverse;
|
||||
align-items: stretch;
|
||||
gap: var(--space-2);
|
||||
}
|
||||
|
||||
.copy-channel-modal__actions > * {
|
||||
width: 100%;
|
||||
}
|
||||
}
|
||||
|
||||
/* ---------- Landscape phone: From -> To on one row ---------- */
|
||||
|
||||
@media (max-height: 500px) and (pointer: coarse) {
|
||||
.copy-channel-modal {
|
||||
--card-control-height: 36px;
|
||||
}
|
||||
|
||||
.copy-channel-modal__transfer {
|
||||
flex-direction: row;
|
||||
align-items: flex-end;
|
||||
gap: var(--space-3);
|
||||
}
|
||||
|
||||
.copy-channel-modal__arrow {
|
||||
width: auto;
|
||||
height: var(--card-control-height);
|
||||
}
|
||||
|
||||
.copy-channel-modal__arrow svg {
|
||||
transform: none;
|
||||
}
|
||||
|
||||
.copy-channel-modal__actions {
|
||||
flex-direction: row;
|
||||
align-items: center;
|
||||
justify-content: flex-end;
|
||||
}
|
||||
|
||||
.copy-channel-modal__actions > * {
|
||||
width: auto;
|
||||
}
|
||||
}
|
||||
|
||||
@keyframes copy-channel-slide-up {
|
||||
from {
|
||||
transform: translateY(100%);
|
||||
}
|
||||
to {
|
||||
transform: translateY(0);
|
||||
}
|
||||
}
|
||||
@@ -1,4 +1,5 @@
|
||||
import { useEffect, useMemo, useState } from 'react';
|
||||
import { createPortal } from 'react-dom';
|
||||
|
||||
import { Channel, InputChannel, OutputChannel } from '../../types';
|
||||
import Button from '../../../../components/Button/Button';
|
||||
@@ -70,7 +71,7 @@ function CopyChannelModal({
|
||||
}
|
||||
};
|
||||
|
||||
return (
|
||||
return createPortal(
|
||||
<div
|
||||
className="copy-channel-overlay"
|
||||
onMouseDown={(e) => {
|
||||
@@ -138,7 +139,8 @@ function CopyChannelModal({
|
||||
</Button>
|
||||
</div>
|
||||
</Card>
|
||||
</div>
|
||||
</div>,
|
||||
document.body
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
@@ -223,15 +223,174 @@
|
||||
margin-top: var(--space-2);
|
||||
}
|
||||
|
||||
/* Mobile */
|
||||
/* ---------- Phone (shared) ---------- */
|
||||
|
||||
@media (max-width: 768px), (max-height: 500px) and (pointer: coarse) {
|
||||
.link-channels-overlay {
|
||||
padding: var(--space-2);
|
||||
box-sizing: border-box;
|
||||
}
|
||||
|
||||
.link-channels-modal {
|
||||
--card-control-height: 44px;
|
||||
|
||||
width: 100%;
|
||||
max-width: 480px;
|
||||
max-height: calc(100dvh - var(--space-4));
|
||||
box-sizing: border-box;
|
||||
|
||||
overflow-x: hidden;
|
||||
overflow-y: auto;
|
||||
}
|
||||
|
||||
.link-channels-modal__mode-toggle {
|
||||
display: grid;
|
||||
grid-template-columns: 1fr 1fr;
|
||||
width: 100%;
|
||||
box-sizing: border-box;
|
||||
}
|
||||
|
||||
/* Same specificity as the base rule, so it can't be beaten by a global touch rule */
|
||||
.link-channels-modal .link-channels-modal__mode-btn {
|
||||
flex: none;
|
||||
height: 100%;
|
||||
min-height: 0;
|
||||
padding: 0 var(--space-2);
|
||||
font-size: var(--font-sm);
|
||||
border-width: var(--border-width);
|
||||
-webkit-appearance: none;
|
||||
appearance: none;
|
||||
}
|
||||
|
||||
.link-channels-modal__mode-btn {
|
||||
flex: 1;
|
||||
}
|
||||
|
||||
/* Matrix: "Out1".."Out8" at --font-sm needs ~310px, so smaller labels and gaps */
|
||||
.link-matrix {
|
||||
gap: 2px;
|
||||
width: 100%;
|
||||
box-sizing: border-box;
|
||||
}
|
||||
|
||||
.link-matrix__col-label,
|
||||
.link-matrix__row-label {
|
||||
min-width: 0;
|
||||
font-size: 10px;
|
||||
letter-spacing: -0.02em;
|
||||
}
|
||||
|
||||
.link-matrix__row-label {
|
||||
padding-right: var(--space-1);
|
||||
}
|
||||
|
||||
@media (max-width: 600px) {
|
||||
.link-matrix__cell {
|
||||
min-width: 26px;
|
||||
position: relative;
|
||||
width: 100%;
|
||||
max-width: 32px;
|
||||
height: auto;
|
||||
min-width: 0;
|
||||
aspect-ratio: 1 / 1;
|
||||
}
|
||||
|
||||
/* Bigger invisible tap area, same visual size */
|
||||
.link-matrix__cell--toggle::after {
|
||||
content: '';
|
||||
position: absolute;
|
||||
inset: -2px;
|
||||
}
|
||||
|
||||
/* No sticky hover state on touch */
|
||||
.link-matrix__cell--toggle:hover {
|
||||
border-color: var(--border-hairline);
|
||||
}
|
||||
|
||||
.link-matrix__cell--toggle.is-active:hover {
|
||||
border-color: var(--accent-brand);
|
||||
}
|
||||
|
||||
.link-channels-modal__actions {
|
||||
justify-content: flex-start;
|
||||
flex-wrap: wrap;
|
||||
flex-direction: column-reverse;
|
||||
align-items: stretch;
|
||||
gap: var(--space-2);
|
||||
}
|
||||
}
|
||||
|
||||
.link-channels-modal__actions > * {
|
||||
width: 100%;
|
||||
}
|
||||
}
|
||||
|
||||
/* ---------- Landscape phone: controls left, matrix right ---------- */
|
||||
|
||||
@media (max-height: 500px) and (pointer: coarse) {
|
||||
.link-channels-modal {
|
||||
--card-control-height: 34px;
|
||||
|
||||
max-width: 640px;
|
||||
|
||||
display: grid;
|
||||
grid-template-columns: minmax(0, 1fr) auto;
|
||||
grid-template-rows: auto auto 1fr;
|
||||
grid-template-areas:
|
||||
'header matrix'
|
||||
'toggle matrix'
|
||||
'actions matrix';
|
||||
column-gap: var(--space-4);
|
||||
align-items: start;
|
||||
}
|
||||
|
||||
.link-channels-modal__header {
|
||||
grid-area: header;
|
||||
margin-bottom: var(--space-2);
|
||||
}
|
||||
|
||||
.link-channels-modal__mode-toggle {
|
||||
grid-area: toggle;
|
||||
margin-bottom: 0;
|
||||
}
|
||||
|
||||
.link-matrix {
|
||||
grid-area: matrix;
|
||||
align-self: center;
|
||||
justify-self: center;
|
||||
|
||||
display: grid;
|
||||
grid-auto-rows: 22px;
|
||||
align-content: center;
|
||||
|
||||
width: max-content;
|
||||
min-width: calc(38px + (8 * 22px) + (8 * 3px));
|
||||
min-height: calc(9 * 22px + 8 * 3px);
|
||||
gap: 3px;
|
||||
|
||||
box-sizing: border-box;
|
||||
}
|
||||
|
||||
.link-matrix__cell {
|
||||
width: 22px;
|
||||
height: 16px;
|
||||
min-height: 0;
|
||||
aspect-ratio: auto;
|
||||
align-self: center;
|
||||
}
|
||||
|
||||
.link-channels-modal__actions {
|
||||
grid-area: actions;
|
||||
align-self: end;
|
||||
flex-direction: row;
|
||||
justify-content: flex-end;
|
||||
}
|
||||
|
||||
.link-channels-modal__actions > * {
|
||||
width: auto;
|
||||
}
|
||||
}
|
||||
|
||||
@keyframes link-channels-slide-up {
|
||||
from {
|
||||
transform: translateY(100%);
|
||||
}
|
||||
to {
|
||||
transform: translateY(0);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
import { useEffect, useState } from 'react';
|
||||
import { createPortal } from 'react-dom';
|
||||
|
||||
import { DSP408 } from '../../../../types';
|
||||
import { Channel, InputChannel, OutputChannel } from '../../types';
|
||||
@@ -244,7 +245,7 @@ function LinkChannelsModal({
|
||||
}
|
||||
};
|
||||
|
||||
return (
|
||||
return createPortal(
|
||||
<div
|
||||
className="link-channels-overlay"
|
||||
onMouseDown={(e) => {
|
||||
@@ -286,7 +287,9 @@ function LinkChannelsModal({
|
||||
|
||||
<div
|
||||
className="link-matrix"
|
||||
style={{ gridTemplateColumns: `auto repeat(${channels.length}, 1fr)` }}
|
||||
style={{
|
||||
gridTemplateColumns: `minmax(38px, auto) repeat(${channels.length}, minmax(28px, 1fr))`,
|
||||
}}
|
||||
>
|
||||
<div className="link-matrix__corner" />
|
||||
|
||||
@@ -361,7 +364,8 @@ function LinkChannelsModal({
|
||||
</Button>
|
||||
</div>
|
||||
</Card>
|
||||
</div>
|
||||
</div>,
|
||||
document.body
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
@@ -178,21 +178,6 @@
|
||||
height: 65%;
|
||||
}
|
||||
|
||||
|
||||
|
||||
/* Mobile */
|
||||
|
||||
@media (max-width: 600px) {
|
||||
.miscellaneous-panel__row {
|
||||
flex-direction: column;
|
||||
}
|
||||
|
||||
.miscellaneous-panel__actions {
|
||||
justify-content: flex-start;
|
||||
flex-wrap: wrap;
|
||||
}
|
||||
}
|
||||
|
||||
.miscellaneous-panel {
|
||||
user-select: none;
|
||||
-webkit-user-select: none;
|
||||
@@ -247,4 +232,139 @@
|
||||
margin-top: var(--space-5);
|
||||
}
|
||||
|
||||
/* ---------- Phone (shared) ---------- */
|
||||
|
||||
@media (max-width: 768px), (max-height: 500px) and (pointer: coarse) {
|
||||
/* Scrolls when the content is taller than the screen */
|
||||
.miscellaneous-section {
|
||||
height: 100%;
|
||||
min-height: 0;
|
||||
padding: var(--space-3);
|
||||
box-sizing: border-box;
|
||||
|
||||
overflow-x: hidden;
|
||||
overflow-y: auto;
|
||||
}
|
||||
|
||||
/* margin: auto centers both ways when it fits, and starts at the top
|
||||
(no clipping) when it doesn't. align-items: center can't do that. */
|
||||
.miscellaneous-panel {
|
||||
--card-control-height: 44px;
|
||||
|
||||
width: 100%;
|
||||
max-width: 720px;
|
||||
margin: auto;
|
||||
box-sizing: border-box;
|
||||
}
|
||||
|
||||
.miscellaneous-panel__section-header {
|
||||
flex-direction: column;
|
||||
align-items: flex-start;
|
||||
gap: var(--space-1);
|
||||
}
|
||||
|
||||
.miscellaneous-panel__row {
|
||||
flex-direction: column;
|
||||
gap: var(--space-2);
|
||||
}
|
||||
|
||||
/* 16px stops iOS Safari from zooming on focus */
|
||||
.miscellaneous-panel__field input {
|
||||
width: 100%;
|
||||
box-sizing: border-box;
|
||||
font-size: 16px;
|
||||
}
|
||||
|
||||
.miscellaneous-panel__password-toggle {
|
||||
right: 0;
|
||||
width: 44px;
|
||||
}
|
||||
|
||||
.miscellaneous-panel__actions {
|
||||
flex-direction: column;
|
||||
align-items: stretch;
|
||||
gap: var(--space-2);
|
||||
}
|
||||
|
||||
.miscellaneous-panel__actions > * {
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
.miscellaneous-panel__section--danger .miscellaneous-panel__section-header p {
|
||||
max-width: none;
|
||||
}
|
||||
|
||||
/* Confirm modal: still centered, the margin lives on the overlay */
|
||||
.confirm-modal-overlay {
|
||||
padding: var(--space-3);
|
||||
box-sizing: border-box;
|
||||
}
|
||||
|
||||
.confirm-modal {
|
||||
width: 100%;
|
||||
max-width: 400px;
|
||||
max-height: 100%;
|
||||
margin: 0;
|
||||
box-sizing: border-box;
|
||||
overflow-y: auto;
|
||||
}
|
||||
|
||||
.confirm-modal__actions {
|
||||
flex-direction: column-reverse; /* primary action on top */
|
||||
gap: var(--space-2);
|
||||
}
|
||||
|
||||
.confirm-modal__actions > * {
|
||||
width: 100%;
|
||||
}
|
||||
}
|
||||
|
||||
/* ---------- Landscape phone ---------- */
|
||||
|
||||
@media (max-height: 500px) and (pointer: coarse) {
|
||||
.miscellaneous-section {
|
||||
padding: var(--space-2);
|
||||
}
|
||||
|
||||
.miscellaneous-panel {
|
||||
--card-control-height: 36px;
|
||||
}
|
||||
|
||||
/* Title left, description right, wraps if it doesn't fit */
|
||||
.miscellaneous-panel__section-header {
|
||||
flex-direction: row;
|
||||
flex-wrap: wrap;
|
||||
align-items: baseline;
|
||||
justify-content: space-between;
|
||||
gap: 0 var(--space-3);
|
||||
}
|
||||
|
||||
.miscellaneous-panel__section-header p {
|
||||
flex: 1 1 200px;
|
||||
min-width: 0;
|
||||
text-align: right;
|
||||
}
|
||||
|
||||
.miscellaneous-panel__row {
|
||||
flex-direction: row;
|
||||
gap: var(--space-3);
|
||||
}
|
||||
|
||||
.miscellaneous-panel__actions {
|
||||
flex-direction: row;
|
||||
align-items: center;
|
||||
justify-content: flex-end;
|
||||
}
|
||||
|
||||
.miscellaneous-panel__actions > * {
|
||||
width: auto;
|
||||
}
|
||||
|
||||
.confirm-modal__actions {
|
||||
flex-direction: row;
|
||||
}
|
||||
|
||||
.confirm-modal__actions > * {
|
||||
width: auto;
|
||||
}
|
||||
}
|
||||
@@ -187,10 +187,6 @@
|
||||
color: var(--border-hairline);
|
||||
}
|
||||
|
||||
.choice-stepper__input:disabled {
|
||||
cursor: not-allowed;
|
||||
}
|
||||
|
||||
/* ---------- Phone / touch ---------- */
|
||||
|
||||
@media (pointer: coarse) {
|
||||
|
||||
@@ -87,6 +87,7 @@
|
||||
/* ---------- SideBar ---------- */
|
||||
--sidebar-width-collapsed: calc(var(--header-height) * 0.85 + 2 * var(--space-3));
|
||||
--sidebar-width-expanded: 11rem;
|
||||
--sidebar-rail-w: var(--sidebar-width-collapsed);
|
||||
|
||||
/* ---------- DSP ---------- */
|
||||
--dsp-control-heigth: 40%;
|
||||
@@ -106,6 +107,7 @@
|
||||
--tab-height: 2.2rem;
|
||||
--sidebar-width-collapsed: 3.1rem;
|
||||
--sidebar-width-expanded: min(80vw, 15.5rem);
|
||||
--sidebar-rail-w: calc(var(--sidebar-width-collapsed) + var(--safe-left));
|
||||
--touch-target: 2.45rem;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user