mirror of
https://github.com/anomalyco/opencode.git
synced 2026-11-29 11:42:17 +00:00
feat(ui,app): add spring curves to menus, popovers, suggestions, and tab preview
This commit is contained in:
parent
f7c955dcbc
commit
2b60a539de
6 changed files with 57 additions and 20 deletions
|
|
@ -41,3 +41,26 @@
|
|||
[data-color-scheme="dark"] [data-component="composer-suggestions"] [data-active] {
|
||||
background: var(--v2-alpha-light-10);
|
||||
}
|
||||
|
||||
[data-component="composer-suggestions"] {
|
||||
transform-origin: bottom center;
|
||||
animation: composer-suggestions-in var(--motion-duration-fast, 160ms)
|
||||
var(--motion-spring-snappy, cubic-bezier(0.22, 1, 0.36, 1));
|
||||
}
|
||||
|
||||
@keyframes composer-suggestions-in {
|
||||
from {
|
||||
opacity: 0;
|
||||
transform: translateY(6px) scale(0.985);
|
||||
}
|
||||
to {
|
||||
opacity: 1;
|
||||
transform: translateY(0) scale(1);
|
||||
}
|
||||
}
|
||||
|
||||
@media (prefers-reduced-motion: reduce) {
|
||||
[data-component="composer-suggestions"] {
|
||||
animation: none;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -25,15 +25,14 @@
|
|||
pointer-events: none !important;
|
||||
|
||||
transform-origin: var(--kb-hovercard-content-transform-origin);
|
||||
/* Entrance: instant (trying no animation — may revert to 120ms ease-out). */
|
||||
animation: none;
|
||||
animation: sessionTabPopoverIn 140ms var(--motion-spring-snappy, cubic-bezier(0.22, 1, 0.36, 1));
|
||||
|
||||
&:focus-visible,
|
||||
&:focus-within {
|
||||
outline: none;
|
||||
}
|
||||
|
||||
/* Exit: instant (trying no animation — may revert to 80ms ease-out). */
|
||||
/* Exit: instant so pointer-leave dismisses immediately without blocking hover tracking. */
|
||||
&[data-closed] {
|
||||
animation: none;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -20,11 +20,12 @@
|
|||
}
|
||||
|
||||
&[data-closed] {
|
||||
animation: popover-close 0.15s ease-out;
|
||||
animation: popover-close 100ms var(--motion-ease-exit, cubic-bezier(0.4, 0, 1, 1)) forwards;
|
||||
}
|
||||
|
||||
&[data-expanded] {
|
||||
animation: popover-open 0.15s ease-out;
|
||||
animation: popover-open var(--motion-duration-fast, 160ms)
|
||||
var(--motion-spring-snappy, cubic-bezier(0.22, 1, 0.36, 1));
|
||||
}
|
||||
|
||||
[data-slot="popover-header"] {
|
||||
|
|
@ -78,21 +79,28 @@
|
|||
@keyframes popover-open {
|
||||
from {
|
||||
opacity: 0;
|
||||
transform: scale(0.96);
|
||||
transform: translateY(2px) scale(0.97);
|
||||
}
|
||||
to {
|
||||
opacity: 1;
|
||||
transform: scale(1);
|
||||
transform: translateY(0) scale(1);
|
||||
}
|
||||
}
|
||||
|
||||
@keyframes popover-close {
|
||||
from {
|
||||
opacity: 1;
|
||||
transform: scale(1);
|
||||
transform: translateY(0) scale(1);
|
||||
}
|
||||
to {
|
||||
opacity: 0;
|
||||
transform: scale(0.96);
|
||||
transform: translateY(1px) scale(0.98);
|
||||
}
|
||||
}
|
||||
|
||||
@media (prefers-reduced-motion: reduce) {
|
||||
[data-component="popover-content"][data-expanded],
|
||||
[data-component="popover-content"][data-closed] {
|
||||
animation: none;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -17,32 +17,33 @@
|
|||
border-radius: 6px;
|
||||
box-shadow: var(--v2-elevation-floating);
|
||||
transform-origin: top center;
|
||||
animation: select-v2-content-in 120ms ease-out;
|
||||
animation: select-v2-content-in var(--motion-duration-fast, 160ms)
|
||||
var(--motion-spring-snappy, cubic-bezier(0.22, 1, 0.36, 1));
|
||||
}
|
||||
|
||||
[data-component="menu-v2-content"][data-slot="select-v2-content"][data-closed] {
|
||||
animation: select-v2-content-out 80ms ease-in forwards;
|
||||
animation: select-v2-content-out 80ms var(--motion-ease-exit, cubic-bezier(0.4, 0, 1, 1)) forwards;
|
||||
}
|
||||
|
||||
@keyframes select-v2-content-in {
|
||||
from {
|
||||
opacity: 0;
|
||||
transform: translateY(-2px);
|
||||
transform: translateY(-2px) scale(0.98);
|
||||
}
|
||||
to {
|
||||
opacity: 1;
|
||||
transform: translateY(0);
|
||||
transform: translateY(0) scale(1);
|
||||
}
|
||||
}
|
||||
|
||||
@keyframes select-v2-content-out {
|
||||
from {
|
||||
opacity: 1;
|
||||
transform: translateY(0);
|
||||
transform: translateY(0) scale(1);
|
||||
}
|
||||
to {
|
||||
opacity: 0;
|
||||
transform: translateY(-2px);
|
||||
transform: translateY(-2px) scale(0.985);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -24,7 +24,7 @@
|
|||
text-rendering: geometricPrecision;
|
||||
|
||||
transform-origin: var(--kb-menu-content-transform-origin);
|
||||
animation: menu-v2-in 120ms ease-out;
|
||||
animation: menu-v2-in var(--motion-duration-fast, 160ms) var(--motion-spring-snappy, cubic-bezier(0.22, 1, 0.36, 1));
|
||||
|
||||
&:focus-visible {
|
||||
outline: none;
|
||||
|
|
@ -302,10 +302,16 @@
|
|||
@keyframes menu-v2-in {
|
||||
from {
|
||||
opacity: 0;
|
||||
transform: scale(0.96);
|
||||
transform: translateY(2px) scale(0.97);
|
||||
}
|
||||
to {
|
||||
opacity: 1;
|
||||
transform: scale(1);
|
||||
transform: translateY(0) scale(1);
|
||||
}
|
||||
}
|
||||
|
||||
@media (prefers-reduced-motion: reduce) {
|
||||
[data-component="menu-v2-content"] {
|
||||
animation: none;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -31,11 +31,11 @@
|
|||
user-select: none;
|
||||
pointer-events: none;
|
||||
|
||||
animation: tooltipV2In 120ms ease-out;
|
||||
animation: tooltipV2In 140ms var(--motion-spring-snappy, cubic-bezier(0.22, 1, 0.36, 1));
|
||||
transform-origin: var(--kb-tooltip-content-transform-origin);
|
||||
|
||||
&[data-closed] {
|
||||
animation: tooltipV2Out 80ms ease-in forwards;
|
||||
animation: tooltipV2Out 80ms var(--motion-ease-exit, cubic-bezier(0.4, 0, 1, 1)) forwards;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue