Open a Directory category's fan of covers as one smooth motion (#132)
Hovering a category tile turned its outer two covers further out over 0.2s, and it looked choppy. Traced in Chromium, the covers were given layers of their own only once the transition began, so the browser drew them again on its first frames and again on the way back, 22 raster tasks for a hover in and out, and the main thread produced 34 frames for 0.4s of motion. Each cover now has its layer before the pointer arrives (will-change), all three move, rotate and translate are animated as properties of their own rather than as one transform list, and the fan takes 0.45s on an ease that settles. The same hover is 5 raster tasks, and the compositor presents 116 frames to the main thread's 26. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
21
web/app.css
21
web/app.css
@@ -674,12 +674,21 @@ body.scan-this .fhead [data-a=scan] .i,body.scan-any .fhead [data-a=scanall] .i,
|
||||
.cat b{font-size:16px;line-height:1.2;font-weight:650;color:var(--fg);overflow-wrap:break-word}
|
||||
.cat small{margin-top:3px;font-size:12px;color:var(--dim);font-variant-numeric:tabular-nums}
|
||||
.cat .fan{position:absolute;right:14px;bottom:-12px;width:112px;height:80px;pointer-events:none}
|
||||
.cat .fan .art{position:absolute;bottom:0;width:62px;height:62px;font-size:16px;border-radius:8px;box-shadow:0 3px 10px rgba(0,0,0,.3);transition:transform .2s ease-out}
|
||||
.cat .fan .art:nth-last-child(1){right:0;transform:rotate(8deg) translateY(-12px)}
|
||||
.cat .fan .art:nth-last-child(2){right:25px;transform:rotate(-3deg) translateY(-4px)}
|
||||
.cat .fan .art:nth-last-child(3){right:50px;transform:rotate(-13deg) translateY(4px)}
|
||||
.cat:hover .fan .art:nth-last-child(1){transform:rotate(12deg) translate(4px,-16px)}
|
||||
.cat:hover .fan .art:nth-last-child(3){transform:rotate(-18deg) translate(-6px,4px)}
|
||||
.cat .fan .art{
|
||||
position:absolute;bottom:0;width:62px;height:62px;font-size:16px;border-radius:8px;box-shadow:0 3px 10px rgba(0,0,0,.3);
|
||||
/* Each cover on a layer of its own before the pointer arrives. Given one only as the fan began
|
||||
to open, the browser drew the covers again on the first frames, and again on the way back,
|
||||
and the fan opened in a jerk (#132). All three move, for as long as the eye can follow, as
|
||||
one motion that settles rather than stops. */
|
||||
will-change:transform;
|
||||
transition:rotate .45s cubic-bezier(.2,.7,.2,1),translate .45s cubic-bezier(.2,.7,.2,1);
|
||||
}
|
||||
.cat .fan .art:nth-last-child(1){right:0;rotate:8deg;translate:0 -12px}
|
||||
.cat .fan .art:nth-last-child(2){right:25px;rotate:-3deg;translate:0 -4px}
|
||||
.cat .fan .art:nth-last-child(3){right:50px;rotate:-13deg;translate:0 4px}
|
||||
.cat:hover .fan .art:nth-last-child(1){rotate:13deg;translate:5px -17px}
|
||||
.cat:hover .fan .art:nth-last-child(2){rotate:-2deg;translate:0 -8px}
|
||||
.cat:hover .fan .art:nth-last-child(3){rotate:-19deg;translate:-7px 3px}
|
||||
/* A category's subcategories, each with how many it holds, then the order. A picked one is
|
||||
drawn as a picked tab is. */
|
||||
.dtools{display:flex;align-items:center;gap:10px 14px;margin-bottom:14px}
|
||||
|
||||
Reference in New Issue
Block a user