Compare commits

..

22 Commits

Author SHA1 Message Date
Cory LaViska
bcb139dcc1 update changelog 2025-03-24 16:27:18 -04:00
Cory LaViska
c66f241215 add allDefined util 2025-03-24 16:27:14 -04:00
Cory LaViska
4ea92905e8 simplify fouce util 2025-03-24 16:08:10 -04:00
Cory LaViska
c64a1754d7 no need to remove cloak class 2025-03-24 15:54:38 -04:00
Cory LaViska
a2f4197098 update fouce util 2025-03-24 15:49:25 -04:00
Cory LaViska
b0cf8bffa8 Merge branch 'next' into fouce-class 2025-03-24 15:44:16 -04:00
konnorrogers
65df1416dd workflow dispatch 2025-02-07 11:37:31 -05:00
konnorrogers
d271929e50 fix test suite 2025-02-07 11:31:05 -05:00
Cory LaViska
70b486fa96 disable SSR 2025-02-06 16:33:54 -05:00
Cory LaViska
884e11c6d7 disable SSR and add Turbo FOUCE helper 2025-02-06 16:22:29 -05:00
Cory LaViska
c0f558f52a reduce fade 2025-02-06 16:13:15 -05:00
Cory LaViska
af96d869ee move turbo to same file 2025-02-06 15:52:28 -05:00
Cory LaViska
d626d2c693 wait a cycle 2025-02-06 15:52:04 -05:00
Cory LaViska
96013f2d55 add cloak class 2025-02-06 15:29:33 -05:00
Cory LaViska
0fcc9390f6 remove class as requested 2025-02-06 15:24:02 -05:00
Cory LaViska
2a488d28b0 Merge branch 'fouce-class' of https://github.com/shoelace-style/webawesome into fouce-class 2025-02-06 12:02:44 -05:00
Cory LaViska
bcc1ccaa1c rename wa-reduce-fouce to wa-cloak 2025-02-06 12:01:52 -05:00
Cory LaViska
aa3cd97dde commit PR suggestion 2025-02-06 12:01:01 -05:00
Cory LaViska
16c5489f7a Update docs/docs/installation.md
Co-authored-by: Lea Verou <lea@verou.me>
2025-02-06 11:58:04 -05:00
Cory LaViska
02d0c1be75 Merge branch 'next' into fouce-class 2025-02-06 11:57:50 -05:00
Cory LaViska
db08435739 add comment 2025-02-04 13:29:22 -05:00
Cory LaViska
72a6d8544d add fouce utilities 2025-02-04 12:56:52 -05:00

View File

@@ -4,12 +4,9 @@ export function domChange(fn, { behavior = 'smooth' } = {}) {
document.startViewTransition && !window.matchMedia('(prefers-reduced-motion: reduce)').matches;
if (canUseViewTransitions && behavior === 'smooth') {
const transition = document.startViewTransition(() => {
fn(true);
// Wait a brief delay before finishing the transition to prevent jumpiness
return new Promise(resolve => setTimeout(resolve, 200));
});
return transition;
document.startViewTransition(fn);
} else {
fn(true);
}
}