Skip to content

Commit 9af3316

Browse files
committed
feat: improve ui responsivness feature cards, hero & cta
1 parent da71bd6 commit 9af3316

5 files changed

Lines changed: 25 additions & 13 deletions

File tree

src/components/cards/NodeCard.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ export async function NodeCard({ locale, animationDelay = 0 }: NodeTabsCardProps
1414

1515
return (
1616
<FeatureCard
17-
className="col-span-1 md:col-span-2 row-span-3"
17+
className="col-span-1 md:col-span-2 row-span-4 md:row-span-3"
1818
contentClassName="h-full items-stretch"
1919
tone="pink"
2020
animationDelay={animationDelay}

src/components/cards/RuntimeTypesCard.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ export async function RuntimeTypesCard({ locale, animationDelay = 0 }: RuntimeTy
1515
return (
1616
<FeatureCard
1717
className="col-span-1 row-span-4"
18-
contentClassName="h-full items-stretch justify-between"
18+
contentClassName="h-full items-stretch justify-between gap-2"
1919
tone="brand"
2020
animationDelay={animationDelay}
2121
>

src/components/sections/CtaSection.tsx

Lines changed: 14 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
"use client"
22

33
import { InteractiveGridPattern } from "@/components/InteractiveGridPattern"
4+
import { useMediaQuery } from "@/hooks/useMediaQuery"
45
import { Section } from "@/components/ui/Section"
56
import { cn } from "@/lib/utils"
67
import Image from "next/image"
@@ -25,6 +26,7 @@ interface CtaSectionProps {
2526

2627
export const CtaSection: React.FC<CtaSectionProps> = ({ content }) => {
2728
const { trigger } = useWebHaptics()
29+
const isTouchDevice = useMediaQuery("(hover: none), (pointer: coarse)")
2830
if (!content) return
2931

3032
const staggerContainer: Variants = {
@@ -61,17 +63,24 @@ export const CtaSection: React.FC<CtaSectionProps> = ({ content }) => {
6163
<div className={"relative flex w-full flex-col items-center justify-center gap-8 overflow-hidden rounded-[calc(1.8rem-1px)] px-6 py-12 sm:px-10"}>
6264

6365
<InteractiveGridPattern
64-
className={cn("opacity-45 mask-[radial-gradient(600px_circle_at_center,white,transparent)]")}
66+
className={cn(
67+
"opacity-45 mask-[radial-gradient(600px_circle_at_center,white,transparent)]",
68+
isTouchDevice && "opacity-30",
69+
)}
6570
width={40}
6671
height={40}
6772
squares={[30, 15]}
6873
/>
69-
<div className="pointer-events-none absolute inset-0 bg-[radial-gradient(circle_at_top,rgba(255,255,255,0.1),transparent_36%),radial-gradient(circle_at_center,rgba(248,114,226,0.16),transparent_62%)]" />
70-
<div className="pointer-events-none absolute inset-x-8 -top-16 h-40 bg-[radial-gradient(circle,rgba(122,203,255,0.18),transparent_68%)] blur-2xl" />
74+
<div className={cn(
75+
"pointer-events-none absolute inset-0 bg-[radial-gradient(circle_at_top,rgba(255,255,255,0.1),transparent_36%),radial-gradient(circle_at_center,rgba(248,114,226,0.16),transparent_62%)]",
76+
isTouchDevice && "opacity-70",
77+
)} />
78+
<div className="pointer-events-none absolute inset-x-8 -top-16 hidden h-40 bg-[radial-gradient(circle,rgba(122,203,255,0.18),transparent_68%)] blur-2xl sm:block" />
7179

72-
<motion.div variants={staggerItem} className={"relative z-20 flex size-32 items-center justify-center rounded-2xl bg-white/5 shadow-[0_14px_36px_rgba(0,0,0,0.22)] backdrop-blur-md"}>
80+
<motion.div variants={staggerItem} className={"relative z-20 flex size-32 items-center justify-center rounded-2xl bg-white/5 shadow-[0_14px_36px_rgba(0,0,0,0.22)] md:backdrop-blur-md"}>
7381
<div className="pointer-events-none absolute inset-0 rounded-2xl bg-[radial-gradient(circle_at_top_left,rgba(255,255,255,0.12),transparent_35%)]" />
74-
<div className={"relative flex items-center justify-center rounded-2xl ring ring-white/10 bg-linear-to-br from-primary via-primary to-pink/8 px-4 py-4 shadow-[inset_0_1px_0_rgba(255,255,255,0.06)]"}>
82+
<div className={"relative isolate flex items-center justify-center rounded-2xl ring ring-white/10 px-4 py-4 shadow-[inset_0_1px_0_rgba(255,255,255,0.06)]"}>
83+
<div className="pointer-events-none absolute inset-0 rounded-2xl bg-linear-to-br from-primary via-primary to-[#2a1638]" />
7584
<Image src={"/code0_logo_white.png"} width={"112"} height={"112"} alt={"Code0 Logo"} className={"z-20"}/>
7685
</div>
7786
</motion.div>

src/components/sections/HeroSection.tsx

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -96,13 +96,12 @@ export const HeroSection: React.FC<HeroSectionProps> = ({ content }) => {
9696
<div className="pointer-events-none absolute inset-0 z-10 bg-[radial-gradient(circle_at_top,rgba(255,255,255,0.08),transparent_36%),linear-gradient(180deg,rgba(255,255,255,0.02),transparent_32%)]" />
9797

9898
<motion.div
99-
className={"relative z-20 flex h-full flex-col items-center justify-between gap-12 rounded-[calc(1.9rem-1px)] px-8 py-12 lg:flex-row lg:px-16 lg:py-24"}
99+
className={"relative z-20 flex h-full flex-col items-center justify-between gap-8 rounded-[calc(1.9rem-1px)] p-8 lg:flex-row lg:p-16"}
100100
variants={staggerContainer}
101101
initial="hidden"
102102
whileInView="show"
103103
viewport={{ once: true, amount: 0.25 }}
104104
>
105-
106105
<div className="w-full lg:w-2/5 flex flex-col gap-4 text-start">
107106
<motion.div variants={staggerItem}>
108107
<Link href={content.badge_link ?? ""}>
@@ -117,7 +116,7 @@ export const HeroSection: React.FC<HeroSectionProps> = ({ content }) => {
117116
{content.heading}
118117
</motion.h1>
119118

120-
<motion.p variants={staggerItem} className="relative z-10 font-medium text-white/75 text-lg lg:text-xl text-balance">
119+
<motion.p variants={staggerItem} className="relative z-10 font-medium text-white/75 text-base lg:text-xl text-pretty">
121120
{content.texts.length > 0
122121
? content.texts.map((item, index) => (
123122
<React.Fragment key={`${item.id ?? item.text}-${index}`}>
@@ -128,7 +127,7 @@ export const HeroSection: React.FC<HeroSectionProps> = ({ content }) => {
128127
: <>Beschreibung1 <br /> Beschreibung2</>}
129128
</motion.p>
130129

131-
<motion.div variants={staggerItem} className={"flex flex-col gap-4 mt-4"}>
130+
<motion.div variants={staggerItem} className={"flex flex-col gap-2 sm:gap-4 mt-4"}>
132131
{content.buttons.map((button, index) => (
133132
<Link href={button.url} key={`${button.label}-${button.id ?? index}`} className="w-full sm:w-auto">
134133
<Button

src/components/ui/SuggesstionMenuClient.tsx

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -43,9 +43,13 @@ export function SuggesstionMenuClient() {
4343
suppressHydrationWarning
4444
>
4545
<IconVariable size={12}/>
46-
<Badge color="secondary" border className="border-pink! bg-[#1c0b29]!">
46+
<Badge color="secondary" border className="min-w-0! max-w-full! border-pink! bg-[#1c0b29]!">
4747
<IconNote size={12} color="#f872e2" />
48-
<Text size="sm" style={{ color: "#f872e2" }}>
48+
<Text
49+
size="sm"
50+
className="min-w-0 max-w-full overflow-hidden text-ellipsis whitespace-nowrap"
51+
style={{ color: "#f872e2" }}
52+
>
4953
{label}
5054
</Text>
5155
</Badge>

0 commit comments

Comments
 (0)