Skip to content

Commit 0b68dcb

Browse files
style(releases): redesign the main page, fix styles
1 parent 1dc5e03 commit 0b68dcb

File tree

3 files changed

+42
-13
lines changed

3 files changed

+42
-13
lines changed

src/app.css

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,14 @@
44

55
@variant dark (&:is(.dark *));
66

7+
/* shadcn static */
78
@theme static {
89
--breakpoint-xs: 475px;
910
--breakpoint-2xl: 1400px;
11+
}
1012

13+
/* shadcn */
14+
@theme {
1115
--color-background: hsl(var(--background));
1216
--color-foreground: hsl(var(--foreground));
1317

@@ -53,13 +57,15 @@
5357
--radius-sm: calc(var(--radius) - 4px);
5458
}
5559

60+
/* Tailwind container utility */
5661
@utility container {
5762
margin-inline: auto;
5863
padding-inline: 2rem;
5964
/* Cancels the undocumented default breakpoint-driven max-width */
6065
max-width: var(--breakpoint-2xl);
6166
}
6267

68+
/* shadcn theme */
6369
@layer base {
6470
:root {
6571
--background: 0 0% 100%;
@@ -106,6 +112,20 @@
106112
}
107113
}
108114

115+
/* custom themes */
116+
@theme {
117+
--animate-major-gradient: major-gradient 7s ease-in-out infinite;
118+
@keyframes major-gradient {
119+
from,
120+
to {
121+
background-position: 0 0;
122+
}
123+
50% {
124+
background-position: 100% 0;
125+
}
126+
}
127+
}
128+
109129
@layer base {
110130
::selection {
111131
@apply bg-primary text-primary-foreground;

src/routes/package/[...package]/+page.svelte

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@
7474
return new Date(created_at).getTime() > new Date().getTime() - 1000 * 60 * 60 * 24 * 7;
7575
})
7676
.map(({ id }) => id.toString())}
77-
class="w-full"
77+
class="w-full space-y-2"
7878
>
7979
{#each displayableReleases as release, index (release.id)}
8080
{@const semVersion = semver.coerce(release.cleanVersion)}

src/routes/package/[...package]/ReleaseCard.svelte

Lines changed: 21 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -135,26 +135,34 @@
135135
{/if}
136136
{/snippet}
137137

138-
<Accordion.Item value={release.id.toString()}>
139-
<Accordion.Trigger class="group hover:no-underline">
138+
<Accordion.Item
139+
value={release.id.toString()}
140+
class={["border-b-0", { "rounded-xl border border-primary": isMajorRelease && index < 3 }]}
141+
>
142+
<Accordion.Trigger
143+
class="group rounded-t-xl bg-secondary px-4 py-3 hover:no-underline data-[state=closed]:rounded-b-xl"
144+
>
140145
<div class="flex w-full items-center gap-2 xs:items-baseline xs:gap-1">
141146
<div class="flex flex-col items-start gap-1">
142147
{#if isMajorRelease}
143148
<Tooltip.Provider>
144149
<Tooltip.Root delayDuration={300}>
145150
<Tooltip.Trigger>
151+
<span
152+
style="--major-gradient: 135deg, #ffcc80, #ff9933, #e67300, #ff9933, #ffcc80, #fff5e6, white; background-size: 200% 200%"
153+
class="animate-major-gradient bg-linear-(--major-gradient) bg-clip-text text-left text-xl text-transparent"
154+
>
155+
{packageName}@{releaseVersion}
156+
</span>
146157
{#if index === 0}
147158
<div
148-
class="mx-auto"
159+
class="ml-auto"
149160
use:confetti={{
150161
duration: 5000,
151162
colors: ["orange", "white"]
152163
}}
153164
></div>
154165
{/if}
155-
<span class="majorGradient text-left text-xl">
156-
{packageName}@{releaseVersion}
157-
</span>
158166
</Tooltip.Trigger>
159167
<Tooltip.Content>
160168
{packageName}
@@ -165,7 +173,7 @@
165173
{:else}
166174
<span class="text-lg group-hover:underline">{packageName}@{releaseVersion}</span>
167175
{/if}
168-
<div class="flex items-center gap-2 xs:hidden">
176+
<div class="mb-auto flex items-center gap-2 xs:hidden">
169177
{@render badges()}
170178
</div>
171179
</div>
@@ -196,25 +204,26 @@
196204
</Tooltip.Root>
197205
</Tooltip.Provider>
198206
</span>
199-
<div class="hidden items-center gap-2 xs:flex">
207+
<div class="mb-auto hidden items-center gap-2 xs:flex">
200208
{@render badges()}
201209
</div>
202210
</div>
203211
</Accordion.Trigger>
204-
<Accordion.Content>
205-
<div class="flex flex-col gap-4 sm:flex-row sm:justify-between sm:gap-0">
212+
<Accordion.Content class="rounded-b-xl bg-accent/30 pl-6">
213+
<div class="relative mt-4 flex flex-col gap-4 sm:flex-row sm:justify-between sm:gap-0">
206214
<MarkdownRenderer
207215
markdown={releaseBody}
208216
additionalPlugins={[{ renderer: { li: ListElementRenderer } }]}
209217
class="prose-sm max-w-full prose-p:my-0"
210218
/>
211-
<!-- Open the release on GitHub in a new tab, with a nice hover animation -->
219+
<!-- Open the release on GitHub in a new tab -->
220+
<Button variant="outline" size="sm" class="invisible mr-6">this is a long long text</Button>
212221
<Button
213222
href={release.html_url}
214223
variant="outline"
215224
size="sm"
216225
target="_blank"
217-
class="group mr-8 mb-2 ml-auto shrink-0 gap-0 transition-colors duration-500 sm:mt-auto sm:ml-4"
226+
class="group absolute right-6 bottom-1 shrink-0 gap-0 transition-colors duration-500"
218227
>
219228
<span class="-mr-6 hidden group-hover:block">Open on GitHub</span>
220229
<img

0 commit comments

Comments
 (0)