Skip to content

Commit da5b472

Browse files
feat: style and animation tweaks
1 parent 9aa622e commit da5b472

File tree

8 files changed

+29
-6
lines changed

8 files changed

+29
-6
lines changed

package.json

+1
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,7 @@
5757
"react-dom": "19.0.0",
5858
"swr": "2.3.3",
5959
"tailwind-merge": "3.0.2",
60+
"tailwindcss-motion": "1.1.0",
6061
"waku": "0.21.23",
6162
"zod": "3.24.2"
6263
},

pnpm-lock.yaml

+12
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/pages/library/components/app-layout.tsx

+3-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import { type ReactNode, type UIEventHandler, useMemo } from 'react'
2-
import { getContextData } from 'waku/middleware/context'
2+
import { getContext, getContextData } from 'waku/middleware/context'
33
import { ScrollArea } from '@/pages/components/radix-themes.ts'
44
import { ServerDataContextProvider } from './server-data-context-provider.tsx'
55
import { SidebarLinks } from './sidebar-links.tsx'
@@ -21,6 +21,7 @@ export default function AppLayout({
2121
serverData,
2222
sidebar = defaultSidebar,
2323
}: AppLayoutProps) {
24+
const { req } = getContext()
2425
const { preference } = getContextData()
2526
const value = useMemo(() => ({ preference, ...serverData }), [preference, serverData])
2627

@@ -39,7 +40,7 @@ export default function AppLayout({
3940

4041
<div className='flex h-full flex-1'>
4142
<div className='relative my-4 mr-4 flex flex-1 overflow-hidden rounded bg-zinc-50 shadow-[0_0_12px] shadow-black/10'>
42-
<MainScrollArea className='z-1 relative flex-1 p-4' size='2'>
43+
<MainScrollArea className='z-1 relative flex-1 p-4' key={req.url.pathname} size='2'>
4344
<main className='min-h-full'>{children}</main>
4445
</MainScrollArea>
4546
{append}

src/pages/library/components/device-info.tsx

+2-1
Original file line numberDiff line numberDiff line change
@@ -50,10 +50,11 @@ export async function DeviceInfo({ platform }: { platform: string }) {
5050
{platformInfo.notes}
5151
</div>
5252
</div>
53+
5354
<div className='w-lg shrink-0'>
5455
<img
5556
alt={platformInfo.name}
56-
className='h-auto w-full drop-shadow-2xl'
57+
className='motion-preset-oscillate motion-duration-2400 h-auto w-full drop-shadow-2xl [--motion-loop-translate-y:8px]'
5758
src={getCDNUrl('Mattersons/es-theme-neutral', `systems/device/${platform}.png`)}
5859
/>
5960
</div>

src/pages/library/components/sidebar-link.tsx

+1
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ export function SidebarLink({ active = false, children, href }) {
99
'mx-2 flex items-center gap-2 rounded px-4 py-2.5 font-semibold transition-colors hover:text-white',
1010
active ? 'cursor-default bg-rose-900 font-semibold text-white' : 'text-white/80 ',
1111
)}
12+
scroll
1213
to={href}
1314
unstable_pending={<div className='z-1 absolute top-0 size-full' />}
1415
>

src/pages/library/platform/rom/components/game-overlay/game-overlay.tsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ export function GameOverlay() {
3434
{show ? (
3535
<motion.div
3636
animate={{ opacity: 1, scale: 1 }}
37-
className='bg-linear-to-b backdrop-blur-xs pointer-events-auto absolute inset-0 z-10 flex h-screen w-screen flex-col bg-black/50 text-white'
37+
className='bg-linear-to-b pointer-events-auto absolute inset-0 z-10 flex h-screen w-screen flex-col bg-black/70 text-white'
3838
exit={{ opacity: 0, scale: 1.1 }}
3939
initial={{ opacity: 0, scale: 1.1 }}
4040
transition={{ duration: 0.2 }}

src/pages/library/platform/rom/components/launch-button.tsx

+8-2
Original file line numberDiff line numberDiff line change
@@ -23,14 +23,20 @@ export function LaunchButton() {
2323
return (
2424
<button
2525
className={clsx(
26-
'inline-flex h-16 w-72 items-center justify-center gap-1.5 rounded bg-[var(--theme)] text-xl font-bold text-white',
26+
'inline-flex h-16 w-72 items-center justify-center gap-3 rounded bg-[var(--theme)] text-xl font-bold text-white',
2727
{ 'opacity-50': isPreparing },
2828
)}
2929
disabled={isPreparing}
3030
onClick={launch}
3131
type='button'
3232
>
33-
<span className={isPreparing ? 'icon-[mdi--loading] animate-spin' : 'icon-[mdi--play]'} />
33+
<span
34+
className={
35+
isPreparing
36+
? 'icon-[mdi--loading] animate-spin'
37+
: 'icon-[mdi--play] motion-preset-pulse-lg motion-duration-1000'
38+
}
39+
/>
3440
{isPreparing ? 'Loading...' : 'Press any key to start'}
3541
</button>
3642
)

src/styles/globals.css

+1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
@import 'tailwindcss';
22
@plugin "@iconify/tailwind4";
33
@plugin "@tailwindcss/typography";
4+
@plugin "tailwindcss-motion";
45

56
body {
67
-moz-osx-font-smoothing: grayscale;

0 commit comments

Comments
 (0)