Skip to content

Commit f2f6554

Browse files
committed
feat(desktop): speed up some animations
1 parent 88060af commit f2f6554

File tree

5 files changed

+10
-13
lines changed

5 files changed

+10
-13
lines changed

apps/desktop/layer/renderer/src/modules/entry-column/Items/social-media-item.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -370,7 +370,7 @@ const CollapsedSocialMediaItem: Component<{
370370
}, [children])
371371

372372
return (
373-
<AutoResizeHeight spring className="relative">
373+
<AutoResizeHeight className="relative">
374374
<div
375375
className={cn(
376376
"relative",

apps/desktop/layer/renderer/src/modules/entry-content/AISummary.tsx

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -106,10 +106,7 @@ export function AISummary({ entryId }: { entryId: string }) {
106106
)}
107107
</div>
108108

109-
<AutoResizeHeight
110-
spring
111-
className="mt-4 text-sm leading-relaxed text-neutral-700 dark:text-neutral-300"
112-
>
109+
<AutoResizeHeight className="mt-4 text-sm leading-relaxed text-neutral-700 dark:text-neutral-300">
113110
{summary.isLoading ? (
114111
<div className="space-y-2">
115112
<div className="bg-material-ultra-thick h-3 w-full rounded-lg" />

apps/desktop/layer/renderer/src/modules/profile/user-profile-modal.shared.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,7 @@ export const SubscriptionGroup: FC<{
102102
/>
103103
</div>
104104
</button>
105-
<AutoResizeHeight duration={0.2}>
105+
<AutoResizeHeight>
106106
<AnimatePresence mode="popLayout">
107107
{isOpened && (
108108
<Fragment>

packages/internal/components/src/constants/spring.ts

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ const softBouncePreset: Spring = {
3636
*/
3737
const smoothPreset: Spring = {
3838
type: "spring",
39-
duration: 0.5,
39+
duration: 0.4,
4040
bounce: 0,
4141
}
4242

@@ -45,7 +45,7 @@ const smoothPreset: Spring = {
4545
*/
4646
const snappyPreset: Spring = {
4747
type: "spring",
48-
duration: 0.5,
48+
duration: 0.4,
4949
bounce: 0.15,
5050
}
5151

@@ -54,7 +54,7 @@ const snappyPreset: Spring = {
5454
*/
5555
const bouncyPreset: Spring = {
5656
type: "spring",
57-
duration: 0.5,
57+
duration: 0.4,
5858
bounce: 0.3,
5959
}
6060
class SpringPresets {
@@ -76,7 +76,7 @@ class SpringStatic {
7676
* @param duration The perceptual duration, which defines the pace of the spring.
7777
* @param extraBounce How much additional bounce should be added to the base bounce of 0.
7878
*/
79-
smooth(duration = 0.5, extraBounce = 0): Spring {
79+
smooth(duration = 0.4, extraBounce = 0): Spring {
8080
return {
8181
type: "spring",
8282
duration,
@@ -87,7 +87,7 @@ class SpringStatic {
8787
/**
8888
* A spring with a predefined duration and small amount of bounce that feels more snappy.
8989
*/
90-
snappy(duration = 0.5, extraBounce = 0): Spring {
90+
snappy(duration = 0.4, extraBounce = 0): Spring {
9191
return {
9292
type: "spring",
9393
duration,
@@ -98,7 +98,7 @@ class SpringStatic {
9898
/**
9999
* A spring with a predefined duration and higher amount of bounce that can be tuned.
100100
*/
101-
bouncy(duration = 0.5, extraBounce = 0): Spring {
101+
bouncy(duration = 0.4, extraBounce = 0): Spring {
102102
return {
103103
type: "spring",
104104
duration,

packages/internal/components/src/ui/auto-resize-height/index.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ interface AnimateChangeInHeightProps {
1616
export const AutoResizeHeight: React.FC<AnimateChangeInHeightProps> = ({
1717
children,
1818
className,
19-
duration = 0.35,
19+
duration = 0.2,
2020
spring = false,
2121
innerClassName,
2222
}) => {

0 commit comments

Comments
 (0)