Skip to content

Connect, collaborate, and grow with a community of TypeScript developers

Fix feature cards (#900)

PickleNikeda5c4db6795
diff --git a/apps/web/src/app/[locale]/_components/community/community.tsx b/apps/web/src/app/[locale]/_components/community/community.tsx
index 845ebbce..7110281a 100644
--- a/apps/web/src/app/[locale]/_components/community/community.tsx
+++ b/apps/web/src/app/[locale]/_components/community/community.tsx
@@ -144,7 +144,7 @@ export function Community() {
</div>
</div>
{/* autoscrolled */}
- <div className="pb-16 lg:pb-0 lg:pl-8 xl:hidden">
+ <div className="pb-16 sm:pb-24 lg:pb-0 lg:pl-8 xl:hidden">
<div className="infinite-scroll-x-container mx-auto hover:shadow-[0_0_10rem_10rem_#fff8] dark:hover:shadow-[0_0_10rem_10rem_#0008] lg:w-[25rem] xl:w-[35rem]">
<div
ref={innerScrollerRef}
diff --git a/apps/web/src/app/[locale]/_components/feature-card.tsx b/apps/web/src/app/[locale]/_components/feature-card.tsx
index f7ab9354..ffeb1b8a 100644
--- a/apps/web/src/app/[locale]/_components/feature-card.tsx
+++ b/apps/web/src/app/[locale]/_components/feature-card.tsx
@@ -73,8 +73,8 @@ function FeatureCard({
bgClass,
)}
>
- <div className="mx-10 my-10 min-h-[250px] w-full md:min-h-[450px]">
- <div className="flex w-4/6 flex-col gap-3 md:w-[80%] xl:w-4/6">
+ <div className="m-6 min-h-[330px] w-full sm:m-10 md:min-h-[450px]">
+ <div className="flex w-5/6 flex-col gap-3 sm:w-4/6 md:w-4/5 xl:w-4/6">
<h2 className="text-xl font-bold tracking-tight md:text-xl">{title}</h2>
<p className="text-sm leading-5 text-zinc-600 dark:text-zinc-400 sm:text-base sm:leading-7">
{description}
@@ -204,7 +204,7 @@ export function ChallengeCreationCard({
<div
className={clsx(
{ 'translate-x-0 opacity-0': step < 3 },
- 'absolute left-1/2 top-[55%] flex w-[80%] -translate-x-1/2 -translate-y-[33%] flex-col gap-12 text-center text-2xl font-bold transition-all duration-500 md:w-[50%]',
+ 'absolute left-1/2 top-1/2 flex w-[80%] -translate-x-1/2 -translate-y-[33%] flex-col gap-12 text-center text-2xl font-bold transition-all duration-500 md:w-[50%]',
)}
>
<div>🎉</div>
@@ -391,7 +391,7 @@ export function CollaborativeEnvironmentCard(props: CardProps) {
<FeatureCard {...props}>
<div
ref={ref}
- className="absolute inset-0 left-[23px] top-[50%] flex w-[100%] flex-col gap-3 pt-4 max-md:scale-90 sm:top-[35%] md:left-[37px] md:top-[30%]"
+ className="absolute inset-0 left-[23px] top-[25%] flex w-[100%] flex-col gap-3 pt-4 max-md:scale-90 sm:left-[33px] sm:top-[35%] md:left-[37px] md:top-[30%]"
>
<div
className={clsx(
@@ -402,7 +402,7 @@ export function CollaborativeEnvironmentCard(props: CardProps) {
>
<div className="flex items-center gap-2">
<Badge name="dax" />
- <div className="text-xs text-neutral-500">48 minutes ago</div>
+ <div className="text-xs text-neutral-500">5 years ago</div>
</div>
Implementing Pick in TypeScript is hard, can anyone help?
</div>
@@ -416,7 +416,7 @@ export function CollaborativeEnvironmentCard(props: CardProps) {
<Reply className="absolute -left-8 h-4 w-4 opacity-50" />
<div className="flex items-center gap-2">
<Badge name="trash" />
- <div className="text-xs text-neutral-500">12 minutes ago</div>
+ <div className="text-xs text-neutral-500">just now</div>
</div>
ez, the answer is
<Markdown>{solutionComment}</Markdown>
@@ -434,12 +434,19 @@ export function CollaborativeEnvironmentCard(props: CardProps) {
<div className="text-xs text-neutral-500">just now</div>
</div>
<Image
- className={clsx({ amoguwusus: inView }, 'opacity-0')}
+ className={clsx({ amoguwusus: inView }, 'hidden opacity-0 xl:block')}
alt="amoguwuawa"
src="/Red.webp"
height="198"
width="150"
/>
+ <Image
+ className={clsx({ amoguwusus: inView }, 'opacity-0 xl:hidden')}
+ alt="amoguwuawa"
+ src="/Red.webp"
+ height="66"
+ width="50"
+ />
</div>
</div>
</FeatureCard>
@@ -451,8 +458,8 @@ export function CuratedTracksCard(props: CardProps) {
<FeatureCard {...props}>
<div
className={clsx(
- 'absolute inset-0 top-[90%] flex flex-col items-center justify-center',
- 'max-md:scale-110 md:top-[38%]',
+ 'absolute inset-0 top-[60%] flex flex-col items-center justify-center sm:top-[69%]',
+ 'max-md:scale-110 md:top-[42%] lg:top-[38%]',
)}
>
<div className="flex w-[69%] items-center justify-between gap-3 rounded-b-lg rounded-t-xl bg-neutral-500/10 p-2 pl-3 md:w-[82%] xl:w-[69%]">
@@ -460,7 +467,7 @@ export function CuratedTracksCard(props: CardProps) {
TypeScript Foundations
</span>
</div>
- <div className="flex w-[69%] flex-col sm:top-auto md:w-[82%] xl:w-[69%]">
+ <div className="flex w-[69%] flex-col md:w-[82%] xl:w-[69%]">
{mockChallenges.map((mockChallenge) => (
<MockTrackChallenge
key={`mock-${mockChallenge.id}`}
diff --git a/apps/web/src/app/[locale]/_components/features.tsx b/apps/web/src/app/[locale]/_components/features.tsx
index 900e43e0..b35bdbd4 100644
--- a/apps/web/src/app/[locale]/_components/features.tsx
+++ b/apps/web/src/app/[locale]/_components/features.tsx
@@ -26,7 +26,7 @@ import {
export function Features() {
return (
<section className="relative overflow-hidden" id="features">
- <div className="mx-auto mb-[64px] grid max-w-[1400px] items-center justify-center px-4 lg:px-24">
+ <div className="mx-auto mb-[64px] grid max-w-[1400px] items-center justify-center px-4 sm:px-24 md:px-4 lg:px-24">
<div className="flex flex-col items-center justify-center gap-16">
<div className="mt-1 flex flex-col gap-3 px-4 text-center sm:px-0">
<a
@@ -60,16 +60,16 @@ export function Features() {
<Balancer>All you need to become a TypeScript menace</Balancer>
</p>
</div>
- <div className="relative z-10 grid w-full gap-4 md:grid-cols-2 lg:gap-8 sm:[&>*:nth-child(3)]:hidden md:[&>*:nth-child(3)]:block">
+ <div className="relative z-10 grid w-full gap-4 md:grid-cols-2 lg:gap-8 [&>*:nth-child(3)]:hidden md:[&>*:nth-child(3)]:block">
<ImageCard
imgClass1={clsx(
'pointer-events-none transition-transform duration-500 bg-neutral-50/30 dark:bg-neutral-800/30',
- 'scale-[150%] sm:scale-[110%] md:scale-100 max-md:rounded-sm rounded-xl top-[69%] left-[69px] md:top-auto w-[42%] md:-bottom-[1%] xl:-bottom-[11%] sm:top-[55%] sm:left-[40px] md:w-[69%]',
+ 'scale-[150%] sm:scale-100 md:scale-100 max-md:rounded-sm rounded-xl top-[69%] left-[69px] md:top-auto w-[42%] sm:top-[50%] md:-bottom-[1%] xl:-bottom-[11%] sm:left-[40px] md:w-[69%]',
'md:group-hover:translate-x-2 md:group-hover:scale-95',
)}
imgClass2={clsx(
'pointer-events-none transition-transform duration-500 bg-neutral-50/50 dark:bg-zinc-800/60 backdrop-blur-sm translate-x-0',
- 'scale-[190%] sm:scale-[150%] md:scale-100 rounded-2xl max-md:rounded-md left-[50%] top-[69%] md:top-auto w-[50%] sm:top-[50%] sm:left-[39%] md:-bottom-[2%] xl:-bottom-[12%] md:w-[77%]',
+ 'scale-[190%] sm:scale-[120%] md:scale-100 rounded-2xl max-md:rounded-md left-[50%] sm:top-[49%] top-[69%] md:top-auto w-[50%] sm:left-[39%] md:-bottom-[2%] xl:-bottom-[12%] md:w-[77%]',
'md:group-hover:scale-105 md:group-hover:-translate-x-2',
)}
description="Engage in TypeScript challenges to strengthen your grasp of the type system and advanced features"
@@ -91,23 +91,23 @@ export function Features() {
<ChallengeCreationCard
step1img1Class={clsx(
'pointer-events-none w-[50%] border border-zinc-300/50 transition-all duration-500 dark:border-zinc-700/50',
- 'max-md:scale-[160%] lg:scale-[160%] max-md:rounded-xl rounded-2xl left-1/4 top-[57%] md:left-[35px] md:top-[41%]',
+ 'max-md:scale-[160%] max-md:rounded-xl rounded-2xl left-[25%] top-[57%] md:left-[35px] md:top-[41%]',
'md:group-hover:translate-y-2',
)}
step1img2Class={clsx(
'pointer-events-none w-[60%] border border-zinc-300/50 dark:border-zinc-700/50 transition-all duration-500 overflow-hidden',
- 'max-md:scale-[160%] lg:scale-[160%] rounded-xl max-md:rounded-lg left-[69%] top-[53%] md:top-[41%] md:left-[calc(50%+35px+1rem)]',
+ 'max-md:scale-[160%] rounded-xl max-md:rounded-lg left-[69%] top-[53%] md:top-[41%] md:left-[calc(50%+35px+1rem)]',
'md:group-hover:-translate-y-6',
)}
step2img1Class={clsx(
- 'pointer-events-none w-[50%] scale-1/2 rounded-t-xl overflow-hidden border border-zinc-300 transition-all duration-500 dark:border-zinc-700',
- 'max-md:scale-[100%] lg:scale-1 lg:top-[40%] left-[0%] top-[40%] lg:top-[30%] md:left-[17px] md:top-[40%]',
+ 'pointer-events-none w-[50%] rounded-t-xl overflow-hidden border border-zinc-300 transition-all duration-500 dark:border-zinc-700',
+ 'max-md:scale-[160%] left-[25%] top-[69%] md:left-[35px] md:top-[30%]',
'md:group-hover:translate-y-2',
)}
step2img2Class={clsx(
- 'pointer-events-none w-[50%] scale-1/2 rounded-t-xl border border-zinc-300 dark:border-zinc-700 transition-all duration-500 rounded-xl overflow-hidden group-hover:-translate-y-6',
- 'max-md:scale-[100%] lg:scale-1 lg:top-[40%] left-[50%] top-[40%] md:top-[40%] lg:top-[30%] md:left-[calc(50%+17px+1rem)]',
- 'md:group-hover:-translate-y-2',
+ 'pointer-events-none w-[110%] rounded-t-xl border border-zinc-300 dark:border-zinc-700 transition-all duration-500 rounded-xl overflow-hidden group-hover:-translate-y-6',
+ 'max-md:scale-[140%] left-[70%] top-[53%] md:top-[30%] md:left-[calc(50%+35px+1rem)]',
+ 'md:group-hover:-translate-y-6',
)}
step3imgClass={clsx(
'pointer-events-none w-[90%] border border-zinc-300 dark:border-zinc-700 rounded-t-2xl transition-all duration-500 overflow-hidden',
diff --git a/apps/web/src/app/[locale]/tracks/_components/track-challenge-card.tsx b/apps/web/src/app/[locale]/tracks/_components/track-challenge-card.tsx
index 40d7660a..d5e1d4e4 100644
--- a/apps/web/src/app/[locale]/tracks/_components/track-challenge-card.tsx
+++ b/apps/web/src/app/[locale]/tracks/_components/track-challenge-card.tsx
@@ -129,24 +129,26 @@ export function MockTrackChallenge({ challenge }: { challenge: Challenge }) {
BGS_BY_DIFFICULTY[challenge.difficulty],
'flex w-full items-center justify-between gap-3 overflow-hidden rounded-lg',
'bg-gradient-to-r from-neutral-500/10 from-70% to-100% dark:from-neutral-500/20',
- 'p-4 py-2 text-black/90 duration-300 group-active/challenge:bg-neutral-500/40 group-active/challenge:duration-75 dark:text-white/90 sm:py-4',
+ 'p-2 pl-3 text-black/90 duration-300 group-active/challenge:bg-neutral-500/40 group-active/challenge:duration-75 dark:text-white/90 md:p-4',
{
'group-hover/challenge:scale-105 group-hover/challenge:rounded-xl group-hover/challenge:bg-neutral-500/20':
!isMobile,
},
)}
>
- <div className="relative flex flex-row items-center gap-3">
+ <div className="relative flex flex-row items-center gap-3 text-sm sm:text-base">
<input
className="peer absolute appearance-none"
type="checkbox"
id={challenge.id.toString()}
/>
- <div className="h-5 w-5 rounded-full border border-black/70 bg-black/10 duration-75 peer-checked:border-transparent peer-checked:bg-green-600/80 dark:border-white/50 dark:bg-white/10 peer-checked:dark:bg-green-300/80" />
- <Check className="absolute left-1 my-auto h-3 w-3 scale-0 stroke-[4] text-white duration-300 peer-checked:scale-100 dark:text-black" />
+ <div className="h-4 w-4 rounded-full border border-black/70 bg-black/10 duration-75 peer-checked:border-transparent peer-checked:bg-green-600/80 dark:border-white/50 dark:bg-white/10 peer-checked:dark:bg-green-300/80 sm:h-5 sm:w-5" />
+ <Check className="absolute left-1 my-auto h-2 w-2 scale-0 stroke-[4] text-white duration-300 peer-checked:scale-100 dark:text-black sm:h-3 sm:w-3" />
{challenge.name}
</div>
- <DifficultyBadge difficulty={challenge.difficulty} />
+ <div className="translate-x-1 scale-75 sm:translate-x-0 sm:scale-100">
+ <DifficultyBadge difficulty={challenge.difficulty} />
+ </div>
</div>
</label>
);
diff --git a/packages/ui/src/components/badge.tsx b/packages/ui/src/components/badge.tsx
index 0185a18e..8a8e83d5 100644
--- a/packages/ui/src/components/badge.tsx
+++ b/packages/ui/src/components/badge.tsx
@@ -5,7 +5,7 @@ import { cva, type VariantProps } from 'class-variance-authority';
import { cn } from '../cn';
const badgeVariants = cva(
- 'inline-flex select-none items-center border rounded-full px-2.5 py-0.5 font-semibold transition-colors focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-0',
+ 'inline-flex items-center border rounded-full font-semibold transition-colors focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-0',
{
variants: {
variant: {