Skip to content

Commit 2fa01d1

Browse files
authored
various UX fixes, as discussed (#283)
* various UX fixes, as discussed * Update text in hero component for clarity * Fix macOS command casing in download-dropdown
1 parent 6f208cd commit 2fa01d1

File tree

4 files changed

+73
-25
lines changed

4 files changed

+73
-25
lines changed

www/src/lib/components/download-dropdown.svelte

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@
2929
// Commands to copy
3030
const commands = {
3131
windows: 'winget install Microsoft.FoundryLocal',
32-
macos: 'brew tap microsoft/foundrylocal\nbrew install foundrylocal',
32+
macos: 'brew tap microsoft/foundrylocal/foundrylocal',
3333
python: 'pip install foundry-local-sdk',
3434
javascript: 'npm install foundry-local-sdk',
3535
csharp: 'dotnet add package Microsoft.AI.Foundry.Local',

www/src/lib/components/home/hero.svelte

Lines changed: 44 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,8 @@
77
DollarSign,
88
Shield,
99
Box,
10-
ArrowRight
10+
ArrowRight,
11+
Rocket
1112
} from 'lucide-svelte';
1213
import { siteConfig } from '$lib/config';
1314
import { animate } from '$lib/utils/animations';
@@ -39,10 +40,21 @@
3940
});
4041
}
4142
42-
// Stagger animation for buttons
43+
// Stagger animation for buttons - handle nested structure
4344
if (buttonsContainer) {
44-
const buttons = Array.from(buttonsContainer.children) as HTMLElement[];
45-
buttons.forEach((button, index) => {
45+
const allButtons: HTMLElement[] = [];
46+
// Get the first button directly
47+
const firstButton = buttonsContainer.querySelector('a[href*="get-started"]') as HTMLElement;
48+
if (firstButton) allButtons.push(firstButton);
49+
50+
// Get buttons from the secondary actions div
51+
const secondaryDiv = buttonsContainer.querySelector('div');
52+
if (secondaryDiv) {
53+
const secondaryButtons = Array.from(secondaryDiv.querySelectorAll('button, a')) as HTMLElement[];
54+
allButtons.push(...secondaryButtons);
55+
}
56+
57+
allButtons.forEach((button, index) => {
4658
button.style.opacity = '0';
4759
button.style.transform = 'translateY(20px)';
4860
button.style.transition = 'all 600ms cubic-bezier(0.4, 0, 0.2, 1)';
@@ -90,38 +102,52 @@
90102
<div
91103
class="inline-flex items-center rounded-full bg-primary/10 px-3 py-1 text-sm text-primary transition-all duration-300 hover:scale-105 hover:bg-primary/20"
92104
>
93-
<DollarSign class="mr-1 size-4" /> Completely Free
105+
<DollarSign class="mr-1 size-4" /> Free to Use
94106
</div>
95107
<div
96108
class="inline-flex items-center rounded-full bg-primary/10 px-3 py-1 text-sm text-primary transition-all duration-300 hover:scale-105 hover:bg-primary/20"
97109
>
98-
<Shield class="mr-1 size-4" /> Complete Data Privacy
110+
<Shield class="mr-1 size-4" /> Data Privacy
99111
</div>
100112
</div>
101113

102114
<!-- Action Buttons -->
103-
<div bind:this={buttonsContainer} class="mt-8 flex flex-col justify-center gap-3 sm:flex-row">
115+
<div bind:this={buttonsContainer} class="mt-8 flex flex-col items-center justify-center gap-3">
116+
<!-- Primary CTA -->
104117
<Button
105118
variant="default"
106119
href="https://learn.microsoft.com/en-us/azure/ai-foundry/foundry-local/get-started"
107120
target="_blank"
108121
rel="noopener noreferrer"
109122
size="lg"
110-
class="group transition-all duration-300 hover:scale-105 hover:shadow-lg"
123+
class="group w-full transition-all duration-300 hover:scale-105 hover:shadow-lg sm:w-40"
111124
>
125+
<Rocket class="mr-2 size-4 transition-transform duration-300 group-hover:-translate-y-1" />
112126
Get Started
113-
<ArrowRight class="ml-2 size-4 transition-transform duration-300 group-hover:translate-x-1" />
114127
</Button>
115128

116-
<Button
117-
variant="outline"
118-
onclick={openDownloadDropdown}
119-
size="lg"
120-
class="group border-2 transition-all duration-300 hover:scale-105 hover:shadow-lg"
121-
>
122-
<Download class="mr-2 size-4 transition-transform duration-300 group-hover:translate-y-0.5" />
123-
Download
124-
</Button>
129+
<!-- Secondary Actions -->
130+
<div class="flex w-full flex-col items-center gap-3 sm:flex-row sm:justify-center">
131+
<Button
132+
variant="outline"
133+
onclick={openDownloadDropdown}
134+
size="lg"
135+
class="group w-full border-2 transition-all duration-300 hover:scale-105 hover:shadow-lg sm:w-40"
136+
>
137+
<Download class="mr-2 size-4 transition-transform duration-300 group-hover:translate-y-0.5" />
138+
Download
139+
</Button>
140+
141+
<Button
142+
variant="outline"
143+
href="/models"
144+
size="lg"
145+
class="group w-full border-2 transition-all duration-300 hover:scale-105 hover:shadow-lg sm:w-40"
146+
>
147+
<Box class="mr-2 size-4 transition-transform duration-300 group-hover:rotate-12" />
148+
Models
149+
</Button>
150+
</div>
125151
</div>
126152
</div>
127153
</div>

www/src/lib/components/home/nav.svelte

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,10 @@
4848
<span class="ml-1 whitespace-nowrap text-lg font-semibold">Foundry Local</span>
4949
</a>
5050
<div class="flex items-center gap-2">
51+
<div class="flex items-center gap-2 md:hidden">
52+
<SocialMedia />
53+
<DarkModeToggle />
54+
</div>
5155
<Button
5256
variant="outline"
5357
size="icon"
@@ -59,9 +63,6 @@
5963
<Menu />
6064
<span class="sr-only">Toggle navigation</span>
6165
</Button>
62-
<div class="md:hidden">
63-
<DarkModeToggle />
64-
</div>
6566
</div>
6667
</div>
6768

@@ -116,7 +117,9 @@
116117
{/if}
117118
{/each}
118119
<DownloadDropdown variant="outline" class="border-2" bind:open={isDownloadOpen} />
119-
<SocialMedia />
120+
<div class="hidden md:block">
121+
<SocialMedia />
122+
</div>
120123
<Separator orientation="vertical" class="mr-2 hidden h-5 md:block" />
121124

122125
<div class="hidden md:block">

www/src/routes/models/+page.svelte

Lines changed: 21 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -309,7 +309,7 @@
309309
try {
310310
const command = formatModelCommand(modelId);
311311
await navigator.clipboard.writeText(command);
312-
copiedModelId = modelId;
312+
copiedModelId = `run-${modelId}`;
313313
toast.success('Run command copied to clipboard');
314314
setTimeout(() => {
315315
copiedModelId = null;
@@ -938,7 +938,26 @@
938938

939939
<!-- Command to run -->
940940
<div class="rounded-md bg-muted/50 p-3">
941-
<div class="mb-1 text-xs font-medium text-muted-foreground">Run Command:</div>
941+
<div class="mb-2 flex items-center justify-between">
942+
<div class="text-xs font-medium text-muted-foreground">Run Command:</div>
943+
<Button
944+
variant="ghost"
945+
size="sm"
946+
onclick={(e) => {
947+
e.stopPropagation();
948+
copyRunCommand(variant.name);
949+
}}
950+
class="h-6 gap-1.5 px-2 text-xs"
951+
>
952+
{#if copiedModelId === `run-${variant.name}`}
953+
<Check class="size-3 text-green-500" />
954+
Copied
955+
{:else}
956+
<Copy class="size-3" />
957+
Copy
958+
{/if}
959+
</Button>
960+
</div>
942961
<code class="text-xs font-mono">{formatModelCommand(variant.name)}</code>
943962
</div>
944963
</div>

0 commit comments

Comments
 (0)