Skip to content

Commit

Permalink
Merge pull request #1 from skillrecordings/john/v2-release
Browse files Browse the repository at this point in the history
feat(index): Updating releases and main screenshot
  • Loading branch information
johnlindquist authored Dec 12, 2023
2 parents bb58bc2 + 09102b8 commit 6ab7e95
Show file tree
Hide file tree
Showing 13 changed files with 460 additions and 153 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -17,3 +17,5 @@ apps/*/public/robots.txt
apps/*/test-results

.eslintcache
.env*.local
.vscode
2 changes: 1 addition & 1 deletion apps/scriptkit/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@
"@code-hike/mdx": "^0.8.2",
"@headlessui/react": "^1.7.1",
"@heroicons/react": "=1.0.6",
"@johnlindquist/kit": "0.75.3",
"@johnlindquist/kit": "2.0.4",
"@mdx-js/loader": "^2.3.0",
"@mdx-js/mdx": "^2.3.0",
"@mdx-js/react": "^2.3.0",
Expand Down
2 changes: 1 addition & 1 deletion apps/scriptkit/public/data/announcements.json

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion apps/scriptkit/public/data/docs.json

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion apps/scriptkit/public/data/hot.json

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion apps/scriptkit/public/data/share.json

Large diffs are not rendered by default.

3 changes: 2 additions & 1 deletion apps/scriptkit/public/free-riders.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
"lsminter",
"ramiroaraujo",
"dodgez",
"ScytheDraven47"
"ScytheDraven47",
"alduraji"
]
}
Binary file added apps/scriptkit/public/kitapp-main-menu.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
98 changes: 71 additions & 27 deletions apps/scriptkit/src/components/download-kitapp.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,18 @@ const DownloadKitApp: React.FC<
React.PropsWithChildren<{
macIntelRelease: Release
macSilliconRelease: Release
windowsPreviewRelease: Release
linuxCommunityRelease?: Release
windowsx64Release: Release
windowsarm64Release: Release
linuxx64Release: Release
linuxarm64Release: Release
}>
> = ({
macIntelRelease,
macSilliconRelease,
windowsPreviewRelease,
linuxCommunityRelease,
windowsx64Release,
windowsarm64Release,
linuxx64Release,
linuxarm64Release,
}) => {
const [isHovered, setIsHovered] = React.useState('')
const macReleases = [
Expand Down Expand Up @@ -69,61 +73,101 @@ const DownloadKitApp: React.FC<
<div className="flex items-center bg-gray-800">
<div className="relative group flex 00">
<a
onMouseOver={() => setIsHovered(windowsPreviewRelease.name)}
onMouseOver={() => setIsHovered(windowsx64Release.name)}
onMouseOut={() => setIsHovered('')}
className={cx(
'font-normal tracking-tight flex items-center p-4 hover:bg-gray-700/50 transition',
{},
)}
href={windowsPreviewRelease?.browser_download_url}
href={windowsx64Release?.browser_download_url}
onMouseUp={(e) => {
e.preventDefault()
fetch('/api/update-twitter-count')
}}
>
<DownloadIcon className="flex-shrink-0 text-gray-500" />
<span className="pl-1">x64 (Beta)</span>
<span className="pl-1">x64</span>
</a>
</div>
</div>
</div>
<div className="absolute bottom-0 left-0 w-full translate-y-1.5 h-full rounded-xl from-gray-800 via-gray-900 to-gray-900 bg-gradient-to-r -z-10" />
</div>
</div>
{linuxCommunityRelease && (
<div className="relative">
<div className="inline-flex items-center gap-5 rounded-xl overflow-hidden bg-gray-900 text-white pl-4">
<div className="font-medium flex items-center gap-1">
<LinuxIcon /> Linux (Community)
</div>
<div className="flex items-center bg-gray-800">
<div className="relative group flex 00">
<a
onMouseOver={() =>
setIsHovered(
`Linux is community supported from contributors like you! (${linuxCommunityRelease.name})`,
)
}
onMouseOver={() => setIsHovered(windowsarm64Release.name)}
onMouseOut={() => setIsHovered('')}
className={cx(
'font-normal tracking-tight flex items-center p-4 hover:bg-gray-700/50 transition',
{},
)}
href={linuxCommunityRelease?.browser_download_url}
href={windowsarm64Release?.browser_download_url}
onMouseUp={(e) => {
e.preventDefault()
fetch('/api/update-twitter-count')
}}
>
<DownloadIcon className="flex-shrink-0 text-gray-500" />
<span className="pl-1">x64 (Beta)</span>
<span className="pl-1">arm64</span>
</a>
</div>
</div>
</div>
<div className="absolute bottom-0 left-0 w-full translate-y-1.5 h-full rounded-xl from-gray-800 via-gray-900 to-gray-900 bg-gradient-to-r -z-10" />
</div>
)}
</div>

<div className="relative">
<div className="inline-flex items-center gap-5 rounded-xl overflow-hidden bg-gray-900 text-white pl-4">
<div className="font-medium flex items-center gap-1">
<LinuxIcon /> Linux (Community)
</div>
<div className="flex items-center bg-gray-800">
<div className="relative group flex 00">
<a
onMouseOver={() =>
setIsHovered(
`Linux is community supported from contributors like you! (${linuxx64Release.name})`,
)
}
onMouseOut={() => setIsHovered('')}
className={cx(
'font-normal tracking-tight flex items-center p-4 hover:bg-gray-700/50 transition',
{},
)}
href={linuxx64Release?.browser_download_url}
onMouseUp={(e) => {
e.preventDefault()
fetch('/api/update-twitter-count')
}}
>
<DownloadIcon className="flex-shrink-0 text-gray-500" />
<span className="pl-1">x64</span>
</a>
</div>
<div className="relative group flex 00">
<a
onMouseOver={() =>
setIsHovered(
`Linux is community supported from contributors like you! (${linuxarm64Release.name})`,
)
}
onMouseOut={() => setIsHovered('')}
className={cx(
'font-normal tracking-tight flex items-center p-4 hover:bg-gray-700/50 transition',
{},
)}
href={linuxarm64Release?.browser_download_url}
onMouseUp={(e) => {
e.preventDefault()
fetch('/api/update-twitter-count')
}}
>
<DownloadIcon className="flex-shrink-0 text-gray-500" />
<span className="pl-1">arm64</span>
</a>
</div>
</div>
</div>
<div className="absolute bottom-0 left-0 w-full translate-y-1.5 h-full rounded-xl from-gray-800 via-gray-900 to-gray-900 bg-gradient-to-r -z-10" />
</div>

<div className=" w-full text-center text-xs opacity-50 absolute md:-bottom-8 -bottom-12">
{isHovered}
</div>
Expand Down
31 changes: 3 additions & 28 deletions apps/scriptkit/src/components/kitapp-ui.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -17,13 +17,9 @@ const KitAppUI: React.FC<React.PropsWithChildren<Props>> = ({scripts}) => {
const [hovered, setHovered] = React.useState<string>('')

return (
<div className="bg-blur flex flex-col text-left h-full max-h-[400px] bg-opacity-[85%] bg-black border border-white border-opacity-5 rounded-lg flex-grow">
<header className="border-b border-white border-opacity-5">
<div className="bg-blur flex flex-col text-left h-full max-h-[400px] bg-opacity-[85%] bg-black border border-white/25 rounded-lg flex-grow">
<header className="border-b border-white/25">
{/* top-bar */}
<div className="text-[0.6rem] uppercase font-mono p-3 pb-2 flex items-center justify-between">
<span>script kit</span>
{/* <span>main</span> */}
</div>
{/* input */}
<div className="flex items-center relative">
<input
Expand All @@ -35,27 +31,6 @@ const KitAppUI: React.FC<React.PropsWithChildren<Props>> = ({scripts}) => {
{/* blink */}
<div className="bg-gray-200 animate-blink absolute w-px h-2/5 left-3 z-10" />
</div>
{/* tabs */}
<nav className="pointer-events-none">
<ul className="flex items-center space-x-1">
{Array.of('Script', 'Kit', 'API', 'Guide', 'Community').map(
(tab, i) => {
let active = 0
return (
<div
className={`border-b-2 px-3 py-1 text-xs ${classNames({
'border-yellow-500': i === active,
'border-none opacity-80': i !== active,
})}`}
key={tab}
>
{tab}
</div>
)
},
)}
</ul>
</nav>
</header>
<main className="flex flex-grow overflow-hidden">
{/* scripts */}
Expand All @@ -67,7 +42,7 @@ const KitAppUI: React.FC<React.PropsWithChildren<Props>> = ({scripts}) => {
<Link
href={`/${script.user}/${script.command}`}
onMouseOver={() => setHovered(script.command)}
className="flex flex-col px-3 py-2 bg-transparent bg-opacity-5 hover:bg-white hover:bg-opacity-5 group"
className="flex flex-col px-3 py-2 bg-transparent bg-opacity-5 hover:bg-white hover:bg-opacity-5 group text-sm"
>
<div>{script.title}</div>
<p className="text-xs group-hover:text-yellow-500 group-hover:opacity-100 opacity-70">
Expand Down
69 changes: 55 additions & 14 deletions apps/scriptkit/src/lib/get-user-scripts.ts
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ export async function getReleases() {
return releases
}

export async function getLatestRelease() {
export async function getLatestMacIntelRelease() {
const releases = await getReleases()

const mainRelease = releases.find(
Expand All @@ -125,8 +125,6 @@ export async function getLatestRelease() {
release?.assets?.find((a) => a.name.includes('dmg')),
)

console.log(`Mac Intel Main Release:`, mainRelease)

const release = mainRelease?.assets.find(
(asset) =>
!asset?.name?.includes('beta') &&
Expand All @@ -135,7 +133,7 @@ export async function getLatestRelease() {
asset?.name?.endsWith('.dmg'),
)

console.log(`Mac Intel Release:`, release)
console.log(`Mac Intel Release:`, release?.name)

return release
}
Expand All @@ -153,8 +151,6 @@ export async function getLatestAppleSiliconRelease() {
release?.assets?.find((a) => a.name.includes('dmg')),
)

console.log(`Apple Silicon Main Release:`, mainRelease)

const release = mainRelease?.assets.find(
(asset) =>
!asset?.name?.includes('beta') &&
Expand All @@ -163,12 +159,12 @@ export async function getLatestAppleSiliconRelease() {
asset?.name?.endsWith('.dmg'),
)

console.log(`Apple Silicon Release:`, release)
console.log(`Apple Silicon Release:`, release?.name)

return release
}

export async function getLatestWindowsPreviewRelease() {
export async function getLatestWindowsx64Release() {
const releases = await getReleases()

const mainRelease = releases.find(
Expand All @@ -179,8 +175,6 @@ export async function getLatestWindowsPreviewRelease() {
release?.assets?.find((a) => a.name.includes('exe')),
)

console.log(`Windows Preview Main Release:`, mainRelease)

const release = mainRelease?.assets.find(
(asset) =>
!asset?.name?.includes('beta') &&
Expand All @@ -189,12 +183,12 @@ export async function getLatestWindowsPreviewRelease() {
asset?.name?.endsWith('.exe'),
)

console.log(`Windows Releases:`, release)
console.log(`Windows x64 Release:`, release?.name)

return release
}

export async function getLatestLinuxRelease() {
export async function getLatestWindowsarm64Release() {
const releases = await getReleases()

const mainRelease = releases.find(
Expand All @@ -205,16 +199,63 @@ export async function getLatestLinuxRelease() {
release?.assets?.find((a) => a.name.includes('exe')),
)

console.log(`Linux Main Release:`, mainRelease)
const release = mainRelease?.assets.find(
(asset) =>
!asset?.name?.includes('beta') &&
!asset?.name?.includes('alpha') &&
asset?.name?.includes('arm') &&
asset?.name?.endsWith('.exe'),
)

console.log(`Windows ARM64 Release:`, release?.name)

return release
}

export async function getLatestLinuxx64Release() {
const releases = await getReleases()

const mainRelease = releases.find(
(release) =>
!release?.name?.includes('beta') &&
!release?.name?.includes('alpha') &&
!release.prerelease &&
release?.assets?.find((a) => a.name.includes('exe')),
)

const release = mainRelease?.assets.find(
(asset) =>
!asset?.name?.includes('arm') &&
!asset?.name?.includes('beta') &&
!asset?.name?.includes('alpha') &&
asset?.name?.endsWith('AppImage'),
)

console.log(`Linux x64 Release:`, release?.name)

return release
}

export async function getLatestLinuxarm64Release() {
const releases = await getReleases()

const mainRelease = releases.find(
(release) =>
!release?.name?.includes('beta') &&
!release?.name?.includes('alpha') &&
!release.prerelease &&
release?.assets?.find((a) => a.name.includes('exe')),
)

const release = mainRelease?.assets.find(
(asset) =>
asset?.name?.includes('arm') &&
!asset?.name?.includes('beta') &&
!asset?.name?.includes('alpha') &&
asset?.name?.endsWith('AppImage'),
)

console.log(`Linux Release:`, release)
console.log(`Linux ARM64 Release:`, release?.name)

return release
}
Loading

1 comment on commit 6ab7e95

@vercel
Copy link

@vercel vercel bot commented on 6ab7e95 Dec 12, 2023

Choose a reason for hiding this comment

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

Please sign in to comment.