Skip to content

176 web animation techniques, each a live demo with plain settings and a ready-made prompt for your AI assistant. No dependencies, no build step.

fix: Pull to Refresh: Compare's posed spinner keeps its round shape on phones, and See inside's still spinner and its label form one chip with no letter of the card showing between them

matin77999dd9184a
diff --git a/animations/04-micro-interactions/pull-to-refresh/index.html b/animations/04-micro-interactions/pull-to-refresh/index.html
index f913b304..29b1d83e 100644
--- a/animations/04-micro-interactions/pull-to-refresh/index.html
+++ b/animations/04-micro-interactions/pull-to-refresh/index.html
@@ -85,7 +85,8 @@
.v-tip circle+circle{fill:#f4f4f2;stroke:none}
.lbl{position:absolute;padding:3px 8px;border-radius:5px;background:#0b0b0d;color:#f4f4f2;font:600 13px/1.25 var(--hb-font);white-space:nowrap}
.cmp-l{left:50%;bottom:8px;translate:-50% 0}
- .views .spin{position:absolute;left:14px;opacity:1;border-radius:50%;background:#0b0b0d;box-shadow:0 0 0 4px #0b0b0d}
+ .views .spin{position:absolute;left:14px;z-index:1;opacity:1;border-radius:50%;background:#0b0b0d}
+ #l-spin{padding:2px 8px 2px 38px}
.twin .card.fresh{animation:none}
.views .on{display:inline}
.stage[data-hb-mode="inside"] .views,.stage[data-hb-mode="inside"] .views .spin,.stage[data-hb-mode="inside"] .in-l,.stage[data-hb-mode="compare"] .views,.stage[data-hb-mode="compare"] .cmp-l{display:block}
@@ -95,6 +96,7 @@
.stage[data-hb-mode="compare"]>.twin{display:flex;flex-direction:column;grid-row:1/3;min-width:0}
.stage[data-hb-mode="compare"]>.app-bar,.stage[data-hb-mode="compare"]>.feed{grid-column:2}
.stage[data-hb-mode="compare"] .indicator{padding:0 10px}
+ .stage[data-hb-mode="compare"] .indicator .spin{flex:none}
@media(max-width:600px){.lbl{font-size:12px}}
</style>
<link rel="stylesheet" href="../../../assets/css/demo-page.css?v=10">
@@ -466,8 +468,8 @@
V.still.className=spin.className.replace(/ ?spinning/,'');V.still.style.top=(ly-55)+'px'; // where the real spinner stands with the list at the line
say(V.lFing,'Your finger: '+['nearly half as far again','almost twice as far','more than twice as far'][resistance-1]);
say(V.lSpin,'Then it spins '+(dur<1000?'under a second':dur<1600?'about a second':'for two seconds'));
- // Each label takes the first place near what it names that covers no other label, arrow, line or the spinner
- const taken=[{x:10,y:ly-59,r:44,b:ly-25},{x:0,y:ly-3,r:W,b:ly+3},{x:xL-8,y:y0-3,r:xL+8,b:ly+4},{x:xF-8,y:y0-3,r:xF+8,b:y0+F+4}];
+ // Each label takes the first place near what it names that covers no other label, arrow or the line
+ const taken=[{x:0,y:ly-3,r:W,b:ly+3},{x:xL-8,y:y0-3,r:xL+8,b:ly+4},{x:xF-8,y:y0-3,r:xF+8,b:y0+F+4}];
const hit=(a,b)=>a.x<b.r&&b.x<a.r&&a.y<b.b&&b.y<a.b;
const put=(el,x,y)=>{
const w=el.offsetWidth,h=el.offsetHeight;let best;
@@ -478,7 +480,7 @@
}
const a=best.a;el.style.left=a.x+'px';el.style.top=a.y+'px';taken.push({x:a.x-2,y:a.y-2,r:a.r+2,b:a.b+2});
};
- put(V.lSpin,50,ly-42-V.lSpin.offsetHeight/2);
+ put(V.lSpin,10,ly-43-V.lSpin.offsetHeight/2); // the label's chip reaches under the spinner, so no part of the card's title shows between them
put(V.lList,xL-10-V.lList.offsetWidth,ly-6-V.lList.offsetHeight);
put(V.lLine,8,ly+7);
put(V.lFing,xF-10-V.lFing.offsetWidth,y0+F-V.lFing.offsetHeight-4);