feat: update font to Playfair_Display, refine UI styling for navbar and upload form, and introduce new CSS hover effects.

This commit is contained in:
2025-12-10 03:30:25 -05:00
parent 95d6bfa084
commit 53880bc8d5
5 changed files with 46 additions and 15 deletions

View File

@@ -1,6 +1,6 @@
import "~/styles/globals.css";
import { Inter, Outfit } from "next/font/google"; // Changed from Geist
import { Inter, Playfair_Display } from "next/font/google";
import { type Metadata } from "next";
const inter = Inter({
@@ -8,7 +8,7 @@ const inter = Inter({
variable: "--font-sans",
});
const outfit = Outfit({
const playfair = Playfair_Display({
subsets: ["latin"],
variable: "--font-heading",
});
@@ -23,7 +23,7 @@ export default function RootLayout({
children,
}: Readonly<{ children: React.ReactNode }>) {
return (
<html lang="en" className={`${inter.variable} ${outfit.variable} `} suppressHydrationWarning>
<html lang="en" className={`${inter.variable} ${playfair.variable} `} suppressHydrationWarning>
<head>
</head>

View File

@@ -18,7 +18,7 @@ export default function HomePage() {
<div className="container mx-auto px-4 pt-32 pb-8">
<div className="flex flex-col items-center justify-center gap-4">
<div className="text-center space-y-4 max-w-5xl">
<h1 className="text-5xl font-extrabold tracking-tight lg:text-7xl bg-clip-text text-transparent bg-gradient-to-b from-neutral-800 to-neutral-500 dark:from-neutral-100 dark:to-neutral-400">
<h1 className="font-heading text-5xl font-extrabold tracking-tight lg:text-7xl bg-clip-text text-transparent bg-gradient-to-b from-neutral-800 to-neutral-500 dark:from-neutral-100 dark:to-neutral-400">
PDF to Markdown
</h1>
<p className="text-xl text-muted-foreground leading-relaxed">

View File

@@ -5,10 +5,10 @@ import { Button } from "./ui/button";
export function Navbar() {
return (
<div className="fixed top-4 left-0 right-0 z-50 flex justify-center px-4">
<nav className="flex items-center justify-between w-full max-w-4xl px-4 py-2 bg-background/80 backdrop-blur-md border border-border/50 rounded-full shadow-lg">
<nav className="flex items-center justify-between w-full max-w-4xl px-4 py-2 m-4 bg-background/80 backdrop-blur-md border border-border/60 rounded-2xl shadow-lg">
<Link href="/" className="flex items-center gap-2 px-2 hover:opacity-80 transition-opacity">
<FileText className="w-5 h-5 text-primary" />
<span className="font-semibold tracking-tight">PDF2MD</span>
<span className="font-heading font-semibold tracking-tight">PDF2MD</span>
</Link>
<div className="flex items-center gap-2">
<Button variant="ghost" size="icon" asChild className="rounded-full">

View File

@@ -80,8 +80,8 @@ export function UploadForm() {
</TabsTrigger>
</TabsList>
<TabsContent value="upload">
<Card className="bg-background/60 backdrop-blur-xl border-border/50 shadow-sm rounded-3xl">
<TabsContent value="upload" className="mt-0">
<Card className="border-dashed border-2 bg-background/60 backdrop-blur-xl border-border/50 shadow-sm rounded-3xl card-hover">
<CardHeader>
<CardTitle>Upload PDF</CardTitle>
<CardDescription>Select a PDF file to convert to Markdown</CardDescription>
@@ -107,7 +107,7 @@ export function UploadForm() {
</div>
<span className="font-medium truncate max-w-[200px] sm:max-w-md">{fileName}</span>
</div>
<Button type="button" variant="ghost" size="icon" onClick={clearFile} aria-label="Remove file" className="rounded-full">
<Button type="button" variant="ghost" size="icon" onClick={clearFile} aria-label="Remove file" className="rounded-full button-hover">
<X className="w-4 h-4" />
</Button>
</div>
@@ -128,7 +128,7 @@ export function UploadForm() {
type="submit"
variant="outline"
disabled={isLoading || !fileName}
className="w-full sm:w-auto rounded-xl border-2 hover:bg-muted/50"
className="w-full sm:w-auto rounded-xl border-2 hover:bg-muted/50 button-hover"
>
{isLoading ? (
<>
@@ -162,7 +162,7 @@ export function UploadForm() {
void navigator.clipboard.writeText(markdown);
setIsCopied(true);
setTimeout(() => setIsCopied(false), 2000);
}} className="min-w-[40px] rounded-xl">
}} className="min-w-[40px] rounded-xl button-hover">
{isCopied ? <Check className="w-4 h-4" /> : <Clipboard className="w-4 h-4" />}
{!isCopied && <span className="ml-2">Copy</span>}
</Button>
@@ -184,7 +184,7 @@ export function UploadForm() {
const input = document.getElementById('file') as HTMLInputElement;
if (input) input.value = '';
}}
className="w-full rounded-xl border-2 hover:bg-muted/50"
className="w-full rounded-xl border-2 hover:bg-muted/50 button-hover"
>
<RotateCcw className="mr-2 h-4 w-4" />
Convert another file

View File

@@ -4,29 +4,38 @@
:root {
--background: 0 0% 100%;
/* #FFFFFF */
--foreground: 240 10% 3.9%;
/* #09090B */
--card: 0 0% 100%;
/* #FFFFFF */
--card-foreground: 240 10% 3.9%;
--popover: 0 0% 100%;
--popover-foreground: 240 10% 3.9%;
--primary: 240 5.9% 10%;
/* #18181B */
--primary-foreground: 0 0% 98%;
--secondary: 240 4.8% 95.9%;
/* #FAFAFA */
--secondary: 240 4.8% 90%;
/* #E4E4E7 (Darkened for contrast) */
--secondary-foreground: 240 5.9% 10%;
--muted: 240 4.8% 95.9%;
/* #F4F4F5 */
--muted-foreground: 240 3.8% 46.1%;
--accent: 240 4.8% 95.9%;
--accent-foreground: 240 5.9% 10%;
--destructive: 0 84.2% 60.2%;
--destructive-foreground: 0 0% 98%;
--border: 240 5.9% 90%;
/* #E4E4E7 */
--input: 240 5.9% 90%;
--ring: 240 10% 3.9%;
--radius: 1rem;
/* 16px Global Radius */
--chart-1: 12 76% 61%;
--chart-2: 173 58% 39%;
--chart-3: 197 37% 24%;
--chart-5: 27 87% 67%;
--radius: 1rem;
--sidebar: 0 0% 98%;
--sidebar-foreground: 240 5.3% 26.1%;
--sidebar-primary: 240 5.9% 10%;
@@ -40,14 +49,17 @@
@media (prefers-color-scheme: dark) {
:root {
--background: 240 10% 3.9%;
/* #09090B */
--foreground: 0 0% 98%;
/* #FAFAFA */
--card: 240 10% 3.9%;
--card-foreground: 0 0% 98%;
--popover: 240 10% 3.9%;
--popover-foreground: 0 0% 98%;
--primary: 0 0% 98%;
--primary-foreground: 240 5.9% 10%;
--secondary: 240 3.7% 15.9%;
--secondary: 240 3.7% 20%;
/* #27272A */
--secondary-foreground: 0 0% 98%;
--muted: 240 3.7% 15.9%;
--muted-foreground: 240 5% 64.9%;
@@ -56,6 +68,7 @@
--destructive: 0 62.8% 30.6%;
--destructive-foreground: 0 0% 98%;
--border: 240 3.7% 15.9%;
/* #27272A */
--input: 240 3.7% 15.9%;
--ring: 240 4.9% 83.9%;
--chart-1: 220 70% 50%;
@@ -137,6 +150,24 @@
.animation-delay-4000 {
animation-delay: 4s;
}
.card-hover {
transition: all 0.3s ease-out;
}
.card-hover:hover {
transform: translateY(-4px);
box-shadow: 0 12px 24px -10px hsl(var(--foreground) / 0.1);
}
.button-hover {
transition: all 0.2s ease-out;
}
.button-hover:hover {
transform: translateY(-2px);
box-shadow: 0 4px 12px -4px hsl(var(--foreground) / 0.1);
}
}
@keyframes blob {