|
1 | 1 | <script lang="ts"> |
2 | 2 | import { onMount } from "svelte"; |
| 3 | + import { confetti } from "@neoconfetti/svelte"; |
3 | 4 | import type { TabsProps } from "bits-ui"; |
4 | 5 | import { ArrowUpRight, LoaderCircle } from "lucide-svelte"; |
5 | 6 | import type { Octokit } from "octokit"; |
|
500 | 501 | case "others": |
501 | 502 | return $displayOtherBetaReleases; |
502 | 503 | } |
503 | | - }) as release (release.id)} |
| 504 | + }) as release, index (release.id)} |
504 | 505 | {@const releaseDate = new Date(release.created_at)} |
505 | 506 | {@const isOlderThanAWeek = |
506 | 507 | releaseDate.getTime() < new Date().getTime() - 1000 * 60 * 60 * 24 * 7} |
|
556 | 557 | } |
557 | 558 | ); |
558 | 559 | })()} |
559 | | - <Accordion.Item value={release.id.toString()}> |
| 560 | + <Accordion.Item |
| 561 | + value={release.id.toString()} |
| 562 | + class={isMajorRelease && id !== "others" && index < 3 |
| 563 | + ? "rounded-xl border-2 border-primary px-4" |
| 564 | + : undefined} |
| 565 | + > |
560 | 566 | <!-- Trigger with release name, date and optional prerelease badge --> |
561 | 567 | <Accordion.Trigger class="group hover:no-underline"> |
562 | 568 | <div class="flex w-full items-center gap-2 xs:items-baseline xs:gap-1"> |
|
572 | 578 | {/if} |
573 | 579 | {/key} |
574 | 580 | <div class="flex flex-col items-start gap-1"> |
575 | | - <span class="text-left text-lg group-hover:underline"> |
576 | | - {releaseName} |
577 | | - </span> |
| 581 | + {#if isMajorRelease && id !== "others"} |
| 582 | + {@const newReleaseMajor = releaseRepo |
| 583 | + ?.versionFromTag(release.tag_name) |
| 584 | + ?.split(".")[0]} |
| 585 | + <Tooltip.Root openDelay={300}> |
| 586 | + <Tooltip.Trigger> |
| 587 | + {#if index === 0 && currentTab === id} |
| 588 | + <div |
| 589 | + class="mx-auto" |
| 590 | + use:confetti={{ |
| 591 | + duration: 5000, |
| 592 | + colors: ["orange", "white"] |
| 593 | + }} |
| 594 | + ></div> |
| 595 | + {/if} |
| 596 | + <span class="majorGradient text-left text-xl"> |
| 597 | + {releaseName} |
| 598 | + </span> |
| 599 | + </Tooltip.Trigger> |
| 600 | + <Tooltip.Content> |
| 601 | + {#if newReleaseMajor} |
| 602 | + {name} {newReleaseMajor} is available! |
| 603 | + {:else} |
| 604 | + A new major of {name} is available! |
| 605 | + {/if} |
| 606 | + </Tooltip.Content> |
| 607 | + </Tooltip.Root> |
| 608 | + {:else} |
| 609 | + <span class="text-left text-lg group-hover:underline"> |
| 610 | + {releaseName} |
| 611 | + </span> |
| 612 | + {/if} |
578 | 613 | <div class="flex items-center gap-2 xs:hidden"> |
579 | 614 | {#if isLatestRelease} |
580 | 615 | <Tooltip.Root openDelay={300}> |
|
763 | 798 | {/each} |
764 | 799 | </Tabs.Root> |
765 | 800 | </div> |
| 801 | + |
| 802 | +<style> |
| 803 | + .majorGradient { |
| 804 | + background: linear-gradient( |
| 805 | + 135deg, |
| 806 | + #ffcc80, |
| 807 | + #ff9933, |
| 808 | + #e67300, |
| 809 | + #ff9933, |
| 810 | + #ffcc80, |
| 811 | + #fff5e6, |
| 812 | + white |
| 813 | + ); |
| 814 | + background-clip: text; |
| 815 | + color: transparent; |
| 816 | + animation: gradient 7s ease-in-out infinite; |
| 817 | + background-size: 200% 200%; |
| 818 | + } |
| 819 | +
|
| 820 | + @keyframes gradient { |
| 821 | + 0%, |
| 822 | + 100% { |
| 823 | + background-position: 0 0; |
| 824 | + } |
| 825 | + 50% { |
| 826 | + background-position: 100% 0; |
| 827 | + } |
| 828 | + } |
| 829 | +</style> |
0 commit comments