Skip to content

Fix: Improved dynamic layout in download page #782

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 4 commits into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
62 changes: 37 additions & 25 deletions src/routes/download/+page.svelte
Original file line number Diff line number Diff line change
@@ -1,37 +1,42 @@
<script lang="ts">
import { links } from "$data/links";
import { defaultI18nValues, externalLink, Metadata } from "$lib";
import { Button, InfoBadge, InfoBar, TextBlock } from "fluent-svelte";
import { Button, InfoBar, TextBlock } from "fluent-svelte";
import { onMount } from "svelte";
import DownloadSourceCard from "./DownloadSourceCard.svelte";
import type { DownloadSource } from "./types";
import { _ } from "svelte-i18n";

let isWindows = false;
let innerWidth = 649;

const downloadSources = [
{
name: $_("download.microsoft_store.title", defaultI18nValues),
description: $_(
"download.microsoft_store.description",
defaultI18nValues
defaultI18nValues,
),
href: `ms-windows-store://pdp/?ProductId=9nghp3dx8hdx&cid=FilesWebsite`,
href: `https://apps.microsoft.com/detail/9nghp3dx8hdx?mode=full`,
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Aside from no longer opening the Microsoft Store, this change removes the campaign data. Can you please revert it for now?

icon: "/branding/logo-light.svg",
darkModeIcon: "/branding/logo-dark.svg",
external: true,
},
{
name: $_("download.preview.title", defaultI18nValues),
description: $_("download.preview.description", defaultI18nValues),
href: "/appinstallers/Files.preview.appinstaller",
href: "https://apps.microsoft.com/detail/9nsqd9pkv3ss?mode=full",
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please keep the existing links

icon: "/download-sources/preview_light.svg",
darkModeIcon: "/download-sources/preview_dark.svg",
},
] as const satisfies readonly DownloadSource[];

onMount(() => {
isWindows = navigator.userAgent.includes("Windows");
innerWidth = window.innerWidth;
window.addEventListener("resize", () => {
innerWidth = window.innerWidth;
});
});
</script>

@@ -43,35 +48,42 @@
<TextBlock variant="titleLarge" style="text-align: center;"
>{$_("download.title", defaultI18nValues)}</TextBlock
>
<InfoBar class="donation-infobar" severity="success" closable={false}>
<div
style="display: flex; gap: 0.5rem; margin-block-end: 7px; margin-block-start: 7px;"
{#if innerWidth > 510}
<InfoBar
style="min-height: 75px; overflow: hidden;"
class="donation-infobar"
severity="success"
closable={false}
>
{$_("download.donation_description", defaultI18nValues)}

<Button
slot="action"
variant="accent"
href="https://github.com/sponsors/yaira2"
{...externalLink}
<div
style="display: flex; gap: 0.5rem; margin-block-end: 7px; margin-block-start: 7px;"
>
{$_("download.donation_button", defaultI18nValues)}
</Button>
</div>
{$_("download.donation_description", defaultI18nValues)}
<Button
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is there a reason why this button is no longer an accent button?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No

slot="action"
href="https://github.com/sponsors/yaira2"
{...externalLink}
>
{$_("download.donation_button", defaultI18nValues)}
</Button>
</div>

<svelte:fragment slot="icon">&nbsp;</svelte:fragment>
</InfoBar>
<svelte:fragment slot="icon">&nbsp;</svelte:fragment>
</InfoBar>
{/if}

<section class="download-sources">
{#each downloadSources as source}
<DownloadSourceCard {source} />
{/each}
<p>
{$_("download.self_signed.description", defaultI18nValues)}<a
href="/appinstallers/Files.stable.appinstaller"
>{$_("download.self_signed.link_text", defaultI18nValues)}</a
>.
</p>
{#if innerWidth > 648}
<p>
{$_("download.self_signed.description", defaultI18nValues)}<a
href="/appinstallers/Files.stable.appinstaller"
>{$_("download.self_signed.link_text", defaultI18nValues)}</a
>.
</p>
{/if}
</section>
</main>