Skip to content

Commit e24f807

Browse files
committed
fix: update interaction scaling for various components
1 parent 9d58a84 commit e24f807

12 files changed

Lines changed: 17 additions & 36 deletions

File tree

src/lib/components/ScrollAreaItems.svelte

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@
7272
data-orientation={orientation}
7373
{...restProps}>
7474
<div
75-
class="relative flex gap-2 py-4 group-data-[orientation=horizontal]/scroll:w-max group-data-[orientation=horizontal]/scroll:flex-nowrap group-data-[orientation=vertical]/scroll:flex-wrap sm:gap-4">
75+
class="relative flex gap-2 pt-4 group-data-[orientation=horizontal]/scroll:w-max group-data-[orientation=horizontal]/scroll:flex-nowrap group-data-[orientation=vertical]/scroll:flex-wrap sm:gap-4">
7676
{@render children?.()}
7777
<div
7878
class="pointer-events-none sticky -right-1 z-10 -ml-40 w-36 self-stretch bg-linear-to-l from-background/80 to-transparent scroll-fade-x blur-xs group-data-[orientation=vertical]/scroll:hidden">

src/lib/components/header/Menu.svelte

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@
3030
</script>
3131

3232
{#snippet ListItem({ title, content, href, class: className, icon: IconComponent, ...restProps }: ListItemProps)}
33-
<NavigationMenu.Link {href} class={cn("hover:scale-95 hover:bg-background/50", className)} {...restProps}>
33+
<NavigationMenu.Link {href} class={cn("interact:scale-95 interact:bg-background/50", className)} {...restProps}>
3434
<div class="flex flex-col gap-1">
3535
<div class="flex items-center-safe gap-1">
3636
<IconComponent class="size-5" />

src/lib/components/header/settings/Packs.svelte

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -141,7 +141,7 @@
141141
<button
142142
{@attach sortable.attachHandle}
143143
type="button"
144-
class="flex size-10 shrink-0 cursor-grab touch-none items-center justify-center rounded-lg text-muted-foreground transition-[background-color,color,scale] duration-150 ease-out outline-none hover:bg-muted hover:text-foreground focus-visible:ring-3 focus-visible:ring-ring/30 active:scale-[0.96] active:cursor-grabbing"
144+
class="flex size-10 shrink-0 cursor-grab touch-none items-center justify-center rounded-lg text-muted-foreground transition-[background-color,color,scale] duration-150 ease-out outline-none hover:bg-muted hover:text-foreground focus-visible:ring-3 focus-visible:ring-ring/30 active:scale-95 active:cursor-grabbing"
145145
aria-label="Reorder {pack.name ?? pack.id}">
146146
<GripVertical class="size-4" />
147147
</button>
@@ -152,7 +152,7 @@
152152
loading="lazy"
153153
src={pack.icon}
154154
alt={pack.name}
155-
class="pointer-events-none aspect-square size-10 h-full rounded-lg outline outline-1 -outline-offset-1 outline-black/10 select-none [image-rendering:pixelated] dark:outline-white/10" />
155+
class="pointer-events-none aspect-square size-10 h-full rounded-lg outline -outline-offset-1 outline-black/10 select-none [image-rendering:pixelated] dark:outline-white/10" />
156156
<Avatar.Fallback class="flex size-10 items-center rounded-lg text-center uppercase"
157157
>{pack.name?.slice(0, 2)}</Avatar.Fallback>
158158
</Avatar.Root>

src/lib/components/item/Item.svelte

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@
4444
"overflow-clip nice-colors-dark",
4545
isInventory ? "p-0" : `relative p-2 ${bgColor}`,
4646
{ "rounded-xl": !isInventory },
47-
"standard:transition-all standard:duration-150 standard:ease-out standard:hover:scale-110 standard:active:scale-110"
47+
"standard:transition-all standard:duration-150 standard:ease-out standard:active:scale-95 standard:interact:scale-95"
4848
)}
4949
bind:ref={targetNode}
5050
onclick={() => {

src/lib/components/misc/ContributorCard.svelte

Lines changed: 2 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,8 @@
3838
<Item.Root
3939
variant="outline"
4040
class={cn("glass glass-brightness-150 glass-contrast-60 dark:glass-brightness-50 dark:glass-contrast-100", {
41-
"delay-75 duration-300 ease-out hover:scale-105 [a]:transition-[scale] standard:[a]:hover:bg-inherit": !options?.tip
41+
"delay-75 duration-300 ease-out interact:scale-95 [a]:transition-[scale] standard:[a]:hover:bg-inherit":
42+
!options?.tip
4243
})}>
4344
{#snippet child({ props })}
4445
<svelte:element
@@ -103,23 +104,3 @@
103104
</svelte:element>
104105
{/snippet}
105106
</Item.Root>
106-
107-
<!-- <div class={cn("relative rounded-xl", { "transition-all duration-300 ease-out hover:scale-105": !options?.tip })}>
108-
<Button href={options?.tip ? undefined : resolve("/stats/[ign]", { ign: user.id })} class="relative flex h-full w-full min-w-0 items-center gap-4 rounded-xl p-5 text-left glass glass-brightness-150 dark:glass-brightness-50 glass-contrast-60 dark:glass-contrast-100">
109-
<Avatar.Root class="size-16 shrink-0">
110-
<Avatar.Image loading="lazy" src={options?.tip ? "https://nmsr.nickac.dev/face/bc8ea1f51f253ff5142ca11ae45193a4ad8c3ab5e9c6eec8ba7a4fcb7bac40" : `https://nmsr.nickac.dev/face/${user.id}`} alt={user.username} class={cn("aspect-square size-16 [image-rendering:pixelated]", options?.tip ? "rounded-xl bg-foreground/10" : "")} />
111-
<Avatar.Fallback class="flex h-full items-center justify-center rounded-xl bg-foreground/10 text-lg font-semibold text-muted-foreground uppercase">
112-
{user.username?.slice(0, 2)}
113-
</Avatar.Fallback>
114-
</Avatar.Root>
115-
<div class="flex flex-col justify-center gap-0">
116-
<div class="text-lg font-semibold text-foreground">
117-
{user.displayName ?? user.username}
118-
</div>
119-
{#if user.quote}
120-
<div class={cn("pr-4 text-sm font-medium text-pretty text-foreground/80", user.role === Role.TECHNOBLADE ? "italic" : "")}>{@html user.quote}</div>
121-
{/if}
122-
</div>
123-
</Button>
124-
125-
</div> -->

src/lib/components/misc/CtaCard.svelte

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020

2121
<Item.Root
2222
variant="outline"
23-
class="w-fit delay-75 duration-300 ease-out [a]:transition-[scale] [a]:hover:scale-95 standard:[a]:hover:bg-inherit">
23+
class="w-fit delay-75 duration-300 ease-out [a]:transition-[scale] [a]:interact:scale-95 standard:[a]:interact:bg-inherit">
2424
{#snippet child({ props })}
2525
<!-- eslint-disable-next-line svelte/no-navigation-without-resolve -->
2626
<a {href} target="_blank" {...props}>

src/lib/components/newsroom/PostCard.svelte

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@
4242
href="/newsroom/{post.slug}"
4343
data-sveltekit-preload-data="hover"
4444
class={cn(
45-
"group relative flex h-full w-full min-w-0 flex-col overflow-hidden rounded-xl border text-left transition-[scale] delay-75 duration-300 ease-out hover:scale-95 focus-visible:scale-95 data-[featured=true]:border-accent-2/50",
45+
"group relative flex h-full w-full min-w-0 flex-col overflow-hidden rounded-xl border text-left transition-[scale] delay-75 duration-300 ease-out data-[featured=true]:border-accent-2/50 interact:scale-95",
4646
{ glass }
4747
)}
4848
data-featured={post.featured}>

src/lib/components/notices/BetaNotice.svelte

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
class="fixed -bottom-0.5 left-0 z-50 w-full p-[env(safe-area-inset-top,0)] pr-[max(0.625rem,env(safe-area-inset-right))] pb-[env(safe-area-inset-bottom,0)] pl-[max(0.625rem,env(safe-area-inset-left))] leading-12">
1414
<Button
1515
variant="ghost"
16-
class="relative mx-auto w-fit border! border-border glass transition-[scale] duration-150 ease-out glass-bg-popover hover:scale-95 "
16+
class="relative mx-auto w-fit border! border-border glass transition-[scale] duration-150 ease-out glass-bg-popover interact:scale-95 "
1717
onpointerdown={() => (noticeOpen = !noticeOpen)}>
1818
<p class="flex items-center gap-x-1.5"><TriangleAlert class="size-5" />This is the SkyCrypt development site</p>
1919
</Button>

src/lib/layouts/stats/PlayerProfile.svelte

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@
6262
<Popover.Root bind:open={ignOpen}>
6363
<Popover.Trigger
6464
disabled={(profile?.members?.length || 1) <= 1}
65-
class="inline-flex items-center rounded-full bg-foreground/10 py-2 pr-4 pl-2 align-middle text-xl font-semibold whitespace-nowrap transition-[scale,background-color] duration-300 ease-out not-disabled:hover:scale-95 not-disabled:hover:bg-foreground/20 data-[state=open]:scale-95 data-[state=open]:bg-foreground/20 sm:text-3xl"
65+
class="inline-flex items-center rounded-full bg-foreground/10 py-2 pr-4 pl-2 align-middle text-xl font-semibold whitespace-nowrap transition-[scale,background-color] duration-300 ease-out data-[state=open]:scale-95 data-[state=open]:bg-foreground/20 sm:text-3xl not-disabled:interact:scale-95 not-disabled:interact:bg-foreground/20"
6666
bind:ref={ignRef}>
6767
{#if profile != null && profile.rank?.rankColor}
6868
<div
@@ -98,7 +98,7 @@
9898
variant="outline"
9999
size="sm"
100100
data-removed={member.removed}
101-
class="group flex-nowrap bg-foreground/5 [a]:transition-[scale,background-color] [a]:duration-300 [a]:ease-out [a]:hover:scale-95 [a]:hover:bg-foreground/10">
101+
class="group flex-nowrap bg-foreground/5 [a]:transition-[scale,background-color] [a]:duration-300 [a]:ease-out [a]:hover:bg-foreground/10 [a]:interact:scale-95">
102102
{#snippet child({ props })}
103103
<a
104104
href={resolve("/stats/[ign]/[[profile]]", {
@@ -140,7 +140,7 @@
140140
</Popover.Root>
141141
<span>on</span>
142142
<div
143-
class="relative inline-flex items-center gap-2 rounded-full bg-foreground/10 px-2 py-1 align-middle text-xl font-semibold transition-[scale,background-color] duration-300 ease-out data-[disabled=false]:hover:scale-95 data-[disabled=false]:hover:bg-foreground/20 data-[disabled=false]:data-[open=true]:scale-95 data-[disabled=false]:data-[open=true]:bg-foreground/20 data-[warning=true]:border-2 data-[warning=true]:border-yellow-500/20 sm:text-3xl"
143+
class="relative inline-flex items-center gap-2 rounded-full bg-foreground/10 px-2 py-1 align-middle text-xl font-semibold transition-[scale,background-color] duration-300 ease-out data-[disabled=false]:data-[open=true]:scale-95 data-[disabled=false]:data-[open=true]:bg-foreground/20 data-[warning=true]:border-2 data-[warning=true]:border-yellow-500/20 sm:text-3xl data-[disabled=false]:interact:scale-95 data-[disabled=false]:interact:bg-foreground/20"
144144
data-open={profileOpen || noticeOpen}
145145
data-warning={apiSettings.length > 0}
146146
bind:this={noticeRef}
@@ -176,7 +176,7 @@
176176
<Item.Root
177177
variant="outline"
178178
size="sm"
179-
class="flex-nowrap bg-foreground/5 [a]:transition-[scale,background-color] [a]:duration-300 [a]:ease-out [a]:hover:scale-95 [a]:hover:bg-foreground/10">
179+
class="flex-nowrap bg-foreground/5 [a]:transition-[scale,background-color] [a]:duration-300 [a]:ease-out [a]:hover:bg-foreground/10 [a]:interact:scale-95">
180180
{#snippet child({ props })}
181181
<a
182182
href={resolve("/stats/[ign]/[[profile]]", {

src/lib/sections/stats/Minions.svelte

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@
3434
<div class="contents space-y-4">
3535
<Item.Root
3636
variant="outline"
37-
class="mx-auto w-fit rounded-full duration-150 ease-out hover:scale-95 [a]:transition-[scale,background-color] [a]:hover:bg-foreground/10">
37+
class="hover:interact-95 mx-auto w-fit rounded-full duration-150 ease-out [a]:transition-[scale,background-color] [a]:hover:bg-foreground/10">
3838
{#snippet child({ props })}
3939
<a href="https://minionah.com/" target="_blank" {...props}>
4040
<Item.Media>

0 commit comments

Comments
 (0)