Skip to content

Commit 60cb402

Browse files
2 parents 2c13a68 + c5d22b3 commit 60cb402

File tree

15 files changed

+155
-116
lines changed

15 files changed

+155
-116
lines changed

.github/workflows/build.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,6 @@ jobs:
1414
- uses: actions/setup-node@v3
1515
with:
1616
node-version: 18
17-
cache: "npm"
17+
cache: 'npm'
1818
- run: npm install
1919
- run: npm run build

.github/workflows/eslint.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,6 @@ jobs:
1414
- uses: actions/setup-node@v3
1515
with:
1616
node-version: 18
17-
cache: "npm"
17+
cache: 'npm'
1818
- run: npm install
1919
- run: npm run lint

.github/workflows/prettier.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,6 @@ jobs:
1414
- uses: actions/setup-node@v3
1515
with:
1616
node-version: 18
17-
cache: "npm"
17+
cache: 'npm'
1818
- run: npm install
19-
- run: npx prettier --check .
19+
- run: npm run prettier:check

.github/workflows/typescript.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,6 @@ jobs:
1414
- uses: actions/setup-node@v3
1515
with:
1616
node-version: 18
17-
cache: "npm"
17+
cache: 'npm'
1818
- run: npm install
1919
- run: npm run type-check

README.md

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
1+
12
# 🖼️ Image to SVG Converter
23

34
A simple web app that lets users upload any image (PNG/JPG) and instantly convert it into an **SVG** file.
4-
Users can **preview**, **copy the SVG code**, or **download the file** to use anywhere.
5+
Users can **preview**, **copy the SVG code**, or **download the file** to use anywhere.
56

67
---
78

89
## ✨ Features
9-
1010
- 🚀 Upload images (PNG, JPG, JPEG)
1111
- 🔄 Convert raster images into scalable vector graphics (SVG)
1212
- 👀 Live preview of the generated SVG
@@ -17,21 +17,19 @@ Users can **preview**, **copy the SVG code**, or **download the file** to use an
1717
---
1818

1919
## 🛠️ Tech Stack
20-
21-
- **Frontend:** React / Next.js
22-
- **Vectorization:** [ImageTracer.js](https://github.com/jankovicsandras/imagetracerjs)
23-
- **Styling:** TailwindCSS (or your chosen framework)
20+
- **Frontend:** React / Next.js
21+
- **Vectorization:** [ImageTracer.js](https://github.com/jankovicsandras/imagetracerjs)
22+
- **Styling:** TailwindCSS (or your chosen framework)
2423

2524
---
2625

2726
## 📦 Installation
2827

2928
Clone the repository:
30-
3129
```bash
3230
git clone https://github.com/shitanshukumar607/imgToSvg.git
3331
cd imgToSvg
34-
```
32+
````
3533

3634
Install dependencies:
3735

@@ -60,12 +58,14 @@ Open [http://localhost:3000](http://localhost:3000) to view the app in the brows
6058

6159
## 📸 Screenshots
6260

61+
62+
6363
## 🔮 Future Improvements
6464

65-
- ✏️ Basic SVG editor (resize, recolor, simplify paths)
66-
- 🎨 Presets (outline only, reduced colors, full color)
67-
- 📂 Support batch uploads
68-
- 🤖 AI-assisted vectorization for complex images
65+
* ✏️ Basic SVG editor (resize, recolor, simplify paths)
66+
* 🎨 Presets (outline only, reduced colors, full color)
67+
* 📂 Support batch uploads
68+
* 🤖 AI-assisted vectorization for complex images
6969

7070
---
7171

@@ -79,4 +79,4 @@ Contributions are welcome!
7979
4. Push branch (`git push origin feature-name`)
8080
5. Create a Pull Request
8181

82-
---
82+
---

app/api/upload/route.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -48,13 +48,13 @@ export async function POST(req: Request) {
4848
resolve(result);
4949
});
5050
uploadStream.end(buffer);
51-
},
51+
}
5252
);
5353

5454
const svgString = await cloudinaryToSVG(cloudinaryResponse.secure_url);
5555

5656
return NextResponse.json(
5757
{ url: cloudinaryResponse.secure_url, svg: svgString },
58-
{ status: 201 },
58+
{ status: 201 }
5959
);
6060
}

app/globals.css

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -157,9 +157,7 @@
157157
border: 2px solid transparent; /* creates padding */
158158
background-clip: padding-box;
159159
box-shadow: var(--sb-glow);
160-
transition:
161-
background-color 150ms ease,
162-
transform 150ms ease;
160+
transition: background-color 150ms ease, transform 150ms ease;
163161
}
164162

165163
*::-webkit-scrollbar-thumb:hover {

app/layout.tsx

Lines changed: 17 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,33 +1,31 @@
1-
import type { Metadata } from "next";
2-
import { Geist, Geist_Mono } from "next/font/google";
1+
import Navbar from "@/components/NavbarComponents/Navbar";
2+
import { ThemeProvider } from "@/components/NavbarComponents/ThemeProvider";
3+
import { Space_Grotesk } from "next/font/google";
34
import "./globals.css";
45

5-
const geistSans = Geist({
6-
variable: "--font-geist-sans",
6+
const spaceGrotesk = Space_Grotesk({
7+
variable: "--font-space-grotesk",
78
subsets: ["latin"],
9+
weight: ["300", "400", "500", "600", "700"],
810
});
911

10-
const geistMono = Geist_Mono({
11-
variable: "--font-geist-mono",
12-
subsets: ["latin"],
13-
});
14-
15-
export const metadata: Metadata = {
16-
title: "Create Next App",
17-
description: "Generated by create next app",
18-
};
19-
2012
export default function RootLayout({
2113
children,
2214
}: Readonly<{
2315
children: React.ReactNode;
2416
}>) {
2517
return (
26-
<html lang="en">
27-
<body
28-
className={`${geistSans.variable} ${geistMono.variable} antialiased`}
29-
>
30-
{children}
18+
<html lang="en" suppressHydrationWarning>
19+
<body className={`${spaceGrotesk.className} font-sans antialiased`}>
20+
<ThemeProvider
21+
attribute="class"
22+
defaultTheme="system"
23+
enableSystem
24+
disableTransitionOnChange
25+
>
26+
<Navbar />
27+
<main>{children}</main>
28+
</ThemeProvider>
3129
</body>
3230
</html>
3331
);
Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
"use client";
2+
3+
import { Home, ImageUp } from "lucide-react";
4+
import Link from "next/link";
5+
import { usePathname } from "next/navigation";
6+
import ThemeToggle from "./ThemeToggle";
7+
8+
export default function Navbar() {
9+
const pathname = usePathname();
10+
11+
const links = [
12+
{ name: "Home", href: "/", icon: Home },
13+
{ name: "Generate", href: "/generate", icon: ImageUp },
14+
];
15+
16+
return (
17+
<nav className="sticky top-0 z-50 w-full border-b border-slate-200 dark:border-neutral-700 bg-white/95 dark:bg-neutral-900/95 backdrop-blur-sm">
18+
<div className="flex h-16 items-center px-4 sm:px-6">
19+
<div className="flex-shrink-0">
20+
<Link
21+
href="/"
22+
className="text-lg font-bold text-slate-800 dark:text-neutral-100"
23+
>
24+
SVG{" "}
25+
<span className="text-emerald-600 dark:text-violet-500">
26+
From Img
27+
</span>
28+
</Link>
29+
</div>
30+
31+
<div className="hidden md:flex items-center justify-center flex-1">
32+
<div className="flex space-x-1">
33+
{links.map((link) => (
34+
<Link
35+
key={link.href}
36+
href={link.href}
37+
className={`flex h-10 items-center px-3 py-2 text-sm font-medium rounded-md
38+
${
39+
pathname === link.href
40+
? "bg-emerald-100 text-emerald-700 dark:bg-violet-700/30 dark:text-violet-300"
41+
: "text-slate-500 hover:text-emerald-600 hover:bg-emerald-50 dark:text-neutral-400 dark:hover:text-violet-400 dark:hover:bg-violet-700/20"
42+
}`}
43+
>
44+
{link.name}
45+
</Link>
46+
))}
47+
</div>
48+
</div>
49+
50+
<div className="flex items-center space-x-2 ml-auto">
51+
<ThemeToggle />
52+
</div>
53+
</div>
54+
</nav>
55+
);
56+
}
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
"use client";
2+
3+
import * as React from "react";
4+
import { ThemeProvider as NextThemesProvider } from "next-themes";
5+
6+
export function ThemeProvider({
7+
children,
8+
...props
9+
}: React.ComponentProps<typeof NextThemesProvider>) {
10+
return <NextThemesProvider {...props}>{children}</NextThemesProvider>;
11+
}

0 commit comments

Comments
 (0)