Skip to content

Commit e5b0d35

Browse files
committed
style(table): make metrics look better in mobile devices
1 parent eb2fd8c commit e5b0d35

1 file changed

Lines changed: 78 additions & 26 deletions

File tree

app/page.tsx

Lines changed: 78 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ import { BlurImage } from "@/components/ui/blur-image";
55
import { TrendingUp, Shield, Award, Zap } from "lucide-react";
66
import { GradientBlob } from "@/components/ui/GradientBlob";
77
import { WhatsAppButton } from "@/components/ui/WhatsAppButton";
8+
import { Card, CardContent, CardHeader } from "@/components/ui/card";
89
import { siteContent } from "@/lib/content";
910

1011
// Static Image Imports
@@ -30,6 +31,34 @@ export default function Home() {
3031
visible: { opacity: 1, y: 0, transition: { duration: 0.5 } },
3132
};
3233

34+
// Metrics data for responsive rendering (ordered by best ranking first)
35+
const metricsData = [
36+
{
37+
metric: "QS Graduate Employability",
38+
rankValue: "9",
39+
rankSuffix: "th",
40+
rankColor: "emerald",
41+
insightTitle: "The ROI Metric.",
42+
insightDescription: "BIT graduates are valued higher by employers than graduates from \"higher ranked\" but less practical universities."
43+
},
44+
{
45+
metric: "NTU Ranking (Engineering)",
46+
rankValue: "14",
47+
rankSuffix: "th",
48+
rankColor: "emerald",
49+
insightTitle: "The Truth.",
50+
insightDescription: "In pure engineering output, BIT is a global top-15 institution, outranking many Ivy League schools."
51+
},
52+
{
53+
metric: "ARWU (Shanghai Ranking) 2025",
54+
rankValue: "102",
55+
rankSuffix: "nd",
56+
rankColor: "default",
57+
insightTitle: "The Hard Science Metric.",
58+
insightDescription: "Being on the cusp of the Top 100 globally signals immense research productivity."
59+
}
60+
];
61+
3362
return (
3463
<div className="relative overflow-hidden">
3564
{/* Animated Breathing Background Blobs */}
@@ -195,16 +224,51 @@ export default function Home() {
195224

196225
{/* Rankings Table */}
197226
<div className="mb-24">
198-
<div className="text-center mb-12">
227+
<div className="text-center mb-8">
228+
<p className="text-xs font-medium uppercase tracking-wider text-muted-foreground mb-4">
229+
Global Recognition <span className="text-muted-foreground/50">(Multiple Rankings)</span>
230+
</p>
199231
<h2 className="text-3xl font-display font-bold mb-4">Other Metrics</h2>
200232
</div>
201233

234+
{/* Mobile Card Layout */}
235+
<motion.div
236+
initial={{ opacity: 0, y: 20 }}
237+
whileInView={{ opacity: 1, y: 0 }}
238+
viewport={{ once: true, margin: "-100px" }}
239+
transition={{ duration: 0.5 }}
240+
className="block sm:hidden space-y-6"
241+
>
242+
{metricsData.map((metric, index) => (
243+
<div key={index} className="bg-white/60 backdrop-blur-md rounded-3xl p-8 border border-white/40 shadow-sm">
244+
<div className="flex items-baseline gap-1 mb-2">
245+
<span className="text-3xl md:text-4xl font-semibold font-display tabular-nums text-foreground">
246+
{metric.rankValue}
247+
</span>
248+
<span className={`text-sm font-medium ${metric.rankColor === 'emerald' ? 'text-emerald-600' : 'text-primary'}`}>
249+
{metric.rankSuffix}
250+
</span>
251+
</div>
252+
<p className="text-sm text-muted-foreground mb-4">
253+
{metric.metric}
254+
</p>
255+
<h3 className="font-bold text-foreground mb-2">
256+
{metric.insightTitle}
257+
</h3>
258+
<p className="text-muted-foreground">
259+
{metric.insightDescription}
260+
</p>
261+
</div>
262+
))}
263+
</motion.div>
264+
265+
{/* Desktop Table Layout */}
202266
<motion.div
203267
initial={{ opacity: 0, y: 20 }}
204268
whileInView={{ opacity: 1, y: 0 }}
205269
viewport={{ once: true, margin: "-100px" }}
206270
transition={{ duration: 0.5 }}
207-
className="overflow-hidden rounded-3xl border border-border bg-white/40 backdrop-blur-sm shadow-xl"
271+
className="hidden sm:block overflow-hidden rounded-3xl border border-border bg-white/40 backdrop-blur-sm shadow-xl"
208272
>
209273
<table className="w-full text-left border-collapse">
210274
<thead>
@@ -215,30 +279,18 @@ export default function Home() {
215279
</tr>
216280
</thead>
217281
<tbody className="divide-y divide-border/50">
218-
<tr className="hover:bg-white/40 transition-colors">
219-
<td className="p-6 font-medium">ARWU (Shanghai Ranking) 2025</td>
220-
<td className="p-6 font-bold text-xl">#102</td>
221-
<td className="p-6 text-muted-foreground text-sm leading-relaxed">
222-
<strong className="text-foreground block mb-1">The Hard Science Metric.</strong>
223-
Being on the cusp of the Top 100 globally signals immense research productivity.
224-
</td>
225-
</tr>
226-
<tr className="hover:bg-white/40 transition-colors">
227-
<td className="p-6 font-medium">QS Graduate Employability</td>
228-
<td className="p-6 font-bold text-xl text-emerald-600">#9</td>
229-
<td className="p-6 text-muted-foreground text-sm leading-relaxed">
230-
<strong className="text-foreground block mb-1">The ROI Metric.</strong>
231-
BIT graduates are valued higher by employers than graduates from &quot;higher ranked&quot; but less practical universities.
232-
</td>
233-
</tr>
234-
<tr className="hover:bg-white/40 transition-colors">
235-
<td className="p-6 font-medium">NTU Ranking (Engineering)</td>
236-
<td className="p-6 font-bold text-xl text-emerald-600">#14</td>
237-
<td className="p-6 text-muted-foreground text-sm leading-relaxed">
238-
<strong className="text-foreground block mb-1">The Truth.</strong>
239-
In pure engineering output, BIT is a global top-15 institution, outranking many Ivy League schools.
240-
</td>
241-
</tr>
282+
{metricsData.map((metric, index) => (
283+
<tr key={index} className="hover:bg-white/40 transition-colors">
284+
<td className="p-6 font-medium">{metric.metric}</td>
285+
<td className={`p-6 font-bold text-xl ${metric.rankColor === 'emerald' ? 'text-emerald-600' : ''}`}>
286+
#{metric.rankValue}
287+
</td>
288+
<td className="p-6 text-muted-foreground text-sm leading-relaxed">
289+
<strong className="text-foreground block mb-1">{metric.insightTitle}</strong>
290+
{metric.insightDescription}
291+
</td>
292+
</tr>
293+
))}
242294
</tbody>
243295
</table>
244296
</motion.div>

0 commit comments

Comments
 (0)