trypear / pear-landing-page

Landing page for PearAI, the Open Source AI Code Editor
https://trypear.ai
Apache License 2.0
76 stars 96 forks source link

feat: download button + determine OS automatically #303

Closed seanlodhammar closed 1 month ago

seanlodhammar commented 1 month ago

Description

Adds a download button to the main header, that uses new getOS util function to detect the user's operating system. Works on both Firefox and Chromium browsers in my own testing.

Should note that getOS uses an experimental function navigator.userAgentData property to accurately detect the architecture that a user is running on. This is necessary for detecting whether a user is using a Silicon or Intel Mac CPU.

This property is only available on Chromium browsers at the moment, so if it is unavailable because the user is using a different browser (e.g. firefox), the navigator.userAgent string is parsed, and the function tries to get platform and architecture data from it. On Mac, even if the user is on the Silicon chip, it still shows up as "Intel" in the user agent string, so instead, this code checks the MacOS version the user is on, and if they're above version 13, then it downloads the Silicon version, otherwise it downloads the Intel version.

If on Linux, the download button sends the user to the Linux blog post.

Tested On

Windows

Related Issue

273

Changes Made

Screenshots

image

Checklist

vercel[bot] commented 1 month ago

The latest updates on your projects. Learn more about Vercel for Git β†—οΈŽ

Name Status Preview Comments Updated (UTC)
pear-landing-page βœ… Ready (Inspect) Visit Preview πŸ’¬ Add feedback Oct 15, 2024 8:23am
pear-landing-page-main βœ… Ready (Inspect) Visit Preview πŸ’¬ Add feedback Oct 15, 2024 8:23am
vercel[bot] commented 1 month ago

Someone is attempting to deploy a commit to the PearAI Team on Vercel.

A member of the Team first needs to authorize it.