Skip to content

3D engine that AI agents drive

Fade the Object studio panel bottom edge while it has more to scroll (#2241)

Nguyen Xuan An024c0b23780b
diff --git a/scripts/smoke-scenes.mjs b/scripts/smoke-scenes.mjs
index f18b5b44..e74cab63 100644
--- a/scripts/smoke-scenes.mjs
+++ b/scripts/smoke-scenes.mjs
@@ -37,6 +37,19 @@ try {
return lastRow.bottom <= panel.getBoundingClientRect().bottom;
});
assert.ok(lastRowReachable, `Object studio Resolution row cannot be scrolled into view at ${size.width}x${size.height}.`);
+ const fade = await page.evaluate(async () => {
+ const panel = document.querySelector('.controls');
+ const read = async (top) => {
+ panel.scrollTop = top;
+ await new Promise((resolve) => requestAnimationFrame(() => requestAnimationFrame(resolve)));
+ return parseFloat(getComputedStyle(panel).getPropertyValue('--controls-fade')) || 0;
+ };
+ return { overflows: panel.scrollHeight > panel.clientHeight, atTop: await read(0), atBottom: await read(panel.scrollHeight) };
+ });
+ if (fade.overflows) {
+ assert.ok(fade.atTop > 0, `Object studio panel shows no fade while more controls are below at ${size.width}x${size.height}.`);
+ assert.equal(fade.atBottom, 0, `Object studio panel still fades at its bottom edge at ${size.width}x${size.height}.`);
+ }
}
await page.setViewportSize({ width: 1440, height: 900 });
await page.goto('http://127.0.0.1:5179/nature.html');
diff --git a/src/style.css b/src/style.css
index b1dc7ae1..b3d43429 100644
--- a/src/style.css
+++ b/src/style.css
@@ -59,7 +59,17 @@ footer button { font-size: 12px; }
h2 { font-weight: 500; font-size: 20px; margin: 0 0 15px; }
#benchmark-summary { white-space: pre-line; line-height: 1.9; font-size: 14px; font-variant-numeric: tabular-nums; }
.benchmark-note { font-size: 12px; line-height: 1.7; color: #a2afb5; }
-.controls { top:96px; max-height:calc(100svh - 96px - 84px); overflow-y:auto; overscroll-behavior:contain; }
+.controls { top:96px; max-height:calc(100svh - 96px - 84px); overflow-y:auto; overscroll-behavior:contain; scrollbar-width:thin; scrollbar-color:#b7eddf66 transparent; }
+@property --controls-fade { syntax:'<length>'; inherits:false; initial-value:0px; }
+@keyframes controls-fade-until-end { from, 90% { --controls-fade:36px; } to { --controls-fade:0px; } }
+@supports (animation-timeline: scroll()) {
+ .controls { mask-image:linear-gradient(#000 calc(100% - var(--controls-fade)), transparent); animation:controls-fade-until-end linear both; animation-timeline:scroll(self block); }
+}
+@media (min-width: 701px) {
+ .assembly-control { margin-bottom:18px; }
+ fieldset { margin-bottom:20px; }
+ .controls input[type=range] { margin-bottom:16px; }
+}
@media (max-width: 1100px) {
.object-info { top: 19%; max-width: 250px; }
h1 { font-size: 35px; }