Skip to content

Commit e16e13a

Browse files
author
Rich Harris
committed
slightly more logic transition code
1 parent 27e538d commit e16e13a

File tree

2 files changed

+4
-4
lines changed
  • content/tutorial/03-advanced-svelte/02-transitions/04-custom-css-transitions

2 files changed

+4
-4
lines changed

content/tutorial/03-advanced-svelte/02-transitions/04-custom-css-transitions/README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -68,8 +68,8 @@ We can get a lot more creative though. Let's make something truly gratuitous:
6868
transform: scale(${eased}) rotate(${eased * 1080}deg);
6969
color: hsl(
7070
${Math.trunc(t * 360)},
71-
${Math.min(100, 1000 - 1000 * t)}%,
72-
${Math.min(50, 500 - 500 * t)}%
71+
${Math.min(100, 1000 * (1 - t))}%,
72+
${Math.min(50, 500 * (1 - t))}%
7373
);`
7474
}+++
7575
};

content/tutorial/03-advanced-svelte/02-transitions/04-custom-css-transitions/app-b/src/lib/App.svelte

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,8 @@
1414
transform: scale(${eased}) rotate(${eased * 1080}deg);
1515
color: hsl(
1616
${Math.trunc(t * 360)},
17-
${Math.min(100, 1000 - 1000 * t)}%,
18-
${Math.min(50, 500 - 500 * t)}%
17+
${Math.min(100, 1000 * (1 - t))}%,
18+
${Math.min(50, 500 * (1 - t))}%
1919
);`;
2020
}
2121
};

0 commit comments

Comments
 (0)