Connect, collaborate, and grow with a community of TypeScript developers
Fix landing page on small screens. (#758)
Boris Nezlobinaa0ea4ef8069
diff --git a/apps/web/src/app/[locale]/_components/feature-card.tsx b/apps/web/src/app/[locale]/_components/feature-card.tsxindex 915cc57f..f7ab9354 100644--- a/apps/web/src/app/[locale]/_components/feature-card.tsx+++ b/apps/web/src/app/[locale]/_components/feature-card.tsx@@ -73,7 +73,7 @@ function FeatureCard({bgClass,)}>- <div className="mx-10 my-10 min-h-[450px] w-full">+ <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"><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">@@ -204,7 +204,7 @@ export function ChallengeCreationCard({<divclassName={clsx({ 'translate-x-0 opacity-0': step < 3 },- '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%]',+ '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%]',)}><div>🎉</div>@@ -391,7 +391,7 @@ export function CollaborativeEnvironmentCard(props: CardProps) {<FeatureCard {...props}><divref={ref}- className="absolute inset-0 left-[23px] top-[30%] 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-[50%] flex w-[100%] flex-col gap-3 pt-4 max-md:scale-90 sm:top-[35%] md:left-[37px] md:top-[30%]"><divclassName={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">5 years ago</div>+ <div className="text-xs text-neutral-500">48 minutes 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">just now</div>+ <div className="text-xs text-neutral-500">12 minutes ago</div></div>ez, the answer is<Markdown>{solutionComment}</Markdown>@@ -451,7 +451,7 @@ export function CuratedTracksCard(props: CardProps) {<FeatureCard {...props}><divclassName={clsx(- 'absolute inset-0 top-[50%] flex flex-col items-center justify-center',+ 'absolute inset-0 top-[90%] flex flex-col items-center justify-center','max-md:scale-110 md:top-[38%]',)}>@@ -460,7 +460,7 @@ export function CuratedTracksCard(props: CardProps) {TypeScript Foundations</span></div>- <div className="flex w-[69%] flex-col md:w-[82%] xl:w-[69%]">+ <div className="flex w-[69%] flex-col sm:top-auto md:w-[82%] xl:w-[69%]">{mockChallenges.map((mockChallenge) => (<MockTrackChallengekey={`mock-${mockChallenge.id}`}diff --git a/apps/web/src/app/[locale]/_components/features.tsx b/apps/web/src/app/[locale]/_components/features.tsxindex 384f8460..900e43e0 100644--- a/apps/web/src/app/[locale]/_components/features.tsx+++ b/apps/web/src/app/[locale]/_components/features.tsx@@ -64,12 +64,12 @@ export function Features() {<ImageCardimgClass1={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:left-[40px] md:w-[69%]',+ '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%]','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:left-[39%] md:-bottom-[2%] xl:-bottom-[12%] md:w-[77%]',+ '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%]','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() {<ChallengeCreationCardstep1img1Class={clsx('pointer-events-none w-[50%] border border-zinc-300/50 transition-all duration-500 dark:border-zinc-700/50',- 'max-md:scale-[160%] max-md:rounded-xl rounded-2xl left-[25%] top-[57%] md:left-[35px] md:top-[41%]',+ 'max-md:scale-[160%] lg:scale-[160%] max-md:rounded-xl rounded-2xl left-1/4 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%] rounded-xl max-md:rounded-lg left-[69%] top-[53%] md:top-[41%] md:left-[calc(50%+35px+1rem)]',+ '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)]','md:group-hover:-translate-y-6',)}step2img1Class={clsx(- '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%]',+ '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%]','md:group-hover:translate-y-2',)}step2img2Class={clsx(- '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',+ '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',)}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.tsxindex 3cf8b530..40d7660a 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@@ -146,9 +146,7 @@ export function MockTrackChallenge({ challenge }: { challenge: Challenge }) {<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" />{challenge.name}</div>- <div className="hidden md:block">- <DifficultyBadge difficulty={challenge.difficulty} />- </div>+ <DifficultyBadge difficulty={challenge.difficulty} /></div></label>);diff --git a/packages/ui/src/components/badge.tsx b/packages/ui/src/components/badge.tsxindex 8a8e83d5..0185a18e 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 items-center border rounded-full font-semibold transition-colors focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-0',+ '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',{variants: {variant: {