Skip to content
Draft
Show file tree
Hide file tree
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
25 changes: 16 additions & 9 deletions app/(home)/ShowcaseItem.tsx
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
import Image, { StaticImageData } from "next/image";
import Image, { type StaticImageData } from "next/image";
import { ExternalLink } from "lucide-react";

export interface ShowcaseItemProps {
name: string;
website?: string;
appstore?: string;
playstore?: string;
logo: StaticImageData;
logo: StaticImageData | string;
description: string;
}

Expand All @@ -15,25 +15,32 @@ export default function ShowcaseItem({ name, website, appstore, playstore, logo,
<div className={`group pt-12 ${website && 'pb-14'}`}>
<div className="rounded-2xl border border-dashed p-4 flex-1 bg-fd-card relative">

<Image src={logo} className="rounded-2xl h-16 w-16 -mt-12 mb-4 backdrop-blur left-4 border border-dashed bg-fd-muted object-cover" alt={`${name} logo`} />
<Image
src={logo}
width={64}
height={64}
unoptimized={typeof logo === "string"}
className="rounded-2xl h-16 w-16 -mt-12 mb-4 backdrop-blur left-4 border border-dashed bg-fd-muted object-cover"
alt=""
/>
<b className="font-bold text-xl">{name}</b>
<p className="opacity-50 mt-2 text-pretty line-clamp-3">{description}</p>

{website && (
<a href={website} target="_blank" rel="noopener noreferrer" className="absolute left-0 bottom-0 translate-y-12 group/link border px-3 py-1.5 shadow-xl dark:shadow-2xl group-hover:translate-y-1/2 group-hover:translate-x-4 duration-300 bg-fd-accent hover:bg-fd-background hover:border-black dark:hover:border-fd-primary dark:hover:shadow-fd-primary rounded-xl font-mono text-sm w-fit ease-[cubic-bezier(0.175,0.885,0.32,1.275)] flex gap-2">
{website}
<ExternalLink className="w-4 h-4 opacity-0 inline-block group-hover/link:opacity-100 group-hover/link:translate-0 -translate-x-1/2 translate-y-1/2 scale-50 group-hover/link:scale-100 duration-300" />
<a href={website} target="_blank" rel="noopener noreferrer" aria-label={`Visit the ${name} website`} className="absolute left-0 bottom-0 translate-y-12 group/link border px-3 py-1.5 shadow-xl dark:shadow-2xl group-hover:translate-y-1/2 group-hover:translate-x-4 duration-300 bg-fd-accent hover:bg-fd-background hover:border-black dark:hover:border-fd-primary dark:hover:shadow-fd-primary rounded-xl font-mono text-sm w-fit max-w-[calc(100%-1rem)] ease-[cubic-bezier(0.175,0.885,0.32,1.275)] flex gap-2 focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-fd-primary">
<span className="truncate">{website}</span>
<ExternalLink className="w-4 h-4 shrink-0 opacity-0 inline-block group-hover/link:opacity-100 group-hover/link:translate-0 -translate-x-1/2 translate-y-1/2 scale-50 group-hover/link:scale-100 duration-300" />
</a>
)}

<div className="absolute top-3 right-3 flex gap-3">
{playstore && (
<a href={playstore} target="_blank" rel="noopener noreferrer" className="border p-1.5 shadow-xl dark:shadow-2xl duration-300 bg-fd-accent hover:bg-fd-background hover:border-black dark:hover:border-fd-primary dark:hover:shadow-fd-primary rounded-xl font-mono text-sm w-fit group-hover:-translate-y-8 ease-[cubic-bezier(0.175,0.885,0.32,1.275)] delay-75 hover:delay-0 hover:scale-105 hover:rounded-xl active:duration-75 active:scale-95 active:-translate-y-7 group-hover:rotate-6 hover:text-fd-foreground dark:hover:text-fd-primary">
<a href={playstore} target="_blank" rel="noopener noreferrer" aria-label={`View ${name} on Google Play`} className="border p-1.5 shadow-xl dark:shadow-2xl duration-300 bg-fd-accent hover:bg-fd-background hover:border-black dark:hover:border-fd-primary dark:hover:shadow-fd-primary rounded-xl font-mono text-sm w-fit group-hover:-translate-y-8 ease-[cubic-bezier(0.175,0.885,0.32,1.275)] delay-75 hover:delay-0 hover:scale-105 hover:rounded-xl active:duration-75 active:scale-95 active:-translate-y-7 group-hover:rotate-6 hover:text-fd-foreground dark:hover:text-fd-primary focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-fd-primary">
<PlayStoreIcon className="w-8 h-8 fill-current" />
</a>
)}
{appstore && (
<a href={appstore} target="_blank" rel="noopener noreferrer" className="border p-1.5 shadow-xl dark:shadow-2xl duration-300 bg-fd-accent hover:bg-fd-background hover:border-black dark:hover:border-fd-primary dark:hover:shadow-fd-primary rounded-xl font-mono text-sm w-fit group-hover:-translate-y-6 ease-[cubic-bezier(0.175,0.885,0.32,1.275)] delay-0 hover:delay-0 hover:scale-105 hover:rounded-xl active:duration-75 active:scale-95 active:-translate-y-5 group-hover:rotate-3 hover:text-fd-foreground dark:hover:text-fd-primary">
<a href={appstore} target="_blank" rel="noopener noreferrer" aria-label={`View ${name} on the App Store`} className="border p-1.5 shadow-xl dark:shadow-2xl duration-300 bg-fd-accent hover:bg-fd-background hover:border-black dark:hover:border-fd-primary dark:hover:shadow-fd-primary rounded-xl font-mono text-sm w-fit group-hover:-translate-y-6 ease-[cubic-bezier(0.175,0.885,0.32,1.275)] delay-0 hover:delay-0 hover:scale-105 hover:rounded-xl active:duration-75 active:scale-95 active:-translate-y-5 group-hover:rotate-3 hover:text-fd-foreground dark:hover:text-fd-primary focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-fd-primary">
<AppStoreIcon className="w-8 h-8 fill-current" />
</a>
)}
Expand All @@ -55,4 +62,4 @@ function PlayStoreIcon(props: React.SVGProps<SVGSVGElement>) {
return (
<svg role="img" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg" {...props}><title>Google Play</title><path d="M22.018 13.298l-3.919 2.218-3.515-3.493 3.543-3.521 3.891 2.202a1.49 1.49 0 0 1 0 2.594zM1.337.924a1.486 1.486 0 0 0-.112.568v21.017c0 .217.045.419.124.6l11.155-11.087L1.337.924zm12.207 10.065l3.258-3.238L3.45.195a1.466 1.466 0 0 0-.946-.179l11.04 10.973zm0 2.067l-11 10.933c.298.036.612-.016.906-.183l13.324-7.54-3.23-3.21z"/></svg>
);
}
}
4 changes: 2 additions & 2 deletions app/(home)/TestimonialsSection.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ export default function TestimonialsSection({
<>
<SectionTitle id="showcase" title="Who is using Nativewind?" />

<section className={`relative flex flex-col w-full max-w-fd-container mx-auto -mt-[1px] border-y border-dashed ${
<section id="showcase-content" className={`relative flex flex-col w-full max-w-fd-container mx-auto -mt-[1px] border-y border-dashed ${
showMore ? 'overflow-clip' : 'max-h-[50vh] overflow-hidden'
}`}>
{children}
Expand All @@ -25,7 +25,7 @@ export default function TestimonialsSection({
</div>
)}
<div className="sticky z-10 bottom-0 w-full pointer-events-none">
<button className="group pointer-events-auto mx-auto mb-4 w-30 font-semibold text-fd-background justify-between pl-3 p-1.5 rounded-xl border border-fd-background/30 shadow-lg flex items-center gap-1 bg-fd-primary hover:bg-fd-card active:bg-fd-accent cursor-pointer hover:text-fd-primary hover:scale-110 hover:-translate-y-0.5 hover:shadow-xl dark:hover:shadow-2xl active:duration-75 active:translate-y-0.5 duration-300 dark:hover:shadow-fd-primary hover:border-fd-primary ease-[cubic-bezier(0.175,0.885,0.32,1.275)] hover:border-dashed text-sm"
<button type="button" aria-expanded={showMore} aria-controls="showcase-content" className="group pointer-events-auto mx-auto mb-4 w-30 font-semibold text-fd-background justify-between pl-3 p-1.5 rounded-xl border border-fd-background/30 shadow-lg flex items-center gap-1 bg-fd-primary hover:bg-fd-card active:bg-fd-accent cursor-pointer hover:text-fd-primary hover:scale-110 hover:-translate-y-0.5 hover:shadow-xl dark:hover:shadow-2xl active:duration-75 active:translate-y-0.5 duration-300 dark:hover:shadow-fd-primary hover:border-fd-primary ease-[cubic-bezier(0.175,0.885,0.32,1.275)] hover:border-dashed text-sm focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-fd-primary"
onClick={() => {
setShowMore(!showMore)
document.getElementById('showcase')?.scrollIntoView({ behavior: 'smooth' })
Expand Down
Loading
Loading