Skip to content

Commit 91625fa

Browse files
greatgitsbysshane
andauthored
fix: speed up drawer open + open route (commaai#553)
based on feedback from last dev call, speeding up the transitions, tweaking animation to be more like old connect https://github.com/user-attachments/assets/7db41d0b-76b0-4369-af8b-8ab01acb1028 --------- Co-authored-by: Shane Smiskol <shane@smiskol.com>
1 parent 7ecd5d4 commit 91625fa

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

src/components/RouteActions.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ const ToggleButton: VoidComponent<{
2424
}`}
2525
>
2626
<div
27-
class={`absolute top-1 size-3 rounded-full bg-surface-container-highest transition-transform duration-500 ease-in-out ${
27+
class={`absolute top-1 size-3 rounded-full bg-surface-container-highest transition-transform duration-300 ease-in-out ${
2828
props.active ? 'translate-x-5' : 'translate-x-1'
2929
}`}
3030
/>

src/components/material/Drawer.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ const Drawer: ParentComponent<DrawerProps> = (props) => {
4545
return (
4646
<DrawerContext.Provider value={{ modal, open, setOpen }}>
4747
<nav
48-
class="hide-scrollbar fixed inset-y-0 left-0 h-full touch-pan-y overflow-y-auto overscroll-y-contain transition-drawer duration-500"
48+
class="hide-scrollbar fixed inset-y-0 left-0 h-full touch-pan-y overflow-y-auto overscroll-y-contain transition-drawer ease-in-out duration-300"
4949
style={{
5050
left: drawerVisible() ? 0 : `${-PEEK}px`,
5151
opacity: drawerVisible() ? 1 : 0.5,
@@ -58,15 +58,15 @@ const Drawer: ParentComponent<DrawerProps> = (props) => {
5858
</nav>
5959

6060
<main
61-
class="absolute inset-y-0 overflow-y-auto bg-background transition-drawer duration-500"
61+
class="absolute inset-y-0 overflow-y-auto bg-background transition-drawer ease-in-out duration-300"
6262
style={{
6363
left: drawerVisible() ? `${drawerWidth()}px` : 0,
6464
width: contentWidth(),
6565
}}
6666
>
6767
{props.children}
6868
<div
69-
class="absolute inset-0 z-[9999] bg-background transition-drawer duration-500"
69+
class="absolute inset-0 z-[9999] bg-background transition-drawer ease-in-out duration-300"
7070
style={{
7171
'pointer-events': modal() && open() ? 'auto' : 'none',
7272
opacity: modal() && open() ? 0.5 : 0,

0 commit comments

Comments
 (0)