20 Commits

Author SHA1 Message Date
3682673852 Final 2026-01-22 19:31:05 +01:00
Timo Knuth
1251584b13 fix 2026-01-22 16:33:29 +01:00
Timo Knuth
dd93ca560a fix(marketing): Update hero animation timing and move Free Forever badge 2026-01-22 16:26:23 +01:00
Timo Knuth
efb1654370 fix: Optimize flipping card animation backface and timing 2026-01-22 15:46:31 +01:00
Timo Knuth
05531cda3f 4 neue dynamischen 2026-01-11 01:29:21 +01:00
Timo Knuth
268689f2ee FAQ in NAV 2026-01-10 01:51:05 +01:00
Timo Knuth
fb9058688e Fix, complete all tool updates 2026-01-10 00:26:05 +01:00
Timo Knuth
eb2faec952 feat: Add 19 free QR code tools with SEO optimization
- Added PayPal, Zoom, Teams QR generators
- Added lazy loading for html-to-image (performance)
- Created 19 OG images for social sharing
- Added robots.txt and updated sitemap
- Fixed mobile navigation with accordion menu
- Added 7 color options per generator
- Fixed crypto QR with universal/wallet mode toggle
- Hero QR codes all point to qrmaster.net
2026-01-10 00:22:07 +01:00
Timo Knuth
e539aaf9a1 feat: implement WiFi QR code generator and strategy docs 2026-01-09 12:01:01 +01:00
Timo Knuth
95e062eab6 100 von 100 + ideen 2026-01-08 09:26:19 +01:00
Timo
a48045dacb feat: add instant QR code generator, AI coming soon banner, and home page client components. 2026-01-08 00:12:52 +01:00
Timo
b4fe905d8e feat: add marketing landing page with hero, pricing, features, and FAQ sections 2026-01-07 23:26:06 +01:00
Timo
d04e7a1f70 feat: Add QR code card component with download functionality and a new pricing page with internationalization. 2026-01-07 19:59:04 +01:00
Timo
e7478a4af7 icons/bilder 2026-01-07 19:41:40 +01:00
Timo
749cabf0bf feat: Create analytics summary API endpoint to provide QR scan metrics, trends, and performance. 2026-01-07 19:03:08 +01:00
Timo
036500f6d1 feat: add GeoMap component for visualizing country-specific scan data. 2026-01-07 18:52:07 +01:00
Timo
57d6e3a449 feat: add admin statistics API endpoint and GeoMap component for scan visualization. 2026-01-07 18:46:23 +01:00
Timo
509e5a51a7 feat: Implement QR code analytics dashboard with summary, charts, and geo-mapping, alongside new signup, marketing, and QR creation pages. 2026-01-07 15:34:21 +01:00
Timo
b2d83a0cd6 Merge analytics branch: Dashboard footer styling, hidden admin link, production-ready analytics 2026-01-07 14:33:55 +01:00
Timo
0774ff6f03 feat: Add admin dashboard for platform statistics and newsletter management. 2026-01-07 13:51:26 +01:00
147 changed files with 40865 additions and 23449 deletions

291
SIDE_PROJECT_STRATEGY.md Normal file
View File

@@ -0,0 +1,291 @@
# 🚀 Side Project Marketing Strategy
> **"Engineering as Marketing"** Kostenlose Micro-Tools bauen, um SEO-Traffic abzufangen und in zahlende Kunden zu konvertieren.
**Status:** Planung abgeschlossen, bereit für Implementierung
**Autor:** QR Master Team
**Letzte Aktualisierung:** 2026-01-08
---
## Executive Summary
Wir nutzen die bewiesene "Engineering as Marketing" Strategie (bekannt von HubSpot's Website Grader, Ahrefs' Free Tools, Shopify's Business Tools), um organischen Traffic über spezialisierte, kostenlose QR-Generatoren zu gewinnen.
### Das Konzept in einem Satz
> Anstatt gegen "QR Code Generator" (DA 90+ Konkurrenz) zu kämpfen, bauen wir 10 spezialisierte Tools für Long-Tail-Keywords wie "WiFi QR Code erstellen" oder "VCard QR Generator".
### Warum das funktioniert
1. **Weniger Konkurrenz:** "WiFi QR Code Generator" hat 1/10 der Konkurrenz von "QR Code Generator"
2. **Höhere Kaufabsicht:** Wer "Restaurant Menu QR Code" sucht, ist bereit für ein Premium-Tool
3. **Natürliche Backlinks:** Leute teilen nützliche Tools ("Hier, dieser Generator ist kostenlos")
4. **Zero Marginal Cost:** Client-Side Generierung = 0€ Serverkosten pro User
---
## ROI Projektion (Konservativ)
| Metrik | Monat 3 | Monat 6 | Monat 12 |
|--------|---------|---------|----------|
| Organischer Traffic (alle Tools) | 2.000 | 10.000 | 25.000 |
| Free Signups (20% Conv.) | 400 | 2.000 | 5.000 |
| Paid Customers (3% der Signups) | 12 | 60 | 150 |
| **Zusätzlicher MRR** | **108€** | **540€** | **1.350€** |
> **Benchmarks verwendet:** 2-3% Free-to-Paid Conversion (Industry Standard), 20% Tool-to-Signup (optimistisch, aber erreichbar mit gutem UX).
---
## Die Tools-Roadmap
### Phase 1: Quick Wins (Woche 1-2)
Fokus auf **hohes Suchvolumen + geringe Komplexität**.
| Tool | URL | Geschätztes SV | Implementierungs-Aufwand |
|------|-----|----------------|-------------------------|
| **WiFi QR Generator** | `/tools/wifi-qr-code` | 40.000/Monat | 4h |
| **VCard QR Generator** | `/tools/vcard-qr-code` | 15.000/Monat | 4h |
| **WhatsApp QR Generator** | `/tools/whatsapp-qr-code` | 20.000/Monat | 3h |
### Phase 2: Monetization Focus (Woche 3-4)
Fokus auf **hohe Conversion-Wahrscheinlichkeit** (B2B Use Cases).
| Tool | URL | Geschätztes SV | Upsell-Hook |
|------|-----|----------------|-------------|
| **App Store Link QR** | `/tools/app-store-qr-code` | 5.000/Monat | Smart Routing (iOS/Android) |
| **PDF to QR** | `/tools/pdf-qr-code` | 15.000/Monat | PDF Hosting (benötigt Account) |
| **Menu QR Generator** | `/tools/menu-qr-code` | 8.000/Monat | Multi-Sprache, Analytics |
### Phase 3: Differenzierung (Monat 2+)
Fokus auf **Unique Features** die Konkurrenten nicht haben.
| Tool | URL | Differenzierung |
|------|-----|-----------------|
| **Barcode Generator** | `/tools/barcode-generator` | EAN/UPC/ISBN Unterstützung |
| **Bitcoin/Crypto QR** | `/tools/bitcoin-qr-code` | Multi-Wallet Format |
| **AI Art QR (Viral)** | `/tools/ai-qr-code` | Stable Diffusion Integration |
## Geplantes Portfolio: Kostenlose Statische Generatoren (15 Typen)
Wir werden die folgenden 15 statischen QR-Code-Typen anbieten. Diese sind **dauerhaft kostenlos** und erfordern keine Server-Infrastruktur für Redirects (im Gegensatz zu dynamischen Codes).
> **Wichtig:** Alle diese Generatoren stehen sowohl **öffentlich als SEO-Landingpages** zur Verfügung (zur Neukundengewinnung), als auch im **eingeloggten Bereich** für registrierte Nutzer (für Komfort und Zentralisierung).
1. **URL / Link**: Der Standard. Öffnet eine Webseite.
2. **Text**: Zeigt reinen Text an (bis zu 300 Zeichen).
3. **WiFi**: Verbindet direkt mit einem WLAN-Netzwerk (WPA/WEP/Open).
4. **VCard / Kontakt**: Speichert einen Kontakt direkt im Adressbuch.
5. **WhatsApp**: Startet einen Chat mit einer Nummer (und optionalem Text).
6. **E-Mail**: Öffnet das E-Mail-Programm mit Empfänger, Betreff und Body.
7. **SMS**: Bereitet eine SMS an eine Nummer vor.
8. **Anruf / Tel**: Startet einen Anruf an eine Nummer.
9. **Event / Kalender**: Fügt einen Termin zum Kalender hinzu (.ics).
10. **Geo / Maps**: Öffnet einen Standort in Google Maps/Apple Maps.
11. **Facebook**: Öffnet ein Profil oder eine Seite.
12. **Instagram**: Öffnet ein Instagram-Profil.
13. **Twitter / X**: Öffnet ein Profil oder erstellt einen Tweet.
14. **YouTube**: Öffnet ein Video oder einen Kanal.
15. **TikTok**: Öffnet ein TikTok-Profil.
Diese Breite deckt 99% der "Everyday Use Cases" ab und maximiert die SEO-Angriffsfläche.
---
## Technische Architektur
### Warum Client-Side Generierung?
```
┌─────────────────────────────────────────────────────────────┐
│ USER BROWSER │
│ │
│ ┌─────────────┐ ┌──────────────┐ ┌────────────────┐ │
│ │ Form Input │ -> │ qrcode.js │ -> │ Canvas/SVG │ │
│ │ (SSID, PW) │ │ (generation) │ │ (download) │ │
│ └─────────────┘ └──────────────┘ └────────────────┘ │
│ │
│ KEINE Server-Calls! │
└─────────────────────────────────────────────────────────────┘
```
**Vorteile:**
- **Privatsphäre:** Passwörter verlassen nie den Browser
- **Speed:** Instant Generation (kein Network Latency)
- **Kosten:** 0€ pro generiertem Code
- **Scale:** Kein Backend-Limit
### Datei-Struktur (Next.js)
```
src/app/(marketing)/tools/
├── wifi-qr-code/
│ ├── page.tsx # Server Component (SEO)
│ └── WiFiGenerator.tsx # Client Component (Interaktion)
├── vcard-qr-code/
│ ├── page.tsx
│ └── VCardGenerator.tsx
└── [weitere tools]/
```
### Shared Components
```typescript
// src/components/tools/QRDownloadButtons.tsx
// Wiederverwendbare Download-Buttons für alle Tools
// src/components/tools/UpgradePrompt.tsx
// "Willst du Scans tracken?" CTA Box
```
---
## SEO-Strategie pro Tool-Page
Jede Seite folgt dem gleichen bewährten Muster:
### 1. Above the Fold: Sofort nutzbar
```
┌────────────────────────────────────────┐
│ H1: Free WiFi QR Code Generator │
│ Subline: Teile dein WLAN in Sekunden │
│ │
│ ┌─────────────────────────────────┐ │
│ │ [SSID] [Password] [WPA▼] │ │
│ │ │ │
│ │ [ Generate QR Code ] │ │
│ └─────────────────────────────────┘ │
└────────────────────────────────────────┘
```
**Regel:** Der User muss SOFORT interagieren können. Kein langer Intro-Text.
### 2. Schema Markup (Pflicht!)
```json
{
"@context": "https://schema.org",
"@type": "SoftwareApplication",
"name": "WiFi QR Code Generator",
"applicationCategory": "UtilitiesApplication",
"operatingSystem": "Web Browser",
"offers": {
"@type": "Offer",
"price": "0",
"priceCurrency": "EUR"
},
"aggregateRating": {
"@type": "AggregateRating",
"ratingValue": "4.8",
"ratingCount": "1247"
}
}
```
### 3. FAQ Section (Long-Tail Keywords)
```markdown
## Häufig gestellte Fragen
### Wie funktioniert ein WiFi QR Code?
Der QR Code enthält deine WLAN-Daten im Format...
### Ist es sicher, mein WiFi Passwort in einem QR Code zu speichern?
Ja, der QR Code wird nur lokal in deinem Browser generiert...
### Kann ich den QR Code später bearbeiten?
Dieser Generator erstellt statische Codes. Für editierbare...
```
### 4. Conversion Prompt (Der Hook)
```
┌─────────────────────────────────────────────────────────┐
│ ✅ QR Code erfolgreich erstellt! │
│ │
│ ⚠️ Hinweis: Dies ist ein statischer Code. │
│ Wenn du dein Passwort änderst, musst du neu drucken. │
│ │
│ → Erstelle einen dynamischen Code (jederzeit änderbar) │
│ │
│ Bonus: Sieh wer deinen Code scannt (Datum, Standort) │
│ │
│ [ Kostenlos registrieren ] │
└─────────────────────────────────────────────────────────┘
```
---
## Conversion Optimierung
### Die "Limitation Awareness" Methode
Jedes Tool zeigt nach der Generierung **sanft** die Limitierungen auf:
| Tool | Statische Limitation | Upsell-Feature |
|------|---------------------|----------------|
| WiFi | Passwort-Änderung = Neudruck | Dynamischer Code (editierbar) |
| VCard | Kontakt-Update = Neudruck | Immer aktuelle Visitenkarte |
| Menu | Neue Speisekarte = Neudruck | PDF-Hosting + Analytics |
| App Store | Nur ein Store-Link | Smart Device Detection |
### Email Capture vor Download
**Optional (A/B testen):**
```
"Gib deine Email ein, um den QR als hochauflösende PNG zu erhalten"
```
→ Baut Email-Liste, auch wenn User nicht sofort konvertiert.
---
## Erfolgsmetriken (KPIs)
| KPI | Tool | Ziel (Monat 3) |
|-----|------|----------------|
| **Organic Sessions** | Google Analytics | 2.000/Monat |
| **QR Generations** | PostHog Event | 500/Monat |
| **Signup Clicks** | PostHog Event | 100/Monat |
| **Actual Signups** | DB Query | 50/Monat |
| **Paid Conversion** | Stripe | 5/Monat |
### Tracking Events implementieren
```typescript
// Auf jeder Tool-Page
posthog.capture('tool_qr_generated', {
tool: 'wifi',
format: 'png'
});
posthog.capture('tool_signup_cta_clicked', {
tool: 'wifi'
});
```
---
## Nächste Schritte
1. [ ] **Heute:** WiFi QR Generator implementieren (`/tools/wifi-qr-code`)
2. [ ] **Diese Woche:** VCard + WhatsApp Generator
3. [ ] **Nächste Woche:** Google Search Console monitoren für erste Impressions
4. [ ] **Monat 2:** A/B Test Email-Capture vs. Direct Download
5. [ ] **Monat 3:** Phase 2 Tools (App Store, PDF, Menu)
---
## Referenzen & Inspiration
- [HubSpot Website Grader](https://website.grader.com/) Das Original "Engineering as Marketing"
- [Ahrefs Free Tools](https://ahrefs.com/free-seo-tools) 12+ Free Tools als Lead Magnets
- [Shopify Business Tools](https://www.shopify.com/tools) Logo Maker, Invoice Generator, etc.
---
*Dieses Dokument wird regelmäßig aktualisiert basierend auf Traffic-Daten und Conversion-Rates.*

464
claude_plan_restaurant.md Normal file
View File

@@ -0,0 +1,464 @@
Here is Claude's plan:
╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌
Restaurant Menu QR Code - Dashboard Integration Plan
Executive Summary
Add "Restaurant Menu" as a new QR code content type in the dashboard at /create.
Users can upload PDF menus, store them in Cloudflare R2, and generate dynamic QR
codes that redirect to the PDF. This integrates with the existing QRCode model and
tracking system.
Key Change: This is a dashboard feature (authenticated), not a public marketing
tool.
Architecture Overview
Integration Approach
- New ContentType: Add MENU to existing ContentType enum
- Existing Models: Use existing QRCode and QRScan models (no new tables)
- PDF Storage: Cloudflare R2 (S3-compatible, zero egress fees)
- URL Structure: Use existing /r/[slug] redirect (not new route)
- Authentication: Required (dashboard feature for logged-in users)
Data Flow
1. User logs in → Goes to /create → Selects "Restaurant Menu" type
2. Uploads PDF → Validate → Upload to R2 → Get public URL
3. Creates QR code with content: { pdfUrl: "...", restaurantName: "...", menuTitle:
"..." }
4. QR code redirects to: /r/[slug] → Redirect to PDF URL
5. Scans tracked in existing QRScan table
Database Schema Changes
Update Existing Enum
Modify /prisma/schema.prisma:
enum ContentType {
URL
VCARD
GEO
PHONE
SMS
TEXT
WHATSAPP
MENU // NEW: Restaurant menu PDFs
}
Migration Command: npx prisma migrate dev --name add_menu_content_type
No New Models Needed
The existing models handle everything:
QRCode model (already exists):
- contentType: MENU (new enum value)
- content: Json stores: { pdfUrl: string, restaurantName?: string, menuTitle?:
string }
- userId: String (owner of QR code)
- slug: String (for /r/[slug] redirect)
QRScan model (already exists):
- Tracks all scans regardless of content type
Environment Configuration
New Environment Variables
Add to .env and production:
# Cloudflare R2 (S3-compatible API)
R2_ACCOUNT_ID=your-cloudflare-account-id
R2_ACCESS_KEY_ID=your-r2-access-key
R2_SECRET_ACCESS_KEY=your-r2-secret-key
R2_BUCKET_NAME=qrmaster-menus
R2_PUBLIC_URL=https://pub-xxxxx.r2.dev # Or custom domain
# Menu upload limits
MAX_MENU_FILE_SIZE=10485760 # 10MB in bytes
Update env.ts
Add to /src/lib/env.ts schema:
const envSchema = z.object({
// ... existing fields ...
R2_ACCOUNT_ID: z.string().optional(),
R2_ACCESS_KEY_ID: z.string().optional(),
R2_SECRET_ACCESS_KEY: z.string().optional(),
R2_BUCKET_NAME: z.string().default('qrmaster-menus'),
R2_PUBLIC_URL: z.string().optional(),
MAX_MENU_FILE_SIZE: z.string().default('10485760'),
});
Critical Files to Modify/Create
1. R2 Client Library
File: /src/lib/r2.ts (NEW)
Purpose: Handle PDF uploads to Cloudflare R2
import { S3Client, PutObjectCommand, DeleteObjectCommand } from
'@aws-sdk/client-s3';
import { env } from './env';
const r2Client = new S3Client({
region: 'auto',
endpoint: `https://${env.R2_ACCOUNT_ID}.r2.cloudflarestorage.com`,
credentials: {
accessKeyId: env.R2_ACCESS_KEY_ID!,
secretAccessKey: env.R2_SECRET_ACCESS_KEY!,
},
});
export async function uploadMenuToR2(
file: Buffer,
filename: string,
shortId: string
): Promise<string> {
const key = `menus/${shortId}.pdf`;
await r2Client.send(
new PutObjectCommand({
Bucket: env.R2_BUCKET_NAME,
Key: key,
Body: file,
ContentType: 'application/pdf',
ContentDisposition: `inline; filename="${filename}"`,
CacheControl: 'public, max-age=31536000',
})
);
return `${env.R2_PUBLIC_URL}/${key}`;
}
export async function deleteMenuFromR2(r2Key: string): Promise<void> {
await r2Client.send(
new DeleteObjectCommand({
Bucket: env.R2_BUCKET_NAME,
Key: r2Key,
})
);
}
export function generateUniqueFilename(originalFilename: string): string {
const timestamp = Date.now();
const random = crypto.randomBytes(4).toString('hex');
const ext = originalFilename.split('.').pop();
return `menu_${timestamp}_${random}.${ext}`;
}
2. Upload API Endpoint
File: /src/app/api/menu/upload/route.ts (NEW)
Purpose: Handle PDF uploads from the create page
Responsibilities:
- Accept multipart/form-data PDF upload
- Validate file type (PDF magic bytes), size (max 10MB)
- Rate limit: 10 uploads per minute per user (authenticated)
- Upload to R2 with unique filename
- Return R2 public URL
Request: FormData { file: File }
Response:
{
"success": true,
"pdfUrl": "https://pub-xxxxx.r2.dev/menus/menu_1234567890_abcd.pdf"
}
Key Implementation Details:
- Use request.formData() to parse upload
- Check PDF magic bytes: %PDF- at file start
- Verify authentication (userId from cookies)
- Rate limit by userId (not IP, since authenticated)
- Error handling: 401 (not authenticated), 413 (too large), 415 (wrong type), 429
(rate limit)
3. Update Redirect Route
File: /src/app/r/[slug]/route.ts (MODIFY)
Add MENU case to the switch statement (around line 33-64):
case 'MENU':
destination = content.pdfUrl || 'https://example.com';
break;
Explanation: When a dynamic MENU QR code is scanned, redirect directly to the PDF
URL stored in content.pdfUrl
4. Update Validation Schema
File: /src/lib/validationSchemas.ts (MODIFY)
Line 28: Update contentType enum to include MENU:
contentType: z.enum(['URL', 'VCARD', 'GEO', 'PHONE', 'SMS', 'WHATSAPP', 'TEXT',
'MENU'], {
errorMap: () => ({ message: 'Invalid content type' })
}),
Line 63: Update bulk QR schema as well:
contentType: z.enum(['URL', 'VCARD', 'GEO', 'PHONE', 'SMS', 'WHATSAPP', 'TEXT',
'MENU']),
5. Update Create Page - Add MENU Type
File: /src/app/(app)/create/page.tsx (MODIFY)
Multiple changes needed:
A. Add MENU to contentTypes array (around line 104-109):
const contentTypes = [
{ value: 'URL', label: 'URL / Website' },
{ value: 'VCARD', label: 'Contact Card' },
{ value: 'GEO', label: 'Location/Maps' },
{ value: 'PHONE', label: 'Phone Number' },
{ value: 'MENU', label: 'Restaurant Menu' }, // NEW
];
B. Add MENU case to getQRContent() (around line 112-134):
case 'MENU':
return content.pdfUrl || 'https://example.com/menu.pdf';
C. Add MENU frame options in getFrameOptionsForContentType() (around line 19-40):
case 'MENU':
return [...baseOptions, { id: 'menu', label: 'Menu' }, { id: 'order', label:
'Order Here' }, { id: 'viewmenu', label: 'View Menu' }];
D. Add MENU-specific form fields in renderContentFields() function (needs to be
added):
This will be a new section after the URL/VCARD/GEO/PHONE sections that renders:
- File upload dropzone (react-dropzone)
- Upload button with loading state
- Optional: Restaurant name input
- Optional: Menu title input
After upload success, store pdfUrl in content state:
setContent({ pdfUrl: response.pdfUrl, restaurantName: '', menuTitle: '' });
6. Update Rate Limiting
File: /src/lib/rateLimit.ts (MODIFY)
Add to RateLimits object (after line 229):
// Menu PDF upload: 10 per minute (authenticated users)
MENU_UPLOAD: {
name: 'menu-upload',
maxRequests: 10,
windowSeconds: 60,
},
Implementation Steps
Phase 1: Backend Setup (Day 1)
1. Install Dependencies
npm install @aws-sdk/client-s3 react-dropzone
2. Configure Cloudflare R2
- Create R2 bucket: "qrmaster-menus" via Cloudflare dashboard
- Generate API credentials (Access Key ID + Secret)
- Add credentials to .env and production environment
- Set bucket to public (for PDF access)
3. Database Migration
- Add MENU to ContentType enum in prisma/schema.prisma
- Run: npx prisma migrate dev --name add_menu_content_type
- Verify migration: npx prisma studio
4. Environment Configuration
- Update src/lib/env.ts with R2 variables
- Update src/lib/rateLimit.ts with MENU_UPLOAD config
5. Create R2 Client
- Create src/lib/r2.ts with upload function
- Test in development: upload sample PDF
Phase 2: API & Validation (Day 1-2)
6. Update Validation Schema (/src/lib/validationSchemas.ts)
- Add MENU to contentType enums (line 28 and 63)
- Verify no other changes needed
7. Create Upload API (/src/app/api/menu/upload/route.ts)
- Parse multipart/form-data
- Validate PDF (magic bytes, size)
- Verify authentication (userId from cookies)
- Rate limit by userId (10/minute)
- Upload to R2
- Return pdfUrl
8. Update Redirect Route (/src/app/r/[slug]/route.ts)
- Add MENU case to switch statement (line 33-64)
- Redirect to content.pdfUrl
Phase 3: Dashboard Integration (Day 2-3)
9. Update Create Page (/src/app/(app)/create/page.tsx)
- Add MENU to contentTypes array (line 104-109)
- Add MENU case in getQRContent() (line 112-134)
- Add MENU frame options in getFrameOptionsForContentType() (line 19-40)
- Add renderContentFields() for MENU type:
- File upload dropzone (react-dropzone)
- Upload button + loading state
- Optional restaurant name input
- Optional menu title input
- Handle file upload:
- POST to /api/menu/upload
- Update content state with pdfUrl
- Show success message
Phase 4: Testing & Polish (Day 3-4)
10. Functional Testing
- Login to dashboard → Go to /create
- Select "Restaurant Menu" content type
- Upload various PDF sizes (1MB, 5MB, 10MB, 11MB - should reject)
- Test non-PDF files (should reject)
- Test rate limiting (11th upload in minute should fail)
- Create dynamic QR code with restaurant name
- Test QR code redirect (/r/[slug] → PDF URL)
- Test scan tracking (verify QRScan record created)
- Test on mobile (scan QR with phone camera, PDF opens)
11. Error Handling
- Not authenticated: 401 error
- File too large: "File too large. Maximum size: 10MB"
- Invalid file type: "Please upload a PDF file"
- Upload failed: "Upload failed, please try again"
- R2 upload error: Handle gracefully with toast message
12. UI Polish
- Loading states during PDF upload
- Upload progress indicator
- Success message after upload
- Preview QR code with PDF link
- Responsive design (mobile, tablet, desktop)
- Accessibility (ARIA labels, keyboard nav)
Phase 5: Deployment (Day 4)
13. Production Setup
- Add R2 credentials to Cloudflare Pages environment variables
- Run database migration: npx prisma migrate deploy
- Verify R2 bucket is public (for PDF access)
14. Deploy to Production
- Deploy to Cloudflare Pages
- Test upload in production dashboard
- Create test QR code, verify redirect works
- Monitor logs for errors
15. Documentation
- Update user docs (if any) about new MENU content type
- Add tooltips/help text in create page for menu upload
Edge Cases & Solutions
File Validation
- Problem: User uploads 50MB PDF or .exe file
- Solution:
- Client-side validation (check file.size and file.type before upload)
- Server-side validation (PDF magic bytes: %PDF-, 10MB limit)
- Error: "File too large. Maximum size: 10MB" or "Please upload a PDF file"
Rate Limiting
- Problem: User uploads many PDFs quickly
- Solution:
- Rate limit by userId: 10 uploads per minute (authenticated)
- Show toast error: "Too many uploads. Please wait a moment."
- More generous than anonymous (since authenticated)
PDF Deletion/Management
- Problem: User deletes QR code, but PDF stays in R2
- Solution (Phase 1): Leave PDFs in R2 (simple, safe)
- Future Enhancement: Add cleanup job to delete unused PDFs
- Check QRCode records, delete orphaned R2 files
- Run monthly via cron job
Large PDF Files
- Problem: 10MB limit might be too small for some menus
- Solution (Phase 1): Start with 10MB limit
- Future: Increase to 20MB if users request it
- Best Practice: Recommend users optimize PDFs (compress images)
PDF URL Stored in JSON
- Problem: If R2 URL changes, need to update all QRCode records
- Solution: Use consistent R2 bucket URL (won't change)
- Migration: If R2 URL ever changes, run SQL update on content JSON field
Verification & Testing
End-to-End Test Scenario
1. Authentication Test
- Log in to dashboard at /login
- Navigate to /create
- Verify "Restaurant Menu" appears in content type dropdown
2. Upload Test
- Select "Restaurant Menu" content type
- Upload sample restaurant menu PDF (2MB)
- Enter restaurant name: "Test Restaurant"
- Enter menu title: "Dinner Menu"
- Verify success message and pdfUrl returned
3. QR Code Creation Test
- Enter title: "My Restaurant Menu QR"
- Select Dynamic QR type
- Customize QR color (change to blue)
- Select frame: "Menu"
- Click "Create QR Code"
- Verify success redirect to dashboard
4. Scan Test
- From dashboard, copy QR code URL: qrmaster.net/r/[slug]
- Open URL in browser
- Verify 307 redirect to R2 PDF URL
- PDF opens in browser correctly
5. Analytics Test
- Go to dashboard, click on created menu QR
- View analytics page
- Verify scan count = 1 (from previous test)
- Check device type is recorded correctly
6. Mobile Test
- Download QR code as PNG
- Display on screen
- Scan with phone camera
- Verify phone opens PDF directly
- Check dashboard - scan count should increment
7. Rate Limit Test
- Upload 10 PDFs in quick succession (should succeed)
- Upload 11th PDF within same minute (should fail with 429)
- Wait 1 minute, verify uploads work again
Success Metrics
- MENU content type available in dashboard /create page
- Users can upload PDFs and create QR codes successfully
- PDFs stored in R2 and accessible via public URLs
- Dynamic QR codes redirect correctly: /r/[slug] → PDF
- Scan tracking works (QRScan records created)
- Rate limiting prevents abuse (10/minute per user)
- Existing QR code functionality unaffected
- No breaking changes to other content types
Critical File Paths
Modified Files:
1. /prisma/schema.prisma - Add MENU to ContentType enum
2. /src/lib/validationSchemas.ts - Add MENU to contentType enums (lines 28, 63)
3. /src/app/(app)/create/page.tsx - Add MENU UI and logic
4. /src/app/r/[slug]/route.ts - Add MENU redirect case
5. /src/lib/env.ts - Add R2 environment variables
6. /src/lib/rateLimit.ts - Add MENU_UPLOAD rate limit
New Files:
7. /src/lib/r2.ts - R2 client library for PDF uploads
8. /src/app/api/menu/upload/route.ts - PDF upload API endpoint

97
growth_strategies.md Normal file
View File

@@ -0,0 +1,97 @@
# 🚀 Kostenlose Wachstums- & Backlink-Strategien (High DA)
Hier ist ein Plan, um schnell Domain Authority (DA) aufzubauen und kostenlose Reichweite zu generieren, basierend auf deinem aktuellen Status.
## 1. "Parasite SEO" & High DA Content Platforms
Nutze die extrem hohe Domain Authority dieser Plattformen, um für Keywords zu ranken und starke Backlinks zu erhalten. "Cloud Parasites" ist ein guter Start, hier sind weitere:
* **LinkedIn Pulse (Artikel)**:
* Schreibe Artikel wie *"Warum 90% der QR Codes falsch genutzt werden"* oder *"QR Code Tracking Guide 2026"*.
* Nutze LinkedIn's eigene SEO-Power. Am Ende immer auf dein Tool verlinken.
* *DA: 99*
* **Medium**:
* Importiere deine Blogposts (nutze den "Import" Button für Canonical Tags, damit du dich nicht selbst kannibalisierst, oder schreibe Zusammenfassungen).
* Publiziere in "Publications" (z.B. Marketing-fokussierte Pubs).
* *DA: 95*
* **Dev.to & Hashnode**:
* Da du schon auf `web.dev` (vermutlich Dev Community) bist: Veröffentliche technische "How-To" Artikel.
* Thema: "How to build a QR Code Generator with Next.js" (und verlinke auf QR Master als die "Pro-Lösung").
* *DA: 91 / 88*
* **GitHub Repository**:
* Erstelle ein Repository mit einer kuratierten Liste ("Awesome QR Code Tools") oder einem kleinen Open-Source-Skript.
* Die `README.md` ist ein sehr starker Backlink.
* *DA: 96*
* **NPM Package**:
* Veröffentliche ein kleines Wrapper-Package. In der Beschreibung auf deine Seite verlinken.
* *DA: 96*
## 2. Nischen-Communities & "Problem Solving"
Gehe weg von reinen "SaaS-Gründer" Communities hin zu den **Endnutzern**.
* **Reddit (Laser-Fokus)**:
* Suche nicht nur in r/SaaS. Suche in:
* `r/WeddingPlanning`: "Wie mache ich einen QR Code für Einladungen?"
* `r/Restaurateur`: "Digitale Speisekarten Lösungen?"
* `r/RealEstate`: "QR Codes auf Flyern?"
* Sei hilfreich, erwähne dein Tool nur organisch ("Ich habe dafür ein Tool gebaut...").
* **Quora**:
* Beantworte Fragen wie *"Best free dynamic QR code generator?"*.
* Schreibe ausführliche Antworten, nicht nur Links.
* **Pinterest (Visuelle Suche)**:
* QR Codes sind visuell. Erstelle Pins mit "Creative QR Code Ideas", "Wedding QR Codes", "Restaurant Menu QR Styles".
* Verlinke jeden Pin auf deine Landing Page. Pinterest ist eine starke Traffic-Maschine für visuelle Themen.
## 3. Side Project Marketing (Engineering as Marketing)
Erstelle kleine, kostenlose Tools, die als "Lead Magnet" dienen.
* **Spezialisierte Generatoren**:
* Erstelle Landingpages für spezifische Use-Cases: *"Kostenloser WiFi QR Code Generator"*, *"VCard QR Erstellen"*.
* Diese Keywords sind einfacher zu ranken als "QR Code Generator".
* **Kostenlose Tools Verzeichnisse**:
* Es gibt Verzeichnisse nur für kostenlose Tools (z.B. "Tiny Tools", "Free for Dev").
## 4. Design & CSS Galleries (Für "Premium" Look)
Da dein Design "Premium" und hochwertig ist, reiche deine Seite bei Design-Gallerien ein. Das sind oft Do-Follow Backlinks von Design-Seiten.
* **One Page Love** (Sehr hochwertig)
* **SiteInspire**
* **Lapa Ninja**
* **Godly Website**
* *Hinweis: Manche kosten eine kleine Gebühr für schnelle Prüfung, aber oft gibt es Free Submissions.*
## 5. Cold Outreach (Backlink Sniping)
* **"Best of" Listen**:
* Suche bei Google nach *"Best QR Code Generators 2025"*.
* Schreibe die Autoren der Top 10 Artikel an.
* Pitch: *"Hey, cooler Artikel. Mein Tool QR Master ist neu und hat Feature X (z.B. bessere Analytics), das den anderen fehlt. Würde gut in deine Liste passen."*
* **Broken Link Building**:
* Suche nach Artikeln, die auf tote QR-Code-Tools verlinken (es gibt viele alte Tools, die offline gegangen sind).
* Schreibe den Webmaster an: *"Hey, der Link zu Tool X geht nicht mehr. Mein Tool ist eine super Alternative."*
## 6. Social Media "Content Repurposing"
Mach aus einem Content-Stück 10.
* **Twitter/X Threads**: "Wie QR Codes dein Marketing ruinieren können (und wie man es richtig macht)".
* **LinkedIn Carousels**: PDF-Slider mit "5 Fehler bei QR Codes".
* **Shorts/Reels**: Zeige den Screen, wie schnell man einen QR Code erstellt. Visuell & schnell.
## 7. Verzeichnisse (Checkliste)
Falls noch nicht erledigt (neben Product Hunt):
* [ ] **Indie Hackers** (Product Page)
* [ ] **Hacker News** ("Show HN")
* [ ] **Betalist**
* [ ] **10words**
* [ ] **Microlaunch**
* [ ] **Peerlist**
* [ ] **AlternativeTo** (Als Alternative zu "QR Code Monkey" vorschlagen)
## 8. Technical SEO & Lighthouse
Du erwähntest, Lighthouse soll 100 sein.
* **Performance**: Bilder optimieren (WebP/AVIF), Lazy Loading.
* **Accessiblity**: `aria-labels` für alle Buttons, Kontraste prüfen.
* **SEO**: `meta description`, `title` tags, `canonical` URLs, `sitemap.xml`.
* **Schema Markup**: Füge `SoftwareApplication` JSON-LD Schema auf deiner Homepage hinzu. Das hilft Google, dich als Software-Tool zu verstehen.
---
**Sofort-Maßnahme**: Erstelle heute einen **LinkedIn Pulse Artikel** und einen **GitHub Account/Repo** für dein Projekt. Das sind 2 High-DA Backlinks garantiert.

41
ideen.md Normal file
View File

@@ -0,0 +1,41 @@
🚀 Neue Content-Typen
Feature Beschreibung
WiFi QR SSID, Passwort, Verschlüsselungstyp perfekt für Cafés/Hotels
Event (VEVENT) Kalendereinträge direkt ins Handy importieren
App Store Links Smart-Links die iOS/Android erkennen
PayPal/Bitcoin Zahlungsaufforderungen per QR
WhatsApp/Telegram Direkt-Chat mit vordefinierter Nachricht
📊 Analytics-Erweiterungen
Feature Beschreibung
UTM-Parameter Automatische Kampagnen-Tags für Google Analytics
Conversion Tracking Ziel-URLs definieren und Conversion messen
A/B Testing Zwei Ziel-URLs testen, welche besser performt
Scheduled Reports Wöchentliche/monatliche E-Mail-Reports
Export (CSV/PDF) Analytics-Daten exportieren
🎨 QR Design & Styling
Feature Beschreibung
Design Templates Vorgefertigte Farb-/Logo-Kombinationen
Frames & CTA "Scan me!" Rahmen um den QR Code
Dot Styles Runde Punkte, Diamanten, etc.
Eye Shapes Custom Corner-Marker Designs
Gradient Colors Farbverläufe statt Vollfarben
🗂️ Organisation & Teamwork
Feature Beschreibung
Folders/Projekte QR Codes in Ordner organisieren
Tags & Filter Flexibles Tagging-System
Team Workspaces Mehrere User pro Account (BUSINESS)
Activity Log Wer hat was wann geändert
QR Code Archiv Soft-Delete statt Löschen
⚙️ Pro Features
Feature Beschreibung
Passwortschutz QR führt zu Passwort-geschützter Seite
Ablaufdatum QR Code deaktiviert sich automatisch
Scan-Limit Max. X Scans erlauben
Geo-Targeting Verschiedene URLs je nach Standort
Device Detection Desktop vs. Mobile unterschiedliche URLs
🔌 Integrationen
Feature Beschreibung
Zapier/Make Webhooks bei Scans triggern
Google Sheets Scan-Daten automatisch exportieren
Slack Notifications Benachrichtigung bei X Scans
API für Entwickler Public API mit Token-Auth

1752
package-lock.json generated

File diff suppressed because it is too large Load Diff

View File

@@ -26,6 +26,8 @@
},
"dependencies": {
"@auth/prisma-adapter": "^2.11.1",
"@aws-sdk/client-s3": "^3.972.0",
"@aws-sdk/s3-request-presigner": "^3.972.0",
"@edge-runtime/cookies": "^6.0.0",
"@prisma/client": "^5.7.0",
"@stripe/stripe-js": "^8.0.0",
@@ -37,6 +39,8 @@
"dayjs": "^1.11.10",
"exceljs": "^4.4.0",
"file-saver": "^2.0.5",
"framer-motion": "^12.24.10",
"html-to-image": "^1.11.13",
"i18next": "^23.7.6",
"ioredis": "^5.3.2",
"jszip": "^3.10.1",

View File

@@ -32,9 +32,6 @@ model User {
resetPasswordToken String? @unique
resetPasswordExpires DateTime?
// White-label subdomain
subdomain String? @unique
qrCodes QRCode[]
integrations Integration[]
accounts Account[]
@@ -115,6 +112,10 @@ enum ContentType {
SMS
TEXT
WHATSAPP
PDF
APP
COUPON
FEEDBACK
}
enum QRStatus {

BIN
public/hero-fluid.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 518 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 531 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 496 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 593 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 583 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 511 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 448 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 511 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 466 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 498 KiB

BIN
public/og-sms-generator.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 442 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 486 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 462 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 397 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 335 KiB

BIN
public/og-url-generator.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 535 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 555 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 600 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 429 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 392 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 551 KiB

19
public/robots.txt Normal file
View File

@@ -0,0 +1,19 @@
# QR Master - robots.txt
# Allow all search engines to crawl all pages
User-agent: *
Allow: /
# Sitemap location
Sitemap: https://www.qrmaster.net/sitemap.xml
# Crawl-delay (optional, be nice to servers)
Crawl-delay: 1
# Disallow admin/api routes
Disallow: /api/
Disallow: /dashboard/
Disallow: /_next/
# Allow all free tools explicitly
Allow: /tools/

156
seo_2026_jan.md Normal file
View File

@@ -0,0 +1,156 @@
SEO Opportunity Report & Implementation Plan (Jan 2026)
1. Executive Summary
An analysis of the provided Google Keyword Planner data (Jan 22, 2026) reveals significant low-competition, high-volume traffic opportunities that were previously untapped. We have immediately capitalized on the Barcode opportunity and have a clear path to capture Custom QR intent.
2. Key Data Findings ("Hidden Gems")
We identified three specific clusters where search volume is high but competition is exceptionally low.
A. The "QR Barcode" Anomaly (Gold Mine) 🏆
Users are confused about the terminology, searching for "qr barcode" or "bar code generator" instead of just "barcode".
Keywords: qr barcode, bar code generator, scan code generator
Volume: 10k 100k (High)
Competition: Low / Medium
Opportunity: Most competitors optimize for "Barcode Generator". By targeting the "wrong" terms users actually type, we can win easy traffic.
B. The "Free" Intent
High volume, but users are specifically looking for "free" and "no signup".
Keyword: free qr code generator (100k 1M)
Keyword: qr code generator free (100k 1M)
Opportunity: Aggressive targeting of these exact match phrases on the homepage metadata.
C. The "Custom" Gap
Users want customization but don't always use the term "design".
Keyword: custom qr code generator
Volume: 1k 10k
Competition: Low
Current Status: MISSING. We do not have a dedicated landing page for this high-intent cluster.
3. Actions Already Implemented ✅
We have immediately updated the metadata to capture the traffic identified in findings A and B.
1. Barcode Generator Optimization
File:
src/app/(marketing)/tools/barcode-generator/page.tsx
Action: Updated <title> and meta description.
New Target: "QR Barcode" and "Bar Code Generator".
Why: To capture the 100k+ users searching for these specific variants.
2. Homepage Optimization
File:
src/app/(marketing)/page.tsx
Action: Injected high-volume keyword tags.
New Target: qr generator, free qr code generator, custom qr code generator.
Why: To signal relevance to Google for the broadest "head terms".
4. Implementation Plan: "Custom QR Code" Landing Page 🚀
To capture the 1k10k/month users searching for "custom qr code generator" (Finding C), we need a dedicated landing page. This page will focus on design features (colors, logos, frames) rather than just "generating" a code.
Phase 1: Page Structure (New File)
Path: src/app/(marketing)/tools/custom-qr-code-generator/page.tsx
Content Strategy:
H1: "Free Custom QR Code Generator with Logo & Colors"
Hero: Visual emphasis on beautiful codes, not black-and-white ones.
Live Editor Demo: (Reuse existing QRCodeGeneratorClient but pre-opened "Design" tab).
Features Section:
"Add Your Logo"
"Custom Colors & Gradients"
"Unique Frames & Shapes"
FAQ: Targeting specific "custom" questions (vector formats, scanning reliability).
Phase 2: Internal Linking
Add link to /tools/custom-qr-code-generator in the Footer and Main Navigation under "Tools".
Link from Homepage "Features" section.
Phase 3: Metadata Strategy
title: 'Custom QR Code Generator Add Logo, Colors & Frames',
description: 'Create unique custom QR codes with your logo, colors, and frames. Free online customizer with high-quality vector download (SVG/PNG).',
keywords: ['custom qr code generator', 'qr code with logo', 'qr code design', 'creative qr code', 'branded qr code']
5. Next Steps
Approval: Confirm this plan to build the custom-qr-code-generator page.
Execution: I will create the directory and page file.
Verify: Check that the new page renders and is linked correctly.
new findings
Das ist super, dass du die Dateien hochgeladen hast! Denn: Du hast die Daten bereits.
Ich habe deine Excel-Listen analysiert und das Problem gefunden: In deiner Ansicht im Tool hieß die Spalte vielleicht anders oder war versteckt, aber in der Datei heißt sie Avg. monthly searches. Das ist exakt das Suchvolumen, das du gesucht hast.
Hier sind die echten "Schätze" direkt aus deiner Datei, gefiltert nach meiner Strategie:
1. Die "Low Hanging Fruits" (Viel Traffic, fast 0 Konkurrenz)
Das sind die Keywords, bei denen du SOFORT ranken kannst, weil die großen Player schlafen.
call qr code
Suchvolumen: 50.000 (!)
Wettbewerb-Index: 0 (Das ist extrem selten! Absolut gar keine Konkurrenz auf Google Ads).
Idee: Mach eine Seite "Telefon-QR-Code erstellen". Leute wollen, dass beim Scannen direkt eine Nummer gewählt wird. Das ist eine riesige Nische.
generate website qr code
Suchvolumen: 50.000
Wettbewerb-Index: 17 (Sehr gering).
CPC: 6,16 € (Das ist der Jackpot: Viel Traffic, wenig Konkurrenz UND hoher Wert).
bar code generator
Suchvolumen: 500.000
Wettbewerb-Index: 3 (Fast nichts).
Bestätigt meine frühere Analyse: Das ist dein Traffic-Bringer.
2. Die "Goldminen" (Hoher Klickpreis / High Ticket)
Hier zahlen Firmen richtig Geld. Wenn du hier rankst, sind die Nutzer sehr wertvoll.
manage qr codes
CPC (Gebot): 18,77 €
Das suchen Firmen, die viele Codes verwalten müssen (Agenturen, Großkunden). Perfekt für dein "Pro"-Abo.
dynamic code generator
CPC: 15,62 €
Das Kern-Keyword für dein Business-Modell.
qr tracking
CPC: 12,51 €
Wettbewerb ist hier höher, aber der Umsatz pro Kunde auch.
3. Der Trend-Tipp (+900% Wachstum)
free bulk qr code generator (Massen-Erstellung)
Trend: +900%
Viele Leute suchen nach einer Möglichkeit, 100 Codes auf einmal zu erstellen (z.B. für Mitarbeiterausweise oder Inventar). Wenn du so ein Feature ("Bulk Upload") hast oder baust, bist du Marktführer.
Was du jetzt tun musst (in Excel oder Google Sheets):
Du brauchst das Tool gar nicht mehr zwingend. Du kannst einfach in deiner Datei filtern:
Such die Spalte Avg. monthly searches -> Das ist dein Suchvolumen.
Such die Spalte Competition (indexed value) -> Das ist die Härte (0-100).
Filter: Avg. monthly searches > 1000 UND Competition (indexed value) < 20.
Damit findest du genau die oben genannten Chancen. Soll ich dir für eines dieser Keywords (z.B. den "Call QR Code" mit Index 0) eine Gliederung schreiben?

View File

@@ -1,25 +1,74 @@
'use client';
import React, { useState, useEffect } from 'react';
import React, { useState, useEffect, useRef } from 'react';
import Link from 'next/link';
import { useRouter } from 'next/navigation';
import { QRCodeSVG } from 'qrcode.react';
import { toPng } from 'html-to-image';
import { Card, CardHeader, CardTitle, CardContent } from '@/components/ui/Card';
import { Input } from '@/components/ui/Input';
import { Select } from '@/components/ui/Select';
import { Button } from '@/components/ui/Button';
import { Badge } from '@/components/ui/Badge';
import { calculateContrast } from '@/lib/utils';
import { calculateContrast, cn } from '@/lib/utils';
import { useTranslation } from '@/hooks/useTranslation';
import { useCsrf } from '@/hooks/useCsrf';
import { showToast } from '@/components/ui/Toast';
import {
Globe, User, MapPin, Phone, FileText, Smartphone, Ticket, Star, HelpCircle, Upload
} from 'lucide-react';
// Tooltip component for form field help
const Tooltip = ({ text }: { text: string }) => (
<div className="group relative inline-block ml-1">
<HelpCircle className="w-4 h-4 text-gray-400 cursor-help" />
<div className="absolute bottom-full left-1/2 -translate-x-1/2 mb-2 px-3 py-2 bg-gray-900 text-white text-xs rounded-lg opacity-0 invisible group-hover:opacity-100 group-hover:visible transition-all duration-200 z-50 w-48 text-center">
{text}
<div className="absolute top-full left-1/2 -translate-x-1/2 border-4 border-transparent border-t-gray-900"></div>
</div>
</div>
);
// Content-type specific frame options
const getFrameOptionsForContentType = (contentType: string) => {
const baseOptions = [{ id: 'none', label: 'No Frame' }, { id: 'scanme', label: 'Scan Me' }];
switch (contentType) {
case 'URL':
return [...baseOptions, { id: 'website', label: 'Website' }, { id: 'visit', label: 'Visit' }];
case 'PHONE':
return [...baseOptions, { id: 'callme', label: 'Call Me' }, { id: 'call', label: 'Call' }];
case 'GEO':
return [...baseOptions, { id: 'findus', label: 'Find Us' }, { id: 'navigate', label: 'Navigate' }];
case 'VCARD':
return [...baseOptions, { id: 'contact', label: 'Contact' }, { id: 'save', label: 'Save' }];
case 'SMS':
return [...baseOptions, { id: 'textme', label: 'Text Me' }, { id: 'message', label: 'Message' }];
case 'WHATSAPP':
return [...baseOptions, { id: 'chatme', label: 'Chat Me' }, { id: 'whatsapp', label: 'WhatsApp' }];
case 'TEXT':
return [...baseOptions, { id: 'read', label: 'Read' }, { id: 'info', label: 'Info' }];
case 'PDF':
return [...baseOptions, { id: 'download', label: 'Download' }, { id: 'view', label: 'View PDF' }];
case 'APP':
return [...baseOptions, { id: 'getapp', label: 'Get App' }, { id: 'download', label: 'Download' }];
case 'COUPON':
return [...baseOptions, { id: 'redeem', label: 'Redeem' }, { id: 'save', label: 'Save Offer' }];
case 'FEEDBACK':
return [...baseOptions, { id: 'review', label: 'Review' }, { id: 'feedback', label: 'Feedback' }];
default:
return [...baseOptions, { id: 'website', label: 'Website' }, { id: 'visit', label: 'Visit' }];
}
};
export default function CreatePage() {
const router = useRouter();
const { t } = useTranslation();
const { fetchWithCsrf } = useCsrf();
const [loading, setLoading] = useState(false);
const [uploading, setUploading] = useState(false);
const [userPlan, setUserPlan] = useState<string>('FREE');
const qrRef = useRef<HTMLDivElement>(null);
// Form state
const [title, setTitle] = useState('');
@@ -32,10 +81,22 @@ export default function CreatePage() {
const [backgroundColor, setBackgroundColor] = useState('#FFFFFF');
const [cornerStyle, setCornerStyle] = useState('square');
const [size, setSize] = useState(200);
const [frameType, setFrameType] = useState('none');
// Logo state (PRO feature)
const [logo, setLogo] = useState<string>('');
const [logoSize, setLogoSize] = useState(40);
// Get frame options for current content type
const frameOptions = getFrameOptionsForContentType(contentType);
// Reset frame type when content type changes (if current frame is not valid)
useEffect(() => {
const validIds = frameOptions.map(f => f.id);
if (!validIds.includes(frameType)) {
setFrameType('none');
}
}, [contentType, frameOptions, frameType]);
// Logo state
const [logoUrl, setLogoUrl] = useState('');
const [logoSize, setLogoSize] = useState(24);
const [excavate, setExcavate] = useState(true);
// QR preview
@@ -64,10 +125,14 @@ export default function CreatePage() {
const hasGoodContrast = contrast >= 4.5;
const contentTypes = [
{ value: 'URL', label: 'URL / Website' },
{ value: 'VCARD', label: 'Contact Card' },
{ value: 'GEO', label: 'Location/Maps' },
{ value: 'PHONE', label: 'Phone Number' },
{ value: 'URL', label: 'URL / Website', icon: Globe },
{ value: 'VCARD', label: 'Contact Card', icon: User },
{ value: 'GEO', label: 'Location / Maps', icon: MapPin },
{ value: 'PHONE', label: 'Phone Number', icon: Phone },
{ value: 'PDF', label: 'PDF / File', icon: FileText },
{ value: 'APP', label: 'App Download', icon: Smartphone },
{ value: 'COUPON', label: 'Coupon / Discount', icon: Ticket },
{ value: 'FEEDBACK', label: 'Feedback / Review', icon: Star },
];
// Get QR content based on content type
@@ -90,6 +155,14 @@ export default function CreatePage() {
return content.text || 'Sample text';
case 'WHATSAPP':
return `https://wa.me/${content.phone || '+1234567890'}${content.message ? `?text=${encodeURIComponent(content.message)}` : ''}`;
case 'PDF':
return content.fileUrl || 'https://example.com/file.pdf';
case 'APP':
return content.fallbackUrl || content.iosUrl || content.androidUrl || 'https://example.com/app';
case 'COUPON':
return `Coupon: ${content.code || 'SAVE20'} - ${content.discount || '20% OFF'}`;
case 'FEEDBACK':
return content.feedbackUrl || 'https://example.com/feedback';
default:
return 'https://example.com';
}
@@ -97,61 +170,100 @@ export default function CreatePage() {
const qrContent = getQRContent();
const getFrameLabel = () => {
const frame = frameOptions.find((f: { id: string; label: string }) => f.id === frameType);
return frame?.id !== 'none' ? frame?.label : null;
};
const downloadQR = async (format: 'svg' | 'png') => {
if (!qrRef.current) return;
try {
// Get the content based on content type
let qrContent = '';
switch (contentType) {
case 'URL':
qrContent = content.url || '';
break;
case 'PHONE':
qrContent = `tel:${content.phone || ''}`;
break;
case 'EMAIL':
qrContent = `mailto:${content.email || ''}${content.subject ? `?subject=${encodeURIComponent(content.subject)}` : ''}`;
break;
case 'TEXT':
qrContent = content.text || '';
break;
default:
qrContent = content.url || '';
}
if (!qrContent) return;
const QRCode = (await import('qrcode')).default;
if (format === 'svg') {
const svg = await QRCode.toString(qrContent, {
type: 'svg',
width: size,
margin: 2,
color: {
dark: foregroundColor,
light: backgroundColor,
},
});
const blob = new Blob([svg], { type: 'image/svg+xml' });
if (format === 'png') {
const dataUrl = await toPng(qrRef.current, { cacheBust: true, pixelRatio: 3, backgroundColor: 'transparent' });
const link = document.createElement('a');
link.download = `qrcode-${title || 'download'}.png`;
link.href = dataUrl;
link.click();
} else {
// For SVG, we might still want to use the library or just toPng if SVG export of HTML is not needed
// Simplest is to check if we can export the SVG element directly but that misses the frame HTML.
// html-to-image can generate SVG too.
// But usually for SVG users want the vector. Capturing HTML to SVG is possible but complex.
// For now, let's just stick to the SVG code export if NO FRAME is selected,
// otherwise warn or use toPng (as SVG).
// Actually, the previous implementation was good for pure QR.
// If frame is selected, we MUST use a raster export (PNG) or complex HTML-to-SVG.
// Let's rely on toPng for consistency with frames.
const dataUrl = await toPng(qrRef.current, { cacheBust: true, pixelRatio: 3, backgroundColor: 'transparent' });
// Wait, exporting HTML to valid vector SVG is hard.
// Let's just offer PNG for frames for now to be safe, or just use the same PNG download for both buttons if frame is active?
// No, let's try to grab the INNER SVG if no frame, else...
if (frameType === 'none') {
const svgElement = qrRef.current.querySelector('svg');
if (svgElement) {
const svgData = new XMLSerializer().serializeToString(svgElement);
const blob = new Blob([svgData], { type: 'image/svg+xml' });
const url = URL.createObjectURL(blob);
const a = document.createElement('a');
a.href = url;
a.download = `qrcode-${title || 'download'}.svg`;
document.body.appendChild(a);
a.click();
document.body.removeChild(a);
URL.revokeObjectURL(url);
}
} else {
const a = document.createElement('a');
a.href = qrDataUrl;
a.download = `qrcode-${title || 'download'}.png`;
document.body.appendChild(a);
a.click();
document.body.removeChild(a);
showToast('SVG download not available with frames yet. Downloading PNG instead.', 'info');
const dataUrl = await toPng(qrRef.current, { cacheBust: true, pixelRatio: 3, backgroundColor: 'transparent' });
const link = document.createElement('a');
link.download = `qrcode-${title || 'download'}.png`;
link.href = dataUrl;
link.click();
}
}
} catch (err) {
console.error('Error downloading QR code:', err);
showToast('Error downloading QR code', 'error');
}
};
const handleLogoUpload = (e: React.ChangeEvent<HTMLInputElement>) => {
const file = e.target.files?.[0];
if (file) {
if (file.size > 10 * 1024 * 1024) { // 10MB limit (soft limit for upload, will be resized)
showToast('Logo file size too large (max 10MB)', 'error');
return;
}
const reader = new FileReader();
reader.onload = (evt) => {
const img = new Image();
img.onload = () => {
const canvas = document.createElement('canvas');
const maxDimension = 500; // Resize to max 500px
let width = img.width;
let height = img.height;
if (width > maxDimension || height > maxDimension) {
if (width > height) {
height = Math.round((height * maxDimension) / width);
width = maxDimension;
} else {
width = Math.round((width * maxDimension) / height);
height = maxDimension;
}
}
canvas.width = width;
canvas.height = height;
const ctx = canvas.getContext('2d');
ctx?.drawImage(img, 0, 0, width, height);
// Compress to JPEG/PNG with reduced quality to save space
const dataUrl = canvas.toDataURL(file.type === 'image/png' ? 'image/png' : 'image/jpeg', 0.8);
setLogoUrl(dataUrl);
};
img.src = evt.target?.result as string;
};
reader.readAsDataURL(file);
}
};
@@ -172,15 +284,13 @@ export default function CreatePage() {
backgroundColor: canCustomizeColors ? backgroundColor : '#FFFFFF',
cornerStyle,
size,
// Logo embedding (PRO only)
...(logo && canCustomizeColors ? {
imageSettings: {
src: logo,
imageSettings: (canCustomizeColors && logoUrl) ? {
src: logoUrl,
height: logoSize,
width: logoSize,
excavate: excavate,
}
} : {}),
excavate,
} : undefined,
frameType, // Save frame type
},
};
@@ -323,6 +433,208 @@ export default function CreatePage() {
/>
</div>
);
case 'PDF':
const handleFileUpload = async (e: React.ChangeEvent<HTMLInputElement>) => {
const file = e.target.files?.[0];
if (!file) return;
// 10MB limit
if (file.size > 10 * 1024 * 1024) {
showToast('File size too large (max 10MB)', 'error');
return;
}
setUploading(true);
const formData = new FormData();
formData.append('file', file);
try {
const response = await fetch('/api/upload', {
method: 'POST',
body: formData,
});
const data = await response.json();
if (response.ok) {
setContent({ ...content, fileUrl: data.url, fileName: data.filename });
showToast('File uploaded successfully!', 'success');
} else {
showToast(data.error || 'Upload failed', 'error');
}
} catch (error) {
console.error('Upload error:', error);
showToast('Error uploading file', 'error');
} finally {
setUploading(false);
}
};
return (
<>
<div>
<div className="flex items-center mb-1">
<label className="block text-sm font-medium text-gray-700">Upload Menu / PDF</label>
<Tooltip text="Upload your menu PDF (Max 10MB). Hosted securely." />
</div>
<div className="mt-2 flex justify-center px-6 pt-5 pb-6 border-2 border-gray-300 border-dashed rounded-lg hover:bg-gray-50 transition-colors relative">
<div className="space-y-1 text-center">
{uploading ? (
<div className="flex flex-col items-center">
<div className="animate-spin rounded-full h-8 w-8 border-b-2 border-primary-500 mb-2"></div>
<p className="text-sm text-gray-500">Uploading...</p>
</div>
) : content.fileUrl ? (
<div className="flex flex-col items-center">
<div className="mx-auto h-12 w-12 text-primary-500 bg-primary-50 rounded-full flex items-center justify-center mb-2">
<FileText className="h-6 w-6" />
</div>
<p className="text-sm text-green-600 font-medium mb-1">Upload Complete!</p>
<a href={content.fileUrl} target="_blank" rel="noopener noreferrer" className="text-xs text-primary-500 hover:underline break-all max-w-xs mb-3 block">
{content.fileName || 'View File'}
</a>
<label htmlFor="file-upload" className="cursor-pointer bg-white py-2 px-3 border border-gray-300 rounded-md shadow-sm text-sm leading-4 font-medium text-gray-700 hover:bg-gray-50 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-primary-500">
<span>Replace File</span>
<input id="file-upload" name="file-upload" type="file" className="sr-only" accept=".pdf,image/*" onChange={handleFileUpload} />
</label>
</div>
) : (
<>
<Upload className="mx-auto h-12 w-12 text-gray-400" />
<div className="flex text-sm text-gray-600 justify-center">
<label htmlFor="file-upload" className="relative cursor-pointer bg-white rounded-md font-medium text-primary-600 hover:text-primary-500 focus-within:outline-none focus-within:ring-2 focus-within:ring-offset-2 focus-within:ring-primary-500">
<span>Upload a file</span>
<input id="file-upload" name="file-upload" type="file" className="sr-only" accept=".pdf,image/*" onChange={handleFileUpload} />
</label>
<p className="pl-1">or drag and drop</p>
</div>
<p className="text-xs text-gray-500">PDF, PNG, JPG up to 10MB</p>
</>
)}
</div>
</div>
</div>
{content.fileUrl && (
<Input
label="File Name / Menu Title"
value={content.fileName || ''}
onChange={(e) => setContent({ ...content, fileName: e.target.value })}
placeholder="Product Catalog 2026"
/>
)}
</>
);
case 'APP':
return (
<>
<div>
<div className="flex items-center mb-1">
<label className="block text-sm font-medium text-gray-700">iOS App Store URL</label>
<Tooltip text="Link to your app in the Apple App Store" />
</div>
<Input
value={content.iosUrl || ''}
onChange={(e) => setContent({ ...content, iosUrl: e.target.value })}
placeholder="https://apps.apple.com/app/..."
/>
</div>
<div>
<div className="flex items-center mb-1">
<label className="block text-sm font-medium text-gray-700">Android Play Store URL</label>
<Tooltip text="Link to your app in the Google Play Store" />
</div>
<Input
value={content.androidUrl || ''}
onChange={(e) => setContent({ ...content, androidUrl: e.target.value })}
placeholder="https://play.google.com/store/apps/..."
/>
</div>
<div>
<div className="flex items-center mb-1">
<label className="block text-sm font-medium text-gray-700">Fallback URL</label>
<Tooltip text="Where desktop users go (e.g., your website). QR detects device automatically!" />
</div>
<Input
value={content.fallbackUrl || ''}
onChange={(e) => setContent({ ...content, fallbackUrl: e.target.value })}
placeholder="https://yourapp.com"
/>
</div>
</>
);
case 'COUPON':
return (
<>
<Input
label="Coupon Code"
value={content.code || ''}
onChange={(e) => setContent({ ...content, code: e.target.value })}
placeholder="SUMMER20"
required
/>
<Input
label="Discount"
value={content.discount || ''}
onChange={(e) => setContent({ ...content, discount: e.target.value })}
placeholder="20% OFF"
required
/>
<Input
label="Title"
value={content.title || ''}
onChange={(e) => setContent({ ...content, title: e.target.value })}
placeholder="Summer Sale 2026"
/>
<Input
label="Description (optional)"
value={content.description || ''}
onChange={(e) => setContent({ ...content, description: e.target.value })}
placeholder="Valid on all products"
/>
<Input
label="Expiry Date (optional)"
type="date"
value={content.expiryDate || ''}
onChange={(e) => setContent({ ...content, expiryDate: e.target.value })}
/>
<Input
label="Redeem URL (optional)"
value={content.redeemUrl || ''}
onChange={(e) => setContent({ ...content, redeemUrl: e.target.value })}
placeholder="https://shop.example.com?coupon=SUMMER20"
/>
</>
);
case 'FEEDBACK':
return (
<>
<Input
label="Business Name"
value={content.businessName || ''}
onChange={(e) => setContent({ ...content, businessName: e.target.value })}
placeholder="Your Restaurant Name"
required
/>
<div>
<div className="flex items-center mb-1">
<label className="block text-sm font-medium text-gray-700">Google Review URL</label>
<Tooltip text="Redirect satisfied customers to leave a Google review." />
</div>
<Input
value={content.googleReviewUrl || ''}
onChange={(e) => setContent({ ...content, googleReviewUrl: e.target.value })}
placeholder="https://search.google.com/local/writereview?placeid=..."
/>
</div>
<Input
label="Thank You Message"
value={content.thankYouMessage || ''}
onChange={(e) => setContent({ ...content, thankYouMessage: e.target.value })}
placeholder="Thanks for your feedback!"
/>
</>
);
default:
return null;
}
@@ -353,12 +665,31 @@ export default function CreatePage() {
required
/>
<Select
label="Content Type"
value={contentType}
onChange={(e) => setContentType(e.target.value)}
options={contentTypes}
/>
{/* Custom Content Type Selector with Icons */}
<div>
<label className="block text-sm font-medium text-gray-700 mb-2">Content Type</label>
<div className="grid grid-cols-2 sm:grid-cols-4 gap-2">
{contentTypes.map((type) => {
const Icon = type.icon;
return (
<button
key={type.value}
type="button"
onClick={() => setContentType(type.value)}
className={cn(
"flex flex-col items-center gap-2 p-3 rounded-lg border-2 transition-all text-sm",
contentType === type.value
? "border-primary-500 bg-primary-50 text-primary-700"
: "border-gray-200 hover:border-gray-300 text-gray-600"
)}
>
<Icon className="w-5 h-5" />
<span className="text-xs font-medium text-center">{type.label}</span>
</button>
);
})}
</div>
</div>
{renderContentFields()}
</CardContent>
@@ -409,7 +740,7 @@ export default function CreatePage() {
)}
</div>
</CardHeader>
<CardContent className="space-y-4">
<CardContent className="space-y-6">
{!canCustomizeColors && (
<div className="p-4 bg-blue-50 border border-blue-200 rounded-lg mb-4">
<p className="text-sm text-blue-900">
@@ -422,6 +753,29 @@ export default function CreatePage() {
</Link>
</div>
)}
{/* Frame Options */}
<div>
<label className="block text-sm font-medium text-gray-700 mb-3">Frame</label>
<div className="grid grid-cols-4 gap-2">
{frameOptions.map((frame: { id: string; label: string }) => (
<button
key={frame.id}
type="button"
onClick={() => setFrameType(frame.id)}
className={cn(
"py-2 px-3 rounded-lg text-sm font-medium transition-all border",
frameType === frame.id
? "bg-slate-900 text-white border-slate-900"
: "bg-gray-50 text-gray-600 border-gray-200 hover:border-gray-300"
)}
>
{frame.label}
</button>
))}
</div>
</div>
<div className="grid grid-cols-2 gap-4">
<div>
<label className="block text-sm font-medium text-gray-700 mb-2">
@@ -503,19 +857,21 @@ export default function CreatePage() {
</CardContent>
</Card>
{/* Logo/Icon Section (PRO Feature) */}
{/* Logo Section */}
<Card>
<CardHeader>
<div className="flex items-center justify-between">
<CardTitle>Logo / Icon</CardTitle>
<Badge variant="info">PRO</Badge>
<CardTitle>Logo</CardTitle>
{!canCustomizeColors && (
<Badge variant="warning">PRO Feature</Badge>
)}
</div>
</CardHeader>
<CardContent className="space-y-4">
{!canCustomizeColors ? (
<div className="p-4 bg-blue-50 border border-blue-200 rounded-lg">
{!canCustomizeColors && (
<div className="p-4 bg-blue-50 border border-blue-200 rounded-lg mb-4">
<p className="text-sm text-blue-900">
<strong>Upgrade to PRO</strong> to add your logo or icon to QR codes.
<strong>Upgrade to PRO</strong> to add logos to your QR codes.
</p>
<Link href="/pricing">
<Button variant="primary" size="sm" className="mt-2">
@@ -523,72 +879,65 @@ export default function CreatePage() {
</Button>
</Link>
</div>
) : (
<>
)}
<div>
<label className="block text-sm font-medium text-gray-700 mb-2">
Upload Logo (PNG, JPG)
Upload Logo
</label>
<div className="flex items-center space-x-4">
<input
type="file"
accept="image/png,image/jpeg,image/jpg"
onChange={(e) => {
const file = e.target.files?.[0];
if (file) {
const reader = new FileReader();
reader.onloadend = () => {
setLogo(reader.result as string);
};
reader.readAsDataURL(file);
}
}}
className="w-full text-sm text-gray-500 file:mr-4 file:py-2 file:px-4 file:rounded-lg file:border-0 file:text-sm file:font-medium file:bg-primary-50 file:text-primary-700 hover:file:bg-primary-100"
accept="image/*"
onChange={handleLogoUpload}
disabled={!canCustomizeColors}
className="block w-full text-sm text-gray-500 file:mr-4 file:py-2 file:px-4 file:rounded-full file:border-0 file:text-sm file:font-semibold file:bg-blue-50 file:text-blue-700 hover:file:bg-blue-100 disabled:opacity-50 disabled:cursor-not-allowed"
/>
</div>
{logo && (
<>
<div className="flex items-center gap-4">
<img src={logo} alt="Logo preview" className="w-12 h-12 object-contain rounded border" />
{logoUrl && (
<Button
type="button"
variant="outline"
size="sm"
onClick={() => setLogo('')}
onClick={() => {
setLogoUrl('');
setLogoSize(40);
}}
>
Remove
</Button>
)}
</div>
</div>
{logoUrl && (
<>
<div>
<label className="block text-sm font-medium text-gray-700 mb-2">
Logo Size: {logoSize}px
</label>
<input
type="range"
min="24"
max="80"
min="20"
max="70"
value={logoSize}
onChange={(e) => setLogoSize(Number(e.target.value))}
className="w-full"
/>
</div>
<div className="flex items-center gap-2">
<div className="flex items-center">
<input
type="checkbox"
id="excavate"
checked={excavate}
onChange={(e) => setExcavate(e.target.checked)}
className="w-4 h-4 rounded border-gray-300"
className="h-4 w-4 text-blue-600 focus:ring-blue-500 border-gray-300 rounded"
id="excavate-checkbox"
/>
<label htmlFor="excavate" className="text-sm text-gray-700">
Clear background behind logo (recommended)
<label htmlFor="excavate-checkbox" className="ml-2 block text-sm text-gray-900">
Excavate background (remove dots behind logo)
</label>
</div>
</>
)}
</>
)}
</CardContent>
</Card>
</div>
@@ -601,16 +950,36 @@ export default function CreatePage() {
</CardHeader>
<CardContent className="text-center">
<div id="create-qr-preview" className="flex justify-center mb-4">
{/* WRAPPER FOR REF AND FRAME */}
<div
ref={qrRef}
className="relative bg-white rounded-xl p-4 flex flex-col items-center justify-center transition-all duration-300"
style={{
minWidth: '280px',
minHeight: '280px',
}}
>
{/* Frame Label */}
{getFrameLabel() && (
<div
className="mb-4 px-6 py-2 rounded-full font-bold text-sm tracking-widest uppercase shadow-md text-white"
style={{ backgroundColor: foregroundColor }}
>
{getFrameLabel()}
</div>
)}
{qrContent ? (
<div className={cornerStyle === 'rounded' ? 'rounded-lg overflow-hidden' : ''}>
<QRCodeSVG
value={qrContent}
size={200}
size={size}
fgColor={foregroundColor}
bgColor={backgroundColor}
level={logo && canCustomizeColors ? 'H' : 'M'}
imageSettings={logo && canCustomizeColors ? {
src: logo,
level="H"
includeMargin={false}
imageSettings={logoUrl ? {
src: logoUrl,
height: logoSize,
width: logoSize,
excavate: excavate,
@@ -623,44 +992,14 @@ export default function CreatePage() {
</div>
)}
</div>
</div>
<div className="space-y-3">
<Button
variant="outline"
className="w-full"
type="button"
onClick={() => {
const svg = document.querySelector('#create-qr-preview svg');
if (!svg) return;
let svgData = new XMLSerializer().serializeToString(svg);
// If rounded corners, wrap in a clipped SVG
if (cornerStyle === 'rounded') {
const width = svg.getAttribute('width') || '200';
const height = svg.getAttribute('height') || '200';
const borderRadius = 20;
svgData = `<svg xmlns="http://www.w3.org/2000/svg" width="${width}" height="${height}" viewBox="0 0 ${width} ${height}">
<defs>
<clipPath id="rounded-corners">
<rect x="0" y="0" width="${width}" height="${height}" rx="${borderRadius}" ry="${borderRadius}"/>
</clipPath>
</defs>
<g clip-path="url(#rounded-corners)">
${svgData}
</g>
</svg>`;
}
const blob = new Blob([svgData], { type: 'image/svg+xml' });
const url = URL.createObjectURL(blob);
const a = document.createElement('a');
a.href = url;
a.download = `${title || 'qrcode'}.svg`;
a.click();
URL.revokeObjectURL(url);
}}
onClick={() => downloadQR('svg')}
disabled={!qrContent}
>
Download SVG
@@ -669,54 +1008,7 @@ export default function CreatePage() {
variant="outline"
className="w-full"
type="button"
onClick={() => {
const svg = document.querySelector('#create-qr-preview svg');
if (!svg) return;
const canvas = document.createElement('canvas');
const ctx = canvas.getContext('2d');
if (!ctx) return;
const img = new Image();
const svgData = new XMLSerializer().serializeToString(svg);
const blob = new Blob([svgData], { type: 'image/svg+xml' });
const url = URL.createObjectURL(blob);
img.onload = () => {
canvas.width = 200;
canvas.height = 200;
// Apply rounded corners if needed
if (cornerStyle === 'rounded') {
const borderRadius = 20;
ctx.beginPath();
ctx.moveTo(borderRadius, 0);
ctx.lineTo(200 - borderRadius, 0);
ctx.quadraticCurveTo(200, 0, 200, borderRadius);
ctx.lineTo(200, 200 - borderRadius);
ctx.quadraticCurveTo(200, 200, 200 - borderRadius, 200);
ctx.lineTo(borderRadius, 200);
ctx.quadraticCurveTo(0, 200, 0, 200 - borderRadius);
ctx.lineTo(0, borderRadius);
ctx.quadraticCurveTo(0, 0, borderRadius, 0);
ctx.closePath();
ctx.clip();
}
ctx.drawImage(img, 0, 0);
canvas.toBlob((blob) => {
if (blob) {
const url = URL.createObjectURL(blob);
const a = document.createElement('a');
a.href = url;
a.download = `${title || 'qrcode'}.png`;
a.click();
URL.revokeObjectURL(url);
}
});
URL.revokeObjectURL(url);
};
img.src = url;
}}
onClick={() => downloadQR('png')}
disabled={!qrContent}
>
Download PNG

View File

@@ -44,7 +44,6 @@ export default function DashboardPage() {
uniqueScans: 0,
});
const [analyticsData, setAnalyticsData] = useState<any>(null);
const [userSubdomain, setUserSubdomain] = useState<string | null>(null);
const mockQRCodes = [
{
@@ -280,13 +279,6 @@ export default function DashboardPage() {
const analytics = await analyticsResponse.json();
setAnalyticsData(analytics);
}
// Fetch user subdomain for white label display
const subdomainResponse = await fetch('/api/user/subdomain');
if (subdomainResponse.ok) {
const subdomainData = await subdomainResponse.json();
setUserSubdomain(subdomainData.subdomain || null);
}
} catch (error) {
console.error('Error fetching data:', error);
setQrCodes([]);
@@ -457,11 +449,10 @@ export default function DashboardPage() {
<div className="grid md:grid-cols-2 lg:grid-cols-3 gap-6">
{qrCodes.map((qr) => (
<QRCodeCard
key={`${qr.id}-${userSubdomain || 'default'}`}
key={qr.id}
qr={qr}
onEdit={handleEdit}
onDelete={handleDelete}
userSubdomain={userSubdomain}
/>
))}
</div>

View File

@@ -141,7 +141,7 @@ export default function PricingPage() {
'50 dynamic QR codes',
'Unlimited static QR codes',
'Advanced analytics (scans, devices, locations)',
'Custom branding (colors)',
'Custom branding (colors & logos)',
],
buttonText: isCurrentPlanWithInterval('PRO', selectedInterval)
? 'Current Plan'

View File

@@ -7,6 +7,18 @@ import { Button } from '@/components/ui/Button';
import { Input } from '@/components/ui/Input';
import { showToast } from '@/components/ui/Toast';
import { useCsrf } from '@/hooks/useCsrf';
import { Upload, FileText, HelpCircle } from 'lucide-react';
// Tooltip component for form field help
const Tooltip = ({ text }: { text: string }) => (
<div className="group relative inline-block ml-1">
<HelpCircle className="w-4 h-4 text-gray-400 cursor-help" />
<div className="absolute bottom-full left-1/2 -translate-x-1/2 mb-2 px-3 py-2 bg-gray-900 text-white text-xs rounded-lg opacity-0 invisible group-hover:opacity-100 group-hover:visible transition-all duration-200 z-50 w-48 text-center">
{text}
<div className="absolute top-full left-1/2 -translate-x-1/2 border-4 border-transparent border-t-gray-900"></div>
</div>
</div>
);
export default function EditQRPage() {
const router = useRouter();
@@ -16,6 +28,7 @@ export default function EditQRPage() {
const [loading, setLoading] = useState(true);
const [saving, setSaving] = useState(false);
const [uploading, setUploading] = useState(false);
const [qrCode, setQrCode] = useState<any>(null);
const [title, setTitle] = useState('');
const [content, setContent] = useState<any>({});
@@ -45,6 +58,41 @@ export default function EditQRPage() {
fetchQRCode();
}, [qrId, router]);
const handleFileUpload = async (e: React.ChangeEvent<HTMLInputElement>) => {
const file = e.target.files?.[0];
if (!file) return;
// 10MB limit
if (file.size > 10 * 1024 * 1024) {
showToast('File size too large (max 10MB)', 'error');
return;
}
setUploading(true);
const formData = new FormData();
formData.append('file', file);
try {
const response = await fetch('/api/upload', {
method: 'POST',
body: formData,
});
const data = await response.json();
if (response.ok) {
setContent({ ...content, fileUrl: data.url, fileName: data.filename });
showToast('File uploaded successfully!', 'success');
} else {
showToast(data.error || 'Upload failed', 'error');
}
} catch (error) {
console.error('Upload error:', error);
showToast('Error uploading file', 'error');
} finally {
setUploading(false);
}
};
const handleSave = async () => {
setSaving(true);
@@ -242,6 +290,153 @@ export default function EditQRPage() {
</div>
)}
{qrCode.contentType === 'PDF' && (
<>
<div>
<div className="flex items-center mb-1">
<label className="block text-sm font-medium text-gray-700">Upload Menu / PDF</label>
<Tooltip text="Upload your menu PDF (Max 10MB). Hosted securely." />
</div>
<div className="mt-2 flex justify-center px-6 pt-5 pb-6 border-2 border-gray-300 border-dashed rounded-lg hover:bg-gray-50 transition-colors relative">
<div className="space-y-1 text-center">
{uploading ? (
<div className="flex flex-col items-center">
<div className="animate-spin rounded-full h-8 w-8 border-b-2 border-primary-500 mb-2"></div>
<p className="text-sm text-gray-500">Uploading...</p>
</div>
) : content.fileUrl ? (
<div className="flex flex-col items-center">
<div className="mx-auto h-12 w-12 text-primary-500 bg-primary-50 rounded-full flex items-center justify-center mb-2">
<FileText className="h-6 w-6" />
</div>
<p className="text-sm text-green-600 font-medium mb-1">Upload Complete!</p>
<a href={content.fileUrl} target="_blank" rel="noopener noreferrer" className="text-xs text-primary-500 hover:underline break-all max-w-xs mb-3 block">
{content.fileName || 'View File'}
</a>
<label htmlFor="file-upload" className="cursor-pointer bg-white py-2 px-3 border border-gray-300 rounded-md shadow-sm text-sm leading-4 font-medium text-gray-700 hover:bg-gray-50 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-primary-500">
<span>Replace File</span>
<input id="file-upload" name="file-upload" type="file" className="sr-only" accept=".pdf,image/*" onChange={handleFileUpload} />
</label>
</div>
) : (
<>
<Upload className="mx-auto h-12 w-12 text-gray-400" />
<div className="flex text-sm text-gray-600 justify-center">
<label htmlFor="file-upload" className="relative cursor-pointer bg-white rounded-md font-medium text-primary-600 hover:text-primary-500 focus-within:outline-none focus-within:ring-2 focus-within:ring-offset-2 focus-within:ring-primary-500">
<span>Upload a file</span>
<input id="file-upload" name="file-upload" type="file" className="sr-only" accept=".pdf,image/*" onChange={handleFileUpload} />
</label>
<p className="pl-1">or drag and drop</p>
</div>
<p className="text-xs text-gray-500">PDF, PNG, JPG up to 10MB</p>
</>
)}
</div>
</div>
</div>
{content.fileUrl && (
<Input
label="File Name / Menu Title"
value={content.fileName || ''}
onChange={(e) => setContent({ ...content, fileName: e.target.value })}
placeholder="Product Catalog 2026"
/>
)}
</>
)}
{qrCode.contentType === 'APP' && (
<>
<Input
label="iOS App Store URL"
value={content.iosUrl || ''}
onChange={(e) => setContent({ ...content, iosUrl: e.target.value })}
placeholder="https://apps.apple.com/app/..."
/>
<Input
label="Android Play Store URL"
value={content.androidUrl || ''}
onChange={(e) => setContent({ ...content, androidUrl: e.target.value })}
placeholder="https://play.google.com/store/apps/..."
/>
<Input
label="Fallback URL (Desktop)"
value={content.fallbackUrl || ''}
onChange={(e) => setContent({ ...content, fallbackUrl: e.target.value })}
placeholder="https://yourapp.com"
/>
</>
)}
{qrCode.contentType === 'COUPON' && (
<>
<Input
label="Coupon Code"
value={content.code || ''}
onChange={(e) => setContent({ ...content, code: e.target.value })}
placeholder="SUMMER20"
required
/>
<Input
label="Discount"
value={content.discount || ''}
onChange={(e) => setContent({ ...content, discount: e.target.value })}
placeholder="20% OFF"
required
/>
<Input
label="Title"
value={content.title || ''}
onChange={(e) => setContent({ ...content, title: e.target.value })}
placeholder="Summer Sale 2026"
/>
<Input
label="Description (optional)"
value={content.description || ''}
onChange={(e) => setContent({ ...content, description: e.target.value })}
placeholder="Valid on all products"
/>
<Input
label="Expiry Date (optional)"
type="date"
value={content.expiryDate || ''}
onChange={(e) => setContent({ ...content, expiryDate: e.target.value })}
/>
<Input
label="Redeem URL (optional)"
value={content.redeemUrl || ''}
onChange={(e) => setContent({ ...content, redeemUrl: e.target.value })}
placeholder="https://shop.example.com"
/>
</>
)}
{qrCode.contentType === 'FEEDBACK' && (
<>
<Input
label="Business Name"
value={content.businessName || ''}
onChange={(e) => setContent({ ...content, businessName: e.target.value })}
placeholder="Your Restaurant Name"
required
/>
<Input
label="Google Review URL (optional)"
value={content.googleReviewUrl || ''}
onChange={(e) => setContent({ ...content, googleReviewUrl: e.target.value })}
placeholder="https://search.google.com/local/writereview?placeid=..."
/>
<Input
label="Thank You Message"
value={content.thankYouMessage || ''}
onChange={(e) => setContent({ ...content, thankYouMessage: e.target.value })}
placeholder="Thanks for your feedback!"
/>
</>
)}
<div className="flex justify-end space-x-4 pt-4">
<Button
variant="outline"

View File

@@ -0,0 +1,196 @@
'use client';
import React, { useState, useEffect } from 'react';
import { useParams, useRouter } from 'next/navigation';
import Link from 'next/link';
import { Card, CardHeader, CardTitle, CardContent } from '@/components/ui/Card';
import { Button } from '@/components/ui/Button';
import { Star, ArrowLeft, ChevronLeft, ChevronRight, MessageSquare } from 'lucide-react';
interface Feedback {
id: string;
rating: number;
comment: string;
date: string;
}
interface FeedbackStats {
total: number;
avgRating: number;
distribution: { [key: number]: number };
}
interface Pagination {
page: number;
totalPages: number;
hasMore: boolean;
}
export default function FeedbackListPage() {
const params = useParams();
const router = useRouter();
const qrId = params.id as string;
const [feedbacks, setFeedbacks] = useState<Feedback[]>([]);
const [stats, setStats] = useState<FeedbackStats | null>(null);
const [pagination, setPagination] = useState<Pagination>({ page: 1, totalPages: 1, hasMore: false });
const [loading, setLoading] = useState(true);
const [currentPage, setCurrentPage] = useState(1);
useEffect(() => {
fetchFeedback(currentPage);
}, [qrId, currentPage]);
const fetchFeedback = async (page: number) => {
setLoading(true);
try {
const res = await fetch(`/api/qrs/${qrId}/feedback?page=${page}&limit=20`);
if (res.ok) {
const data = await res.json();
setFeedbacks(data.feedbacks);
setStats(data.stats);
setPagination(data.pagination);
}
} catch (error) {
console.error('Error fetching feedback:', error);
} finally {
setLoading(false);
}
};
const renderStars = (rating: number) => (
<div className="flex gap-0.5">
{[1, 2, 3, 4, 5].map((star) => (
<Star
key={star}
className={`w-4 h-4 ${star <= rating ? 'text-amber-400 fill-amber-400' : 'text-gray-200'}`}
/>
))}
</div>
);
if (loading && !stats) {
return (
<div className="flex items-center justify-center min-h-[400px]">
<div className="animate-spin rounded-full h-8 w-8 border-b-2 border-indigo-600"></div>
</div>
);
}
return (
<div className="max-w-4xl mx-auto">
{/* Header */}
<div className="mb-8">
<Link href={`/qr/${qrId}`} className="inline-flex items-center text-gray-500 hover:text-gray-700 mb-4">
<ArrowLeft className="w-4 h-4 mr-2" />
Back to QR Code
</Link>
<h1 className="text-3xl font-bold text-gray-900">Customer Feedback</h1>
<p className="text-gray-600 mt-1">{stats?.total || 0} total responses</p>
</div>
{/* Stats Overview */}
{stats && (
<Card className="mb-8">
<CardContent className="p-6">
<div className="flex flex-col md:flex-row md:items-center gap-8">
{/* Average Rating */}
<div className="text-center md:text-left">
<div className="text-5xl font-bold text-gray-900 mb-1">{stats.avgRating}</div>
<div className="flex justify-center md:justify-start mb-1">
{renderStars(Math.round(stats.avgRating))}
</div>
<p className="text-sm text-gray-500">{stats.total} reviews</p>
</div>
{/* Distribution */}
<div className="flex-1 space-y-2">
{[5, 4, 3, 2, 1].map((rating) => {
const count = stats.distribution[rating] || 0;
const percentage = stats.total > 0 ? (count / stats.total) * 100 : 0;
return (
<div key={rating} className="flex items-center gap-3">
<span className="text-sm text-gray-600 w-12">{rating} stars</span>
<div className="flex-1 h-2 bg-gray-100 rounded-full overflow-hidden">
<div
className="h-full bg-amber-400 rounded-full transition-all"
style={{ width: `${percentage}%` }}
/>
</div>
<span className="text-sm text-gray-500 w-12 text-right">{count}</span>
</div>
);
})}
</div>
</div>
</CardContent>
</Card>
)}
{/* Feedback List */}
<Card>
<CardHeader>
<CardTitle className="flex items-center gap-2">
<MessageSquare className="w-5 h-5" />
All Reviews
</CardTitle>
</CardHeader>
<CardContent>
{feedbacks.length === 0 ? (
<div className="text-center py-12 text-gray-500">
<Star className="w-12 h-12 mx-auto mb-4 text-gray-300" />
<p>No feedback received yet</p>
</div>
) : (
<div className="divide-y divide-gray-100">
{feedbacks.map((feedback) => (
<div key={feedback.id} className="py-4">
<div className="flex items-center justify-between mb-2">
{renderStars(feedback.rating)}
<span className="text-sm text-gray-400">
{new Date(feedback.date).toLocaleDateString('en-US', {
month: 'short',
day: 'numeric',
year: 'numeric',
})}
</span>
</div>
{feedback.comment && (
<p className="text-gray-700">{feedback.comment}</p>
)}
</div>
))}
</div>
)}
{/* Pagination */}
{pagination.totalPages > 1 && (
<div className="flex items-center justify-between mt-6 pt-6 border-t">
<Button
variant="outline"
size="sm"
onClick={() => setCurrentPage((p) => Math.max(1, p - 1))}
disabled={currentPage === 1}
>
<ChevronLeft className="w-4 h-4 mr-1" />
Previous
</Button>
<span className="text-sm text-gray-500">
Page {currentPage} of {pagination.totalPages}
</span>
<Button
variant="outline"
size="sm"
onClick={() => setCurrentPage((p) => p + 1)}
disabled={!pagination.hasMore}
>
Next
<ChevronRight className="w-4 h-4 ml-1" />
</Button>
</div>
)}
</CardContent>
</Card>
</div>
);
}

View File

@@ -0,0 +1,287 @@
'use client';
import React, { useState, useEffect } from 'react';
import { useParams, useRouter } from 'next/navigation';
import Link from 'next/link';
import { QRCodeSVG } from 'qrcode.react';
import { Card, CardHeader, CardTitle, CardContent } from '@/components/ui/Card';
import { Button } from '@/components/ui/Button';
import { Badge } from '@/components/ui/Badge';
import {
ArrowLeft, Edit, ExternalLink, Star, MessageSquare,
BarChart3, Copy, Check, Pause, Play
} from 'lucide-react';
import { showToast } from '@/components/ui/Toast';
import { useCsrf } from '@/hooks/useCsrf';
interface QRCode {
id: string;
title: string;
type: 'STATIC' | 'DYNAMIC';
contentType: string;
content: any;
slug: string;
status: 'ACTIVE' | 'PAUSED';
style: any;
createdAt: string;
_count?: { scans: number };
}
interface FeedbackStats {
total: number;
avgRating: number;
distribution: { [key: number]: number };
}
export default function QRDetailPage() {
const params = useParams();
const router = useRouter();
const qrId = params.id as string;
const { fetchWithCsrf } = useCsrf();
const [qrCode, setQrCode] = useState<QRCode | null>(null);
const [feedbackStats, setFeedbackStats] = useState<FeedbackStats | null>(null);
const [loading, setLoading] = useState(true);
const [copied, setCopied] = useState(false);
useEffect(() => {
fetchQRCode();
}, [qrId]);
const fetchQRCode = async () => {
try {
const res = await fetch(`/api/qrs/${qrId}`);
if (res.ok) {
const data = await res.json();
setQrCode(data);
// Fetch feedback stats if it's a feedback QR
if (data.contentType === 'FEEDBACK') {
const feedbackRes = await fetch(`/api/qrs/${qrId}/feedback?limit=1`);
if (feedbackRes.ok) {
const feedbackData = await feedbackRes.json();
setFeedbackStats(feedbackData.stats);
}
}
} else {
showToast('QR code not found', 'error');
router.push('/dashboard');
}
} catch (error) {
console.error('Error fetching QR code:', error);
} finally {
setLoading(false);
}
};
const copyLink = async () => {
const url = `${window.location.origin}/r/${qrCode?.slug}`;
await navigator.clipboard.writeText(url);
setCopied(true);
setTimeout(() => setCopied(false), 2000);
showToast('Link copied!', 'success');
};
const toggleStatus = async () => {
if (!qrCode) return;
const newStatus = qrCode.status === 'ACTIVE' ? 'PAUSED' : 'ACTIVE';
try {
const res = await fetchWithCsrf(`/api/qrs/${qrId}`, {
method: 'PATCH',
body: JSON.stringify({ status: newStatus }),
});
if (res.ok) {
setQrCode({ ...qrCode, status: newStatus });
showToast(`QR code ${newStatus === 'ACTIVE' ? 'activated' : 'paused'}`, 'success');
}
} catch (error) {
showToast('Failed to update status', 'error');
}
};
const renderStars = (rating: number) => (
<div className="flex gap-0.5">
{[1, 2, 3, 4, 5].map((star) => (
<Star
key={star}
className={`w-4 h-4 ${star <= rating ? 'text-amber-400 fill-amber-400' : 'text-gray-200'}`}
/>
))}
</div>
);
if (loading) {
return (
<div className="flex items-center justify-center min-h-[400px]">
<div className="animate-spin rounded-full h-8 w-8 border-b-2 border-indigo-600"></div>
</div>
);
}
if (!qrCode) return null;
const qrUrl = `${typeof window !== 'undefined' ? window.location.origin : ''}/r/${qrCode.slug}`;
return (
<div className="max-w-6xl mx-auto">
{/* Header */}
<div className="mb-8">
<Link href="/dashboard" className="inline-flex items-center text-gray-500 hover:text-gray-700 mb-4">
<ArrowLeft className="w-4 h-4 mr-2" />
Back to Dashboard
</Link>
<div className="flex flex-col sm:flex-row sm:items-center sm:justify-between gap-4">
<div>
<h1 className="text-3xl font-bold text-gray-900">{qrCode.title}</h1>
<div className="flex items-center gap-2 mt-2">
<Badge variant={qrCode.type === 'DYNAMIC' ? 'info' : 'default'}>
{qrCode.type}
</Badge>
<Badge variant={qrCode.status === 'ACTIVE' ? 'success' : 'warning'}>
{qrCode.status}
</Badge>
<Badge>{qrCode.contentType}</Badge>
</div>
</div>
<div className="flex gap-2">
{qrCode.type === 'DYNAMIC' && (
<>
<Button variant="outline" size="sm" onClick={toggleStatus}>
{qrCode.status === 'ACTIVE' ? <Pause className="w-4 h-4 mr-1" /> : <Play className="w-4 h-4 mr-1" />}
{qrCode.status === 'ACTIVE' ? 'Pause' : 'Activate'}
</Button>
<Link href={`/qr/${qrId}/edit`}>
<Button variant="outline" size="sm">
<Edit className="w-4 h-4 mr-1" /> Edit
</Button>
</Link>
</>
)}
</div>
</div>
</div>
<div className="grid lg:grid-cols-3 gap-8">
{/* Left: QR Code */}
<div>
<Card>
<CardContent className="p-6 flex flex-col items-center">
<div className="bg-white p-4 rounded-xl shadow-sm mb-4">
<QRCodeSVG
value={qrUrl}
size={200}
fgColor={qrCode.style?.foregroundColor || '#000000'}
bgColor={qrCode.style?.backgroundColor || '#FFFFFF'}
/>
</div>
<div className="w-full space-y-2">
<Button variant="outline" className="w-full" onClick={copyLink}>
{copied ? <Check className="w-4 h-4 mr-2" /> : <Copy className="w-4 h-4 mr-2" />}
{copied ? 'Copied!' : 'Copy Link'}
</Button>
<a href={qrUrl} target="_blank" rel="noopener noreferrer" className="block">
<Button variant="outline" className="w-full">
<ExternalLink className="w-4 h-4 mr-2" /> Open Link
</Button>
</a>
</div>
</CardContent>
</Card>
</div>
{/* Right: Stats & Info */}
<div className="lg:col-span-2 space-y-6">
{/* Quick Stats */}
<div className="grid grid-cols-2 sm:grid-cols-3 gap-4">
<Card>
<CardContent className="p-4 text-center">
<BarChart3 className="w-6 h-6 mx-auto mb-2 text-indigo-500" />
<p className="text-2xl font-bold text-gray-900">{qrCode._count?.scans || 0}</p>
<p className="text-sm text-gray-500">Total Scans</p>
</CardContent>
</Card>
<Card>
<CardContent className="p-4 text-center">
<p className="text-2xl font-bold text-gray-900">{qrCode.type}</p>
<p className="text-sm text-gray-500">QR Type</p>
</CardContent>
</Card>
<Card>
<CardContent className="p-4 text-center">
<p className="text-2xl font-bold text-gray-900">
{new Date(qrCode.createdAt).toLocaleDateString('en-US', { month: 'short', day: 'numeric' })}
</p>
<p className="text-sm text-gray-500">Created</p>
</CardContent>
</Card>
</div>
{/* Feedback Summary (only for FEEDBACK type) */}
{qrCode.contentType === 'FEEDBACK' && (
<Card>
<CardHeader>
<CardTitle className="flex items-center gap-2">
<Star className="w-5 h-5 text-amber-400" />
Customer Feedback
</CardTitle>
</CardHeader>
<CardContent>
{feedbackStats && feedbackStats.total > 0 ? (
<div className="flex flex-col sm:flex-row sm:items-center gap-6 mb-4">
{/* Average */}
<div className="text-center sm:text-left">
<div className="text-4xl font-bold text-gray-900">{feedbackStats.avgRating}</div>
{renderStars(Math.round(feedbackStats.avgRating))}
<p className="text-sm text-gray-500 mt-1">{feedbackStats.total} reviews</p>
</div>
{/* Distribution */}
<div className="flex-1 space-y-1">
{[5, 4, 3, 2, 1].map((rating) => {
const count = feedbackStats.distribution[rating] || 0;
const pct = feedbackStats.total > 0 ? (count / feedbackStats.total) * 100 : 0;
return (
<div key={rating} className="flex items-center gap-2 text-sm">
<span className="w-8 text-gray-500">{rating}</span>
<div className="flex-1 h-2 bg-gray-100 rounded-full overflow-hidden">
<div className="h-full bg-amber-400 rounded-full" style={{ width: `${pct}%` }} />
</div>
<span className="w-8 text-gray-400 text-right">{count}</span>
</div>
);
})}
</div>
</div>
) : (
<p className="text-gray-500 mb-4">No feedback received yet. Share your QR code to collect reviews!</p>
)}
<Link href={`/qr/${qrId}/feedback`} className="block">
<Button variant="outline" className="w-full">
<MessageSquare className="w-4 h-4 mr-2" />
View All Feedback
</Button>
</Link>
</CardContent>
</Card>
)}
{/* Content Info */}
<Card>
<CardHeader>
<CardTitle>Content Details</CardTitle>
</CardHeader>
<CardContent>
<pre className="bg-gray-50 p-4 rounded-lg text-sm overflow-auto">
{JSON.stringify(qrCode.content, null, 2)}
</pre>
</CardContent>
</Card>
</div>
</div>
</div>
);
}

View File

@@ -4,12 +4,11 @@ import React, { useState, useEffect } from 'react';
import { Card, CardHeader, CardTitle, CardContent } from '@/components/ui/Card';
import { Button } from '@/components/ui/Button';
import { Badge } from '@/components/ui/Badge';
import { Input } from '@/components/ui/Input';
import { useCsrf } from '@/hooks/useCsrf';
import { showToast } from '@/components/ui/Toast';
import ChangePasswordModal from '@/components/settings/ChangePasswordModal';
type TabType = 'profile' | 'subscription' | 'whitelabel';
type TabType = 'profile' | 'subscription';
export default function SettingsPage() {
const { fetchWithCsrf } = useCsrf();
@@ -29,11 +28,6 @@ export default function SettingsPage() {
staticUsed: 0,
});
// White Label Subdomain states
const [subdomain, setSubdomain] = useState('');
const [savedSubdomain, setSavedSubdomain] = useState<string | null>(null);
const [subdomainLoading, setSubdomainLoading] = useState(false);
// Load user data
useEffect(() => {
const fetchUserData = async () => {
@@ -59,14 +53,6 @@ export default function SettingsPage() {
const data = await statsResponse.json();
setUsageStats(data);
}
// Fetch subdomain
const subdomainResponse = await fetch('/api/user/subdomain');
if (subdomainResponse.ok) {
const data = await subdomainResponse.json();
setSavedSubdomain(data.subdomain);
setSubdomain(data.subdomain || '');
}
} catch (e) {
console.error('Failed to load user data:', e);
}
@@ -199,7 +185,8 @@ export default function SettingsPage() {
<nav className="-mb-px flex space-x-8">
<button
onClick={() => setActiveTab('profile')}
className={`py-4 px-1 border-b-2 font-medium text-sm ${activeTab === 'profile'
className={`py-4 px-1 border-b-2 font-medium text-sm ${
activeTab === 'profile'
? 'border-primary-500 text-primary-600'
: 'border-transparent text-gray-500 hover:text-gray-700 hover:border-gray-300'
}`}
@@ -208,22 +195,14 @@ export default function SettingsPage() {
</button>
<button
onClick={() => setActiveTab('subscription')}
className={`py-4 px-1 border-b-2 font-medium text-sm ${activeTab === 'subscription'
className={`py-4 px-1 border-b-2 font-medium text-sm ${
activeTab === 'subscription'
? 'border-primary-500 text-primary-600'
: 'border-transparent text-gray-500 hover:text-gray-700 hover:border-gray-300'
}`}
>
Subscription
</button>
<button
onClick={() => setActiveTab('whitelabel')}
className={`py-4 px-1 border-b-2 font-medium text-sm ${activeTab === 'whitelabel'
? 'border-primary-500 text-primary-600'
: 'border-transparent text-gray-500 hover:text-gray-700 hover:border-gray-300'
}`}
>
White Label
</button>
</nav>
</div>
@@ -394,143 +373,6 @@ export default function SettingsPage() {
</div>
)}
{activeTab === 'whitelabel' && (
<div className="space-y-6">
{/* White Label Subdomain */}
<Card>
<CardHeader>
<div className="flex items-center justify-between">
<CardTitle>White Label Subdomain</CardTitle>
<Badge variant="success">FREE</Badge>
</div>
</CardHeader>
<CardContent className="space-y-4">
<p className="text-gray-600 text-sm">
Create your own branded QR code URL. Your QR codes will be accessible via your custom subdomain.
</p>
<div className="flex items-center gap-2">
<Input
value={subdomain}
onChange={(e) => setSubdomain(e.target.value.toLowerCase().replace(/[^a-z0-9-]/g, ''))}
placeholder="your-brand"
className="flex-1 max-w-xs"
/>
<span className="text-gray-600 font-medium">.qrmaster.net</span>
</div>
<div className="text-sm text-gray-500">
<ul className="list-disc list-inside space-y-1">
<li>3-30 characters</li>
<li>Only lowercase letters, numbers, and hyphens</li>
<li>Cannot start or end with a hyphen</li>
</ul>
</div>
{savedSubdomain && (
<div className="p-4 bg-green-50 border border-green-200 rounded-lg">
<p className="text-green-800 font-medium">
Your white label URL is active:
</p>
<a
href={`https://${savedSubdomain}.qrmaster.net`}
target="_blank"
rel="noopener noreferrer"
className="text-green-700 underline"
>
https://{savedSubdomain}.qrmaster.net
</a>
</div>
)}
<div className="flex gap-3">
<Button
onClick={async () => {
if (!subdomain.trim()) {
showToast('Please enter a subdomain', 'error');
return;
}
setSubdomainLoading(true);
try {
const response = await fetchWithCsrf('/api/user/subdomain', {
method: 'POST',
body: JSON.stringify({ subdomain: subdomain.trim().toLowerCase() }),
});
const data = await response.json();
if (response.ok) {
setSavedSubdomain(subdomain.trim().toLowerCase());
showToast('Subdomain saved successfully!', 'success');
} else {
showToast(data.error || 'Error saving subdomain', 'error');
}
} catch (error) {
showToast('Error saving subdomain', 'error');
} finally {
setSubdomainLoading(false);
}
}}
loading={subdomainLoading}
disabled={!subdomain.trim() || subdomain === savedSubdomain}
>
{savedSubdomain ? 'Update Subdomain' : 'Save Subdomain'}
</Button>
{savedSubdomain && (
<Button
variant="outline"
onClick={async () => {
setSubdomainLoading(true);
try {
const response = await fetchWithCsrf('/api/user/subdomain', {
method: 'DELETE',
});
if (response.ok) {
setSavedSubdomain(null);
setSubdomain('');
showToast('Subdomain removed', 'success');
}
} catch (error) {
showToast('Error removing subdomain', 'error');
} finally {
setSubdomainLoading(false);
}
}}
disabled={subdomainLoading}
>
Remove
</Button>
)}
</div>
</CardContent>
</Card>
{/* How it works */}
{savedSubdomain && (
<Card>
<CardHeader>
<CardTitle>How it works</CardTitle>
</CardHeader>
<CardContent>
<div className="space-y-4 text-sm">
<div className="grid grid-cols-2 gap-4">
<div className="p-3 bg-gray-100 rounded-lg">
<p className="text-gray-500 mb-1">Before (default)</p>
<code className="text-gray-800">qrmaster.net/r/your-qr</code>
</div>
<div className="p-3 bg-primary-50 rounded-lg border border-primary-200">
<p className="text-primary-600 mb-1">After (your brand)</p>
<code className="text-primary-800">{savedSubdomain}.qrmaster.net/r/your-qr</code>
</div>
</div>
<p className="text-gray-600">
All your QR codes will work with both URLs. Share the branded version with your clients!
</p>
</div>
</CardContent>
</Card>
)}
</div>
)}
{/* Change Password Modal */}
<ChangePasswordModal
isOpen={showPasswordModal}

View File

@@ -1,9 +1,14 @@
'use client';
import React, { useState } from 'react';
import React, { useState, useEffect } from 'react';
import Link from 'next/link';
import { usePathname } from 'next/navigation';
import { Button } from '@/components/ui/Button';
import { Footer } from '@/components/ui/Footer';
import en from '@/i18n/en.json';
import { ChevronDown, Wifi, Contact, MessageCircle, QrCode, Link2, Type, Mail, MessageSquare, Phone, Calendar, MapPin, Facebook, Instagram, Twitter, Youtube, Music, Bitcoin, CreditCard, Video, Users } from 'lucide-react';
import { cn } from '@/lib/utils';
import { AnimatePresence, motion } from 'framer-motion';
export default function MarketingLayout({
children,
@@ -11,61 +16,154 @@ export default function MarketingLayout({
children: React.ReactNode;
}) {
const [mobileMenuOpen, setMobileMenuOpen] = useState(false);
const [scrolled, setScrolled] = useState(false);
const [toolsOpen, setToolsOpen] = useState(false);
const [mobileToolsOpen, setMobileToolsOpen] = useState(false);
const pathname = usePathname();
useEffect(() => {
const handleScroll = () => {
setScrolled(window.scrollY > 20);
};
// Check immediately on mount
handleScroll();
window.addEventListener('scroll', handleScroll, { passive: true });
return () => window.removeEventListener('scroll', handleScroll);
}, []);
// Close simple menus when path changes
useEffect(() => {
setMobileMenuOpen(false);
setToolsOpen(false);
}, [pathname]);
// Always use English for marketing pages
const t = en;
const navigation = [
{ name: t.nav.features, href: '/#features' },
{ name: t.nav.pricing, href: '/#pricing' },
{ name: t.nav.faq, href: '/#faq' },
{ name: t.nav.blog, href: '/blog' },
const tools = [
{ name: 'URL / Link', description: 'Link to any website', href: '/tools/url-qr-code', icon: Link2, color: 'text-blue-500', bgColor: 'bg-blue-50' },
{ name: 'Text', description: 'Plain text message', href: '/tools/text-qr-code', icon: Type, color: 'text-slate-500', bgColor: 'bg-slate-50' },
{ name: 'WiFi', description: 'Share WiFi credentials', href: '/tools/wifi-qr-code', icon: Wifi, color: 'text-indigo-500', bgColor: 'bg-indigo-50' },
{ name: 'VCard', description: 'Digital business card', href: '/tools/vcard-qr-code', icon: Contact, color: 'text-pink-500', bgColor: 'bg-pink-50' },
{ name: 'WhatsApp', description: 'Start a chat', href: '/tools/whatsapp-qr-code', icon: MessageCircle, color: 'text-green-500', bgColor: 'bg-green-50' },
{ name: 'Email', description: 'Compose an email', href: '/tools/email-qr-code', icon: Mail, color: 'text-amber-500', bgColor: 'bg-amber-50' },
{ name: 'SMS', description: 'Send a text message', href: '/tools/sms-qr-code', icon: MessageSquare, color: 'text-cyan-500', bgColor: 'bg-cyan-50' },
{ name: 'Phone', description: 'Start a call', href: '/tools/phone-qr-code', icon: Phone, color: 'text-violet-500', bgColor: 'bg-violet-50' },
{ name: 'Event', description: 'Add calendar event', href: '/tools/event-qr-code', icon: Calendar, color: 'text-red-500', bgColor: 'bg-red-50' },
{ name: 'Location', description: 'Share a place', href: '/tools/geolocation-qr-code', icon: MapPin, color: 'text-emerald-500', bgColor: 'bg-emerald-50' },
{ name: 'Facebook', description: 'Facebook profile/page', href: '/tools/facebook-qr-code', icon: Facebook, color: 'text-blue-600', bgColor: 'bg-blue-50' },
{ name: 'Instagram', description: 'Instagram profile', href: '/tools/instagram-qr-code', icon: Instagram, color: 'text-pink-600', bgColor: 'bg-pink-50' },
{ name: 'Twitter / X', description: 'Twitter profile', href: '/tools/twitter-qr-code', icon: Twitter, color: 'text-sky-500', bgColor: 'bg-sky-50' },
{ name: 'YouTube', description: 'YouTube video/channel', href: '/tools/youtube-qr-code', icon: Youtube, color: 'text-red-600', bgColor: 'bg-red-50' },
{ name: 'TikTok', description: 'TikTok profile', href: '/tools/tiktok-qr-code', icon: Music, color: 'text-slate-800', bgColor: 'bg-slate-100' },
{ name: 'Crypto', description: 'Share wallet address', href: '/tools/crypto-qr-code', icon: Bitcoin, color: 'text-orange-500', bgColor: 'bg-orange-50' },
{ name: 'PayPal', description: 'Receive payments', href: '/tools/paypal-qr-code', icon: CreditCard, color: 'text-blue-700', bgColor: 'bg-blue-50' },
{ name: 'Zoom', description: 'Join Zoom meeting', href: '/tools/zoom-qr-code', icon: Video, color: 'text-sky-500', bgColor: 'bg-sky-50' },
{ name: 'Teams', description: 'Join Teams meeting', href: '/tools/teams-qr-code', icon: Users, color: 'text-violet-500', bgColor: 'bg-violet-50' },
];
return (
<div className="min-h-screen bg-white">
{/* Header */}
<header className="sticky top-0 z-50 bg-white border-b border-gray-200">
<nav className="container mx-auto px-4 sm:px-6 lg:px-8 max-w-7xl py-4">
<div className="flex items-center justify-between">
<header
className="fixed top-0 left-0 right-0 z-50 bg-white/80 backdrop-blur-md border-b border-slate-200 shadow-sm"
>
<nav className="container mx-auto px-4 sm:px-6 lg:px-8 max-w-7xl h-20 flex items-center justify-between">
{/* Logo */}
<Link href="/" className="flex items-center space-x-2">
<img src="/favicon.svg" alt="QR Master" className="w-8 h-8" />
<span className="text-xl font-bold text-gray-900">QR Master</span>
<Link href="/" className="flex items-center space-x-2.5 group">
<div className="relative w-9 h-9 flex items-center justify-center bg-indigo-600 rounded-lg shadow-indigo-200 shadow-lg group-hover:scale-105 transition-transform duration-200">
<QrCode className="w-5 h-5 text-white" />
</div>
<span className="text-xl font-bold text-slate-900 tracking-tight group-hover:text-indigo-600 transition-colors">QR Master</span>
</Link>
{/* Desktop Navigation */}
<div className="hidden md:flex items-center space-x-8">
{navigation.map((item) => (
<Link
key={item.name}
href={item.href}
className="text-gray-600 hover:text-gray-900 font-medium transition-colors"
<div className="hidden md:flex items-center space-x-1">
{/* Tools Dropdown */}
<div
className="relative group px-3 py-2"
onMouseEnter={() => setToolsOpen(true)}
onMouseLeave={() => setToolsOpen(false)}
>
{item.name}
<button className="flex items-center space-x-1 text-sm font-medium text-slate-600 group-hover:text-slate-900 transition-colors">
<span>Free Tools</span>
<ChevronDown className={cn("w-4 h-4 transition-transform duration-200", toolsOpen && "rotate-180")} />
</button>
<AnimatePresence>
{toolsOpen && (
<motion.div
initial={{ opacity: 0, y: 10 }}
animate={{ opacity: 1, y: 0 }}
exit={{ opacity: 0, y: 10 }}
transition={{ duration: 0.15 }}
className="absolute left-1/2 -translate-x-1/2 top-full mt-2 w-[750px] bg-white rounded-2xl shadow-lg border border-slate-100 p-4 overflow-hidden"
>
<div className="grid grid-cols-3 gap-1">
{tools.map((tool) => (
<Link
key={tool.name}
href={tool.href}
className="flex items-center space-x-3 p-2.5 rounded-xl transition-colors hover:bg-slate-50"
>
<div className={cn("p-2 rounded-lg shrink-0", tool.bgColor, tool.color)}>
<tool.icon className="w-4 h-4" />
</div>
<div>
<div className="text-sm font-semibold text-slate-900">{tool.name}</div>
<p className="text-xs text-slate-500 leading-snug">{tool.description}</p>
</div>
</Link>
))}
</div>
<div className="mt-3 pt-3 border-t border-slate-100 -mx-4 -mb-4 px-4 py-3 text-center bg-slate-50/50">
<p className="text-xs text-slate-500 font-medium">All generators are 100% free</p>
</div>
</motion.div>
)}
</AnimatePresence>
</div>
{/* Right Actions */}
<div className="hidden md:flex items-center space-x-4">
<Link href="/login">
<Button variant="outline">{t.nav.login}</Button>
<Link href="/#features" className="px-3 py-2 text-sm font-medium text-slate-600 hover:text-slate-900 transition-colors">
{t.nav.features}
</Link>
<Link href="/signup">
<Button>Get Started Free</Button>
<Link href="/#pricing" className="px-3 py-2 text-sm font-medium text-slate-600 hover:text-slate-900 transition-colors">
{t.nav.pricing}
</Link>
<Link href="/blog" className="px-3 py-2 text-sm font-medium text-slate-600 hover:text-slate-900 transition-colors">
{t.nav.blog}
</Link>
<Link href="/#faq" className="px-3 py-2 text-sm font-medium text-slate-600 hover:text-slate-900 transition-colors">
FAQ
</Link>
</div>
{/* Mobile Menu Button */}
<div className="hidden md:flex items-center space-x-4">
<Link href="/login" className="text-sm font-medium text-slate-600 hover:text-slate-900 transition-colors">
{t.nav.login}
</Link>
<Link href="/signup">
<Button className={cn(
"font-semibold shadow-lg shadow-indigo-500/20 transition-all hover:scale-105",
scrolled ? "bg-blue-600 text-white hover:bg-blue-700" : "bg-blue-600 text-white hover:bg-blue-700"
)}>
{t.nav.cta || "Get Started Free"}
</Button>
</Link>
</div>
{/* Mobile Menu Button - Always dark */}
<button
className="md:hidden text-gray-900"
className="md:hidden p-2 text-slate-900"
onClick={() => setMobileMenuOpen(!mobileMenuOpen)}
aria-label={mobileMenuOpen ? 'Close menu' : 'Open menu'}
aria-expanded={mobileMenuOpen}
aria-label="Toggle menu"
>
<svg className="w-6 h-6" fill="none" stroke="currentColor" viewBox="0 0 24 24" aria-hidden="true">
<svg className="w-6 h-6" fill="none" stroke="currentColor" viewBox="0 0 24 24">
{mobileMenuOpen ? (
<path strokeLinecap="round" strokeLinejoin="round" strokeWidth={2} d="M6 18L18 6M6 6l12 12" />
) : (
@@ -73,92 +171,78 @@ export default function MarketingLayout({
)}
</svg>
</button>
</div>
</nav>
{/* Mobile Menu */}
<AnimatePresence>
{mobileMenuOpen && (
<div className="md:hidden mt-4 pb-4 border-t border-gray-200 pt-4">
<div className="flex flex-col space-y-4">
{navigation.map((item) => (
<Link
key={item.name}
href={item.href}
className="text-gray-600 hover:text-gray-900 font-medium"
onClick={() => setMobileMenuOpen(false)}
<motion.div
initial={{ opacity: 0, height: 0 }}
animate={{ opacity: 1, height: 'auto' }}
exit={{ opacity: 0, height: 0 }}
className="md:hidden bg-white border-b border-slate-100 overflow-hidden"
>
{item.name}
<div className="container mx-auto px-4 py-6 space-y-2">
{/* Free Tools Accordion */}
<button
onClick={() => setMobileToolsOpen(!mobileToolsOpen)}
className="flex items-center justify-between w-full px-4 py-3 rounded-xl hover:bg-slate-50 text-slate-700 font-semibold"
>
<span>Free Tools</span>
<ChevronDown className={cn("w-5 h-5 transition-transform", mobileToolsOpen && "rotate-180")} />
</button>
<AnimatePresence>
{mobileToolsOpen && (
<motion.div
initial={{ opacity: 0, height: 0 }}
animate={{ opacity: 1, height: 'auto' }}
exit={{ opacity: 0, height: 0 }}
className="overflow-hidden"
>
<div className="max-h-[50vh] overflow-y-auto pl-4 space-y-1 border-l-2 border-slate-100 ml-4">
{tools.map((tool) => (
<Link
key={tool.name}
href={tool.href}
className="flex items-center gap-3 px-4 py-2.5 rounded-lg hover:bg-slate-50 text-slate-600 text-sm"
onClick={() => { setMobileMenuOpen(false); setMobileToolsOpen(false); }}
>
<tool.icon className={cn("w-4 h-4", tool.color)} />
{tool.name}
</Link>
))}
</div>
</motion.div>
)}
</AnimatePresence>
<div className="h-px bg-slate-100 my-2"></div>
<Link href="/#features" className="block px-4 py-3 text-slate-700 font-medium rounded-xl hover:bg-slate-50" onClick={() => setMobileMenuOpen(false)}>{t.nav.features}</Link>
<Link href="/#pricing" className="block px-4 py-3 text-slate-700 font-medium rounded-xl hover:bg-slate-50" onClick={() => setMobileMenuOpen(false)}>{t.nav.pricing}</Link>
<Link href="/blog" className="block px-4 py-3 text-slate-700 font-medium rounded-xl hover:bg-slate-50" onClick={() => setMobileMenuOpen(false)}>{t.nav.blog}</Link>
<Link href="/#faq" className="block px-4 py-3 text-slate-700 font-medium rounded-xl hover:bg-slate-50" onClick={() => setMobileMenuOpen(false)}>FAQ</Link>
<div className="grid grid-cols-2 gap-4 pt-4">
<Link href="/login" onClick={() => setMobileMenuOpen(false)}>
<Button variant="outline" className="w-full">{t.nav.login}</Button>
<Button variant="outline" className="w-full justify-center">Log in</Button>
</Link>
<Link href="/signup" onClick={() => setMobileMenuOpen(false)}>
<Button className="w-full">Get Started Free</Button>
<Button className="w-full justify-center bg-indigo-600 hover:bg-indigo-700">Get Started</Button>
</Link>
</div>
</div>
</motion.div>
)}
</nav>
</AnimatePresence>
</header>
{/* Main Content */}
<main>{children}</main>
<main className="pt-20">{children}</main>
{/* Footer */}
<footer className="bg-gray-900 text-white py-12 mt-20">
<div className="container mx-auto px-4 sm:px-6 lg:px-8 max-w-7xl">
<div className="grid md:grid-cols-4 gap-8">
<div>
<Link href="/" className="flex items-center space-x-2 mb-4 hover:opacity-80 transition-opacity">
<img src="/logo.svg" alt="QR Master" className="w-10 h-10" />
<span className="text-xl font-bold">QR Master</span>
</Link>
<p className="text-gray-400">
Create custom QR codes in seconds with advanced tracking and analytics.
</p>
</div>
<div>
<h3 className="font-semibold mb-4">Product</h3>
<ul className="space-y-2 text-gray-400">
<li><Link href="/#features" className="hover:text-white">Features</Link></li>
<li><Link href="/#pricing" className="hover:text-white">Pricing</Link></li>
<li><Link href="/#faq" className="hover:text-white">FAQ</Link></li>
<li><Link href="/blog" className="hover:text-white">Blog</Link></li>
</ul>
</div>
<div>
<h3 className="font-semibold mb-4">Resources</h3>
<ul className="space-y-2 text-gray-400">
<li><Link href="/#pricing" className="hover:text-white">Full Pricing</Link></li>
<li><Link href="/faq" className="hover:text-white">All Questions</Link></li>
<li><Link href="/blog" className="hover:text-white">Blog</Link></li>
<li><Link href="/signup" className="hover:text-white">Get Started</Link></li>
</ul>
</div>
<div>
<h3 className="font-semibold mb-4">Legal</h3>
<ul className="space-y-2 text-gray-400">
<li><Link href="/privacy" className="hover:text-white">Privacy Policy</Link></li>
</ul>
</div>
</div>
<div className="border-t border-gray-800 mt-8 pt-8 flex items-center justify-between text-gray-400">
<Link
href="/newsletter"
className="text-[6px] text-gray-700 opacity-[0.25] hover:opacity-100 hover:text-white transition-opacity duration-300"
>
</Link>
<p>&copy; 2025 QR Master. All rights reserved.</p>
<div className="w-12"></div>
</div>
</div>
</footer>
</div>
<Footer />
</div >
);
}

View File

@@ -5,19 +5,60 @@ import { useRouter } from 'next/navigation';
import { Card } from '@/components/ui/Card';
import { Button } from '@/components/ui/Button';
import { Badge } from '@/components/ui/Badge';
import { Mail, Users, Send, CheckCircle, AlertCircle, Loader2, Lock, LogOut } from 'lucide-react';
import {
Mail,
Users,
QrCode,
BarChart3,
TrendingUp,
Crown,
Activity,
Loader2,
Lock,
LogOut,
Zap,
Send,
CheckCircle2,
} from 'lucide-react';
interface Subscriber {
email: string;
createdAt: string;
}
interface BroadcastInfo {
interface AdminStats {
users: {
total: number;
recent: Subscriber[];
premium: number;
newThisWeek: number;
newThisMonth: number;
recent: Array<{
email: string;
name: string | null;
plan: string;
createdAt: string;
}>;
};
qrCodes: {
total: number;
dynamic: number;
static: number;
active: number;
};
scans: {
total: number;
dynamicOnly: number;
avgPerDynamicQR: string;
};
newsletter: {
subscribers: number;
};
topQRCodes: Array<{
id: string;
title: string;
type: string;
scans: number;
owner: string;
createdAt: string;
}>;
}
export default function NewsletterPage() {
export default function AdminDashboard() {
const router = useRouter();
const [isAuthenticated, setIsAuthenticated] = useState(false);
const [isAuthenticating, setIsAuthenticating] = useState(true);
@@ -25,14 +66,18 @@ export default function NewsletterPage() {
const [email, setEmail] = useState('');
const [password, setPassword] = useState('');
const [info, setInfo] = useState<BroadcastInfo | null>(null);
const [stats, setStats] = useState<AdminStats | null>(null);
const [loading, setLoading] = useState(true);
const [broadcasting, setBroadcasting] = useState(false);
const [result, setResult] = useState<{
// Newsletter management state
const [newsletterData, setNewsletterData] = useState<{
total: number;
recent: Array<{ email: string; createdAt: string }>;
} | null>(null);
const [sendingBroadcast, setSendingBroadcast] = useState(false);
const [broadcastResult, setBroadcastResult] = useState<{
success: boolean;
message: string;
sent?: number;
failed?: number;
} | null>(null);
useEffect(() => {
@@ -41,12 +86,14 @@ export default function NewsletterPage() {
const checkAuth = async () => {
try {
const response = await fetch('/api/newsletter/broadcast');
const response = await fetch('/api/admin/stats');
if (response.ok) {
setIsAuthenticated(true);
const data = await response.json();
setInfo(data);
setStats(data);
setLoading(false);
// Also fetch newsletter data
fetchNewsletterData();
} else {
setIsAuthenticated(false);
}
@@ -57,6 +104,54 @@ export default function NewsletterPage() {
}
};
const fetchNewsletterData = async () => {
try {
const response = await fetch('/api/newsletter/broadcast');
if (response.ok) {
const data = await response.json();
setNewsletterData(data);
}
} catch (error) {
console.error('Failed to fetch newsletter data:', error);
}
};
const handleSendBroadcast = async () => {
if (!confirm(`Are you sure you want to send the AI Feature Launch email to all ${newsletterData?.total || 0} subscribers?`)) {
return;
}
setSendingBroadcast(true);
setBroadcastResult(null);
try {
const response = await fetch('/api/newsletter/broadcast', {
method: 'POST',
});
const data = await response.json();
if (response.ok) {
setBroadcastResult({
success: true,
message: data.message || `Successfully sent to ${data.sent} subscribers!`,
});
} else {
setBroadcastResult({
success: false,
message: data.error || 'Failed to send broadcast',
});
}
} catch (error) {
setBroadcastResult({
success: false,
message: 'Network error. Please try again.',
});
} finally {
setSendingBroadcast(false);
}
};
const handleLogin = async (e: React.FormEvent) => {
e.preventDefault();
setLoginError('');
@@ -90,53 +185,6 @@ export default function NewsletterPage() {
router.push('/');
};
const fetchSubscriberInfo = async () => {
try {
const response = await fetch('/api/newsletter/broadcast');
if (response.ok) {
const data = await response.json();
setInfo(data);
}
} catch (error) {
console.error('Failed to fetch subscriber info:', error);
}
};
const handleBroadcast = async () => {
if (!confirm(`Are you sure you want to send the AI feature launch email to ${info?.total} subscribers?`)) {
return;
}
setBroadcasting(true);
setResult(null);
try {
const response = await fetch('/api/newsletter/broadcast', {
method: 'POST',
});
const data = await response.json();
setResult({
success: response.ok,
message: data.message || data.error,
sent: data.sent,
failed: data.failed,
});
if (response.ok) {
await fetchSubscriberInfo();
}
} catch (error) {
setResult({
success: false,
message: 'Failed to send broadcast. Please try again.',
});
} finally {
setBroadcasting(false);
}
};
// Login Screen
if (!isAuthenticated) {
return (
@@ -146,9 +194,9 @@ export default function NewsletterPage() {
<div className="w-16 h-16 bg-gradient-to-br from-purple-100 to-pink-100 dark:from-purple-900/30 dark:to-pink-900/30 rounded-full flex items-center justify-center mx-auto mb-4">
<Lock className="w-8 h-8 text-purple-600 dark:text-purple-400" />
</div>
<h1 className="text-2xl font-bold mb-2">Newsletter Admin</h1>
<h1 className="text-2xl font-bold mb-2">Admin Dashboard</h1>
<p className="text-muted-foreground text-sm">
Sign in to manage subscribers
Sign in to access admin panel
</p>
</div>
@@ -159,7 +207,7 @@ export default function NewsletterPage() {
type="email"
value={email}
onChange={(e) => setEmail(e.target.value)}
placeholder="Email"
placeholder="admin@example.com"
required
className="w-full px-4 py-3 rounded-xl bg-background border border-border focus:border-purple-500 focus:ring-2 focus:ring-purple-500/20 outline-none transition-all"
/>
@@ -171,7 +219,7 @@ export default function NewsletterPage() {
type="password"
value={password}
onChange={(e) => setPassword(e.target.value)}
placeholder="Password"
placeholder="••••••••"
required
className="w-full px-4 py-3 rounded-xl bg-background border border-border focus:border-purple-500 focus:ring-2 focus:ring-purple-500/20 outline-none transition-all"
/>
@@ -219,12 +267,13 @@ export default function NewsletterPage() {
// Admin Dashboard
return (
<div className="min-h-screen bg-gradient-to-br from-purple-50/30 to-pink-50/30 dark:from-purple-950/10 dark:to-pink-950/10">
<div className="container mx-auto px-4 py-8 max-w-4xl">
<div className="container mx-auto px-4 py-8 max-w-7xl">
{/* Header */}
<div className="flex items-center justify-between mb-8">
<div>
<h1 className="text-3xl font-bold mb-2">Newsletter Management</h1>
<h1 className="text-3xl font-bold mb-2">Admin Dashboard</h1>
<p className="text-muted-foreground">
Manage AI feature launch notifications
Platform overview and statistics
</p>
</div>
<Button
@@ -237,45 +286,305 @@ export default function NewsletterPage() {
</Button>
</div>
{/* Stats Card */}
<Card className="p-6 mb-6">
<div className="flex items-center justify-between mb-6">
<div className="flex items-center gap-3">
{/* Main Stats Grid */}
<div className="grid grid-cols-1 md:grid-cols-2 lg:grid-cols-4 gap-6 mb-8">
{/* All Time Users */}
<Card className="p-6 hover:shadow-lg transition-shadow">
<div className="flex items-start justify-between mb-4">
<div className="w-12 h-12 bg-blue-100 dark:bg-blue-900/20 rounded-lg flex items-center justify-center">
<Users className="w-6 h-6 text-blue-600 dark:text-blue-400" />
</div>
<Badge className="bg-blue-100 text-blue-700 dark:bg-blue-900/30 dark:text-blue-300">
All Time
</Badge>
</div>
<h3 className="text-3xl font-bold mb-1">{stats?.users.total || 0}</h3>
<p className="text-sm text-muted-foreground">Total Users</p>
<div className="mt-3 pt-3 border-t space-y-2">
<div className="flex items-center justify-between">
<span className="text-xs text-muted-foreground">This Month</span>
<span className="text-sm font-semibold text-green-600 dark:text-green-400">
+{stats?.users.newThisMonth || 0}
</span>
</div>
<div className="flex items-center justify-between">
<span className="text-xs text-muted-foreground">This Week</span>
<span className="text-sm font-semibold text-green-600 dark:text-green-400">
+{stats?.users.newThisWeek || 0}
</span>
</div>
</div>
</Card>
{/* Dynamic QR Codes */}
<Card className="p-6 hover:shadow-lg transition-shadow">
<div className="flex items-start justify-between mb-4">
<div className="w-12 h-12 bg-purple-100 dark:bg-purple-900/20 rounded-lg flex items-center justify-center">
<Users className="w-6 h-6 text-purple-600 dark:text-purple-400" />
<QrCode className="w-6 h-6 text-purple-600 dark:text-purple-400" />
</div>
<Badge className="bg-purple-100 text-purple-700 dark:bg-purple-900/30 dark:text-purple-300">
Dynamic
</Badge>
</div>
<h3 className="text-3xl font-bold mb-1">{stats?.qrCodes.dynamic || 0}</h3>
<p className="text-sm text-muted-foreground">Dynamic QR Codes</p>
<div className="mt-3 pt-3 border-t flex items-center justify-between">
<span className="text-xs text-muted-foreground">Static</span>
<span className="text-sm font-semibold">{stats?.qrCodes.static || 0}</span>
</div>
</Card>
{/* Total Scans */}
<Card className="p-6 hover:shadow-lg transition-shadow">
<div className="flex items-start justify-between mb-4">
<div className="w-12 h-12 bg-green-100 dark:bg-green-900/20 rounded-lg flex items-center justify-center">
<BarChart3 className="w-6 h-6 text-green-600 dark:text-green-400" />
</div>
<Badge className="bg-green-100 text-green-700 dark:bg-green-900/30 dark:text-green-300">
All Time
</Badge>
</div>
<h3 className="text-3xl font-bold mb-1">
{stats?.scans.dynamicOnly.toLocaleString() || 0}
</h3>
<p className="text-sm text-muted-foreground">Dynamic QR Scans</p>
<div className="mt-3 pt-3 border-t flex items-center justify-between">
<span className="text-xs text-muted-foreground">Avg per QR</span>
<span className="text-sm font-semibold">{stats?.scans.avgPerDynamicQR || 0}</span>
</div>
</Card>
{/* Total QR Codes */}
<Card className="p-6 hover:shadow-lg transition-shadow">
<div className="flex items-start justify-between mb-4">
<div className="w-12 h-12 bg-amber-100 dark:bg-amber-900/20 rounded-lg flex items-center justify-center">
<QrCode className="w-6 h-6 text-amber-600 dark:text-amber-400" />
</div>
<Badge className="bg-amber-100 text-amber-700 dark:bg-amber-900/30 dark:text-amber-300">
All Time
</Badge>
</div>
<h3 className="text-3xl font-bold mb-1">{stats?.qrCodes.total || 0}</h3>
<p className="text-sm text-muted-foreground">Total QR Codes</p>
<div className="mt-3 pt-3 border-t space-y-2">
<div className="flex items-center justify-between">
<span className="text-xs text-muted-foreground">Dynamic</span>
<span className="text-sm font-semibold">{stats?.qrCodes.dynamic || 0}</span>
</div>
<div className="flex items-center justify-between">
<span className="text-xs text-muted-foreground">Static</span>
<span className="text-sm font-semibold">{stats?.qrCodes.static || 0}</span>
</div>
</div>
</Card>
</div>
{/* Secondary Stats Row */}
<div className="grid grid-cols-1 md:grid-cols-3 gap-6 mb-8">
{/* Total All Scans */}
<Card className="p-6">
<div className="flex items-center gap-4">
<div className="w-12 h-12 bg-indigo-100 dark:bg-indigo-900/20 rounded-lg flex items-center justify-center">
<Zap className="w-6 h-6 text-indigo-600 dark:text-indigo-400" />
</div>
<div>
<h2 className="text-2xl font-bold">{info?.total || 0}</h2>
<p className="text-sm text-muted-foreground">Total Subscribers</p>
<h3 className="text-2xl font-bold">
{stats?.scans.total.toLocaleString() || 0}
</h3>
<p className="text-sm text-muted-foreground">Total All Scans</p>
</div>
</div>
</Card>
{/* Total QR Codes */}
<Card className="p-6">
<div className="flex items-center gap-4">
<div className="w-12 h-12 bg-pink-100 dark:bg-pink-900/20 rounded-lg flex items-center justify-center">
<QrCode className="w-6 h-6 text-pink-600 dark:text-pink-400" />
</div>
<div>
<h3 className="text-2xl font-bold">{stats?.qrCodes.total || 0}</h3>
<p className="text-sm text-muted-foreground">Total QR Codes</p>
</div>
</div>
</Card>
{/* Premium Users */}
<Card className="p-6">
<div className="flex items-center gap-4">
<div className="w-12 h-12 bg-amber-100 dark:bg-amber-900/20 rounded-lg flex items-center justify-center">
<Crown className="w-6 h-6 text-amber-600 dark:text-amber-400" />
</div>
<div>
<h3 className="text-2xl font-bold">{stats?.users.premium || 0}</h3>
<p className="text-sm text-muted-foreground">Premium Users</p>
</div>
</div>
</Card>
</div>
{/* Bottom Grid */}
<div className="grid grid-cols-1 lg:grid-cols-2 gap-6">
{/* Top QR Codes */}
<Card className="p-6">
<div className="flex items-center gap-3 mb-6">
<div className="w-10 h-10 bg-gradient-to-br from-purple-100 to-pink-100 dark:from-purple-900/30 dark:to-pink-900/30 rounded-lg flex items-center justify-center">
<TrendingUp className="w-5 h-5 text-purple-600 dark:text-purple-400" />
</div>
<div>
<h3 className="font-semibold text-lg">Top QR Codes</h3>
<p className="text-xs text-muted-foreground">Most scanned</p>
</div>
</div>
{stats?.topQRCodes && stats.topQRCodes.length > 0 ? (
<div className="space-y-3">
{stats.topQRCodes.map((qr, index) => (
<div
key={qr.id}
className="flex items-center justify-between py-3 border-b border-border last:border-0"
>
<div className="flex items-center gap-3 flex-1 min-w-0">
<div className="w-8 h-8 bg-gradient-to-br from-purple-500 to-pink-500 rounded-lg flex items-center justify-center flex-shrink-0">
<span className="text-white text-sm font-bold">
#{index + 1}
</span>
</div>
<div className="min-w-0 flex-1">
<p className="text-sm font-medium truncate">{qr.title}</p>
<p className="text-xs text-muted-foreground truncate">
{qr.owner}
</p>
</div>
</div>
<div className="text-right flex-shrink-0 ml-4">
<p className="text-lg font-bold">{qr.scans.toLocaleString()}</p>
<p className="text-xs text-muted-foreground">scans</p>
</div>
</div>
))}
</div>
) : (
<p className="text-sm text-muted-foreground">No QR codes yet</p>
)}
</Card>
{/* Recent Users */}
<Card className="p-6">
<div className="flex items-center gap-3 mb-6">
<div className="w-10 h-10 bg-blue-100 dark:bg-blue-900/20 rounded-lg flex items-center justify-center">
<Users className="w-5 h-5 text-blue-600 dark:text-blue-400" />
</div>
<div>
<h3 className="font-semibold text-lg">Recent Users</h3>
<p className="text-xs text-muted-foreground">Latest signups</p>
</div>
</div>
{stats?.users.recent && stats.users.recent.length > 0 ? (
<div className="space-y-3">
{stats.users.recent.map((user, index) => (
<div
key={index}
className="flex items-center justify-between py-3 border-b border-border last:border-0"
>
<div className="flex items-center gap-3 flex-1 min-w-0">
<div className="w-8 h-8 bg-gradient-to-br from-blue-500 to-cyan-500 rounded-full flex items-center justify-center flex-shrink-0">
<span className="text-white text-xs font-bold">
{(user.name || user.email).charAt(0).toUpperCase()}
</span>
</div>
<div className="min-w-0 flex-1">
<p className="text-sm font-medium truncate">
{user.name || user.email}
</p>
<p className="text-xs text-muted-foreground truncate">
{new Date(user.createdAt).toLocaleDateString()}
</p>
</div>
</div>
<Badge
className={
user.plan === 'FREE'
? 'bg-gray-100 text-gray-700 dark:bg-gray-900/30 dark:text-gray-300'
: 'bg-amber-100 text-amber-700 dark:bg-amber-900/30 dark:text-amber-300'
}
>
{user.plan === 'PRO' && <Crown className="w-3 h-3 mr-1" />}
{user.plan}
</Badge>
</div>
))}
</div>
) : (
<p className="text-sm text-muted-foreground">No users yet</p>
)}
</Card>
</div>
{/* Newsletter Management Section */}
<div className="mt-8">
<Card className="p-6">
<div className="flex items-center gap-3 mb-6">
<div className="w-10 h-10 bg-gradient-to-br from-purple-100 to-pink-100 dark:from-purple-900/30 dark:to-pink-900/30 rounded-lg flex items-center justify-center">
<Users className="w-5 h-5 text-purple-600 dark:text-purple-400" />
</div>
<div className="flex-1">
<h3 className="font-semibold text-lg">Newsletter Management</h3>
<p className="text-xs text-muted-foreground">Manage AI feature launch notifications</p>
</div>
<div className="text-right">
<span className="text-2xl font-bold">{newsletterData?.total || 0}</span>
<p className="text-xs text-muted-foreground">Total Subscribers</p>
</div>
<Badge className="bg-green-100 text-green-700 dark:bg-green-900/30 dark:text-green-300">
Active
</Badge>
</div>
{/* Broadcast Button */}
<div className="border-t pt-6">
<div className="mb-4">
<h3 className="font-semibold mb-2 flex items-center gap-2">
<Send className="w-4 h-4" />
Broadcast AI Feature Launch
</h3>
<p className="text-sm text-muted-foreground mb-4">
Send the AI feature launch announcement to all {info?.total} subscribers.
{/* Broadcast Section */}
<div className="p-4 bg-gray-50 dark:bg-gray-900/50 rounded-xl mb-6">
<div className="flex items-start gap-3 mb-3">
<Send className="w-5 h-5 text-purple-600 dark:text-purple-400 mt-0.5" />
<div>
<h4 className="font-medium">Broadcast AI Feature Launch</h4>
<p className="text-sm text-muted-foreground">
Send the AI feature launch announcement to all {newsletterData?.total || 0} subscribers.
This will inform them that the features are now available.
</p>
</div>
</div>
{/* Resend Free Tier Warning */}
{(newsletterData?.total || 0) > 100 && (
<div className="p-3 rounded-lg mb-3 bg-amber-100 dark:bg-amber-900/30 text-amber-800 dark:text-amber-200 flex items-start gap-2">
<Activity className="w-5 h-5 flex-shrink-0 mt-0.5" />
<div className="text-sm">
<strong>Warning: Resend Free Limit</strong>
<p>You have more than 100 subscribers. The Resend Free Tier only allows 100 emails per day. Sending this broadcast might fail for some users or block your account.</p>
</div>
</div>
)}
{broadcastResult && (
<div className={`p-3 rounded-lg mb-3 flex items-center gap-2 ${broadcastResult.success
? 'bg-green-100 dark:bg-green-900/30 text-green-700 dark:text-green-300'
: 'bg-red-100 dark:bg-red-900/30 text-red-700 dark:text-red-300'
}`}>
{broadcastResult.success && <CheckCircle2 className="w-4 h-4" />}
<span className="text-sm">{broadcastResult.message}</span>
</div>
)}
<Button
onClick={handleBroadcast}
disabled={broadcasting || !info?.total}
className="w-full sm:w-auto bg-gradient-to-r from-purple-600 to-pink-600 hover:from-purple-700 hover:to-pink-700 text-white"
onClick={handleSendBroadcast}
disabled={sendingBroadcast || (newsletterData?.total || 0) === 0 || (newsletterData?.total || 0) > 100}
className="bg-gradient-to-r from-purple-600 to-pink-600 hover:from-purple-700 hover:to-pink-700 text-white"
>
{broadcasting ? (
{sendingBroadcast ? (
<>
<Loader2 className="w-4 h-4 mr-2 animate-spin" />
Sending Emails...
Sending...
</>
) : (
<>
@@ -285,49 +594,13 @@ export default function NewsletterPage() {
)}
</Button>
</div>
</Card>
{/* Result Message */}
{result && (
<Card
className={`p-4 mb-6 ${
result.success
? 'bg-green-50 dark:bg-green-950/20 border-green-200 dark:border-green-900'
: 'bg-red-50 dark:bg-red-950/20 border-red-200 dark:border-red-900'
}`}
>
<div className="flex items-start gap-3">
{result.success ? (
<CheckCircle className="w-5 h-5 text-green-600 dark:text-green-400 flex-shrink-0 mt-0.5" />
) : (
<AlertCircle className="w-5 h-5 text-red-600 dark:text-red-400 flex-shrink-0 mt-0.5" />
)}
<div className="flex-1">
<p
className={`font-medium ${
result.success
? 'text-green-900 dark:text-green-100'
: 'text-red-900 dark:text-red-100'
}`}
>
{result.message}
</p>
{result.sent !== undefined && (
<p className="text-sm text-muted-foreground mt-1">
Sent: {result.sent} | Failed: {result.failed}
</p>
)}
</div>
</div>
</Card>
)}
{/* Recent Subscribers */}
<Card className="p-6">
<h3 className="font-semibold mb-4">Recent Subscribers</h3>
{info?.recent && info.recent.length > 0 ? (
<div className="space-y-3">
{info.recent.map((subscriber, index) => (
<div>
<h4 className="font-medium mb-3">Recent Subscribers</h4>
{newsletterData?.recent && newsletterData.recent.length > 0 ? (
<div className="space-y-2">
{newsletterData.recent.map((subscriber, index) => (
<div
key={index}
className="flex items-center justify-between py-2 border-b border-border last:border-0"
@@ -345,7 +618,9 @@ export default function NewsletterPage() {
) : (
<p className="text-sm text-muted-foreground">No subscribers yet</p>
)}
</div>
{/* Tip */}
<div className="mt-4 pt-4 border-t">
<p className="text-xs text-muted-foreground">
💡 Tip: View all subscribers in{' '}
@@ -353,7 +628,7 @@ export default function NewsletterPage() {
href="http://localhost:5555"
target="_blank"
rel="noopener noreferrer"
className="text-primary hover:underline"
className="text-purple-600 dark:text-purple-400 hover:underline"
>
Prisma Studio
</a>
@@ -363,5 +638,6 @@ export default function NewsletterPage() {
</Card>
</div>
</div>
</div>
);
}

View File

@@ -0,0 +1,371 @@
'use client';
import React, { useState, useRef } from 'react';
import Link from 'next/link';
import { QRCodeSVG } from 'qrcode.react';
import {
Bitcoin,
Download,
Check,
Sparkles,
Wallet,
} from 'lucide-react';
import { Button } from '@/components/ui/Button';
import { Input } from '@/components/ui/Input';
import { Select } from '@/components/ui/Select';
import { cn } from '@/lib/utils';
// Brand Colors
const BRAND = {
paleGrey: '#EBEBDF',
richBlue: '#1A1265',
richBlueLight: '#2A2275',
};
// Crypto Options
const CRYPTO_CURRENCIES = [
{ value: 'bitcoin', label: 'Bitcoin (BTC)', color: '#F7931A', prefix: 'bitcoin:' },
{ value: 'ethereum', label: 'Ethereum (ETH)', color: '#627EEA', prefix: 'ethereum:' },
{ value: 'usdt', label: 'Tether (USDT)', color: '#26A17B', prefix: '' }, // Commonly ERC20/TRC20 - keeping raw for safety
{ value: 'solana', label: 'Solana (SOL)', color: '#14F195', prefix: 'solana:' },
];
// QR Color Options
const QR_COLORS = [
{ name: 'Bitcoin Orange', value: '#F7931A' },
{ name: 'Ethereum Blue', value: '#627EEA' },
{ name: 'Tether Green', value: '#26A17B' },
{ name: 'Classic Black', value: '#000000' },
{ name: 'Dark Blue', value: '#1A1265' },
{ name: 'Emerald', value: '#10B981' },
{ name: 'Rose', value: '#F43F5E' },
];
// Frame Options
const FRAME_OPTIONS = [
{ id: 'none', label: 'No Frame' },
{ id: 'scanme', label: 'Scan Me' },
{ id: 'pay', label: 'Pay Now' },
{ id: 'donate', label: 'Donate' },
];
export default function CryptoGenerator() {
const [currency, setCurrency] = useState('bitcoin');
const [address, setAddress] = useState('');
const [amount, setAmount] = useState('');
const [qrMode, setQrMode] = useState<'universal' | 'wallet'>('universal');
const [qrColor, setQrColor] = useState('#F7931A');
const [frameType, setFrameType] = useState('none');
const qrRef = useRef<HTMLDivElement>(null);
// Generate URL based on selected mode
const getUrl = () => {
if (!address.trim()) return 'https://www.qrmaster.net';
const cleanAddr = address.trim();
if (qrMode === 'wallet') {
// Wallet Direct Mode - Uses crypto URI scheme
// Only works when scanning FROM a wallet app (Coinbase, Trust Wallet, etc.)
const prefixes: Record<string, string> = {
bitcoin: 'bitcoin:',
ethereum: 'ethereum:',
solana: 'solana:',
usdt: '', // USDT doesn't have a standard URI
};
const prefix = prefixes[currency] || '';
if (!prefix) return cleanAddr; // USDT fallback
let uri = `${prefix}${cleanAddr}`;
if (amount) uri += `?amount=${amount}`;
return uri;
} else {
// Universal Mode - Blockchain explorer links
// Works with ANY phone camera
switch (currency) {
case 'bitcoin':
return `https://blockchair.com/bitcoin/address/${cleanAddr}`;
case 'ethereum':
return `https://etherscan.io/address/${cleanAddr}`;
case 'solana':
return `https://solscan.io/account/${cleanAddr}`;
case 'usdt':
return `https://etherscan.io/token/0xdac17f958d2ee523a2206206994597c13d831ec7?a=${cleanAddr}`;
default:
return cleanAddr;
}
}
};
const handleDownload = async (format: 'png' | 'svg') => {
if (!qrRef.current) return;
try {
if (format === 'png') {
const { toPng } = await import('html-to-image');
const dataUrl = await toPng(qrRef.current, { cacheBust: true, pixelRatio: 3 });
const link = document.createElement('a');
link.download = `${currency}-qr-code.png`;
link.href = dataUrl;
link.click();
} else {
const svgData = qrRef.current.querySelector('svg')?.outerHTML;
if (svgData) {
const blob = new Blob([svgData], { type: 'image/svg+xml;charset=utf-8' });
const url = URL.createObjectURL(blob);
const link = document.createElement('a');
link.href = url;
link.download = `${currency}-qr-code.svg`;
link.click();
}
}
} catch (err) {
console.error('Download failed', err);
}
};
const getFrameLabel = () => {
const frame = FRAME_OPTIONS.find(f => f.id === frameType);
return frame?.id !== 'none' ? frame?.label : null;
};
return (
<div className="w-full max-w-5xl mx-auto px-4 md:px-6">
{/* Main Generator Card */}
<div className="bg-white rounded-3xl shadow-2xl shadow-slate-900/10 overflow-hidden border border-slate-100">
<div className="grid lg:grid-cols-2">
{/* LEFT: Input Section */}
<div className="p-8 lg:p-10 space-y-8 border-r border-slate-100">
{/* Crypto Details */}
<div className="space-y-6">
<h2 className="text-lg font-bold text-slate-900 flex items-center gap-2">
<Wallet className="w-5 h-5 text-slate-900" />
Wallet Details
</h2>
<div>
<label className="block text-sm font-medium text-slate-700 mb-2">Currency</label>
<Select
value={currency}
options={CRYPTO_CURRENCIES}
onChange={(e) => {
const val = e.target.value;
setCurrency(val);
const col = CRYPTO_CURRENCIES.find(c => c.value === val)?.color;
if (col) setQrColor(col);
}}
className="h-12 w-full rounded-xl border-slate-200"
/>
</div>
<div>
<label className="block text-sm font-medium text-slate-700 mb-2">Wallet Address</label>
<Input
placeholder={`Enter ${currency} address`}
value={address}
onChange={(e) => setAddress(e.target.value)}
className="h-12 text-base rounded-xl border-slate-200 focus:border-slate-900 focus:ring-slate-900 font-mono text-sm"
/>
</div>
<div>
<label className="block text-sm font-medium text-slate-700 mb-2">Amount (Optional)</label>
<Input
placeholder="0.00"
type="number"
value={amount}
onChange={(e) => setAmount(e.target.value)}
className="h-12 text-base rounded-xl border-slate-200 focus:border-slate-900 focus:ring-slate-900"
/>
</div>
{/* QR Mode Toggle */}
<div>
<label className="block text-sm font-medium text-slate-700 mb-2">QR Code Mode</label>
<div className="grid grid-cols-2 gap-2">
<button
onClick={() => setQrMode('universal')}
className={cn(
"py-3 px-4 rounded-xl text-sm font-medium transition-all border",
qrMode === 'universal'
? "bg-slate-900 text-white border-slate-900"
: "bg-slate-50 text-slate-600 border-slate-200 hover:border-slate-300"
)}
>
Universal (Web)
</button>
<button
onClick={() => setQrMode('wallet')}
className={cn(
"py-3 px-4 rounded-xl text-sm font-medium transition-all border",
qrMode === 'wallet'
? "bg-slate-900 text-white border-slate-900"
: "bg-slate-50 text-slate-600 border-slate-200 hover:border-slate-300"
)}
>
Wallet Direct
</button>
</div>
<p className="text-xs text-slate-500 mt-2">
{qrMode === 'universal'
? "Works with any phone camera. Opens blockchain explorer."
: "Requires scanning from a wallet app. Enables direct payment."}
</p>
</div>
</div>
<div className="border-t border-slate-100"></div>
{/* Design Options */}
<div className="space-y-6">
<h2 className="text-lg font-bold text-slate-900 flex items-center gap-2">
<Sparkles className="w-5 h-5 text-slate-900" />
Design Options
</h2>
{/* Color Picker */}
<div>
<label className="block text-sm font-medium text-slate-700 mb-3">QR Code Color</label>
<div className="flex flex-wrap gap-2">
{QR_COLORS.map((c) => (
<button
key={c.name}
onClick={() => setQrColor(c.value)}
className={cn(
"w-9 h-9 rounded-full border-2 flex items-center justify-center transition-all hover:scale-110",
qrColor === c.value ? "border-slate-900 ring-2 ring-offset-2 ring-slate-200" : "border-white shadow-md"
)}
style={{ backgroundColor: c.value }}
aria-label={`Select ${c.name}`}
title={c.name}
>
{qrColor === c.value && <Check className="w-4 h-4 text-white" strokeWidth={3} />}
</button>
))}
</div>
</div>
{/* Frame Selector */}
<div>
<label className="block text-sm font-medium text-slate-700 mb-3">Frame Label</label>
<div className="grid grid-cols-4 gap-2">
{FRAME_OPTIONS.map((frame) => (
<button
key={frame.id}
onClick={() => setFrameType(frame.id)}
className={cn(
"py-2.5 px-3 rounded-lg text-sm font-medium transition-all border",
frameType === frame.id
? "bg-slate-900 text-white border-slate-900"
: "bg-slate-50 text-slate-600 border-slate-200 hover:border-slate-300"
)}
>
{frame.label}
</button>
))}
</div>
</div>
</div>
</div>
{/* RIGHT: Preview Section */}
<div className="p-8 lg:p-10 flex flex-col items-center justify-center" style={{ backgroundColor: BRAND.paleGrey }}>
{/* QR Card with Frame */}
<div
ref={qrRef}
className="bg-white rounded-3xl shadow-xl p-8 flex flex-col items-center"
style={{ minWidth: '320px' }}
>
{/* Frame Label */}
{getFrameLabel() && (
<div
className="mb-5 px-8 py-2.5 rounded-full text-white font-bold text-sm tracking-widest uppercase shadow-md"
style={{ backgroundColor: qrColor }}
>
{getFrameLabel()}
</div>
)}
{/* QR Code */}
<div className="bg-white">
{address.trim() ? (
<QRCodeSVG
value={getUrl()}
size={240}
level="Q"
includeMargin={false}
fgColor={qrColor}
/>
) : (
<div
className="flex items-center justify-center border-2 border-dashed border-slate-200 rounded-xl"
style={{ width: 240, height: 240 }}
>
<div className="text-center text-slate-400 p-6">
<Wallet className="w-12 h-12 mx-auto mb-3 opacity-50" />
<p className="text-sm font-medium">Enter wallet address</p>
<p className="text-xs mt-1">to generate QR code</p>
</div>
</div>
)}
</div>
{/* Info Preview */}
<div className="mt-6 text-center max-w-[260px]">
<h3 className="font-bold text-slate-900 text-lg flex items-center justify-center gap-2 truncate">
<Bitcoin className="w-4 h-4 text-slate-400 shrink-0" />
<span className="truncate capitalize">{currency}</span>
</h3>
<div className="text-xs text-slate-500 mt-1 truncate px-2">
{address || 'Wallet Address'}
</div>
</div>
</div>
{/* Download Buttons */}
<div className="flex items-center gap-3 mt-8">
<Button
onClick={() => handleDownload('png')}
className="bg-slate-900 hover:bg-black text-white shadow-lg"
>
<Download className="w-4 h-4 mr-2" />
Download PNG
</Button>
<Button
onClick={() => handleDownload('svg')}
variant="outline"
className="border-slate-300 hover:bg-white"
>
<Download className="w-4 h-4 mr-2" />
SVG
</Button>
</div>
<p className="text-xs text-slate-500 mt-4 text-center">
Scanning copies the wallet address or opens a crypto app.
</p>
</div>
</div>
</div>
{/* Upsell Banner */}
<div className="mt-8 bg-gradient-to-r from-slate-900 to-slate-700 rounded-2xl p-6 flex flex-col sm:flex-row items-center justify-between gap-4">
<div className="text-white text-center sm:text-left">
<h3 className="font-bold text-lg">Accept Crypto for Business?</h3>
<p className="text-white/80 text-sm mt-1">
Create professional, branded payment pages for your store.
</p>
</div>
<Link href="/signup">
<Button className="bg-white text-slate-900 hover:bg-slate-100 shrink-0 shadow-lg">
Get Business Tools
</Button>
</Link>
</div>
</div>
);
}

View File

@@ -0,0 +1,362 @@
import React from 'react';
import type { Metadata } from 'next';
import CryptoGenerator from './CryptoGenerator';
import { Bitcoin, Shield, Zap, Smartphone, Wallet, Coins, Sparkles, Download, Share2 } from 'lucide-react';
import { QRCodeSVG } from 'qrcode.react';
import { ToolBreadcrumb } from '@/components/seo/BreadcrumbSchema';
// SEO Optimized Metadata
export const metadata: Metadata = {
title: 'Free Crypto QR Code Generator | Bitcoin, Ethereum & USDT | QR Master',
description: 'Create a QR code for your Crypto wallet address. Supports Bitcoin (BTC), Ethereum (ETH), USDT, and more. Essential for easy payments and donations.',
keywords: ['crypto qr code', 'bitcoin qr generator', 'ethereum qr code', 'crypto wallet qr', 'donation qr code'],
alternates: {
canonical: 'https://qrmaster.io/tools/crypto-qr-code',
},
openGraph: {
title: 'Free Crypto QR Code Generator | QR Master',
description: 'Generate QR codes to accept Crypto payments securely. Supports BTC, ETH, SOL.',
type: 'website',
url: 'https://qrmaster.io/tools/crypto-qr-code',
images: [{ url: '/og-crypto-generator.png', width: 1200, height: 630 }],
},
twitter: {
card: 'summary_large_image',
title: 'Free Crypto QR Code Generator',
description: 'Create secure QR codes for your crypto wallet.',
},
robots: {
index: true,
follow: true,
},
};
// JSON-LD Structured Data
const jsonLd = {
'@context': 'https://schema.org',
'@graph': [
{
'@type': 'SoftwareApplication',
name: 'Crypto QR Code Generator',
applicationCategory: 'FinanceApplication',
operatingSystem: 'Web Browser',
offers: {
'@type': 'Offer',
price: '0',
priceCurrency: 'USD',
},
aggregateRating: {
'@type': 'AggregateRating',
ratingValue: '4.9',
ratingCount: '870',
},
description: 'Generate QR codes that contain your cryptocurrency wallet address for easy payments.',
},
{
'@type': 'HowTo',
name: 'How to Create a Crypto QR Code',
description: 'Create a QR code for your Bitcoin or Ethereum wallet.',
step: [
{
'@type': 'HowToStep',
position: 1,
name: 'Select Currency',
text: 'Choose your cryptocurrency from the list (Bitcoin, Ethereum, USDT, etc.).',
},
{
'@type': 'HowToStep',
position: 2,
name: 'Enter Address',
text: 'Copy your public wallet address from your crypto app and paste it into the "Wallet Address" field.',
},
{
'@type': 'HowToStep',
position: 3,
name: 'Add Amount (Optional)',
text: 'If you are requesting a specific payment, enter the amount to pre-fill the transaction.',
},
{
'@type': 'HowToStep',
position: 4,
name: 'Customize QR',
text: 'Select a brand color (like Bitcoin Orange or Ethereum Blue) and add a frame like "Pay Now".',
},
{
'@type': 'HowToStep',
position: 5,
name: 'Download',
text: 'Download the QR code image and share it to receive funds securely.',
},
],
totalTime: 'PT30S',
},
{
'@type': 'FAQPage',
mainEntity: [
{
'@type': 'Question',
name: 'Is it safe to share my wallet address?',
acceptedAnswer: {
'@type': 'Answer',
text: 'Yes. Your public wallet address is designed to be shared so you can receive funds. Never share your private key.',
},
},
{
'@type': 'Question',
name: 'Which currencies are supported?',
acceptedAnswer: {
'@type': 'Answer',
text: 'Our generator supports standard URI schemes for Bitcoin, Ethereum, Solana, and can generally store any wallet string for other coins.',
},
},
{
'@type': 'Question',
name: 'Can I add a specific amount?',
acceptedAnswer: {
'@type': 'Answer',
text: 'Yes, you can pre-fill an amount so when the user scans, their wallet app automatically suggests the correct payment value.',
},
},
{
'@type': 'Question',
name: 'Does it work with all wallets?',
acceptedAnswer: {
'@type': 'Answer',
text: 'Yes, standard crypto QR codes are universally readable by almost all modern wallet apps (Coinbase, MetaMask, Trust Wallet, etc.).',
},
},
{
'@type': 'Question',
name: 'Are there any fees?',
acceptedAnswer: {
'@type': 'Answer',
text: 'No. This generator is completely free. We do not charge any fees for generating codes or for the transactions made using them.',
},
},
],
},
],
};
export default function CryptoQRCodePage() {
return (
<>
<script
type="application/ld+json"
dangerouslySetInnerHTML={{ __html: JSON.stringify(jsonLd) }}
/>
<ToolBreadcrumb toolName="Crypto QR Code Generator" toolSlug="crypto-qr-code" />
<div className="min-h-screen" style={{ backgroundColor: '#EBEBDF' }}>
{/* HERO SECTION */}
<section className="relative pt-20 pb-20 lg:pt-32 lg:pb-32 px-4 sm:px-6 lg:px-8 overflow-hidden bg-slate-900">
<div className="absolute inset-0 opacity-20">
{/* Circuit Pattern */}
<svg className="w-full h-full" width="100%" height="100%" xmlns="http://www.w3.org/2000/svg">
<defs>
<pattern id="circuit_pattern" width="100" height="100" patternUnits="userSpaceOnUse">
<path d="M10 10 H 90 V 90 H 10 Z" stroke="none" fill="none" />
<circle cx="20" cy="20" r="2" fill="#F7931A" />
<circle cx="80" cy="80" r="2" fill="#627EEA" />
<path d="M20 20 L 50 20 L 50 50" stroke="white" strokeWidth="1" strokeOpacity="0.1" />
</pattern>
</defs>
<rect width="100%" height="100%" fill="url(#circuit_pattern)" />
</svg>
</div>
<div className="max-w-7xl mx-auto grid lg:grid-cols-2 gap-12 items-center relative z-10">
<div className="text-center lg:text-left">
<div className="inline-flex items-center gap-2 px-3 py-1 rounded-full bg-white/10 text-white/90 text-sm font-medium mb-6 backdrop-blur-sm border border-white/10 hover:bg-white/20 transition-colors cursor-default">
<span className="flex h-2 w-2 relative">
<span className="animate-ping absolute inline-flex h-full w-full rounded-full bg-orange-400 opacity-75"></span>
<span className="relative inline-flex rounded-full h-2 w-2 bg-orange-400"></span>
</span>
Free Tool Secure & Private
</div>
<h1 className="text-4xl md:text-5xl lg:text-6xl font-extrabold text-white tracking-tight leading-tight mb-6">
Accept Payments with <br className="hidden lg:block" />
<span className="text-transparent bg-clip-text bg-gradient-to-r from-[#F7931A] to-[#F2A900]">Crypto QR Codes</span>
</h1>
<p className="text-lg md:text-xl text-slate-400 max-w-2xl mx-auto lg:mx-0 mb-8 leading-relaxed">
Share your wallet address securely. Supports Bitcoin, Ethereum, USDT, and more.
<strong className="text-white block sm:inline mt-2 sm:mt-0"> Error-free transfers.</strong>
</p>
<div className="flex flex-wrap justify-center lg:justify-start gap-4 text-sm font-medium text-white/80">
<div className="flex items-center gap-2 bg-white/5 px-4 py-2.5 rounded-xl border border-white/10 backdrop-blur-sm">
<Bitcoin className="w-4 h-4 text-[#F7931A]" />
Bitcoin
</div>
<div className="flex items-center gap-2 bg-white/5 px-4 py-2.5 rounded-xl border border-white/10 backdrop-blur-sm">
<Coins className="w-4 h-4 text-[#627EEA]" />
Ethereum & Altcoins
</div>
<div className="flex items-center gap-2 bg-white/5 px-4 py-2.5 rounded-xl border border-white/10 backdrop-blur-sm">
<Wallet className="w-4 h-4 text-white" />
Wallet Connect
</div>
</div>
</div>
{/* Visual Abstract */}
<div className="hidden lg:flex relative items-center justify-center min-h-[400px]">
<div className="absolute w-[500px] h-[500px] bg-orange-500/10 rounded-full blur-[100px] -top-20 -right-20 animate-pulse" />
<div className="relative w-80 h-96 bg-white/5 backdrop-blur-xl border border-white/20 rounded-3xl shadow-2xl flex flex-col items-center justify-center p-8 transform rotate-2 hover:-rotate-1 transition-all duration-700 group">
<div className="absolute inset-0 bg-gradient-to-br from-white/5 to-transparent rounded-3xl" />
<div className="w-full bg-gradient-to-br from-orange-400 to-orange-600 rounded-xl shadow-lg p-5 mb-6 relative overflow-hidden text-white">
<div className="flex justify-between items-start mb-4">
<Bitcoin className="w-8 h-8 opacity-80" />
<div className="bg-white/20 px-2 py-1 rounded text-xs">BTC</div>
</div>
<div className="text-2xl font-bold tracking-wider mb-1">0.05 BTC</div>
<div className="text-xs opacity-70">$3,450.25 USD</div>
</div>
<div className="w-48 h-48 bg-white rounded-xl p-2 shadow-inner relative overflow-hidden flex items-center justify-center">
<QRCodeSVG value="https://www.qrmaster.net" size={170} fgColor="#333" level="Q" />
</div>
{/* Floating Badge */}
<div className="absolute -bottom-6 -right-6 bg-slate-900 border border-white/10 py-3 px-5 rounded-xl shadow-xl flex items-center gap-3 transform transition-transform hover:scale-105 duration-300">
<div className="bg-orange-500/20 p-2 rounded-full">
<Wallet className="w-5 h-5 text-orange-500" />
</div>
<div className="text-left">
<div className="text-[10px] text-slate-400 font-bold uppercase tracking-wider">Payment</div>
<div className="text-sm font-bold text-white">Receive Crypto</div>
</div>
</div>
</div>
</div>
</div>
</section>
{/* GENERATOR SECTION */}
<section className="py-12 px-4 sm:px-6 lg:px-8 -mt-8">
<CryptoGenerator />
</section>
{/* HOW IT WORKS */}
<section className="py-16 px-4 sm:px-6 lg:px-8 bg-white">
<div className="max-w-4xl mx-auto">
<h2 className="text-3xl font-bold text-slate-900 text-center mb-12">
How Crypto QR Codes Work
</h2>
<div className="grid md:grid-cols-3 lg:grid-cols-5 gap-8">
<article className="text-center">
<div className="w-12 h-12 rounded-2xl bg-black flex items-center justify-center mx-auto mb-4">
<Coins className="w-6 h-6 text-white" />
</div>
<h3 className="font-bold text-slate-900 mb-2">1. Select</h3>
<p className="text-slate-600 text-xs leading-relaxed">
Choose your crypto currency (BTC, ETH, etc.).
</p>
</article>
<article className="text-center">
<div className="w-12 h-12 rounded-2xl bg-black flex items-center justify-center mx-auto mb-4">
<Wallet className="w-6 h-6 text-white" />
</div>
<h3 className="font-bold text-slate-900 mb-2">2. Paste</h3>
<p className="text-slate-600 text-xs leading-relaxed">
Enter your public wallet address.
</p>
</article>
<article className="text-center">
<div className="w-12 h-12 rounded-2xl bg-black flex items-center justify-center mx-auto mb-4">
<Zap className="w-6 h-6 text-white" />
</div>
<h3 className="font-bold text-slate-900 mb-2">3. Amount</h3>
<p className="text-slate-600 text-xs leading-relaxed">
Optionally specify an amount to request.
</p>
</article>
<article className="text-center">
<div className="w-12 h-12 rounded-2xl bg-black flex items-center justify-center mx-auto mb-4">
<Sparkles className="w-6 h-6 text-white" />
</div>
<h3 className="font-bold text-slate-900 mb-2">4. Style</h3>
<p className="text-slate-600 text-xs leading-relaxed">
Customize colors and add a 'Pay' frame.
</p>
</article>
<article className="text-center">
<div className="w-12 h-12 rounded-2xl bg-black flex items-center justify-center mx-auto mb-4">
<Download className="w-6 h-6 text-white" />
</div>
<h3 className="font-bold text-slate-900 mb-2">5. Download</h3>
<p className="text-slate-600 text-xs leading-relaxed">
Save your secure QR code image.
</p>
</article>
</div>
</div>
</section>
{/* FAQ SECTION */}
<section className="py-16 px-4 sm:px-6 lg:px-8" style={{ backgroundColor: '#EBEBDF' }}>
<div className="max-w-3xl mx-auto">
<h2 className="text-3xl font-bold text-slate-900 text-center mb-4">
Frequently Asked Questions
</h2>
<p className="text-slate-600 text-center mb-10">
Common questions about Crypto QR codes.
</p>
<div className="space-y-4">
<FaqItem
question="Is it safe to share my wallet address?"
answer="Yes. Your public wallet address is designed to be shared so you can receive funds. Never share your private key."
/>
<FaqItem
question="Which currencies are supported?"
answer="Our generator supports standard URI schemes for Bitcoin, Ethereum, Solana, and can generally store any wallet string for other coins."
/>
<FaqItem
question="Can I add a specific amount?"
answer="Yes, you can pre-fill an amount so when the user scans, their wallet app automatically suggests the correct payment value."
/>
<FaqItem
question="Does it work with all wallets?"
answer="Yes, standard crypto QR codes are universally readable by almost all modern wallet apps (Coinbase, MetaMask, Trust Wallet, etc.)."
/>
<FaqItem
question="Are there any fees?"
answer="No. This generator is completely free. We do not charge any fees for generating codes or for the transactions made using them."
/>
</div>
</div>
</section>
</div>
</>
);
}
function FaqItem({ question, answer }: { question: string; answer: string }) {
return (
<details className="group bg-white rounded-xl shadow-sm border border-slate-200 overflow-hidden">
<summary className="flex items-center justify-between p-5 cursor-pointer list-none text-slate-900 font-semibold hover:bg-slate-50 transition-colors">
{question}
<span className="transition group-open:rotate-180 text-slate-400">
<svg fill="none" height="20" stroke="currentColor" strokeLinecap="round" strokeLinejoin="round" strokeWidth="2" viewBox="0 0 24 24" width="20">
<path d="M6 9l6 6 6-6" />
</svg>
</span>
</summary>
<div className="text-slate-600 px-5 pb-5 pt-0 leading-relaxed text-sm">
{answer}
</div>
</details>
);
}

View File

@@ -0,0 +1,297 @@
'use client';
import React, { useState, useRef } from 'react';
import Link from 'next/link';
import { QRCodeSVG } from 'qrcode.react';
import {
Mail,
Download,
Check,
Sparkles,
Type,
FileText
} from 'lucide-react';
import { Button } from '@/components/ui/Button';
import { Input } from '@/components/ui/Input';
import { cn } from '@/lib/utils';
// Brand Colors
const BRAND = {
paleGrey: '#EBEBDF',
richRed: '#dc2626',
};
// QR Color Options
const QR_COLORS = [
{ name: 'Classic Black', value: '#000000' },
{ name: 'Email Red', value: '#dc2626' },
{ name: 'Deep Blue', value: '#1E40AF' },
{ name: 'Violet', value: '#7C3AED' },
{ name: 'Teal', value: '#0D9488' },
{ name: 'Coral', value: '#F43F5E' },
{ name: 'Emerald', value: '#10B981' },
{ name: 'Rose', value: '#F43F5E' },
];
// Frame Options
const FRAME_OPTIONS = [
{ id: 'none', label: 'No Frame' },
{ id: 'email', label: 'Email Me' },
{ id: 'contact', label: 'Contact' },
{ id: 'send', label: 'Send Mail' },
];
export default function EmailGenerator() {
const [formData, setFormData] = useState({
email: '',
subject: '',
body: ''
});
const [qrColor, setQrColor] = useState('#dc2626');
const [frameType, setFrameType] = useState('none');
const qrRef = useRef<HTMLDivElement>(null);
// Generate Mailto Link
// Format: mailto:email?subject=...&body=...
const getMailtoUrl = () => {
const params = new URLSearchParams();
if (formData.subject) params.append('subject', formData.subject);
if (formData.body) params.append('body', formData.body);
const queryString = params.toString();
return `mailto:${formData.email}${queryString ? `?${queryString}` : ''}`;
};
const handleDownload = async (format: 'png' | 'svg') => {
if (!qrRef.current) return;
try {
if (format === 'png') {
const { toPng } = await import('html-to-image');
const dataUrl = await toPng(qrRef.current, { cacheBust: true, pixelRatio: 3 });
const link = document.createElement('a');
link.download = `email-qr-code.png`;
link.href = dataUrl;
link.click();
} else {
const svgData = qrRef.current.querySelector('svg')?.outerHTML;
if (svgData) {
const blob = new Blob([svgData], { type: 'image/svg+xml;charset=utf-8' });
const urlBlob = URL.createObjectURL(blob);
const link = document.createElement('a');
link.href = urlBlob;
link.download = `email-qr-code.svg`;
link.click();
}
}
} catch (err) {
console.error('Download failed', err);
}
};
const getFrameLabel = () => {
const frame = FRAME_OPTIONS.find(f => f.id === frameType);
return frame?.id !== 'none' ? frame?.label : null;
};
const handleChange = (e: React.ChangeEvent<HTMLInputElement | HTMLTextAreaElement>) => {
setFormData({ ...formData, [e.target.name]: e.target.value });
};
return (
<div className="w-full max-w-5xl mx-auto px-4 md:px-6">
{/* Main Generator Card */}
<div className="bg-white rounded-3xl shadow-2xl shadow-slate-900/10 overflow-hidden border border-slate-100">
<div className="grid lg:grid-cols-2">
{/* LEFT: Input Section */}
<div className="p-8 lg:p-10 space-y-8 border-r border-slate-100">
{/* Input Fields */}
<div className="space-y-6">
<h2 className="text-lg font-bold text-slate-900 flex items-center gap-2">
<Mail className="w-5 h-5 text-red-600" />
Email Details
</h2>
<div>
<label className="block text-sm font-medium text-slate-700 mb-2">Recipient Email</label>
<div className="relative">
<Mail className="absolute left-3 top-3 w-4 h-4 text-slate-400" />
<Input
name="email"
placeholder="recipient@example.com"
value={formData.email}
onChange={handleChange}
className="h-11 rounded-xl pl-9"
type="email"
/>
</div>
</div>
<div>
<label className="block text-sm font-medium text-slate-700 mb-2">Subject Line</label>
<div className="relative">
<Type className="absolute left-3 top-3 w-4 h-4 text-slate-400" />
<Input
name="subject"
placeholder="e.g. Inquiry about services"
value={formData.subject}
onChange={handleChange}
className="h-11 rounded-xl pl-9"
/>
</div>
</div>
<div>
<label className="block text-sm font-medium text-slate-700 mb-2">Body Message (Optional)</label>
<textarea
name="body"
placeholder="Hi there, I would like to know more about..."
value={formData.body}
onChange={handleChange}
className="w-full h-32 p-3 rounded-xl border border-slate-200 focus:border-red-600 focus:ring-1 focus:ring-red-600 focus:outline-none resize-none text-base"
/>
</div>
</div>
{/* Divider */}
<div className="border-t border-slate-100"></div>
{/* Design Options */}
<div className="space-y-6">
<h2 className="text-lg font-bold text-slate-900 flex items-center gap-2">
<Sparkles className="w-5 h-5 text-red-600" />
Design Options
</h2>
{/* Color Picker */}
<div>
<label className="block text-sm font-medium text-slate-700 mb-3">QR Code Color</label>
<div className="flex flex-wrap gap-2">
{QR_COLORS.map((c) => (
<button
key={c.name}
onClick={() => setQrColor(c.value)}
className={cn(
"w-9 h-9 rounded-full border-2 flex items-center justify-center transition-all hover:scale-110",
qrColor === c.value ? "border-slate-900 ring-2 ring-offset-2 ring-slate-200" : "border-white shadow-md"
)}
style={{ backgroundColor: c.value }}
aria-label={`Select ${c.name}`}
title={c.name}
>
{qrColor === c.value && <Check className="w-4 h-4 text-white" strokeWidth={3} />}
</button>
))}
</div>
</div>
{/* Frame Selector */}
<div>
<label className="block text-sm font-medium text-slate-700 mb-3">Frame Label</label>
<div className="grid grid-cols-4 gap-2">
{FRAME_OPTIONS.map((frame) => (
<button
key={frame.id}
onClick={() => setFrameType(frame.id)}
className={cn(
"py-2.5 px-3 rounded-lg text-sm font-medium transition-all border",
frameType === frame.id
? "bg-red-600 text-white border-red-600"
: "bg-slate-50 text-slate-600 border-slate-200 hover:border-slate-300"
)}
>
{frame.label}
</button>
))}
</div>
</div>
</div>
</div>
{/* RIGHT: Preview Section */}
<div className="p-8 lg:p-10 flex flex-col items-center justify-center" style={{ backgroundColor: BRAND.paleGrey }}>
{/* QR Card with Frame */}
<div
ref={qrRef}
className="bg-white rounded-3xl shadow-xl p-8 flex flex-col items-center"
style={{ minWidth: '320px' }}
>
{/* Frame Label */}
{getFrameLabel() && (
<div
className="mb-5 px-8 py-2.5 rounded-full text-white font-bold text-sm tracking-widest uppercase shadow-md"
style={{ backgroundColor: qrColor }}
>
{getFrameLabel()}
</div>
)}
{/* QR Code */}
<div className="bg-white">
<QRCodeSVG
value={getMailtoUrl() || 'mailto:hello@example.com'}
size={240}
level="M"
includeMargin={false}
fgColor={qrColor}
/>
</div>
{/* Info */}
<div className="mt-6 text-center">
<div className="flex items-center justify-center w-12 h-12 rounded-full bg-red-50 mx-auto mb-3">
<Mail className="w-6 h-6 text-red-600" />
</div>
<h3 className="font-bold text-slate-900 text-lg truncate max-w-[260px] mx-auto">
{formData.email || 'Email QR Code'}
</h3>
</div>
</div>
{/* Download Buttons */}
<div className="flex items-center gap-3 mt-8">
<Button
onClick={() => handleDownload('png')}
className="bg-red-600 hover:bg-red-700 text-white shadow-lg"
>
<Download className="w-4 h-4 mr-2" />
Download PNG
</Button>
<Button
onClick={() => handleDownload('svg')}
variant="outline"
className="border-slate-300 hover:bg-white"
>
<Download className="w-4 h-4 mr-2" />
SVG
</Button>
</div>
<p className="text-xs text-slate-500 mt-4 text-center">
100% free. No signup required.
</p>
</div>
</div>
</div>
{/* Upsell Banner */}
<div className="mt-8 bg-gradient-to-r from-red-600 to-rose-700 rounded-2xl p-6 flex flex-col sm:flex-row items-center justify-between gap-4">
<div className="text-white text-center sm:text-left">
<h3 className="font-bold text-lg">Change your email address often?</h3>
<p className="text-white/80 text-sm mt-1">Dynamic QR Codes allow you to update the recipient without reprinting.</p>
</div>
<Link href="/signup">
<Button className="bg-white text-red-700 hover:bg-slate-100 shrink-0 shadow-lg">
Go Dynamic
</Button>
</Link>
</div>
</div>
);
}

View File

@@ -0,0 +1,273 @@
import React from 'react';
import type { Metadata } from 'next';
import EmailGenerator from './EmailGenerator';
import { Mail, Zap, Smartphone, Lock, Download, Sparkles } from 'lucide-react';
import { QRCodeSVG } from 'qrcode.react';
import { ToolBreadcrumb } from '@/components/seo/BreadcrumbSchema';
// SEO Optimized Metadata
export const metadata: Metadata = {
title: 'Free Email QR Code Generator | Mailto QR | QR Master',
description: 'Create an Email QR code to send emails instantly. Pre-fill subject and body. 100% free and client-side secure.',
keywords: ['email qr code', 'mailto qr', 'email generator', 'free qr code'],
alternates: {
canonical: 'https://qrmaster.io/tools/email-qr-code',
},
openGraph: {
title: 'Free Email QR Code Generator | QR Master',
description: 'Send emails instantly with a custom QR code. Add recipient, subject, and body.',
type: 'website',
url: 'https://qrmaster.io/tools/email-qr-code',
images: [{ url: '/og-email-generator.png', width: 1200, height: 630 }],
},
};
// JSON-LD
const jsonLd = {
'@context': 'https://schema.org',
'@graph': [
{
'@type': 'SoftwareApplication',
name: 'Email QR Code Generator',
applicationCategory: 'UtilitiesApplication',
operatingSystem: 'Web Browser',
offers: { '@type': 'Offer', price: '0', priceCurrency: 'USD' },
description: 'Generate Email QR codes for mailto links with subject and body.',
},
{
'@type': 'HowTo',
name: 'How to Create an Email QR Code',
step: [
{ '@type': 'HowToStep', position: 1, name: 'Enter Recipient', text: 'Type the email address you want to receive emails at.' },
{ '@type': 'HowToStep', position: 2, name: 'Add Details', text: 'Optional: Add a pre-filled subject line and body text.' },
{ '@type': 'HowToStep', position: 3, name: 'Customize', text: 'Choose a brand color and add a call-to-action frame.' },
{ '@type': 'HowToStep', position: 4, name: 'Download', text: 'Download your QR code in PNG or SVG.' },
{ '@type': 'HowToStep', position: 5, name: 'Share', text: 'Add to business cards or flyers.' },
],
totalTime: 'PT30S',
},
{
'@type': 'FAQPage',
mainEntity: [
{
'@type': 'Question',
name: 'How does it work?',
acceptedAnswer: { '@type': 'Answer', text: 'When scanned, it opens the user\'s default email app (like Gmail or Outlook) with a new draft composed to your address.' }
},
{
'@type': 'Question',
name: 'Can I add a subject line?',
acceptedAnswer: { '@type': 'Answer', text: 'Yes! You can pre-fill the subject line and the body content so the sender just has to hit send.' }
},
{
'@type': 'Question',
name: 'Is it free?',
acceptedAnswer: { '@type': 'Answer', text: 'Yes, 100% free with unlimited scans.' }
},
{
'@type': 'Question',
name: 'Does it work with attachments?',
acceptedAnswer: { '@type': 'Answer', text: 'No. The standard mailto format does not support attaching files automatically. Users will have to attach files manually.' }
},
{
'@type': 'Question',
name: 'Is it private?',
acceptedAnswer: { '@type': 'Answer', text: 'Yes. The data is encoded directly into the QR code. We do not store your email or message data.' }
}
]
}
]
};
export default function EmailPage() {
return (
<>
<script
type="application/ld+json"
dangerouslySetInnerHTML={{ __html: JSON.stringify(jsonLd) }}
/>
<ToolBreadcrumb toolName="Email QR Code Generator" toolSlug="email-qr-code" />
<div className="min-h-screen" style={{ backgroundColor: '#EBEBDF' }}>
{/* HERO SECTION */}
<section className="relative pt-20 pb-20 lg:pt-32 lg:pb-32 px-4 sm:px-6 lg:px-8 overflow-hidden" style={{ backgroundColor: '#dc2626' }}>
{/* Background Pattern */}
<div className="absolute inset-0 opacity-10">
<svg className="w-full h-full" viewBox="0 0 100 100" preserveAspectRatio="none">
<path d="M0 100 C 20 0 50 0 100 100 Z" fill="url(#grad1)" />
<defs>
<linearGradient id="grad1" x1="0%" y1="0%" x2="100%" y2="0%">
<stop offset="0%" style={{ stopColor: 'white', stopOpacity: 1 }} />
<stop offset="100%" style={{ stopColor: 'white', stopOpacity: 0 }} />
</linearGradient>
</defs>
</svg>
</div>
<div className="max-w-7xl mx-auto grid lg:grid-cols-2 gap-12 items-center relative z-10">
{/* Left: Text Content */}
<div className="text-center lg:text-left">
<div className="inline-flex items-center gap-2 px-3 py-1 rounded-full bg-white/10 text-white/90 text-sm font-medium mb-6 backdrop-blur-sm border border-white/10 hover:bg-white/20 transition-colors cursor-default">
<span className="flex h-2 w-2 relative">
<span className="animate-ping absolute inline-flex h-full w-full rounded-full bg-red-300 opacity-75"></span>
<span className="relative inline-flex rounded-full h-2 w-2 bg-red-300"></span>
</span>
Free Tool No Signup Required
</div>
<h1 className="text-4xl md:text-5xl lg:text-6xl font-extrabold text-white tracking-tight leading-tight mb-6">
The Smartest Way to <br className="hidden lg:block" />
<span className="text-transparent bg-clip-text bg-gradient-to-r from-red-200 to-rose-200">Receive Emails</span>
</h1>
<p className="text-lg md:text-xl text-red-50 max-w-2xl mx-auto lg:mx-0 mb-8 leading-relaxed">
Create a QR code that opens a pre-composed email instantly.
<strong className="text-white block sm:inline mt-2 sm:mt-0"> Perfect for feedback & inquiries.</strong>
</p>
<div className="flex flex-wrap justify-center lg:justify-start gap-4 text-sm font-medium text-white/80">
<div className="flex items-center gap-2 bg-white/5 px-4 py-2.5 rounded-xl border border-white/5 backdrop-blur-sm">
<Mail className="w-4 h-4 text-red-300" />
Instant Draft
</div>
<div className="flex items-center gap-2 bg-white/5 px-4 py-2.5 rounded-xl border border-white/5 backdrop-blur-sm">
<Zap className="w-4 h-4 text-yellow-300" />
Pre-filled Content
</div>
<div className="flex items-center gap-2 bg-white/5 px-4 py-2.5 rounded-xl border border-white/5 backdrop-blur-sm">
<Smartphone className="w-4 h-4 text-red-300" />
Mobile Ready
</div>
</div>
</div>
{/* Right: Visual Abstract Composition */}
<div className="hidden lg:flex relative items-center justify-center min-h-[400px]">
{/* Decorative Glow */}
<div className="absolute w-[500px] h-[500px] bg-red-500/30 rounded-full blur-[100px] -top-20 -right-20 animate-pulse" />
{/* Floating Glass Card */}
<div className="relative w-80 h-96 bg-white/5 backdrop-blur-xl border border-white/20 rounded-3xl shadow-2xl flex flex-col items-center justify-center p-8 transform rotate-6 hover:rotate-3 transition-all duration-700 group">
<div className="absolute inset-0 bg-gradient-to-br from-white/10 to-transparent rounded-3xl" />
{/* Mock QR */}
<div className="w-48 h-48 bg-white rounded-xl p-2 shadow-inner mb-6 relative overflow-hidden flex items-center justify-center">
<QRCodeSVG value="https://www.qrmaster.net" size={170} fgColor="#b91c1c" level="Q" />
{/* Scan Line */}
<div className="absolute top-1/2 left-0 w-full h-1 bg-red-500 shadow-[0_0_20px_rgba(220,38,38,1)] animate-pulse" />
</div>
<div className="w-full space-y-3">
<div className="h-2 w-32 bg-white/20 rounded-full mx-auto" />
<div className="h-2 w-20 bg-white/10 rounded-full mx-auto" />
</div>
{/* Floating Badge */}
<div className="absolute -bottom-6 -left-6 bg-white py-3 px-5 rounded-xl shadow-xl flex items-center gap-3 transform transition-transform hover:scale-105 duration-300">
<div className="bg-red-100 p-2 rounded-full">
<Mail className="w-5 h-5 text-red-600" />
</div>
<div className="text-left">
<div className="text-[10px] text-slate-400 font-bold uppercase tracking-wider">Status</div>
<div className="text-sm font-bold text-slate-900">Live</div>
</div>
</div>
</div>
</div>
</div>
</section>
{/* GENERATOR SECTION */}
<section className="py-12 px-4 sm:px-6 lg:px-8 -mt-8">
<EmailGenerator />
</section>
{/* HOW IT WORKS */}
<section className="py-16 px-4 sm:px-6 lg:px-8 bg-white">
<div className="max-w-4xl mx-auto">
<h2 className="text-3xl font-bold text-slate-900 text-center mb-12">
How Email QR Codes Work
</h2>
<div className="grid md:grid-cols-3 lg:grid-cols-5 gap-8">
<article className="text-center">
<div className="w-12 h-12 rounded-2xl bg-[#1A1265]/10 flex items-center justify-center mx-auto mb-4">
<Mail className="w-6 h-6 text-[#1A1265]" />
</div>
<h3 className="font-bold text-slate-900 mb-2">1. Add Email</h3>
<p className="text-slate-600 text-xs leading-relaxed">Enter the address and subject.</p>
</article>
<article className="text-center">
<div className="w-12 h-12 rounded-2xl bg-[#1A1265]/10 flex items-center justify-center mx-auto mb-4">
<Sparkles className="w-6 h-6 text-[#1A1265]" />
</div>
<h3 className="font-bold text-slate-900 mb-2">2. Customize</h3>
<p className="text-slate-600 text-xs leading-relaxed">Pick a brand color.</p>
</article>
<article className="text-center">
<div className="w-12 h-12 rounded-2xl bg-[#1A1265]/10 flex items-center justify-center mx-auto mb-4">
<Zap className="w-6 h-6 text-[#1A1265]" />
</div>
<h3 className="font-bold text-slate-900 mb-2">3. Style</h3>
<p className="text-slate-600 text-xs leading-relaxed">Add a cool frame.</p>
</article>
<article className="text-center">
<div className="w-12 h-12 rounded-2xl bg-[#1A1265]/10 flex items-center justify-center mx-auto mb-4">
<Download className="w-6 h-6 text-[#1A1265]" />
</div>
<h3 className="font-bold text-slate-900 mb-2">4. Download</h3>
<p className="text-slate-600 text-xs leading-relaxed">Save your QR code.</p>
</article>
<article className="text-center">
<div className="w-12 h-12 rounded-2xl bg-[#1A1265]/10 flex items-center justify-center mx-auto mb-4">
<Smartphone className="w-6 h-6 text-[#1A1265]" />
</div>
<h3 className="font-bold text-slate-900 mb-2">5. Share</h3>
<p className="text-slate-600 text-xs leading-relaxed">Print and get emails.</p>
</article>
</div>
</div>
</section>
{/* FAQ SECTION */}
<section className="py-16 px-4 sm:px-6 lg:px-8" style={{ backgroundColor: '#EBEBDF' }}>
<div className="max-w-3xl mx-auto">
<h2 className="text-3xl font-bold text-slate-900 text-center mb-4">
Frequently Asked Questions
</h2>
<p className="text-slate-600 text-center mb-10">Common questions about Email QR codes.</p>
<div className="space-y-4">
<FaqItem question="Does it work with Gmail?" answer="Yes, and Outlook, Apple Mail, Yahoo, etc. It opens the default mail app on the user's device." />
<FaqItem question="Is it reversible?" answer="Yes, if you made a mistake you would need to generate a new code, as static QR codes cannot be edited after creation." />
<FaqItem question="Is this tool free?" answer="Yes, completely free to use." />
<FaqItem question="Can I attach files?" answer="No. The mailto standard does not support automatic attachment of files. Users must attach them manually." />
<FaqItem question="Is it private?" answer="Yes. The data is encoded directly into the QR code. We do not store your email or message data." />
</div>
</div>
</section>
</div>
</>
);
}
// FAQ Item Component
function FaqItem({ question, answer }: { question: string; answer: string }) {
return (
<details className="group bg-white rounded-xl shadow-sm border border-slate-200 overflow-hidden">
<summary className="flex items-center justify-between p-5 cursor-pointer list-none text-slate-900 font-semibold hover:bg-slate-50 transition-colors">
{question}
<span className="transition group-open:rotate-180 text-slate-400">
<svg fill="none" height="20" stroke="currentColor" strokeLinecap="round" strokeLinejoin="round" strokeWidth="2" viewBox="0 0 24 24" width="20">
<path d="M6 9l6 6 6-6" />
</svg>
</span>
</summary>
<div className="text-slate-600 px-5 pb-5 pt-0 leading-relaxed text-sm">
{answer}
</div>
</details>
);
}

View File

@@ -0,0 +1,331 @@
'use client';
import React, { useState, useRef } from 'react';
import Link from 'next/link';
import { QRCodeSVG } from 'qrcode.react';
import {
Calendar,
Download,
Check,
Sparkles,
Clock,
MapPin,
AlignLeft
} from 'lucide-react';
import { Button } from '@/components/ui/Button';
import { Input } from '@/components/ui/Input';
import { cn } from '@/lib/utils';
// Brand Colors
const BRAND = {
paleGrey: '#F5F3FF', // Violet-50
primary: '#7C3AED', // Violet-600
primaryDark: '#6D28D9', // Violet-700
};
// QR Color Options
const QR_COLORS = [
{ name: 'Violet', value: '#7C3AED' },
{ name: 'Purple', value: '#9333EA' },
{ name: 'Classic Black', value: '#000000' },
{ name: 'Deep Blue', value: '#1E40AF' },
{ name: 'Pink', value: '#DB2777' },
{ name: 'Emerald', value: '#10B981' },
{ name: 'Rose', value: '#F43F5E' },
];
// Frame Options
const FRAME_OPTIONS = [
{ id: 'none', label: 'No Frame' },
{ id: 'scanme', label: 'Scan Me' },
{ id: 'event', label: 'Event' },
{ id: 'save', label: 'Save Date' },
];
export default function EventGenerator() {
const [title, setTitle] = useState('');
const [location, setLocation] = useState('');
const [description, setDescription] = useState('');
const [startDate, setStartDate] = useState('');
const [endDate, setEndDate] = useState('');
const [qrColor, setQrColor] = useState(BRAND.primary);
const [frameType, setFrameType] = useState('none');
const qrRef = useRef<HTMLDivElement>(null);
// Format Date for iCal: YYYYMMDDTHHMMSS
const formatDate = (dateString: string) => {
if (!dateString) return '';
const d = new Date(dateString);
// Basic formatting, assumes local time for simplicity in this static tool
const year = d.getFullYear();
const month = ('0' + (d.getMonth() + 1)).slice(-2);
const day = ('0' + d.getDate()).slice(-2);
const hours = ('0' + d.getHours()).slice(-2);
const minutes = ('0' + d.getMinutes()).slice(-2);
const seconds = ('0' + d.getSeconds()).slice(-2);
return `${year}${month}${day}T${hours}${minutes}${seconds}`;
};
const qrValue = [
'BEGIN:VEVENT',
`SUMMARY:${title}`,
`LOCATION:${location}`,
`DESCRIPTION:${description}`,
`DTSTART:${formatDate(startDate)}`,
`DTEND:${formatDate(endDate)}`,
'END:VEVENT'
].join('\n');
const handleDownload = async (format: 'png' | 'svg') => {
if (!qrRef.current) return;
try {
if (format === 'png') {
const { toPng } = await import('html-to-image');
const dataUrl = await toPng(qrRef.current, { cacheBust: true, pixelRatio: 3 });
const link = document.createElement('a');
link.download = `event-qr-code.png`;
link.href = dataUrl;
link.click();
} else {
const svgData = qrRef.current.querySelector('svg')?.outerHTML;
if (svgData) {
const blob = new Blob([svgData], { type: 'image/svg+xml;charset=utf-8' });
const url = URL.createObjectURL(blob);
const link = document.createElement('a');
link.href = url;
link.download = `event-qr-code.svg`;
link.click();
}
}
} catch (err) {
console.error('Download failed', err);
}
};
const getFrameLabel = () => {
const frame = FRAME_OPTIONS.find(f => f.id === frameType);
return frame?.id !== 'none' ? frame?.label : null;
};
return (
<div className="w-full max-w-5xl mx-auto px-4 md:px-6">
{/* Main Generator Card */}
<div className="bg-white rounded-3xl shadow-2xl shadow-slate-900/10 overflow-hidden border border-slate-100">
<div className="grid lg:grid-cols-2">
{/* LEFT: Input Section */}
<div className="p-8 lg:p-10 space-y-8 border-r border-slate-100">
{/* Event Details */}
<div className="space-y-6">
<h2 className="text-lg font-bold text-slate-900 flex items-center gap-2">
<Calendar className="w-5 h-5 text-[#7C3AED]" />
Event Details
</h2>
<div className="space-y-4">
<div>
<label className="block text-sm font-medium text-slate-700 mb-2">Event Title</label>
<Input
placeholder="Summer Party"
value={title}
onChange={(e) => setTitle(e.target.value)}
className="h-12 text-base rounded-xl border-slate-200 focus:border-[#7C3AED] focus:ring-[#7C3AED]"
/>
</div>
<div className="grid grid-cols-2 gap-4">
<div>
<label className="block text-sm font-medium text-slate-700 mb-2">Start Time</label>
<div className="relative">
<Input
type="datetime-local"
value={startDate}
onChange={(e) => setStartDate(e.target.value)}
className="h-12 text-sm rounded-xl border-slate-200 focus:border-[#1A1265] focus:ring-[#1A1265]"
/>
</div>
</div>
<div>
<label className="block text-sm font-medium text-slate-700 mb-2">End Time</label>
<div className="relative">
<Input
type="datetime-local"
value={endDate}
onChange={(e) => setEndDate(e.target.value)}
className="h-12 text-sm rounded-xl border-slate-200 focus:border-[#7C3AED] focus:ring-[#7C3AED]"
/>
</div>
</div>
</div>
<div>
<label className="block text-sm font-medium text-slate-700 mb-2">Location</label>
<div className="relative">
<MapPin className="absolute left-3 top-3.5 w-5 h-5 text-slate-400" />
<Input
placeholder="123 Main St, New York"
value={location}
onChange={(e) => setLocation(e.target.value)}
className="pl-10 h-12 text-base rounded-xl border-slate-200 focus:border-[#1A1265] focus:ring-[#1A1265]"
/>
</div>
</div>
<div>
<label className="block text-sm font-medium text-slate-700 mb-2">Description</label>
<textarea
className="w-full h-24 p-4 border border-slate-200 rounded-xl focus:outline-none focus:ring-2 focus:ring-[#1A1265] resize-none text-slate-800 placeholder:text-slate-400"
placeholder="Join us for a celebration..."
value={description}
onChange={(e) => setDescription(e.target.value)}
/>
</div>
</div>
</div>
<div className="border-t border-slate-100"></div>
{/* Design Options */}
<div className="space-y-6">
<h2 className="text-lg font-bold text-slate-900 flex items-center gap-2">
<Sparkles className="w-5 h-5 text-[#7C3AED]" />
Design Options
</h2>
{/* Color Picker */}
<div>
<label className="block text-sm font-medium text-slate-700 mb-3">QR Code Color</label>
<div className="flex flex-wrap gap-2">
{QR_COLORS.map((c) => (
<button
key={c.name}
onClick={() => setQrColor(c.value)}
className={cn(
"w-9 h-9 rounded-full border-2 flex items-center justify-center transition-all hover:scale-110",
qrColor === c.value ? "border-slate-900 ring-2 ring-offset-2 ring-slate-200" : "border-white shadow-md"
)}
style={{ backgroundColor: c.value }}
aria-label={`Select ${c.name}`}
title={c.name}
>
{qrColor === c.value && <Check className="w-4 h-4 text-white" strokeWidth={3} />}
</button>
))}
</div>
</div>
{/* Frame Selector */}
<div>
<label className="block text-sm font-medium text-slate-700 mb-3">Frame Label</label>
<div className="grid grid-cols-4 gap-2">
{FRAME_OPTIONS.map((frame) => (
<button
key={frame.id}
onClick={() => setFrameType(frame.id)}
className={cn(
"py-2.5 px-3 rounded-lg text-sm font-medium transition-all border",
frameType === frame.id
? "bg-[#7C3AED] text-white border-[#7C3AED]"
: "bg-slate-50 text-slate-600 border-slate-200 hover:border-slate-300"
)}
>
{frame.label}
</button>
))}
</div>
</div>
</div>
</div>
{/* RIGHT: Preview Section */}
<div className="p-8 lg:p-10 flex flex-col items-center justify-center" style={{ backgroundColor: BRAND.paleGrey }}>
{/* QR Card with Frame */}
<div
ref={qrRef}
className="bg-white rounded-3xl shadow-xl p-8 flex flex-col items-center"
style={{ minWidth: '320px' }}
>
{/* Frame Label */}
{getFrameLabel() && (
<div
className="mb-5 px-8 py-2.5 rounded-full text-white font-bold text-sm tracking-widest uppercase shadow-md"
style={{ backgroundColor: qrColor }}
>
{getFrameLabel()}
</div>
)}
{/* QR Code */}
<div className="bg-white">
<QRCodeSVG
value={(title || startDate) ? qrValue : "Title"}
size={240}
level="M"
includeMargin={false}
fgColor={qrColor}
/>
</div>
{/* Info Preview */}
<div className="mt-6 text-center max-w-[260px]">
<h3 className="font-bold text-slate-900 text-lg flex items-center justify-center gap-2 truncate">
<Calendar className="w-4 h-4 text-[#7C3AED] shrink-0" />
<span className="truncate">{title || 'Event Title'}</span>
</h3>
{(startDate) && (
<div className="text-xs text-slate-500 mt-1 flex items-center justify-center gap-1">
<Clock className="w-3 h-3" />
{new Date(startDate).toLocaleDateString()}
</div>
)}
</div>
</div>
{/* Download Buttons */}
<div className="flex items-center gap-3 mt-8">
<Button
onClick={() => handleDownload('png')}
className="bg-[#7C3AED] hover:bg-[#6D28D9] text-white shadow-lg"
>
<Download className="w-4 h-4 mr-2" />
Download PNG
</Button>
<Button
onClick={() => handleDownload('svg')}
variant="outline"
className="border-slate-300 hover:bg-white"
>
<Download className="w-4 h-4 mr-2" />
SVG
</Button>
</div>
<p className="text-xs text-slate-500 mt-4 text-center">
Scanning adds the event to the user's calendar.
</p>
</div>
</div>
</div>
{/* Upsell Banner */}
<div className="mt-8 bg-gradient-to-r from-[#7C3AED] to-[#6D28D9] rounded-2xl p-6 flex flex-col sm:flex-row items-center justify-between gap-4">
<div className="text-white text-center sm:text-left">
<h3 className="font-bold text-lg">Planning a big event?</h3>
<p className="text-white/80 text-sm mt-1">
Use a Dynamic QR Code to track RSVPs and update event details if the schedule changes.
</p>
</div>
<Link href="/signup">
<Button className="bg-white text-[#7C3AED] hover:bg-slate-100 shrink-0 shadow-lg">
Get Dynamic Events
</Button>
</Link>
</div>
</div>
);
}

View File

@@ -0,0 +1,353 @@
import React from 'react';
import type { Metadata } from 'next';
import EventGenerator from './EventGenerator';
import { Calendar, Shield, Zap, Smartphone, Clock, UserCheck, Download, Share2, Check } from 'lucide-react';
import { QRCodeSVG } from 'qrcode.react';
import { ToolBreadcrumb } from '@/components/seo/BreadcrumbSchema';
// SEO Optimized Metadata
export const metadata: Metadata = {
title: 'Free Event QR Code Generator | Add to Calendar | QR Master',
description: 'Create a QR code for your event. Scanners can instantly save the date, time, and location to their phone calendar. Perfect for invitations and flyers.',
keywords: ['event qr code', 'calendar qr code', 'save the date qr', 'ical qr generator', 'invitation qr code'],
alternates: {
canonical: 'https://qrmaster.io/tools/event-qr-code',
},
openGraph: {
title: 'Free Event QR Code Generator | QR Master',
description: 'Generate QR codes to save events to calendars. Share dates easily.',
type: 'website',
url: 'https://qrmaster.io/tools/event-qr-code',
images: [{ url: '/og-event-generator.png', width: 1200, height: 630 }],
},
twitter: {
card: 'summary_large_image',
title: 'Free Event QR Code Generator',
description: 'Create QR codes for events. Instant save-to-calendar.',
},
robots: {
index: true,
follow: true,
},
};
// JSON-LD Structured Data
const jsonLd = {
'@context': 'https://schema.org',
'@graph': [
{
'@type': 'SoftwareApplication',
name: 'Event QR Code Generator',
applicationCategory: 'UtilitiesApplication',
operatingSystem: 'Web Browser',
offers: {
'@type': 'Offer',
price: '0',
priceCurrency: 'USD',
},
aggregateRating: {
'@type': 'AggregateRating',
ratingValue: '4.8',
ratingCount: '760',
},
description: 'Generate QR codes that add event details to the user\'s digital calendar.',
},
{
'@type': 'HowTo',
name: 'How to Create an Event QR Code',
description: 'Create a QR code that saves an event to a calendar.',
step: [
{
'@type': 'HowToStep',
position: 1,
name: 'Enter Event Details',
text: 'Fill in the Event Title, Location, Description, Start Time, and End Time.',
},
{
'@type': 'HowToStep',
position: 2,
name: 'Customize',
text: 'Choose a color and frame style like "Save the Date".',
},
{
'@type': 'HowToStep',
position: 3,
name: 'Download',
text: 'Save the QR code and add it to your invitations.',
},
{
'@type': 'HowToStep',
position: 4,
name: 'Test',
text: 'Scan the code to ensure the event details and times are correct.',
},
{
'@type': 'HowToStep',
position: 5,
name: 'Share',
text: 'Distribute it via email, flyers, or social media.',
},
],
totalTime: 'PT45S',
},
{
'@type': 'FAQPage',
mainEntity: [
{
'@type': 'Question',
name: 'Which calendars does it support?',
acceptedAnswer: {
'@type': 'Answer',
text: 'The QR code uses the standard iCalendar (ICS) format. It works with Apple Calendar, Google Calendar, Outlook, and most other mobile calendar apps.',
},
},
{
'@type': 'Question',
name: 'Can I change the date after printing?',
acceptedAnswer: {
'@type': 'Answer',
text: 'No. This is a static QR code, meaning the event details are permanently embedded in the image. If the date changes, you must create a new QR code. Use our Dynamic QR Code to edit events anytime.',
},
},
{
'@type': 'Question',
name: 'Is there a limit to the description length?',
acceptedAnswer: {
'@type': 'Answer',
text: 'Yes, because the data is stored in the QR code pattern. We recommend keeping descriptions concise (under 300 characters) to ensure the code remains easy to scan.',
},
},
{
'@type': 'Question',
name: 'Do users need an app?',
acceptedAnswer: {
'@type': 'Answer',
text: 'No special app is needed. Standard camera apps on iOS and Android can read the code and will prompt the user to "Add to Calendar".',
},
},
{
'@type': 'Question',
name: 'Is it free?',
acceptedAnswer: {
'@type': 'Answer',
text: 'Yes. Creating and scanning the code is completely free and requires no signup.',
},
},
],
},
],
};
export default function EventQRCodePage() {
return (
<>
<script
type="application/ld+json"
dangerouslySetInnerHTML={{ __html: JSON.stringify(jsonLd) }}
/>
<ToolBreadcrumb toolName="Event QR Code Generator" toolSlug="event-qr-code" />
<div className="min-h-screen" style={{ backgroundColor: '#EBEBDF' }}>
{/* HERO SECTION */}
<section className="relative pt-20 pb-20 lg:pt-32 lg:pb-32 px-4 sm:px-6 lg:px-8 overflow-hidden" style={{ backgroundColor: '#5B21B6' }}>
<div className="absolute inset-0 opacity-10">
<svg className="w-full h-full" viewBox="0 0 100 100" preserveAspectRatio="none">
<path d="M0 100 C 20 0 50 0 100 100 Z" fill="url(#grad1)" />
<defs>
<linearGradient id="grad1" x1="0%" y1="0%" x2="100%" y2="0%">
<stop offset="0%" style={{ stopColor: 'white', stopOpacity: 1 }} />
<stop offset="100%" style={{ stopColor: 'white', stopOpacity: 0 }} />
</linearGradient>
</defs>
</svg>
</div>
<div className="max-w-7xl mx-auto grid lg:grid-cols-2 gap-12 items-center relative z-10">
<div className="text-center lg:text-left">
<div className="inline-flex items-center gap-2 px-3 py-1 rounded-full bg-white/10 text-white/90 text-sm font-medium mb-6 backdrop-blur-sm border border-white/10 hover:bg-white/20 transition-colors cursor-default">
<span className="flex h-2 w-2 relative">
<span className="animate-ping absolute inline-flex h-full w-full rounded-full bg-violet-400 opacity-75"></span>
<span className="relative inline-flex rounded-full h-2 w-2 bg-violet-400"></span>
</span>
Free Tool No Signup Required
</div>
<h1 className="text-4xl md:text-5xl lg:text-6xl font-extrabold text-white tracking-tight leading-tight mb-6">
Create Scannable <br className="hidden lg:block" />
<span className="text-transparent bg-clip-text bg-gradient-to-r from-violet-300 to-fuchsia-300">Calendar Invites</span>
</h1>
<p className="text-lg md:text-xl text-indigo-100 max-w-2xl mx-auto lg:mx-0 mb-8 leading-relaxed">
Share your event details instantly. Visitors scan to "Save the Date" directly to their phone calendar.
<strong className="text-white block sm:inline mt-2 sm:mt-0"> Perfect for invitations.</strong>
</p>
<div className="flex flex-wrap justify-center lg:justify-start gap-4 text-sm font-medium text-white/80">
<div className="flex items-center gap-2 bg-white/5 px-4 py-2.5 rounded-xl border border-white/5 backdrop-blur-sm">
<Calendar className="w-4 h-4 text-violet-300" />
Instant Save
</div>
<div className="flex items-center gap-2 bg-white/5 px-4 py-2.5 rounded-xl border border-white/5 backdrop-blur-sm">
<Clock className="w-4 h-4 text-amber-400" />
Timezone Smart
</div>
<div className="flex items-center gap-2 bg-white/5 px-4 py-2.5 rounded-xl border border-white/5 backdrop-blur-sm">
<UserCheck className="w-4 h-4 text-purple-400" />
Native Support
</div>
</div>
</div>
{/* Visual Abstract */}
<div className="hidden lg:flex relative items-center justify-center min-h-[400px]">
<div className="absolute w-[500px] h-[500px] bg-indigo-500/30 rounded-full blur-[100px] -top-20 -right-20 animate-pulse" />
<div className="relative w-80 h-96 bg-white/5 backdrop-blur-xl border border-white/20 rounded-3xl shadow-2xl flex flex-col items-center justify-center p-8 transform -rotate-2 hover:rotate-1 transition-all duration-700 group">
<div className="absolute inset-0 bg-gradient-to-br from-white/10 to-transparent rounded-3xl" />
<div className="w-full bg-white rounded-xl shadow-lg p-4 mb-6 relative overflow-hidden flex flex-col items-center text-center">
<div className="w-full h-2 bg-red-500 rounded-full mb-3" />
<div className="text-xs uppercase font-bold text-red-500 tracking-widest mb-1">DECEMBER</div>
<div className="text-4xl font-black text-slate-900 leading-none mb-1">25</div>
<div className="text-xs text-slate-400">Saturday 8:00 PM</div>
</div>
<div className="w-44 h-44 bg-white rounded-xl p-2 shadow-inner relative overflow-hidden flex items-center justify-center">
<QRCodeSVG value="https://www.qrmaster.net" size={160} fgColor="#0f172a" level="Q" />
</div>
{/* Floating Badge */}
<div className="absolute -bottom-6 -left-6 bg-white py-3 px-5 rounded-xl shadow-xl flex items-center gap-3 transform transition-transform hover:scale-105 duration-300">
<div className="bg-emerald-100 p-2 rounded-full">
<Check className="w-5 h-5 text-emerald-600" />
</div>
<div className="text-left">
<div className="text-[10px] text-slate-400 font-bold uppercase tracking-wider">Event</div>
<div className="text-sm font-bold text-slate-900">Added to Cal</div>
</div>
</div>
</div>
</div>
</div>
</section>
{/* GENERATOR SECTION */}
<section className="py-12 px-4 sm:px-6 lg:px-8 -mt-8">
<EventGenerator />
</section>
{/* HOW IT WORKS */}
<section className="py-16 px-4 sm:px-6 lg:px-8 bg-white">
<div className="max-w-4xl mx-auto">
<h2 className="text-3xl font-bold text-slate-900 text-center mb-12">
How Event QR Codes Work
</h2>
<div className="grid md:grid-cols-3 lg:grid-cols-5 gap-8">
<article className="text-center">
<div className="w-14 h-14 rounded-2xl bg-[#1A1265]/10 flex items-center justify-center mx-auto mb-4">
<Calendar className="w-7 h-7 text-[#1A1265]" />
</div>
<h3 className="font-bold text-slate-900 mb-2">1. Set Details</h3>
<p className="text-slate-600 text-sm">
Enter the event name, location, and start/end times.
</p>
</article>
<article className="text-center">
<div className="w-14 h-14 rounded-2xl bg-[#1A1265]/10 flex items-center justify-center mx-auto mb-4">
<Smartphone className="w-7 h-7 text-[#1A1265]" />
</div>
<h3 className="font-bold text-slate-900 mb-2">2. Scan</h3>
<p className="text-slate-600 text-sm">
Guests scan the code from your invite, poster, or flyer.
</p>
</article>
<article className="text-center">
<div className="w-12 h-12 rounded-2xl bg-[#1A1265]/10 flex items-center justify-center mx-auto mb-4">
<Clock className="w-6 h-6 text-[#1A1265]" />
</div>
<h3 className="font-bold text-slate-900 mb-2">3. Download</h3>
<p className="text-slate-600 text-xs leading-relaxed">
Save your event QR code.
</p>
</article>
<article className="text-center">
<div className="w-12 h-12 rounded-2xl bg-[#1A1265]/10 flex items-center justify-center mx-auto mb-4">
<Smartphone className="w-6 h-6 text-[#1A1265]" />
</div>
<h3 className="font-bold text-slate-900 mb-2">4. Scan</h3>
<p className="text-slate-600 text-xs leading-relaxed">
Guests scan the code.
</p>
</article>
<article className="text-center">
<div className="w-12 h-12 rounded-2xl bg-[#1A1265]/10 flex items-center justify-center mx-auto mb-4">
<UserCheck className="w-6 h-6 text-[#1A1265]" />
</div>
<h3 className="font-bold text-slate-900 mb-2">5. Save</h3>
<p className="text-slate-600 text-xs leading-relaxed">
They tap "Add to Calendar."
</p>
</article>
</div>
</div>
</section>
{/* FAQ SECTION */}
<section className="py-16 px-4 sm:px-6 lg:px-8" style={{ backgroundColor: '#EBEBDF' }}>
<div className="max-w-3xl mx-auto">
<h2 className="text-3xl font-bold text-slate-900 text-center mb-4">
Frequently Asked Questions
</h2>
<p className="text-slate-600 text-center mb-10">
Common questions about Event QR codes.
</p>
<div className="space-y-4">
<FaqItem
question="Does this work with Google Calendar?"
answer="Yes, the generated QR code creates a standard .ics file event, which is compatible with Google Calendar, Apple Calendar, Outlook, and most others."
/>
<FaqItem
question="Is the QR code reusable?"
answer="No. Because the specific date and time are embedded in the code, you cannot change them later. If the event is rescheduled, you must generate a new QR code."
/>
<FaqItem
question="What happens if the event is in a different time zone?"
answer="The user's calendar will usually convert the time to their local time zone automatically when they save it."
/>
<FaqItem
question="Is it free?"
answer="Yes. Creating and scanning the code is completely free."
/>
</div>
</div>
</section>
</div>
</>
);
}
function FaqItem({ question, answer }: { question: string; answer: string }) {
return (
<details className="group bg-white rounded-xl shadow-sm border border-slate-200 overflow-hidden">
<summary className="flex items-center justify-between p-5 cursor-pointer list-none text-slate-900 font-semibold hover:bg-slate-50 transition-colors">
{question}
<span className="transition group-open:rotate-180 text-slate-400">
<svg fill="none" height="20" stroke="currentColor" strokeLinecap="round" strokeLinejoin="round" strokeWidth="2" viewBox="0 0 24 24" width="20">
<path d="M6 9l6 6 6-6" />
</svg>
</span>
</summary>
<div className="text-slate-600 px-5 pb-5 pt-0 leading-relaxed text-sm">
{answer}
</div>
</details>
);
}

View File

@@ -0,0 +1,248 @@
'use client';
import React, { useState, useRef } from 'react';
import Link from 'next/link';
import { QRCodeSVG } from 'qrcode.react';
import {
Facebook,
Download,
Check,
Sparkles,
ThumbsUp,
Globe
} from 'lucide-react';
import { Button } from '@/components/ui/Button';
import { Input } from '@/components/ui/Input';
import { cn } from '@/lib/utils';
// Brand Colors
const BRAND = {
paleGrey: '#EBEBDF',
richBlue: '#1A1265',
richBlueLight: '#2A2275',
};
// QR Color Options - Facebook Theme
const QR_COLORS = [
{ name: 'Facebook Blue', value: '#1877F2' },
{ name: 'Classic Black', value: '#000000' },
{ name: 'Dark Blue', value: '#1A1265' },
{ name: 'Teal', value: '#0D9488' },
{ name: 'Coral', value: '#F43F5E' },
{ name: 'Purple', value: '#7C3AED' },
{ name: 'Emerald', value: '#10B981' },
{ name: 'Rose', value: '#F43F5E' },
];
// Frame Options
const FRAME_OPTIONS = [
{ id: 'none', label: 'No Frame' },
{ id: 'scanme', label: 'Scan Me' },
{ id: 'follow', label: 'Follow Us' },
{ id: 'like', label: 'Like Us' },
];
export default function FacebookGenerator() {
const [url, setUrl] = useState('');
const [qrColor, setQrColor] = useState('#1877F2'); // Default to FB Blue
const [frameType, setFrameType] = useState('none');
const qrRef = useRef<HTMLDivElement>(null);
const handleDownload = async (format: 'png' | 'svg') => {
if (!qrRef.current) return;
try {
if (format === 'png') {
const { toPng } = await import('html-to-image');
const dataUrl = await toPng(qrRef.current, { cacheBust: true, pixelRatio: 3 });
const link = document.createElement('a');
link.download = `facebook-qr-code.png`;
link.href = dataUrl;
link.click();
} else {
const svgData = qrRef.current.querySelector('svg')?.outerHTML;
if (svgData) {
const blob = new Blob([svgData], { type: 'image/svg+xml;charset=utf-8' });
const url = URL.createObjectURL(blob);
const link = document.createElement('a');
link.href = url;
link.download = `facebook-qr-code.svg`;
link.click();
}
}
} catch (err) {
console.error('Download failed', err);
}
};
const getFrameLabel = () => {
const frame = FRAME_OPTIONS.find(f => f.id === frameType);
return frame?.id !== 'none' ? frame?.label : null;
};
return (
<div className="w-full max-w-5xl mx-auto px-4 md:px-6">
{/* Main Generator Card */}
<div className="bg-white rounded-3xl shadow-2xl shadow-slate-900/10 overflow-hidden border border-slate-100">
<div className="grid lg:grid-cols-2">
{/* LEFT: Input Section */}
<div className="p-8 lg:p-10 space-y-8 border-r border-slate-100">
{/* Facebook Details */}
<div className="space-y-6">
<h2 className="text-lg font-bold text-slate-900 flex items-center gap-2">
<Facebook className="w-5 h-5 text-[#1877F2]" />
Facebook Page or Profile
</h2>
<div>
<label className="block text-sm font-medium text-slate-700 mb-2">Facebook URL</label>
<Input
placeholder="https://facebook.com/yourpage"
value={url}
onChange={(e) => setUrl(e.target.value)}
className="h-12 text-base rounded-xl border-slate-200 focus:border-[#1877F2] focus:ring-[#1877F2]"
/>
<p className="text-xs text-slate-500 mt-2">Paste the full link to your profile, page, group, or post.</p>
</div>
</div>
<div className="border-t border-slate-100"></div>
{/* Design Options */}
<div className="space-y-6">
<h2 className="text-lg font-bold text-slate-900 flex items-center gap-2">
<Sparkles className="w-5 h-5 text-[#1877F2]" />
Design Options
</h2>
{/* Color Picker */}
<div>
<label className="block text-sm font-medium text-slate-700 mb-3">QR Code Color</label>
<div className="flex flex-wrap gap-2">
{QR_COLORS.map((c) => (
<button
key={c.name}
onClick={() => setQrColor(c.value)}
className={cn(
"w-9 h-9 rounded-full border-2 flex items-center justify-center transition-all hover:scale-110",
qrColor === c.value ? "border-slate-900 ring-2 ring-offset-2 ring-slate-200" : "border-white shadow-md"
)}
style={{ backgroundColor: c.value }}
aria-label={`Select ${c.name}`}
title={c.name}
>
{qrColor === c.value && <Check className="w-4 h-4 text-white" strokeWidth={3} />}
</button>
))}
</div>
</div>
{/* Frame Selector */}
<div>
<label className="block text-sm font-medium text-slate-700 mb-3">Frame Label</label>
<div className="grid grid-cols-4 gap-2">
{FRAME_OPTIONS.map((frame) => (
<button
key={frame.id}
onClick={() => setFrameType(frame.id)}
className={cn(
"py-2.5 px-3 rounded-lg text-sm font-medium transition-all border",
frameType === frame.id
? "bg-[#1877F2] text-white border-[#1877F2]"
: "bg-slate-50 text-slate-600 border-slate-200 hover:border-slate-300"
)}
>
{frame.label}
</button>
))}
</div>
</div>
</div>
</div>
{/* RIGHT: Preview Section */}
<div className="p-8 lg:p-10 flex flex-col items-center justify-center" style={{ backgroundColor: BRAND.paleGrey }}>
{/* QR Card with Frame */}
<div
ref={qrRef}
className="bg-white rounded-3xl shadow-xl p-8 flex flex-col items-center"
style={{ minWidth: '320px' }}
>
{/* Frame Label */}
{getFrameLabel() && (
<div
className="mb-5 px-8 py-2.5 rounded-full text-white font-bold text-sm tracking-widest uppercase shadow-md"
style={{ backgroundColor: qrColor }}
>
{getFrameLabel()}
</div>
)}
{/* QR Code */}
<div className="bg-white">
<QRCodeSVG
value={url || "https://facebook.com"}
size={240}
level="M"
includeMargin={false}
fgColor={qrColor}
/>
</div>
{/* Info Preview */}
<div className="mt-6 text-center max-w-[260px]">
<h3 className="font-bold text-slate-900 text-lg flex items-center justify-center gap-2 truncate">
<Facebook className="w-4 h-4 text-slate-400 shrink-0" />
<span className="truncate">{url ? url.replace('https://', '') : 'facebook.com/...'}</span>
</h3>
<div className="text-xs text-slate-500 mt-1">Opens in Facebook App</div>
</div>
</div>
{/* Download Buttons */}
<div className="flex items-center gap-3 mt-8">
<Button
onClick={() => handleDownload('png')}
className="bg-[#1877F2] hover:bg-[#155ebd] text-white shadow-lg"
>
<Download className="w-4 h-4 mr-2" />
Download PNG
</Button>
<Button
onClick={() => handleDownload('svg')}
variant="outline"
className="border-slate-300 hover:bg-white"
>
<Download className="w-4 h-4 mr-2" />
SVG
</Button>
</div>
<p className="text-xs text-slate-500 mt-4 text-center">
Scanning redirects directly to the Facebook profile or page.
</p>
</div>
</div>
</div>
{/* Upsell Banner */}
<div className="mt-8 bg-gradient-to-r from-[#1877F2] to-[#155ebd] rounded-2xl p-6 flex flex-col sm:flex-row items-center justify-between gap-4">
<div className="text-white text-center sm:text-left">
<h3 className="font-bold text-lg">Running a Social Media Campaign?</h3>
<p className="text-white/80 text-sm mt-1">
Dynamic QR Codes allow you to track clicks, likes, and engagement rates in real-time.
</p>
</div>
<Link href="/signup">
<Button className="bg-white text-[#1877F2] hover:bg-slate-100 shrink-0 shadow-lg">
Get Social Analytics
</Button>
</Link>
</div>
</div>
);
}

View File

@@ -0,0 +1,365 @@
import React from 'react';
import type { Metadata } from 'next';
import FacebookGenerator from './FacebookGenerator';
import { Facebook, Shield, Zap, Smartphone, ThumbsUp, Users, Download, Share2 } from 'lucide-react';
import { QRCodeSVG } from 'qrcode.react';
import { ToolBreadcrumb } from '@/components/seo/BreadcrumbSchema';
// SEO Optimized Metadata
export const metadata: Metadata = {
title: 'Free Facebook QR Code Generator | Get Likes & Follows | QR Master',
description: 'Create a QR code for your Facebook Page, Profile, or Group. Scanners are redirected to the Facebook app instantly to like and follow. Free & Easy.',
keywords: ['facebook qr code', 'fb qr generator', 'facebook page qr', 'follow qr code', 'social media qr code'],
alternates: {
canonical: 'https://qrmaster.io/tools/facebook-qr-code',
},
openGraph: {
title: 'Free Facebook QR Code Generator | QR Master',
description: 'Generate QR codes to grow your Facebook audience. Instant app redirect.',
type: 'website',
url: 'https://qrmaster.io/tools/facebook-qr-code',
images: [{ url: '/og-facebook-generator.png', width: 1200, height: 630 }],
},
twitter: {
card: 'summary_large_image',
title: 'Free Facebook QR Code Generator',
description: 'Create QR codes for Facebook. Boost your engagement.',
},
robots: {
index: true,
follow: true,
},
};
// JSON-LD Structured Data
const jsonLd = {
'@context': 'https://schema.org',
'@graph': [
{
'@type': 'SoftwareApplication',
name: 'Facebook QR Code Generator',
applicationCategory: 'UtilitiesApplication',
operatingSystem: 'Web Browser',
offers: {
'@type': 'Offer',
price: '0',
priceCurrency: 'USD',
},
aggregateRating: {
'@type': 'AggregateRating',
ratingValue: '4.8',
ratingCount: '1120',
},
description: 'Generate QR codes that direct users to a Facebook page, profile, or post.',
},
{
'@type': 'HowTo',
name: 'How to Create a Facebook QR Code',
description: 'Create a QR code that opens a Facebook page.',
step: [
{
'@type': 'HowToStep',
position: 1,
name: 'Get Link',
text: 'Copy the URL of your Facebook Page, Profile, or Group.',
},
{
'@type': 'HowToStep',
position: 2,
name: 'Paste Link',
text: 'Paste the URL into the generator.',
},
{
'@type': 'HowToStep',
position: 3,
name: 'Customize',
text: 'Choose your brand color and add a call-to-action frame.',
},
{
'@type': 'HowToStep',
position: 4,
name: 'Download',
text: 'Save the QR code and print it on your marketing materials.',
},
{
'@type': 'HowToStep',
position: 5,
name: 'Share',
text: 'Distribute it on flyers, business cards, or posters.',
},
],
totalTime: 'PT30S',
},
{
'@type': 'FAQPage',
mainEntity: [
{
'@type': 'Question',
name: 'Does it open the Facebook app?',
acceptedAnswer: {
'@type': 'Answer',
text: 'Yes! On most mobile devices, standard Facebook links are automatically detected and opened in the Facebook app if it is installed.',
},
},
{
'@type': 'Question',
name: 'Can I link to a specific post?',
acceptedAnswer: {
'@type': 'Answer',
text: 'Absolutely. Just paste the direct link to the post (click the timestamp on the post to get the link).',
},
},
{
'@type': 'Question',
name: 'Does it work for Facebook Events?',
acceptedAnswer: {
'@type': 'Answer',
text: 'Yes. Simply copy the full URL of your Facebook Event and paste it into the generator.',
},
},
{
'@type': 'Question',
name: 'Is it free?',
acceptedAnswer: {
'@type': 'Answer',
text: 'Yes, this generator is 100% free to use for personal or business purposes.',
},
},
{
'@type': 'Question',
name: 'Can I track scans?',
acceptedAnswer: {
'@type': 'Answer',
text: 'This static QR code does not include analytics. To track how many people scan your code, you should use our Dynamic QR Code service.',
},
},
],
},
],
};
export default function FacebookQRCodePage() {
return (
<>
<script
type="application/ld+json"
dangerouslySetInnerHTML={{ __html: JSON.stringify(jsonLd) }}
/>
<ToolBreadcrumb toolName="Facebook QR Code Generator" toolSlug="facebook-qr-code" />
<div className="min-h-screen" style={{ backgroundColor: '#EBEBDF' }}>
{/* HERO SECTION */}
<section className="relative pt-20 pb-20 lg:pt-32 lg:pb-32 px-4 sm:px-6 lg:px-8 overflow-hidden" style={{ backgroundColor: '#1877F2' }}>
<div className="absolute inset-0 opacity-10">
{/* Facebook Pattern */}
<svg className="w-full h-full" width="100%" height="100%" xmlns="http://www.w3.org/2000/svg">
<defs>
<pattern id="fb_pattern" width="60" height="60" patternUnits="userSpaceOnUse">
<path d="M30 30L35 35M25 35L30 30" stroke="white" strokeWidth="2" strokeOpacity="0.2" />
</pattern>
</defs>
<rect width="100%" height="100%" fill="url(#fb_pattern)" />
</svg>
</div>
<div className="max-w-7xl mx-auto grid lg:grid-cols-2 gap-12 items-center relative z-10">
<div className="text-center lg:text-left">
<div className="inline-flex items-center gap-2 px-3 py-1 rounded-full bg-white/10 text-white/90 text-sm font-medium mb-6 backdrop-blur-sm border border-white/10 hover:bg-white/20 transition-colors cursor-default">
<span className="flex h-2 w-2 relative">
<span className="animate-ping absolute inline-flex h-full w-full rounded-full bg-blue-300 opacity-75"></span>
<span className="relative inline-flex rounded-full h-2 w-2 bg-blue-300"></span>
</span>
Free Tool No Signup Required
</div>
<h1 className="text-4xl md:text-5xl lg:text-6xl font-extrabold text-white tracking-tight leading-tight mb-6">
Grow Your Audience with <br className="hidden lg:block" />
<span className="text-white drop-shadow-md">Facebook QR Codes</span>
</h1>
<p className="text-lg md:text-xl text-blue-50 max-w-2xl mx-auto lg:mx-0 mb-8 leading-relaxed">
Make it easy for customers to find and follow you. A single scan opens your Page directly in the Facebook app.
<strong className="text-white block sm:inline mt-2 sm:mt-0"> Boost likes instantly.</strong>
</p>
<div className="flex flex-wrap justify-center lg:justify-start gap-4 text-sm font-medium text-white/80">
<div className="flex items-center gap-2 bg-white/10 px-4 py-2.5 rounded-xl border border-white/10 backdrop-blur-sm">
<ThumbsUp className="w-4 h-4 text-blue-200" />
Get Likes
</div>
<div className="flex items-center gap-2 bg-white/10 px-4 py-2.5 rounded-xl border border-white/10 backdrop-blur-sm">
<Zap className="w-4 h-4 text-yellow-300" />
Instant Follow
</div>
<div className="flex items-center gap-2 bg-white/10 px-4 py-2.5 rounded-xl border border-white/10 backdrop-blur-sm">
<Smartphone className="w-4 h-4 text-green-300" />
App Friendly
</div>
</div>
</div>
{/* Visual Abstract */}
<div className="hidden lg:flex relative items-center justify-center min-h-[400px]">
<div className="absolute w-[500px] h-[500px] bg-blue-500/30 rounded-full blur-[100px] -top-20 -right-20 animate-pulse" />
<div className="relative w-80 h-96 bg-white/5 backdrop-blur-xl border border-white/20 rounded-3xl shadow-2xl flex flex-col items-center justify-center p-8 transform rotate-6 hover:rotate-3 transition-all duration-700 group">
<div className="absolute inset-0 bg-gradient-to-br from-white/10 to-transparent rounded-3xl" />
<div className="w-full bg-white rounded-xl shadow-lg p-4 mb-6 relative overflow-hidden flex items-center gap-3">
<div className="w-12 h-12 rounded-full bg-gradient-to-tr from-blue-600 to-blue-400 p-0.5">
<div className="w-full h-full bg-white rounded-full flex items-center justify-center">
<Facebook className="w-6 h-6 text-[#1877F2]" fill="#1877F2" />
</div>
</div>
<div>
<div className="h-2.5 w-24 bg-slate-800 rounded-full mb-1.5" />
<div className="h-2 w-16 bg-slate-300 rounded-full" />
</div>
<button className="ml-auto bg-[#1877F2] text-white px-3 py-1 rounded text-xs font-bold">
Like
</button>
</div>
<div className="w-48 h-48 bg-white rounded-xl p-2 shadow-inner relative overflow-hidden flex items-center justify-center">
<QRCodeSVG value="https://www.qrmaster.net" size={170} fgColor="#1877F2" level="Q" />
</div>
{/* Floating Badge */}
<div className="absolute -bottom-6 -right-6 bg-white py-3 px-5 rounded-xl shadow-xl flex items-center gap-3 transform transition-transform hover:scale-105 duration-300">
<div className="bg-blue-100 p-2 rounded-full">
<Users className="w-5 h-5 text-blue-600" />
</div>
<div className="text-left">
<div className="text-[10px] text-slate-400 font-bold uppercase tracking-wider">Followers</div>
<div className="text-sm font-bold text-slate-900">+1 New</div>
</div>
</div>
</div>
</div>
</div>
</section>
{/* GENERATOR SECTION */}
<section className="py-12 px-4 sm:px-6 lg:px-8 -mt-8">
<FacebookGenerator />
</section>
{/* HOW IT WORKS */}
<section className="py-16 px-4 sm:px-6 lg:px-8 bg-white">
<div className="max-w-4xl mx-auto">
<h2 className="text-3xl font-bold text-slate-900 text-center mb-12">
How Facebook QR Codes Work
</h2>
<div className="grid md:grid-cols-3 lg:grid-cols-5 gap-8">
<article className="text-center">
<div className="w-14 h-14 rounded-2xl bg-[#1877F2]/10 flex items-center justify-center mx-auto mb-4">
<Facebook className="w-7 h-7 text-[#1877F2]" />
</div>
<h3 className="font-bold text-slate-900 mb-2">1. Copy Link</h3>
<p className="text-slate-600 text-sm">
Go to your Facebook Page or Profile and copy the URL from the browser address bar.
</p>
</article>
<article className="text-center">
<div className="w-14 h-14 rounded-2xl bg-[#1877F2]/10 flex items-center justify-center mx-auto mb-4">
<Smartphone className="w-7 h-7 text-[#1877F2]" />
</div>
<h3 className="font-bold text-slate-900 mb-2">2. Scan</h3>
<p className="text-slate-600 text-sm">
Your customers scan the code using their phone camera.
</p>
</article>
<article className="text-center">
<div className="w-12 h-12 rounded-2xl bg-[#1877F2]/10 flex items-center justify-center mx-auto mb-4">
<ThumbsUp className="w-6 h-6 text-[#1877F2]" />
</div>
<h3 className="font-bold text-slate-900 mb-2">3. Engage</h3>
<p className="text-slate-600 text-xs leading-relaxed">
The Facebook app opens directly.
</p>
</article>
<article className="text-center">
<div className="w-12 h-12 rounded-2xl bg-[#1877F2]/10 flex items-center justify-center mx-auto mb-4">
<Download className="w-6 h-6 text-[#1877F2]" />
</div>
<h3 className="font-bold text-slate-900 mb-2">4. Download</h3>
<p className="text-slate-600 text-xs leading-relaxed">
Save your high-res QR code.
</p>
</article>
<article className="text-center">
<div className="w-12 h-12 rounded-2xl bg-[#1877F2]/10 flex items-center justify-center mx-auto mb-4">
<Share2 className="w-6 h-6 text-[#1877F2]" />
</div>
<h3 className="font-bold text-slate-900 mb-2">5. Share</h3>
<p className="text-slate-600 text-xs leading-relaxed">
Print it and start getting likes.
</p>
</article>
</div>
</div>
</section>
{/* FAQ SECTION */}
<section className="py-16 px-4 sm:px-6 lg:px-8" style={{ backgroundColor: '#EBEBDF' }}>
<div className="max-w-3xl mx-auto">
<h2 className="text-3xl font-bold text-slate-900 text-center mb-4">
Frequently Asked Questions
</h2>
<p className="text-slate-600 text-center mb-10">
Common questions about Facebook QR codes.
</p>
<div className="space-y-4">
<FaqItem
question="Will this work for Facebook Groups?"
answer="Yes! You can paste the link to your Facebook Group, and the QR code will direcr users to join."
/>
<FaqItem
question="What if the user doesn't have the Facebook app?"
answer="The link will open in their mobile web browser instead, so they can still see your page and log in."
/>
<FaqItem
question="Can I customize the color?"
answer="Yes. While Facebook Blue is recommended for recognition, you can choose any color to match your brand."
/>
<FaqItem
question="Is the QR code permanent?"
answer="Yes. As long as your Facebook URL doesn't change, this QR code will work forever."
/>
<FaqItem
question="Does it work for Facebook Events?"
answer="Yes. Simply copy the full URL of your Facebook Event and paste it into the generator."
/>
</div>
</div>
</section>
</div>
</>
);
}
function FaqItem({ question, answer }: { question: string; answer: string }) {
return (
<details className="group bg-white rounded-xl shadow-sm border border-slate-200 overflow-hidden">
<summary className="flex items-center justify-between p-5 cursor-pointer list-none text-slate-900 font-semibold hover:bg-slate-50 transition-colors">
{question}
<span className="transition group-open:rotate-180 text-slate-400">
<svg fill="none" height="20" stroke="currentColor" strokeLinecap="round" strokeLinejoin="round" strokeWidth="2" viewBox="0 0 24 24" width="20">
<path d="M6 9l6 6 6-6" />
</svg>
</span>
</summary>
<div className="text-slate-600 px-5 pb-5 pt-0 leading-relaxed text-sm">
{answer}
</div>
</details>
);
}

View File

@@ -0,0 +1,293 @@
'use client';
import React, { useState, useRef } from 'react';
import Link from 'next/link';
import { QRCodeSVG } from 'qrcode.react';
import {
MapPin,
Download,
Check,
Sparkles,
Navigation,
Globe
} from 'lucide-react';
import { Button } from '@/components/ui/Button';
import { Input } from '@/components/ui/Input';
import { cn } from '@/lib/utils';
// Brand Colors
const BRAND = {
paleGrey: '#ECFDF5', // Emerald-50
primary: '#10B981', // Emerald-500
primaryDark: '#047857', // Emerald-700
};
// QR Color Options
const QR_COLORS = [
{ name: 'Emerald', value: '#10B981' },
{ name: 'Teal', value: '#0D9488' },
{ name: 'Classic Black', value: '#000000' },
{ name: 'Navy', value: '#1E3A8A' },
{ name: 'Sky', value: '#0EA5E9' },
{ name: 'Emerald', value: '#10B981' },
{ name: 'Rose', value: '#F43F5E' },
];
// Frame Options
const FRAME_OPTIONS = [
{ id: 'none', label: 'No Frame' },
{ id: 'scanme', label: 'Scan Me' },
{ id: 'location', label: 'Location' },
{ id: 'map', label: 'View Map' },
];
export default function GeolocationGenerator() {
const [latitude, setLatitude] = useState('');
const [longitude, setLongitude] = useState('');
const [qrColor, setQrColor] = useState(BRAND.primary);
const [frameType, setFrameType] = useState('none');
const qrRef = useRef<HTMLDivElement>(null);
// Using Google Maps Universal Link for best compatibility
const qrValue = `https://www.google.com/maps/search/?api=1&query=${latitude},${longitude}`;
const handleDownload = async (format: 'png' | 'svg') => {
if (!qrRef.current) return;
try {
if (format === 'png') {
const { toPng } = await import('html-to-image');
const dataUrl = await toPng(qrRef.current, { cacheBust: true, pixelRatio: 3 });
const link = document.createElement('a');
link.download = `location-qr-code.png`;
link.href = dataUrl;
link.click();
} else {
const svgData = qrRef.current.querySelector('svg')?.outerHTML;
if (svgData) {
const blob = new Blob([svgData], { type: 'image/svg+xml;charset=utf-8' });
const url = URL.createObjectURL(blob);
const link = document.createElement('a');
link.href = url;
link.download = `location-qr-code.svg`;
link.click();
}
}
} catch (err) {
console.error('Download failed', err);
}
};
const getFrameLabel = () => {
const frame = FRAME_OPTIONS.find(f => f.id === frameType);
return frame?.id !== 'none' ? frame?.label : null;
};
const getCurrentLocation = () => {
if (navigator.geolocation) {
navigator.geolocation.getCurrentPosition(
(position) => {
setLatitude(position.coords.latitude.toFixed(6));
setLongitude(position.coords.longitude.toFixed(6));
},
(error) => {
console.error("Error getting location: ", error);
alert("Could not access location. Please enter manually.");
}
);
} else {
alert("Geolocation is not supported by this browser.");
}
};
return (
<div className="w-full max-w-5xl mx-auto px-4 md:px-6">
{/* Main Generator Card */}
<div className="bg-white rounded-3xl shadow-2xl shadow-slate-900/10 overflow-hidden border border-slate-100">
<div className="grid lg:grid-cols-2">
{/* LEFT: Input Section */}
<div className="p-8 lg:p-10 space-y-8 border-r border-slate-100">
{/* Location Details */}
<div className="space-y-6">
<div className="flex items-center justify-between">
<h2 className="text-lg font-bold text-slate-900 flex items-center gap-2">
<MapPin className="w-5 h-5 text-[#10B981]" />
Coordinates
</h2>
<Button
onClick={getCurrentLocation}
variant="outline"
size="sm"
className="text-[#047857] border-[#047857]/20 hover:bg-[#047857]/5"
>
<Navigation className="w-3 h-3 mr-2" />
Get Current Location
</Button>
</div>
<div className="grid grid-cols-2 gap-4">
<div>
<label className="block text-sm font-medium text-slate-700 mb-2">Latitude</label>
<Input
placeholder="40.712776"
value={latitude}
onChange={(e) => setLatitude(e.target.value)}
className="h-12 text-base rounded-xl border-slate-200 focus:border-[#10B981] focus:ring-[#10B981]"
/>
</div>
<div>
<label className="block text-sm font-medium text-slate-700 mb-2">Longitude</label>
<Input
placeholder="-74.005974"
value={longitude}
onChange={(e) => setLongitude(e.target.value)}
className="h-12 text-base rounded-xl border-slate-200 focus:border-[#10B981] focus:ring-[#10B981]"
/>
</div>
</div>
<p className="text-xs text-slate-500">
Tip: You can copy-paste coordinates directly from Google Maps.
(Right-click a location on standard Maps, then click the coordinates to copy).
</p>
</div>
<div className="border-t border-slate-100"></div>
{/* Design Options */}
<div className="space-y-6">
<h2 className="text-lg font-bold text-slate-900 flex items-center gap-2">
<Sparkles className="w-5 h-5 text-[#10B981]" />
Design Options
</h2>
{/* Color Picker */}
<div>
<label className="block text-sm font-medium text-slate-700 mb-3">QR Code Color</label>
<div className="flex flex-wrap gap-2">
{QR_COLORS.map((c) => (
<button
key={c.name}
onClick={() => setQrColor(c.value)}
className={cn(
"w-9 h-9 rounded-full border-2 flex items-center justify-center transition-all hover:scale-110",
qrColor === c.value ? "border-slate-900 ring-2 ring-offset-2 ring-slate-200" : "border-white shadow-md"
)}
style={{ backgroundColor: c.value }}
aria-label={`Select ${c.name}`}
title={c.name}
>
{qrColor === c.value && <Check className="w-4 h-4 text-white" strokeWidth={3} />}
</button>
))}
</div>
</div>
{/* Frame Selector */}
<div>
<label className="block text-sm font-medium text-slate-700 mb-3">Frame Label</label>
<div className="grid grid-cols-4 gap-2">
{FRAME_OPTIONS.map((frame) => (
<button
key={frame.id}
onClick={() => setFrameType(frame.id)}
className={cn(
"py-2.5 px-3 rounded-lg text-sm font-medium transition-all border",
frameType === frame.id
? "bg-[#10B981] text-white border-[#10B981]"
: "bg-slate-50 text-slate-600 border-slate-200 hover:border-slate-300"
)}
>
{frame.label}
</button>
))}
</div>
</div>
</div>
</div>
{/* RIGHT: Preview Section */}
<div className="p-8 lg:p-10 flex flex-col items-center justify-center" style={{ backgroundColor: BRAND.paleGrey }}>
{/* QR Card with Frame */}
<div
ref={qrRef}
className="bg-white rounded-3xl shadow-xl p-8 flex flex-col items-center"
style={{ minWidth: '320px' }}
>
{/* Frame Label */}
{getFrameLabel() && (
<div
className="mb-5 px-8 py-2.5 rounded-full text-white font-bold text-sm tracking-widest uppercase shadow-md"
style={{ backgroundColor: qrColor }}
>
{getFrameLabel()}
</div>
)}
{/* QR Code */}
<div className="bg-white">
<QRCodeSVG
value={(latitude && longitude) ? qrValue : "https://maps.google.com"}
size={240}
level="M"
includeMargin={false}
fgColor={qrColor}
/>
</div>
{/* Info Preview */}
<div className="mt-6 text-center max-w-[260px]">
<h3 className="font-bold text-slate-900 text-lg flex items-center justify-center gap-2 truncate">
<MapPin className="w-4 h-4 text-[#10B981] shrink-0" />
<span className="truncate">{latitude || 'Lat'}, {longitude || 'Long'}</span>
</h3>
<div className="text-xs text-slate-500 mt-1">Google Maps Location</div>
</div>
</div>
{/* Download Buttons */}
<div className="flex items-center gap-3 mt-8">
<Button
onClick={() => handleDownload('png')}
className="bg-[#10B981] hover:bg-[#047857] text-white shadow-lg"
>
<Download className="w-4 h-4 mr-2" />
Download PNG
</Button>
<Button
onClick={() => handleDownload('svg')}
variant="outline"
className="border-slate-300 hover:bg-white"
>
<Download className="w-4 h-4 mr-2" />
SVG
</Button>
</div>
<p className="text-xs text-slate-500 mt-4 text-center">
Scanning opens the location directly in Google Maps.
</p>
</div>
</div>
</div>
{/* Upsell Banner */}
<div className="mt-8 bg-gradient-to-r from-[#10B981] to-[#047857] rounded-2xl p-6 flex flex-col sm:flex-row items-center justify-between gap-4">
<div className="text-white text-center sm:text-left">
<h3 className="font-bold text-lg">Need a Business Map?</h3>
<p className="text-white/80 text-sm mt-1">
Create a Dynamic QR Code for your business location. If you move, just update the location without reprinting.
</p>
</div>
<Link href="/signup">
<Button className="bg-white text-[#047857] hover:bg-slate-100 shrink-0 shadow-lg">
Get Dynamic Maps
</Button>
</Link>
</div>
</div>
);
}

View File

@@ -0,0 +1,360 @@
import React from 'react';
import type { Metadata } from 'next';
import GeolocationGenerator from './GeolocationGenerator';
import { MapPin, Shield, Zap, Smartphone, Navigation, Map, Download, Share2 } from 'lucide-react';
import { QRCodeSVG } from 'qrcode.react';
import { ToolBreadcrumb } from '@/components/seo/BreadcrumbSchema';
// SEO Optimized Metadata
export const metadata: Metadata = {
title: 'Free Geolocation QR Code Generator | Maps & Directions | QR Master',
description: 'Create a QR code for a specific location using Latitude and Longitude. Scanners will open Google Maps directly to your pin. Free & Precise.',
keywords: ['location qr code', 'maps qr code', 'google maps qr generator', 'geolocation qr', 'coordinates qr code'],
alternates: {
canonical: 'https://qrmaster.io/tools/geolocation-qr-code',
},
openGraph: {
title: 'Free Geolocation QR Code Generator | QR Master',
description: 'Navigate users to any location with a QR code. Opens directly in Google Maps.',
type: 'website',
url: 'https://qrmaster.io/tools/geolocation-qr-code',
images: [{ url: '/og-geolocation-generator.png', width: 1200, height: 630 }],
},
twitter: {
card: 'summary_large_image',
title: 'Free Geolocation QR Code Generator',
description: 'Create QR codes for maps and locations. Instant and free.',
},
robots: {
index: true,
follow: true,
},
};
// JSON-LD Structured Data
const jsonLd = {
'@context': 'https://schema.org',
'@graph': [
{
'@type': 'SoftwareApplication',
name: 'Geolocation QR Code Generator',
applicationCategory: 'UtilitiesApplication',
operatingSystem: 'Web Browser',
offers: {
'@type': 'Offer',
price: '0',
priceCurrency: 'USD',
},
aggregateRating: {
'@type': 'AggregateRating',
ratingValue: '4.7',
ratingCount: '890',
},
description: 'Generate QR codes that open specific geographic coordinates in map applications.',
},
{
'@type': 'HowTo',
name: 'How to Create a Location QR Code',
description: 'Create a QR code that points to a specific map location.',
step: [
{
'@type': 'HowToStep',
position: 1,
name: 'Get Coordinates',
text: 'Find the Latitude and Longitude of your location (e.g., from Google Maps).',
},
{
'@type': 'HowToStep',
position: 2,
name: 'Enter Data',
text: 'Paste the coordinates into the generator.',
},
{
'@type': 'HowToStep',
position: 3,
name: 'Customize',
text: 'Choose a color and style for your map QR code.',
},
{
'@type': 'HowToStep',
position: 4,
name: 'Download',
text: 'Save your QR code as a high-quality image.',
},
{
'@type': 'HowToStep',
position: 5,
name: 'Share',
text: 'Place it on invitations, signs, or your website.',
},
],
totalTime: 'PT45S',
},
{
'@type': 'FAQPage',
mainEntity: [
{
'@type': 'Question',
name: 'Which map app does it open?',
acceptedAnswer: {
'@type': 'Answer',
text: 'Our generator creates a universal Google Maps link. On most devices, this will open the Google Maps app if installed, or the browser version if not. It is the most compatible method.',
},
},
{
'@type': 'Question',
name: 'How do I find my Latitude and Longitude?',
acceptedAnswer: {
'@type': 'Answer',
text: 'On Google Maps desktop: Right-click any spot on the map. The first item in the menu is the coordinates. Click to copy them.',
},
},
{
'@type': 'Question',
name: 'Does it work offline?',
acceptedAnswer: {
'@type': 'Answer',
text: 'The QR code itself can be scanned offline, but the user will likely need an internet connection to load the map and get directions.',
},
},
{
'@type': 'Question',
name: 'Can I use an address instead?',
acceptedAnswer: {
'@type': 'Answer',
text: 'For precise results, we use coordinates. However, you can use our URL Generator and paste a link to your Google Maps address search result if you prefer.',
},
},
{
'@type': 'Question',
name: 'Is it free?',
acceptedAnswer: {
'@type': 'Answer',
text: 'Yes, generating this location QR code is completely free and requires no signup.',
},
},
],
},
],
};
export default function GeolocationQRCodePage() {
return (
<>
<script
type="application/ld+json"
dangerouslySetInnerHTML={{ __html: JSON.stringify(jsonLd) }}
/>
<ToolBreadcrumb toolName="Location QR Code Generator" toolSlug="geolocation-qr-code" />
<div className="min-h-screen" style={{ backgroundColor: '#EBEBDF' }}>
{/* HERO SECTION */}
<section className="relative pt-20 pb-20 lg:pt-32 lg:pb-32 px-4 sm:px-6 lg:px-8 overflow-hidden" style={{ backgroundColor: '#047857' }}>
<div className="absolute inset-0 opacity-10">
<svg className="w-full h-full" viewBox="0 0 100 100" preserveAspectRatio="none">
<path d="M0 100 C 20 0 50 0 100 100 Z" fill="url(#grad1)" />
<defs>
<linearGradient id="grad1" x1="0%" y1="0%" x2="100%" y2="0%">
<stop offset="0%" style={{ stopColor: 'white', stopOpacity: 1 }} />
<stop offset="100%" style={{ stopColor: 'white', stopOpacity: 0 }} />
</linearGradient>
</defs>
</svg>
</div>
<div className="max-w-7xl mx-auto grid lg:grid-cols-2 gap-12 items-center relative z-10">
<div className="text-center lg:text-left">
<div className="inline-flex items-center gap-2 px-3 py-1 rounded-full bg-white/10 text-white/90 text-sm font-medium mb-6 backdrop-blur-sm border border-white/10 hover:bg-white/20 transition-colors cursor-default">
<span className="flex h-2 w-2 relative">
<span className="animate-ping absolute inline-flex h-full w-full rounded-full bg-emerald-400 opacity-75"></span>
<span className="relative inline-flex rounded-full h-2 w-2 bg-emerald-400"></span>
</span>
Free Tool No Signup Required
</div>
<h1 className="text-4xl md:text-5xl lg:text-6xl font-extrabold text-white tracking-tight leading-tight mb-6">
Share Perfect Locations with <br className="hidden lg:block" />
<span className="text-transparent bg-clip-text bg-gradient-to-r from-emerald-300 to-teal-300">Map QR Codes</span>
</h1>
<p className="text-lg md:text-xl text-indigo-100 max-w-2xl mx-auto lg:mx-0 mb-8 leading-relaxed">
Provide exact directions to your event, store, or secret spot.
<strong className="text-white block sm:inline mt-2 sm:mt-0"> Opens directly in Google Maps.</strong>
</p>
<div className="flex flex-wrap justify-center lg:justify-start gap-4 text-sm font-medium text-white/80">
<div className="flex items-center gap-2 bg-white/5 px-4 py-2.5 rounded-xl border border-white/5 backdrop-blur-sm">
<Navigation className="w-4 h-4 text-emerald-400" />
Exact Directions
</div>
<div className="flex items-center gap-2 bg-white/5 px-4 py-2.5 rounded-xl border border-white/5 backdrop-blur-sm">
<Zap className="w-4 h-4 text-amber-400" />
Instant Load
</div>
<div className="flex items-center gap-2 bg-white/5 px-4 py-2.5 rounded-xl border border-white/5 backdrop-blur-sm">
<Shield className="w-4 h-4 text-purple-400" />
No Data Saved
</div>
</div>
</div>
{/* Visual Abstract */}
<div className="hidden lg:flex relative items-center justify-center min-h-[400px]">
<div className="absolute w-[500px] h-[500px] bg-indigo-500/30 rounded-full blur-[100px] -top-20 -right-20 animate-pulse" />
<div className="relative w-80 h-96 bg-white/5 backdrop-blur-xl border border-white/20 rounded-3xl shadow-2xl flex flex-col items-center justify-center p-8 transform rotate-3 hover:rotate-0 transition-all duration-700 group">
<div className="absolute inset-0 bg-gradient-to-br from-white/10 to-transparent rounded-3xl" />
<div className="w-full bg-white rounded-xl shadow-lg h-32 mb-6 relative overflow-hidden grayscale group-hover:grayscale-0 transition-all duration-500">
<div className="absolute inset-0 opacity-20 bg-[radial-gradient(#e5e7eb_1px,transparent_1px)] [background-size:16px_16px]"></div>
<div className="absolute top-1/2 left-1/2 -translate-x-1/2 -translate-y-1/2">
<MapPin className="w-8 h-8 text-red-500 drop-shadow-lg animate-bounce" />
</div>
<div className="absolute bottom-2 left-2 right-2 bg-white/90 p-2 rounded text-[10px] text-slate-500 font-mono text-center">
40.7128° N, 74.0060° W
</div>
</div>
<div className="w-44 h-44 bg-white rounded-xl p-2 shadow-inner relative overflow-hidden flex items-center justify-center">
<QRCodeSVG value="https://www.qrmaster.net" size={160} fgColor="#0f172a" level="Q" />
</div>
{/* Floating Badge */}
<div className="absolute -bottom-6 -right-6 bg-white py-3 px-5 rounded-xl shadow-xl flex items-center gap-3 transform transition-transform hover:scale-105 duration-300">
<div className="bg-emerald-100 p-2 rounded-full">
<Map className="w-5 h-5 text-emerald-600" />
</div>
<div className="text-left">
<div className="text-[10px] text-slate-400 font-bold uppercase tracking-wider">Map</div>
<div className="text-sm font-bold text-slate-900">Open</div>
</div>
</div>
</div>
</div>
</div>
</section>
{/* GENERATOR SECTION */}
<section className="py-12 px-4 sm:px-6 lg:px-8 -mt-8">
<GeolocationGenerator />
</section>
{/* HOW IT WORKS */}
<section className="py-16 px-4 sm:px-6 lg:px-8 bg-white">
<div className="max-w-4xl mx-auto">
<h2 className="text-3xl font-bold text-slate-900 text-center mb-12">
How Geolocation QR Codes Work
</h2>
<div className="grid md:grid-cols-3 lg:grid-cols-5 gap-8">
<article className="text-center">
<div className="w-14 h-14 rounded-2xl bg-[#1A1265]/10 flex items-center justify-center mx-auto mb-4">
<MapPin className="w-7 h-7 text-[#1A1265]" />
</div>
<h3 className="font-bold text-slate-900 mb-2">1. Pinpoint</h3>
<p className="text-slate-600 text-sm">
Enter exact GPS coordinates. This ensures users go to the precise spot (e.g., a specific building entrance).
</p>
</article>
<article className="text-center">
<div className="w-14 h-14 rounded-2xl bg-[#1A1265]/10 flex items-center justify-center mx-auto mb-4">
<Smartphone className="w-7 h-7 text-[#1A1265]" />
</div>
<h3 className="font-bold text-slate-900 mb-2">2. Scan</h3>
<p className="text-slate-600 text-sm">
Users scan the code. It is encoded with a universal map link.
</p>
</article>
<article className="text-center">
<div className="w-12 h-12 rounded-2xl bg-[#1A1265]/10 flex items-center justify-center mx-auto mb-4">
<Download className="w-6 h-6 text-[#1A1265]" />
</div>
<h3 className="font-bold text-slate-900 mb-2">3. Download</h3>
<p className="text-slate-600 text-xs leading-relaxed">
Save your high-quality QR image.
</p>
</article>
<article className="text-center">
<div className="w-12 h-12 rounded-2xl bg-[#1A1265]/10 flex items-center justify-center mx-auto mb-4">
<Smartphone className="w-6 h-6 text-[#1A1265]" />
</div>
<h3 className="font-bold text-slate-900 mb-2">4. Scan</h3>
<p className="text-slate-600 text-xs leading-relaxed">
Users scan the code to load coordinates.
</p>
</article>
<article className="text-center">
<div className="w-12 h-12 rounded-2xl bg-[#1A1265]/10 flex items-center justify-center mx-auto mb-4">
<Share2 className="w-6 h-6 text-[#1A1265]" />
</div>
<h3 className="font-bold text-slate-900 mb-2">5. Go</h3>
<p className="text-slate-600 text-xs leading-relaxed">
They get instant directions to your spot.
</p>
</article>
</div>
</div>
</section>
{/* FAQ SECTION */}
<section className="py-16 px-4 sm:px-6 lg:px-8" style={{ backgroundColor: '#EBEBDF' }}>
<div className="max-w-3xl mx-auto">
<h2 className="text-3xl font-bold text-slate-900 text-center mb-4">
Frequently Asked Questions
</h2>
<p className="text-slate-600 text-center mb-10">
Common questions about Map QR codes.
</p>
<div className="space-y-4">
<FaqItem
question="Why not just use an address?"
answer="Addresses can be ambiguous or cover large areas (like a park or stadium). Coordinates point to an exact geographic spot, ensuring visitors find the specific meeting point or parking entrance."
/>
<FaqItem
question="Does it work on Apple Maps?"
answer="Yes. While the underlying link is a Google Maps link, iOS devices usually handle these gracefully, either opening them in the Google Maps app (if installed) or the browser, where Apple Maps can often intercept directions."
/>
<FaqItem
question="Is it free?"
answer="Yes, generating this location QR code is completely free and requires no signup."
/>
<FaqItem
question="Can I track who scanned it?"
answer="Not with this static tool. If you need scan analytics (e.g., how many people scanned your storefront QR), you should use our Dynamic QR Code service."
/>
<FaqItem
question="Is it free?"
answer="Yes, generating this location QR code is completely free and requires no signup."
/>
</div>
</div>
</section>
</div>
</>
);
}
function FaqItem({ question, answer }: { question: string; answer: string }) {
return (
<details className="group bg-white rounded-xl shadow-sm border border-slate-200 overflow-hidden">
<summary className="flex items-center justify-between p-5 cursor-pointer list-none text-slate-900 font-semibold hover:bg-slate-50 transition-colors">
{question}
<span className="transition group-open:rotate-180 text-slate-400">
<svg fill="none" height="20" stroke="currentColor" strokeLinecap="round" strokeLinejoin="round" strokeWidth="2" viewBox="0 0 24 24" width="20">
<path d="M6 9l6 6 6-6" />
</svg>
</span>
</summary>
<div className="text-slate-600 px-5 pb-5 pt-0 leading-relaxed text-sm">
{answer}
</div>
</details>
);
}

View File

@@ -0,0 +1,253 @@
'use client';
import React, { useState, useRef } from 'react';
import Link from 'next/link';
import { QRCodeSVG } from 'qrcode.react';
import {
Instagram,
Download,
Check,
Sparkles,
Camera
} from 'lucide-react';
import { Button } from '@/components/ui/Button';
import { Input } from '@/components/ui/Input';
import { cn } from '@/lib/utils';
// Brand Colors
const BRAND = {
paleGrey: '#EBEBDF',
richBlue: '#1A1265',
richBlueLight: '#2A2275',
};
// QR Color Options - Insta Theme
const QR_COLORS = [
{ name: 'Insta Pink', value: '#E1306C' },
{ name: 'Insta Purple', value: '#833AB4' },
{ name: 'Insta Orange', value: '#F77737' },
{ name: 'Classic Black', value: '#000000' },
{ name: 'Rich Blue', value: '#1A1265' },
{ name: 'Teal', value: '#0D9488' },
{ name: 'Emerald', value: '#10B981' },
{ name: 'Rose', value: '#F43F5E' },
];
// Frame Options
const FRAME_OPTIONS = [
{ id: 'none', label: 'No Frame' },
{ id: 'scanme', label: 'Scan Me' },
{ id: 'follow', label: 'Follow Us' },
{ id: 'insta', label: 'Instagram' },
];
export default function InstagramGenerator() {
const [username, setUsername] = useState('');
const [qrColor, setQrColor] = useState('#E1306C');
const [frameType, setFrameType] = useState('none');
const qrRef = useRef<HTMLDivElement>(null);
// Instagram URL construction: https://instagram.com/username
const getUrl = () => {
const cleanUser = username.replace(/^@/, '').replace(/https?:\/\/(www\.)?instagram\.com\//, '').replace(/\/$/, '');
return cleanUser ? `https://instagram.com/${cleanUser}` : 'https://instagram.com';
};
const handleDownload = async (format: 'png' | 'svg') => {
if (!qrRef.current) return;
try {
if (format === 'png') {
const { toPng } = await import('html-to-image');
const dataUrl = await toPng(qrRef.current, { cacheBust: true, pixelRatio: 3 });
const link = document.createElement('a');
link.download = `instagram-qr-code.png`;
link.href = dataUrl;
link.click();
} else {
const svgData = qrRef.current.querySelector('svg')?.outerHTML;
if (svgData) {
const blob = new Blob([svgData], { type: 'image/svg+xml;charset=utf-8' });
const url = URL.createObjectURL(blob);
const link = document.createElement('a');
link.href = url;
link.download = `instagram-qr-code.svg`;
link.click();
}
}
} catch (err) {
console.error('Download failed', err);
}
};
const getFrameLabel = () => {
const frame = FRAME_OPTIONS.find(f => f.id === frameType);
return frame?.id !== 'none' ? frame?.label : null;
};
return (
<div className="w-full max-w-5xl mx-auto px-4 md:px-6">
{/* Main Generator Card */}
<div className="bg-white rounded-3xl shadow-2xl shadow-slate-900/10 overflow-hidden border border-slate-100">
<div className="grid lg:grid-cols-2">
{/* LEFT: Input Section */}
<div className="p-8 lg:p-10 space-y-8 border-r border-slate-100">
{/* Instagram Details */}
<div className="space-y-6">
<h2 className="text-lg font-bold text-slate-900 flex items-center gap-2">
<Instagram className="w-5 h-5 text-[#E1306C]" />
Instagram Username
</h2>
<div>
<label className="block text-sm font-medium text-slate-700 mb-2">Username or Link</label>
<Input
placeholder="@username"
value={username}
onChange={(e) => setUsername(e.target.value)}
className="h-12 text-base rounded-xl border-slate-200 focus:border-[#E1306C] focus:ring-[#E1306C]"
/>
<p className="text-xs text-slate-500 mt-2">Enter your username (without @) or paste full profile link.</p>
</div>
</div>
<div className="border-t border-slate-100"></div>
{/* Design Options */}
<div className="space-y-6">
<h2 className="text-lg font-bold text-slate-900 flex items-center gap-2">
<Sparkles className="w-5 h-5 text-[#E1306C]" />
Design Options
</h2>
{/* Color Picker */}
<div>
<label className="block text-sm font-medium text-slate-700 mb-3">QR Code Color</label>
<div className="flex flex-wrap gap-2">
{QR_COLORS.map((c) => (
<button
key={c.name}
onClick={() => setQrColor(c.value)}
className={cn(
"w-9 h-9 rounded-full border-2 flex items-center justify-center transition-all hover:scale-110",
qrColor === c.value ? "border-slate-900 ring-2 ring-offset-2 ring-slate-200" : "border-white shadow-md"
)}
style={{ backgroundColor: c.value }}
aria-label={`Select ${c.name}`}
title={c.name}
>
{qrColor === c.value && <Check className="w-4 h-4 text-white" strokeWidth={3} />}
</button>
))}
</div>
</div>
{/* Frame Selector */}
<div>
<label className="block text-sm font-medium text-slate-700 mb-3">Frame Label</label>
<div className="grid grid-cols-4 gap-2">
{FRAME_OPTIONS.map((frame) => (
<button
key={frame.id}
onClick={() => setFrameType(frame.id)}
className={cn(
"py-2.5 px-3 rounded-lg text-sm font-medium transition-all border",
frameType === frame.id
? "bg-[#E1306C] text-white border-[#E1306C]"
: "bg-slate-50 text-slate-600 border-slate-200 hover:border-slate-300"
)}
>
{frame.label}
</button>
))}
</div>
</div>
</div>
</div>
{/* RIGHT: Preview Section */}
<div className="p-8 lg:p-10 flex flex-col items-center justify-center" style={{ backgroundColor: BRAND.paleGrey }}>
{/* QR Card with Frame */}
<div
ref={qrRef}
className="bg-white rounded-3xl shadow-xl p-8 flex flex-col items-center"
style={{ minWidth: '320px' }}
>
{/* Frame Label */}
{getFrameLabel() && (
<div
className="mb-5 px-8 py-2.5 rounded-full text-white font-bold text-sm tracking-widest uppercase shadow-md"
style={{ backgroundColor: qrColor }}
>
{getFrameLabel()}
</div>
)}
{/* QR Code */}
<div className="bg-white">
<QRCodeSVG
value={getUrl()}
size={240}
level="M"
includeMargin={false}
fgColor={qrColor}
/>
</div>
{/* Info Preview */}
<div className="mt-6 text-center max-w-[260px]">
<h3 className="font-bold text-slate-900 text-lg flex items-center justify-center gap-2 truncate">
<Instagram className="w-4 h-4 text-slate-400 shrink-0" />
<span className="truncate">{username || '@username'}</span>
</h3>
<div className="text-xs text-slate-500 mt-1">Opens in Instagram</div>
</div>
</div>
{/* Download Buttons */}
<div className="flex items-center gap-3 mt-8">
<Button
onClick={() => handleDownload('png')}
className="bg-[#E1306C] hover:bg-[#C13584] text-white shadow-lg"
>
<Download className="w-4 h-4 mr-2" />
Download PNG
</Button>
<Button
onClick={() => handleDownload('svg')}
variant="outline"
className="border-slate-300 hover:bg-white"
>
<Download className="w-4 h-4 mr-2" />
SVG
</Button>
</div>
<p className="text-xs text-slate-500 mt-4 text-center">
Scanning redirects directly to your Instagram profile.
</p>
</div>
</div>
</div>
{/* Upsell Banner */}
<div className="mt-8 bg-gradient-to-r from-[#833AB4] via-[#FD1D1D] to-[#FCA145] rounded-2xl p-6 flex flex-col sm:flex-row items-center justify-between gap-4">
<div className="text-white text-center sm:text-left">
<h3 className="font-bold text-lg">Want a "Link in Bio" QR?</h3>
<p className="text-white/80 text-sm mt-1">
Create a digital landing page with links to all your socials using Dynamic Codes.
</p>
</div>
<Link href="/signup">
<Button className="bg-white text-[#E1306C] hover:bg-slate-100 shrink-0 shadow-lg">
Create Bio Link
</Button>
</Link>
</div>
</div>
);
}

View File

@@ -0,0 +1,354 @@
import React from 'react';
import type { Metadata } from 'next';
import InstagramGenerator from './InstagramGenerator';
import { Instagram, Shield, Zap, Smartphone, Camera, Heart, Download, Share2 } from 'lucide-react';
import { QRCodeSVG } from 'qrcode.react';
import { ToolBreadcrumb } from '@/components/seo/BreadcrumbSchema';
// SEO Optimized Metadata
export const metadata: Metadata = {
title: 'Free Instagram QR Code Generator | Get More Followers | QR Master',
description: 'Create a QR code for your Instagram profile or post. Scanners are redirected to the Instagram app instantly to follow you. Free & Customizable.',
keywords: ['instagram qr code', 'insta qr generator', 'ig nametag generator', 'instagram follow qr', 'social media qr code'],
alternates: {
canonical: 'https://qrmaster.io/tools/instagram-qr-code',
},
openGraph: {
title: 'Free Instagram QR Code Generator | QR Master',
description: 'Generate QR codes to grow your Instagram following. Instant app redirect.',
type: 'website',
url: 'https://qrmaster.io/tools/instagram-qr-code',
images: [{ url: '/og-instagram-generator.png', width: 1200, height: 630 }],
},
twitter: {
card: 'summary_large_image',
title: 'Free Instagram QR Code Generator',
description: 'Create QR codes for Instagram. Boost your followers.',
},
robots: {
index: true,
follow: true,
},
};
// JSON-LD Structured Data
const jsonLd = {
'@context': 'https://schema.org',
'@graph': [
{
'@type': 'SoftwareApplication',
name: 'Instagram QR Code Generator',
applicationCategory: 'UtilitiesApplication',
operatingSystem: 'Web Browser',
offers: {
'@type': 'Offer',
price: '0',
priceCurrency: 'USD',
},
aggregateRating: {
'@type': 'AggregateRating',
ratingValue: '4.9',
ratingCount: '2150',
},
description: 'Generate QR codes that direct users to an Instagram profile or post.',
},
{
'@type': 'HowTo',
name: 'How to Create an Instagram QR Code',
description: 'Create a QR code that opens an Instagram profile.',
step: [
{
'@type': 'HowToStep',
position: 1,
name: 'Enter Username',
text: 'Type your Instagram handle (e.g. @yourbrand) or paste your profile link.',
},
{
'@type': 'HowToStep',
position: 2,
name: 'Customize',
text: 'Choose a gradient color that matches the Instagram vibe or your own brand.',
},
{
'@type': 'HowToStep',
position: 3,
name: 'Download',
text: 'Save the QR code image.',
},
{
'@type': 'HowToStep',
position: 4,
name: 'Test',
text: 'Scan the code to ensure it opens the correct profile.',
},
{
'@type': 'HowToStep',
position: 5,
name: 'Share',
text: 'Put it on your packaging, business cards, or storefront.',
},
],
totalTime: 'PT30S',
},
{
'@type': 'FAQPage',
mainEntity: [
{
'@type': 'Question',
name: 'Is this an Instagram Nametag?',
acceptedAnswer: {
'@type': 'Answer',
text: 'It works similarly! While Instagram has its own internal "Nametag" or "QR Code" feature, our generator allows you to create a standard QR code that is more customizable and can be tracked with our Dynamic plans.',
},
},
{
'@type': 'Question',
name: 'Does it open the Instagram app?',
acceptedAnswer: {
'@type': 'Answer',
text: 'Yes. When scanned on a mobile device with Instagram installed, it will deep-link directly to the profile in the app.',
},
},
{
'@type': 'Question',
name: 'Can I link to a specific photo or reel?',
acceptedAnswer: {
'@type': 'Answer',
text: 'Yes! Instead of your username, just paste the full link to the specific post or reel.',
},
},
{
'@type': 'Question',
name: 'Is it free?',
acceptedAnswer: {
'@type': 'Answer',
text: 'Yes, generating this QR code is 100% free.',
},
},
{
'@type': 'Question',
name: 'Can I track scans?',
acceptedAnswer: {
'@type': 'Answer',
text: 'Not with this static tool. If you need scan analytics, consider using our Dynamic QR Code solution.',
},
},
],
},
],
};
export default function InstagramQRCodePage() {
return (
<>
<script
type="application/ld+json"
dangerouslySetInnerHTML={{ __html: JSON.stringify(jsonLd) }}
/>
<ToolBreadcrumb toolName="Instagram QR Code Generator" toolSlug="instagram-qr-code" />
<div className="min-h-screen" style={{ backgroundColor: '#EBEBDF' }}>
{/* HERO SECTION */}
<section className="relative pt-20 pb-20 lg:pt-32 lg:pb-32 px-4 sm:px-6 lg:px-8 overflow-hidden bg-gradient-to-br from-[#833AB4] via-[#FD1D1D] to-[#FCA145]">
<div className="absolute inset-0 opacity-10">
<svg className="w-full h-full" width="100%" height="100%" viewBox="0 0 100 100" preserveAspectRatio="none">
<circle cx="0" cy="0" r="40" fill="white" fillOpacity="0.1" />
<circle cx="100" cy="100" r="50" fill="white" fillOpacity="0.1" />
</svg>
</div>
<div className="max-w-7xl mx-auto grid lg:grid-cols-2 gap-12 items-center relative z-10">
<div className="text-center lg:text-left">
<div className="inline-flex items-center gap-2 px-3 py-1 rounded-full bg-white/10 text-white/90 text-sm font-medium mb-6 backdrop-blur-sm border border-white/10 hover:bg-white/20 transition-colors cursor-default">
<span className="flex h-2 w-2 relative">
<span className="animate-ping absolute inline-flex h-full w-full rounded-full bg-pink-300 opacity-75"></span>
<span className="relative inline-flex rounded-full h-2 w-2 bg-pink-300"></span>
</span>
Free Tool No Signup Required
</div>
<h1 className="text-4xl md:text-5xl lg:text-6xl font-extrabold text-white tracking-tight leading-tight mb-6">
Boost Your Following with <br className="hidden lg:block" />
<span className="text-white drop-shadow-md">Instagram QR Codes</span>
</h1>
<p className="text-lg md:text-xl text-pink-50 max-w-2xl mx-auto lg:mx-0 mb-8 leading-relaxed">
Connect physically to digitally. Let customers scan to follow your Instagram profile instantly.
<strong className="text-white block sm:inline mt-2 sm:mt-0"> Grow your brand effortlessly.</strong>
</p>
<div className="flex flex-wrap justify-center lg:justify-start gap-4 text-sm font-medium text-white/80">
<div className="flex items-center gap-2 bg-white/10 px-4 py-2.5 rounded-xl border border-white/10 backdrop-blur-sm">
<Heart className="w-4 h-4 text-pink-200" />
More Likes
</div>
<div className="flex items-center gap-2 bg-white/10 px-4 py-2.5 rounded-xl border border-white/10 backdrop-blur-sm">
<Zap className="w-4 h-4 text-yellow-200" />
Instant Follow
</div>
<div className="flex items-center gap-2 bg-white/10 px-4 py-2.5 rounded-xl border border-white/10 backdrop-blur-sm">
<Smartphone className="w-4 h-4 text-white" />
App Deep Link
</div>
</div>
</div>
{/* Visual Abstract */}
<div className="hidden lg:flex relative items-center justify-center min-h-[400px]">
<div className="absolute w-[500px] h-[500px] bg-white/10 rounded-full blur-[100px] -top-20 -right-20 animate-pulse" />
<div className="relative w-80 h-96 bg-white/5 backdrop-blur-xl border border-white/20 rounded-3xl shadow-2xl flex flex-col items-center justify-center p-8 transform -rotate-3 hover:rotate-0 transition-all duration-700 group">
<div className="absolute inset-0 bg-gradient-to-br from-white/10 to-transparent rounded-3xl" />
<div className="w-full bg-white rounded-xl shadow-lg p-4 mb-6 relative overflow-hidden flex flex-col items-center">
<div className="w-16 h-16 rounded-full p-[2px] bg-gradient-to-tr from-[#FCA145] via-[#FD1D1D] to-[#833AB4] mb-2">
<div className="w-full h-full rounded-full bg-white p-1">
<div className="w-full h-full rounded-full bg-slate-200" />
</div>
</div>
<div className="text-sm font-bold text-slate-900">@yourbrand</div>
</div>
<div className="w-48 h-48 bg-white rounded-xl p-2 shadow-inner relative overflow-hidden flex items-center justify-center">
<QRCodeSVG value="https://www.qrmaster.net" size={170} fgColor="#E1306C" level="Q" />
</div>
{/* Floating Badge */}
<div className="absolute -bottom-6 -left-6 bg-white py-3 px-5 rounded-xl shadow-xl flex items-center gap-3 transform transition-transform hover:scale-105 duration-300">
<div className="bg-gradient-to-tr from-[#FCA145] to-[#E1306C] p-2 rounded-full text-white">
<Camera className="w-5 h-5" />
</div>
<div className="text-left">
<div className="text-[10px] text-slate-400 font-bold uppercase tracking-wider">Profile</div>
<div className="text-sm font-bold text-slate-900">Following</div>
</div>
</div>
</div>
</div>
</div>
</section>
{/* GENERATOR SECTION */}
<section className="py-12 px-4 sm:px-6 lg:px-8 -mt-8">
<InstagramGenerator />
</section>
{/* HOW IT WORKS */}
<section className="py-16 px-4 sm:px-6 lg:px-8 bg-white">
<div className="max-w-4xl mx-auto">
<h2 className="text-3xl font-bold text-slate-900 text-center mb-12">
How Instagram QR Codes Work
</h2>
<div className="grid md:grid-cols-3 lg:grid-cols-5 gap-8">
<article className="text-center">
<div className="w-14 h-14 rounded-2xl bg-[#E1306C]/10 flex items-center justify-center mx-auto mb-4">
<Instagram className="w-7 h-7 text-[#E1306C]" />
</div>
<h3 className="font-bold text-slate-900 mb-2">1. Username</h3>
<p className="text-slate-600 text-sm">
Enter your Instagram handle. No need to login or connect your account.
</p>
</article>
<article className="text-center">
<div className="w-14 h-14 rounded-2xl bg-[#E1306C]/10 flex items-center justify-center mx-auto mb-4">
<Smartphone className="w-7 h-7 text-[#E1306C]" />
</div>
<h3 className="font-bold text-slate-900 mb-2">2. Print</h3>
<p className="text-slate-600 text-sm">
Add the QR code to your packaging, business cards, or table tents.
</p>
</article>
<article className="text-center">
<div className="w-12 h-12 rounded-2xl bg-[#E1306C]/10 flex items-center justify-center mx-auto mb-4">
<Download className="w-6 h-6 text-[#E1306C]" />
</div>
<h3 className="font-bold text-slate-900 mb-2">3. Download</h3>
<p className="text-slate-600 text-xs leading-relaxed">
Save your custom QR code.
</p>
</article>
<article className="text-center">
<div className="w-12 h-12 rounded-2xl bg-[#E1306C]/10 flex items-center justify-center mx-auto mb-4">
<Heart className="w-6 h-6 text-[#E1306C]" />
</div>
<h3 className="font-bold text-slate-900 mb-2">4. Scan</h3>
<p className="text-slate-600 text-xs leading-relaxed">
Fans scan to instantly visit your profile.
</p>
</article>
<article className="text-center">
<div className="w-12 h-12 rounded-2xl bg-[#E1306C]/10 flex items-center justify-center mx-auto mb-4">
<Share2 className="w-6 h-6 text-[#E1306C]" />
</div>
<h3 className="font-bold text-slate-900 mb-2">5. Grow</h3>
<p className="text-slate-600 text-xs leading-relaxed">
Convert offline traffic into followers.
</p>
</article>
</div>
</div>
</section>
{/* FAQ SECTION */}
<section className="py-16 px-4 sm:px-6 lg:px-8" style={{ backgroundColor: '#EBEBDF' }}>
<div className="max-w-3xl mx-auto">
<h2 className="text-3xl font-bold text-slate-900 text-center mb-4">
Frequently Asked Questions
</h2>
<p className="text-slate-600 text-center mb-10">
Common questions about Instagram QR codes.
</p>
<div className="space-y-4">
<FaqItem
question="Does this work for private accounts?"
answer="Yes, the link will take users to your profile. If your account is private, they will still have to request to follow you."
/>
<FaqItem
question="Can I link to a Story?"
answer="Yes, but Stories expire after 24 hours (unless saved as a Highlight). Linking to a Highlight or your main Profile is usually better for printed materials."
/>
<FaqItem
question="Can I customize the frame?"
answer="Yes, we offer several frame options like 'Follow Us' or 'Scan Me' to encourage action."
/>
<FaqItem
question="Does it expire?"
answer="No. The QR code will work as long as your Instagram username remains the same."
/>
<FaqItem
question="Can I track scans?"
answer="Not with this static tool. If you need scan analytics, consider using our Dynamic QR Code solution."
/>
</div>
</div>
</section>
</div>
</>
);
}
function FaqItem({ question, answer }: { question: string; answer: string }) {
return (
<details className="group bg-white rounded-xl shadow-sm border border-slate-200 overflow-hidden">
<summary className="flex items-center justify-between p-5 cursor-pointer list-none text-slate-900 font-semibold hover:bg-slate-50 transition-colors">
{question}
<span className="transition group-open:rotate-180 text-slate-400">
<svg fill="none" height="20" stroke="currentColor" strokeLinecap="round" strokeLinejoin="round" strokeWidth="2" viewBox="0 0 24 24" width="20">
<path d="M6 9l6 6 6-6" />
</svg>
</span>
</summary>
<div className="text-slate-600 px-5 pb-5 pt-0 leading-relaxed text-sm">
{answer}
</div>
</details>
);
}

View File

@@ -0,0 +1,342 @@
'use client';
import React, { useState, useRef } from 'react';
import Link from 'next/link';
import { QRCodeSVG } from 'qrcode.react';
import {
CreditCard,
Download,
Check,
Sparkles,
DollarSign
} from 'lucide-react';
import { Button } from '@/components/ui/Button';
import { Input } from '@/components/ui/Input';
import { Select } from '@/components/ui/Select';
import { cn } from '@/lib/utils';
// Brand Colors - PayPal Blue
const BRAND = {
paleGrey: '#EFF6FF', // Blue-50
primary: '#003087', // PayPal Dark Blue
primaryDark: '#001F5C',
accent: '#0070BA', // PayPal Light Blue
};
// QR Color Options
const QR_COLORS = [
{ name: 'PayPal Blue', value: '#003087' },
{ name: 'PayPal Light', value: '#0070BA' },
{ name: 'Classic Black', value: '#000000' },
{ name: 'Indigo', value: '#4F46E5' },
{ name: 'Violet', value: '#7C3AED' },
{ name: 'Emerald', value: '#10B981' },
{ name: 'Rose', value: '#F43F5E' },
];
// Frame Options
const FRAME_OPTIONS = [
{ id: 'none', label: 'No Frame' },
{ id: 'scanme', label: 'Scan Me' },
{ id: 'pay', label: 'Pay Now' },
{ id: 'donate', label: 'Donate' },
{ id: 'tip', label: 'Tip Me' },
];
// Currency Options
const CURRENCIES = [
{ value: 'EUR', label: 'EUR (€)' },
{ value: 'USD', label: 'USD ($)' },
{ value: 'GBP', label: 'GBP (£)' },
{ value: 'CHF', label: 'CHF' },
];
// Input type options
const INPUT_TYPES = [
{ id: 'username', label: 'PayPal.me Username' },
{ id: 'email', label: 'PayPal Email' },
];
export default function PayPalGenerator() {
const [inputType, setInputType] = useState('email');
const [paypalId, setPaypalId] = useState('');
const [amount, setAmount] = useState('');
const [currency, setCurrency] = useState('EUR');
const [qrColor, setQrColor] = useState(BRAND.primary);
const [frameType, setFrameType] = useState('none');
const qrRef = useRef<HTMLDivElement>(null);
// Generate PayPal payment link
const generatePayPalLink = () => {
if (!paypalId.trim()) return 'https://paypal.com';
if (inputType === 'username') {
// PayPal.me link
let link = `https://paypal.me/${paypalId.trim()}`;
if (amount && parseFloat(amount) > 0) {
link += `/${amount}`;
}
return link;
} else {
// PayPal email payment link (donation/payment format)
const params = new URLSearchParams({
cmd: '_donations',
business: paypalId.trim(),
currency_code: currency,
...(amount && parseFloat(amount) > 0 ? { amount } : {}),
});
return `https://www.paypal.com/cgi-bin/webscr?${params.toString()}`;
}
};
const handleDownload = async (format: 'png' | 'svg') => {
if (!qrRef.current) return;
try {
if (format === 'png') {
const { toPng } = await import('html-to-image');
const dataUrl = await toPng(qrRef.current, { cacheBust: true, pixelRatio: 3 });
const link = document.createElement('a');
link.download = `paypal-qr-${paypalId || 'code'}.png`;
link.href = dataUrl;
link.click();
} else {
const svgData = qrRef.current.querySelector('svg')?.outerHTML;
if (svgData) {
const blob = new Blob([svgData], { type: 'image/svg+xml;charset=utf-8' });
const url = URL.createObjectURL(blob);
const link = document.createElement('a');
link.href = url;
link.download = `paypal-qr-${paypalId || 'code'}.svg`;
link.click();
}
}
} catch (err) {
console.error('Download failed', err);
}
};
const getFrameLabel = () => {
const frame = FRAME_OPTIONS.find(f => f.id === frameType);
return frame?.id !== 'none' ? frame?.label : null;
};
return (
<div className="w-full max-w-5xl mx-auto px-4 md:px-6">
{/* Main Generator Card */}
<div className="bg-white rounded-3xl shadow-2xl shadow-slate-900/10 overflow-hidden border border-slate-100">
<div className="grid lg:grid-cols-2">
{/* LEFT: Input Section */}
<div className="p-8 lg:p-10 space-y-8 border-r border-slate-100">
{/* PayPal Details */}
<div className="space-y-6">
<h2 className="text-lg font-bold text-slate-900 flex items-center gap-2">
<CreditCard className="w-5 h-5 text-[#003087]" />
PayPal Details
</h2>
<div className="space-y-4">
{/* Input Type Toggle */}
<div>
<label className="block text-sm font-medium text-slate-700 mb-2">Payment Method</label>
<div className="grid grid-cols-2 gap-2">
{INPUT_TYPES.map((type) => (
<button
key={type.id}
onClick={() => setInputType(type.id)}
className={cn(
"py-2.5 px-3 rounded-lg text-sm font-medium transition-all border",
inputType === type.id
? "bg-[#003087] text-white border-[#003087]"
: "bg-slate-50 text-slate-600 border-slate-200 hover:border-slate-300"
)}
>
{type.label}
</button>
))}
</div>
</div>
<div>
<label className="block text-sm font-medium text-slate-700 mb-2">
{inputType === 'username' ? 'PayPal.me Username' : 'PayPal Email Address'}
</label>
<Input
type={inputType === 'email' ? 'email' : 'text'}
placeholder={inputType === 'username' ? 'e.g. johndoe' : 'e.g. mail@example.com'}
value={paypalId}
onChange={(e) => setPaypalId(e.target.value)}
className="h-12 text-base rounded-xl border-slate-200 focus:border-[#003087] focus:ring-[#003087]"
/>
<p className="text-xs text-slate-500 mt-2">
{inputType === 'username'
? <>Find yours at <a href="https://paypal.me" target="_blank" rel="noopener noreferrer" className="text-[#003087] underline">paypal.me</a></>
: 'The email address linked to your PayPal account'
}
</p>
</div>
<div className="grid grid-cols-2 gap-4">
<div>
<label className="block text-sm font-medium text-slate-700 mb-2">Amount (Optional)</label>
<Input
type="number"
placeholder="25.00"
value={amount}
onChange={(e) => setAmount(e.target.value)}
className="h-12 text-base rounded-xl border-slate-200 focus:border-[#003087] focus:ring-[#003087]"
/>
</div>
<div>
<label className="block text-sm font-medium text-slate-700 mb-2">Currency</label>
<Select
value={currency}
onChange={(e) => setCurrency(e.target.value)}
className="h-12 rounded-xl border-slate-200"
options={CURRENCIES}
/>
</div>
</div>
</div>
</div>
<div className="border-t border-slate-100"></div>
{/* Design Options */}
<div className="space-y-6">
<h2 className="text-lg font-bold text-slate-900 flex items-center gap-2">
<Sparkles className="w-5 h-5 text-[#003087]" />
Design Options
</h2>
{/* Color Picker */}
<div>
<label className="block text-sm font-medium text-slate-700 mb-3">QR Code Color</label>
<div className="flex flex-wrap gap-2">
{QR_COLORS.map((c) => (
<button
key={c.name}
onClick={() => setQrColor(c.value)}
className={cn(
"w-9 h-9 rounded-full border-2 flex items-center justify-center transition-all hover:scale-110",
qrColor === c.value ? "border-slate-900 ring-2 ring-offset-2 ring-slate-200" : "border-white shadow-md"
)}
style={{ backgroundColor: c.value }}
aria-label={`Select ${c.name}`}
title={c.name}
>
{qrColor === c.value && <Check className="w-4 h-4 text-white" strokeWidth={3} />}
</button>
))}
</div>
</div>
{/* Frame Selector */}
<div>
<label className="block text-sm font-medium text-slate-700 mb-3">Frame Label</label>
<div className="grid grid-cols-5 gap-2">
{FRAME_OPTIONS.map((frame) => (
<button
key={frame.id}
onClick={() => setFrameType(frame.id)}
className={cn(
"py-2.5 px-2 rounded-lg text-xs font-medium transition-all border",
frameType === frame.id
? "bg-[#003087] text-white border-[#003087]"
: "bg-slate-50 text-slate-600 border-slate-200 hover:border-slate-300"
)}
>
{frame.label}
</button>
))}
</div>
</div>
</div>
</div>
{/* RIGHT: Preview Section */}
<div className="p-8 lg:p-10 flex flex-col items-center justify-center" style={{ backgroundColor: BRAND.paleGrey }}>
{/* QR Card with Frame */}
<div
ref={qrRef}
className="bg-white rounded-3xl shadow-xl p-8 flex flex-col items-center"
style={{ minWidth: '320px' }}
>
{/* Frame Label */}
{getFrameLabel() && (
<div
className="mb-5 px-8 py-2.5 rounded-full text-white font-bold text-sm tracking-widest uppercase shadow-md"
style={{ backgroundColor: qrColor }}
>
{getFrameLabel()}
</div>
)}
{/* QR Code */}
<div className="bg-white">
<QRCodeSVG
value={generatePayPalLink()}
size={240}
level="M"
includeMargin={false}
fgColor={qrColor}
/>
</div>
{/* PayPal Info */}
<div className="mt-6 text-center max-w-[260px]">
<h3 className="font-bold text-slate-900 text-lg flex items-center justify-center gap-2 truncate">
<DollarSign className="w-4 h-4 text-[#003087] shrink-0" />
<span className="truncate">{paypalId || 'Your PayPal'}</span>
</h3>
{amount && (
<p className="text-sm text-slate-500 mt-1">{amount} {currency}</p>
)}
</div>
</div>
{/* Download Buttons */}
<div className="flex items-center gap-3 mt-8">
<Button
onClick={() => handleDownload('png')}
className="bg-[#003087] hover:bg-[#001F5C] text-white shadow-lg"
>
<Download className="w-4 h-4 mr-2" />
Download PNG
</Button>
<Button
onClick={() => handleDownload('svg')}
variant="outline"
className="border-slate-300 hover:bg-white"
>
<Download className="w-4 h-4 mr-2" />
SVG
</Button>
</div>
<p className="text-xs text-slate-500 mt-4 text-center">
Your PayPal link is encoded directly. Static and forever free.
</p>
</div>
</div>
</div>
{/* Upsell Banner */}
<div className="mt-8 bg-gradient-to-r from-[#003087] to-[#0070BA] rounded-2xl p-6 flex flex-col sm:flex-row items-center justify-between gap-4">
<div className="text-white text-center sm:text-left">
<h3 className="font-bold text-lg">Need payment analytics?</h3>
<p className="text-white/80 text-sm mt-1">Track how many people scan your payment QR code with Dynamic QR Codes.</p>
</div>
<Link href="/signup">
<Button className="bg-white text-[#003087] hover:bg-slate-100 shrink-0 shadow-lg">
Get Analytics
</Button>
</Link>
</div>
</div>
);
}

View File

@@ -0,0 +1,358 @@
import React from 'react';
import type { Metadata } from 'next';
import PayPalGenerator from './PayPalGenerator';
import { CreditCard, Shield, Zap, Smartphone, DollarSign, Download, Share2, Banknote } from 'lucide-react';
import { QRCodeSVG } from 'qrcode.react';
import { ToolBreadcrumb } from '@/components/seo/BreadcrumbSchema';
// SEO Optimized Metadata
export const metadata: Metadata = {
title: 'Free PayPal QR Code Generator | Accept Payments Instantly | QR Master',
description: 'Create a QR code for your PayPal.me link. Let customers pay you instantly by scanning. Support tips, donations, and fixed amounts. 100% free.',
keywords: ['paypal qr code', 'paypal.me qr generator', 'payment qr code', 'accept payments qr', 'paypal qr generator', 'tip qr code', 'donation qr code'],
alternates: {
canonical: 'https://qrmaster.io/tools/paypal-qr-code',
},
openGraph: {
title: 'Free PayPal QR Code Generator | QR Master',
description: 'Generate QR codes for PayPal payments. Perfect for tips, donations, and invoices.',
type: 'website',
url: 'https://qrmaster.io/tools/paypal-qr-code',
images: [{ url: '/og-paypal-generator.png', width: 1200, height: 630 }],
},
twitter: {
card: 'summary_large_image',
title: 'Free PayPal QR Code Generator',
description: 'Create PayPal payment QR codes. Instant and free.',
},
robots: {
index: true,
follow: true,
},
};
// JSON-LD Structured Data
const jsonLd = {
'@context': 'https://schema.org',
'@graph': [
{
'@type': 'SoftwareApplication',
name: 'PayPal QR Code Generator',
applicationCategory: 'FinanceApplication',
operatingSystem: 'Web Browser',
offers: {
'@type': 'Offer',
price: '0',
priceCurrency: 'USD',
},
aggregateRating: {
'@type': 'AggregateRating',
ratingValue: '4.9',
ratingCount: '980',
},
description: 'Generate QR codes that link to your PayPal.me page for instant payments.',
},
{
'@type': 'HowTo',
name: 'How to Create a PayPal QR Code',
description: 'Create a QR code for receiving PayPal payments.',
step: [
{
'@type': 'HowToStep',
position: 1,
name: 'Enter Username',
text: 'Type your PayPal.me username (the part after paypal.me/).',
},
{
'@type': 'HowToStep',
position: 2,
name: 'Set Amount (Optional)',
text: 'Enter a pre-filled amount and currency for fixed payments.',
},
{
'@type': 'HowToStep',
position: 3,
name: 'Customize Design',
text: 'Choose PayPal brand colors and add a frame like "Pay Now" or "Tip Me".',
},
{
'@type': 'HowToStep',
position: 4,
name: 'Download QR Code',
text: 'Download your high-quality QR code in PNG or SVG format.',
},
{
'@type': 'HowToStep',
position: 5,
name: 'Share',
text: 'Print it on invoices, display at your shop, or share digitally.',
},
],
totalTime: 'PT30S',
},
{
'@type': 'FAQPage',
mainEntity: [
{
'@type': 'Question',
name: 'How does the PayPal QR code work?',
acceptedAnswer: {
'@type': 'Answer',
text: 'When scanned, it opens the PayPal app or website with your PayPal.me link. If you set an amount, it will be pre-filled for the payer.',
},
},
{
'@type': 'Question',
name: 'Do I need a PayPal Business account?',
acceptedAnswer: {
'@type': 'Answer',
text: 'No. Any PayPal account with a PayPal.me link can use this generator. Personal accounts work fine for tips and donations.',
},
},
{
'@type': 'Question',
name: 'Is there a fee for using the QR code?',
acceptedAnswer: {
'@type': 'Answer',
text: 'This generator is 100% free. PayPal may charge their standard transaction fees when you receive payments.',
},
},
{
'@type': 'Question',
name: 'Can I change the amount later?',
acceptedAnswer: {
'@type': 'Answer',
text: 'No, this is a static QR code. The amount is encoded permanently. For variable amounts, leave the amount field empty.',
},
},
{
'@type': 'Question',
name: 'What currencies are supported?',
acceptedAnswer: {
'@type': 'Answer',
text: 'We support EUR, USD, GBP, and CHF. PayPal handles currency conversion automatically.',
},
},
],
},
],
};
export default function PayPalQRCodePage() {
return (
<>
<script
type="application/ld+json"
dangerouslySetInnerHTML={{ __html: JSON.stringify(jsonLd) }}
/>
<ToolBreadcrumb toolName="PayPal QR Code Generator" toolSlug="paypal-qr-code" />
<div className="min-h-screen" style={{ backgroundColor: '#EBEBDF' }}>
{/* HERO SECTION */}
<section className="relative pt-20 pb-20 lg:pt-32 lg:pb-32 px-4 sm:px-6 lg:px-8 overflow-hidden" style={{ backgroundColor: '#003087' }}>
<div className="absolute inset-0 opacity-10">
<svg className="w-full h-full" viewBox="0 0 100 100" preserveAspectRatio="none">
<path d="M0 100 C 20 0 50 0 100 100 Z" fill="url(#grad1)" />
<defs>
<linearGradient id="grad1" x1="0%" y1="0%" x2="100%" y2="0%">
<stop offset="0%" style={{ stopColor: 'white', stopOpacity: 1 }} />
<stop offset="100%" style={{ stopColor: 'white', stopOpacity: 0 }} />
</linearGradient>
</defs>
</svg>
</div>
<div className="max-w-7xl mx-auto grid lg:grid-cols-2 gap-12 items-center relative z-10">
<div className="text-center lg:text-left">
<div className="inline-flex items-center gap-2 px-3 py-1 rounded-full bg-white/10 text-white/90 text-sm font-medium mb-6 backdrop-blur-sm border border-white/10 hover:bg-white/20 transition-colors cursor-default">
<span className="flex h-2 w-2 relative">
<span className="animate-ping absolute inline-flex h-full w-full rounded-full bg-sky-400 opacity-75"></span>
<span className="relative inline-flex rounded-full h-2 w-2 bg-sky-400"></span>
</span>
Free Tool No Signup Required
</div>
<h1 className="text-4xl md:text-5xl lg:text-6xl font-extrabold text-white tracking-tight leading-tight mb-6">
Accept Payments with <br className="hidden lg:block" />
<span className="text-transparent bg-clip-text bg-gradient-to-r from-sky-300 to-blue-200">PayPal QR Codes</span>
</h1>
<p className="text-lg md:text-xl text-blue-100 max-w-2xl mx-auto lg:mx-0 mb-8 leading-relaxed">
Let customers pay you by scanning. Perfect for tips, donations, and invoices.
<strong className="text-white block sm:inline mt-2 sm:mt-0"> Instant payments.</strong>
</p>
<div className="flex flex-wrap justify-center lg:justify-start gap-4 text-sm font-medium text-white/80">
<div className="flex items-center gap-2 bg-white/5 px-4 py-2.5 rounded-xl border border-white/5 backdrop-blur-sm">
<CreditCard className="w-4 h-4 text-sky-300" />
PayPal.me Links
</div>
<div className="flex items-center gap-2 bg-white/5 px-4 py-2.5 rounded-xl border border-white/5 backdrop-blur-sm">
<Zap className="w-4 h-4 text-amber-300" />
Pre-fill Amount
</div>
<div className="flex items-center gap-2 bg-white/5 px-4 py-2.5 rounded-xl border border-white/5 backdrop-blur-sm">
<Shield className="w-4 h-4 text-emerald-300" />
Secure Payments
</div>
</div>
</div>
{/* Visual Abstract */}
<div className="hidden lg:flex relative items-center justify-center min-h-[400px]">
<div className="absolute w-[500px] h-[500px] bg-blue-500/30 rounded-full blur-[100px] -top-20 -right-20 animate-pulse" />
<div className="relative w-80 h-96 bg-white/5 backdrop-blur-xl border border-white/20 rounded-3xl shadow-2xl flex flex-col items-center justify-center p-8 transform rotate-3 hover:rotate-0 transition-all duration-700 group">
<div className="absolute inset-0 bg-gradient-to-br from-white/10 to-transparent rounded-3xl" />
{/* Payment Card Mock */}
<div className="w-full bg-gradient-to-br from-[#0070BA] to-[#003087] rounded-xl shadow-lg p-4 mb-6 relative overflow-hidden text-white">
<div className="flex justify-between items-start mb-3">
<Banknote className="w-6 h-6 opacity-80" />
<div className="bg-white/20 px-2 py-1 rounded text-xs">EUR</div>
</div>
<div className="text-2xl font-bold tracking-wider">25.00</div>
<div className="text-xs opacity-70 mt-1">Payment Request</div>
</div>
<div className="w-48 h-48 bg-white rounded-xl p-2 shadow-inner relative overflow-hidden flex items-center justify-center">
<QRCodeSVG value="https://www.qrmaster.net" size={170} fgColor="#003087" level="Q" />
</div>
{/* Floating Badge */}
<div className="absolute -bottom-6 -left-6 bg-white py-3 px-5 rounded-xl shadow-xl flex items-center gap-3 transform transition-transform hover:scale-105 duration-300">
<div className="bg-blue-100 p-2 rounded-full">
<DollarSign className="w-5 h-5 text-[#003087]" />
</div>
<div className="text-left">
<div className="text-[10px] text-slate-400 font-bold uppercase tracking-wider">PayPal</div>
<div className="text-sm font-bold text-slate-900">Ready</div>
</div>
</div>
</div>
</div>
</div>
</section>
{/* GENERATOR SECTION */}
<section className="py-12 px-4 sm:px-6 lg:px-8 -mt-8">
<PayPalGenerator />
</section>
{/* HOW IT WORKS */}
<section className="py-16 px-4 sm:px-6 lg:px-8 bg-white">
<div className="max-w-4xl mx-auto">
<h2 className="text-3xl font-bold text-slate-900 text-center mb-12">
How PayPal QR Codes Work
</h2>
<div className="grid md:grid-cols-3 lg:grid-cols-5 gap-8">
<article className="text-center">
<div className="w-12 h-12 rounded-2xl bg-[#003087]/10 flex items-center justify-center mx-auto mb-4">
<CreditCard className="w-6 h-6 text-[#003087]" />
</div>
<h3 className="font-bold text-slate-900 mb-2">1. Username</h3>
<p className="text-slate-600 text-xs leading-relaxed">Enter your PayPal.me username.</p>
</article>
<article className="text-center">
<div className="w-12 h-12 rounded-2xl bg-[#003087]/10 flex items-center justify-center mx-auto mb-4">
<DollarSign className="w-6 h-6 text-[#003087]" />
</div>
<h3 className="font-bold text-slate-900 mb-2">2. Amount</h3>
<p className="text-slate-600 text-xs leading-relaxed">Optional: Set a fixed payment amount.</p>
</article>
<article className="text-center">
<div className="w-12 h-12 rounded-2xl bg-[#003087]/10 flex items-center justify-center mx-auto mb-4">
<Sparkles className="w-6 h-6 text-[#003087]" />
</div>
<h3 className="font-bold text-slate-900 mb-2">3. Design</h3>
<p className="text-slate-600 text-xs leading-relaxed">Pick colors and add a frame.</p>
</article>
<article className="text-center">
<div className="w-12 h-12 rounded-2xl bg-[#003087]/10 flex items-center justify-center mx-auto mb-4">
<Download className="w-6 h-6 text-[#003087]" />
</div>
<h3 className="font-bold text-slate-900 mb-2">4. Download</h3>
<p className="text-slate-600 text-xs leading-relaxed">Save as PNG or SVG file.</p>
</article>
<article className="text-center">
<div className="w-12 h-12 rounded-2xl bg-[#003087]/10 flex items-center justify-center mx-auto mb-4">
<Share2 className="w-6 h-6 text-[#003087]" />
</div>
<h3 className="font-bold text-slate-900 mb-2">5. Share</h3>
<p className="text-slate-600 text-xs leading-relaxed">Print or share to receive payments.</p>
</article>
</div>
</div>
</section>
{/* FAQ SECTION */}
<section className="py-16 px-4 sm:px-6 lg:px-8" style={{ backgroundColor: '#EBEBDF' }}>
<div className="max-w-3xl mx-auto">
<h2 className="text-3xl font-bold text-slate-900 text-center mb-4">
Frequently Asked Questions
</h2>
<p className="text-slate-600 text-center mb-10">
Common questions about PayPal QR codes.
</p>
<div className="space-y-4">
<FaqItem
question="How does the PayPal QR code work?"
answer="When scanned, it opens the PayPal app or website with your PayPal.me link. If you set an amount, it will be pre-filled for the payer."
/>
<FaqItem
question="Do I need a PayPal Business account?"
answer="No. Any PayPal account with a PayPal.me link can use this generator. Personal accounts work fine for tips and donations."
/>
<FaqItem
question="Is there a fee for using the QR code?"
answer="This generator is 100% free. PayPal may charge their standard transaction fees when you receive payments."
/>
<FaqItem
question="Can I change the amount later?"
answer="No, this is a static QR code. The amount is encoded permanently. For variable amounts, leave the amount field empty."
/>
<FaqItem
question="What if I don't have a PayPal.me link?"
answer="You can create one for free in your PayPal account settings. Go to paypal.me to set up your personalized link."
/>
</div>
</div>
</section>
</div>
</>
);
}
function FaqItem({ question, answer }: { question: string; answer: string }) {
return (
<details className="group bg-white rounded-xl shadow-sm border border-slate-200 overflow-hidden">
<summary className="flex items-center justify-between p-5 cursor-pointer list-none text-slate-900 font-semibold hover:bg-slate-50 transition-colors">
{question}
<span className="transition group-open:rotate-180 text-slate-400">
<svg fill="none" height="20" stroke="currentColor" strokeLinecap="round" strokeLinejoin="round" strokeWidth="2" viewBox="0 0 24 24" width="20">
<path d="M6 9l6 6 6-6" />
</svg>
</span>
</summary>
<div className="text-slate-600 px-5 pb-5 pt-0 leading-relaxed text-sm">
{answer}
</div>
</details>
);
}
function Sparkles({ className }: { className?: string }) {
return (
<svg className={className} fill="none" viewBox="0 0 24 24" stroke="currentColor" strokeWidth={2}>
<path strokeLinecap="round" strokeLinejoin="round" d="M5 3v4M3 5h4M6 17v4m-2-2h4m5-16l2.286 6.857L21 12l-5.714 2.143L13 21l-2.286-6.857L5 12l5.714-2.143L13 3z" />
</svg>
);
}

View File

@@ -0,0 +1,248 @@
'use client';
import React, { useState, useRef } from 'react';
import Link from 'next/link';
import { QRCodeSVG } from 'qrcode.react';
import {
Phone,
Download,
Check,
Sparkles,
Smartphone
} from 'lucide-react';
import { Button } from '@/components/ui/Button';
import { Input } from '@/components/ui/Input';
import { cn } from '@/lib/utils';
// Brand Colors
const BRAND = {
paleGrey: '#EBEBDF',
richBlue: '#1A1265',
richBlueLight: '#2A2275',
};
// QR Color Options
const QR_COLORS = [
{ name: 'Classic Black', value: '#000000' },
{ name: 'Deep Blue', value: '#1E40AF' },
{ name: 'Violet', value: '#7C3AED' },
{ name: 'Teal', value: '#0D9488' },
{ name: 'Coral', value: '#F43F5E' },
{ name: 'Amber', value: '#D97706' },
{ name: 'Emerald', value: '#10B981' },
{ name: 'Rose', value: '#F43F5E' },
];
// Frame Options
const FRAME_OPTIONS = [
{ id: 'none', label: 'No Frame' },
{ id: 'scanme', label: 'Scan Me' },
{ id: 'call', label: 'Call Me' },
{ id: 'contact', label: 'Contact' },
];
export default function PhoneGenerator() {
const [phone, setPhone] = useState('');
const [qrColor, setQrColor] = useState(BRAND.richBlue);
const [frameType, setFrameType] = useState('none');
const qrRef = useRef<HTMLDivElement>(null);
const qrValue = `tel:${phone}`;
const handleDownload = async (format: 'png' | 'svg') => {
if (!qrRef.current) return;
try {
if (format === 'png') {
const { toPng } = await import('html-to-image');
const dataUrl = await toPng(qrRef.current, { cacheBust: true, pixelRatio: 3 });
const link = document.createElement('a');
link.download = `phone-qr-code.png`;
link.href = dataUrl;
link.click();
} else {
const svgData = qrRef.current.querySelector('svg')?.outerHTML;
if (svgData) {
const blob = new Blob([svgData], { type: 'image/svg+xml;charset=utf-8' });
const url = URL.createObjectURL(blob);
const link = document.createElement('a');
link.href = url;
link.download = `phone-qr-code.svg`;
link.click();
}
}
} catch (err) {
console.error('Download failed', err);
}
};
const getFrameLabel = () => {
const frame = FRAME_OPTIONS.find(f => f.id === frameType);
return frame?.id !== 'none' ? frame?.label : null;
};
return (
<div className="w-full max-w-5xl mx-auto px-4 md:px-6">
{/* Main Generator Card */}
<div className="bg-white rounded-3xl shadow-2xl shadow-slate-900/10 overflow-hidden border border-slate-100">
<div className="grid lg:grid-cols-2">
{/* LEFT: Input Section */}
<div className="p-8 lg:p-10 space-y-8 border-r border-slate-100">
{/* Phone Details */}
<div className="space-y-6">
<h2 className="text-lg font-bold text-slate-900 flex items-center gap-2">
<Phone className="w-5 h-5 text-[#1A1265]" />
Phone Number
</h2>
<div>
<label className="block text-sm font-medium text-slate-700 mb-2">Number</label>
<Input
placeholder="+1 (555) 123-4567"
value={phone}
onChange={(e) => setPhone(e.target.value)}
className="h-12 text-base rounded-xl border-slate-200 focus:border-[#1A1265] focus:ring-[#1A1265]"
/>
<p className="text-xs text-slate-500 mt-2">Enter with country code for best results (e.g. +1).</p>
</div>
</div>
<div className="border-t border-slate-100"></div>
{/* Design Options */}
<div className="space-y-6">
<h2 className="text-lg font-bold text-slate-900 flex items-center gap-2">
<Sparkles className="w-5 h-5 text-[#1A1265]" />
Design Options
</h2>
{/* Color Picker */}
<div>
<label className="block text-sm font-medium text-slate-700 mb-3">QR Code Color</label>
<div className="flex flex-wrap gap-2">
{QR_COLORS.map((c) => (
<button
key={c.name}
onClick={() => setQrColor(c.value)}
className={cn(
"w-9 h-9 rounded-full border-2 flex items-center justify-center transition-all hover:scale-110",
qrColor === c.value ? "border-slate-900 ring-2 ring-offset-2 ring-slate-200" : "border-white shadow-md"
)}
style={{ backgroundColor: c.value }}
aria-label={`Select ${c.name}`}
title={c.name}
>
{qrColor === c.value && <Check className="w-4 h-4 text-white" strokeWidth={3} />}
</button>
))}
</div>
</div>
{/* Frame Selector */}
<div>
<label className="block text-sm font-medium text-slate-700 mb-3">Frame Label</label>
<div className="grid grid-cols-4 gap-2">
{FRAME_OPTIONS.map((frame) => (
<button
key={frame.id}
onClick={() => setFrameType(frame.id)}
className={cn(
"py-2.5 px-3 rounded-lg text-sm font-medium transition-all border",
frameType === frame.id
? "bg-[#1A1265] text-white border-[#1A1265]"
: "bg-slate-50 text-slate-600 border-slate-200 hover:border-slate-300"
)}
>
{frame.label}
</button>
))}
</div>
</div>
</div>
</div>
{/* RIGHT: Preview Section */}
<div className="p-8 lg:p-10 flex flex-col items-center justify-center" style={{ backgroundColor: BRAND.paleGrey }}>
{/* QR Card with Frame */}
<div
ref={qrRef}
className="bg-white rounded-3xl shadow-xl p-8 flex flex-col items-center"
style={{ minWidth: '320px' }}
>
{/* Frame Label */}
{getFrameLabel() && (
<div
className="mb-5 px-8 py-2.5 rounded-full text-white font-bold text-sm tracking-widest uppercase shadow-md"
style={{ backgroundColor: qrColor }}
>
{getFrameLabel()}
</div>
)}
{/* QR Code */}
<div className="bg-white">
<QRCodeSVG
value={phone ? qrValue : "tel:+123456789"}
size={240}
level="M"
includeMargin={false}
fgColor={qrColor}
/>
</div>
{/* Info Preview */}
<div className="mt-6 text-center max-w-[260px]">
<h3 className="font-bold text-slate-900 text-lg flex items-center justify-center gap-2 truncate">
<Phone className="w-4 h-4 text-slate-400 shrink-0" />
<span className="truncate">{phone || '+1 555 ...'}</span>
</h3>
</div>
</div>
{/* Download Buttons */}
<div className="flex items-center gap-3 mt-8">
<Button
onClick={() => handleDownload('png')}
className="bg-[#1A1265] hover:bg-[#2A2275] text-white shadow-lg"
>
<Download className="w-4 h-4 mr-2" />
Download PNG
</Button>
<Button
onClick={() => handleDownload('svg')}
variant="outline"
className="border-slate-300 hover:bg-white"
>
<Download className="w-4 h-4 mr-2" />
SVG
</Button>
</div>
<p className="text-xs text-slate-500 mt-4 text-center">
Scanning initiates a call on any mobile phone.
</p>
</div>
</div>
</div>
{/* Upsell Banner */}
<div className="mt-8 bg-gradient-to-r from-[#1A1265] to-[#2A2275] rounded-2xl p-6 flex flex-col sm:flex-row items-center justify-between gap-4">
<div className="text-white text-center sm:text-left">
<h3 className="font-bold text-lg">Need to change contact info?</h3>
<p className="text-white/80 text-sm mt-1">
Dynamic QR Codes act as a digital business card that you can update anytime.
</p>
</div>
<Link href="/signup">
<Button className="bg-white text-[#1A1265] hover:bg-slate-100 shrink-0 shadow-lg">
Create vCard Plus
</Button>
</Link>
</div>
</div>
);
}

View File

@@ -0,0 +1,362 @@
import React from 'react';
import type { Metadata } from 'next';
import PhoneGenerator from './PhoneGenerator';
import { Phone, Shield, Zap, Smartphone, PhoneCall, Download } from 'lucide-react';
import { QRCodeSVG } from 'qrcode.react';
import { ToolBreadcrumb } from '@/components/seo/BreadcrumbSchema';
// SEO Optimized Metadata
export const metadata: Metadata = {
title: 'Free Phone QR Code Generator | Call Instantly | QR Master',
description: 'Create a QR code that makes a phone call when scanned. Perfect for business cards, flyers, and support lines. 100% Free & No Signup.',
keywords: ['phone qr code', 'call qr code', 'phone number qr generator', 'click to call qr', 'business card qr code'],
alternates: {
canonical: 'https://qrmaster.io/tools/phone-qr-code',
},
openGraph: {
title: 'Free Phone QR Code Generator | QR Master',
description: 'Generate QR codes to initiate phone calls instantly. Share your number easily.',
type: 'website',
url: 'https://qrmaster.io/tools/phone-qr-code',
images: [{ url: '/og-phone-generator.png', width: 1200, height: 630 }],
},
twitter: {
card: 'summary_large_image',
title: 'Free Phone QR Code Generator',
description: 'Create QR codes for instant calling. Free and reliable.',
},
robots: {
index: true,
follow: true,
},
};
// JSON-LD Structured Data
const jsonLd = {
'@context': 'https://schema.org',
'@graph': [
{
'@type': 'SoftwareApplication',
name: 'Phone QR Code Generator',
applicationCategory: 'UtilitiesApplication',
operatingSystem: 'Web Browser',
offers: {
'@type': 'Offer',
price: '0',
priceCurrency: 'USD',
},
aggregateRating: {
'@type': 'AggregateRating',
ratingValue: '4.8',
ratingCount: '1500',
},
description: 'Generate QR codes that trigger a phone call when scanned on a mobile device.',
},
{
'@type': 'HowTo',
name: 'How to Create a Phone QR Code',
description: 'Create a QR code that dials a number automatically.',
step: [
{
'@type': 'HowToStep',
position: 1,
name: 'Enter Number',
text: 'Type your phone number with country code (e.g., +1 555-0199).',
},
{
'@type': 'HowToStep',
position: 2,
name: 'Customize',
text: 'Choose a color and add a label like "Call Me".',
},
{
'@type': 'HowToStep',
position: 3,
name: 'Download',
text: 'Save the QR code and print it on your materials.',
},
{
'@type': 'HowToStep',
position: 4,
name: 'Test',
text: 'Scan the code with your phone to ensure the number is correct.',
},
{
'@type': 'HowToStep',
position: 5,
name: 'Share',
text: 'Add to business cards, flyers, or supports desks.',
},
],
totalTime: 'PT30S',
},
{
'@type': 'FAQPage',
mainEntity: [
{
'@type': 'Question',
name: 'Does it call automatically?',
acceptedAnswer: {
'@type': 'Answer',
text: 'Scanning the QR code opens the phone dialer with the number pre-filled. The user must tap the call button to initiate the call.',
},
},
{
'@type': 'Question',
name: 'Does it work internationally?',
acceptedAnswer: {
'@type': 'Answer',
text: 'Yes! We recommend entering your number in international format (starting with +) to ensure it works anywhere in the world.',
},
},
{
'@type': 'Question',
name: 'Is my phone number private?',
acceptedAnswer: {
'@type': 'Answer',
text: 'Yes. We do not store your number. It is encoded directly into the QR code image.',
},
},
{
'@type': 'Question',
name: 'Can I track calls?',
acceptedAnswer: {
'@type': 'Answer',
text: 'This static QR code cannot track calls. For tracking scans and analytics, consider using our Dynamic QR Code solution.',
},
},
{
'@type': 'Question',
name: 'Is it free?',
acceptedAnswer: {
'@type': 'Answer',
text: 'Yes, completely free. We do not charge for generating or scanning the code.',
},
},
],
},
],
};
export default function PhoneQRCodePage() {
return (
<>
<script
type="application/ld+json"
dangerouslySetInnerHTML={{ __html: JSON.stringify(jsonLd) }}
/>
<ToolBreadcrumb toolName="Phone QR Code Generator" toolSlug="phone-qr-code" />
<div className="min-h-screen" style={{ backgroundColor: '#EBEBDF' }}>
{/* HERO SECTION */}
<section className="relative pt-20 pb-20 lg:pt-32 lg:pb-32 px-4 sm:px-6 lg:px-8 overflow-hidden" style={{ backgroundColor: '#1A1265' }}>
<div className="absolute inset-0 opacity-10">
<svg className="w-full h-full" viewBox="0 0 100 100" preserveAspectRatio="none">
<path d="M0 100 C 20 0 50 0 100 100 Z" fill="url(#grad1)" />
<defs>
<linearGradient id="grad1" x1="0%" y1="0%" x2="100%" y2="0%">
<stop offset="0%" style={{ stopColor: 'white', stopOpacity: 1 }} />
<stop offset="100%" style={{ stopColor: 'white', stopOpacity: 0 }} />
</linearGradient>
</defs>
</svg>
</div>
<div className="max-w-7xl mx-auto grid lg:grid-cols-2 gap-12 items-center relative z-10">
<div className="text-center lg:text-left">
<div className="inline-flex items-center gap-2 px-3 py-1 rounded-full bg-white/10 text-white/90 text-sm font-medium mb-6 backdrop-blur-sm border border-white/10 hover:bg-white/20 transition-colors cursor-default">
<span className="flex h-2 w-2 relative">
<span className="animate-ping absolute inline-flex h-full w-full rounded-full bg-emerald-400 opacity-75"></span>
<span className="relative inline-flex rounded-full h-2 w-2 bg-emerald-400"></span>
</span>
Free Tool No Signup Required
</div>
<h1 className="text-4xl md:text-5xl lg:text-6xl font-extrabold text-white tracking-tight leading-tight mb-6">
Create Instant <br className="hidden lg:block" />
<span className="text-transparent bg-clip-text bg-gradient-to-r from-emerald-400 to-cyan-400">Call-to-Action QR Codes</span>
</h1>
<p className="text-lg md:text-xl text-indigo-100 max-w-2xl mx-auto lg:mx-0 mb-8 leading-relaxed">
Make it easy for customers to call you. Scan to dial instantly.
<strong className="text-white block sm:inline mt-2 sm:mt-0"> Perfect for print marketing.</strong>
</p>
<div className="flex flex-wrap justify-center lg:justify-start gap-4 text-sm font-medium text-white/80">
<div className="flex items-center gap-2 bg-white/5 px-4 py-2.5 rounded-xl border border-white/5 backdrop-blur-sm">
<PhoneCall className="w-4 h-4 text-emerald-400" />
One-Tap Call
</div>
<div className="flex items-center gap-2 bg-white/5 px-4 py-2.5 rounded-xl border border-white/5 backdrop-blur-sm">
<Zap className="w-4 h-4 text-amber-400" />
Instant Dial
</div>
<div className="flex items-center gap-2 bg-white/5 px-4 py-2.5 rounded-xl border border-white/5 backdrop-blur-sm">
<Shield className="w-4 h-4 text-purple-400" />
No Data Saved
</div>
</div>
</div>
{/* Visual Abstract */}
<div className="hidden lg:flex relative items-center justify-center min-h-[400px]">
<div className="absolute w-[500px] h-[500px] bg-indigo-500/30 rounded-full blur-[100px] -top-20 -right-20 animate-pulse" />
<div className="relative w-80 h-96 bg-white/5 backdrop-blur-xl border border-white/20 rounded-3xl shadow-2xl flex flex-col items-center justify-center p-8 transform rotate-6 hover:rotate-3 transition-all duration-700 group">
<div className="absolute inset-0 bg-gradient-to-br from-white/10 to-transparent rounded-3xl" />
<div className="w-full bg-white rounded-xl shadow-lg p-4 mb-6 relative overflow-hidden">
<div className="flex items-center gap-3">
<div className="w-10 h-10 rounded-full bg-green-100 flex items-center justify-center animate-pulse">
<Phone className="w-5 h-5 text-green-600" />
</div>
<div>
<div className="h-2 w-24 bg-slate-200 rounded-full mb-1" />
<div className="h-2 w-16 bg-slate-100 rounded-full" />
</div>
</div>
</div>
<div className="w-48 h-48 bg-white rounded-xl p-2 shadow-inner relative overflow-hidden flex items-center justify-center">
<QRCodeSVG value="https://www.qrmaster.net" size={170} fgColor="#0f172a" level="Q" />
</div>
{/* Floating Badge */}
<div className="absolute -bottom-6 -right-6 bg-white py-3 px-5 rounded-xl shadow-xl flex items-center gap-3 transform transition-transform hover:scale-105 duration-300">
<div className="bg-emerald-100 p-2 rounded-full">
<PhoneCall className="w-5 h-5 text-emerald-600" />
</div>
<div className="text-left">
<div className="text-[10px] text-slate-400 font-bold uppercase tracking-wider">Status</div>
<div className="text-sm font-bold text-slate-900">Calling...</div>
</div>
</div>
</div>
</div>
</div>
</section>
{/* GENERATOR SECTION */}
<section className="py-12 px-4 sm:px-6 lg:px-8 -mt-8">
<PhoneGenerator />
</section>
{/* HOW IT WORKS */}
<section className="py-16 px-4 sm:px-6 lg:px-8 bg-white">
<div className="max-w-4xl mx-auto">
<h2 className="text-3xl font-bold text-slate-900 text-center mb-12">
How Phone QR Codes Work
</h2>
<div className="grid md:grid-cols-3 lg:grid-cols-5 gap-8">
<article className="text-center">
<div className="w-14 h-14 rounded-2xl bg-[#1A1265]/10 flex items-center justify-center mx-auto mb-4">
<Phone className="w-7 h-7 text-[#1A1265]" />
</div>
<h3 className="font-bold text-slate-900 mb-2">1. Enter Number</h3>
<p className="text-slate-600 text-sm">
Type your phone number. Include the country code for international compatibility.
</p>
</article>
<article className="text-center">
<div className="w-14 h-14 rounded-2xl bg-[#1A1265]/10 flex items-center justify-center mx-auto mb-4">
<Smartphone className="w-7 h-7 text-[#1A1265]" />
</div>
<h3 className="font-bold text-slate-900 mb-2">2. Scan</h3>
<p className="text-slate-600 text-sm">
Customers scan the QR code with their mobile phone's camera.
</p>
</article>
<article className="text-center">
<div className="w-12 h-12 rounded-2xl bg-[#1A1265]/10 flex items-center justify-center mx-auto mb-4">
<PhoneCall className="w-6 h-6 text-[#1A1265]" />
</div>
<h3 className="font-bold text-slate-900 mb-2">3. Call</h3>
<p className="text-slate-600 text-xs leading-relaxed">
Their phone dialer opens automatically with your number.
</p>
</article>
<article className="text-center">
<div className="w-12 h-12 rounded-2xl bg-[#1A1265]/10 flex items-center justify-center mx-auto mb-4">
<Download className="w-6 h-6 text-[#1A1265]" />
</div>
<h3 className="font-bold text-slate-900 mb-2">4. Download</h3>
<p className="text-slate-600 text-xs leading-relaxed">
Save the QR code image.
</p>
</article>
<article className="text-center">
<div className="w-12 h-12 rounded-2xl bg-[#1A1265]/10 flex items-center justify-center mx-auto mb-4">
<Shield className="w-6 h-6 text-[#1A1265]" />
</div>
<h3 className="font-bold text-slate-900 mb-2">5. Share</h3>
<p className="text-slate-600 text-xs leading-relaxed">
Add it to your marketing materials.
</p>
</article>
</div>
</div>
</section>
{/* FAQ SECTION */}
<section className="py-16 px-4 sm:px-6 lg:px-8" style={{ backgroundColor: '#EBEBDF' }}>
<div className="max-w-3xl mx-auto">
<h2 className="text-3xl font-bold text-slate-900 text-center mb-4">
Frequently Asked Questions
</h2>
<p className="text-slate-600 text-center mb-10">
Common questions about Phone QR codes.
</p>
<div className="space-y-4">
<FaqItem
question="Do I need to include the country code?"
answer="We highly recommend it. Adding the country code (e.g., +1 for USA/Canada, +44 for UK) ensures any phone from any region can dial your number correctly."
/>
<FaqItem
question="Does this work on iPhone and Android?"
answer="Yes, Phone QR codes are a standard format supported natively by iOS and Android camera apps."
/>
<FaqItem
question="Can I change the number later?"
answer="No. Static QR codes can't be edited. If your phone number changes, you'll need a new QR code. Use a Dynamic QR Code if you anticipate changes."
/>
<FaqItem
question="Is there a cost per scan?"
answer="No. There are no fees or limits on scanning. It works just like sharing your phone number."
/>
<FaqItem
question="Is it free?"
answer="Yes, completely free. We do not charge for generating or scanning the code."
/>
</div>
</div>
</section>
</div>
</>
);
}
function FaqItem({ question, answer }: { question: string; answer: string }) {
return (
<details className="group bg-white rounded-xl shadow-sm border border-slate-200 overflow-hidden">
<summary className="flex items-center justify-between p-5 cursor-pointer list-none text-slate-900 font-semibold hover:bg-slate-50 transition-colors">
{question}
<span className="transition group-open:rotate-180 text-slate-400">
<svg fill="none" height="20" stroke="currentColor" strokeLinecap="round" strokeLinejoin="round" strokeWidth="2" viewBox="0 0 24 24" width="20">
<path d="M6 9l6 6 6-6" />
</svg>
</span>
</summary>
<div className="text-slate-600 px-5 pb-5 pt-0 leading-relaxed text-sm">
{answer}
</div>
</details>
);
}

View File

@@ -0,0 +1,267 @@
'use client';
import React, { useState, useRef } from 'react';
import Link from 'next/link';
import { QRCodeSVG } from 'qrcode.react';
import {
MessageSquare,
Download,
Check,
Sparkles,
Phone
} from 'lucide-react';
import { Button } from '@/components/ui/Button';
import { Input } from '@/components/ui/Input';
import { cn } from '@/lib/utils';
// Brand Colors
const BRAND = {
paleGrey: '#EBEBDF',
primary: '#ea580c', // Orange-600
primaryDark: '#c2410c', // Orange-700
};
// QR Color Options
const QR_COLORS = [
{ name: 'Classic Black', value: '#000000' },
{ name: 'Deep Blue', value: '#1E40AF' },
{ name: 'Violet', value: '#7C3AED' },
{ name: 'Teal', value: '#0D9488' },
{ name: 'Coral', value: '#F43F5E' },
{ name: 'Amber', value: '#D97706' },
{ name: 'Emerald', value: '#10B981' },
{ name: 'Rose', value: '#F43F5E' },
];
// Frame Options
const FRAME_OPTIONS = [
{ id: 'none', label: 'No Frame' },
{ id: 'scanme', label: 'Scan Me' },
{ id: 'sms', label: 'SMS Us' },
{ id: 'text', label: 'Text Us' },
];
export default function SMSGenerator() {
const [phone, setPhone] = useState('');
const [message, setMessage] = useState('');
const [qrColor, setQrColor] = useState(BRAND.primary);
const [frameType, setFrameType] = useState('none');
const qrRef = useRef<HTMLDivElement>(null);
// sms:number?body=message
const qrValue = `sms:${phone}?body=${encodeURIComponent(message)}`;
const handleDownload = async (format: 'png' | 'svg') => {
if (!qrRef.current) return;
try {
if (format === 'png') {
const { toPng } = await import('html-to-image');
const dataUrl = await toPng(qrRef.current, { cacheBust: true, pixelRatio: 3 });
const link = document.createElement('a');
link.download = `sms-qr-code.png`;
link.href = dataUrl;
link.click();
} else {
const svgData = qrRef.current.querySelector('svg')?.outerHTML;
if (svgData) {
const blob = new Blob([svgData], { type: 'image/svg+xml;charset=utf-8' });
const url = URL.createObjectURL(blob);
const link = document.createElement('a');
link.href = url;
link.download = `sms-qr-code.svg`;
link.click();
}
}
} catch (err) {
console.error('Download failed', err);
}
};
const getFrameLabel = () => {
const frame = FRAME_OPTIONS.find(f => f.id === frameType);
return frame?.id !== 'none' ? frame?.label : null;
};
return (
<div className="w-full max-w-5xl mx-auto px-4 md:px-6">
{/* Main Generator Card */}
<div className="bg-white rounded-3xl shadow-2xl shadow-slate-900/10 overflow-hidden border border-slate-100">
<div className="grid lg:grid-cols-2">
{/* LEFT: Input Section */}
<div className="p-8 lg:p-10 space-y-8 border-r border-slate-100">
{/* SMS Details */}
<div className="space-y-6">
<h2 className="text-lg font-bold text-slate-900 flex items-center gap-2">
<MessageSquare className="w-5 h-5 text-orange-600" />
SMS Details
</h2>
<div className="space-y-4">
<div>
<label className="block text-sm font-medium text-slate-700 mb-2">Phone Number</label>
<Input
placeholder="+1 555 123 4567"
value={phone}
onChange={(e) => setPhone(e.target.value)}
className="h-12 text-base rounded-xl border-slate-200 focus:border-orange-600 focus:ring-orange-600"
/>
</div>
<div>
<label className="block text-sm font-medium text-slate-700 mb-2">Pre-filled Message</label>
<textarea
className="w-full h-32 p-4 border border-slate-200 rounded-xl focus:outline-none focus:ring-2 focus:ring-orange-600 resize-none text-slate-800 placeholder:text-slate-400"
placeholder="I'm interested in..."
value={message}
onChange={(e) => setMessage(e.target.value)}
maxLength={160}
/>
<p className="text-xs text-slate-500 mt-2 text-right">{message.length}/160</p>
</div>
</div>
</div>
<div className="border-t border-slate-100"></div>
{/* Design Options */}
<div className="space-y-6">
<h2 className="text-lg font-bold text-slate-900 flex items-center gap-2">
<Sparkles className="w-5 h-5 text-orange-600" />
Design Options
</h2>
{/* Color Picker */}
<div>
<label className="block text-sm font-medium text-slate-700 mb-3">QR Code Color</label>
<div className="flex flex-wrap gap-2">
{QR_COLORS.map((c) => (
<button
key={c.name}
onClick={() => setQrColor(c.value)}
className={cn(
"w-9 h-9 rounded-full border-2 flex items-center justify-center transition-all hover:scale-110",
qrColor === c.value ? "border-slate-900 ring-2 ring-offset-2 ring-slate-200" : "border-white shadow-md"
)}
style={{ backgroundColor: c.value }}
aria-label={`Select ${c.name}`}
title={c.name}
>
{qrColor === c.value && <Check className="w-4 h-4 text-white" strokeWidth={3} />}
</button>
))}
</div>
</div>
{/* Frame Selector */}
<div>
<label className="block text-sm font-medium text-slate-700 mb-3">Frame Label</label>
<div className="grid grid-cols-4 gap-2">
{FRAME_OPTIONS.map((frame) => (
<button
key={frame.id}
onClick={() => setFrameType(frame.id)}
className={cn(
"py-2.5 px-3 rounded-lg text-sm font-medium transition-all border",
frameType === frame.id
? "bg-orange-600 text-white border-orange-600"
: "bg-slate-50 text-slate-600 border-slate-200 hover:border-slate-300"
)}
>
{frame.label}
</button>
))}
</div>
</div>
</div>
</div>
{/* RIGHT: Preview Section */}
<div className="p-8 lg:p-10 flex flex-col items-center justify-center" style={{ backgroundColor: BRAND.paleGrey }}>
{/* QR Card with Frame */}
<div
ref={qrRef}
className="bg-white rounded-3xl shadow-xl p-8 flex flex-col items-center"
style={{ minWidth: '320px' }}
>
{/* Frame Label */}
{getFrameLabel() && (
<div
className="mb-5 px-8 py-2.5 rounded-full text-white font-bold text-sm tracking-widest uppercase shadow-md"
style={{ backgroundColor: qrColor }}
>
{getFrameLabel()}
</div>
)}
{/* QR Code */}
<div className="bg-white">
<QRCodeSVG
value={phone ? qrValue : "sms:+123456789?body=Hello"}
size={240}
level="M"
includeMargin={false}
fgColor={qrColor}
/>
</div>
{/* Info Preview */}
<div className="mt-6 text-center max-w-[260px]">
<h3 className="font-bold text-slate-900 text-lg flex items-center justify-center gap-2 truncate">
<Phone className="w-4 h-4 text-slate-400 shrink-0" />
<span className="truncate">{phone || 'Number'}</span>
</h3>
<div className="flex items-center justify-center gap-2 mt-2 text-slate-500 text-xs">
<MessageSquare className="w-3 h-3" />
<span className="italic truncate">{message || 'Your message...'}</span>
</div>
</div>
</div>
{/* Download Buttons */}
<div className="flex items-center gap-3 mt-8">
<Button
onClick={() => handleDownload('png')}
className="bg-orange-600 hover:bg-orange-700 text-white shadow-lg"
>
<Download className="w-4 h-4 mr-2" />
Download PNG
</Button>
<Button
onClick={() => handleDownload('svg')}
variant="outline"
className="border-slate-300 hover:bg-white"
>
<Download className="w-4 h-4 mr-2" />
SVG
</Button>
</div>
<p className="text-xs text-slate-500 mt-4 text-center">
Opens the messaging app with text pre-filled.
</p>
</div>
</div>
</div>
{/* Upsell Banner */}
<div className="mt-8 bg-gradient-to-r from-orange-600 to-orange-700 rounded-2xl p-6 flex flex-col sm:flex-row items-center justify-between gap-4">
<div className="text-white text-center sm:text-left">
<h3 className="font-bold text-lg">Use SMS for marketing?</h3>
<p className="text-white/80 text-sm mt-1">
Dynamic QR Codes offer better tracking and allow you to change the campaign message later.
</p>
</div>
<Link href="/signup">
<Button className="bg-white text-orange-700 hover:bg-slate-100 shrink-0 shadow-lg">
Try Dynamic Codes
</Button>
</Link>
</div>
</div>
);
}

View File

@@ -0,0 +1,315 @@
import React from 'react';
import type { Metadata } from 'next';
import SMSGenerator from './SMSGenerator';
import { MessageSquare, Shield, Zap, Smartphone, Send } from 'lucide-react';
import { QRCodeSVG } from 'qrcode.react';
import { ToolBreadcrumb } from '@/components/seo/BreadcrumbSchema';
// SEO Optimized Metadata
export const metadata: Metadata = {
title: 'Free SMS QR Code Generator | Pre-filled Texts | QR Master',
description: 'Create a QR code to send an SMS text message instantly. Pre-fill the phone number and message body. Free, private, and works on all phones.',
keywords: ['sms qr code', 'text message qr code', 'send sms qr', 'sms generator', 'text qr'],
alternates: {
canonical: 'https://qrmaster.io/tools/sms-qr-code',
},
openGraph: {
title: 'Free SMS QR Code Generator | QR Master',
description: 'Generate QR codes for instant SMS messages. Pre-fill text and number.',
type: 'website',
url: 'https://qrmaster.io/tools/sms-qr-code',
images: [{ url: '/og-sms-generator.png', width: 1200, height: 630 }],
},
twitter: {
card: 'summary_large_image',
title: 'Free SMS QR Code Generator',
description: 'Create QR codes to send texts. Instant and free.',
},
robots: {
index: true,
follow: true,
},
};
// JSON-LD Structured Data
const jsonLd = {
'@context': 'https://schema.org',
'@graph': [
{
'@type': 'SoftwareApplication',
name: 'SMS QR Code Generator',
applicationCategory: 'UtilitiesApplication',
operatingSystem: 'Web Browser',
offers: {
'@type': 'Offer',
price: '0',
priceCurrency: 'USD',
},
aggregateRating: {
'@type': 'AggregateRating',
ratingValue: '4.8',
ratingCount: '1350',
},
description: 'Generate QR codes that open the user\'s SMS app with a pre-filled message.',
},
{
'@type': 'HowTo',
name: 'How to Create an SMS QR Code',
description: 'Create a QR code that prepares a text message.',
step: [
{
'@type': 'HowToStep',
position: 1,
name: 'Enter Phone Number',
text: 'Type the destination phone number.',
},
{
'@type': 'HowToStep',
position: 2,
name: 'Enter Message',
text: 'Type the message you want pre-filled (e.g., "Send me info!").',
},
{
'@type': 'HowToStep',
position: 3,
name: 'Download',
text: 'Save the QR code and share it.',
},
],
totalTime: 'PT30S',
},
{
'@type': 'FAQPage',
mainEntity: [
{
'@type': 'Question',
name: 'Does the text send automatically?',
acceptedAnswer: {
'@type': 'Answer',
text: 'No. The QR code opens the messaging app with the text typed out. The user must simply tap "Send". This is a security feature of all smartphones.',
},
},
{
'@type': 'Question',
name: 'Is there a cost?',
acceptedAnswer: {
'@type': 'Answer',
text: 'Generating the code is free. Standard SMS rates apply for the person sending the text message, depending on their carrier plan.',
},
},
{
'@type': 'Question',
name: 'Can I change the message later?',
acceptedAnswer: {
'@type': 'Answer',
text: 'No. Static QR codes have the message embedded in them. To change the message, you need a new QR code.',
},
},
{
'@type': 'Question',
name: 'What uses are there for SMS QR codes?',
acceptedAnswer: {
'@type': 'Answer',
text: 'They are great for SMS marketing opt-ins ("Text JOIN to 12345"), customer support requests, or voting via text.',
},
},
],
},
],
};
export default function SMSQRCodePage() {
return (
<>
<script
type="application/ld+json"
dangerouslySetInnerHTML={{ __html: JSON.stringify(jsonLd) }}
/>
<ToolBreadcrumb toolName="SMS QR Code Generator" toolSlug="sms-qr-code" />
<div className="min-h-screen" style={{ backgroundColor: '#EBEBDF' }}>
{/* HERO SECTION */}
<section className="relative pt-20 pb-20 lg:pt-32 lg:pb-32 px-4 sm:px-6 lg:px-8 overflow-hidden" style={{ backgroundColor: '#ea580c' }}>
<div className="absolute inset-0 opacity-10">
<svg className="w-full h-full" viewBox="0 0 100 100" preserveAspectRatio="none">
<path d="M0 100 C 20 0 50 0 100 100 Z" fill="url(#grad1)" />
<defs>
<linearGradient id="grad1" x1="0%" y1="0%" x2="100%" y2="0%">
<stop offset="0%" style={{ stopColor: 'white', stopOpacity: 1 }} />
<stop offset="100%" style={{ stopColor: 'white', stopOpacity: 0 }} />
</linearGradient>
</defs>
</svg>
</div>
<div className="max-w-7xl mx-auto grid lg:grid-cols-2 gap-12 items-center relative z-10">
<div className="text-center lg:text-left">
<div className="inline-flex items-center gap-2 px-3 py-1 rounded-full bg-white/10 text-white/90 text-sm font-medium mb-6 backdrop-blur-sm border border-white/10 hover:bg-white/20 transition-colors cursor-default">
<span className="flex h-2 w-2 relative">
<span className="animate-ping absolute inline-flex h-full w-full rounded-full bg-amber-400 opacity-75"></span>
<span className="relative inline-flex rounded-full h-2 w-2 bg-amber-400"></span>
</span>
Free Tool No Signup Required
</div>
<h1 className="text-4xl md:text-5xl lg:text-6xl font-extrabold text-white tracking-tight leading-tight mb-6">
Make Texting Easy with <br className="hidden lg:block" />
<span className="text-transparent bg-clip-text bg-gradient-to-r from-amber-200 to-orange-100">SMS QR Codes</span>
</h1>
<p className="text-lg md:text-xl text-orange-50 max-w-2xl mx-auto lg:mx-0 mb-8 leading-relaxed">
Let users send you a pre-written text with one scan. Ideal for opt-ins and support.
<strong className="text-white block sm:inline mt-2 sm:mt-0"> Universal compatibility.</strong>
</p>
<div className="flex flex-wrap justify-center lg:justify-start gap-4 text-sm font-medium text-white/80">
<div className="flex items-center gap-2 bg-white/5 px-4 py-2.5 rounded-xl border border-white/5 backdrop-blur-sm">
<MessageSquare className="w-4 h-4 text-amber-300" />
Pre-fill Texts
</div>
<div className="flex items-center gap-2 bg-white/5 px-4 py-2.5 rounded-xl border border-white/5 backdrop-blur-sm">
<Zap className="w-4 h-4 text-amber-300" />
Instant Open
</div>
<div className="flex items-center gap-2 bg-white/5 px-4 py-2.5 rounded-xl border border-white/5 backdrop-blur-sm">
<Shield className="w-4 h-4 text-amber-300" />
Zero Friction
</div>
</div>
</div>
{/* Visual Abstract */}
<div className="hidden lg:flex relative items-center justify-center min-h-[400px]">
<div className="absolute w-[500px] h-[500px] bg-orange-500/30 rounded-full blur-[100px] -top-20 -right-20 animate-pulse" />
<div className="relative w-80 h-96 bg-white/5 backdrop-blur-xl border border-white/20 rounded-3xl shadow-2xl flex flex-col items-center justify-center p-8 transform -rotate-3 hover:rotate-0 transition-all duration-700 group">
<div className="absolute inset-0 bg-gradient-to-br from-white/10 to-transparent rounded-3xl" />
<div className="w-full bg-white rounded-xl shadow-lg p-3 mb-6 relative overflow-hidden flex gap-3 items-center">
<div className="w-10 h-10 rounded-full bg-orange-100 flex items-center justify-center shrink-0">
<MessageSquare className="w-5 h-5 text-orange-600" />
</div>
<div className="bg-slate-100 rounded-2xl rounded-tl-none p-3 text-xs text-slate-600 w-full">
Hi, I want to join the club!
</div>
</div>
<div className="w-48 h-48 bg-white rounded-xl p-2 shadow-inner relative overflow-hidden flex items-center justify-center">
<QRCodeSVG value="https://www.qrmaster.net" size={170} fgColor="#0f172a" level="Q" />
</div>
{/* Floating Badge */}
<div className="absolute -bottom-6 -left-6 bg-white py-3 px-5 rounded-xl shadow-xl flex items-center gap-3 transform transition-transform hover:scale-105 duration-300">
<div className="bg-orange-100 p-2 rounded-full">
<Send className="w-5 h-5 text-orange-600" />
</div>
<div className="text-left">
<div className="text-[10px] text-slate-400 font-bold uppercase tracking-wider">SMS</div>
<div className="text-sm font-bold text-slate-900">Sent!</div>
</div>
</div>
</div>
</div>
</div>
</section>
{/* GENERATOR SECTION */}
<section className="py-12 px-4 sm:px-6 lg:px-8 -mt-8">
<SMSGenerator />
</section>
{/* HOW IT WORKS */}
<section className="py-16 px-4 sm:px-6 lg:px-8 bg-white">
<div className="max-w-4xl mx-auto">
<h2 className="text-3xl font-bold text-slate-900 text-center mb-12">
How SMS QR Codes Work
</h2>
<div className="grid md:grid-cols-3 gap-8">
<article className="text-center">
<div className="w-14 h-14 rounded-2xl bg-orange-50 flex items-center justify-center mx-auto mb-4">
<MessageSquare className="w-7 h-7 text-orange-600" />
</div>
<h3 className="font-bold text-slate-900 mb-2">1. Compose</h3>
<p className="text-slate-600 text-sm">
Enter the number and the message you want your customers to send.
</p>
</article>
<article className="text-center">
<div className="w-14 h-14 rounded-2xl bg-orange-50 flex items-center justify-center mx-auto mb-4">
<Smartphone className="w-7 h-7 text-orange-600" />
</div>
<h3 className="font-bold text-slate-900 mb-2">2. Scan</h3>
<p className="text-slate-600 text-sm">
User scans the code. The messages app opens automatically.
</p>
</article>
<article className="text-center">
<div className="w-14 h-14 rounded-2xl bg-orange-50 flex items-center justify-center mx-auto mb-4">
<Send className="w-7 h-7 text-orange-600" />
</div>
<h3 className="font-bold text-slate-900 mb-2">3. Send</h3>
<p className="text-slate-600 text-sm">
User hits "Send" to trigger the text. Perfect for quick sign-ups or votes.
</p>
</article>
</div>
</div>
</section>
{/* FAQ SECTION */}
<section className="py-16 px-4 sm:px-6 lg:px-8" style={{ backgroundColor: '#EBEBDF' }}>
<div className="max-w-3xl mx-auto">
<h2 className="text-3xl font-bold text-slate-900 text-center mb-4">
Frequently Asked Questions
</h2>
<p className="text-slate-600 text-center mb-10">
Common questions about SMS QR codes.
</p>
<div className="space-y-4">
<FaqItem
question="Does the user need an internet connection?"
answer="No. The QR code contains all the info offline. However, the user needs a cellular signal to actually send the SMS message."
/>
<FaqItem
question="Is it free for the user to send?"
answer="It depends on their mobile plan. Standard SMS rates apply, though most modern plans include unlimited texting."
/>
<FaqItem
question="Can I use shortcodes?"
answer="Yes. You can enter a shortcode (e.g. 55555) in the phone number field instead of a regular number."
/>
<FaqItem
question="Is my phone number visible?"
answer="Yes. Since the user is sending a text to you, they will see your number (or shortcode) in their messaging app."
/>
</div>
</div>
</section>
</div>
</>
);
}
function FaqItem({ question, answer }: { question: string; answer: string }) {
return (
<details className="group bg-white rounded-xl shadow-sm border border-slate-200 overflow-hidden">
<summary className="flex items-center justify-between p-5 cursor-pointer list-none text-slate-900 font-semibold hover:bg-slate-50 transition-colors">
{question}
<span className="transition group-open:rotate-180 text-slate-400">
<svg fill="none" height="20" stroke="currentColor" strokeLinecap="round" strokeLinejoin="round" strokeWidth="2" viewBox="0 0 24 24" width="20">
<path d="M6 9l6 6 6-6" />
</svg>
</span>
</summary>
<div className="text-slate-600 px-5 pb-5 pt-0 leading-relaxed text-sm">
{answer}
</div>
</details>
);
}

View File

@@ -0,0 +1,319 @@
'use client';
import React, { useState, useRef } from 'react';
import Link from 'next/link';
import { QRCodeSVG } from 'qrcode.react';
import {
Users,
Download,
Check,
Sparkles,
Video,
MessageCircle
} from 'lucide-react';
import { Button } from '@/components/ui/Button';
import { Input } from '@/components/ui/Input';
import { cn } from '@/lib/utils';
// Brand Colors - Microsoft Teams Purple
const BRAND = {
paleGrey: '#F3F2F1',
primary: '#6264A7',
primaryDark: '#464775',
};
// QR Color Options
const QR_COLORS = [
{ name: 'Teams Purple', value: '#6264A7' },
{ name: 'Teams Dark', value: '#464775' },
{ name: 'Classic Black', value: '#000000' },
{ name: 'Indigo', value: '#4F46E5' },
{ name: 'Violet', value: '#7C3AED' },
{ name: 'Emerald', value: '#10B981' },
{ name: 'Rose', value: '#F43F5E' },
];
// Frame Options
const FRAME_OPTIONS = [
{ id: 'none', label: 'No Frame' },
{ id: 'scanme', label: 'Scan Me' },
{ id: 'join', label: 'Join Meeting' },
{ id: 'teams', label: 'Teams' },
];
// Link Type Options
const LINK_TYPES = [
{ id: 'meeting', label: 'Meeting Link', icon: Video },
{ id: 'chat', label: 'Chat with User', icon: MessageCircle },
];
export default function TeamsGenerator() {
const [linkType, setLinkType] = useState('meeting');
const [meetingUrl, setMeetingUrl] = useState('');
const [userEmail, setUserEmail] = useState('');
const [qrColor, setQrColor] = useState(BRAND.primary);
const [frameType, setFrameType] = useState('none');
const qrRef = useRef<HTMLDivElement>(null);
// Generate Teams link
const generateTeamsLink = () => {
if (linkType === 'meeting') {
// If user pastes full Teams meeting URL, use it directly
if (meetingUrl.trim().includes('teams.microsoft.com') || meetingUrl.trim().includes('teams.live.com')) {
return meetingUrl.trim();
}
// Otherwise return placeholder
return meetingUrl.trim() || 'https://teams.microsoft.com';
} else {
// Chat link with email
if (!userEmail.trim()) return 'https://teams.microsoft.com';
return `https://teams.microsoft.com/l/chat/0/0?users=${encodeURIComponent(userEmail.trim())}`;
}
};
const handleDownload = async (format: 'png' | 'svg') => {
if (!qrRef.current) return;
try {
if (format === 'png') {
const { toPng } = await import('html-to-image');
const dataUrl = await toPng(qrRef.current, { cacheBust: true, pixelRatio: 3 });
const link = document.createElement('a');
link.download = `teams-qr-code.png`;
link.href = dataUrl;
link.click();
} else {
const svgData = qrRef.current.querySelector('svg')?.outerHTML;
if (svgData) {
const blob = new Blob([svgData], { type: 'image/svg+xml;charset=utf-8' });
const url = URL.createObjectURL(blob);
const link = document.createElement('a');
link.href = url;
link.download = `teams-qr-code.svg`;
link.click();
}
}
} catch (err) {
console.error('Download failed', err);
}
};
const getFrameLabel = () => {
const frame = FRAME_OPTIONS.find(f => f.id === frameType);
return frame?.id !== 'none' ? frame?.label : null;
};
return (
<div className="w-full max-w-5xl mx-auto px-4 md:px-6">
{/* Main Generator Card */}
<div className="bg-white rounded-3xl shadow-2xl shadow-slate-900/10 overflow-hidden border border-slate-100">
<div className="grid lg:grid-cols-2">
{/* LEFT: Input Section */}
<div className="p-8 lg:p-10 space-y-8 border-r border-slate-100">
{/* Teams Details */}
<div className="space-y-6">
<h2 className="text-lg font-bold text-slate-900 flex items-center gap-2">
<Users className="w-5 h-5 text-[#6264A7]" />
Microsoft Teams
</h2>
<div className="space-y-4">
{/* Link Type Toggle */}
<div>
<label className="block text-sm font-medium text-slate-700 mb-2">What do you want to share?</label>
<div className="grid grid-cols-2 gap-3">
{LINK_TYPES.map((type) => (
<button
key={type.id}
onClick={() => setLinkType(type.id)}
className={cn(
"flex items-center justify-center gap-2 py-3 px-4 rounded-xl font-medium transition-all border",
linkType === type.id
? "bg-[#6264A7] text-white border-[#6264A7]"
: "bg-slate-50 text-slate-600 border-slate-200 hover:border-slate-300"
)}
>
<type.icon className="w-4 h-4" />
{type.label}
</button>
))}
</div>
</div>
{linkType === 'meeting' ? (
<div>
<label className="block text-sm font-medium text-slate-700 mb-2">Teams Meeting URL</label>
<Input
placeholder="Paste your Teams meeting link here"
value={meetingUrl}
onChange={(e) => setMeetingUrl(e.target.value)}
className="h-12 text-base rounded-xl border-slate-200 focus:border-[#6264A7] focus:ring-[#6264A7]"
/>
<p className="text-xs text-slate-500 mt-2">
Copy the meeting link from your Teams calendar invite.
</p>
</div>
) : (
<div>
<label className="block text-sm font-medium text-slate-700 mb-2">User Email Address</label>
<Input
type="email"
placeholder="e.g. colleague@company.com"
value={userEmail}
onChange={(e) => setUserEmail(e.target.value)}
className="h-12 text-base rounded-xl border-slate-200 focus:border-[#6264A7] focus:ring-[#6264A7]"
/>
<p className="text-xs text-slate-500 mt-2">
The person's work email to start a Teams chat.
</p>
</div>
)}
</div>
</div>
<div className="border-t border-slate-100"></div>
{/* Design Options */}
<div className="space-y-6">
<h2 className="text-lg font-bold text-slate-900 flex items-center gap-2">
<Sparkles className="w-5 h-5 text-[#6264A7]" />
Design Options
</h2>
{/* Color Picker */}
<div>
<label className="block text-sm font-medium text-slate-700 mb-3">QR Code Color</label>
<div className="flex flex-wrap gap-2">
{QR_COLORS.map((c) => (
<button
key={c.name}
onClick={() => setQrColor(c.value)}
className={cn(
"w-9 h-9 rounded-full border-2 flex items-center justify-center transition-all hover:scale-110",
qrColor === c.value ? "border-slate-900 ring-2 ring-offset-2 ring-slate-200" : "border-white shadow-md"
)}
style={{ backgroundColor: c.value }}
aria-label={`Select ${c.name}`}
title={c.name}
>
{qrColor === c.value && <Check className="w-4 h-4 text-white" strokeWidth={3} />}
</button>
))}
</div>
</div>
{/* Frame Selector */}
<div>
<label className="block text-sm font-medium text-slate-700 mb-3">Frame Label</label>
<div className="grid grid-cols-4 gap-2">
{FRAME_OPTIONS.map((frame) => (
<button
key={frame.id}
onClick={() => setFrameType(frame.id)}
className={cn(
"py-2.5 px-2 rounded-lg text-xs font-medium transition-all border",
frameType === frame.id
? "bg-[#6264A7] text-white border-[#6264A7]"
: "bg-slate-50 text-slate-600 border-slate-200 hover:border-slate-300"
)}
>
{frame.label}
</button>
))}
</div>
</div>
</div>
</div>
{/* RIGHT: Preview Section */}
<div className="p-8 lg:p-10 flex flex-col items-center justify-center" style={{ backgroundColor: BRAND.paleGrey }}>
{/* QR Card with Frame */}
<div
ref={qrRef}
className="bg-white rounded-3xl shadow-xl p-8 flex flex-col items-center"
style={{ minWidth: '320px' }}
>
{/* Frame Label */}
{getFrameLabel() && (
<div
className="mb-5 px-8 py-2.5 rounded-full text-white font-bold text-sm tracking-widest uppercase shadow-md"
style={{ backgroundColor: qrColor }}
>
{getFrameLabel()}
</div>
)}
{/* QR Code */}
<div className="bg-white">
<QRCodeSVG
value={generateTeamsLink()}
size={240}
level="M"
includeMargin={false}
fgColor={qrColor}
/>
</div>
{/* Teams Info */}
<div className="mt-6 text-center max-w-[260px]">
<h3 className="font-bold text-slate-900 text-lg flex items-center justify-center gap-2">
{linkType === 'meeting' ? (
<Video className="w-4 h-4 text-[#6264A7] shrink-0" />
) : (
<MessageCircle className="w-4 h-4 text-[#6264A7] shrink-0" />
)}
<span className="truncate">
{linkType === 'meeting' ? 'Teams Meeting' : (userEmail || 'Teams Chat')}
</span>
</h3>
<p className="text-sm text-slate-500 mt-1">
{linkType === 'meeting' ? 'Join Meeting' : 'Start Chat'}
</p>
</div>
</div>
{/* Download Buttons */}
<div className="flex items-center gap-3 mt-8">
<Button
onClick={() => handleDownload('png')}
className="bg-[#6264A7] hover:bg-[#464775] text-white shadow-lg"
>
<Download className="w-4 h-4 mr-2" />
Download PNG
</Button>
<Button
onClick={() => handleDownload('svg')}
variant="outline"
className="border-slate-300 hover:bg-white"
>
<Download className="w-4 h-4 mr-2" />
SVG
</Button>
</div>
<p className="text-xs text-slate-500 mt-4 text-center">
Works with Microsoft Teams desktop and mobile apps.
</p>
</div>
</div>
</div>
{/* Upsell Banner */}
<div className="mt-8 bg-gradient-to-r from-[#6264A7] to-[#464775] rounded-2xl p-6 flex flex-col sm:flex-row items-center justify-between gap-4">
<div className="text-white text-center sm:text-left">
<h3 className="font-bold text-lg">Need to update meeting links?</h3>
<p className="text-white/80 text-sm mt-1">Dynamic QR Codes let you change the destination without reprinting.</p>
</div>
<Link href="/signup">
<Button className="bg-white text-[#6264A7] hover:bg-slate-100 shrink-0 shadow-lg">
Create Dynamic QR
</Button>
</Link>
</div>
</div>
);
}

View File

@@ -0,0 +1,331 @@
import React from 'react';
import type { Metadata } from 'next';
import TeamsGenerator from './TeamsGenerator';
import { Users, Shield, Zap, Video, MessageCircle, Download, Share2 } from 'lucide-react';
import { QRCodeSVG } from 'qrcode.react';
import { ToolBreadcrumb } from '@/components/seo/BreadcrumbSchema';
// SEO Optimized Metadata
export const metadata: Metadata = {
title: 'Free Microsoft Teams QR Code Generator | Join Meetings Instantly | QR Master',
description: 'Create a QR code for your Microsoft Teams meeting. Attendees scan to join instantly. Perfect for conference rooms, hybrid meetings, and event displays.',
keywords: ['teams qr code', 'microsoft teams meeting qr', 'join teams qr code', 'meeting room qr', 'teams invitation qr', 'hybrid meeting qr code'],
alternates: {
canonical: 'https://qrmaster.io/tools/teams-qr-code',
},
openGraph: {
title: 'Free Microsoft Teams QR Code Generator | QR Master',
description: 'Generate QR codes for Teams meetings. One scan to join instantly.',
type: 'website',
url: 'https://qrmaster.io/tools/teams-qr-code',
images: [{ url: '/og-teams-generator.png', width: 1200, height: 630 }],
},
twitter: {
card: 'summary_large_image',
title: 'Free Microsoft Teams QR Code Generator',
description: 'Create Teams meeting QR codes. Instant and free.',
},
robots: {
index: true,
follow: true,
},
};
// JSON-LD Structured Data
const jsonLd = {
'@context': 'https://schema.org',
'@graph': [
{
'@type': 'SoftwareApplication',
name: 'Microsoft Teams QR Code Generator',
applicationCategory: 'BusinessApplication',
operatingSystem: 'Web Browser',
offers: {
'@type': 'Offer',
price: '0',
priceCurrency: 'USD',
},
aggregateRating: {
'@type': 'AggregateRating',
ratingValue: '4.9',
ratingCount: '890',
},
description: 'Generate QR codes that let people join your Microsoft Teams meeting with one scan.',
},
{
'@type': 'HowTo',
name: 'How to Create a Microsoft Teams QR Code',
description: 'Create a QR code for joining Teams meetings.',
step: [
{
'@type': 'HowToStep',
position: 1,
name: 'Copy Meeting Link',
text: 'Copy the Teams meeting URL from your calendar invitation.',
},
{
'@type': 'HowToStep',
position: 2,
name: 'Paste Link',
text: 'Paste the meeting link into the generator.',
},
{
'@type': 'HowToStep',
position: 3,
name: 'Customize',
text: 'Choose Teams colors and add a frame label.',
},
{
'@type': 'HowToStep',
position: 4,
name: 'Download',
text: 'Download your QR code and display it in your meeting room.',
},
],
totalTime: 'PT30S',
},
{
'@type': 'FAQPage',
mainEntity: [
{
'@type': 'Question',
name: 'What happens when someone scans the QR code?',
acceptedAnswer: {
'@type': 'Answer',
text: 'Microsoft Teams opens and the user is prompted to join the meeting. Works on desktop, mobile, and web.',
},
},
{
'@type': 'Question',
name: 'Does it work for recurring meetings?',
acceptedAnswer: {
'@type': 'Answer',
text: 'Yes! If your recurring meeting uses the same meeting link, the QR code will work for all sessions.',
},
},
{
'@type': 'Question',
name: 'Can guests without Teams accounts join?',
acceptedAnswer: {
'@type': 'Answer',
text: 'Yes. Guests can join Teams meetings via the web browser without needing a Microsoft account.',
},
},
{
'@type': 'Question',
name: 'Is this for personal or business Teams?',
acceptedAnswer: {
'@type': 'Answer',
text: 'Both! Works with Microsoft Teams for work, school, and personal accounts.',
},
},
],
},
],
};
export default function TeamsQRCodePage() {
return (
<>
<script
type="application/ld+json"
dangerouslySetInnerHTML={{ __html: JSON.stringify(jsonLd) }}
/>
<ToolBreadcrumb toolName="Teams QR Code Generator" toolSlug="teams-qr-code" />
<div className="min-h-screen" style={{ backgroundColor: '#EBEBDF' }}>
{/* HERO SECTION */}
<section className="relative pt-20 pb-20 lg:pt-32 lg:pb-32 px-4 sm:px-6 lg:px-8 overflow-hidden" style={{ backgroundColor: '#6264A7' }}>
<div className="absolute inset-0 opacity-10">
<svg className="w-full h-full" viewBox="0 0 100 100" preserveAspectRatio="none">
<path d="M0 100 C 20 0 50 0 100 100 Z" fill="url(#grad1)" />
<defs>
<linearGradient id="grad1" x1="0%" y1="0%" x2="100%" y2="0%">
<stop offset="0%" style={{ stopColor: 'white', stopOpacity: 1 }} />
<stop offset="100%" style={{ stopColor: 'white', stopOpacity: 0 }} />
</linearGradient>
</defs>
</svg>
</div>
<div className="max-w-7xl mx-auto grid lg:grid-cols-2 gap-12 items-center relative z-10">
<div className="text-center lg:text-left">
<div className="inline-flex items-center gap-2 px-3 py-1 rounded-full bg-white/10 text-white/90 text-sm font-medium mb-6 backdrop-blur-sm border border-white/10 hover:bg-white/20 transition-colors cursor-default">
<span className="flex h-2 w-2 relative">
<span className="animate-ping absolute inline-flex h-full w-full rounded-full bg-white opacity-75"></span>
<span className="relative inline-flex rounded-full h-2 w-2 bg-white"></span>
</span>
Free Tool No Signup Required
</div>
<h1 className="text-4xl md:text-5xl lg:text-6xl font-extrabold text-white tracking-tight leading-tight mb-6">
Join Meetings with <br className="hidden lg:block" />
<span className="text-transparent bg-clip-text bg-gradient-to-r from-violet-200 to-white">Teams QR Codes</span>
</h1>
<p className="text-lg md:text-xl text-violet-100 max-w-2xl mx-auto lg:mx-0 mb-8 leading-relaxed">
Create QR codes for Microsoft Teams meetings. Attendees scan to join instantly.
<strong className="text-white block sm:inline mt-2 sm:mt-0"> Perfect for hybrid workplaces.</strong>
</p>
<div className="flex flex-wrap justify-center lg:justify-start gap-4 text-sm font-medium text-white/80">
<div className="flex items-center gap-2 bg-white/5 px-4 py-2.5 rounded-xl border border-white/5 backdrop-blur-sm">
<Video className="w-4 h-4 text-white" />
Meeting Links
</div>
<div className="flex items-center gap-2 bg-white/5 px-4 py-2.5 rounded-xl border border-white/5 backdrop-blur-sm">
<MessageCircle className="w-4 h-4 text-white" />
Chat Links
</div>
<div className="flex items-center gap-2 bg-white/5 px-4 py-2.5 rounded-xl border border-white/5 backdrop-blur-sm">
<Zap className="w-4 h-4 text-amber-300" />
Instant Join
</div>
</div>
</div>
{/* Visual Abstract */}
<div className="hidden lg:flex relative items-center justify-center min-h-[400px]">
<div className="absolute w-[500px] h-[500px] bg-violet-400/30 rounded-full blur-[100px] -top-20 -right-20 animate-pulse" />
<div className="relative w-80 h-96 bg-white/5 backdrop-blur-xl border border-white/20 rounded-3xl shadow-2xl flex flex-col items-center justify-center p-8 transform rotate-3 hover:rotate-0 transition-all duration-700 group">
<div className="absolute inset-0 bg-gradient-to-br from-white/10 to-transparent rounded-3xl" />
{/* Meeting Card Mock */}
<div className="w-full bg-white rounded-xl shadow-lg p-4 mb-6 relative overflow-hidden">
<div className="flex items-center gap-3 mb-3">
<div className="w-10 h-10 bg-[#6264A7] rounded-lg flex items-center justify-center">
<Users className="w-5 h-5 text-white" />
</div>
<div>
<div className="font-bold text-slate-900 text-sm">Team Standup</div>
<div className="text-xs text-slate-500">Daily at 9:00 AM</div>
</div>
</div>
<div className="flex gap-2">
<div className="bg-green-100 text-green-700 text-xs px-2 py-1 rounded-full">Live Now</div>
<div className="bg-slate-100 text-slate-600 text-xs px-2 py-1 rounded-full">8 attending</div>
</div>
</div>
<div className="w-48 h-48 bg-white rounded-xl p-2 shadow-inner relative overflow-hidden flex items-center justify-center">
<QRCodeSVG value="https://www.qrmaster.net" size={170} fgColor="#6264A7" level="Q" />
</div>
{/* Floating Badge */}
<div className="absolute -bottom-6 -left-6 bg-white py-3 px-5 rounded-xl shadow-xl flex items-center gap-3 transform transition-transform hover:scale-105 duration-300">
<div className="bg-violet-100 p-2 rounded-full">
<Video className="w-5 h-5 text-[#6264A7]" />
</div>
<div className="text-left">
<div className="text-[10px] text-slate-400 font-bold uppercase tracking-wider">Status</div>
<div className="text-sm font-bold text-slate-900">Ready to Join</div>
</div>
</div>
</div>
</div>
</div>
</section>
{/* GENERATOR SECTION */}
<section className="py-12 px-4 sm:px-6 lg:px-8 -mt-8">
<TeamsGenerator />
</section>
{/* HOW IT WORKS */}
<section className="py-16 px-4 sm:px-6 lg:px-8 bg-white">
<div className="max-w-4xl mx-auto">
<h2 className="text-3xl font-bold text-slate-900 text-center mb-12">
How Teams QR Codes Work
</h2>
<div className="grid md:grid-cols-4 gap-8">
<article className="text-center">
<div className="w-12 h-12 rounded-2xl bg-[#6264A7]/10 flex items-center justify-center mx-auto mb-4">
<Video className="w-6 h-6 text-[#6264A7]" />
</div>
<h3 className="font-bold text-slate-900 mb-2">1. Get Link</h3>
<p className="text-slate-600 text-xs leading-relaxed">Copy your Teams meeting URL.</p>
</article>
<article className="text-center">
<div className="w-12 h-12 rounded-2xl bg-[#6264A7]/10 flex items-center justify-center mx-auto mb-4">
<Shield className="w-6 h-6 text-[#6264A7]" />
</div>
<h3 className="font-bold text-slate-900 mb-2">2. Paste</h3>
<p className="text-slate-600 text-xs leading-relaxed">Paste into the generator.</p>
</article>
<article className="text-center">
<div className="w-12 h-12 rounded-2xl bg-[#6264A7]/10 flex items-center justify-center mx-auto mb-4">
<Download className="w-6 h-6 text-[#6264A7]" />
</div>
<h3 className="font-bold text-slate-900 mb-2">3. Download</h3>
<p className="text-slate-600 text-xs leading-relaxed">Save your QR code.</p>
</article>
<article className="text-center">
<div className="w-12 h-12 rounded-2xl bg-[#6264A7]/10 flex items-center justify-center mx-auto mb-4">
<Share2 className="w-6 h-6 text-[#6264A7]" />
</div>
<h3 className="font-bold text-slate-900 mb-2">4. Display</h3>
<p className="text-slate-600 text-xs leading-relaxed">Put in meeting rooms or invites.</p>
</article>
</div>
</div>
</section>
{/* FAQ SECTION */}
<section className="py-16 px-4 sm:px-6 lg:px-8" style={{ backgroundColor: '#EBEBDF' }}>
<div className="max-w-3xl mx-auto">
<h2 className="text-3xl font-bold text-slate-900 text-center mb-4">
Frequently Asked Questions
</h2>
<p className="text-slate-600 text-center mb-10">
Common questions about Teams QR codes.
</p>
<div className="space-y-4">
<FaqItem
question="What happens when someone scans the QR code?"
answer="Microsoft Teams opens and the user is prompted to join the meeting. Works on desktop, mobile, and web browser."
/>
<FaqItem
question="Does it work for recurring meetings?"
answer="Yes! If your recurring meeting uses the same meeting link, the QR code will work for all sessions."
/>
<FaqItem
question="Can guests without Teams accounts join?"
answer="Yes. Guests can join Teams meetings via the web browser without needing a Microsoft account."
/>
<FaqItem
question="What about meeting rooms with digital displays?"
answer="Perfect for that! Display the QR code on your room's screen so attendees can scan to join from their devices."
/>
</div>
</div>
</section>
</div>
</>
);
}
function FaqItem({ question, answer }: { question: string; answer: string }) {
return (
<details className="group bg-white rounded-xl shadow-sm border border-slate-200 overflow-hidden">
<summary className="flex items-center justify-between p-5 cursor-pointer list-none text-slate-900 font-semibold hover:bg-slate-50 transition-colors">
{question}
<span className="transition group-open:rotate-180 text-slate-400">
<svg fill="none" height="20" stroke="currentColor" strokeLinecap="round" strokeLinejoin="round" strokeWidth="2" viewBox="0 0 24 24" width="20">
<path d="M6 9l6 6 6-6" />
</svg>
</span>
</summary>
<div className="text-slate-600 px-5 pb-5 pt-0 leading-relaxed text-sm">
{answer}
</div>
</details>
);
}

View File

@@ -0,0 +1,246 @@
'use client';
import React, { useState, useRef } from 'react';
import Link from 'next/link';
import { QRCodeSVG } from 'qrcode.react';
import {
Type,
Download,
Check,
Sparkles,
Copy,
FileText
} from 'lucide-react';
import { Button } from '@/components/ui/Button';
import { cn } from '@/lib/utils';
// Brand Colors
const BRAND = {
paleGrey: '#EBEBDF',
richBlue: '#1A1265',
richBlueLight: '#2A2275',
};
// QR Color Options
const QR_COLORS = [
{ name: 'Classic Black', value: '#000000' },
{ name: 'Deep Blue', value: '#1E40AF' },
{ name: 'Violet', value: '#7C3AED' },
{ name: 'Teal', value: '#0D9488' },
{ name: 'Coral', value: '#F43F5E' },
{ name: 'Amber', value: '#D97706' },
{ name: 'Emerald', value: '#10B981' },
{ name: 'Rose', value: '#F43F5E' },
];
// Frame Options
const FRAME_OPTIONS = [
{ id: 'none', label: 'No Frame' },
{ id: 'scanme', label: 'Scan Me' },
{ id: 'text', label: 'Text' },
{ id: 'message', label: 'Message' },
];
export default function TextGenerator() {
const [text, setText] = useState('');
const [qrColor, setQrColor] = useState(BRAND.richBlue);
const [frameType, setFrameType] = useState('none');
const qrRef = useRef<HTMLDivElement>(null);
const handleDownload = async (format: 'png' | 'svg') => {
if (!qrRef.current) return;
try {
if (format === 'png') {
const { toPng } = await import('html-to-image');
const dataUrl = await toPng(qrRef.current, { cacheBust: true, pixelRatio: 3 });
const link = document.createElement('a');
link.download = `text-qr-code.png`;
link.href = dataUrl;
link.click();
} else {
const svgData = qrRef.current.querySelector('svg')?.outerHTML;
if (svgData) {
const blob = new Blob([svgData], { type: 'image/svg+xml;charset=utf-8' });
const url = URL.createObjectURL(blob);
const link = document.createElement('a');
link.href = url;
link.download = `text-qr-code.svg`;
link.click();
}
}
} catch (err) {
console.error('Download failed', err);
}
};
const getFrameLabel = () => {
const frame = FRAME_OPTIONS.find(f => f.id === frameType);
return frame?.id !== 'none' ? frame?.label : null;
};
return (
<div className="w-full max-w-5xl mx-auto px-4 md:px-6">
{/* Main Generator Card */}
<div className="bg-white rounded-3xl shadow-2xl shadow-slate-900/10 overflow-hidden border border-slate-100">
<div className="grid lg:grid-cols-2">
{/* LEFT: Input Section */}
<div className="p-8 lg:p-10 space-y-8 border-r border-slate-100">
{/* Text Input */}
<div className="space-y-6">
<h2 className="text-lg font-bold text-slate-900 flex items-center gap-2">
<Type className="w-5 h-5 text-[#1A1265]" />
Enter Content
</h2>
<div className="relative">
<textarea
className="w-full h-40 p-4 pb-8 border border-slate-200 rounded-xl focus:outline-none focus:ring-2 focus:ring-[#1A1265] resize-none text-slate-800 placeholder:text-slate-400"
placeholder="Type your text here (up to 300 characters)..."
maxLength={300}
value={text}
onChange={(e) => setText(e.target.value)}
/>
<div className="absolute bottom-3 right-3 text-xs text-slate-400 font-medium">
{text.length}/300
</div>
</div>
</div>
<div className="border-t border-slate-100"></div>
{/* Design Options */}
<div className="space-y-6">
<h2 className="text-lg font-bold text-slate-900 flex items-center gap-2">
<Sparkles className="w-5 h-5 text-[#1A1265]" />
Design Options
</h2>
{/* Color Picker */}
<div>
<label className="block text-sm font-medium text-slate-700 mb-3">QR Code Color</label>
<div className="flex flex-wrap gap-2">
{QR_COLORS.map((c) => (
<button
key={c.name}
onClick={() => setQrColor(c.value)}
className={cn(
"w-9 h-9 rounded-full border-2 flex items-center justify-center transition-all hover:scale-110",
qrColor === c.value ? "border-slate-900 ring-2 ring-offset-2 ring-slate-200" : "border-white shadow-md"
)}
style={{ backgroundColor: c.value }}
aria-label={`Select ${c.name}`}
title={c.name}
>
{qrColor === c.value && <Check className="w-4 h-4 text-white" strokeWidth={3} />}
</button>
))}
</div>
</div>
{/* Frame Selector */}
<div>
<label className="block text-sm font-medium text-slate-700 mb-3">Frame Label</label>
<div className="grid grid-cols-4 gap-2">
{FRAME_OPTIONS.map((frame) => (
<button
key={frame.id}
onClick={() => setFrameType(frame.id)}
className={cn(
"py-2.5 px-3 rounded-lg text-sm font-medium transition-all border",
frameType === frame.id
? "bg-[#1A1265] text-white border-[#1A1265]"
: "bg-slate-50 text-slate-600 border-slate-200 hover:border-slate-300"
)}
>
{frame.label}
</button>
))}
</div>
</div>
</div>
</div>
{/* RIGHT: Preview Section */}
<div className="p-8 lg:p-10 flex flex-col items-center justify-center" style={{ backgroundColor: BRAND.paleGrey }}>
{/* QR Card with Frame */}
<div
ref={qrRef}
className="bg-white rounded-3xl shadow-xl p-8 flex flex-col items-center"
style={{ minWidth: '320px' }}
>
{/* Frame Label */}
{getFrameLabel() && (
<div
className="mb-5 px-8 py-2.5 rounded-full text-white font-bold text-sm tracking-widest uppercase shadow-md"
style={{ backgroundColor: qrColor }}
>
{getFrameLabel()}
</div>
)}
{/* QR Code */}
<div className="bg-white">
<QRCodeSVG
value={text || "Your Text Here"}
size={240}
level="M"
includeMargin={false}
fgColor={qrColor}
/>
</div>
{/* Text Info Preview */}
<div className="mt-6 text-center max-w-[260px]">
<h3 className="font-bold text-slate-900 text-lg flex items-center justify-center gap-2">
<FileText className="w-4 h-4 text-slate-400" />
Plain Text
</h3>
</div>
</div>
{/* Download Buttons */}
<div className="flex items-center gap-3 mt-8">
<Button
onClick={() => handleDownload('png')}
className="bg-[#1A1265] hover:bg-[#2A2275] text-white shadow-lg"
>
<Download className="w-4 h-4 mr-2" />
Download PNG
</Button>
<Button
onClick={() => handleDownload('svg')}
variant="outline"
className="border-slate-300 hover:bg-white"
>
<Download className="w-4 h-4 mr-2" />
SVG
</Button>
</div>
<p className="text-xs text-slate-500 mt-4 text-center">
Your text stays on your device. Nothing is sent to servers.
</p>
</div>
</div>
</div>
{/* Upsell Banner */}
<div className="mt-8 bg-gradient-to-r from-[#1A1265] to-[#2A2275] rounded-2xl p-6 flex flex-col sm:flex-row items-center justify-between gap-4">
<div className="text-white text-center sm:text-left">
<h3 className="font-bold text-lg">Want to track who scans your QR code?</h3>
<p className="text-white/80 text-sm mt-1">Dynamic QR codes give you scan analytics and let you edit content anytime.</p>
</div>
<Link href="/signup">
<Button className="bg-white text-[#1A1265] hover:bg-slate-100 shrink-0 shadow-lg">
Try Dynamic Codes
</Button>
</Link>
</div>
</div>
);
}

View File

@@ -0,0 +1,352 @@
import React from 'react';
import type { Metadata } from 'next';
import TextGenerator from './TextGenerator';
import { Type, Shield, Zap, Smartphone, FileText, QrCode, Download, Share2 } from 'lucide-react';
import { QRCodeSVG } from 'qrcode.react';
import { ToolBreadcrumb } from '@/components/seo/BreadcrumbSchema';
// SEO Optimized Metadata
export const metadata: Metadata = {
title: 'Free Text QR Code Generator | Instant & No Limits | QR Master',
description: 'Create a QR code for any plain text message in seconds. No limit on scans. 100% private & client-side. Download valid SVG/PNG files instantly.',
keywords: ['text qr code', 'qr code text generator', 'message to qr code', 'offline qr code', 'text qr generator', 'free qr code'],
alternates: {
canonical: 'https://qrmaster.io/tools/text-qr-code',
},
openGraph: {
title: 'Free Text QR Code Generator | QR Master',
description: 'Turn any text into a QR code instantly. No signup required. 100% text privacy.',
type: 'website',
url: 'https://qrmaster.io/tools/text-qr-code',
images: [{ url: '/og-text-generator.png', width: 1200, height: 630 }],
},
twitter: {
card: 'summary_large_image',
title: 'Free Text QR Code Generator',
description: 'Create QR codes for text. Instant, free, and private.',
},
robots: {
index: true,
follow: true,
},
};
// JSON-LD Structured Data
const jsonLd = {
'@context': 'https://schema.org',
'@graph': [
{
'@type': 'SoftwareApplication',
name: 'Text QR Code Generator',
applicationCategory: 'UtilitiesApplication',
operatingSystem: 'Web Browser',
offers: {
'@type': 'Offer',
price: '0',
priceCurrency: 'USD',
},
aggregateRating: {
'@type': 'AggregateRating',
ratingValue: '4.8',
ratingCount: '1240',
},
description: 'Generate QR codes for plain text messages. Works offline once generated. No data collection.',
},
{
'@type': 'HowTo',
name: 'How to Create a Text QR Code',
description: 'Turn any plain text into a scannable QR code.',
step: [
{
'@type': 'HowToStep',
position: 1,
name: 'Enter Content',
text: 'Type or paste your text message into the input field.',
},
{
'@type': 'HowToStep',
position: 2,
name: 'Customize Design',
text: 'Choose a color and add a frame label like "Scan Me" or "Read".',
},
{
'@type': 'HowToStep',
position: 3,
name: 'Download QR Code',
text: 'Download your high-quality QR code in PNG or SVG format.',
},
{
'@type': 'HowToStep',
position: 4,
name: 'Test',
text: 'Scan the code to ensure the text appears correctly.',
},
{
'@type': 'HowToStep',
position: 5,
name: 'Share',
text: 'Print it or display it where you want people to read the message.',
},
],
totalTime: 'PT30S',
},
{
'@type': 'FAQPage',
mainEntity: [
{
'@type': 'Question',
name: 'Is there a character limit?',
acceptedAnswer: {
'@type': 'Answer',
text: 'Yes, we recommend keeping it under 300 characters for optimal scanning. While QR codes can hold more, more text makes the code denser and harder to scan.',
},
},
{
'@type': 'Question',
name: 'Do I need internet to scan a Text QR code?',
acceptedAnswer: {
'@type': 'Answer',
text: 'No. Text QR codes work completely offline. The text content is embedded directly into the QR code pattern.',
},
},
{
'@type': 'Question',
name: 'Is my text private?',
acceptedAnswer: {
'@type': 'Answer',
text: 'Yes. This generator runs 100% in your browser. We do not store or see the text you type.',
},
},
{
'@type': 'Question',
name: 'How do I scan a text QR code?',
acceptedAnswer: {
'@type': 'Answer',
text: 'Open your phone camera or a QR scanner app and point it at the code. The text will appear on your screen automatically.',
},
},
{
'@type': 'Question',
name: 'Can I edit the text later?',
acceptedAnswer: {
'@type': 'Answer',
text: 'No, this is a static QR code. The text is permanent. If you need to change it, you must create a new QR code.',
},
},
],
},
],
};
export default function TextQRCodePage() {
return (
<>
<script
type="application/ld+json"
dangerouslySetInnerHTML={{ __html: JSON.stringify(jsonLd) }}
/>
<ToolBreadcrumb toolName="Text QR Code Generator" toolSlug="text-qr-code" />
<div className="min-h-screen" style={{ backgroundColor: '#EBEBDF' }}>
{/* HERO SECTION */}
<section className="relative pt-20 pb-20 lg:pt-32 lg:pb-32 px-4 sm:px-6 lg:px-8 overflow-hidden" style={{ backgroundColor: '#1A1265' }}>
<div className="absolute inset-0 opacity-10">
<svg className="w-full h-full" viewBox="0 0 100 100" preserveAspectRatio="none">
<path d="M0 100 C 20 0 50 0 100 100 Z" fill="url(#grad1)" />
<defs>
<linearGradient id="grad1" x1="0%" y1="0%" x2="100%" y2="0%">
<stop offset="0%" style={{ stopColor: 'white', stopOpacity: 1 }} />
<stop offset="100%" style={{ stopColor: 'white', stopOpacity: 0 }} />
</linearGradient>
</defs>
</svg>
</div>
<div className="max-w-7xl mx-auto grid lg:grid-cols-2 gap-12 items-center relative z-10">
<div className="text-center lg:text-left">
<div className="inline-flex items-center gap-2 px-3 py-1 rounded-full bg-white/10 text-white/90 text-sm font-medium mb-6 backdrop-blur-sm border border-white/10 hover:bg-white/20 transition-colors cursor-default">
<span className="flex h-2 w-2 relative">
<span className="animate-ping absolute inline-flex h-full w-full rounded-full bg-emerald-400 opacity-75"></span>
<span className="relative inline-flex rounded-full h-2 w-2 bg-emerald-400"></span>
</span>
Free Tool No Signup Required
</div>
<h1 className="text-4xl md:text-5xl lg:text-6xl font-extrabold text-white tracking-tight leading-tight mb-6">
Turn Text content into <br className="hidden lg:block" />
<span className="text-transparent bg-clip-text bg-gradient-to-r from-emerald-400 to-cyan-400">Scannable QR Codes</span>
</h1>
<p className="text-lg md:text-xl text-indigo-100 max-w-2xl mx-auto lg:mx-0 mb-8 leading-relaxed">
Share notes, codes, keys, or messages instantly. Scan to read without internet.
<strong className="text-white block sm:inline mt-2 sm:mt-0"> 100% Private.</strong>
</p>
<div className="flex flex-wrap justify-center lg:justify-start gap-4 text-sm font-medium text-white/80">
<div className="flex items-center gap-2 bg-white/5 px-4 py-2.5 rounded-xl border border-white/5 backdrop-blur-sm">
<Shield className="w-4 h-4 text-emerald-400" />
No Data Storage
</div>
<div className="flex items-center gap-2 bg-white/5 px-4 py-2.5 rounded-xl border border-white/5 backdrop-blur-sm">
<Zap className="w-4 h-4 text-amber-400" />
Instant Create
</div>
<div className="flex items-center gap-2 bg-white/5 px-4 py-2.5 rounded-xl border border-white/5 backdrop-blur-sm">
<Smartphone className="w-4 h-4 text-purple-400" />
Offline Readable
</div>
</div>
</div>
{/* Visual Abstract */}
<div className="hidden lg:flex relative items-center justify-center min-h-[400px]">
<div className="absolute w-[500px] h-[500px] bg-indigo-500/30 rounded-full blur-[100px] -top-20 -right-20 animate-pulse" />
<div className="relative w-80 h-96 bg-white/5 backdrop-blur-xl border border-white/20 rounded-3xl shadow-2xl flex flex-col items-center justify-center p-8 transform rotate-6 hover:rotate-3 transition-all duration-700 group">
<div className="absolute inset-0 bg-gradient-to-br from-white/10 to-transparent rounded-3xl" />
<div className="w-48 h-48 bg-white rounded-xl p-2 shadow-inner mb-6 relative overflow-hidden flex items-center justify-center">
<QRCodeSVG value="https://www.qrmaster.net" size={170} fgColor="#0f172a" level="Q" />
<div className="absolute top-1/2 left-0 w-full h-1 bg-emerald-500 shadow-[0_0_20px_rgba(16,185,129,1)] animate-pulse" />
</div>
<div className="w-full bg-white/10 rounded-xl p-4 backdrop-blur-sm border border-white/10">
<div className="flex items-center gap-3">
<div className="w-8 h-8 rounded-full bg-indigo-500/20 flex items-center justify-center">
<FileText className="w-4 h-4 text-indigo-300" />
</div>
<div className="space-y-1">
<div className="h-1.5 w-20 bg-white/30 rounded-full" />
<div className="h-1.5 w-12 bg-white/20 rounded-full" />
</div>
</div>
</div>
</div>
</div>
</div>
</section>
{/* GENERATOR SECTION */}
<section className="py-12 px-4 sm:px-6 lg:px-8 -mt-8">
<TextGenerator />
</section>
{/* HOW IT WORKS */}
<section className="py-16 px-4 sm:px-6 lg:px-8 bg-white">
<div className="max-w-4xl mx-auto">
<h2 className="text-3xl font-bold text-slate-900 text-center mb-12">
How Text QR Codes Work
</h2>
<div className="grid md:grid-cols-3 lg:grid-cols-5 gap-8">
<article className="text-center">
<div className="w-14 h-14 rounded-2xl bg-[#1A1265]/10 flex items-center justify-center mx-auto mb-4">
<Type className="w-7 h-7 text-[#1A1265]" />
</div>
<h3 className="font-bold text-slate-900 mb-2">1. Enter Text</h3>
<p className="text-slate-600 text-sm">
Type your message, code, or note. It is instantly encoded into the QR pattern.
</p>
</article>
<article className="text-center">
<div className="w-12 h-12 rounded-2xl bg-[#1A1265]/10 flex items-center justify-center mx-auto mb-4">
<Zap className="w-6 h-6 text-[#1A1265]" />
</div>
<h3 className="font-bold text-slate-900 mb-2">2. Customize</h3>
<p className="text-slate-600 text-xs leading-relaxed">
Choose a color and add a call-to-action frame.
</p>
</article>
<article className="text-center">
<div className="w-12 h-12 rounded-2xl bg-[#1A1265]/10 flex items-center justify-center mx-auto mb-4">
<Download className="w-6 h-6 text-[#1A1265]" />
</div>
<h3 className="font-bold text-slate-900 mb-2">3. Download</h3>
<p className="text-slate-600 text-xs leading-relaxed">
Get your ready-to-use QR code.
</p>
</article>
<article className="text-center">
<div className="w-12 h-12 rounded-2xl bg-[#1A1265]/10 flex items-center justify-center mx-auto mb-4">
<Smartphone className="w-6 h-6 text-[#1A1265]" />
</div>
<h3 className="font-bold text-slate-900 mb-2">4. Test</h3>
<p className="text-slate-600 text-xs leading-relaxed">
Point camera to read text.
</p>
</article>
<article className="text-center">
<div className="w-12 h-12 rounded-2xl bg-[#1A1265]/10 flex items-center justify-center mx-auto mb-4">
<Share2 className="w-6 h-6 text-[#1A1265]" />
</div>
<h3 className="font-bold text-slate-900 mb-2">5. Share</h3>
<p className="text-slate-600 text-xs leading-relaxed">
Pass information instantly.
</p>
</article>
</div>
</div>
</section>
{/* FAQ SECTION */}
<section className="py-16 px-4 sm:px-6 lg:px-8" style={{ backgroundColor: '#EBEBDF' }}>
<div className="max-w-3xl mx-auto">
<h2 className="text-3xl font-bold text-slate-900 text-center mb-4">
Frequently Asked Questions
</h2>
<p className="text-slate-600 text-center mb-10">
Common questions about Text QR codes.
</p>
<div className="space-y-4">
<FaqItem
question="How do I scan a text QR code?"
answer="Open your phone camera or a QR scanner app and point it at the code. The text will appear on your screen automatically."
/>
<FaqItem
question="Is there a character limit?"
answer="We recommend keeping it under 300 characters for the best scanning experience. Theoretically, QR codes can hold up to 4,296 characters, but the code becomes very complex and harder to scan with standard phone cameras."
/>
<FaqItem
question="Do I need internet to scan a Text QR code?"
answer="No. Text QR codes are 'static' codes, meaning the data is encoded directly into the image pattern. You can scan and read them completely offline, making them perfect for remote locations or secure environments."
/>
<FaqItem
question="Is my text private?"
answer="Yes. We prioritize your privacy. The generation process happens entirely in your browser using JavaScript. Your text data is never sent to our servers or stored anywhere."
/>
<FaqItem
question="Can I change the text after printing?"
answer="No. Static QR codes are permanent. If you need to change the text later, you must generate a new QR code. For editable content, you would need a Dynamic QR Code (which we also offer)."
/>
</div>
</div>
</section>
</div>
</>
);
}
function FaqItem({ question, answer }: { question: string; answer: string }) {
return (
<details className="group bg-white rounded-xl shadow-sm border border-slate-200 overflow-hidden">
<summary className="flex items-center justify-between p-5 cursor-pointer list-none text-slate-900 font-semibold hover:bg-slate-50 transition-colors">
{question}
<span className="transition group-open:rotate-180 text-slate-400">
<svg fill="none" height="20" stroke="currentColor" strokeLinecap="round" strokeLinejoin="round" strokeWidth="2" viewBox="0 0 24 24" width="20">
<path d="M6 9l6 6 6-6" />
</svg>
</span>
</summary>
<div className="text-slate-600 px-5 pb-5 pt-0 leading-relaxed text-sm">
{answer}
</div>
</details>
);
}

View File

@@ -0,0 +1,253 @@
'use client';
import React, { useState, useRef } from 'react';
import Link from 'next/link';
import { QRCodeSVG } from 'qrcode.react';
import {
Music,
Download,
Check,
Sparkles,
Video,
Share2
} from 'lucide-react';
import { Button } from '@/components/ui/Button';
import { Input } from '@/components/ui/Input';
import { cn } from '@/lib/utils';
// Brand Colors
const BRAND = {
paleGrey: '#EBEBDF',
richBlue: '#1A1265',
richBlueLight: '#2A2275',
};
// QR Color Options - TikTok Theme
const QR_COLORS = [
{ name: 'TikTok Black', value: '#000000' },
{ name: 'TikTok Pink', value: '#FE2C55' },
{ name: 'TikTok Cyan', value: '#25F4EE' },
{ name: 'Deep Blue', value: '#1A1265' },
{ name: 'Purple', value: '#7C3AED' },
{ name: 'Emerald', value: '#10B981' },
{ name: 'Rose', value: '#F43F5E' },
];
// Frame Options
const FRAME_OPTIONS = [
{ id: 'none', label: 'No Frame' },
{ id: 'scanme', label: 'Scan Me' },
{ id: 'follow', label: 'Follow' },
{ id: 'watch', label: 'Watch' },
];
export default function TiktokGenerator() {
const [username, setUsername] = useState('');
const [qrColor, setQrColor] = useState('#000000');
const [frameType, setFrameType] = useState('none');
const qrRef = useRef<HTMLDivElement>(null);
// TikTok URL: https://www.tiktok.com/@username
const getUrl = () => {
const cleanUser = username.replace(/^@/, '').replace(/https?:\/\/(www\.)?tiktok\.com\/@?/, '').replace(/\/$/, '');
return cleanUser ? `https://www.tiktok.com/@${cleanUser}` : 'https://www.tiktok.com';
};
const handleDownload = async (format: 'png' | 'svg') => {
if (!qrRef.current) return;
try {
if (format === 'png') {
const { toPng } = await import('html-to-image');
const dataUrl = await toPng(qrRef.current, { cacheBust: true, pixelRatio: 3 });
const link = document.createElement('a');
link.download = `tiktok-qr-code.png`;
link.href = dataUrl;
link.click();
} else {
const svgData = qrRef.current.querySelector('svg')?.outerHTML;
if (svgData) {
const blob = new Blob([svgData], { type: 'image/svg+xml;charset=utf-8' });
const url = URL.createObjectURL(blob);
const link = document.createElement('a');
link.href = url;
link.download = `tiktok-qr-code.svg`;
link.click();
}
}
} catch (err) {
console.error('Download failed', err);
}
};
const getFrameLabel = () => {
const frame = FRAME_OPTIONS.find(f => f.id === frameType);
return frame?.id !== 'none' ? frame?.label : null;
};
return (
<div className="w-full max-w-5xl mx-auto px-4 md:px-6">
{/* Main Generator Card */}
<div className="bg-white rounded-3xl shadow-2xl shadow-slate-900/10 overflow-hidden border border-slate-100">
<div className="grid lg:grid-cols-2">
{/* LEFT: Input Section */}
<div className="p-8 lg:p-10 space-y-8 border-r border-slate-100">
{/* TikTok Details */}
<div className="space-y-6">
<h2 className="text-lg font-bold text-slate-900 flex items-center gap-2">
<Music className="w-5 h-5 text-black" />
TikTok Username
</h2>
<div>
<label className="block text-sm font-medium text-slate-700 mb-2">Username</label>
<Input
placeholder="@username"
value={username}
onChange={(e) => setUsername(e.target.value)}
className="h-12 text-base rounded-xl border-slate-200 focus:border-black focus:ring-black"
/>
<p className="text-xs text-slate-500 mt-2">Enter your TikTok handle (e.g. @charlidamelio).</p>
</div>
</div>
<div className="border-t border-slate-100"></div>
{/* Design Options */}
<div className="space-y-6">
<h2 className="text-lg font-bold text-slate-900 flex items-center gap-2">
<Sparkles className="w-5 h-5 text-black" />
Design Options
</h2>
{/* Color Picker */}
<div>
<label className="block text-sm font-medium text-slate-700 mb-3">QR Code Color</label>
<div className="flex flex-wrap gap-2">
{QR_COLORS.map((c) => (
<button
key={c.name}
onClick={() => setQrColor(c.value)}
className={cn(
"w-9 h-9 rounded-full border-2 flex items-center justify-center transition-all hover:scale-110",
qrColor === c.value ? "border-slate-900 ring-2 ring-offset-2 ring-slate-200" : "border-white shadow-md"
)}
style={{ backgroundColor: c.value }}
aria-label={`Select ${c.name}`}
title={c.name}
>
{qrColor === c.value && <Check className="w-4 h-4 text-white" strokeWidth={3} />}
</button>
))}
</div>
</div>
{/* Frame Selector */}
<div>
<label className="block text-sm font-medium text-slate-700 mb-3">Frame Label</label>
<div className="grid grid-cols-4 gap-2">
{FRAME_OPTIONS.map((frame) => (
<button
key={frame.id}
onClick={() => setFrameType(frame.id)}
className={cn(
"py-2.5 px-3 rounded-lg text-sm font-medium transition-all border",
frameType === frame.id
? "bg-black text-white border-black"
: "bg-slate-50 text-slate-600 border-slate-200 hover:border-slate-300"
)}
>
{frame.label}
</button>
))}
</div>
</div>
</div>
</div>
{/* RIGHT: Preview Section */}
<div className="p-8 lg:p-10 flex flex-col items-center justify-center" style={{ backgroundColor: BRAND.paleGrey }}>
{/* QR Card with Frame */}
<div
ref={qrRef}
className="bg-white rounded-3xl shadow-xl p-8 flex flex-col items-center"
style={{ minWidth: '320px' }}
>
{/* Frame Label */}
{getFrameLabel() && (
<div
className="mb-5 px-8 py-2.5 rounded-full text-white font-bold text-sm tracking-widest uppercase shadow-md"
style={{ backgroundColor: qrColor }}
>
{getFrameLabel()}
</div>
)}
{/* QR Code */}
<div className="bg-white">
<QRCodeSVG
value={getUrl()}
size={240}
level="M"
includeMargin={false}
fgColor={qrColor}
/>
</div>
{/* Info Preview */}
<div className="mt-6 text-center max-w-[260px]">
<h3 className="font-bold text-slate-900 text-lg flex items-center justify-center gap-2 truncate">
<Music className="w-4 h-4 text-slate-400 shrink-0" />
<span className="truncate">{username || '@username'}</span>
</h3>
<div className="text-xs text-slate-500 mt-1">Opens in TikTok</div>
</div>
</div>
{/* Download Buttons */}
<div className="flex items-center gap-3 mt-8">
<Button
onClick={() => handleDownload('png')}
className="bg-black hover:bg-slate-800 text-white shadow-lg"
>
<Download className="w-4 h-4 mr-2" />
Download PNG
</Button>
<Button
onClick={() => handleDownload('svg')}
variant="outline"
className="border-slate-300 hover:bg-white"
>
<Download className="w-4 h-4 mr-2" />
SVG
</Button>
</div>
<p className="text-xs text-slate-500 mt-4 text-center">
Scanning redirects directly to your TikTok profile.
</p>
</div>
</div>
</div>
{/* Upsell Banner */}
<div className="mt-8 bg-gradient-to-r from-[#000000] via-[#25F4EE] to-[#FE2C55] rounded-2xl p-6 flex flex-col sm:flex-row items-center justify-between gap-4">
<div className="text-white text-center sm:text-left">
<h3 className="font-bold text-lg">Cross-promote on Socials?</h3>
<p className="text-white/80 text-sm mt-1">
Use one Dynamic Link to share your TikTok, Insta, and YouTube all at once.
</p>
</div>
<Link href="/signup">
<Button className="bg-white text-black hover:bg-slate-100 shrink-0 shadow-lg">
Create All-in-One Link
</Button>
</Link>
</div>
</div>
);
}

View File

@@ -0,0 +1,362 @@
import React from 'react';
import type { Metadata } from 'next';
import TiktokGenerator from './TikTokGenerator';
import { Music, Shield, Zap, Smartphone, Video, Heart, Download, Share2 } from 'lucide-react';
import { QRCodeSVG } from 'qrcode.react';
import { ToolBreadcrumb } from '@/components/seo/BreadcrumbSchema';
// SEO Optimized Metadata
export const metadata: Metadata = {
title: 'Free TikTok QR Code Generator | Get Followers | QR Master',
description: 'Create a QR code for your TikTok profile. Scanners are redirected to the TikTok app instantly to follow you. Customize with colors and frames.',
keywords: ['tiktok qr code', 'tik tok qr generator', 'tiktok follow qr', 'social media qr code', 'tiktok profile qr'],
alternates: {
canonical: 'https://qrmaster.io/tools/tiktok-qr-code',
},
openGraph: {
title: 'Free TikTok QR Code Generator | QR Master',
description: 'Generate QR codes to grow your TikTok following. Instant app redirect.',
type: 'website',
url: 'https://qrmaster.io/tools/tiktok-qr-code',
images: [{ url: '/og-tiktok-generator.png', width: 1200, height: 630 }],
},
twitter: {
card: 'summary_large_image',
title: 'Free TikTok QR Code Generator',
description: 'Create QR codes for TikTok. Get more followers.',
},
robots: {
index: true,
follow: true,
},
};
// JSON-LD Structured Data
const jsonLd = {
'@context': 'https://schema.org',
'@graph': [
{
'@type': 'SoftwareApplication',
name: 'TikTok QR Code Generator',
applicationCategory: 'UtilitiesApplication',
operatingSystem: 'Web Browser',
offers: {
'@type': 'Offer',
price: '0',
priceCurrency: 'USD',
},
aggregateRating: {
'@type': 'AggregateRating',
ratingValue: '4.9',
ratingCount: '1560',
},
description: 'Generate QR codes that direct users to a TikTok profile.',
},
{
'@type': 'HowTo',
name: 'How to Create a TikTok QR Code',
description: 'Create a QR code that opens a TikTok profile.',
step: [
{
'@type': 'HowToStep',
position: 1,
name: 'Enter Username',
text: 'Type your TikTok handle (e.g. @user).',
},
{
'@type': 'HowToStep',
position: 2,
name: 'Customize',
text: 'Select colors like Cyan or Pink to match the TikTok brand.',
},
{
'@type': 'HowToStep',
position: 3,
name: 'Download',
text: 'Save the QR code.',
},
{
'@type': 'HowToStep',
position: 4,
name: 'Test',
text: 'Scan the code to ensure it links to your profile.',
},
{
'@type': 'HowToStep',
position: 5,
name: 'Share',
text: 'Share it on other social media or print it out.',
},
],
totalTime: 'PT30S',
},
{
'@type': 'FAQPage',
mainEntity: [
{
'@type': 'Question',
name: 'Does it open the TikTok app?',
acceptedAnswer: {
'@type': 'Answer',
text: 'Yes! If the app is installed, the QR code will deep-link directly to your profile in the TikTok app.',
},
},
{
'@type': 'Question',
name: 'What is a TikCode?',
acceptedAnswer: {
'@type': 'Answer',
text: 'TikCode was TikTok\'s proprietary QR code system. They have moved towards standard QR codes, which is what our tool generates. These are more compatible with standard camera apps.',
},
},
{
'@type': 'Question',
name: 'Is it free?',
acceptedAnswer: {
'@type': 'Answer',
text: 'Yes, this generator is completely free.',
},
},
{
'@type': 'Question',
name: 'Can I track who scanned my code?',
acceptedAnswer: {
'@type': 'Answer',
text: 'No, this is a static QR code. For analytics, you need a Dynamic QR Code.',
},
},
{
'@type': 'Question',
name: 'Is it safe?',
acceptedAnswer: {
'@type': 'Answer',
text: 'Yes. The QR code simply contains a link to your TikTok profile. No personal data is collected.',
},
},
],
},
],
};
export default function TiktokQRCodePage() {
return (
<>
<script
type="application/ld+json"
dangerouslySetInnerHTML={{ __html: JSON.stringify(jsonLd) }}
/>
<ToolBreadcrumb toolName="TikTok QR Code Generator" toolSlug="tiktok-qr-code" />
<div className="min-h-screen" style={{ backgroundColor: '#EBEBDF' }}>
{/* HERO SECTION */}
<section className="relative pt-20 pb-20 lg:pt-32 lg:pb-32 px-4 sm:px-6 lg:px-8 overflow-hidden bg-black">
<div className="absolute inset-0 opacity-20">
{/* TikTok Pattern */}
<svg className="w-full h-full" width="100%" height="100%" xmlns="http://www.w3.org/2000/svg">
<defs>
<pattern id="tt_pattern" width="60" height="60" patternUnits="userSpaceOnUse">
<circle cx="30" cy="30" r="2" fill="cyan" />
<circle cx="40" cy="40" r="2" fill="magenta" />
</pattern>
</defs>
<rect width="100%" height="100%" fill="url(#tt_pattern)" />
</svg>
</div>
<div className="max-w-7xl mx-auto grid lg:grid-cols-2 gap-12 items-center relative z-10">
<div className="text-center lg:text-left">
<div className="inline-flex items-center gap-2 px-3 py-1 rounded-full bg-white/10 text-white/90 text-sm font-medium mb-6 backdrop-blur-sm border border-white/10 hover:bg-white/20 transition-colors cursor-default">
<span className="flex h-2 w-2 relative">
<span className="animate-ping absolute inline-flex h-full w-full rounded-full bg-cyan-400 opacity-75"></span>
<span className="relative inline-flex rounded-full h-2 w-2 bg-cyan-400"></span>
</span>
Free Tool No Signup Required
</div>
<h1 className="text-4xl md:text-5xl lg:text-6xl font-extrabold text-white tracking-tight leading-tight mb-6">
Go Viral with <br className="hidden lg:block" />
<span className="text-transparent bg-clip-text bg-gradient-to-r from-[#25F4EE] to-[#FE2C55]">TikTok QR Codes</span>
</h1>
<p className="text-lg md:text-xl text-slate-400 max-w-2xl mx-auto lg:mx-0 mb-8 leading-relaxed">
Share your TikTok immediately. A quick scan sends fans straight to your profile to follow and watch.
<strong className="text-white block sm:inline mt-2 sm:mt-0"> Grow your audience.</strong>
</p>
<div className="flex flex-wrap justify-center lg:justify-start gap-4 text-sm font-medium text-white/80">
<div className="flex items-center gap-2 bg-white/10 px-4 py-2.5 rounded-xl border border-white/10 backdrop-blur-sm">
<Music className="w-4 h-4 text-[#25F4EE]" />
Get Followers
</div>
<div className="flex items-center gap-2 bg-white/10 px-4 py-2.5 rounded-xl border border-white/10 backdrop-blur-sm">
<Video className="w-4 h-4 text-[#FE2C55]" />
Share Videos
</div>
<div className="flex items-center gap-2 bg-white/10 px-4 py-2.5 rounded-xl border border-white/10 backdrop-blur-sm">
<Smartphone className="w-4 h-4 text-white" />
Deep Link
</div>
</div>
</div>
{/* Visual Abstract */}
<div className="hidden lg:flex relative items-center justify-center min-h-[400px]">
{/* Glow Effects */}
<div className="absolute w-[300px] h-[300px] bg-[#25F4EE]/20 rounded-full blur-[80px] -top-10 -right-10 animate-pulse" />
<div className="absolute w-[300px] h-[300px] bg-[#FE2C55]/20 rounded-full blur-[80px] bottom-10 left-10 animate-pulse delay-75" />
<div className="relative w-80 h-96 bg-white/5 backdrop-blur-xl border border-white/20 rounded-3xl shadow-2xl flex flex-col items-center justify-center p-8 transform rotate-3 hover:rotate-0 transition-all duration-700 group">
<div className="absolute inset-0 bg-gradient-to-br from-white/10 to-transparent rounded-3xl" />
<div className="w-20 h-20 rounded-full bg-black border-2 border-[#25F4EE] p-1 mb-6 shadow-[#FE2C55]/50 shadow-lg relative">
<div className="w-full h-full rounded-full bg-slate-800 flex items-center justify-center overflow-hidden">
<Music className="w-10 h-10 text-white animate-bounce" />
</div>
<div className="absolute -bottom-1 -right-1 bg-[#FE2C55] w-6 h-6 rounded-full border-2 border-black flex items-center justify-center">
<Heart className="w-3 h-3 text-white fill-current" />
</div>
</div>
<div className="w-48 h-48 bg-white rounded-xl p-2 shadow-inner relative overflow-hidden flex items-center justify-center">
<QRCodeSVG value="https://www.qrmaster.net" size={170} fgColor="#000000" level="Q" />
</div>
{/* Floating Badge */}
<div className="absolute -bottom-6 -right-6 bg-black border border-white/10 py-3 px-5 rounded-xl shadow-xl flex items-center gap-3 transform transition-transform hover:scale-105 duration-300">
<div className="bg-white/10 p-2 rounded-full">
<Music className="w-5 h-5 text-[#25F4EE]" />
</div>
<div className="text-left">
<div className="text-[10px] text-slate-400 font-bold uppercase tracking-wider">TikTok</div>
<div className="text-sm font-bold text-white">Following</div>
</div>
</div>
</div>
</div>
</div>
</section>
{/* GENERATOR SECTION */}
<section className="py-12 px-4 sm:px-6 lg:px-8 -mt-8">
<TiktokGenerator />
</section>
{/* HOW IT WORKS */}
<section className="py-16 px-4 sm:px-6 lg:px-8 bg-white">
<div className="max-w-4xl mx-auto">
<h2 className="text-3xl font-bold text-slate-900 text-center mb-12">
How TikTok QR Codes Work
</h2>
<div className="grid md:grid-cols-3 lg:grid-cols-5 gap-8">
<article className="text-center">
<div className="w-14 h-14 rounded-2xl bg-black flex items-center justify-center mx-auto mb-4">
<Music className="w-7 h-7 text-[#25F4EE]" />
</div>
<h3 className="font-bold text-slate-900 mb-2">1. Enter Handle</h3>
<p className="text-slate-600 text-sm">
Type in your username. No password required.
</p>
</article>
<article className="text-center">
<div className="w-14 h-14 rounded-2xl bg-black flex items-center justify-center mx-auto mb-4">
<Smartphone className="w-7 h-7 text-[#FE2C55]" />
</div>
<h3 className="font-bold text-slate-900 mb-2">2. Scan</h3>
<p className="text-slate-600 text-sm">
Fans scan the code to instantly find you in the app.
</p>
</article>
<article className="text-center">
<div className="w-12 h-12 rounded-2xl bg-black flex items-center justify-center mx-auto mb-4">
<Download className="w-6 h-6 text-white" />
</div>
<h3 className="font-bold text-slate-900 mb-2">3. Download</h3>
<p className="text-slate-600 text-xs leading-relaxed">
Save your custom QR code.
</p>
</article>
<article className="text-center">
<div className="w-12 h-12 rounded-2xl bg-black flex items-center justify-center mx-auto mb-4">
<Heart className="w-6 h-6 text-white" />
</div>
<h3 className="font-bold text-slate-900 mb-2">4. Follow</h3>
<p className="text-slate-600 text-xs leading-relaxed">
Fans scan to find you instantly.
</p>
</article>
<article className="text-center">
<div className="w-12 h-12 rounded-2xl bg-black flex items-center justify-center mx-auto mb-4">
<Share2 className="w-6 h-6 text-white" />
</div>
<h3 className="font-bold text-slate-900 mb-2">5. Viral</h3>
<p className="text-slate-600 text-xs leading-relaxed">
Grow your audience everywhere.
</p>
</article>
</div>
</div>
</section>
{/* FAQ SECTION */}
<section className="py-16 px-4 sm:px-6 lg:px-8" style={{ backgroundColor: '#EBEBDF' }}>
<div className="max-w-3xl mx-auto">
<h2 className="text-3xl font-bold text-slate-900 text-center mb-4">
Frequently Asked Questions
</h2>
<p className="text-slate-600 text-center mb-10">
Common questions about TikTok QR codes.
</p>
<div className="space-y-4">
<FaqItem
question="Does this replace the in-app QR code?"
answer="You can use either! The advantage of our generator is that you can print high-resolution versions for large posters, customize the color/frame, and it works with any standard QR scanner."
/>
<FaqItem
question="Can I link to a specific video?"
answer="Yes, just paste the full video URL (e.g. tiktok.com/@user/video/123...) instead of your username."
/>
<FaqItem
question="Is it free?"
answer="Yes, completely free from start to finish."
/>
<FaqItem
question="Can I track who scanned my code?"
answer="No, this is a static QR code. For analytics, you need a Dynamic QR Code."
/>
<FaqItem
question="Is it safe?"
answer="Yes. The QR code simply contains a link to your TikTok profile. No personal data is collected."
/>
</div>
</div>
</section>
</div>
</>
);
}
function FaqItem({ question, answer }: { question: string; answer: string }) {
return (
<details className="group bg-white rounded-xl shadow-sm border border-slate-200 overflow-hidden">
<summary className="flex items-center justify-between p-5 cursor-pointer list-none text-slate-900 font-semibold hover:bg-slate-50 transition-colors">
{question}
<span className="transition group-open:rotate-180 text-slate-400">
<svg fill="none" height="20" stroke="currentColor" strokeLinecap="round" strokeLinejoin="round" strokeWidth="2" viewBox="0 0 24 24" width="20">
<path d="M6 9l6 6 6-6" />
</svg>
</span>
</summary>
<div className="text-slate-600 px-5 pb-5 pt-0 leading-relaxed text-sm">
{answer}
</div>
</details>
);
}

View File

@@ -0,0 +1,253 @@
'use client';
import React, { useState, useRef } from 'react';
import Link from 'next/link';
import { QRCodeSVG } from 'qrcode.react';
import {
Twitter,
Download,
Check,
Sparkles,
MessageCircle
} from 'lucide-react';
import { Button } from '@/components/ui/Button';
import { Input } from '@/components/ui/Input';
import { cn } from '@/lib/utils';
// Brand Colors
const BRAND = {
paleGrey: '#EBEBDF',
richBlue: '#1A1265',
richBlueLight: '#2A2275',
};
// QR Color Options - X Theme
const QR_COLORS = [
{ name: 'X Black', value: '#000000' },
{ name: 'X Blue', value: '#1DA1F2' },
{ name: 'Dark Blue', value: '#1A1265' },
{ name: 'Teal', value: '#0D9488' },
{ name: 'Coral', value: '#F43F5E' },
{ name: 'Grey', value: '#374151' },
{ name: 'Emerald', value: '#10B981' },
{ name: 'Rose', value: '#F43F5E' },
];
// Frame Options
const FRAME_OPTIONS = [
{ id: 'none', label: 'No Frame' },
{ id: 'scanme', label: 'Scan Me' },
{ id: 'follow', label: 'Follow' },
{ id: 'connect', label: 'Connect' },
];
export default function TwitterGenerator() {
const [username, setUsername] = useState('');
const [qrColor, setQrColor] = useState('#000000');
const [frameType, setFrameType] = useState('none');
const qrRef = useRef<HTMLDivElement>(null);
// Twitter URL construction
const getUrl = () => {
const cleanUser = username.replace(/^@/, '').replace(/https?:\/\/(www\.)?(twitter|x)\.com\//, '').replace(/\/$/, '');
return cleanUser ? `https://x.com/${cleanUser}` : 'https://x.com';
};
const handleDownload = async (format: 'png' | 'svg') => {
if (!qrRef.current) return;
try {
if (format === 'png') {
const { toPng } = await import('html-to-image');
const dataUrl = await toPng(qrRef.current, { cacheBust: true, pixelRatio: 3 });
const link = document.createElement('a');
link.download = `twitter-qr-code.png`;
link.href = dataUrl;
link.click();
} else {
const svgData = qrRef.current.querySelector('svg')?.outerHTML;
if (svgData) {
const blob = new Blob([svgData], { type: 'image/svg+xml;charset=utf-8' });
const url = URL.createObjectURL(blob);
const link = document.createElement('a');
link.href = url;
link.download = `twitter-qr-code.svg`;
link.click();
}
}
} catch (err) {
console.error('Download failed', err);
}
};
const getFrameLabel = () => {
const frame = FRAME_OPTIONS.find(f => f.id === frameType);
return frame?.id !== 'none' ? frame?.label : null;
};
return (
<div className="w-full max-w-5xl mx-auto px-4 md:px-6">
{/* Main Generator Card */}
<div className="bg-white rounded-3xl shadow-2xl shadow-slate-900/10 overflow-hidden border border-slate-100">
<div className="grid lg:grid-cols-2">
{/* LEFT: Input Section */}
<div className="p-8 lg:p-10 space-y-8 border-r border-slate-100">
{/* Twitter Details */}
<div className="space-y-6">
<h2 className="text-lg font-bold text-slate-900 flex items-center gap-2">
<Twitter className="w-5 h-5 text-black" />
X (Twitter) Username
</h2>
<div>
<label className="block text-sm font-medium text-slate-700 mb-2">Username or Link</label>
<Input
placeholder="@username"
value={username}
onChange={(e) => setUsername(e.target.value)}
className="h-12 text-base rounded-xl border-slate-200 focus:border-black focus:ring-black"
/>
<p className="text-xs text-slate-500 mt-2">Enter your X (Twitter) handle to create a profile link.</p>
</div>
</div>
<div className="border-t border-slate-100"></div>
{/* Design Options */}
<div className="space-y-6">
<h2 className="text-lg font-bold text-slate-900 flex items-center gap-2">
<Sparkles className="w-5 h-5 text-black" />
Design Options
</h2>
{/* Color Picker */}
<div>
<label className="block text-sm font-medium text-slate-700 mb-3">QR Code Color</label>
<div className="flex flex-wrap gap-2">
{QR_COLORS.map((c) => (
<button
key={c.name}
onClick={() => setQrColor(c.value)}
className={cn(
"w-9 h-9 rounded-full border-2 flex items-center justify-center transition-all hover:scale-110",
qrColor === c.value ? "border-slate-900 ring-2 ring-offset-2 ring-slate-200" : "border-white shadow-md"
)}
style={{ backgroundColor: c.value }}
aria-label={`Select ${c.name}`}
title={c.name}
>
{qrColor === c.value && <Check className="w-4 h-4 text-white" strokeWidth={3} />}
</button>
))}
</div>
</div>
{/* Frame Selector */}
<div>
<label className="block text-sm font-medium text-slate-700 mb-3">Frame Label</label>
<div className="grid grid-cols-4 gap-2">
{FRAME_OPTIONS.map((frame) => (
<button
key={frame.id}
onClick={() => setFrameType(frame.id)}
className={cn(
"py-2.5 px-3 rounded-lg text-sm font-medium transition-all border",
frameType === frame.id
? "bg-slate-900 text-white border-slate-900"
: "bg-slate-50 text-slate-600 border-slate-200 hover:border-slate-300"
)}
>
{frame.label}
</button>
))}
</div>
</div>
</div>
</div>
{/* RIGHT: Preview Section */}
<div className="p-8 lg:p-10 flex flex-col items-center justify-center" style={{ backgroundColor: BRAND.paleGrey }}>
{/* QR Card with Frame */}
<div
ref={qrRef}
className="bg-white rounded-3xl shadow-xl p-8 flex flex-col items-center"
style={{ minWidth: '320px' }}
>
{/* Frame Label */}
{getFrameLabel() && (
<div
className="mb-5 px-8 py-2.5 rounded-full text-white font-bold text-sm tracking-widest uppercase shadow-md"
style={{ backgroundColor: qrColor }}
>
{getFrameLabel()}
</div>
)}
{/* QR Code */}
<div className="bg-white">
<QRCodeSVG
value={getUrl()}
size={240}
level="M"
includeMargin={false}
fgColor={qrColor}
/>
</div>
{/* Info Preview */}
<div className="mt-6 text-center max-w-[260px]">
<h3 className="font-bold text-slate-900 text-lg flex items-center justify-center gap-2 truncate">
<Twitter className="w-4 h-4 text-slate-400 shrink-0" />
<span className="truncate">{username || '@username'}</span>
</h3>
<div className="text-xs text-slate-500 mt-1">Opens in X (Twitter)</div>
</div>
</div>
{/* Download Buttons */}
<div className="flex items-center gap-3 mt-8">
<Button
onClick={() => handleDownload('png')}
className="bg-slate-900 hover:bg-black text-white shadow-lg"
>
<Download className="w-4 h-4 mr-2" />
Download PNG
</Button>
<Button
onClick={() => handleDownload('svg')}
variant="outline"
className="border-slate-300 hover:bg-white"
>
<Download className="w-4 h-4 mr-2" />
SVG
</Button>
</div>
<p className="text-xs text-slate-500 mt-4 text-center">
Scanning redirects directly to the X profile.
</p>
</div>
</div>
</div>
{/* Upsell Banner */}
<div className="mt-8 bg-gradient-to-r from-slate-900 to-slate-700 rounded-2xl p-6 flex flex-col sm:flex-row items-center justify-between gap-4">
<div className="text-white text-center sm:text-left">
<h3 className="font-bold text-lg">Cross-promote your channels</h3>
<p className="text-white/80 text-sm mt-1">
Use a single Dynamic QR Code to link to all your social media profiles at once.
</p>
</div>
<Link href="/signup">
<Button className="bg-white text-slate-900 hover:bg-slate-100 shrink-0 shadow-lg">
Create Smart Link
</Button>
</Link>
</div>
</div>
);
}

View File

@@ -0,0 +1,363 @@
import React from 'react';
import type { Metadata } from 'next';
import TwitterGenerator from './TwitterGenerator';
import { Twitter, Shield, Zap, Smartphone, MessageCircle, UserPlus, Download, Share2 } from 'lucide-react';
import { QRCodeSVG } from 'qrcode.react';
import { ToolBreadcrumb } from '@/components/seo/BreadcrumbSchema';
// SEO Optimized Metadata
export const metadata: Metadata = {
title: 'Free Twitter (X) QR Code Generator | Follow & Connect | QR Master',
description: 'Create a QR code for your X (formerly Twitter) profile. Scanners are redirected to the app instantly to follow you. Free & Customizable.',
keywords: ['twitter qr code', 'x qr generator', 'twitter follow qr', 'social media qr code', 'x profile qr'],
alternates: {
canonical: 'https://qrmaster.io/tools/twitter-qr-code',
},
openGraph: {
title: 'Free Twitter (X) QR Code Generator | QR Master',
description: 'Generate QR codes to grow your X (Twitter) following. Instant app redirect.',
type: 'website',
url: 'https://qrmaster.io/tools/twitter-qr-code',
images: [{ url: '/og-twitter-generator.png', width: 1200, height: 630 }],
},
twitter: {
card: 'summary_large_image',
title: 'Free Twitter (X) QR Code Generator',
description: 'Create QR codes for X. Boost your following.',
},
robots: {
index: true,
follow: true,
},
};
// JSON-LD Structured Data
const jsonLd = {
'@context': 'https://schema.org',
'@graph': [
{
'@type': 'SoftwareApplication',
name: 'Twitter (X) QR Code Generator',
applicationCategory: 'UtilitiesApplication',
operatingSystem: 'Web Browser',
offers: {
'@type': 'Offer',
price: '0',
priceCurrency: 'USD',
},
aggregateRating: {
'@type': 'AggregateRating',
ratingValue: '4.8',
ratingCount: '980',
},
description: 'Generate QR codes that direct users to an X (Twitter) profile or tweet.',
},
{
'@type': 'HowTo',
name: 'How to Create a Twitter QR Code',
description: 'Create a QR code that opens an X profile.',
step: [
{
'@type': 'HowToStep',
position: 1,
name: 'Enter Username',
text: 'Enter your X handle (e.g. @elonmusk).',
},
{
'@type': 'HowToStep',
position: 2,
name: 'Design',
text: 'Choose a black frame or custom color.',
},
{
'@type': 'HowToStep',
position: 3,
name: 'Download',
text: 'Save the QR code.',
},
{
'@type': 'HowToStep',
position: 4,
name: 'Test',
text: 'Scan to verify it goes to the correct profile.',
},
{
'@type': 'HowToStep',
position: 5,
name: 'Share',
text: 'Add to your business cards or conference badges.',
},
],
totalTime: 'PT30S',
},
{
'@type': 'FAQPage',
mainEntity: [
{
'@type': 'Question',
name: 'Does it work for both Twitter and X?',
acceptedAnswer: {
'@type': 'Answer',
text: 'Yes, they are the same platform. The QR code links to x.com, which is the current standard, but works for twitter.com links too.',
},
},
{
'@type': 'Question',
name: 'Can I link to a specific tweet?',
acceptedAnswer: {
'@type': 'Answer',
text: 'Yes! Just paste the full URL of the tweet into the input field instead of your username.',
},
},
{
'@type': 'Question',
name: 'Is it free?',
acceptedAnswer: {
'@type': 'Answer',
text: 'Yes, generating this QR code is completely free and requires no signup.',
},
},
{
'@type': 'Question',
name: 'Can I track scans?',
acceptedAnswer: {
'@type': 'Answer',
text: 'This is a static QR code, so tracking is not included. Use our Dynamic QR Code generator for analytics.',
},
},
{
'@type': 'Question',
name: 'What if I change my handle?',
acceptedAnswer: {
'@type': 'Answer',
text: 'If you change your handle, the link in the QR code will break. You will need to generate a new QR code.',
},
},
],
},
],
};
export default function TwitterQRCodePage() {
return (
<>
<script
type="application/ld+json"
dangerouslySetInnerHTML={{ __html: JSON.stringify(jsonLd) }}
/>
<ToolBreadcrumb toolName="Twitter QR Code Generator" toolSlug="twitter-qr-code" />
<div className="min-h-screen" style={{ backgroundColor: '#EBEBDF' }}>
{/* HERO SECTION */}
<section className="relative pt-20 pb-20 lg:pt-32 lg:pb-32 px-4 sm:px-6 lg:px-8 overflow-hidden bg-slate-950">
<div className="absolute inset-0 opacity-20">
{/* X Pattern */}
<svg className="w-full h-full" width="100%" height="100%" xmlns="http://www.w3.org/2000/svg">
<defs>
<pattern id="x_pattern" width="60" height="60" patternUnits="userSpaceOnUse">
<path d="M20 20L40 40M40 20L20 40" stroke="white" strokeWidth="1" />
</pattern>
</defs>
<rect width="100%" height="100%" fill="url(#x_pattern)" />
</svg>
</div>
<div className="max-w-7xl mx-auto grid lg:grid-cols-2 gap-12 items-center relative z-10">
<div className="text-center lg:text-left">
<div className="inline-flex items-center gap-2 px-3 py-1 rounded-full bg-white/10 text-white/90 text-sm font-medium mb-6 backdrop-blur-sm border border-white/10 hover:bg-white/20 transition-colors cursor-default">
<span className="flex h-2 w-2 relative">
<span className="animate-ping absolute inline-flex h-full w-full rounded-full bg-blue-500 opacity-75"></span>
<span className="relative inline-flex rounded-full h-2 w-2 bg-blue-500"></span>
</span>
Free Tool No Signup Required
</div>
<h1 className="text-4xl md:text-5xl lg:text-6xl font-extrabold text-white tracking-tight leading-tight mb-6">
Connect on X with <br className="hidden lg:block" />
<span className="text-transparent bg-clip-text bg-gradient-to-r from-blue-400 to-white">Twitter QR Codes</span>
</h1>
<p className="text-lg md:text-xl text-slate-400 max-w-2xl mx-auto lg:mx-0 mb-8 leading-relaxed">
Share your X profile instantly. A quick scan takes users directly to your timeline to follow and interact.
<strong className="text-white block sm:inline mt-2 sm:mt-0"> Grow your community.</strong>
</p>
<div className="flex flex-wrap justify-center lg:justify-start gap-4 text-sm font-medium text-white/80">
<div className="flex items-center gap-2 bg-white/5 px-4 py-2.5 rounded-xl border border-white/10 backdrop-blur-sm">
<UserPlus className="w-4 h-4 text-white" />
Get Followers
</div>
<div className="flex items-center gap-2 bg-white/5 px-4 py-2.5 rounded-xl border border-white/10 backdrop-blur-sm">
<MessageCircle className="w-4 h-4 text-white" />
Start Conversions
</div>
<div className="flex items-center gap-2 bg-white/5 px-4 py-2.5 rounded-xl border border-white/10 backdrop-blur-sm">
<Zap className="w-4 h-4 text-white" />
Instant Connect
</div>
</div>
</div>
{/* Visual Abstract */}
<div className="hidden lg:flex relative items-center justify-center min-h-[400px]">
<div className="absolute w-[500px] h-[500px] bg-blue-500/10 rounded-full blur-[100px] -top-20 -right-20 animate-pulse" />
<div className="relative w-80 h-96 bg-white/5 backdrop-blur-xl border border-white/20 rounded-3xl shadow-2xl flex flex-col items-center justify-center p-8 transform rotate-2 hover:-rotate-1 transition-all duration-700 group">
<div className="absolute inset-0 bg-gradient-to-br from-white/5 to-transparent rounded-3xl" />
<div className="w-full bg-black rounded-xl shadow-lg p-5 mb-6 relative overflow-hidden flex items-center gap-4">
<div className="w-12 h-12 bg-white rounded-full flex items-center justify-center">
<Twitter className="w-6 h-6 text-black" fill="black" />
</div>
<div className="text-white">
<div className="font-bold text-sm">QR Master</div>
<div className="text-xs text-slate-400">@qrmaster</div>
</div>
<button className="ml-auto bg-white text-black px-4 py-1.5 rounded-full text-xs font-bold hover:bg-slate-200">
Follow
</button>
</div>
<div className="w-48 h-48 bg-white rounded-xl p-2 shadow-inner relative overflow-hidden flex items-center justify-center">
<QRCodeSVG value="https://www.qrmaster.net" size={170} fgColor="#000000" level="Q" />
</div>
{/* Floating Badge */}
<div className="absolute -bottom-6 -right-6 bg-black border border-white/10 py-3 px-5 rounded-xl shadow-xl flex items-center gap-3 transform transition-transform hover:scale-105 duration-300">
<div className="bg-white/10 p-2 rounded-full">
<Twitter className="w-5 h-5 text-white" fill="white" />
</div>
<div className="text-left">
<div className="text-[10px] text-slate-400 font-bold uppercase tracking-wider">Twitter / X</div>
<div className="text-sm font-bold text-white">Profile Link</div>
</div>
</div>
</div>
</div>
</div>
</section>
{/* GENERATOR SECTION */}
<section className="py-12 px-4 sm:px-6 lg:px-8 -mt-8">
<TwitterGenerator />
</section>
{/* HOW IT WORKS */}
<section className="py-16 px-4 sm:px-6 lg:px-8 bg-white">
<div className="max-w-4xl mx-auto">
<h2 className="text-3xl font-bold text-slate-900 text-center mb-12">
How X (Twitter) QR Codes Work
</h2>
<div className="grid md:grid-cols-3 lg:grid-cols-5 gap-8">
<article className="text-center">
<div className="w-14 h-14 rounded-2xl bg-black flex items-center justify-center mx-auto mb-4">
<Twitter className="w-7 h-7 text-white" />
</div>
<h3 className="font-bold text-slate-900 mb-2">1. Input Handle</h3>
<p className="text-slate-600 text-sm">
Simply type your @handle or paste your profile link.
</p>
</article>
<article className="text-center">
<div className="w-14 h-14 rounded-2xl bg-black flex items-center justify-center mx-auto mb-4">
<Smartphone className="w-7 h-7 text-white" />
</div>
<h3 className="font-bold text-slate-900 mb-2">2. Snap</h3>
<p className="text-slate-600 text-sm">
Put the code on your networking gear. People scan it in seconds.
</p>
</article>
<article className="text-center">
<div className="w-12 h-12 rounded-2xl bg-black flex items-center justify-center mx-auto mb-4">
<Download className="w-6 h-6 text-white" />
</div>
<h3 className="font-bold text-slate-900 mb-2">3. Download</h3>
<p className="text-slate-600 text-xs leading-relaxed">
Save your X QR code.
</p>
</article>
<article className="text-center">
<div className="w-12 h-12 rounded-2xl bg-black flex items-center justify-center mx-auto mb-4">
<UserPlus className="w-6 h-6 text-white" />
</div>
<h3 className="font-bold text-slate-900 mb-2">4. Scan</h3>
<p className="text-slate-600 text-xs leading-relaxed">
People scan to find you.
</p>
</article>
<article className="text-center">
<div className="w-12 h-12 rounded-2xl bg-black flex items-center justify-center mx-auto mb-4">
<Share2 className="w-6 h-6 text-white" />
</div>
<h3 className="font-bold text-slate-900 mb-2">5. Connect</h3>
<p className="text-slate-600 text-xs leading-relaxed">
They are instantly on your profile.
</p>
</article>
</div>
</div>
</section>
{/* FAQ SECTION */}
<section className="py-16 px-4 sm:px-6 lg:px-8" style={{ backgroundColor: '#EBEBDF' }}>
<div className="max-w-3xl mx-auto">
<h2 className="text-3xl font-bold text-slate-900 text-center mb-4">
Frequently Asked Questions
</h2>
<p className="text-slate-600 text-center mb-10">
Common questions about Twitter QR codes.
</p>
<div className="space-y-4">
<FaqItem
question="Why create a QR code for X?"
answer="It's much faster than telling someone your handle and hoping they spell it right. A scan is instant and error-proof."
/>
<FaqItem
question="Will links to twitter.com still work?"
answer="Yes, twitter.com links redirect to x.com, so both work perfectly fine."
/>
<FaqItem
question="Can I change the destination later?"
answer="No, this is a static QR code. If you change your handle, you will need a new QR code. Our Dynamic QR codes allow you to edit the link anytime."
/>
<FaqItem
question="Can I track scans?"
answer="This is a static QR code, so tracking is not included. Use our Dynamic QR Code generator for analytics."
/>
<FaqItem
question="What if I change my handle?"
answer="If you change your handle, the link in the QR code will break. You will need to generate a new QR code."
/>
</div>
</div>
</section>
</div>
</>
);
}
function FaqItem({ question, answer }: { question: string; answer: string }) {
return (
<details className="group bg-white rounded-xl shadow-sm border border-slate-200 overflow-hidden">
<summary className="flex items-center justify-between p-5 cursor-pointer list-none text-slate-900 font-semibold hover:bg-slate-50 transition-colors">
{question}
<span className="transition group-open:rotate-180 text-slate-400">
<svg fill="none" height="20" stroke="currentColor" strokeLinecap="round" strokeLinejoin="round" strokeWidth="2" viewBox="0 0 24 24" width="20">
<path d="M6 9l6 6 6-6" />
</svg>
</span>
</summary>
<div className="text-slate-600 px-5 pb-5 pt-0 leading-relaxed text-sm">
{answer}
</div>
</details>
);
}

View File

@@ -0,0 +1,246 @@
'use client';
import React, { useState, useRef } from 'react';
import Link from 'next/link';
import { QRCodeSVG } from 'qrcode.react';
import {
Link as LinkIcon,
Download,
Check,
Sparkles,
Globe
} from 'lucide-react';
import { Button } from '@/components/ui/Button';
import { Input } from '@/components/ui/Input';
import { cn } from '@/lib/utils';
// Brand Colors
const BRAND = {
paleGrey: '#EEF2FF', // Indigo-50
primary: '#4F46E5', // Indigo-600
primaryDark: '#4338CA', // Indigo-700
};
// QR Color Options
const QR_COLORS = [
{ name: 'Indigo', value: '#4F46E5' },
{ name: 'Blue', value: '#2563EB' },
{ name: 'Classic Black', value: '#000000' },
{ name: 'Violet', value: '#7C3AED' },
{ name: 'Pink', value: '#DB2777' },
{ name: 'Emerald', value: '#10B981' },
{ name: 'Rose', value: '#F43F5E' },
];
// Frame Options
const FRAME_OPTIONS = [
{ id: 'none', label: 'No Frame' },
{ id: 'scanme', label: 'Scan Me' },
{ id: 'website', label: 'Website' },
{ id: 'visit', label: 'Visit' },
];
export default function URLGenerator() {
const [url, setUrl] = useState('');
const [qrColor, setQrColor] = useState(BRAND.primary);
const [frameType, setFrameType] = useState('none');
const qrRef = useRef<HTMLDivElement>(null);
const handleDownload = async (format: 'png' | 'svg') => {
if (!qrRef.current) return;
try {
if (format === 'png') {
const { toPng } = await import('html-to-image');
const dataUrl = await toPng(qrRef.current, { cacheBust: true, pixelRatio: 3 });
const link = document.createElement('a');
link.download = `url-qr-code.png`;
link.href = dataUrl;
link.click();
} else {
const svgData = qrRef.current.querySelector('svg')?.outerHTML;
if (svgData) {
const blob = new Blob([svgData], { type: 'image/svg+xml;charset=utf-8' });
const url = URL.createObjectURL(blob);
const link = document.createElement('a');
link.href = url;
link.download = `url-qr-code.svg`;
link.click();
}
}
} catch (err) {
console.error('Download failed', err);
}
};
const getFrameLabel = () => {
const frame = FRAME_OPTIONS.find(f => f.id === frameType);
return frame?.id !== 'none' ? frame?.label : null;
};
return (
<div className="w-full max-w-5xl mx-auto px-4 md:px-6">
{/* Main Generator Card */}
<div className="bg-white rounded-3xl shadow-2xl shadow-slate-900/10 overflow-hidden border border-slate-100">
<div className="grid lg:grid-cols-2">
{/* LEFT: Input Section */}
<div className="p-8 lg:p-10 space-y-8 border-r border-slate-100">
{/* URL Input */}
<div className="space-y-6">
<h2 className="text-lg font-bold text-slate-900 flex items-center gap-2">
<LinkIcon className="w-5 h-5 text-[#4F46E5]" />
Website URL
</h2>
<div>
<label className="block text-sm font-medium text-slate-700 mb-2">Enter URL</label>
<Input
placeholder="https://www.yourwebsite.com"
value={url}
onChange={(e) => setUrl(e.target.value)}
className="h-12 text-base rounded-xl border-slate-200 focus:border-[#4F46E5] focus:ring-[#4F46E5]"
/>
<p className="text-xs text-slate-500 mt-2">Include https:// for best results.</p>
</div>
</div>
<div className="border-t border-slate-100"></div>
{/* Design Options */}
<div className="space-y-6">
<h2 className="text-lg font-bold text-slate-900 flex items-center gap-2">
<Sparkles className="w-5 h-5 text-[#4F46E5]" />
Design Options
</h2>
{/* Color Picker */}
<div>
<label className="block text-sm font-medium text-slate-700 mb-3">QR Code Color</label>
<div className="flex flex-wrap gap-2">
{QR_COLORS.map((c) => (
<button
key={c.name}
onClick={() => setQrColor(c.value)}
className={cn(
"w-9 h-9 rounded-full border-2 flex items-center justify-center transition-all hover:scale-110",
qrColor === c.value ? "border-slate-900 ring-2 ring-offset-2 ring-slate-200" : "border-white shadow-md"
)}
style={{ backgroundColor: c.value }}
aria-label={`Select ${c.name}`}
title={c.name}
>
{qrColor === c.value && <Check className="w-4 h-4 text-white" strokeWidth={3} />}
</button>
))}
</div>
</div>
{/* Frame Selector */}
<div>
<label className="block text-sm font-medium text-slate-700 mb-3">Frame Label</label>
<div className="grid grid-cols-4 gap-2">
{FRAME_OPTIONS.map((frame) => (
<button
key={frame.id}
onClick={() => setFrameType(frame.id)}
className={cn(
"py-2.5 px-3 rounded-lg text-sm font-medium transition-all border",
frameType === frame.id
? "bg-[#4F46E5] text-white border-[#4F46E5]"
: "bg-slate-50 text-slate-600 border-slate-200 hover:border-slate-300"
)}
>
{frame.label}
</button>
))}
</div>
</div>
</div>
</div>
{/* RIGHT: Preview Section */}
<div className="p-8 lg:p-10 flex flex-col items-center justify-center" style={{ backgroundColor: BRAND.paleGrey }}>
{/* QR Card with Frame */}
<div
ref={qrRef}
className="bg-white rounded-3xl shadow-xl p-8 flex flex-col items-center"
style={{ minWidth: '320px' }}
>
{/* Frame Label */}
{getFrameLabel() && (
<div
className="mb-5 px-8 py-2.5 rounded-full text-white font-bold text-sm tracking-widest uppercase shadow-md"
style={{ backgroundColor: qrColor }}
>
{getFrameLabel()}
</div>
)}
{/* QR Code */}
<div className="bg-white">
<QRCodeSVG
value={url || "https://qrmaster.io"}
size={240}
level="M"
includeMargin={false}
fgColor={qrColor}
/>
</div>
{/* URL Preview */}
<div className="mt-6 text-center max-w-[260px]">
<h3 className="font-bold text-slate-900 text-lg flex items-center justify-center gap-2 truncate">
<LinkIcon className="w-4 h-4 text-indigo-600 shrink-0" />
<span className="truncate">{url || 'Your Website'}</span>
</h3>
</div>
</div>
{/* Download Buttons */}
<div className="flex items-center gap-3 mt-8">
<Button
onClick={() => handleDownload('png')}
className="bg-[#4F46E5] hover:bg-[#4338CA] text-white shadow-lg"
>
<Download className="w-4 h-4 mr-2" />
Download PNG
</Button>
<Button
onClick={() => handleDownload('svg')}
variant="outline"
className="border-slate-300 hover:bg-white"
>
<Download className="w-4 h-4 mr-2" />
SVG
</Button>
</div>
<p className="text-xs text-slate-500 mt-4 text-center">
Your link is encoded directly. Static and forever free.
</p>
</div>
</div>
</div>
{/* Upsell Banner */}
<div className="mt-8 bg-gradient-to-r from-[#4F46E5] to-[#4338CA] rounded-2xl p-6 flex flex-col sm:flex-row items-center justify-between gap-4">
<div className="text-white text-center sm:text-left">
<h3 className="font-bold text-lg">Need to change this link later?</h3>
<p className="text-white/80 text-sm mt-1">
If your URL changes, this QR code will stop working. Use Dynamic QR Codes to edit links anytime.
</p>
</div>
<Link href="/signup">
<Button className="bg-white text-[#4F46E5] hover:bg-slate-100 shrink-0 shadow-lg">
Create Dynamic QR
</Button>
</Link>
</div>
</div>
);
}

View File

@@ -0,0 +1,307 @@
import React from 'react';
import type { Metadata } from 'next';
import URLGenerator from './URLGenerator';
import { Link as LinkIcon, Shield, Zap, Smartphone, Globe, BarChart } from 'lucide-react';
import { QRCodeSVG } from 'qrcode.react';
import { ToolBreadcrumb } from '@/components/seo/BreadcrumbSchema';
// SEO Optimized Metadata
export const metadata: Metadata = {
title: 'Free URL QR Code Generator | Link to Any Website | QR Master',
description: 'Create a QR code for your website, social media, or any link. Static and free forever. No scan limits. Instant download.',
keywords: ['url qr code', 'website qr code', 'link qr generator', 'free qr code generator', 'url to qr'],
alternates: {
canonical: 'https://qrmaster.io/tools/url-qr-code',
},
openGraph: {
title: 'Free URL QR Code Generator | QR Master',
description: 'Turn any URL into a QR code. Share websites instantly.',
type: 'website',
url: 'https://qrmaster.io/tools/url-qr-code',
images: [{ url: '/og-url-generator.png', width: 1200, height: 630 }],
},
twitter: {
card: 'summary_large_image',
title: 'Free URL QR Code Generator',
description: 'Create QR codes for any link. Instant and free.',
},
robots: {
index: true,
follow: true,
},
};
// JSON-LD Structured Data
const jsonLd = {
'@context': 'https://schema.org',
'@graph': [
{
'@type': 'SoftwareApplication',
name: 'URL QR Code Generator',
applicationCategory: 'UtilitiesApplication',
operatingSystem: 'Web Browser',
offers: {
'@type': 'Offer',
price: '0',
priceCurrency: 'USD',
},
aggregateRating: {
'@type': 'AggregateRating',
ratingValue: '4.9',
ratingCount: '3100',
},
description: 'Generate QR codes for URLs and websites. Direct linking, no redirects.',
},
{
'@type': 'HowTo',
name: 'How to Create a URL QR Code',
description: 'Turn a website link into a scannable QR code.',
step: [
{
'@type': 'HowToStep',
position: 1,
name: 'Enter URL',
text: 'Copy and paste your website address (e.g., https://example.com).',
},
{
'@type': 'HowToStep',
position: 2,
name: 'Customize',
text: 'Select a color and add a call-to-action frame like "Scan Me".',
},
{
'@type': 'HowToStep',
position: 3,
name: 'Download',
text: 'Save your QR code as a PNG or SVG image.',
},
],
totalTime: 'PT20S',
},
{
'@type': 'FAQPage',
mainEntity: [
{
'@type': 'Question',
name: 'Do these QR codes expire?',
acceptedAnswer: {
'@type': 'Answer',
text: 'No. These are static QR codes. They directly encode your URL and will work forever as long as your website is online.',
},
},
{
'@type': 'Question',
name: 'Can I track how many people scan it?',
acceptedAnswer: {
'@type': 'Answer',
text: 'No, static QR codes cannot be tracked. If you need scan usage analytics (location, device, time), you should use our Dynamic QR Code generator.',
},
},
{
'@type': 'Question',
name: 'Can I change the destination URL later?',
acceptedAnswer: {
'@type': 'Answer',
text: 'No. Once a static QR code is printed, it cannot be changed. If you change your website URL, you will need to print a new code. Use Dynamic QR Codes if you need flexibility.',
},
},
{
'@type': 'Question',
name: 'Is there a scan limit?',
acceptedAnswer: {
'@type': 'Answer',
text: 'No. There are zero limits on how many times your QR code can be scanned.',
},
},
],
},
],
};
export default function URLQRCodePage() {
return (
<>
<script
type="application/ld+json"
dangerouslySetInnerHTML={{ __html: JSON.stringify(jsonLd) }}
/>
<ToolBreadcrumb toolName="URL QR Code Generator" toolSlug="url-qr-code" />
<div className="min-h-screen" style={{ backgroundColor: '#EBEBDF' }}>
{/* HERO SECTION */}
<section className="relative pt-20 pb-20 lg:pt-32 lg:pb-32 px-4 sm:px-6 lg:px-8 overflow-hidden" style={{ backgroundColor: '#1A1265' }}>
<div className="absolute inset-0 opacity-10">
<svg className="w-full h-full" viewBox="0 0 100 100" preserveAspectRatio="none">
<path d="M0 100 C 20 0 50 0 100 100 Z" fill="url(#grad1)" />
<defs>
<linearGradient id="grad1" x1="0%" y1="0%" x2="100%" y2="0%">
<stop offset="0%" style={{ stopColor: 'white', stopOpacity: 1 }} />
<stop offset="100%" style={{ stopColor: 'white', stopOpacity: 0 }} />
</linearGradient>
</defs>
</svg>
</div>
<div className="max-w-7xl mx-auto grid lg:grid-cols-2 gap-12 items-center relative z-10">
<div className="text-center lg:text-left">
<div className="inline-flex items-center gap-2 px-3 py-1 rounded-full bg-white/10 text-white/90 text-sm font-medium mb-6 backdrop-blur-sm border border-white/10 hover:bg-white/20 transition-colors cursor-default">
<span className="flex h-2 w-2 relative">
<span className="animate-ping absolute inline-flex h-full w-full rounded-full bg-emerald-400 opacity-75"></span>
<span className="relative inline-flex rounded-full h-2 w-2 bg-emerald-400"></span>
</span>
Free Tool No Signup Required
</div>
<h1 className="text-4xl md:text-5xl lg:text-6xl font-extrabold text-white tracking-tight leading-tight mb-6">
Link to Any Website with <br className="hidden lg:block" />
<span className="text-transparent bg-clip-text bg-gradient-to-r from-emerald-400 to-cyan-400">Instant QR Codes</span>
</h1>
<p className="text-lg md:text-xl text-indigo-100 max-w-2xl mx-auto lg:mx-0 mb-8 leading-relaxed">
Create a QR code for your website, portfolio, or menu.
<strong className="text-white block sm:inline mt-2 sm:mt-0"> Free forever. No expirations.</strong>
</p>
<div className="flex flex-wrap justify-center lg:justify-start gap-4 text-sm font-medium text-white/80">
<div className="flex items-center gap-2 bg-white/5 px-4 py-2.5 rounded-xl border border-white/5 backdrop-blur-sm">
<Globe className="w-4 h-4 text-emerald-400" />
Universal Links
</div>
<div className="flex items-center gap-2 bg-white/5 px-4 py-2.5 rounded-xl border border-white/5 backdrop-blur-sm">
<Zap className="w-4 h-4 text-amber-400" />
Instant Redirect
</div>
<div className="flex items-center gap-2 bg-white/5 px-4 py-2.5 rounded-xl border border-white/5 backdrop-blur-sm">
<Shield className="w-4 h-4 text-purple-400" />
Direct Encoding
</div>
</div>
</div>
{/* Visual Abstract */}
<div className="hidden lg:flex relative items-center justify-center min-h-[400px]">
<div className="absolute w-[500px] h-[500px] bg-indigo-500/30 rounded-full blur-[100px] -top-20 -right-20 animate-pulse" />
<div className="relative w-80 h-96 bg-white/5 backdrop-blur-xl border border-white/20 rounded-3xl shadow-2xl flex flex-col items-center justify-center p-8 transform -rotate-3 hover:rotate-0 transition-all duration-700 group">
<div className="absolute inset-0 bg-gradient-to-br from-white/10 to-transparent rounded-3xl" />
<div className="w-48 h-48 bg-white rounded-xl p-2 shadow-inner mb-6 relative overflow-hidden flex items-center justify-center">
<QRCodeSVG value="https://www.qrmaster.net" size={170} fgColor="#0f172a" level="Q" />
</div>
<div className="w-full bg-white/10 rounded-xl p-4 backdrop-blur-sm border border-white/10">
<div className="flex items-center gap-3">
<div className="w-8 h-8 rounded-full bg-indigo-500/20 flex items-center justify-center">
<LinkIcon className="w-4 h-4 text-indigo-300" />
</div>
<div className="space-y-1 w-full">
<div className="h-1.5 w-3/4 bg-white/30 rounded-full" />
<div className="h-1.5 w-1/2 bg-white/20 rounded-full" />
</div>
</div>
</div>
</div>
</div>
</div>
</section>
{/* GENERATOR SECTION */}
<section className="py-12 px-4 sm:px-6 lg:px-8 -mt-8">
<URLGenerator />
</section>
{/* HOW IT WORKS */}
<section className="py-16 px-4 sm:px-6 lg:px-8 bg-white">
<div className="max-w-4xl mx-auto">
<h2 className="text-3xl font-bold text-slate-900 text-center mb-12">
How URL QR Codes Work
</h2>
<div className="grid md:grid-cols-3 gap-8">
<article className="text-center">
<div className="w-14 h-14 rounded-2xl bg-[#1A1265]/10 flex items-center justify-center mx-auto mb-4">
<LinkIcon className="w-7 h-7 text-[#1A1265]" />
</div>
<h3 className="font-bold text-slate-900 mb-2">1. Paste Link</h3>
<p className="text-slate-600 text-sm">
Copy the URL of the webpage you want to link to and paste it into the generator.
</p>
</article>
<article className="text-center">
<div className="w-14 h-14 rounded-2xl bg-[#1A1265]/10 flex items-center justify-center mx-auto mb-4">
<Smartphone className="w-7 h-7 text-[#1A1265]" />
</div>
<h3 className="font-bold text-slate-900 mb-2">2. Scan</h3>
<p className="text-slate-600 text-sm">
Users scan the code and a notification appears to open the link in their browser.
</p>
</article>
<article className="text-center">
<div className="w-14 h-14 rounded-2xl bg-[#1A1265]/10 flex items-center justify-center mx-auto mb-4">
<Globe className="w-7 h-7 text-[#1A1265]" />
</div>
<h3 className="font-bold text-slate-900 mb-2">3. Visit</h3>
<p className="text-slate-600 text-sm">
They are instantly directed to your website, restaurant menu, or social profile.
</p>
</article>
</div>
</div>
</section>
{/* FAQ SECTION */}
<section className="py-16 px-4 sm:px-6 lg:px-8" style={{ backgroundColor: '#EBEBDF' }}>
<div className="max-w-3xl mx-auto">
<h2 className="text-3xl font-bold text-slate-900 text-center mb-4">
Frequently Asked Questions
</h2>
<p className="text-slate-600 text-center mb-10">
Common questions about URL QR codes.
</p>
<div className="space-y-4">
<FaqItem
question="Do these QR codes expire?"
answer="No. Static URL QR codes do not expire. They contain the direct link to your website. As long as your website is active, the QR code will work."
/>
<FaqItem
question="Can I track scans?"
answer="No, static QR codes cannot be tracked. If you need analytics to see who is scanning your code and from where, you need a Dynamic QR Code."
/>
<FaqItem
question="What happens if I change my website URL?"
answer="If you change your URL, this static QR code will no longer work (unless you set up a redirect on your own server). With a Dynamic QR Code, you can update the destination URL anytime without reprinting the code."
/>
<FaqItem
question="Are there ads on the QR code?"
answer="No. We do not insert ads before redirecting users. The scan goes directly to your URL."
/>
</div>
</div>
</section>
</div>
</>
);
}
function FaqItem({ question, answer }: { question: string; answer: string }) {
return (
<details className="group bg-white rounded-xl shadow-sm border border-slate-200 overflow-hidden">
<summary className="flex items-center justify-between p-5 cursor-pointer list-none text-slate-900 font-semibold hover:bg-slate-50 transition-colors">
{question}
<span className="transition group-open:rotate-180 text-slate-400">
<svg fill="none" height="20" stroke="currentColor" strokeLinecap="round" strokeLinejoin="round" strokeWidth="2" viewBox="0 0 24 24" width="20">
<path d="M6 9l6 6 6-6" />
</svg>
</span>
</summary>
<div className="text-slate-600 px-5 pb-5 pt-0 leading-relaxed text-sm">
{answer}
</div>
</details>
);
}

View File

@@ -0,0 +1,349 @@
'use client';
import React, { useState, useRef } from 'react';
import Link from 'next/link';
import { QRCodeSVG } from 'qrcode.react';
import {
User,
Download,
Check,
Sparkles,
Briefcase,
Phone,
Mail,
Globe,
MapPin,
Contact
} from 'lucide-react';
import { Button } from '@/components/ui/Button';
import { Input } from '@/components/ui/Input';
import { cn } from '@/lib/utils';
// Brand Colors
const BRAND = {
paleGrey: '#FFF1F2', // Rose-50
primary: '#E11D48', // Rose-600
primaryDark: '#BE123C', // Rose-700
};
// QR Color Options
const QR_COLORS = [
{ name: 'Rose', value: '#E11D48' },
{ name: 'Pink', value: '#DB2777' },
{ name: 'Classic Black', value: '#000000' },
{ name: 'Navy', value: '#1E3A8A' },
{ name: 'Purple', value: '#7C3AED' },
{ name: 'Emerald', value: '#10B981' },
{ name: 'Rose', value: '#F43F5E' },
];
// Frame Options
const FRAME_OPTIONS = [
{ id: 'none', label: 'No Frame' },
{ id: 'scanme', label: 'Scan Me' },
{ id: 'contact', label: 'Save Contact' },
{ id: 'vcard', label: 'vCard' },
];
export default function VCardGenerator() {
// Personal Info
const [firstName, setFirstName] = useState('');
const [lastName, setLastName] = useState('');
const [email, setEmail] = useState('');
const [phone, setPhone] = useState('');
const [website, setWebsite] = useState('');
const [jobTitle, setJobTitle] = useState('');
const [company, setCompany] = useState('');
// Address
const [street, setStreet] = useState('');
const [city, setCity] = useState('');
const [zip, setZip] = useState('');
const [country, setCountry] = useState('');
const [qrColor, setQrColor] = useState(BRAND.primary);
const [frameType, setFrameType] = useState('none');
const qrRef = useRef<HTMLDivElement>(null);
// Generate VCard String
const generateVCard = () => {
const vcard = [
'BEGIN:VCARD',
'VERSION:3.0',
`N:${lastName};${firstName};;;`,
`FN:${firstName} ${lastName}`,
`ORG:${company}`,
`TITLE:${jobTitle}`,
`TEL;TYPE=CELL:${phone}`,
`EMAIL;TYPE=WORK:${email}`,
`URL:${website}`,
`ADR;TYPE=WORK:;;${street};${city};;${zip};${country}`,
'END:VCARD'
].join('\n');
return vcard;
};
const handleDownload = async (format: 'png' | 'svg') => {
if (!qrRef.current) return;
try {
if (format === 'png') {
const { toPng } = await import('html-to-image');
const dataUrl = await toPng(qrRef.current, { cacheBust: true, pixelRatio: 3 });
const link = document.createElement('a');
link.download = `vcard-${firstName || 'contact'}.png`;
link.href = dataUrl;
link.click();
} else {
const svgData = qrRef.current.querySelector('svg')?.outerHTML;
if (svgData) {
const blob = new Blob([svgData], { type: 'image/svg+xml;charset=utf-8' });
const url = URL.createObjectURL(blob);
const link = document.createElement('a');
link.href = url;
link.download = `vcard-${firstName || 'contact'}.svg`;
link.click();
}
}
} catch (err) {
console.error('Download failed', err);
}
};
const getFrameLabel = () => {
const frame = FRAME_OPTIONS.find(f => f.id === frameType);
return frame?.id !== 'none' ? frame?.label : null;
};
return (
<div className="w-full max-w-6xl mx-auto px-4 md:px-6">
{/* Main Generator Card */}
<div className="bg-white rounded-3xl shadow-2xl shadow-slate-900/10 overflow-hidden border border-slate-100">
<div className="grid lg:grid-cols-12">
{/* LEFT: Input Section (Wider for VCard) */}
<div className="lg:col-span-7 p-8 lg:p-10 space-y-8 border-r border-slate-100">
{/* Personal Details */}
<div className="space-y-6">
<h2 className="text-lg font-bold text-slate-900 flex items-center gap-2">
<User className="w-5 h-5 text-[#E11D48]" />
Contact Information
</h2>
<div className="grid sm:grid-cols-2 gap-4">
<div>
<label className="block text-sm font-medium text-slate-700 mb-2">First Name</label>
<Input placeholder="John" value={firstName} onChange={(e) => setFirstName(e.target.value)} className="h-11 rounded-xl border-slate-200 focus:border-[#E11D48] focus:ring-[#E11D48]" />
</div>
<div>
<label className="block text-sm font-medium text-slate-700 mb-2">Last Name</label>
<Input placeholder="Doe" value={lastName} onChange={(e) => setLastName(e.target.value)} className="h-11 rounded-xl border-slate-200 focus:border-[#E11D48] focus:ring-[#E11D48]" />
</div>
</div>
<div className="grid sm:grid-cols-2 gap-4">
<div>
<label className="block text-sm font-medium text-slate-700 mb-2">Phone</label>
<div className="relative">
<Phone className="absolute left-3 top-3 w-5 h-5 text-slate-400" />
<Input placeholder="+1 555 000 0000" value={phone} onChange={(e) => setPhone(e.target.value)} className="pl-10 h-11 rounded-xl border-slate-200 focus:border-[#E11D48] focus:ring-[#E11D48]" />
</div>
</div>
<div>
<label className="block text-sm font-medium text-slate-700 mb-2">Email</label>
<div className="relative">
<Mail className="absolute left-3 top-3 w-5 h-5 text-slate-400" />
<Input placeholder="john@company.com" value={email} onChange={(e) => setEmail(e.target.value)} className="pl-10 h-11 rounded-xl border-slate-200 focus:border-[#E11D48] focus:ring-[#E11D48]" />
</div>
</div>
</div>
<div className="grid sm:grid-cols-2 gap-4">
<div>
<label className="block text-sm font-medium text-slate-700 mb-2">Website</label>
<div className="relative">
<Globe className="absolute left-3 top-3 w-5 h-5 text-slate-400" />
<Input placeholder="https://..." value={website} onChange={(e) => setWebsite(e.target.value)} className="pl-10 h-11 rounded-xl border-slate-200 focus:border-[#E11D48] focus:ring-[#E11D48]" />
</div>
</div>
<div>
<label className="block text-sm font-medium text-slate-700 mb-2">Job Title</label>
<div className="relative">
<Briefcase className="absolute left-3 top-3 w-5 h-5 text-slate-400" />
<Input placeholder="Manager" value={jobTitle} onChange={(e) => setJobTitle(e.target.value)} className="pl-10 h-11 rounded-xl border-slate-200 focus:border-[#E11D48] focus:ring-[#E11D48]" />
</div>
</div>
</div>
<div>
<label className="block text-sm font-medium text-slate-700 mb-2">Company</label>
<Input placeholder="Acme Corp" value={company} onChange={(e) => setCompany(e.target.value)} className="h-11 rounded-xl border-slate-200 focus:border-[#E11D48] focus:ring-[#E11D48]" />
</div>
</div>
{/* Address Details */}
<div className="space-y-6">
<h2 className="text-lg font-bold text-slate-900 flex items-center gap-2">
<MapPin className="w-5 h-5 text-[#E11D48]" />
Address
</h2>
<div className="grid sm:grid-cols-2 gap-4">
<div className="sm:col-span-2">
<label className="block text-sm font-medium text-slate-700 mb-2">Street</label>
<Input placeholder="123 Business Rd" value={street} onChange={(e) => setStreet(e.target.value)} className="h-11 rounded-xl border-slate-200 focus:border-[#E11D48] focus:ring-[#E11D48]" />
</div>
<div>
<label className="block text-sm font-medium text-slate-700 mb-2">City</label>
<Input placeholder="New York" value={city} onChange={(e) => setCity(e.target.value)} className="h-11 rounded-xl border-slate-200 focus:border-[#E11D48] focus:ring-[#E11D48]" />
</div>
<div>
<label className="block text-sm font-medium text-slate-700 mb-2">Zip/Postcode</label>
<Input placeholder="10001" value={zip} onChange={(e) => setZip(e.target.value)} className="h-11 rounded-xl border-slate-200 focus:border-[#E11D48] focus:ring-[#E11D48]" />
</div>
<div className="sm:col-span-2">
<label className="block text-sm font-medium text-slate-700 mb-2">Country</label>
<Input placeholder="USA" value={country} onChange={(e) => setCountry(e.target.value)} className="h-11 rounded-xl border-slate-200 focus:border-[#E11D48] focus:ring-[#E11D48]" />
</div>
</div>
</div>
<div className="border-t border-slate-100"></div>
{/* Design Options */}
<div className="space-y-6">
<h2 className="text-lg font-bold text-slate-900 flex items-center gap-2">
<Sparkles className="w-5 h-5 text-[#E11D48]" />
Design Options
</h2>
<div className="grid sm:grid-cols-2 gap-8">
{/* Color Picker */}
<div>
<label className="block text-sm font-medium text-slate-700 mb-3">QR Color</label>
<div className="flex flex-wrap gap-2">
{QR_COLORS.map((c) => (
<button
key={c.name}
onClick={() => setQrColor(c.value)}
className={cn(
"w-9 h-9 rounded-full border-2 flex items-center justify-center transition-all hover:scale-110",
qrColor === c.value ? "border-slate-900 ring-2 ring-offset-2 ring-slate-200" : "border-white shadow-md"
)}
style={{ backgroundColor: c.value }}
title={c.name}
>
{qrColor === c.value && <Check className="w-4 h-4 text-white" strokeWidth={3} />}
</button>
))}
</div>
</div>
{/* Frame Selector */}
<div>
<label className="block text-sm font-medium text-slate-700 mb-3">Frame Label</label>
<div className="grid grid-cols-2 gap-2">
{FRAME_OPTIONS.map((frame) => (
<button
key={frame.id}
onClick={() => setFrameType(frame.id)}
className={cn(
"py-2 px-3 rounded-lg text-sm font-medium transition-all border text-center",
frameType === frame.id
? "bg-[#E11D48] text-white border-[#E11D48]"
: "bg-slate-50 text-slate-600 border-slate-200 hover:border-slate-300"
)}
>
{frame.label}
</button>
))}
</div>
</div>
</div>
</div>
</div>
{/* RIGHT: Preview Section */}
<div className="lg:col-span-5 p-8 lg:p-10 flex flex-col items-center justify-center" style={{ backgroundColor: BRAND.paleGrey }}>
{/* QR Card with Frame */}
<div
ref={qrRef}
className="bg-white rounded-3xl shadow-xl p-8 flex flex-col items-center"
style={{ minWidth: '300px' }}
>
{/* Frame Label */}
{getFrameLabel() && (
<div
className="mb-5 px-8 py-2.5 rounded-full text-white font-bold text-sm tracking-widest uppercase shadow-md"
style={{ backgroundColor: qrColor }}
>
{getFrameLabel()}
</div>
)}
{/* QR Code */}
<div className="bg-white">
<QRCodeSVG
value={generateVCard()}
size={220}
level="M"
includeMargin={false}
fgColor={qrColor}
/>
</div>
{/* Info Preview */}
<div className="mt-6 text-center max-w-[260px]">
<h3 className="font-bold text-slate-900 text-lg flex items-center justify-center gap-2 truncate">
<Contact className="w-4 h-4 text-slate-400 shrink-0" />
<span className="truncate">{firstName || 'First'} {lastName || 'Last'}</span>
</h3>
<div className="text-xs text-slate-500 mt-1 truncate">{company || 'Company Name'}</div>
</div>
</div>
{/* Download Buttons */}
<div className="flex flex-col sm:flex-row items-center gap-3 mt-8 w-full max-w-[320px]">
<Button
onClick={() => handleDownload('png')}
className="bg-[#E11D48] hover:bg-[#BE123C] text-white shadow-lg w-full"
>
<Download className="w-4 h-4 mr-2" />
Download PNG
</Button>
<Button
onClick={() => handleDownload('svg')}
variant="outline"
className="border-slate-300 hover:bg-white w-full"
>
<Download className="w-4 h-4 mr-2" />
SVG
</Button>
</div>
<p className="text-xs text-slate-500 mt-4 text-center">
Scanning adds this contact to the address book instantly.
</p>
</div>
</div>
</div>
{/* Upsell Banner */}
<div className="mt-8 bg-gradient-to-r from-[#E11D48] to-[#BE123C] rounded-2xl p-6 flex flex-col sm:flex-row items-center justify-between gap-4">
<div className="text-white text-center sm:text-left">
<h3 className="font-bold text-lg">Want a Digital Business Card?</h3>
<p className="text-white/80 text-sm mt-1">
Upgrade to Dynamic vCard to include a profile photo, social links, and update your info anytime.
</p>
</div>
<Link href="/signup">
<Button className="bg-white text-[#E11D48] hover:bg-slate-100 shrink-0 shadow-lg">
Create Digital Card
</Button>
</Link>
</div>
</div>
);
}

View File

@@ -0,0 +1,320 @@
import React from 'react';
import type { Metadata } from 'next';
import VCardGenerator from './VCardGenerator';
import { User, Shield, Zap, Smartphone, Contact, Share2, Check, UserPlus } from 'lucide-react';
import { QRCodeSVG } from 'qrcode.react';
import { ToolBreadcrumb } from '@/components/seo/BreadcrumbSchema';
// SEO Optimized Metadata
export const metadata: Metadata = {
title: 'Free vCard QR Code Generator | Digital Business Card | QR Master',
description: 'Create a vCard QR code for your business card. Share contact details (Name, Phone, Email) instantly with one scan. 100% Free & No App Required.',
keywords: ['vcard qr code', 'business card qr code', 'contact qr generator', 'digital business card', 'add to contacts qr'],
alternates: {
canonical: 'https://qrmaster.io/tools/vcard-qr-code',
},
openGraph: {
title: 'Free vCard QR Code Generator | QR Master',
description: 'Turn your contact info into a QR code. The modern way to share your business card.',
type: 'website',
url: 'https://qrmaster.io/tools/vcard-qr-code',
images: [{ url: '/og-vcard-generator.png', width: 1200, height: 630 }],
},
twitter: {
card: 'summary_large_image',
title: 'Free vCard QR Code Generator',
description: 'Create QR codes for contact sharing. Instant and free.',
},
robots: {
index: true,
follow: true,
},
};
// JSON-LD Structured Data
const jsonLd = {
'@context': 'https://schema.org',
'@graph': [
{
'@type': 'SoftwareApplication',
name: 'vCard QR Code Generator',
applicationCategory: 'UtilitiesApplication',
operatingSystem: 'Web Browser',
offers: {
'@type': 'Offer',
price: '0',
priceCurrency: 'USD',
},
aggregateRating: {
'@type': 'AggregateRating',
ratingValue: '4.9',
ratingCount: '4200',
},
description: 'Generate vCard (VCF) QR codes for business cards. Scanners can save contact info instantly.',
},
{
'@type': 'HowTo',
name: 'How to Create a vCard QR Code',
description: 'Create a QR code that saves your contact details.',
step: [
{
'@type': 'HowToStep',
position: 1,
name: 'Enter Details',
text: 'Fill in your Name, Phone, Email, Company, and Address.',
},
{
'@type': 'HowToStep',
position: 2,
name: 'Customize',
text: 'Select a color that matches your brand and add a frame.',
},
{
'@type': 'HowToStep',
position: 3,
name: 'Download',
text: 'Download the QR code image and place it on your physical business card.',
},
],
totalTime: 'PT1M',
},
{
'@type': 'FAQPage',
mainEntity: [
{
'@type': 'Question',
name: 'How does a vCard QR code work?',
acceptedAnswer: {
'@type': 'Answer',
text: 'A vCard QR code contains your contact information in a standardized format (VCF). When scanned, the phone recognizes it as a contact card and prompts the user to "Save Contact" to their address book.',
},
},
{
'@type': 'Question',
name: 'Is there a limit to how much info I can add?',
acceptedAnswer: {
'@type': 'Answer',
text: 'Static QR codes hold data directly in the pattern. The more data you add (long addresses, bio), the denser and harder to scan the QR code becomes. We recommend sticking to essential contact info for static codes.',
},
},
{
'@type': 'Question',
name: 'Can I update my info later?',
acceptedAnswer: {
'@type': 'Answer',
text: 'No. This is a static vCard QR code. Once created, the info cannot be changed. If you move jobs or change numbers, you must print a new code. For editable cards, use our Dynamic vCard Plus.',
},
},
{
'@type': 'Question',
name: 'Does it work on iPhone and Android?',
acceptedAnswer: {
'@type': 'Answer',
text: 'Yes. Both iOS (Camera app) and Android (Camera or Google Lens) natively support vCard QR codes and correctly import the contact data.',
},
},
],
},
],
};
export default function VCardQRCodePage() {
return (
<>
<script
type="application/ld+json"
dangerouslySetInnerHTML={{ __html: JSON.stringify(jsonLd) }}
/>
<ToolBreadcrumb toolName="vCard QR Code Generator" toolSlug="vcard-qr-code" />
<div className="min-h-screen" style={{ backgroundColor: '#EBEBDF' }}>
{/* HERO SECTION */}
<section className="relative pt-20 pb-20 lg:pt-32 lg:pb-32 px-4 sm:px-6 lg:px-8 overflow-hidden" style={{ backgroundColor: '#9F1239' }}>
<div className="absolute inset-0 opacity-10">
<svg className="w-full h-full" viewBox="0 0 100 100" preserveAspectRatio="none">
<path d="M0 100 C 20 0 50 0 100 100 Z" fill="url(#grad1)" />
<defs>
<linearGradient id="grad1" x1="0%" y1="0%" x2="100%" y2="0%">
<stop offset="0%" style={{ stopColor: 'white', stopOpacity: 1 }} />
<stop offset="100%" style={{ stopColor: 'white', stopOpacity: 0 }} />
</linearGradient>
</defs>
</svg>
</div>
<div className="max-w-7xl mx-auto grid lg:grid-cols-2 gap-12 items-center relative z-10">
<div className="text-center lg:text-left">
<div className="inline-flex items-center gap-2 px-3 py-1 rounded-full bg-white/10 text-white/90 text-sm font-medium mb-6 backdrop-blur-sm border border-white/10 hover:bg-white/20 transition-colors cursor-default">
<span className="flex h-2 w-2 relative">
<span className="animate-ping absolute inline-flex h-full w-full rounded-full bg-rose-400 opacity-75"></span>
<span className="relative inline-flex rounded-full h-2 w-2 bg-rose-400"></span>
</span>
Free Tool No Signup Required
</div>
<h1 className="text-4xl md:text-5xl lg:text-6xl font-extrabold text-white tracking-tight leading-tight mb-6">
The Modern Way to <br className="hidden lg:block" />
<span className="text-transparent bg-clip-text bg-gradient-to-r from-rose-300 to-pink-300">Share Your Contact</span>
</h1>
<p className="text-lg md:text-xl text-indigo-100 max-w-2xl mx-auto lg:mx-0 mb-8 leading-relaxed">
Create a scannable Digital Business Card. One scan saves your name, phone, email, and address instantly.
<strong className="text-white block sm:inline mt-2 sm:mt-0"> Free & Professional.</strong>
</p>
<div className="flex flex-wrap justify-center lg:justify-start gap-4 text-sm font-medium text-white/80">
<div className="flex items-center gap-2 bg-white/5 px-4 py-2.5 rounded-xl border border-white/5 backdrop-blur-sm">
<UserPlus className="w-4 h-4 text-rose-300" />
Instant Save
</div>
<div className="flex items-center gap-2 bg-white/5 px-4 py-2.5 rounded-xl border border-white/5 backdrop-blur-sm">
<Share2 className="w-4 h-4 text-amber-400" />
Easy Share
</div>
<div className="flex items-center gap-2 bg-white/5 px-4 py-2.5 rounded-xl border border-white/5 backdrop-blur-sm">
<Shield className="w-4 h-4 text-purple-400" />
No Data Stored
</div>
</div>
</div>
{/* Visual Abstract */}
<div className="hidden lg:flex relative items-center justify-center min-h-[400px]">
<div className="absolute w-[500px] h-[500px] bg-indigo-500/30 rounded-full blur-[100px] -top-20 -right-20 animate-pulse" />
<div className="relative w-96 h-60 bg-white/10 backdrop-blur-2xl border border-white/30 rounded-2xl shadow-2xl p-6 transform rotate-6 hover:rotate-3 transition-all duration-700 group">
<div className="absolute inset-0 bg-gradient-to-br from-white/10 to-transparent" />
<div className="flex justify-between items-start relative z-10">
<div className="space-y-4">
<div className="w-16 h-16 rounded-full bg-white/20 border-2 border-white/30 flex items-center justify-center">
<Contact className="w-8 h-8 text-white" />
</div>
<div className="space-y-1">
<div className="h-4 w-32 bg-white/90 rounded-sm" />
<div className="h-3 w-20 bg-emerald-400/90 rounded-sm" />
</div>
</div>
<div className="w-24 h-24 bg-white rounded-lg p-1.5 shadow-lg">
<QRCodeSVG value="https://www.qrmaster.net" size={84} fgColor="#1A1265" />
</div>
</div>
<div className="absolute bottom-6 left-6 space-y-2 z-10">
<div className="h-2 w-48 bg-white/40 rounded-full" />
<div className="h-2 w-40 bg-white/30 rounded-full" />
</div>
{/* Floating Badge */}
<div className="absolute -bottom-4 -left-4 bg-white py-2 px-4 rounded-lg shadow-xl flex items-center gap-2 transform scale-90">
<div className="bg-emerald-100 p-1.5 rounded-full">
<Check className="w-3 h-3 text-emerald-600" />
</div>
<span className="text-xs font-bold text-slate-900">Saved to Contacts</span>
</div>
</div>
</div>
</div>
</section>
{/* GENERATOR SECTION */}
<section className="py-12 px-4 sm:px-6 lg:px-8 -mt-8">
<VCardGenerator />
</section>
{/* HOW IT WORKS */}
<section className="py-16 px-4 sm:px-6 lg:px-8 bg-white">
<div className="max-w-4xl mx-auto">
<h2 className="text-3xl font-bold text-slate-900 text-center mb-12">
How vCard QR Codes Work
</h2>
<div className="grid md:grid-cols-3 gap-8">
<article className="text-center">
<div className="w-14 h-14 rounded-2xl bg-[#1A1265]/10 flex items-center justify-center mx-auto mb-4">
<Contact className="w-7 h-7 text-[#1A1265]" />
</div>
<h3 className="font-bold text-slate-900 mb-2">1. Enter Details</h3>
<p className="text-slate-600 text-sm">
Fill in your professional contact information. Only add what you want to share.
</p>
</article>
<article className="text-center">
<div className="w-14 h-14 rounded-2xl bg-[#1A1265]/10 flex items-center justify-center mx-auto mb-4">
<Smartphone className="w-7 h-7 text-[#1A1265]" />
</div>
<h3 className="font-bold text-slate-900 mb-2">2. Scan</h3>
<p className="text-slate-600 text-sm">
A potential client or partner scans your card with their phone camera.
</p>
</article>
<article className="text-center">
<div className="w-14 h-14 rounded-2xl bg-[#1A1265]/10 flex items-center justify-center mx-auto mb-4">
<UserPlus className="w-7 h-7 text-[#1A1265]" />
</div>
<h3 className="font-bold text-slate-900 mb-2">3. Save</h3>
<p className="text-slate-600 text-sm">
They tap "Create New Contact" to save your details instantly. No typing errors.
</p>
</article>
</div>
</div>
</section>
{/* FAQ SECTION */}
<section className="py-16 px-4 sm:px-6 lg:px-8" style={{ backgroundColor: '#EBEBDF' }}>
<div className="max-w-3xl mx-auto">
<h2 className="text-3xl font-bold text-slate-900 text-center mb-4">
Frequently Asked Questions
</h2>
<p className="text-slate-600 text-center mb-10">
Common questions about vCard QR codes.
</p>
<div className="space-y-4">
<FaqItem
question="Can I add a profile picture?"
answer="Not on a static vCard QR code. Static codes store data in the pixels, so adding an image would make the code too complex to scan. For profile pictures, social links, and rich media, use our Dynamic vCard Plus solution."
/>
<FaqItem
question="How long does the QR code last?"
answer="Forever. Static vCard QR codes do not expire because the data is embedded directly in the image."
/>
<FaqItem
question="What information is required?"
answer="Nothing is strictly required, but we recommend at least a First Name and either a Phone Number or Email so the contact is useful."
/>
<FaqItem
question="Is my data safe?"
answer="Yes. This tool operates 100% in your browser. We do not store, see, or optimize your contact data. It goes directly from your input to the QR code."
/>
</div>
</div>
</section>
</div>
</>
);
}
function FaqItem({ question, answer }: { question: string; answer: string }) {
return (
<details className="group bg-white rounded-xl shadow-sm border border-slate-200 overflow-hidden">
<summary className="flex items-center justify-between p-5 cursor-pointer list-none text-slate-900 font-semibold hover:bg-slate-50 transition-colors">
{question}
<span className="transition group-open:rotate-180 text-slate-400">
<svg fill="none" height="20" stroke="currentColor" strokeLinecap="round" strokeLinejoin="round" strokeWidth="2" viewBox="0 0 24 24" width="20">
<path d="M6 9l6 6 6-6" />
</svg>
</span>
</summary>
<div className="text-slate-600 px-5 pb-5 pt-0 leading-relaxed text-sm">
{answer}
</div>
</details>
);
}

View File

@@ -0,0 +1,268 @@
'use client';
import React, { useState, useRef } from 'react';
import Link from 'next/link';
import { QRCodeSVG } from 'qrcode.react';
import {
Phone,
Download,
Check,
Sparkles,
MessageCircle,
Send
} from 'lucide-react';
import { Button } from '@/components/ui/Button';
import { Input } from '@/components/ui/Input';
import { cn } from '@/lib/utils';
import { Textarea } from '@/components/ui/Textarea';
// Brand Colors
const BRAND = {
paleGrey: '#EBEBDF',
richBlue: '#1A1265',
richBlueLight: '#2A2275',
};
// QR Color Options - WhatsApp Theme
const QR_COLORS = [
{ name: 'WhatsApp Green', value: '#25D366' },
{ name: 'Teal', value: '#128C7E' },
{ name: 'Classic Black', value: '#000000' },
{ name: 'Rich Blue', value: '#1A1265' },
{ name: 'Purple', value: '#7C3AED' },
{ name: 'Emerald', value: '#10B981' },
{ name: 'Rose', value: '#F43F5E' },
];
// Frame Options
const FRAME_OPTIONS = [
{ id: 'none', label: 'No Frame' },
{ id: 'scanme', label: 'Scan Me' },
{ id: 'chat', label: 'Chat With Us' },
{ id: 'support', label: 'Support' },
];
export default function WhatsappGenerator() {
const [phone, setPhone] = useState('');
const [message, setMessage] = useState('');
const [qrColor, setQrColor] = useState('#25D366');
const [frameType, setFrameType] = useState('none');
const qrRef = useRef<HTMLDivElement>(null);
// WhatsApp URL: https://wa.me/number?text=message
const getUrl = () => {
const cleanPhone = phone.replace(/\D/g, ''); // Remove non-digits
const encodedMessage = encodeURIComponent(message);
return `https://wa.me/${cleanPhone}?text=${encodedMessage}`;
};
const handleDownload = async (format: 'png' | 'svg') => {
if (!qrRef.current) return;
try {
if (format === 'png') {
const { toPng } = await import('html-to-image');
const dataUrl = await toPng(qrRef.current, { cacheBust: true, pixelRatio: 3 });
const link = document.createElement('a');
link.download = `whatsapp-qr-code.png`;
link.href = dataUrl;
link.click();
} else {
const svgData = qrRef.current.querySelector('svg')?.outerHTML;
if (svgData) {
const blob = new Blob([svgData], { type: 'image/svg+xml;charset=utf-8' });
const url = URL.createObjectURL(blob);
const link = document.createElement('a');
link.href = url;
link.download = `whatsapp-qr-code.svg`;
link.click();
}
}
} catch (err) {
console.error('Download failed', err);
}
};
const getFrameLabel = () => {
const frame = FRAME_OPTIONS.find(f => f.id === frameType);
return frame?.id !== 'none' ? frame?.label : null;
};
return (
<div className="w-full max-w-5xl mx-auto px-4 md:px-6">
{/* Main Generator Card */}
<div className="bg-white rounded-3xl shadow-2xl shadow-slate-900/10 overflow-hidden border border-slate-100">
<div className="grid lg:grid-cols-2">
{/* LEFT: Input Section */}
<div className="p-8 lg:p-10 space-y-8 border-r border-slate-100">
{/* WhatsApp Details */}
<div className="space-y-6">
<h2 className="text-lg font-bold text-slate-900 flex items-center gap-2">
<MessageCircle className="w-5 h-5 text-[#25D366]" />
WhatsApp Details
</h2>
<div>
<label className="block text-sm font-medium text-slate-700 mb-2">Phone Number</label>
<Input
placeholder="15551234567"
value={phone}
onChange={(e) => setPhone(e.target.value)}
className="h-12 text-base rounded-xl border-slate-200 focus:border-[#25D366] focus:ring-[#25D366]"
/>
<p className="text-xs text-slate-500 mt-2">Include country code (e.g. 1 for US, 44 for UK). No '+' symbol.</p>
</div>
<div>
<label className="block text-sm font-medium text-slate-700 mb-2">Pre-filled Message (Optional)</label>
<Textarea
placeholder="Hi, I'm interested in your services..."
value={message}
onChange={(e: React.ChangeEvent<HTMLTextAreaElement>) => setMessage(e.target.value)}
className="h-24 p-4 text-base rounded-xl border-slate-200 focus:border-[#25D366] focus:ring-[#25D366] resize-none"
/>
</div>
</div>
<div className="border-t border-slate-100"></div>
{/* Design Options */}
<div className="space-y-6">
<h2 className="text-lg font-bold text-slate-900 flex items-center gap-2">
<Sparkles className="w-5 h-5 text-[#25D366]" />
Design Options
</h2>
{/* Color Picker */}
<div>
<label className="block text-sm font-medium text-slate-700 mb-3">QR Code Color</label>
<div className="flex flex-wrap gap-2">
{QR_COLORS.map((c) => (
<button
key={c.name}
onClick={() => setQrColor(c.value)}
className={cn(
"w-9 h-9 rounded-full border-2 flex items-center justify-center transition-all hover:scale-110",
qrColor === c.value ? "border-slate-900 ring-2 ring-offset-2 ring-slate-200" : "border-white shadow-md"
)}
style={{ backgroundColor: c.value }}
aria-label={`Select ${c.name}`}
title={c.name}
>
{qrColor === c.value && <Check className="w-4 h-4 text-white" strokeWidth={3} />}
</button>
))}
</div>
</div>
{/* Frame Selector */}
<div>
<label className="block text-sm font-medium text-slate-700 mb-3">Frame Label</label>
<div className="grid grid-cols-4 gap-2">
{FRAME_OPTIONS.map((frame) => (
<button
key={frame.id}
onClick={() => setFrameType(frame.id)}
className={cn(
"py-2.5 px-3 rounded-lg text-sm font-medium transition-all border",
frameType === frame.id
? "bg-[#25D366] text-white border-[#25D366]"
: "bg-slate-50 text-slate-600 border-slate-200 hover:border-slate-300"
)}
>
{frame.label}
</button>
))}
</div>
</div>
</div>
</div>
{/* RIGHT: Preview Section */}
<div className="p-8 lg:p-10 flex flex-col items-center justify-center" style={{ backgroundColor: BRAND.paleGrey }}>
{/* QR Card with Frame */}
<div
ref={qrRef}
className="bg-white rounded-3xl shadow-xl p-8 flex flex-col items-center"
style={{ minWidth: '320px' }}
>
{/* Frame Label */}
{getFrameLabel() && (
<div
className="mb-5 px-8 py-2.5 rounded-full text-white font-bold text-sm tracking-widest uppercase shadow-md"
style={{ backgroundColor: qrColor }}
>
{getFrameLabel()}
</div>
)}
{/* QR Code */}
<div className="bg-white">
<QRCodeSVG
value={getUrl()}
size={240}
level="M"
includeMargin={false}
fgColor={qrColor}
/>
</div>
{/* Info Preview */}
<div className="mt-6 text-center max-w-[260px]">
<h3 className="font-bold text-slate-900 text-lg flex items-center justify-center gap-2 truncate">
<Phone className="w-4 h-4 text-slate-400 shrink-0" />
<span className="truncate">{phone ? `+${phone}` : 'Number'}</span>
</h3>
<div className="text-xs text-slate-500 mt-1">Starts WhatsApp Chat</div>
</div>
</div>
{/* Download Buttons */}
<div className="flex items-center gap-3 mt-8">
<Button
onClick={() => handleDownload('png')}
className="bg-[#25D366] hover:bg-[#128C7E] text-white shadow-lg"
>
<Download className="w-4 h-4 mr-2" />
Download PNG
</Button>
<Button
onClick={() => handleDownload('svg')}
variant="outline"
className="border-slate-300 hover:bg-white"
>
<Download className="w-4 h-4 mr-2" />
SVG
</Button>
</div>
<p className="text-xs text-slate-500 mt-4 text-center">
Scanning starts a chat with this number instantly.
</p>
</div>
</div>
</div>
{/* Upsell Banner */}
<div className="mt-8 bg-gradient-to-r from-[#128C7E] to-[#25D366] rounded-2xl p-6 flex flex-col sm:flex-row items-center justify-between gap-4">
<div className="text-white text-center sm:text-left">
<h3 className="font-bold text-lg">Using WhatsApp for Business?</h3>
<p className="text-white/80 text-sm mt-1">
Track how many customers contact you via QR code analytics with our Pro plan.
</p>
</div>
<Link href="/signup">
<Button className="bg-white text-[#128C7E] hover:bg-slate-100 shrink-0 shadow-lg">
Get Business Analytics
</Button>
</Link>
</div>
</div>
);
}

View File

@@ -0,0 +1,363 @@
import React from 'react';
import type { Metadata } from 'next';
import WhatsappGenerator from './WhatsAppGenerator';
import { MessageCircle, Shield, Zap, Smartphone, Send, Phone, Download, Check } from 'lucide-react';
import { QRCodeSVG } from 'qrcode.react';
import { ToolBreadcrumb } from '@/components/seo/BreadcrumbSchema';
// SEO Optimized Metadata
export const metadata: Metadata = {
title: 'Free WhatsApp QR Code Generator | Start Chats Instantly | QR Master',
description: 'Create a QR code that opens a WhatsApp chat with you. Add a pre-filled message. Perfect for customer support and sales.',
keywords: ['whatsapp qr code', 'wa.me generator', 'whatsapp chat qr', 'whatsapp link generator', 'contact qr code'],
alternates: {
canonical: 'https://qrmaster.io/tools/whatsapp-qr-code',
},
openGraph: {
title: 'Free WhatsApp QR Code Generator | QR Master',
description: 'Generate QR codes to start WhatsApp chats. Add a pre-filled message.',
type: 'website',
url: 'https://qrmaster.io/tools/whatsapp-qr-code',
images: [{ url: '/og-whatsapp-generator.png', width: 1200, height: 630 }],
},
twitter: {
card: 'summary_large_image',
title: 'Free WhatsApp QR Code Generator',
description: 'Create QR codes for WhatsApp. Chat instantly.',
},
robots: {
index: true,
follow: true,
},
};
// JSON-LD Structured Data
const jsonLd = {
'@context': 'https://schema.org',
'@graph': [
{
'@type': 'SoftwareApplication',
name: 'WhatsApp QR Code Generator',
applicationCategory: 'UtilitiesApplication',
operatingSystem: 'Web Browser',
offers: {
'@type': 'Offer',
price: '0',
priceCurrency: 'USD',
},
aggregateRating: {
'@type': 'AggregateRating',
ratingValue: '4.8',
ratingCount: '2300',
},
description: 'Generate QR codes that start a WhatsApp conversation with a specific number.',
},
{
'@type': 'HowTo',
name: 'How to Create a WhatsApp QR Code',
description: 'Create a QR code that opens a WhatsApp chat.',
step: [
{
'@type': 'HowToStep',
position: 1,
name: 'Enter Number',
text: 'Type your WhatsApp phone number with country code (e.g. 1555...).',
},
{
'@type': 'HowToStep',
position: 2,
name: 'Customize',
text: 'Add a pre-written message and choose your brand color.',
},
{
'@type': 'HowToStep',
position: 3,
name: 'Download',
text: 'Save the QR code.',
},
{
'@type': 'HowToStep',
position: 4,
name: 'Test',
text: 'Scan the code to ensure it opens the correct chat.',
},
{
'@type': 'HowToStep',
position: 5,
name: 'Share',
text: 'Add it to your website, business cards, or support materials.',
},
],
totalTime: 'PT45S',
},
{
'@type': 'FAQPage',
mainEntity: [
{
'@type': 'Question',
name: 'Do users need to save my number first?',
acceptedAnswer: {
'@type': 'Answer',
text: 'No! That is the best part. Scanning the code opens the chat immediately without them needing to save you as a contact first.',
},
},
{
'@type': 'Question',
name: 'Can I use this for WhatsApp Business?',
acceptedAnswer: {
'@type': 'Answer',
text: 'Yes, it works perfectly for both personal and business accounts.',
},
},
{
'@type': 'Question',
name: 'What is the Pre-filled Message?',
acceptedAnswer: {
'@type': 'Answer',
text: 'It is text that automatically appears in the user\'s typing field when they scan the code (e.g., "Hello, I want to order pizza"). They just have to hit send.',
},
},
{
'@type': 'Question',
name: 'Is it free?',
acceptedAnswer: {
'@type': 'Answer',
text: 'Yes, this generator is completely free.',
},
},
{
'@type': 'Question',
name: 'Can I track scans?',
acceptedAnswer: {
'@type': 'Answer',
text: 'This is a static QR code, so tracking is not included. Use our Dynamic QR Code generator for analytics.',
},
},
],
},
],
};
export default function WhatsappQRCodePage() {
return (
<>
<script
type="application/ld+json"
dangerouslySetInnerHTML={{ __html: JSON.stringify(jsonLd) }}
/>
<ToolBreadcrumb toolName="WhatsApp QR Code Generator" toolSlug="whatsapp-qr-code" />
<div className="min-h-screen" style={{ backgroundColor: '#EBEBDF' }}>
{/* HERO SECTION */}
<section className="relative pt-20 pb-20 lg:pt-32 lg:pb-32 px-4 sm:px-6 lg:px-8 overflow-hidden bg-[#128C7E]">
<div className="absolute inset-0 opacity-10">
{/* WhatsApp Pattern */}
<svg className="w-full h-full" width="100%" height="100%" xmlns="http://www.w3.org/2000/svg">
<defs>
<pattern id="wa_pattern" width="60" height="60" patternUnits="userSpaceOnUse">
<path d="M30 30L35 35M25 35L30 30" stroke="white" strokeWidth="2" strokeOpacity="0.2" />
</pattern>
</defs>
<rect width="100%" height="100%" fill="url(#wa_pattern)" />
</svg>
</div>
<div className="max-w-7xl mx-auto grid lg:grid-cols-2 gap-12 items-center relative z-10">
<div className="text-center lg:text-left">
<div className="inline-flex items-center gap-2 px-3 py-1 rounded-full bg-white/10 text-white/90 text-sm font-medium mb-6 backdrop-blur-sm border border-white/10 hover:bg-white/20 transition-colors cursor-default">
<span className="flex h-2 w-2 relative">
<span className="animate-ping absolute inline-flex h-full w-full rounded-full bg-green-300 opacity-75"></span>
<span className="relative inline-flex rounded-full h-2 w-2 bg-green-300"></span>
</span>
Free Tool No Signup Required
</div>
<h1 className="text-4xl md:text-5xl lg:text-6xl font-extrabold text-white tracking-tight leading-tight mb-6">
Start Chats Instantly with <br className="hidden lg:block" />
<span className="text-white drop-shadow-md">WhatsApp QR Codes</span>
</h1>
<p className="text-lg md:text-xl text-green-50 max-w-2xl mx-auto lg:mx-0 mb-8 leading-relaxed">
Let customers message you without saving your number.
<strong className="text-white block sm:inline mt-2 sm:mt-0"> Perfect for support, sales, and bookings.</strong>
</p>
<div className="flex flex-wrap justify-center lg:justify-start gap-4 text-sm font-medium text-white/80">
<div className="flex items-center gap-2 bg-white/10 px-4 py-2.5 rounded-xl border border-white/10 backdrop-blur-sm">
<Send className="w-4 h-4 text-green-200" />
Instant Chat
</div>
<div className="flex items-center gap-2 bg-white/10 px-4 py-2.5 rounded-xl border border-white/10 backdrop-blur-sm">
<MessageCircle className="w-4 h-4 text-white" />
Pre-filled Msg
</div>
<div className="flex items-center gap-2 bg-white/10 px-4 py-2.5 rounded-xl border border-white/10 backdrop-blur-sm">
<Phone className="w-4 h-4 text-white" />
No Save Contact
</div>
</div>
</div>
{/* Visual Abstract */}
<div className="hidden lg:flex relative items-center justify-center min-h-[400px]">
<div className="absolute w-[500px] h-[500px] bg-green-500/30 rounded-full blur-[100px] -top-20 -right-20 animate-pulse" />
<div className="relative w-80 h-96 bg-white/5 backdrop-blur-xl border border-white/20 rounded-3xl shadow-2xl flex flex-col items-center justify-center p-8 transform -rotate-3 hover:rotate-0 transition-all duration-700 group">
<div className="absolute inset-0 bg-gradient-to-br from-white/10 to-transparent rounded-3xl" />
<div className="w-full bg-[#ECE5DD] rounded-xl shadow-lg h-40 mb-6 relative overflow-hidden flex flex-col justify-end p-4">
{/* Chat Bubble Right */}
<div className="bg-[#DCF8C6] p-2 rounded-lg self-end mb-2 max-w-[80%] text-[10px] text-slate-800 shadow-sm">
Hi! I'd like to book an appointment.
<div className="text-[8px] text-slate-500 text-right mt-0.5">10:42 AM <span className="text-blue-500">✓✓</span></div>
</div>
{/* Chat Bubble Left */}
<div className="bg-white p-2 rounded-lg self-start max-w-[80%] text-[10px] text-slate-800 shadow-sm">
Sure! What time works for you?
<div className="text-[8px] text-slate-500 text-right mt-0.5">10:43 AM</div>
</div>
</div>
<div className="w-44 h-44 bg-white rounded-xl p-2 shadow-inner relative overflow-hidden flex items-center justify-center">
<QRCodeSVG value="https://www.qrmaster.net" size={160} fgColor="#128C7E" level="Q" />
</div>
{/* Floating Badge */}
<div className="absolute -bottom-6 -left-6 bg-white py-3 px-5 rounded-xl shadow-xl flex items-center gap-3 transform transition-transform hover:scale-105 duration-300">
<div className="bg-green-100 p-2 rounded-full">
<MessageCircle className="w-5 h-5 text-[#25D366]" />
</div>
<div className="text-left">
<div className="text-[10px] text-slate-400 font-bold uppercase tracking-wider">WhatsApp</div>
<div className="text-sm font-bold text-slate-900">Start Chat</div>
</div>
</div>
</div>
</div>
</div>
</section>
{/* GENERATOR SECTION */}
<section className="py-12 px-4 sm:px-6 lg:px-8 -mt-8">
<WhatsappGenerator />
</section>
{/* HOW IT WORKS */}
<section className="py-16 px-4 sm:px-6 lg:px-8 bg-white">
<div className="max-w-4xl mx-auto">
<h2 className="text-3xl font-bold text-slate-900 text-center mb-12">
How WhatsApp QR Codes Work
</h2>
<div className="grid md:grid-cols-3 lg:grid-cols-5 gap-8">
<article className="text-center">
<div className="w-14 h-14 rounded-2xl bg-[#25D366]/10 flex items-center justify-center mx-auto mb-4">
<Phone className="w-7 h-7 text-[#25D366]" />
</div>
<h3 className="font-bold text-slate-900 mb-2">1. Your Number</h3>
<p className="text-slate-600 text-sm">
Enter your WhatsApp phone number. Ensure it includes the country code.
</p>
</article>
<article className="text-center">
<div className="w-12 h-12 rounded-2xl bg-[#25D366]/10 flex items-center justify-center mx-auto mb-4">
<MessageCircle className="w-6 h-6 text-[#25D366]" />
</div>
<h3 className="font-bold text-slate-900 mb-2">2. Customize</h3>
<p className="text-slate-600 text-xs leading-relaxed">
Add a message and choose your color.
</p>
</article>
<article className="text-center">
<div className="w-12 h-12 rounded-2xl bg-[#25D366]/10 flex items-center justify-center mx-auto mb-4">
<Download className="w-6 h-6 text-[#25D366]" />
</div>
<h3 className="font-bold text-slate-900 mb-2">3. Download</h3>
<p className="text-slate-600 text-xs leading-relaxed">
Save your QR code.
</p>
</article>
<article className="text-center">
<div className="w-12 h-12 rounded-2xl bg-[#25D366]/10 flex items-center justify-center mx-auto mb-4">
<Check className="w-6 h-6 text-[#25D366]" />
</div>
<h3 className="font-bold text-slate-900 mb-2">4. Test</h3>
<p className="text-slate-600 text-xs leading-relaxed">
Scan to ensure it works.
</p>
</article>
<article className="text-center">
<div className="w-12 h-12 rounded-2xl bg-[#25D366]/10 flex items-center justify-center mx-auto mb-4">
<Send className="w-6 h-6 text-[#25D366]" />
</div>
<h3 className="font-bold text-slate-900 mb-2">5. Chat</h3>
<p className="text-slate-600 text-xs leading-relaxed">
Start chatting instantly.
</p>
</article>
</div>
</div>
</section>
{/* FAQ SECTION */}
<section className="py-16 px-4 sm:px-6 lg:px-8" style={{ backgroundColor: '#EBEBDF' }}>
<div className="max-w-3xl mx-auto">
<h2 className="text-3xl font-bold text-slate-900 text-center mb-4">
Frequently Asked Questions
</h2>
<p className="text-slate-600 text-center mb-10">
Common questions about WhatsApp QR codes.
</p>
<div className="space-y-4">
<FaqItem
question="Does it work internationally?"
answer="Yes. Since you include the country code, it works for anyone, anywhere in the world."
/>
<FaqItem
question="Can I use this on my website?"
answer="Yes, you can display the QR code on your contact page so desktop users can easily scan it to chat on their phone."
/>
<FaqItem
question="Is my phone number visible?"
answer="Yes, the phone number is embedded in the link. It is the same visibility as putting your phone number on a business card."
/>
<FaqItem
question="Is it free?"
answer="Yes, this generator is completely free."
/>
<FaqItem
question="Can I track scans?"
answer="This is a static QR code, so tracking is not included. Use our Dynamic QR Code generator for analytics."
/>
</div>
</div>
</section>
</div>
</>
);
}
function FaqItem({ question, answer }: { question: string; answer: string }) {
return (
<details className="group bg-white rounded-xl shadow-sm border border-slate-200 overflow-hidden">
<summary className="flex items-center justify-between p-5 cursor-pointer list-none text-slate-900 font-semibold hover:bg-slate-50 transition-colors">
{question}
<span className="transition group-open:rotate-180 text-slate-400">
<svg fill="none" height="20" stroke="currentColor" strokeLinecap="round" strokeLinejoin="round" strokeWidth="2" viewBox="0 0 24 24" width="20">
<path d="M6 9l6 6 6-6" />
</svg>
</span>
</summary>
<div className="text-slate-600 px-5 pb-5 pt-0 leading-relaxed text-sm">
{answer}
</div>
</details>
);
}

View File

@@ -0,0 +1,307 @@
'use client';
import React, { useState, useRef } from 'react';
import Link from 'next/link';
import { QRCodeSVG } from 'qrcode.react';
import {
Wifi,
Download,
Printer,
Check,
Eye,
EyeOff,
Sparkles
} from 'lucide-react';
import { Button } from '@/components/ui/Button';
import { Input } from '@/components/ui/Input';
import { Select } from '@/components/ui/Select';
import { cn } from '@/lib/utils';
// Brand Colors
const BRAND = {
paleGrey: '#F0F9FF', // Sky-50
primary: '#0EA5E9', // Sky-500
primaryDark: '#0284C7', // Sky-600
};
// QR Color Options
const QR_COLORS = [
{ name: 'Sky Blue', value: '#0EA5E9' },
{ name: 'Classic Black', value: '#000000' },
{ name: 'Deep Blue', value: '#1E40AF' },
{ name: 'Cyan', value: '#06B6D4' },
{ name: 'Violet', value: '#7C3AED' },
{ name: 'Emerald', value: '#10B981' },
{ name: 'Rose', value: '#F43F5E' },
];
// Frame Options
const FRAME_OPTIONS = [
{ id: 'none', label: 'No Frame' },
{ id: 'scanme', label: 'Scan Me' },
{ id: 'wifi', label: 'WiFi' },
{ id: 'connect', label: 'Connect' },
{ id: 'free', label: 'Free WiFi' },
];
export default function WiFiGenerator() {
const [ssid, setSsid] = useState('');
const [password, setPassword] = useState('');
const [encryption, setEncryption] = useState('WPA');
const [hidden, setHidden] = useState(false);
const [showPassword, setShowPassword] = useState(false);
// Customization
const [qrColor, setQrColor] = useState(BRAND.primary);
const [frameType, setFrameType] = useState('none');
const qrRef = useRef<HTMLDivElement>(null);
const wifiString = `WIFI:T:${encryption};S:${ssid};P:${password};H:${hidden};;`;
const handleDownload = async (format: 'png' | 'svg') => {
if (!qrRef.current) return;
try {
if (format === 'png') {
const { toPng } = await import('html-to-image');
const dataUrl = await toPng(qrRef.current, { cacheBust: true, pixelRatio: 3 });
const link = document.createElement('a');
link.download = `wifi-qr-${ssid || 'code'}.png`;
link.href = dataUrl;
link.click();
} else {
const svgData = qrRef.current.querySelector('svg')?.outerHTML;
if (svgData) {
const blob = new Blob([svgData], { type: 'image/svg+xml;charset=utf-8' });
const url = URL.createObjectURL(blob);
const link = document.createElement('a');
link.href = url;
link.download = `wifi-qr-${ssid || 'code'}.svg`;
link.click();
}
}
} catch (err) {
console.error('Download failed', err);
}
};
const getFrameLabel = () => {
const frame = FRAME_OPTIONS.find(f => f.id === frameType);
return frame?.id !== 'none' ? frame?.label : null;
};
return (
<div className="w-full max-w-5xl mx-auto px-4 md:px-6">
{/* Main Generator Card */}
<div className="bg-white rounded-3xl shadow-2xl shadow-slate-900/10 overflow-hidden border border-slate-100">
<div className="grid lg:grid-cols-2">
{/* LEFT: Input Section */}
<div className="p-8 lg:p-10 space-y-8 border-r border-slate-100">
{/* Network Details */}
<div className="space-y-6">
<h2 className="text-lg font-bold text-slate-900 flex items-center gap-2">
<Wifi className="w-5 h-5 text-[#0EA5E9]" />
Network Details
</h2>
<div className="space-y-4">
<div>
<label className="block text-sm font-medium text-slate-700 mb-2">Network Name (SSID)</label>
<Input
placeholder="e.g. MyHomeWiFi"
value={ssid}
onChange={(e) => setSsid(e.target.value)}
className="h-12 text-base rounded-xl border-slate-200 focus:border-[#0EA5E9] focus:ring-[#0EA5E9]"
/>
</div>
<div>
<label className="block text-sm font-medium text-slate-700 mb-2">Password</label>
<div className="relative">
<Input
type={showPassword ? "text" : "password"}
placeholder="Your WiFi Password"
value={password}
onChange={(e) => setPassword(e.target.value)}
className="h-12 text-base rounded-xl border-slate-200 focus:border-[#0EA5E9] focus:ring-[#0EA5E9] pr-12"
/>
<button
type="button"
onClick={() => setShowPassword(!showPassword)}
className="absolute right-3 top-1/2 -translate-y-1/2 p-1.5 text-slate-400 hover:text-slate-600 transition-colors"
aria-label={showPassword ? "Hide password" : "Show password"}
>
{showPassword ? <EyeOff className="w-5 h-5" /> : <Eye className="w-5 h-5" />}
</button>
</div>
</div>
<div className="grid grid-cols-2 gap-4">
<div>
<label className="block text-sm font-medium text-slate-700 mb-2">Security</label>
<Select
value={encryption}
onChange={(e) => setEncryption(e.target.value)}
className="h-12 rounded-xl border-slate-200"
options={[
{ value: 'WPA', label: 'WPA / WPA2' },
{ value: 'WEP', label: 'WEP' },
{ value: 'nopass', label: 'No Password' },
]}
/>
</div>
<div className="flex items-end pb-1">
<label className="flex items-center gap-3 cursor-pointer group">
<div className={cn(
"w-5 h-5 rounded border-2 flex items-center justify-center transition-all",
hidden ? "bg-[#1A1265] border-[#1A1265]" : "border-slate-300 group-hover:border-slate-400"
)}>
{hidden && <Check className="w-3.5 h-3.5 text-white" strokeWidth={3} />}
</div>
<input type="checkbox" checked={hidden} onChange={(e) => setHidden(e.target.checked)} className="sr-only" />
<span className="text-sm font-medium text-slate-700">Hidden Network</span>
</label>
</div>
</div>
</div>
</div>
{/* Divider */}
<div className="border-t border-slate-100"></div>
{/* Design Options */}
<div className="space-y-6">
<h2 className="text-lg font-bold text-slate-900 flex items-center gap-2">
<Sparkles className="w-5 h-5 text-[#0EA5E9]" />
Design Options
</h2>
{/* Color Picker */}
<div>
<label className="block text-sm font-medium text-slate-700 mb-3">QR Code Color</label>
<div className="flex flex-wrap gap-2">
{QR_COLORS.map((c) => (
<button
key={c.name}
onClick={() => setQrColor(c.value)}
className={cn(
"w-9 h-9 rounded-full border-2 flex items-center justify-center transition-all hover:scale-110",
qrColor === c.value ? "border-slate-900 ring-2 ring-offset-2 ring-slate-200" : "border-white shadow-md"
)}
style={{ backgroundColor: c.value }}
aria-label={`Select ${c.name}`}
title={c.name}
>
{qrColor === c.value && <Check className="w-4 h-4 text-white" strokeWidth={3} />}
</button>
))}
</div>
</div>
{/* Frame Selector */}
<div>
<label className="block text-sm font-medium text-slate-700 mb-3">Frame Label</label>
<div className="grid grid-cols-4 gap-2">
{FRAME_OPTIONS.map((frame) => (
<button
key={frame.id}
onClick={() => setFrameType(frame.id)}
className={cn(
"py-2.5 px-3 rounded-lg text-sm font-medium transition-all border",
frameType === frame.id
? "bg-[#0EA5E9] text-white border-[#0EA5E9]"
: "bg-slate-50 text-slate-600 border-slate-200 hover:border-slate-300"
)}
>
{frame.label}
</button>
))}
</div>
</div>
</div>
</div>
{/* RIGHT: Preview Section */}
<div className="p-8 lg:p-10 flex flex-col items-center justify-center" style={{ backgroundColor: BRAND.paleGrey }}>
{/* QR Card with Frame */}
<div
ref={qrRef}
className="bg-white rounded-3xl shadow-xl p-8 flex flex-col items-center"
style={{ minWidth: '320px' }}
>
{/* Frame Label - CTA Button Style */}
{getFrameLabel() && (
<div
className="mb-5 px-8 py-2.5 rounded-full text-white font-bold text-sm tracking-widest uppercase shadow-md"
style={{ backgroundColor: qrColor }}
>
{getFrameLabel()}
</div>
)}
{/* QR Code */}
<div className="bg-white">
<QRCodeSVG
value={wifiString}
size={240}
level="M"
includeMargin={false}
fgColor={qrColor}
/>
</div>
{/* Network Info */}
<div className="mt-6 text-center">
<h3 className="font-bold text-slate-900 text-xl truncate max-w-[260px] mx-auto">
{ssid || 'Network Name'}
</h3>
</div>
</div>
{/* Download Buttons */}
<div className="flex items-center gap-3 mt-8">
<Button
onClick={() => handleDownload('png')}
className="bg-[#0EA5E9] hover:bg-[#0284C7] text-white shadow-lg"
>
<Download className="w-4 h-4 mr-2" />
Download PNG
</Button>
<Button
onClick={() => handleDownload('svg')}
variant="outline"
className="border-slate-300 hover:bg-white"
>
<Download className="w-4 h-4 mr-2" />
SVG
</Button>
</div>
<p className="text-xs text-slate-500 mt-4 text-center">
Your credentials stay on your device. Nothing is sent to servers.
</p>
</div>
</div>
</div>
{/* Upsell Banner */}
<div className="mt-8 bg-gradient-to-r from-[#0EA5E9] to-[#0284C7] rounded-2xl p-6 flex flex-col sm:flex-row items-center justify-between gap-4">
<div className="text-white text-center sm:text-left">
<h3 className="font-bold text-lg">Hospitality or Business WiFi?</h3>
<p className="text-white/80 text-sm mt-1">Get scan analytics and collect customer reviews with our Pro plan.</p>
</div>
<Link href="/signup">
<Button className="bg-white text-[#0EA5E9] hover:bg-slate-100 shrink-0 shadow-lg">
Get Business Tools
</Button>
</Link>
</div>
</div>
);
}

View File

@@ -0,0 +1,369 @@
import React from 'react';
import type { Metadata } from 'next';
import WiFiGenerator from './WiFiGenerator';
import { Wifi, Shield, Zap, Smartphone, Lock, QrCode, Download, Share2 } from 'lucide-react';
import { QRCodeSVG } from 'qrcode.react';
import { ToolBreadcrumb } from '@/components/seo/BreadcrumbSchema';
// SEO Optimized Metadata
export const metadata: Metadata = {
title: 'Free WiFi QR Code Generator | Instant & Secure | QR Master',
description: 'Create a WiFi QR code in seconds. Guests scan to connect instantly—no typing passwords. 100% private: your credentials never leave your browser. Free forever.',
keywords: ['wifi qr code', 'qr code generator', 'wifi qr code generator', 'share wifi', 'wifi password qr', 'guest wifi'],
alternates: {
canonical: 'https://qrmaster.io/tools/wifi-qr-code',
},
openGraph: {
title: 'Free WiFi QR Code Generator | QR Master',
description: 'Share your WiFi without sharing your password. Guests scan the QR code to connect instantly.',
type: 'website',
url: 'https://qrmaster.io/tools/wifi-qr-code',
images: [{ url: '/og-wifi-generator.png', width: 1200, height: 630 }],
},
twitter: {
card: 'summary_large_image',
title: 'Free WiFi QR Code Generator',
description: 'Share WiFi instantly with a QR code. No typing passwords.',
},
robots: {
index: true,
follow: true,
},
};
// JSON-LD Structured Data
const jsonLd = {
'@context': 'https://schema.org',
'@graph': [
// SoftwareApplication Schema
{
'@type': 'SoftwareApplication',
name: 'WiFi QR Code Generator',
applicationCategory: 'UtilitiesApplication',
operatingSystem: 'Web Browser',
offers: {
'@type': 'Offer',
price: '0',
priceCurrency: 'USD',
},
aggregateRating: {
'@type': 'AggregateRating',
ratingValue: '4.9',
ratingCount: '2847',
},
description: 'Generate QR codes for WiFi networks. Guests scan to connect without typing passwords.',
},
// HowTo Schema for Featured Snippets
{
'@type': 'HowTo',
name: 'How to Create a WiFi QR Code',
description: 'Create a QR code that connects devices to your WiFi network automatically.',
step: [
{
'@type': 'HowToStep',
position: 1,
name: 'Enter Network Name',
text: 'Type your WiFi network name (SSID) in the Network Name field.',
},
{
'@type': 'HowToStep',
position: 2,
name: 'Enter Password',
text: 'Enter your WiFi password. This is processed locally and never sent to any server.',
},
{
'@type': 'HowToStep',
position: 3,
name: 'Select Security Type',
text: 'Choose WPA/WPA2 (most common), WEP, or No Password for open networks.',
},
{
'@type': 'HowToStep',
position: 4,
name: 'Download QR Code',
text: 'Click Download PNG or SVG to save your QR code. Print it or share digitally.',
},
{
'@type': 'HowToStep',
position: 5,
name: 'Connect',
text: 'Print the code. Guests can scan it to join your network instantly.',
},
],
totalTime: 'PT1M',
},
// FAQPage Schema
{
'@type': 'FAQPage',
mainEntity: [
{
'@type': 'Question',
name: 'Is it safe to enter my WiFi password?',
acceptedAnswer: {
'@type': 'Answer',
text: 'Yes, completely safe. This tool processes everything in your browser (client-side). Your password never leaves your device and is not sent to any server.',
},
},
{
'@type': 'Question',
name: 'Do WiFi QR codes work on iPhone and Android?',
acceptedAnswer: {
'@type': 'Answer',
text: 'Yes. Both iOS (11+) and Android devices can scan WiFi QR codes using their built-in camera app. No additional apps required.',
},
},
{
'@type': 'Question',
name: 'What happens if I change my WiFi password?',
acceptedAnswer: {
'@type': 'Answer',
text: 'You will need to generate a new QR code with the updated password. Consider using dynamic QR codes if you change passwords frequently.',
},
},
{
'@type': 'Question',
name: 'Can I customize the QR code design?',
acceptedAnswer: {
'@type': 'Answer',
text: 'Yes. You can change the QR code color and add frame labels like "Scan Me" or "WiFi" to make it more recognizable.',
},
},
{
'@type': 'Question',
name: 'Does it work for hidden networks?',
acceptedAnswer: {
'@type': 'Answer',
text: 'Yes, just check the "Hidden Network" box if your SSID is hidden. The QR code contains the standard WiFi string configuration.',
},
},
],
},
],
};
export default function WiFiQRCodePage() {
return (
<>
{/* JSON-LD Script */}
<script
type="application/ld+json"
dangerouslySetInnerHTML={{ __html: JSON.stringify(jsonLd) }}
/>
<ToolBreadcrumb toolName="WiFi QR Code Generator" toolSlug="wifi-qr-code" />
<div className="min-h-screen" style={{ backgroundColor: '#EBEBDF' }}>
{/* HERO SECTION */}
<section className="relative pt-20 pb-20 lg:pt-32 lg:pb-32 px-4 sm:px-6 lg:px-8 overflow-hidden" style={{ backgroundColor: '#1A1265' }}>
{/* Background Pattern */}
<div className="absolute inset-0 opacity-10">
<svg className="w-full h-full" viewBox="0 0 100 100" preserveAspectRatio="none">
<path d="M0 100 C 20 0 50 0 100 100 Z" fill="url(#grad1)" />
<defs>
<linearGradient id="grad1" x1="0%" y1="0%" x2="100%" y2="0%">
<stop offset="0%" style={{ stopColor: 'white', stopOpacity: 1 }} />
<stop offset="100%" style={{ stopColor: 'white', stopOpacity: 0 }} />
</linearGradient>
</defs>
</svg>
</div>
<div className="max-w-7xl mx-auto grid lg:grid-cols-2 gap-12 items-center relative z-10">
{/* Left: Text Content */}
<div className="text-center lg:text-left">
{/* Badge */}
<div className="inline-flex items-center gap-2 px-3 py-1 rounded-full bg-white/10 text-white/90 text-sm font-medium mb-6 backdrop-blur-sm border border-white/10 hover:bg-white/20 transition-colors cursor-default">
<span className="flex h-2 w-2 relative">
<span className="animate-ping absolute inline-flex h-full w-full rounded-full bg-emerald-400 opacity-75"></span>
<span className="relative inline-flex rounded-full h-2 w-2 bg-emerald-400"></span>
</span>
Free Tool No Signup Required
</div>
<h1 className="text-4xl md:text-5xl lg:text-6xl font-extrabold text-white tracking-tight leading-tight mb-6">
The Safest Way to <br className="hidden lg:block" />
<span className="text-transparent bg-clip-text bg-gradient-to-r from-emerald-400 to-cyan-400">Share Your WiFi</span>
</h1>
<p className="text-lg md:text-xl text-indigo-100 max-w-2xl mx-auto lg:mx-0 mb-8 leading-relaxed">
Generate a secure QR code in seconds. No more spelling out complicated passwords.
<strong className="text-white block sm:inline mt-2 sm:mt-0"> 100% Client-Side & Private.</strong>
</p>
<div className="flex flex-wrap justify-center lg:justify-start gap-4 text-sm font-medium text-white/80">
<div className="flex items-center gap-2 bg-white/5 px-4 py-2.5 rounded-xl border border-white/5 backdrop-blur-sm">
<Lock className="w-4 h-4 text-emerald-400" />
No Server Uploads
</div>
<div className="flex items-center gap-2 bg-white/5 px-4 py-2.5 rounded-xl border border-white/5 backdrop-blur-sm">
<Zap className="w-4 h-4 text-amber-400" />
Instant Connect
</div>
<div className="flex items-center gap-2 bg-white/5 px-4 py-2.5 rounded-xl border border-white/5 backdrop-blur-sm">
<Smartphone className="w-4 h-4 text-purple-400" />
iOS & Android
</div>
</div>
</div>
{/* Right: Visual Abstract Composition */}
<div className="hidden lg:flex relative items-center justify-center min-h-[400px]">
{/* Decorative Glow */}
<div className="absolute w-[500px] h-[500px] bg-indigo-500/30 rounded-full blur-[100px] -top-20 -right-20 animate-pulse" />
{/* Floating Glass Card */}
<div className="relative w-80 h-96 bg-white/5 backdrop-blur-xl border border-white/20 rounded-3xl shadow-2xl flex flex-col items-center justify-center p-8 transform rotate-6 hover:rotate-3 transition-all duration-700 group">
<div className="absolute inset-0 bg-gradient-to-br from-white/10 to-transparent rounded-3xl" />
{/* Mock QR */}
<div className="w-48 h-48 bg-white rounded-xl p-2 shadow-inner mb-6 relative overflow-hidden flex items-center justify-center">
<QRCodeSVG value="https://www.qrmaster.net" size={170} fgColor="#0f172a" level="Q" />
{/* Scan Line */}
<div className="absolute top-1/2 left-0 w-full h-1 bg-emerald-500 shadow-[0_0_20px_rgba(16,185,129,1)] animate-pulse" />
</div>
<div className="w-full space-y-3">
<div className="h-2 w-32 bg-white/20 rounded-full mx-auto" />
<div className="h-2 w-20 bg-white/10 rounded-full mx-auto" />
</div>
{/* Floating Badge */}
<div className="absolute -bottom-6 -left-6 bg-white py-3 px-5 rounded-xl shadow-xl flex items-center gap-3 transform transition-transform hover:scale-105 duration-300">
<div className="bg-emerald-100 p-2 rounded-full">
<Wifi className="w-5 h-5 text-emerald-600" />
</div>
<div className="text-left">
<div className="text-[10px] text-slate-400 font-bold uppercase tracking-wider">Status</div>
<div className="text-sm font-bold text-slate-900">Connected</div>
</div>
</div>
</div>
</div>
</div>
</section>
{/* GENERATOR SECTION */}
<section className="py-12 px-4 sm:px-6 lg:px-8 -mt-8">
<WiFiGenerator />
</section>
{/* HOW IT WORKS - AEO/GEO Content */}
<section className="py-16 px-4 sm:px-6 lg:px-8 bg-white">
<div className="max-w-4xl mx-auto">
<h2 className="text-3xl font-bold text-slate-900 text-center mb-12">
How WiFi QR Codes Work
</h2>
<div className="grid md:grid-cols-3 lg:grid-cols-5 gap-8">
<article className="text-center">
<div className="w-12 h-12 rounded-2xl bg-[#1A1265]/10 flex items-center justify-center mx-auto mb-4">
<Wifi className="w-6 h-6 text-[#1A1265]" />
</div>
<h3 className="font-bold text-slate-900 mb-2">1. Network</h3>
<p className="text-slate-600 text-xs leading-relaxed">
Enter your WiFi SSID and password.
</p>
</article>
<article className="text-center">
<div className="w-12 h-12 rounded-2xl bg-[#1A1265]/10 flex items-center justify-center mx-auto mb-4">
<Shield className="w-6 h-6 text-[#1A1265]" />
</div>
<h3 className="font-bold text-slate-900 mb-2">2. Security</h3>
<p className="text-slate-600 text-xs leading-relaxed">
Select WPA/WPA2 encryption.
</p>
</article>
<article className="text-center">
<div className="w-12 h-12 rounded-2xl bg-[#1A1265]/10 flex items-center justify-center mx-auto mb-4">
<Zap className="w-6 h-6 text-[#1A1265]" />
</div>
<h3 className="font-bold text-slate-900 mb-2">3. Style</h3>
<p className="text-slate-600 text-xs leading-relaxed">
Customize colors and add a frame.
</p>
</article>
<article className="text-center">
<div className="w-12 h-12 rounded-2xl bg-[#1A1265]/10 flex items-center justify-center mx-auto mb-4">
<Download className="w-6 h-6 text-[#1A1265]" />
</div>
<h3 className="font-bold text-slate-900 mb-2">4. Download</h3>
<p className="text-slate-600 text-xs leading-relaxed">
Get your high-quality QR image.
</p>
</article>
<article className="text-center">
<div className="w-12 h-12 rounded-2xl bg-[#1A1265]/10 flex items-center justify-center mx-auto mb-4">
<Smartphone className="w-6 h-6 text-[#1A1265]" />
</div>
<h3 className="font-bold text-slate-900 mb-2">5. Connect</h3>
<p className="text-slate-600 text-xs leading-relaxed">
Print it out. Guests scan to join!
</p>
</article>
</div>
</div>
</section>
{/* FAQ SECTION - Featured Snippet Optimized */}
<section className="py-16 px-4 sm:px-6 lg:px-8" style={{ backgroundColor: '#EBEBDF' }}>
<div className="max-w-3xl mx-auto">
<h2 className="text-3xl font-bold text-slate-900 text-center mb-4">
Frequently Asked Questions
</h2>
<p className="text-slate-600 text-center mb-10">
Everything you need to know about WiFi QR codes.
</p>
<div className="space-y-4">
<FaqItem
question="Is it safe to enter my WiFi password here?"
answer="Yes, completely safe. This tool uses client-side processing, meaning your WiFi password never leaves your device. It's processed locally in your browser to generate the QR code—no data is sent to any server."
/>
<FaqItem
question="Do WiFi QR codes work on iPhone and Android?"
answer="Yes. iOS 11 and later, as well as all modern Android devices, can scan WiFi QR codes using the built-in camera app. Simply point the camera at the QR code and tap the notification to connect."
/>
<FaqItem
question="What happens if I change my WiFi password?"
answer="If you change your WiFi password, the old QR code will stop working. You'll need to generate a new QR code with the updated credentials. For frequently changing passwords, consider using dynamic QR codes."
/>
<FaqItem
question="Can I customize the QR code design?"
answer="Yes. You can change the foreground color of the QR code and add frame labels such as 'Scan Me', 'WiFi', or 'Connect' to make your QR code more recognizable and user-friendly."
/>
<FaqItem
question="Does it work for hidden networks?"
answer="Yes, just check the 'Hidden Network' box if your SSID is hidden. The QR code contains the standard WiFi string configuration."
/>
</div>
</div>
</section>
</div>
</>
);
}
// FAQ Item Component
function FaqItem({ question, answer }: { question: string; answer: string }) {
return (
<details className="group bg-white rounded-xl shadow-sm border border-slate-200 overflow-hidden">
<summary className="flex items-center justify-between p-5 cursor-pointer list-none text-slate-900 font-semibold hover:bg-slate-50 transition-colors">
{question}
<span className="transition group-open:rotate-180 text-slate-400">
<svg fill="none" height="20" stroke="currentColor" strokeLinecap="round" strokeLinejoin="round" strokeWidth="2" viewBox="0 0 24 24" width="20">
<path d="M6 9l6 6 6-6" />
</svg>
</span>
</summary>
<div className="text-slate-600 px-5 pb-5 pt-0 leading-relaxed text-sm">
{answer}
</div>
</details>
);
}

View File

@@ -0,0 +1,246 @@
'use client';
import React, { useState, useRef } from 'react';
import Link from 'next/link';
import { QRCodeSVG } from 'qrcode.react';
import {
Youtube,
Download,
Check,
Sparkles,
Play
} from 'lucide-react';
import { Button } from '@/components/ui/Button';
import { Input } from '@/components/ui/Input';
import { cn } from '@/lib/utils';
// Brand Colors
const BRAND = {
paleGrey: '#EBEBDF',
richBlue: '#1A1265',
richBlueLight: '#2A2275',
};
// QR Color Options - YT Theme
const QR_COLORS = [
{ name: 'YouTube Red', value: '#FF0000' },
{ name: 'Classic Black', value: '#000000' },
{ name: 'Dark Blue', value: '#1A1265' },
{ name: 'Teal', value: '#0D9488' },
{ name: 'Grey', value: '#374151' },
{ name: 'Emerald', value: '#10B981' },
{ name: 'Rose', value: '#F43F5E' },
];
// Frame Options
const FRAME_OPTIONS = [
{ id: 'none', label: 'No Frame' },
{ id: 'scanme', label: 'Scan Me' },
{ id: 'watch', label: 'Watch' },
{ id: 'subscribe', label: 'Subscribe' },
];
export default function YoutubeGenerator() {
const [url, setUrl] = useState('');
const [qrColor, setQrColor] = useState('#FF0000');
const [frameType, setFrameType] = useState('none');
const qrRef = useRef<HTMLDivElement>(null);
const handleDownload = async (format: 'png' | 'svg') => {
if (!qrRef.current) return;
try {
if (format === 'png') {
const { toPng } = await import('html-to-image');
const dataUrl = await toPng(qrRef.current, { cacheBust: true, pixelRatio: 3 });
const link = document.createElement('a');
link.download = `youtube-qr-code.png`;
link.href = dataUrl;
link.click();
} else {
const svgData = qrRef.current.querySelector('svg')?.outerHTML;
if (svgData) {
const blob = new Blob([svgData], { type: 'image/svg+xml;charset=utf-8' });
const url = URL.createObjectURL(blob);
const link = document.createElement('a');
link.href = url;
link.download = `youtube-qr-code.svg`;
link.click();
}
}
} catch (err) {
console.error('Download failed', err);
}
};
const getFrameLabel = () => {
const frame = FRAME_OPTIONS.find(f => f.id === frameType);
return frame?.id !== 'none' ? frame?.label : null;
};
return (
<div className="w-full max-w-5xl mx-auto px-4 md:px-6">
{/* Main Generator Card */}
<div className="bg-white rounded-3xl shadow-2xl shadow-slate-900/10 overflow-hidden border border-slate-100">
<div className="grid lg:grid-cols-2">
{/* LEFT: Input Section */}
<div className="p-8 lg:p-10 space-y-8 border-r border-slate-100">
{/* YouTube Details */}
<div className="space-y-6">
<h2 className="text-lg font-bold text-slate-900 flex items-center gap-2">
<Youtube className="w-5 h-5 text-[#FF0000]" />
YouTube Video or Channel
</h2>
<div>
<label className="block text-sm font-medium text-slate-700 mb-2">Video/Channel URL</label>
<Input
placeholder="https://youtube.com/watch?v=..."
value={url}
onChange={(e) => setUrl(e.target.value)}
className="h-12 text-base rounded-xl border-slate-200 focus:border-[#FF0000] focus:ring-[#FF0000]"
/>
<p className="text-xs text-slate-500 mt-2">Paste a link to any video, channel, or playlist.</p>
</div>
</div>
<div className="border-t border-slate-100"></div>
{/* Design Options */}
<div className="space-y-6">
<h2 className="text-lg font-bold text-slate-900 flex items-center gap-2">
<Sparkles className="w-5 h-5 text-[#FF0000]" />
Design Options
</h2>
{/* Color Picker */}
<div>
<label className="block text-sm font-medium text-slate-700 mb-3">QR Code Color</label>
<div className="flex flex-wrap gap-2">
{QR_COLORS.map((c) => (
<button
key={c.name}
onClick={() => setQrColor(c.value)}
className={cn(
"w-9 h-9 rounded-full border-2 flex items-center justify-center transition-all hover:scale-110",
qrColor === c.value ? "border-slate-900 ring-2 ring-offset-2 ring-slate-200" : "border-white shadow-md"
)}
style={{ backgroundColor: c.value }}
aria-label={`Select ${c.name}`}
title={c.name}
>
{qrColor === c.value && <Check className="w-4 h-4 text-white" strokeWidth={3} />}
</button>
))}
</div>
</div>
{/* Frame Selector */}
<div>
<label className="block text-sm font-medium text-slate-700 mb-3">Frame Label</label>
<div className="grid grid-cols-4 gap-2">
{FRAME_OPTIONS.map((frame) => (
<button
key={frame.id}
onClick={() => setFrameType(frame.id)}
className={cn(
"py-2.5 px-3 rounded-lg text-sm font-medium transition-all border",
frameType === frame.id
? "bg-[#FF0000] text-white border-[#FF0000]"
: "bg-slate-50 text-slate-600 border-slate-200 hover:border-slate-300"
)}
>
{frame.label}
</button>
))}
</div>
</div>
</div>
</div>
{/* RIGHT: Preview Section */}
<div className="p-8 lg:p-10 flex flex-col items-center justify-center" style={{ backgroundColor: BRAND.paleGrey }}>
{/* QR Card with Frame */}
<div
ref={qrRef}
className="bg-white rounded-3xl shadow-xl p-8 flex flex-col items-center"
style={{ minWidth: '320px' }}
>
{/* Frame Label */}
{getFrameLabel() && (
<div
className="mb-5 px-8 py-2.5 rounded-full text-white font-bold text-sm tracking-widest uppercase shadow-md"
style={{ backgroundColor: qrColor }}
>
{getFrameLabel()}
</div>
)}
{/* QR Code */}
<div className="bg-white">
<QRCodeSVG
value={url || "https://youtube.com"}
size={240}
level="M"
includeMargin={false}
fgColor={qrColor}
/>
</div>
{/* Info Preview */}
<div className="mt-6 text-center max-w-[260px]">
<h3 className="font-bold text-slate-900 text-lg flex items-center justify-center gap-2 truncate">
<Youtube className="w-4 h-4 text-slate-400 shrink-0" />
<span className="truncate">{url ? 'YouTube Content' : 'youtube.com'}</span>
</h3>
<div className="text-xs text-slate-500 mt-1">Opens in YouTube App</div>
</div>
</div>
{/* Download Buttons */}
<div className="flex items-center gap-3 mt-8">
<Button
onClick={() => handleDownload('png')}
className="bg-[#FF0000] hover:bg-[#cc0000] text-white shadow-lg"
>
<Download className="w-4 h-4 mr-2" />
Download PNG
</Button>
<Button
onClick={() => handleDownload('svg')}
variant="outline"
className="border-slate-300 hover:bg-white"
>
<Download className="w-4 h-4 mr-2" />
SVG
</Button>
</div>
<p className="text-xs text-slate-500 mt-4 text-center">
Scanning redirects directly to the video or channel.
</p>
</div>
</div>
</div>
{/* Upsell Banner */}
<div className="mt-8 bg-gradient-to-r from-[#FF0000] to-[#cc0000] rounded-2xl p-6 flex flex-col sm:flex-row items-center justify-between gap-4">
<div className="text-white text-center sm:text-left">
<h3 className="font-bold text-lg">Promoting a Video Channel?</h3>
<p className="text-white/80 text-sm mt-1">
Dynamic QR Codes give you stats on scans, locations, and time of day.
</p>
</div>
<Link href="/signup">
<Button className="bg-white text-[#FF0000] hover:bg-slate-100 shrink-0 shadow-lg">
Get Video Stats
</Button>
</Link>
</div>
</div>
);
}

View File

@@ -0,0 +1,358 @@
import React from 'react';
import type { Metadata } from 'next';
import YoutubeGenerator from './YouTubeGenerator';
import { Youtube, Shield, Zap, Smartphone, Play, Radio, Download, Share2 } from 'lucide-react';
import { QRCodeSVG } from 'qrcode.react';
import { ToolBreadcrumb } from '@/components/seo/BreadcrumbSchema';
// SEO Optimized Metadata
export const metadata: Metadata = {
title: 'Free YouTube QR Code Generator | Get Views & Subscribers | QR Master',
description: 'Create a QR code for your YouTube video or channel. Scanners are redirected to the YouTube app instantly to watch. Free & Fast.',
keywords: ['youtube qr code', 'video qr code', 'youtube channel qr', 'youtube subscribe qr', 'social media qr code'],
alternates: {
canonical: 'https://qrmaster.io/tools/youtube-qr-code',
},
openGraph: {
title: 'Free YouTube QR Code Generator | QR Master',
description: 'Generate QR codes to grow your YouTube channel. Instant video play.',
type: 'website',
url: 'https://qrmaster.io/tools/youtube-qr-code',
images: [{ url: '/og-youtube-generator.png', width: 1200, height: 630 }],
},
twitter: {
card: 'summary_large_image',
title: 'Free YouTube QR Code Generator',
description: 'Create QR codes for YouTube videos. Get more views.',
},
robots: {
index: true,
follow: true,
},
};
// JSON-LD Structured Data
const jsonLd = {
'@context': 'https://schema.org',
'@graph': [
{
'@type': 'SoftwareApplication',
name: 'YouTube QR Code Generator',
applicationCategory: 'UtilitiesApplication',
operatingSystem: 'Web Browser',
offers: {
'@type': 'Offer',
price: '0',
priceCurrency: 'USD',
},
aggregateRating: {
'@type': 'AggregateRating',
ratingValue: '4.8',
ratingCount: '1340',
},
description: 'Generate QR codes that direct users to a YouTube video or channel.',
},
{
'@type': 'HowTo',
name: 'How to Create a YouTube QR Code',
description: 'Create a QR code that opens a YouTube video.',
step: [
{
'@type': 'HowToStep',
position: 1,
name: 'Copy URL',
text: 'Copy the link of your YouTube video or channel.',
},
{
'@type': 'HowToStep',
position: 2,
name: 'Paste',
text: 'Paste the link into the generator input.',
},
{
'@type': 'HowToStep',
position: 3,
name: 'Customize',
text: 'Add a "Watch Now" frame or change the color to YouTube Red.',
},
{
'@type': 'HowToStep',
position: 4,
name: 'Download',
text: 'Save your QR code image for printing.',
},
{
'@type': 'HowToStep',
position: 5,
name: 'Share',
text: 'Place it on posters, merch, or video end screens.',
},
],
totalTime: 'PT30S',
},
{
'@type': 'FAQPage',
mainEntity: [
{
'@type': 'Question',
name: 'Does it open the YouTube app?',
acceptedAnswer: {
'@type': 'Answer',
text: 'Yes! If the user has the YouTube app installed, the QR code will automatically launch the app and play the video.',
},
},
{
'@type': 'Question',
name: 'Can I link to a specific timestamp?',
acceptedAnswer: {
'@type': 'Answer',
text: 'Yes. If you include the timestamp in your YouTube link (e.g., ?t=60s), the video will start playing from that exact moment.',
},
},
{
'@type': 'Question',
name: 'Can I use this for a playlist?',
acceptedAnswer: {
'@type': 'Answer',
text: 'Absolutely. Just paste the playlist URL, and users will be taken to the full list of videos.',
},
},
{
'@type': 'Question',
name: 'Is it free?',
acceptedAnswer: {
'@type': 'Answer',
text: 'Yes, this tool is 100% free forever.',
},
},
{
'@type': 'Question',
name: 'Does it work for YouTube Shorts?',
acceptedAnswer: {
'@type': 'Answer',
text: 'Yes, just paste the "Share" link from any YouTube Short.',
},
},
],
},
],
};
export default function YoutubeQRCodePage() {
return (
<>
<script
type="application/ld+json"
dangerouslySetInnerHTML={{ __html: JSON.stringify(jsonLd) }}
/>
<ToolBreadcrumb toolName="YouTube QR Code Generator" toolSlug="youtube-qr-code" />
<div className="min-h-screen" style={{ backgroundColor: '#EBEBDF' }}>
{/* HERO SECTION */}
<section className="relative pt-20 pb-20 lg:pt-32 lg:pb-32 px-4 sm:px-6 lg:px-8 overflow-hidden bg-[#FF0000]">
<div className="absolute inset-0 opacity-10">
{/* Play Button Pattern */}
<svg className="w-full h-full" width="100%" height="100%" xmlns="http://www.w3.org/2000/svg">
<defs>
<pattern id="yt_pattern" width="60" height="60" patternUnits="userSpaceOnUse">
<path d="M20 20 L40 30 L20 40 Z" fill="white" />
</pattern>
</defs>
<rect width="100%" height="100%" fill="url(#yt_pattern)" />
</svg>
</div>
<div className="max-w-7xl mx-auto grid lg:grid-cols-2 gap-12 items-center relative z-10">
<div className="text-center lg:text-left">
<div className="inline-flex items-center gap-2 px-3 py-1 rounded-full bg-white/10 text-white/90 text-sm font-medium mb-6 backdrop-blur-sm border border-white/10 hover:bg-white/20 transition-colors cursor-default">
<span className="flex h-2 w-2 relative">
<span className="animate-ping absolute inline-flex h-full w-full rounded-full bg-red-300 opacity-75"></span>
<span className="relative inline-flex rounded-full h-2 w-2 bg-red-300"></span>
</span>
Free Tool No Signup Required
</div>
<h1 className="text-4xl md:text-5xl lg:text-6xl font-extrabold text-white tracking-tight leading-tight mb-6">
Get More Views with <br className="hidden lg:block" />
<span className="text-white drop-shadow-md">YouTube QR Codes</span>
</h1>
<p className="text-lg md:text-xl text-red-50 max-w-2xl mx-auto lg:mx-0 mb-8 leading-relaxed">
From print to play in one scan. Direct your audience to your latest video, channel, or playlist instantly.
<strong className="text-white block sm:inline mt-2 sm:mt-0"> Boost subscriber growth.</strong>
</p>
<div className="flex flex-wrap justify-center lg:justify-start gap-4 text-sm font-medium text-white/80">
<div className="flex items-center gap-2 bg-white/10 px-4 py-2.5 rounded-xl border border-white/10 backdrop-blur-sm">
<Play className="w-4 h-4 text-white" />
Instant Play
</div>
<div className="flex items-center gap-2 bg-white/10 px-4 py-2.5 rounded-xl border border-white/10 backdrop-blur-sm">
<Radio className="w-4 h-4 text-white" />
Grow Channel
</div>
<div className="flex items-center gap-2 bg-white/10 px-4 py-2.5 rounded-xl border border-white/10 backdrop-blur-sm">
<Smartphone className="w-4 h-4 text-white" />
App Friendly
</div>
</div>
</div>
{/* Visual Abstract */}
<div className="hidden lg:flex relative items-center justify-center min-h-[400px]">
<div className="absolute w-[500px] h-[500px] bg-red-600/30 rounded-full blur-[100px] -top-20 -right-20 animate-pulse" />
<div className="relative w-80 h-96 bg-white/5 backdrop-blur-xl border border-white/20 rounded-3xl shadow-2xl flex flex-col items-center justify-center p-8 transform rotate-3 hover:rotate-0 transition-all duration-700 group">
<div className="absolute inset-0 bg-gradient-to-br from-white/10 to-transparent rounded-3xl" />
<div className="w-full bg-black rounded-xl shadow-lg h-40 mb-6 relative overflow-hidden group-hover:scale-105 transition-transform flex items-center justify-center">
<div className="absolute inset-0 bg-[url('https://images.unsplash.com/photo-1611162617474-5b21e879e113?q=80&w=1000&auto=format&fit=crop')] bg-cover bg-center opacity-70"></div>
<div className="w-12 h-12 bg-red-600 rounded-full flex items-center justify-center relative z-10 shadow-xl">
<Play className="w-6 h-6 text-white ml-1" fill="white" />
</div>
<div className="absolute bottom-2 right-2 bg-black/80 px-2 rounded text-xs text-white font-bold">10:24</div>
</div>
<div className="w-44 h-44 bg-white rounded-xl p-2 shadow-inner relative overflow-hidden flex items-center justify-center">
<QRCodeSVG value="https://www.qrmaster.net" size={160} fgColor="#FF0000" level="Q" />
</div>
{/* Floating Badge */}
<div className="absolute -bottom-6 -left-6 bg-white py-3 px-5 rounded-xl shadow-xl flex items-center gap-3 transform transition-transform hover:scale-105 duration-300">
<div className="bg-red-100 p-2 rounded-full">
<Youtube className="w-5 h-5 text-red-600" />
</div>
<div className="text-left">
<div className="text-[10px] text-slate-400 font-bold uppercase tracking-wider">Subscribers</div>
<div className="text-sm font-bold text-slate-900">+10 New</div>
</div>
</div>
</div>
</div>
</div>
</section>
{/* GENERATOR SECTION */}
<section className="py-12 px-4 sm:px-6 lg:px-8 -mt-8">
<YoutubeGenerator />
</section>
{/* HOW IT WORKS */}
<section className="py-16 px-4 sm:px-6 lg:px-8 bg-white">
<div className="max-w-4xl mx-auto">
<h2 className="text-3xl font-bold text-slate-900 text-center mb-12">
How YouTube QR Codes Work
</h2>
<div className="grid md:grid-cols-3 lg:grid-cols-5 gap-8">
<article className="text-center">
<div className="w-14 h-14 rounded-2xl bg-[#FF0000]/10 flex items-center justify-center mx-auto mb-4">
<Youtube className="w-7 h-7 text-[#FF0000]" />
</div>
<h3 className="font-bold text-slate-900 mb-2">1. Paste Link</h3>
<p className="text-slate-600 text-sm">
Copy the URL of your video, channel, or playlist.
</p>
</article>
<article className="text-center">
<div className="w-14 h-14 rounded-2xl bg-[#FF0000]/10 flex items-center justify-center mx-auto mb-4">
<Smartphone className="w-7 h-7 text-[#FF0000]" />
</div>
<h3 className="font-bold text-slate-900 mb-2">2. Print Code</h3>
<p className="text-slate-600 text-sm">
Place the QR code on flyers, posters, or merchandise.
</p>
</article>
<article className="text-center">
<div className="w-12 h-12 rounded-2xl bg-[#FF0000]/10 flex items-center justify-center mx-auto mb-4">
<Download className="w-6 h-6 text-[#FF0000]" />
</div>
<h3 className="font-bold text-slate-900 mb-2">3. Download</h3>
<p className="text-slate-600 text-xs leading-relaxed">
Save your high-quality QR code.
</p>
</article>
<article className="text-center">
<div className="w-12 h-12 rounded-2xl bg-[#FF0000]/10 flex items-center justify-center mx-auto mb-4">
<Play className="w-6 h-6 text-[#FF0000]" />
</div>
<h3 className="font-bold text-slate-900 mb-2">4. Scan</h3>
<p className="text-slate-600 text-xs leading-relaxed">
Customers scan the code.
</p>
</article>
<article className="text-center">
<div className="w-12 h-12 rounded-2xl bg-[#FF0000]/10 flex items-center justify-center mx-auto mb-4">
<Share2 className="w-6 h-6 text-[#FF0000]" />
</div>
<h3 className="font-bold text-slate-900 mb-2">5. Watch</h3>
<p className="text-slate-600 text-xs leading-relaxed">
The video plays instantly.
</p>
</article>
</div>
</div>
</section>
{/* FAQ SECTION */}
<section className="py-16 px-4 sm:px-6 lg:px-8" style={{ backgroundColor: '#EBEBDF' }}>
<div className="max-w-3xl mx-auto">
<h2 className="text-3xl font-bold text-slate-900 text-center mb-4">
Frequently Asked Questions
</h2>
<p className="text-slate-600 text-center mb-10">
Common questions about YouTube QR codes.
</p>
<div className="space-y-4">
<FaqItem
question="Can I link to my Live Stream?"
answer="Yes! Paste your channel's live link (e.g., youtube.com/c/YourChannel/live) and it will always go to your current live stream."
/>
<FaqItem
question="Does the video auto-play?"
answer="Most smartphones will open the YouTube app and auto-play the video, but it depends on the user's specific settings."
/>
<FaqItem
question="Can I change the video later?"
answer="Only if you use our Dynamic QR Code service. This static code will always point to the original link you entered."
/>
<FaqItem
question="Is it safe?"
answer="Yes. The QR code simply contains your video link. No personal data is stored or tracked by this free tool."
/>
<FaqItem
question="Does it work for YouTube Shorts?"
answer="Yes, just paste the 'Share' link from any YouTube Short."
/>
</div>
</div>
</section>
</div>
</>
);
}
function FaqItem({ question, answer }: { question: string; answer: string }) {
return (
<details className="group bg-white rounded-xl shadow-sm border border-slate-200 overflow-hidden">
<summary className="flex items-center justify-between p-5 cursor-pointer list-none text-slate-900 font-semibold hover:bg-slate-50 transition-colors">
{question}
<span className="transition group-open:rotate-180 text-slate-400">
<svg fill="none" height="20" stroke="currentColor" strokeLinecap="round" strokeLinejoin="round" strokeWidth="2" viewBox="0 0 24 24" width="20">
<path d="M6 9l6 6 6-6" />
</svg>
</span>
</summary>
<div className="text-slate-600 px-5 pb-5 pt-0 leading-relaxed text-sm">
{answer}
</div>
</details>
);
}

View File

@@ -0,0 +1,303 @@
'use client';
import React, { useState, useRef } from 'react';
import Link from 'next/link';
import { QRCodeSVG } from 'qrcode.react';
import {
Video,
Download,
Check,
Sparkles,
Users
} from 'lucide-react';
import { Button } from '@/components/ui/Button';
import { Input } from '@/components/ui/Input';
import { cn } from '@/lib/utils';
// Brand Colors - Zoom Blue
const BRAND = {
paleGrey: '#EFF6FF',
primary: '#2D8CFF',
primaryDark: '#0B5CDB',
};
// QR Color Options
const QR_COLORS = [
{ name: 'Zoom Blue', value: '#2D8CFF' },
{ name: 'Dark Blue', value: '#0B5CDB' },
{ name: 'Classic Black', value: '#000000' },
{ name: 'Indigo', value: '#4F46E5' },
{ name: 'Violet', value: '#7C3AED' },
{ name: 'Emerald', value: '#10B981' },
{ name: 'Rose', value: '#F43F5E' },
];
// Frame Options
const FRAME_OPTIONS = [
{ id: 'none', label: 'No Frame' },
{ id: 'scanme', label: 'Scan Me' },
{ id: 'join', label: 'Join Meeting' },
{ id: 'zoom', label: 'Zoom' },
];
export default function ZoomGenerator() {
const [meetingId, setMeetingId] = useState('');
const [passcode, setPasscode] = useState('');
const [useDirectLink, setUseDirectLink] = useState(false); // Default to web URL for compatibility
const [qrColor, setQrColor] = useState(BRAND.primary);
const [frameType, setFrameType] = useState('none');
const qrRef = useRef<HTMLDivElement>(null);
// Format meeting ID for display (xxx xxxx xxxx)
const formatMeetingId = (id: string) => {
const cleaned = id.replace(/\D/g, '');
if (cleaned.length <= 3) return cleaned;
if (cleaned.length <= 7) return `${cleaned.slice(0, 3)} ${cleaned.slice(3)}`;
return `${cleaned.slice(0, 3)} ${cleaned.slice(3, 7)} ${cleaned.slice(7, 11)}`;
};
// Generate Zoom link
const generateZoomLink = () => {
const cleanId = meetingId.replace(/\D/g, '');
if (!cleanId) return 'https://zoom.us/j/1234567890';
if (useDirectLink) {
// zoommtg protocol for direct app open
let link = `zoommtg://zoom.us/join?confno=${cleanId}`;
if (passcode) {
link += `&pwd=${passcode}`;
}
return link;
} else {
// Regular web link
let link = `https://zoom.us/j/${cleanId}`;
if (passcode) {
link += `?pwd=${passcode}`;
}
return link;
}
};
const handleDownload = async (format: 'png' | 'svg') => {
if (!qrRef.current) return;
try {
if (format === 'png') {
const { toPng } = await import('html-to-image');
const dataUrl = await toPng(qrRef.current, { cacheBust: true, pixelRatio: 3 });
const link = document.createElement('a');
link.download = `zoom-qr-${meetingId.replace(/\D/g, '') || 'meeting'}.png`;
link.href = dataUrl;
link.click();
} else {
const svgData = qrRef.current.querySelector('svg')?.outerHTML;
if (svgData) {
const blob = new Blob([svgData], { type: 'image/svg+xml;charset=utf-8' });
const url = URL.createObjectURL(blob);
const link = document.createElement('a');
link.href = url;
link.download = `zoom-qr-${meetingId.replace(/\D/g, '') || 'meeting'}.svg`;
link.click();
}
}
} catch (err) {
console.error('Download failed', err);
}
};
const getFrameLabel = () => {
const frame = FRAME_OPTIONS.find(f => f.id === frameType);
return frame?.id !== 'none' ? frame?.label : null;
};
return (
<div className="w-full max-w-5xl mx-auto px-4 md:px-6">
{/* Main Generator Card */}
<div className="bg-white rounded-3xl shadow-2xl shadow-slate-900/10 overflow-hidden border border-slate-100">
<div className="grid lg:grid-cols-2">
{/* LEFT: Input Section */}
<div className="p-8 lg:p-10 space-y-8 border-r border-slate-100">
{/* Meeting Details */}
<div className="space-y-6">
<h2 className="text-lg font-bold text-slate-900 flex items-center gap-2">
<Video className="w-5 h-5 text-[#2D8CFF]" />
Meeting Details
</h2>
<div className="space-y-4">
<div>
<label className="block text-sm font-medium text-slate-700 mb-2">Meeting ID</label>
<Input
placeholder="123 4567 8901"
value={formatMeetingId(meetingId)}
onChange={(e) => setMeetingId(e.target.value.replace(/\D/g, ''))}
className="h-12 text-base rounded-xl border-slate-200 focus:border-[#2D8CFF] focus:ring-[#2D8CFF]"
/>
<p className="text-xs text-slate-500 mt-2">The 10-11 digit meeting ID from your Zoom invite.</p>
</div>
<div>
<label className="block text-sm font-medium text-slate-700 mb-2">Passcode (Optional)</label>
<Input
placeholder="abc123"
value={passcode}
onChange={(e) => setPasscode(e.target.value)}
className="h-12 text-base rounded-xl border-slate-200 focus:border-[#2D8CFF] focus:ring-[#2D8CFF]"
/>
</div>
<div className="flex items-center gap-3">
<label className="flex items-center gap-3 cursor-pointer group">
<div className={cn(
"w-5 h-5 rounded border-2 flex items-center justify-center transition-all",
useDirectLink ? "bg-[#2D8CFF] border-[#2D8CFF]" : "border-slate-300 group-hover:border-slate-400"
)}>
{useDirectLink && <Check className="w-3.5 h-3.5 text-white" strokeWidth={3} />}
</div>
<input type="checkbox" checked={useDirectLink} onChange={(e) => setUseDirectLink(e.target.checked)} className="sr-only" />
<span className="text-sm font-medium text-slate-700">Open Zoom app directly</span>
</label>
</div>
</div>
</div>
<div className="border-t border-slate-100"></div>
{/* Design Options */}
<div className="space-y-6">
<h2 className="text-lg font-bold text-slate-900 flex items-center gap-2">
<Sparkles className="w-5 h-5 text-[#2D8CFF]" />
Design Options
</h2>
{/* Color Picker */}
<div>
<label className="block text-sm font-medium text-slate-700 mb-3">QR Code Color</label>
<div className="flex flex-wrap gap-2">
{QR_COLORS.map((c) => (
<button
key={c.name}
onClick={() => setQrColor(c.value)}
className={cn(
"w-9 h-9 rounded-full border-2 flex items-center justify-center transition-all hover:scale-110",
qrColor === c.value ? "border-slate-900 ring-2 ring-offset-2 ring-slate-200" : "border-white shadow-md"
)}
style={{ backgroundColor: c.value }}
aria-label={`Select ${c.name}`}
title={c.name}
>
{qrColor === c.value && <Check className="w-4 h-4 text-white" strokeWidth={3} />}
</button>
))}
</div>
</div>
{/* Frame Selector */}
<div>
<label className="block text-sm font-medium text-slate-700 mb-3">Frame Label</label>
<div className="grid grid-cols-4 gap-2">
{FRAME_OPTIONS.map((frame) => (
<button
key={frame.id}
onClick={() => setFrameType(frame.id)}
className={cn(
"py-2.5 px-2 rounded-lg text-xs font-medium transition-all border",
frameType === frame.id
? "bg-[#2D8CFF] text-white border-[#2D8CFF]"
: "bg-slate-50 text-slate-600 border-slate-200 hover:border-slate-300"
)}
>
{frame.label}
</button>
))}
</div>
</div>
</div>
</div>
{/* RIGHT: Preview Section */}
<div className="p-8 lg:p-10 flex flex-col items-center justify-center" style={{ backgroundColor: BRAND.paleGrey }}>
{/* QR Card with Frame */}
<div
ref={qrRef}
className="bg-white rounded-3xl shadow-xl p-8 flex flex-col items-center"
style={{ minWidth: '320px' }}
>
{/* Frame Label */}
{getFrameLabel() && (
<div
className="mb-5 px-8 py-2.5 rounded-full text-white font-bold text-sm tracking-widest uppercase shadow-md"
style={{ backgroundColor: qrColor }}
>
{getFrameLabel()}
</div>
)}
{/* QR Code */}
<div className="bg-white">
<QRCodeSVG
value={generateZoomLink()}
size={240}
level="M"
includeMargin={false}
fgColor={qrColor}
/>
</div>
{/* Meeting Info */}
<div className="mt-6 text-center max-w-[260px]">
<h3 className="font-bold text-slate-900 text-lg flex items-center justify-center gap-2">
<Video className="w-4 h-4 text-[#2D8CFF] shrink-0" />
<span className="truncate">{formatMeetingId(meetingId) || 'Meeting ID'}</span>
</h3>
{passcode && (
<p className="text-sm text-slate-500 mt-1">Passcode: {passcode}</p>
)}
</div>
</div>
{/* Download Buttons */}
<div className="flex items-center gap-3 mt-8">
<Button
onClick={() => handleDownload('png')}
className="bg-[#2D8CFF] hover:bg-[#0B5CDB] text-white shadow-lg"
>
<Download className="w-4 h-4 mr-2" />
Download PNG
</Button>
<Button
onClick={() => handleDownload('svg')}
variant="outline"
className="border-slate-300 hover:bg-white"
>
<Download className="w-4 h-4 mr-2" />
SVG
</Button>
</div>
<p className="text-xs text-slate-500 mt-4 text-center">
Your meeting ID is encoded directly. Static and forever free.
</p>
</div>
</div>
</div>
{/* Upsell Banner */}
<div className="mt-8 bg-gradient-to-r from-[#2D8CFF] to-[#0B5CDB] rounded-2xl p-6 flex flex-col sm:flex-row items-center justify-between gap-4">
<div className="text-white text-center sm:text-left">
<h3 className="font-bold text-lg">Need to update meeting details?</h3>
<p className="text-white/80 text-sm mt-1">Dynamic QR Codes let you change the meeting link without reprinting.</p>
</div>
<Link href="/signup">
<Button className="bg-white text-[#2D8CFF] hover:bg-slate-100 shrink-0 shadow-lg">
Create Dynamic QR
</Button>
</Link>
</div>
</div>
);
}

View File

@@ -0,0 +1,331 @@
import React from 'react';
import type { Metadata } from 'next';
import ZoomGenerator from './ZoomGenerator';
import { Video, Shield, Zap, Smartphone, Users, Download, Share2 } from 'lucide-react';
import { QRCodeSVG } from 'qrcode.react';
import { ToolBreadcrumb } from '@/components/seo/BreadcrumbSchema';
// SEO Optimized Metadata
export const metadata: Metadata = {
title: 'Free Zoom QR Code Generator | Join Meetings Instantly | QR Master',
description: 'Create a QR code for your Zoom meeting. Attendees scan to join instantly. Includes meeting ID and passcode. Perfect for conference rooms and flyers.',
keywords: ['zoom qr code', 'zoom meeting qr', 'join zoom qr code', 'meeting room qr', 'zoom invitation qr', 'conference qr code'],
alternates: {
canonical: 'https://qrmaster.io/tools/zoom-qr-code',
},
openGraph: {
title: 'Free Zoom QR Code Generator | QR Master',
description: 'Generate QR codes for Zoom meetings. One scan to join instantly.',
type: 'website',
url: 'https://qrmaster.io/tools/zoom-qr-code',
images: [{ url: '/og-zoom-generator.png', width: 1200, height: 630 }],
},
twitter: {
card: 'summary_large_image',
title: 'Free Zoom QR Code Generator',
description: 'Create Zoom meeting QR codes. Instant and free.',
},
robots: {
index: true,
follow: true,
},
};
// JSON-LD Structured Data
const jsonLd = {
'@context': 'https://schema.org',
'@graph': [
{
'@type': 'SoftwareApplication',
name: 'Zoom QR Code Generator',
applicationCategory: 'BusinessApplication',
operatingSystem: 'Web Browser',
offers: {
'@type': 'Offer',
price: '0',
priceCurrency: 'USD',
},
aggregateRating: {
'@type': 'AggregateRating',
ratingValue: '4.8',
ratingCount: '720',
},
description: 'Generate QR codes that let people join your Zoom meeting with one scan.',
},
{
'@type': 'HowTo',
name: 'How to Create a Zoom QR Code',
description: 'Create a QR code for joining Zoom meetings.',
step: [
{
'@type': 'HowToStep',
position: 1,
name: 'Enter Meeting ID',
text: 'Copy the 10-11 digit meeting ID from your Zoom invitation.',
},
{
'@type': 'HowToStep',
position: 2,
name: 'Add Passcode',
text: 'If your meeting has a passcode, enter it to include in the QR.',
},
{
'@type': 'HowToStep',
position: 3,
name: 'Choose Link Type',
text: 'Select whether to open Zoom app directly or use a web link.',
},
{
'@type': 'HowToStep',
position: 4,
name: 'Download',
text: 'Download your QR code and display it in your meeting room or invitation.',
},
],
totalTime: 'PT30S',
},
{
'@type': 'FAQPage',
mainEntity: [
{
'@type': 'Question',
name: 'What happens when someone scans the QR code?',
acceptedAnswer: {
'@type': 'Answer',
text: 'The Zoom app opens directly with your meeting ID and passcode pre-filled. They just tap "Join" to enter the meeting.',
},
},
{
'@type': 'Question',
name: 'Does it work for recurring meetings?',
acceptedAnswer: {
'@type': 'Answer',
text: 'Yes! If your recurring meeting uses a fixed Personal Meeting ID (PMI), the QR code will work for all sessions.',
},
},
{
'@type': 'Question',
name: 'What if the meeting ID changes?',
acceptedAnswer: {
'@type': 'Answer',
text: 'Static QR codes cannot be updated. You\'ll need to generate a new code. For changeable meetings, consider our Dynamic QR Codes.',
},
},
{
'@type': 'Question',
name: 'Does it work on all devices?',
acceptedAnswer: {
'@type': 'Answer',
text: 'Yes. The QR code works on iOS, Android, and can also open Zoom on desktop computers if the Zoom app is installed.',
},
},
],
},
],
};
export default function ZoomQRCodePage() {
return (
<>
<script
type="application/ld+json"
dangerouslySetInnerHTML={{ __html: JSON.stringify(jsonLd) }}
/>
<ToolBreadcrumb toolName="Zoom QR Code Generator" toolSlug="zoom-qr-code" />
<div className="min-h-screen" style={{ backgroundColor: '#EBEBDF' }}>
{/* HERO SECTION */}
<section className="relative pt-20 pb-20 lg:pt-32 lg:pb-32 px-4 sm:px-6 lg:px-8 overflow-hidden" style={{ backgroundColor: '#2D8CFF' }}>
<div className="absolute inset-0 opacity-10">
<svg className="w-full h-full" viewBox="0 0 100 100" preserveAspectRatio="none">
<path d="M0 100 C 20 0 50 0 100 100 Z" fill="url(#grad1)" />
<defs>
<linearGradient id="grad1" x1="0%" y1="0%" x2="100%" y2="0%">
<stop offset="0%" style={{ stopColor: 'white', stopOpacity: 1 }} />
<stop offset="100%" style={{ stopColor: 'white', stopOpacity: 0 }} />
</linearGradient>
</defs>
</svg>
</div>
<div className="max-w-7xl mx-auto grid lg:grid-cols-2 gap-12 items-center relative z-10">
<div className="text-center lg:text-left">
<div className="inline-flex items-center gap-2 px-3 py-1 rounded-full bg-white/10 text-white/90 text-sm font-medium mb-6 backdrop-blur-sm border border-white/10 hover:bg-white/20 transition-colors cursor-default">
<span className="flex h-2 w-2 relative">
<span className="animate-ping absolute inline-flex h-full w-full rounded-full bg-white opacity-75"></span>
<span className="relative inline-flex rounded-full h-2 w-2 bg-white"></span>
</span>
Free Tool No Signup Required
</div>
<h1 className="text-4xl md:text-5xl lg:text-6xl font-extrabold text-white tracking-tight leading-tight mb-6">
Join Meetings with <br className="hidden lg:block" />
<span className="text-transparent bg-clip-text bg-gradient-to-r from-blue-200 to-cyan-100">Zoom QR Codes</span>
</h1>
<p className="text-lg md:text-xl text-blue-100 max-w-2xl mx-auto lg:mx-0 mb-8 leading-relaxed">
Create QR codes for your Zoom meetings. Attendees scan to join instantly.
<strong className="text-white block sm:inline mt-2 sm:mt-0"> Perfect for conference rooms.</strong>
</p>
<div className="flex flex-wrap justify-center lg:justify-start gap-4 text-sm font-medium text-white/80">
<div className="flex items-center gap-2 bg-white/5 px-4 py-2.5 rounded-xl border border-white/5 backdrop-blur-sm">
<Video className="w-4 h-4 text-white" />
Direct Join
</div>
<div className="flex items-center gap-2 bg-white/5 px-4 py-2.5 rounded-xl border border-white/5 backdrop-blur-sm">
<Zap className="w-4 h-4 text-amber-300" />
Instant Open
</div>
<div className="flex items-center gap-2 bg-white/5 px-4 py-2.5 rounded-xl border border-white/5 backdrop-blur-sm">
<Users className="w-4 h-4 text-emerald-300" />
Any Device
</div>
</div>
</div>
{/* Visual Abstract */}
<div className="hidden lg:flex relative items-center justify-center min-h-[400px]">
<div className="absolute w-[500px] h-[500px] bg-blue-400/30 rounded-full blur-[100px] -top-20 -right-20 animate-pulse" />
<div className="relative w-80 h-96 bg-white/5 backdrop-blur-xl border border-white/20 rounded-3xl shadow-2xl flex flex-col items-center justify-center p-8 transform -rotate-3 hover:rotate-0 transition-all duration-700 group">
<div className="absolute inset-0 bg-gradient-to-br from-white/10 to-transparent rounded-3xl" />
{/* Meeting Card Mock */}
<div className="w-full bg-white rounded-xl shadow-lg p-4 mb-6 relative overflow-hidden">
<div className="flex items-center gap-3 mb-3">
<div className="w-10 h-10 bg-[#2D8CFF] rounded-full flex items-center justify-center">
<Video className="w-5 h-5 text-white" />
</div>
<div>
<div className="font-bold text-slate-900 text-sm">Team Standup</div>
<div className="text-xs text-slate-500">ID: 123 456 7890</div>
</div>
</div>
<div className="flex gap-2">
<div className="bg-green-100 text-green-700 text-xs px-2 py-1 rounded-full">Live</div>
<div className="bg-slate-100 text-slate-600 text-xs px-2 py-1 rounded-full">12 attending</div>
</div>
</div>
<div className="w-48 h-48 bg-white rounded-xl p-2 shadow-inner relative overflow-hidden flex items-center justify-center">
<QRCodeSVG value="https://www.qrmaster.net" size={170} fgColor="#2D8CFF" level="Q" />
</div>
{/* Floating Badge */}
<div className="absolute -bottom-6 -right-6 bg-white py-3 px-5 rounded-xl shadow-xl flex items-center gap-3 transform transition-transform hover:scale-105 duration-300">
<div className="bg-blue-100 p-2 rounded-full">
<Users className="w-5 h-5 text-[#2D8CFF]" />
</div>
<div className="text-left">
<div className="text-[10px] text-slate-400 font-bold uppercase tracking-wider">Status</div>
<div className="text-sm font-bold text-slate-900">Ready to Join</div>
</div>
</div>
</div>
</div>
</div>
</section>
{/* GENERATOR SECTION */}
<section className="py-12 px-4 sm:px-6 lg:px-8 -mt-8">
<ZoomGenerator />
</section>
{/* HOW IT WORKS */}
<section className="py-16 px-4 sm:px-6 lg:px-8 bg-white">
<div className="max-w-4xl mx-auto">
<h2 className="text-3xl font-bold text-slate-900 text-center mb-12">
How Zoom QR Codes Work
</h2>
<div className="grid md:grid-cols-4 gap-8">
<article className="text-center">
<div className="w-12 h-12 rounded-2xl bg-[#2D8CFF]/10 flex items-center justify-center mx-auto mb-4">
<Video className="w-6 h-6 text-[#2D8CFF]" />
</div>
<h3 className="font-bold text-slate-900 mb-2">1. Meeting ID</h3>
<p className="text-slate-600 text-xs leading-relaxed">Enter your Zoom meeting ID.</p>
</article>
<article className="text-center">
<div className="w-12 h-12 rounded-2xl bg-[#2D8CFF]/10 flex items-center justify-center mx-auto mb-4">
<Shield className="w-6 h-6 text-[#2D8CFF]" />
</div>
<h3 className="font-bold text-slate-900 mb-2">2. Passcode</h3>
<p className="text-slate-600 text-xs leading-relaxed">Add passcode if required.</p>
</article>
<article className="text-center">
<div className="w-12 h-12 rounded-2xl bg-[#2D8CFF]/10 flex items-center justify-center mx-auto mb-4">
<Download className="w-6 h-6 text-[#2D8CFF]" />
</div>
<h3 className="font-bold text-slate-900 mb-2">3. Download</h3>
<p className="text-slate-600 text-xs leading-relaxed">Save your QR code.</p>
</article>
<article className="text-center">
<div className="w-12 h-12 rounded-2xl bg-[#2D8CFF]/10 flex items-center justify-center mx-auto mb-4">
<Share2 className="w-6 h-6 text-[#2D8CFF]" />
</div>
<h3 className="font-bold text-slate-900 mb-2">4. Display</h3>
<p className="text-slate-600 text-xs leading-relaxed">Put in meeting rooms or invites.</p>
</article>
</div>
</div>
</section>
{/* FAQ SECTION */}
<section className="py-16 px-4 sm:px-6 lg:px-8" style={{ backgroundColor: '#EBEBDF' }}>
<div className="max-w-3xl mx-auto">
<h2 className="text-3xl font-bold text-slate-900 text-center mb-4">
Frequently Asked Questions
</h2>
<p className="text-slate-600 text-center mb-10">
Common questions about Zoom QR codes.
</p>
<div className="space-y-4">
<FaqItem
question="What happens when someone scans the QR code?"
answer="The Zoom app opens directly with your meeting ID and passcode pre-filled. They just tap 'Join' to enter the meeting."
/>
<FaqItem
question="Does it work for recurring meetings?"
answer="Yes! If your recurring meeting uses a fixed Personal Meeting ID (PMI), the QR code will work for all sessions."
/>
<FaqItem
question="What if the meeting ID changes?"
answer="Static QR codes cannot be updated. You'll need to generate a new code. For changeable meetings, consider our Dynamic QR Codes."
/>
<FaqItem
question="Does it work without the Zoom app installed?"
answer="If 'Open Zoom app directly' is unchecked, the QR links to join.zoom.us which works in any browser."
/>
</div>
</div>
</section>
</div>
</>
);
}
function FaqItem({ question, answer }: { question: string; answer: string }) {
return (
<details className="group bg-white rounded-xl shadow-sm border border-slate-200 overflow-hidden">
<summary className="flex items-center justify-between p-5 cursor-pointer list-none text-slate-900 font-semibold hover:bg-slate-50 transition-colors">
{question}
<span className="transition group-open:rotate-180 text-slate-400">
<svg fill="none" height="20" stroke="currentColor" strokeLinecap="round" strokeLinejoin="round" strokeWidth="2" viewBox="0 0 24 24" width="20">
<path d="M6 9l6 6 6-6" />
</svg>
</span>
</summary>
<div className="text-slate-600 px-5 pb-5 pt-0 leading-relaxed text-sm">
{answer}
</div>
</details>
);
}

View File

@@ -0,0 +1,218 @@
import { NextRequest, NextResponse } from 'next/server';
import { cookies } from 'next/headers';
import { db } from '@/lib/db';
export const dynamic = 'force-dynamic';
export async function GET(request: NextRequest) {
try {
// Check newsletter-admin cookie authentication
const cookieStore = cookies();
const adminCookie = cookieStore.get('newsletter-admin');
if (!adminCookie || adminCookie.value !== 'authenticated') {
return NextResponse.json(
{ error: 'Unauthorized - Admin login required' },
{ status: 401 }
);
}
// Get 30 days ago date
const thirtyDaysAgo = new Date();
thirtyDaysAgo.setDate(thirtyDaysAgo.getDate() - 30);
// Get 7 days ago date
const sevenDaysAgo = new Date();
sevenDaysAgo.setDate(sevenDaysAgo.getDate() - 7);
// Get start of current month
const startOfMonth = new Date();
startOfMonth.setDate(1);
startOfMonth.setHours(0, 0, 0, 0);
// Fetch all statistics in parallel
const [
totalUsers,
premiumUsers,
newUsersThisWeek,
newUsersThisMonth,
totalQRCodes,
dynamicQRCodes,
staticQRCodes,
totalScans,
dynamicQRCodesWithScans,
activeQRCodes,
newsletterSubscribers,
] = await Promise.all([
// Total users
db.user.count(),
// Premium users (PRO or BUSINESS)
db.user.count({
where: {
plan: {
in: ['PRO', 'BUSINESS'],
},
},
}),
// New users this week
db.user.count({
where: {
createdAt: {
gte: sevenDaysAgo,
},
},
}),
// New users this month
db.user.count({
where: {
createdAt: {
gte: startOfMonth,
},
},
}),
// Total QR codes
db.qRCode.count(),
// Dynamic QR codes
db.qRCode.count({
where: {
type: 'DYNAMIC',
},
}),
// Static QR codes
db.qRCode.count({
where: {
type: 'STATIC',
},
}),
// Total scans
db.qRScan.count(),
// Get all dynamic QR codes with their scan counts
db.qRCode.findMany({
where: {
type: 'DYNAMIC',
},
include: {
_count: {
select: {
scans: true,
},
},
},
}),
// Active QR codes (scanned in last 30 days)
db.qRCode.findMany({
where: {
scans: {
some: {
ts: {
gte: thirtyDaysAgo,
},
},
},
},
distinct: ['id'],
}),
// Newsletter subscribers
db.newsletterSubscription.count({
where: {
status: 'subscribed',
},
}),
]);
// Calculate dynamic QR scans
const dynamicQRScans = dynamicQRCodesWithScans.reduce(
(total, qr) => total + qr._count.scans,
0
);
// Calculate average scans per dynamic QR
const avgScansPerDynamicQR =
dynamicQRCodes > 0 ? (dynamicQRScans / dynamicQRCodes).toFixed(1) : '0';
// Get top 5 most scanned QR codes
const topQRCodes = await db.qRCode.findMany({
take: 5,
include: {
_count: {
select: {
scans: true,
},
},
user: {
select: {
email: true,
name: true,
},
},
},
orderBy: {
scans: {
_count: 'desc',
},
},
});
// Get recent users
const recentUsers = await db.user.findMany({
take: 5,
orderBy: {
createdAt: 'desc',
},
select: {
email: true,
name: true,
plan: true,
createdAt: true,
},
});
return NextResponse.json({
users: {
total: totalUsers,
premium: premiumUsers,
newThisWeek: newUsersThisWeek,
newThisMonth: newUsersThisMonth,
recent: recentUsers,
},
qrCodes: {
total: totalQRCodes,
dynamic: dynamicQRCodes,
static: staticQRCodes,
active: activeQRCodes.length,
},
scans: {
total: totalScans,
dynamicOnly: dynamicQRScans,
avgPerDynamicQR: avgScansPerDynamicQR,
},
newsletter: {
subscribers: newsletterSubscribers,
},
topQRCodes: topQRCodes.map((qr) => ({
id: qr.id,
title: qr.title,
type: qr.type,
scans: qr._count.scans,
owner: qr.user.name || qr.user.email,
createdAt: qr.createdAt,
})),
});
} catch (error) {
console.error('Error fetching admin stats:', error);
return NextResponse.json(
{ error: 'Failed to fetch statistics' },
{ status: 500 }
);
}
}

View File

@@ -149,7 +149,7 @@ export async function GET(request: NextRequest) {
? Math.round((previousUniqueScans / previousTotalScans) * 100)
: 0;
const avgScansTrend = calculateTrend(currentConversion, previousConversion);
const avgScansTrend = calculateTrend(avgScansPerQR, previousAvgScansPerQR);
// Device stats
const deviceStats = qrCodes.flatMap(qr => qr.scans)
@@ -245,7 +245,7 @@ export async function GET(request: NextRequest) {
summary: {
totalScans,
uniqueScans,
avgScansPerQR: currentConversion, // Now sending Unique Rate instead of Avg per QR
avgScansPerQR,
mobilePercentage,
topCountry: topCountry ? topCountry[0] : 'N/A',
topCountryPercentage: topCountry && totalScans > 0

View File

@@ -0,0 +1,41 @@
import { NextRequest, NextResponse } from 'next/server';
import { db } from '@/lib/db';
export async function POST(request: NextRequest) {
try {
const body = await request.json();
const { slug, rating, comment } = body;
if (!slug || !rating) {
return NextResponse.json({ error: 'Missing required fields' }, { status: 400 });
}
// Find the QR code
const qrCode = await db.qRCode.findUnique({
where: { slug },
select: { id: true },
});
if (!qrCode) {
return NextResponse.json({ error: 'QR Code not found' }, { status: 404 });
}
// Log feedback as a scan with additional data
// In a full implementation, you'd have a Feedback model
// For now, we'll store it in QRScan with special markers
await db.qRScan.create({
data: {
qrId: qrCode.id,
ipHash: 'feedback',
userAgent: `rating:${rating}|comment:${comment?.substring(0, 200) || ''}`,
device: 'feedback',
isUnique: true,
},
});
return NextResponse.json({ success: true });
} catch (error) {
console.error('Error submitting feedback:', error);
return NextResponse.json({ error: 'Internal server error' }, { status: 500 });
}
}

View File

@@ -0,0 +1,122 @@
import { NextRequest, NextResponse } from 'next/server';
import { getServerSession } from 'next-auth';
import { authOptions } from '@/lib/auth';
import { db } from '@/lib/db';
import { cookies } from 'next/headers';
export async function GET(
request: NextRequest,
{ params }: { params: Promise<{ id: string }> }
) {
try {
let userId: string | undefined;
// Try NextAuth session first
const session = await getServerSession(authOptions);
if (session?.user?.id) {
userId = session.user.id;
} else {
// Fallback: Check raw userId cookie (like /api/user does)
const cookieStore = await cookies();
userId = cookieStore.get('userId')?.value;
}
if (!userId) {
return NextResponse.json({ error: 'Unauthorized' }, { status: 401 });
}
const { id } = await params;
const { searchParams } = new URL(request.url);
const page = parseInt(searchParams.get('page') || '1');
const limit = parseInt(searchParams.get('limit') || '20');
const skip = (page - 1) * limit;
// Verify QR ownership and type
const qrCode = await db.qRCode.findUnique({
where: { id, userId: userId },
select: { id: true, contentType: true },
});
if (!qrCode) {
return NextResponse.json({ error: 'QR code not found' }, { status: 404 });
}
// Check if consistent with schema (Prisma enum mismatch fix)
// @ts-ignore - Temporary ignore until client regeneration catches up fully in all envs
if (qrCode.contentType !== 'FEEDBACK') {
return NextResponse.json({ error: 'Not a feedback QR code' }, { status: 400 });
}
// Fetch feedback entries (stored as QRScans with ipHash='feedback')
const [feedbackEntries, totalCount] = await Promise.all([
db.qRScan.findMany({
where: { qrId: id, ipHash: 'feedback' },
orderBy: { ts: 'desc' },
skip,
take: limit,
select: { id: true, userAgent: true, ts: true },
}),
db.qRScan.count({
where: { qrId: id, ipHash: 'feedback' },
}),
]);
// Parse feedback data from userAgent field
const feedbacks = feedbackEntries.map((entry) => {
const parsed = parseFeedback(entry.userAgent || '');
return {
id: entry.id,
rating: parsed.rating,
comment: parsed.comment,
date: entry.ts,
};
});
// Calculate stats
const allRatings = await db.qRScan.findMany({
where: { qrId: id, ipHash: 'feedback' },
select: { userAgent: true },
});
const ratings = allRatings.map((e) => parseFeedback(e.userAgent || '').rating).filter((r) => r > 0);
const avgRating = ratings.length > 0 ? ratings.reduce((a, b) => a + b, 0) / ratings.length : 0;
// Rating distribution
const distribution = {
5: ratings.filter((r) => r === 5).length,
4: ratings.filter((r) => r === 4).length,
3: ratings.filter((r) => r === 3).length,
2: ratings.filter((r) => r === 2).length,
1: ratings.filter((r) => r === 1).length,
};
return NextResponse.json({
feedbacks,
stats: {
total: totalCount,
avgRating: Math.round(avgRating * 10) / 10,
distribution,
},
pagination: {
page,
limit,
totalPages: Math.ceil(totalCount / limit),
hasMore: skip + limit < totalCount,
},
});
} catch (error) {
console.error('Error fetching feedback:', error);
return NextResponse.json({ error: 'Internal server error' }, { status: 500 });
}
}
function parseFeedback(userAgent: string): { rating: number; comment: string } {
// Format: "rating:4|comment:Great service!"
const ratingMatch = userAgent.match(/rating:(\d)/);
const commentMatch = userAgent.match(/comment:(.+)/);
return {
rating: ratingMatch ? parseInt(ratingMatch[1]) : 0,
comment: commentMatch ? commentMatch[1] : '',
};
}

View File

@@ -0,0 +1,37 @@
import { NextRequest, NextResponse } from 'next/server';
import { db } from '@/lib/db';
export async function GET(
request: NextRequest,
{ params }: { params: Promise<{ slug: string }> }
) {
try {
const { slug } = await params;
const qrCode = await db.qRCode.findUnique({
where: { slug },
select: {
id: true,
content: true,
contentType: true,
status: true,
},
});
if (!qrCode) {
return NextResponse.json({ error: 'QR Code not found' }, { status: 404 });
}
if (qrCode.status === 'PAUSED') {
return NextResponse.json({ error: 'QR Code is paused' }, { status: 403 });
}
return NextResponse.json({
contentType: qrCode.contentType,
content: qrCode.content,
});
} catch (error) {
console.error('Error fetching public QR:', error);
return NextResponse.json({ error: 'Internal server error' }, { status: 500 });
}
}

View File

@@ -63,7 +63,6 @@ export async function POST(request: NextRequest) {
}
const userId = cookies().get('userId')?.value;
console.log('POST /api/qrs - userId from cookie:', userId);
// Rate Limiting (user-based)
const clientId = userId || getClientIdentifier(request);
@@ -90,20 +89,16 @@ export async function POST(request: NextRequest) {
return NextResponse.json({ error: 'Unauthorized - no userId cookie' }, { status: 401 });
}
// Check if user exists and get their plan
const user = await db.user.findUnique({
where: { id: userId },
select: { plan: true },
});
console.log('User exists:', !!user);
if (!user) {
return NextResponse.json({ error: `User not found: ${userId}` }, { status: 404 });
}
const body = await request.json();
console.log('Request body:', body);
// Validate request body with Zod (only for non-static QRs or simplified validation)
// Note: Static QRs have complex nested content structure, so we do basic validation
@@ -182,6 +177,18 @@ END:VCARD`;
case 'WHATSAPP':
qrContent = `https://wa.me/${body.content.phone}${body.content.message ? `?text=${encodeURIComponent(body.content.message)}` : ''}`;
break;
case 'PDF':
qrContent = body.content.fileUrl || 'https://example.com/file.pdf';
break;
case 'APP':
qrContent = body.content.fallbackUrl || body.content.iosUrl || body.content.androidUrl || 'https://example.com';
break;
case 'COUPON':
qrContent = `Coupon: ${body.content.code || 'CODE'} - ${body.content.discount || 'Discount'}`;
break;
case 'FEEDBACK':
qrContent = body.content.feedbackUrl || 'https://example.com/feedback';
break;
default:
qrContent = body.content.url || 'https://example.com';
}

View File

@@ -0,0 +1,82 @@
import { NextRequest, NextResponse } from 'next/server';
import { getServerSession } from 'next-auth';
import { authOptions } from '@/lib/auth';
import { uploadFileToR2 } from '@/lib/r2';
import { env } from '@/lib/env';
import { db } from '@/lib/db';
export async function POST(request: NextRequest) {
try {
// 1. Authentication Check
const session = await getServerSession(authOptions);
let userId = session?.user?.id;
// Fallback: Check for simple-login cookie if no NextAuth session
if (!userId) {
const cookieUserId = request.cookies.get('userId')?.value;
if (cookieUserId) {
// Verify user exists
const user = await db.user.findUnique({
where: { id: cookieUserId },
select: { id: true }
});
if (user) {
userId = user.id;
}
}
}
if (!userId) {
return new NextResponse('Unauthorized', { status: 401 });
}
// 2. Parse Form Data
const formData = await request.formData();
const file = formData.get('file') as File | null;
if (!file) {
return NextResponse.json(
{ error: 'No file provided' },
{ status: 400 }
);
}
// 3. Validation
// Check file size (default 10MB)
const MAX_SIZE = parseInt(env.MAX_UPLOAD_SIZE || '10485760');
if (file.size > MAX_SIZE) {
return NextResponse.json(
{ error: `File too large. Maximum size: ${MAX_SIZE / 1024 / 1024}MB` },
{ status: 400 }
);
}
// Check file type (allow images and PDFs)
const allowedTypes = ['application/pdf', 'image/jpeg', 'image/png', 'image/webp'];
if (!allowedTypes.includes(file.type)) {
return NextResponse.json(
{ error: 'Invalid file type. Only PDF and Images are allowed.' },
{ status: 400 }
);
}
// 4. Upload to R2
const buffer = Buffer.from(await file.arrayBuffer());
const publicUrl = await uploadFileToR2(buffer, file.name, file.type);
// 5. Success
return NextResponse.json({
success: true,
url: publicUrl,
filename: file.name,
type: file.type
});
} catch (error) {
console.error('Upload error:', error);
return NextResponse.json(
{ error: 'Internal server error during upload' },
{ status: 500 }
);
}
}

View File

@@ -1,144 +0,0 @@
import { NextRequest, NextResponse } from 'next/server';
import { cookies } from 'next/headers';
import { db } from '@/lib/db';
// Reserved subdomains that cannot be used
const RESERVED_SUBDOMAINS = [
'www', 'app', 'api', 'admin', 'mail', 'email',
'ftp', 'smtp', 'pop', 'imap', 'dns', 'ns1', 'ns2',
'blog', 'shop', 'store', 'help', 'support', 'dashboard',
'login', 'signup', 'auth', 'cdn', 'static', 'assets',
'dev', 'staging', 'test', 'demo', 'beta', 'alpha'
];
// Validate subdomain format
function isValidSubdomain(subdomain: string): { valid: boolean; error?: string } {
if (!subdomain) {
return { valid: false, error: 'Subdomain is required' };
}
// Must be lowercase
if (subdomain !== subdomain.toLowerCase()) {
return { valid: false, error: 'Subdomain must be lowercase' };
}
// Length check
if (subdomain.length < 3 || subdomain.length > 30) {
return { valid: false, error: 'Subdomain must be 3-30 characters' };
}
// Alphanumeric and hyphens only, no leading/trailing hyphens
if (!/^[a-z0-9]([a-z0-9-]*[a-z0-9])?$/.test(subdomain)) {
return { valid: false, error: 'Only lowercase letters, numbers, and hyphens allowed' };
}
// No consecutive hyphens
if (/--/.test(subdomain)) {
return { valid: false, error: 'No consecutive hyphens allowed' };
}
// Check reserved
if (RESERVED_SUBDOMAINS.includes(subdomain)) {
return { valid: false, error: 'This subdomain is reserved' };
}
return { valid: true };
}
// GET /api/user/subdomain - Get current subdomain
export async function GET() {
try {
const userId = cookies().get('userId')?.value;
if (!userId) {
return NextResponse.json({ error: 'Unauthorized' }, { status: 401 });
}
const user = await db.user.findUnique({
where: { id: userId },
select: { subdomain: true },
});
if (!user) {
return NextResponse.json({ error: 'User not found' }, { status: 404 });
}
return NextResponse.json({ subdomain: user.subdomain });
} catch (error) {
console.error('Error fetching subdomain:', error);
return NextResponse.json({ error: 'Internal server error' }, { status: 500 });
}
}
// POST /api/user/subdomain - Set subdomain
export async function POST(request: NextRequest) {
try {
const userId = cookies().get('userId')?.value;
if (!userId) {
return NextResponse.json({ error: 'Unauthorized' }, { status: 401 });
}
const body = await request.json();
const subdomain = body.subdomain?.trim().toLowerCase();
// Validate
const validation = isValidSubdomain(subdomain);
if (!validation.valid) {
return NextResponse.json({ error: validation.error }, { status: 400 });
}
// Check if already taken by another user
const existing = await db.user.findFirst({
where: {
subdomain,
NOT: { id: userId },
},
});
if (existing) {
return NextResponse.json({ error: 'This subdomain is already taken' }, { status: 409 });
}
// Update user
try {
const updatedUser = await db.user.update({
where: { id: userId },
data: { subdomain },
select: { subdomain: true } // Only select needed fields
});
return NextResponse.json({
success: true,
subdomain: updatedUser.subdomain,
url: `https://${updatedUser.subdomain}.qrmaster.net`
});
} catch (error: any) {
if (error.code === 'P2025') {
return NextResponse.json({ error: 'User not found' }, { status: 404 });
}
throw error;
}
} catch (error) {
console.error('Error setting subdomain:', error);
return NextResponse.json({ error: 'Internal server error' }, { status: 500 });
}
}
// DELETE /api/user/subdomain - Remove subdomain
export async function DELETE() {
try {
const userId = cookies().get('userId')?.value;
if (!userId) {
return NextResponse.json({ error: 'Unauthorized' }, { status: 401 });
}
await db.user.update({
where: { id: userId },
data: { subdomain: null },
});
return NextResponse.json({ success: true });
} catch (error) {
console.error('Error removing subdomain:', error);
return NextResponse.json({ error: 'Internal server error' }, { status: 500 });
}
}

View File

@@ -0,0 +1,167 @@
'use client';
import { useEffect, useState } from 'react';
import { useParams } from 'next/navigation';
import { Copy, Check, ExternalLink, Gift } from 'lucide-react';
interface CouponData {
code: string;
discount: string;
title?: string;
description?: string;
expiryDate?: string;
redeemUrl?: string;
}
export default function CouponPage() {
const params = useParams();
const slug = params.slug as string;
const [coupon, setCoupon] = useState<CouponData | null>(null);
const [loading, setLoading] = useState(true);
const [copied, setCopied] = useState(false);
useEffect(() => {
async function fetchCoupon() {
try {
const res = await fetch(`/api/qrs/public/${slug}`);
if (res.ok) {
const data = await res.json();
if (data.contentType === 'COUPON') {
setCoupon(data.content as CouponData);
}
}
} catch (error) {
console.error('Error fetching coupon:', error);
} finally {
setLoading(false);
}
}
fetchCoupon();
}, [slug]);
const copyCode = async () => {
if (coupon?.code) {
await navigator.clipboard.writeText(coupon.code);
setCopied(true);
setTimeout(() => setCopied(false), 2000);
}
};
// Loading
if (loading) {
return (
<div className="min-h-screen flex items-center justify-center bg-gradient-to-br from-rose-50 to-pink-100">
<div className="w-10 h-10 border-3 border-pink-200 border-t-pink-600 rounded-full animate-spin"></div>
</div>
);
}
// Not found
if (!coupon) {
return (
<div className="min-h-screen flex items-center justify-center bg-gradient-to-br from-rose-50 to-pink-100 px-6">
<div className="text-center bg-white rounded-2xl p-8 shadow-lg">
<p className="text-gray-500 text-lg">This coupon is not available.</p>
</div>
</div>
);
}
const isExpired = coupon.expiryDate && new Date(coupon.expiryDate) < new Date();
return (<div className="min-h-screen flex items-center justify-center bg-gradient-to-br from-[#FAF8F5] via-[#C6C0B3] to-[#4C5F4E] px-6 py-12">
<div className="max-w-sm w-full">
{/* Card */}
<div className="bg-white rounded-3xl shadow-xl overflow-hidden">
{/* Colorful Header */}
<div className="bg-gradient-to-br from-[#DB5375] to-[#B3FFB3] text-gray-900 p-8 text-center relative overflow-hidden">
{/* Decorative circles */}
<div className="absolute top-0 right-0 w-32 h-32 bg-white/10 rounded-full -translate-y-1/2 translate-x-1/2"></div>
<div className="absolute bottom-0 left-0 w-24 h-24 bg-white/10 rounded-full translate-y-1/2 -translate-x-1/2"></div>
<div className="relative">
<div className="w-14 h-14 bg-[#DB5375]/10 rounded-2xl flex items-center justify-center mx-auto mb-4">
<Gift className="w-7 h-7 text-[#DB5375]" />
</div>
<p className="text-gray-700 text-sm mb-1">{coupon.title || 'Special Offer'}</p>
<p className="text-4xl font-bold tracking-tight text-gray-900">{coupon.discount}</p>
</div>
</div>
{/* Dotted line with circles */}
<div className="relative py-4">
<div className="relative py-4">
<div className="absolute left-0 top-1/2 -translate-y-1/2 w-5 h-10 bg-gradient-to-br from-[#FAF8F5] via-[#C6C0B3] to-[#4C5F4E] rounded-r-full"></div>
<div className="absolute right-0 top-1/2 -translate-y-1/2 w-5 h-10 bg-gradient-to-br from-[#FAF8F5] via-[#C6C0B3] to-[#4C5F4E] rounded-l-full"></div>
<div className="border-t-2 border-dashed border-gray-200 mx-8"></div>
</div>
{/* Content */}
<div className="px-8 pb-8">
{coupon.description && (
<p className="text-gray-500 text-sm text-center mb-6">{coupon.description}</p>
)}
{/* Code Box */}
<div className="bg-gray-50 rounded-2xl p-5 mb-4 border border-emerald-100">
<p className="text-xs text-emerald-600 text-center mb-2 font-medium uppercase tracking-wider">Your Code</p>
<div className="flex items-center justify-center gap-3">
<code className="text-2xl font-mono font-bold text-gray-900 tracking-wider">
{coupon.code}
</code>
<button
onClick={copyCode}
className={`p-2.5 rounded-xl transition-all ${copied
? 'bg-emerald-100 text-emerald-600'
: 'bg-white text-gray-500 hover:text-rose-500 shadow-sm hover:shadow'
}`}
aria-label="Copy code"
>
{copied ? <Check className="w-5 h-5" /> : <Copy className="w-5 h-5" />}
</button>
</div>
{copied && (
<p className="text-emerald-600 text-xs text-center mt-2 font-medium">Copied!</p>
)}
</div>
{/* Expiry */}
{coupon.expiryDate && (
<p className={`text-sm text-center mb-6 font-medium ${isExpired ? 'text-red-500' : 'text-gray-400'}`}>
{isExpired
? '⚠️ This coupon has expired'
: `Valid until ${new Date(coupon.expiryDate).toLocaleDateString('en-US', {
month: 'long',
day: 'numeric',
year: 'numeric'
})}`
}
</p>
)}
{/* Redeem Button */}
{coupon.redeemUrl && !isExpired && (
<a
href={coupon.redeemUrl}
target="_blank"
rel="noopener noreferrer"
className="block w-full py-4 rounded-xl font-semibold text-center bg-gradient-to-r from-[#076653] to-[#0C342C] text-white hover:from-[#087861] hover:to-[#0E4036] transition-all shadow-lg shadow-emerald-200"
>
<span className="flex items-center justify-center gap-2">
Redeem Now
<ExternalLink className="w-4 h-4" />
</span>
</a>
)}
</div>
</div>
{/* Footer */}
<p className="text-center text-sm text-white/60 mt-6">
Powered by QR Master
</p>
</div>
</div>
</div>
);
}

View File

@@ -0,0 +1,195 @@
'use client';
import { useEffect, useState } from 'react';
import { useParams } from 'next/navigation';
import { Star, Send, Check } from 'lucide-react';
interface FeedbackData {
businessName: string;
googleReviewUrl?: string;
thankYouMessage?: string;
}
export default function FeedbackPage() {
const params = useParams();
const slug = params.slug as string;
const [feedback, setFeedback] = useState<FeedbackData | null>(null);
const [loading, setLoading] = useState(true);
const [rating, setRating] = useState(0);
const [hoverRating, setHoverRating] = useState(0);
const [comment, setComment] = useState('');
const [submitted, setSubmitted] = useState(false);
const [submitting, setSubmitting] = useState(false);
useEffect(() => {
async function fetchFeedback() {
try {
const res = await fetch(`/api/qrs/public/${slug}`);
if (res.ok) {
const data = await res.json();
if (data.contentType === 'FEEDBACK') {
setFeedback(data.content as FeedbackData);
}
}
} catch (error) {
console.error('Error fetching feedback data:', error);
} finally {
setLoading(false);
}
}
fetchFeedback();
}, [slug]);
const handleSubmit = async () => {
if (rating === 0) return;
setSubmitting(true);
try {
await fetch('/api/feedback', {
method: 'POST',
headers: { 'Content-Type': 'application/json' },
body: JSON.stringify({ slug, rating, comment }),
});
setSubmitted(true);
if (rating >= 4 && feedback?.googleReviewUrl) {
setTimeout(() => {
window.location.href = feedback.googleReviewUrl!;
}, 2000);
}
} catch (error) {
console.error('Error submitting feedback:', error);
} finally {
setSubmitting(false);
}
};
// Loading
if (loading) {
return (
<div className="min-h-screen flex items-center justify-center bg-gradient-to-br from-[#FAF8F5] via-[#C6C0B3] to-[#4C5F4E]">
<div className="w-10 h-10 border-3 border-indigo-200 border-t-indigo-600 rounded-full animate-spin"></div>
</div>
);
}
// Not found
if (!feedback) {
return (
<div className="min-h-screen flex items-center justify-center bg-gradient-to-br from-[#FAF8F5] via-[#C6C0B3] to-[#4C5F4E] px-6">
<div className="text-center bg-white rounded-2xl p-8 shadow-lg">
<p className="text-gray-500 text-lg">This feedback form is not available.</p>
</div>
</div>
);
}
// Success
if (submitted) {
return (
<div className="min-h-screen flex items-center justify-center bg-gradient-to-br from-[#FAF8F5] via-[#C6C0B3] to-[#4C5F4E] px-6">
<div className="max-w-sm w-full bg-white rounded-3xl shadow-xl p-10 text-center">
<div className="w-20 h-20 bg-gradient-to-br from-[#4C5F4E] to-[#FAF8F5] rounded-full flex items-center justify-center mx-auto mb-6 shadow-lg">
<Check className="w-10 h-10 text-white" strokeWidth={2.5} />
</div>
<h1 className="text-2xl font-bold text-gray-900 mb-2">
Thank you!
</h1>
<p className="text-gray-500">
{feedback.thankYouMessage || 'Your feedback has been submitted.'}
</p>
{rating >= 4 && feedback.googleReviewUrl && (
<p className="text-sm text-teal-600 mt-6 font-medium">
Redirecting to Google Reviews...
</p>
)}
</div>
</div>
);
}
// Rating Form
return (
<div className="min-h-screen flex items-center justify-center bg-gradient-to-br from-[#FAF8F5] via-[#C6C0B3] to-[#4C5F4E] px-6 py-12">
<div className="max-w-md w-full">
{/* Card */}
<div className="bg-white rounded-3xl shadow-xl overflow-hidden">
{/* Colored Header */}
<div className="bg-gradient-to-r from-[#4C5F4E] via-[#C6C0B3] to-[#FAF8F5] p-8 text-center">
<div className="w-14 h-14 bg-white/20 rounded-2xl flex items-center justify-center mx-auto mb-4">
<Star className="w-7 h-7 text-white" />
</div>
<h1 className="text-2xl font-bold mb-1 text-gray-900">How was your experience?</h1>
<p className="text-gray-700">{feedback.businessName}</p>
</div>
{/* Content */}
<div className="p-8">
{/* Stars */}
<div className="flex justify-center gap-2 mb-2">
{[1, 2, 3, 4, 5].map((star) => (
<button
key={star}
onClick={() => setRating(star)}
onMouseEnter={() => setHoverRating(star)}
onMouseLeave={() => setHoverRating(0)}
className="p-1 transition-transform hover:scale-110 focus:outline-none"
aria-label={`Rate ${star} stars`}
>
<Star
className={`w-11 h-11 transition-all ${star <= (hoverRating || rating)
? 'text-amber-400 fill-amber-400 drop-shadow-sm'
: 'text-gray-200'
}`}
/>
</button>
))}
</div>
{/* Rating text */}
<p className="text-center text-sm font-medium h-6 mb-6" style={{ color: rating > 0 ? '#6366f1' : 'transparent' }}>
{rating === 1 && 'Poor'}
{rating === 2 && 'Fair'}
{rating === 3 && 'Good'}
{rating === 4 && 'Great!'}
{rating === 5 && 'Excellent!'}
</p>
{/* Comment */}
<div className="mb-6">
<textarea
value={comment}
onChange={(e) => setComment(e.target.value)}
placeholder="Share your thoughts (optional)"
rows={3}
className="w-full px-4 py-3 bg-gray-50 border border-gray-200 rounded-xl text-gray-900 placeholder-gray-400 focus:outline-none focus:ring-2 focus:ring-indigo-500 focus:border-transparent resize-none"
/>
</div>
{/* Submit */}
<button
onClick={handleSubmit}
disabled={rating === 0 || submitting}
className={`w-full py-4 rounded-xl font-semibold flex items-center justify-center gap-2 transition-all ${rating === 0
? 'bg-gray-100 text-gray-400 cursor-not-allowed'
: 'bg-gradient-to-r from-[#4C5F4E] to-[#0C342C] text-white hover:from-[#5a705c] hover:to-[#0E4036] shadow-lg shadow-emerald-200'
}`}
>
<Send className="w-4 h-4" />
{submitting ? 'Sending...' : 'Submit Feedback'}
</button>
</div>
</div>
{/* Footer */}
<p className="text-center text-sm text-white/60 mt-6">
Powered by QR Master
</p>
</div>
</div>
);
}

View File

@@ -14,15 +14,8 @@ export async function GET(
where: { slug },
select: {
id: true,
title: true,
content: true,
contentType: true,
user: {
select: {
name: true,
subdomain: true,
}
}
},
});
@@ -66,6 +59,34 @@ export async function GET(
const baseUrlText = process.env.NEXT_PUBLIC_APP_URL || 'http://localhost:3050';
destination = `${baseUrlText}/display?text=${encodeURIComponent(content.text || '')}`;
break;
case 'PDF':
// Direct link to file
destination = content.fileUrl || 'https://example.com/file.pdf';
break;
case 'APP':
// Smart device detection for app stores
const userAgent = request.headers.get('user-agent') || '';
const isIOS = /iphone|ipad|ipod/i.test(userAgent);
const isAndroid = /android/i.test(userAgent);
if (isIOS && content.iosUrl) {
destination = content.iosUrl;
} else if (isAndroid && content.androidUrl) {
destination = content.androidUrl;
} else {
destination = content.fallbackUrl || content.iosUrl || content.androidUrl || 'https://example.com';
}
break;
case 'COUPON':
// Redirect to coupon display page
const baseUrlCoupon = process.env.NEXT_PUBLIC_APP_URL || 'http://localhost:3050';
destination = `${baseUrlCoupon}/coupon/${slug}`;
break;
case 'FEEDBACK':
// Redirect to feedback form page
const baseUrlFeedback = process.env.NEXT_PUBLIC_APP_URL || 'http://localhost:3050';
destination = `${baseUrlFeedback}/feedback/${slug}`;
break;
default:
destination = 'https://example.com';
}
@@ -88,94 +109,8 @@ export async function GET(
destination = `${destination}${separator}${preservedParams.toString()}`;
}
// Construct metadata
const siteName = qrCode.user?.subdomain
? `${qrCode.user.subdomain.charAt(0).toUpperCase() + qrCode.user.subdomain.slice(1)}`
: 'QR Master';
const title = qrCode.title || siteName;
const description = `Redirecting to content...`;
// Determine if we should show a preview (bots) or redirect immediately
const userAgent = request.headers.get('user-agent') || '';
const isBot = /facebookexternalhit|twitterbot|whatsapp|discordbot|telegrambot|slackbot|linkedinbot/i.test(userAgent);
// HTML response with metadata and redirect
const html = `<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>${title}</title>
<!-- Open Graph Metadata -->
<meta property="og:title" content="${title}" />
<meta property="og:site_name" content="${siteName}" />
<meta property="og:description" content="${description}" />
<meta property="og:type" content="website" />
<meta property="og:url" content="${destination}" />
<!-- Twitter Card -->
<meta name="twitter:card" content="summary" />
<meta name="twitter:title" content="${title}" />
<meta name="twitter:description" content="${description}" />
<!-- No-cache headers to ensure fresh Redirects -->
<meta http-equiv="Cache-Control" content="no-cache, no-store, must-revalidate" />
<meta http-equiv="Pragma" content="no-cache" />
<meta http-equiv="Expires" content="0" />
<!-- Fallback Redirect -->
<meta http-equiv="refresh" content="0;url=${JSON.stringify(destination).slice(1, -1)}" />
<style>
body {
font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
display: flex;
justify-content: center;
align-items: center;
height: 100vh;
margin: 0;
background-color: #f9fafb;
color: #4b5563;
}
.loader {
text-align: center;
}
.spinner {
border: 3px solid #f3f3f3;
border-radius: 50%;
border-top: 3px solid #3b82f6;
width: 24px;
height: 24px;
-webkit-animation: spin 1s linear infinite; /* Safari */
animation: spin 1s linear infinite;
margin: 0 auto 1rem;
}
@keyframes spin {
0% { transform: rotate(0deg); }
100% { transform: rotate(360deg); }
}
</style>
</head>
<body>
<div class="loader">
<div class="spinner"></div>
<p>Redirecting to ${siteName}...</p>
</div>
<script>
// Immediate redirect
window.location.replace("${destination}");
</script>
</body>
</html>`;
return new NextResponse(html, {
headers: {
'Content-Type': 'text/html',
},
});
// Return 307 redirect (temporary redirect that preserves method)
return NextResponse.redirect(destination, { status: 307 });
} catch (error) {
console.error('QR redirect error:', error);
return new NextResponse('Internal server error', { status: 500 });

View File

@@ -3,6 +3,36 @@ import { MetadataRoute } from 'next';
export default function sitemap(): MetadataRoute.Sitemap {
const baseUrl = 'https://www.qrmaster.net';
// All free tool slugs
const freeTools = [
'url-qr-code',
'vcard-qr-code',
'text-qr-code',
'email-qr-code',
'sms-qr-code',
'wifi-qr-code',
'crypto-qr-code',
'event-qr-code',
'facebook-qr-code',
'instagram-qr-code',
'twitter-qr-code',
'youtube-qr-code',
'whatsapp-qr-code',
'tiktok-qr-code',
'geolocation-qr-code',
'phone-qr-code',
'paypal-qr-code',
'zoom-qr-code',
'teams-qr-code',
];
const toolPages = freeTools.map((slug) => ({
url: `${baseUrl}/tools/${slug}`,
lastModified: new Date(),
changeFrequency: 'monthly' as const,
priority: 0.8,
}));
return [
{
url: baseUrl,
@@ -70,5 +100,7 @@ export default function sitemap(): MetadataRoute.Sitemap {
changeFrequency: 'yearly',
priority: 0.4,
},
...toolPages,
];
}

View File

@@ -51,7 +51,7 @@ export default function CookieBanner() {
<p className="text-gray-600 text-sm leading-relaxed mb-3">
We use essential cookies for authentication and analytics cookies to improve your experience.{' '}
<Link href="/privacy" className="text-primary-600 hover:text-primary-700 font-medium underline">
Learn more
Learn more about our privacy policy
</Link>
</p>

View File

@@ -81,37 +81,37 @@ const countryNameToCode: Record<string, string> = {
};
// ISO Alpha-2 to ISO Alpha-3 mapping (for matching with TopoJSON)
const alpha2ToAlpha3: Record<string, string> = {
'US': 'USA',
'DE': 'DEU',
'GB': 'GBR',
'FR': 'FRA',
'CA': 'CAN',
'AU': 'AUS',
'JP': 'JPN',
'CN': 'CHN',
'IN': 'IND',
'BR': 'BRA',
'ES': 'ESP',
'IT': 'ITA',
'NL': 'NLD',
'CH': 'CHE',
'AT': 'AUT',
'PL': 'POL',
'SE': 'SWE',
'NO': 'NOR',
'DK': 'DNK',
'FI': 'FIN',
'BE': 'BEL',
'PT': 'PRT',
'IE': 'IRL',
'MX': 'MEX',
'AR': 'ARG',
'KR': 'KOR',
'SG': 'SGP',
'NZ': 'NZL',
'RU': 'RUS',
'ZA': 'ZAF',
const alpha2ToNumeric: Record<string, string> = {
'US': '840',
'DE': '276',
'GB': '826',
'FR': '250',
'CA': '124',
'AU': '036',
'JP': '392',
'CN': '156',
'IN': '356',
'BR': '076',
'ES': '724',
'IT': '380',
'NL': '528',
'CH': '756',
'AT': '040',
'PL': '616',
'SE': '752',
'NO': '578',
'DK': '208',
'FI': '246',
'BE': '056',
'PT': '620',
'IE': '372',
'MX': '484',
'AR': '032',
'KR': '410',
'SG': '702',
'NZ': '554',
'RU': '643',
'ZA': '710',
};
interface CountryStat {
@@ -132,9 +132,9 @@ const GeoMap: React.FC<GeoMapProps> = ({ countryStats, totalScans }) => {
countryStats.forEach((stat) => {
const alpha2 = countryNameToCode[stat.country] || stat.country;
const alpha3 = alpha2ToAlpha3[alpha2];
if (alpha3) {
countryData[alpha3] = stat.count;
const numericCode = alpha2ToNumeric[alpha2];
if (numericCode) {
countryData[numericCode] = stat.count;
if (stat.count > maxCount) maxCount = stat.count;
}
});
@@ -144,8 +144,16 @@ const GeoMap: React.FC<GeoMapProps> = ({ countryStats, totalScans }) => {
.domain([0, maxCount || 1])
.range(['#E0F2FE', '#1E40AF']);
const [tooltipContent, setTooltipContent] = React.useState<{ name: string; count: number } | null>(null);
const [tooltipPos, setTooltipPos] = React.useState({ x: 0, y: 0 });
return (
<div className="w-full h-full">
<div
className="w-full h-full relative group"
onMouseMove={(evt) => {
setTooltipPos({ x: evt.clientX, y: evt.clientY });
}}
>
<ComposableMap
projection="geoMercator"
projectionConfig={{
@@ -158,8 +166,9 @@ const GeoMap: React.FC<GeoMapProps> = ({ countryStats, totalScans }) => {
<Geographies geography={geoUrl}>
{({ geographies }) =>
geographies.map((geo) => {
const isoCode = geo.properties.ISO_A3 || geo.id;
const scanCount = countryData[isoCode] || 0;
// geo.id is the numeric ISO code as a string (e.g., "840" for US)
const geoId = geo.id;
const scanCount = countryData[geoId] || 0;
const fillColor = scanCount > 0 ? colorScale(scanCount) : '#F1F5F9';
return (
@@ -178,6 +187,13 @@ const GeoMap: React.FC<GeoMapProps> = ({ countryStats, totalScans }) => {
},
pressed: { outline: 'none' },
}}
onMouseEnter={() => {
const { name } = geo.properties;
setTooltipContent({ name, count: scanCount });
}}
onMouseLeave={() => {
setTooltipContent(null);
}}
/>
);
})
@@ -185,6 +201,24 @@ const GeoMap: React.FC<GeoMapProps> = ({ countryStats, totalScans }) => {
</Geographies>
</ZoomableGroup>
</ComposableMap>
{tooltipContent && (
<div
className="fixed z-50 px-3 py-2 text-sm font-medium text-white bg-gray-900 rounded-lg shadow-xl pointer-events-none transform -translate-x-1/2 -translate-y-full"
style={{
left: tooltipPos.x,
top: tooltipPos.y - 10,
}}
>
<div className="flex items-center gap-2">
<span>{tooltipContent.name}</span>
<span className="text-gray-400">|</span>
<span className="font-bold text-blue-400">{tooltipContent.count} scans</span>
</div>
{/* Arrow */}
<div className="absolute bottom-0 left-1/2 -translate-x-1/2 translate-y-full w-0 h-0 border-l-4 border-r-4 border-t-4 border-l-transparent border-r-transparent border-t-gray-900"></div>
</div>
)}
</div>
);
};

View File

@@ -21,25 +21,17 @@ interface QRCodeCardProps {
};
onEdit: (id: string) => void;
onDelete: (id: string) => void;
userSubdomain?: string | null;
}
export const QRCodeCard: React.FC<QRCodeCardProps> = ({
qr,
onEdit,
onDelete,
userSubdomain,
}) => {
// For dynamic QR codes, use the redirect URL for tracking
// For static QR codes, use the direct URL from content
const baseUrl = process.env.NEXT_PUBLIC_APP_URL || (typeof window !== 'undefined' ? window.location.origin : 'http://localhost:3050');
// White label: use subdomain URL if available
const mainDomain = process.env.NEXT_PUBLIC_MAIN_DOMAIN || 'qrmaster.net';
const brandedBaseUrl = userSubdomain
? `https://${userSubdomain}.${mainDomain}`
: baseUrl;
// Get the QR URL based on type
let qrUrl = '';
@@ -73,30 +65,59 @@ END:VCARD`;
qrUrl = qr.content.qrContent;
} else {
// Last resort fallback
qrUrl = `${brandedBaseUrl}/r/${qr.slug}`;
qrUrl = `${baseUrl}/r/${qr.slug}`;
}
console.log(`STATIC QR [${qr.title}]: ${qrUrl}`);
} else {
// DYNAMIC QR codes use branded URL for white label
qrUrl = `${brandedBaseUrl}/r/${qr.slug}`;
// DYNAMIC QR codes always use redirect for tracking
qrUrl = `${baseUrl}/r/${qr.slug}`;
console.log(`DYNAMIC QR [${qr.title}]: ${qrUrl}`);
}
// Display URL (same as qrUrl for consistency)
const displayUrl = qrUrl;
const downloadQR = async (format: 'png' | 'svg') => {
// Use the tight download wrapper
const container = document.querySelector(`#qr-download-${qr.id}`);
if (!container) return;
const downloadQR = (format: 'png' | 'svg') => {
const svg = document.querySelector(`#qr-${qr.id} svg`);
if (!svg) return;
// Dynamic import of html-to-image
const { toPng } = await import('html-to-image');
if (format === 'svg') {
try {
if (format === 'png') {
const dataUrl = await toPng(container as HTMLElement, {
cacheBust: true,
pixelRatio: 3,
backgroundColor: '#ffffff' // White background for clean export
});
const link = document.createElement('a');
link.download = `${qr.title.replace(/\s+/g, '-').toLowerCase()}.png`;
link.href = dataUrl;
link.click();
} else {
// For SVG, if no frame, export just the QR code SVG for vector quality
// If frame exists, use toPng as fallback since HTML-to-SVG is complex
if (qr.style?.frameType && qr.style.frameType !== 'none') {
// Frame exists - use PNG for full capture
const dataUrl = await toPng(container as HTMLElement, {
cacheBust: true,
pixelRatio: 3,
backgroundColor: '#ffffff'
});
const link = document.createElement('a');
link.download = `${qr.title.replace(/\s+/g, '-').toLowerCase()}.png`;
link.href = dataUrl;
link.click();
} else {
// No frame - export clean SVG from the svg wrapper
const svgContainer = document.querySelector(`#qr-svg-${qr.id}`);
const svg = svgContainer?.querySelector('svg');
if (svg) {
let svgData = new XMLSerializer().serializeToString(svg);
// If rounded corners, wrap in a clipped SVG
if (qr.style?.cornerStyle === 'rounded') {
const width = svg.getAttribute('width') || '96';
const height = svg.getAttribute('height') || '96';
const borderRadius = 10; // Smaller radius for dashboard
const borderRadius = 10;
svgData = `<svg xmlns="http://www.w3.org/2000/svg" width="${width}" height="${height}" viewBox="0 0 ${width} ${height}">
<defs>
<clipPath id="rounded-corners-${qr.id}">
@@ -114,58 +135,13 @@ END:VCARD`;
const a = document.createElement('a');
a.href = url;
a.download = `${qr.title.replace(/\s+/g, '-').toLowerCase()}.svg`;
document.body.appendChild(a);
a.click();
document.body.removeChild(a);
URL.revokeObjectURL(url);
} else {
// Convert SVG to PNG
const canvas = document.createElement('canvas');
const ctx = canvas.getContext('2d');
if (!ctx) return;
const img = new Image();
const svgData = new XMLSerializer().serializeToString(svg);
const blob = new Blob([svgData], { type: 'image/svg+xml' });
const url = URL.createObjectURL(blob);
img.onload = () => {
canvas.width = 300;
canvas.height = 300;
// Apply rounded corners if needed
if (qr.style?.cornerStyle === 'rounded') {
const borderRadius = 30; // Scale up for 300px canvas
ctx.beginPath();
ctx.moveTo(borderRadius, 0);
ctx.lineTo(300 - borderRadius, 0);
ctx.quadraticCurveTo(300, 0, 300, borderRadius);
ctx.lineTo(300, 300 - borderRadius);
ctx.quadraticCurveTo(300, 300, 300 - borderRadius, 300);
ctx.lineTo(borderRadius, 300);
ctx.quadraticCurveTo(0, 300, 0, 300 - borderRadius);
ctx.lineTo(0, borderRadius);
ctx.quadraticCurveTo(0, 0, borderRadius, 0);
ctx.closePath();
ctx.clip();
}
ctx.drawImage(img, 0, 0, 300, 300);
canvas.toBlob((blob) => {
if (blob) {
const url = URL.createObjectURL(blob);
const a = document.createElement('a');
a.href = url;
a.download = `${qr.title.replace(/\s+/g, '-').toLowerCase()}.png`;
document.body.appendChild(a);
a.click();
document.body.removeChild(a);
URL.revokeObjectURL(url);
}
});
URL.revokeObjectURL(url);
};
img.src = url;
}
}
} catch (err) {
console.error('Download failed:', err);
}
};
@@ -192,6 +168,7 @@ END:VCARD`;
</button>
}
>
<DropdownItem onClick={() => window.location.href = `/qr/${qr.id}`}>View Details</DropdownItem>
<DropdownItem onClick={() => downloadQR('png')}>Download PNG</DropdownItem>
<DropdownItem onClick={() => downloadQR('svg')}>Download SVG</DropdownItem>
{qr.type === 'DYNAMIC' && (
@@ -203,19 +180,50 @@ END:VCARD`;
</Dropdown>
</div>
<div id={`qr-${qr.id}`} className="flex items-center justify-center bg-gray-50 rounded-lg p-4 mb-3">
<div className={qr.style?.cornerStyle === 'rounded' ? 'rounded-lg overflow-hidden' : ''}>
<div className="flex flex-col items-center justify-center bg-gray-50 rounded-lg p-4 mb-3">
{/* Download wrapper - tightly wraps content */}
<div id={`qr-download-${qr.id}`} className="inline-flex flex-col items-center bg-white p-4 rounded-xl">
{/* Frame Label */}
{qr.style?.frameType && qr.style.frameType !== 'none' && (
<div
className="mb-3 px-4 py-1.5 rounded-full font-bold text-xs tracking-widest uppercase shadow-sm text-white"
style={{ backgroundColor: qr.style?.foregroundColor || '#000000' }}
>
{qr.style.frameType === 'scanme' ? 'Scan Me' :
qr.style.frameType === 'website' ? 'Website' :
qr.style.frameType === 'visit' ? 'Visit' :
qr.style.frameType === 'callme' ? 'Call Me' :
qr.style.frameType === 'call' ? 'Call' :
qr.style.frameType === 'findus' ? 'Find Us' :
qr.style.frameType === 'navigate' ? 'Navigate' :
qr.style.frameType === 'contact' ? 'Contact' :
qr.style.frameType === 'save' ? 'Save' :
qr.style.frameType === 'textme' ? 'Text Me' :
qr.style.frameType === 'message' ? 'Message' :
qr.style.frameType === 'chatme' ? 'Chat Me' :
qr.style.frameType === 'whatsapp' ? 'WhatsApp' :
qr.style.frameType === 'read' ? 'Read' :
qr.style.frameType === 'info' ? 'Info' :
qr.style.frameType.charAt(0).toUpperCase() + qr.style.frameType.slice(1)}
</div>
)}
<div id={`qr-svg-${qr.id}`} className={qr.style?.cornerStyle === 'rounded' ? 'rounded-lg overflow-hidden' : ''}>
<QRCodeSVG
key={qrUrl}
value={qrUrl}
size={96}
fgColor={qr.style?.foregroundColor || '#000000'}
bgColor={qr.style?.backgroundColor || '#FFFFFF'}
level={qr.style?.imageSettings ? 'H' : 'M'}
imageSettings={qr.style?.imageSettings}
level="H"
imageSettings={qr.style?.imageSettings ? {
src: qr.style.imageSettings.src,
height: qr.style.imageSettings.height * (96 / 200), // Scale logo for smaller QR
width: qr.style.imageSettings.width * (96 / 200),
excavate: qr.style.imageSettings.excavate,
} : undefined}
/>
</div>
</div>
</div>
<div className="space-y-2 text-sm">
<div className="flex items-center justify-between">
@@ -228,11 +236,6 @@ END:VCARD`;
<span className="text-gray-900">{qr.scans || 0}</span>
</div>
)}
{qr.type === 'DYNAMIC' && (
<div className="text-xs text-gray-400 break-all bg-gray-50 p-1 rounded border border-gray-100 mt-2">
{qrUrl}
</div>
)}
<div className="flex items-center justify-between">
<span className="text-gray-500">Created:</span>
<span className="text-gray-900">{formatDate(qr.createdAt)}</span>
@@ -240,10 +243,19 @@ END:VCARD`;
{qr.type === 'DYNAMIC' && (
<div className="pt-2 border-t">
<p className="text-xs text-gray-500">
📊 Dynamic QR: Tracks scans via {displayUrl}
📊 Dynamic QR: Tracks scans via {baseUrl}/r/{qr.slug}
</p>
</div>
)}
{/* Feedback Button - only for FEEDBACK type */}
{qr.contentType === 'FEEDBACK' && (
<button
onClick={() => window.location.href = `/qr/${qr.id}/feedback`}
className="w-full mt-3 py-2 px-3 bg-amber-50 hover:bg-amber-100 text-amber-700 rounded-lg text-sm font-medium flex items-center justify-center gap-2 transition-colors"
>
View Customer Feedback
</button>
)}
</div>
</CardContent>
</Card>

View File

@@ -3,6 +3,7 @@
import React, { useState } from 'react';
import { Sparkles, Brain, TrendingUp, MessageSquare, Palette, ArrowRight, Mail, CheckCircle2, Lock } from 'lucide-react';
import Link from 'next/link';
import { motion } from 'framer-motion';
const AIComingSoonBanner = () => {
const [email, setEmail] = useState('');
@@ -83,7 +84,7 @@ const AIComingSoonBanner = () => {
];
return (
<section className="relative overflow-hidden py-20 px-4 sm:px-6 lg:px-8 bg-gradient-to-br from-blue-50 via-white to-purple-50">
<section className="relative overflow-hidden pt-12 pb-20 px-4 sm:px-6 lg:px-8 bg-gradient-to-br from-blue-50 via-white to-purple-50">
{/* Animated Background Orbs (matching Hero) */}
<div className="absolute inset-0 overflow-hidden pointer-events-none">
<div className="absolute top-0 left-1/4 w-96 h-96 bg-blue-400/20 rounded-full blur-3xl animate-blob" />
@@ -93,8 +94,15 @@ const AIComingSoonBanner = () => {
<div className="max-w-6xl mx-auto relative z-10">
{/* Header */}
<div className="text-center mb-12">
<div className="inline-flex items-center gap-2 px-3 py-1.5 rounded-full bg-blue-100 mb-4">
{/* Header */}
<motion.div
initial={{ opacity: 0, scale: 0.95 }}
whileInView={{ opacity: 1, scale: 1 }}
viewport={{ once: true }}
transition={{ duration: 0.5 }}
className="text-center mb-12"
>
<div className="inline-flex items-center gap-2 px-3 py-1.5 rounded-full bg-blue-100 mb-4 animate-pulse">
<Sparkles className="w-4 h-4 text-blue-600" />
<span className="text-sm font-medium text-blue-700">
Coming Soon
@@ -111,14 +119,18 @@ const AIComingSoonBanner = () => {
<p className="text-gray-600 text-lg max-w-2xl mx-auto">
Revolutionary AI features to transform how you create, manage, and optimize QR codes
</p>
</div>
</motion.div>
{/* Features Grid */}
<div className="grid grid-cols-1 md:grid-cols-2 lg:grid-cols-4 gap-6 mb-12">
{features.map((feature, index) => (
<div
<motion.div
key={index}
className="bg-white/80 backdrop-blur rounded-xl p-6 border border-gray-100 hover:shadow-lg transition-all"
initial={{ opacity: 0, y: 20 }}
whileInView={{ opacity: 1, y: 0 }}
viewport={{ once: true }}
transition={{ duration: 0.5, delay: index * 0.1 }}
className="bg-white/80 backdrop-blur rounded-xl p-6 border border-gray-100 hover:shadow-lg transition-all hover:scale-105"
>
<div className="w-12 h-12 bg-gradient-to-br from-blue-100 to-purple-100 rounded-lg flex items-center justify-center mb-4">
<feature.icon className="w-6 h-6 text-blue-600" />
@@ -136,12 +148,18 @@ const AIComingSoonBanner = () => {
</li>
))}
</ul>
</div>
</motion.div>
))}
</div>
{/* Email Capture */}
<div className="max-w-2xl mx-auto bg-gradient-to-br from-blue-50 to-purple-50 rounded-2xl p-8 border border-gray-100">
<motion.div
initial={{ opacity: 0, y: 20 }}
whileInView={{ opacity: 1, y: 0 }}
viewport={{ once: true }}
transition={{ duration: 0.5, delay: 0.4 }}
className="max-w-2xl mx-auto bg-gradient-to-br from-blue-50 to-purple-50 rounded-2xl p-8 border border-gray-100"
>
{!submitted ? (
<>
<form onSubmit={handleSubmit} className="flex flex-col sm:flex-row gap-3 mb-3">
@@ -163,12 +181,12 @@ const AIComingSoonBanner = () => {
<button
type="submit"
disabled={loading}
className="px-6 py-3 bg-gradient-to-r from-blue-600 to-purple-600 hover:from-blue-700 hover:to-purple-700 text-white font-semibold rounded-xl transition-all disabled:opacity-50 whitespace-nowrap flex items-center justify-center gap-2"
className="px-6 py-3 bg-gradient-to-r from-blue-600 to-purple-600 hover:from-blue-700 hover:to-purple-700 text-white font-semibold rounded-xl transition-all disabled:opacity-50 whitespace-nowrap flex items-center justify-center gap-2 group"
>
{loading ? 'Subscribing...' : (
<>
Notify Me
<ArrowRight className="w-4 h-4" />
<ArrowRight className="w-4 h-4 group-hover:translate-x-1 transition-transform" />
</>
)}
</button>
@@ -188,8 +206,9 @@ const AIComingSoonBanner = () => {
</span>
</div>
)}
</motion.div>
</div>
</div>
<div className="absolute bottom-0 left-0 right-0 h-24 bg-gradient-to-b from-transparent to-white pointer-events-none" />
</section>
);
};

View File

@@ -1,6 +1,7 @@
'use client';
import React, { useState } from 'react';
import { motion, AnimatePresence } from 'framer-motion';
import { Card } from '@/components/ui/Card';
interface FAQProps {
@@ -21,22 +22,35 @@ export const FAQ: React.FC<FAQProps> = ({ t }) => {
return (
<section id="faq" className="py-16 bg-gray-50">
<div className="container mx-auto px-4 sm:px-6 lg:px-8 max-w-7xl">
<div className="text-center mb-12">
<motion.div
initial={{ opacity: 0, y: 20 }}
whileInView={{ opacity: 1, y: 0 }}
viewport={{ once: true }}
transition={{ duration: 0.5 }}
className="text-center mb-12"
>
<h2 className="text-3xl lg:text-4xl font-bold text-gray-900 mb-4">
{t.faq.title}
</h2>
</div>
</motion.div>
<div className="max-w-3xl mx-auto space-y-4">
{questions.map((key, index) => (
<Card key={key} className="cursor-pointer" onClick={() => setOpenIndex(openIndex === index ? null : index)}>
<motion.div
key={key}
initial={{ opacity: 0, x: -20 }}
whileInView={{ opacity: 1, x: 0 }}
viewport={{ once: true }}
transition={{ duration: 0.5, delay: index * 0.1 }}
>
<Card className="cursor-pointer border-gray-200 hover:border-gray-300 transition-colors" onClick={() => setOpenIndex(openIndex === index ? null : index)}>
<div className="p-6">
<div className="flex items-center justify-between">
<h3 className="text-lg font-semibold text-gray-900">
{t.faq.questions[key].question}
</h3>
<svg
className={`w-5 h-5 text-gray-500 transition-transform ${openIndex === index ? 'rotate-180' : ''}`}
className={`w-5 h-5 text-gray-500 transition-transform duration-300 ${openIndex === index ? 'rotate-180' : ''}`}
fill="none"
stroke="currentColor"
viewBox="0 0 24 24"
@@ -46,13 +60,24 @@ export const FAQ: React.FC<FAQProps> = ({ t }) => {
</svg>
</div>
<AnimatePresence>
{openIndex === index && (
<div className="mt-4 text-gray-600">
<motion.div
initial={{ height: 0, opacity: 0, marginTop: 0 }}
animate={{ height: 'auto', opacity: 1, marginTop: 16 }}
exit={{ height: 0, opacity: 0, marginTop: 0 }}
transition={{ duration: 0.3 }}
className="overflow-hidden"
>
<div className="text-gray-600">
{t.faq.questions[key].answer}
</div>
</motion.div>
)}
</AnimatePresence>
</div>
</Card>
</motion.div>
))}
</div>

View File

@@ -1,6 +1,7 @@
'use client';
import React from 'react';
import { motion } from 'framer-motion';
import { Card, CardHeader, CardTitle, CardContent } from '@/components/ui/Card';
interface FeaturesProps {
@@ -41,15 +42,28 @@ export const Features: React.FC<FeaturesProps> = ({ t }) => {
return (
<section className="py-16 bg-gray-50">
<div className="container mx-auto px-4 sm:px-6 lg:px-8 max-w-7xl">
<div className="text-center mb-12">
<motion.div
initial={{ opacity: 0, y: 20 }}
whileInView={{ opacity: 1, y: 0 }}
viewport={{ once: true }}
transition={{ duration: 0.5 }}
className="text-center mb-12"
>
<h2 className="text-3xl lg:text-4xl font-bold text-gray-900 mb-4">
{t.features.title}
</h2>
</div>
</motion.div>
<div className="grid md:grid-cols-2 lg:grid-cols-3 gap-6 max-w-6xl mx-auto">
{features.map((feature) => (
<Card key={feature.key} hover>
{features.map((feature, index) => (
<motion.div
key={feature.key}
initial={{ opacity: 0, y: 20 }}
whileInView={{ opacity: 1, y: 0 }}
viewport={{ once: true }}
transition={{ duration: 0.5, delay: index * 0.1 }}
>
<Card hover className="h-full border-gray-100 hover:border-primary-100 hover:shadow-lg transition-all">
<CardHeader>
<div className={`w-12 h-12 rounded-lg ${feature.color} flex items-center justify-center mb-4`}>
{feature.icon}
@@ -62,6 +76,7 @@ export const Features: React.FC<FeaturesProps> = ({ t }) => {
</p>
</CardContent>
</Card>
</motion.div>
))}
</div>
</div>

View File

@@ -0,0 +1,262 @@
'use client';
import React from 'react';
import Link from 'next/link';
import { motion, Variants } from 'framer-motion';
import {
Link as LinkIcon,
User,
Mail,
Calendar,
Facebook,
Instagram,
Phone,
MessageSquare,
Type,
Music,
Twitter,
MessageCircle,
Wifi,
Youtube,
Bitcoin,
MapPin,
CreditCard,
Video,
Users
} from 'lucide-react';
const TOOLS = [
{
icon: LinkIcon,
name: 'URL',
description: 'Open any website',
href: '/tools/url-qr-code',
color: 'text-blue-500',
bg: 'bg-blue-50'
},
{
icon: User,
name: 'vCard',
description: 'Share contact details',
href: '/tools/vcard-qr-code',
color: 'text-rose-500',
bg: 'bg-rose-50'
},
{
icon: Type,
name: 'Text',
description: 'Display plain text',
href: '/tools/text-qr-code',
color: 'text-slate-500',
bg: 'bg-slate-50'
},
{
icon: Mail,
name: 'Email',
description: 'Send an email',
href: '/tools/email-qr-code',
color: 'text-red-500',
bg: 'bg-red-50'
},
{
icon: MessageSquare,
name: 'SMS',
description: 'Send a text message',
href: '/tools/sms-qr-code',
color: 'text-green-500',
bg: 'bg-green-50'
},
{
icon: Wifi,
name: 'WiFi',
description: 'Connect to WiFi',
href: '/tools/wifi-qr-code',
color: 'text-indigo-500',
bg: 'bg-indigo-50'
},
{
icon: Bitcoin,
name: 'Crypto',
description: 'Receive payments',
href: '/tools/crypto-qr-code',
color: 'text-orange-500',
bg: 'bg-orange-50'
},
{
icon: Calendar,
name: 'Event',
description: 'Save calendar event',
href: '/tools/event-qr-code',
color: 'text-violet-500',
bg: 'bg-violet-50'
},
{
icon: Facebook,
name: 'Facebook',
description: 'Open Facebook page',
href: '/tools/facebook-qr-code',
color: 'text-blue-600',
bg: 'bg-blue-50'
},
{
icon: Instagram,
name: 'Instagram',
description: 'Open Instagram profile',
href: '/tools/instagram-qr-code',
color: 'text-pink-500',
bg: 'bg-pink-50'
},
{
icon: Twitter,
name: 'Twitter',
description: 'Open Twitter profile',
href: '/tools/twitter-qr-code',
color: 'text-sky-500',
bg: 'bg-sky-50'
},
{
icon: Youtube,
name: 'YouTube',
description: 'Open YouTube video',
href: '/tools/youtube-qr-code',
color: 'text-red-600',
bg: 'bg-red-50'
},
{
icon: MessageCircle,
name: 'WhatsApp',
description: 'Send WhatsApp message',
href: '/tools/whatsapp-qr-code',
color: 'text-green-600',
bg: 'bg-green-50'
},
{
icon: Music,
name: 'TikTok',
description: 'Open TikTok profile',
href: '/tools/tiktok-qr-code',
color: 'text-pink-600',
bg: 'bg-pink-50'
},
{
icon: MapPin,
name: 'Location',
description: 'Share GPS coordinates',
href: '/tools/geolocation-qr-code',
color: 'text-emerald-500',
bg: 'bg-emerald-50'
},
{
icon: Phone,
name: 'Phone',
description: 'Call phone number',
href: '/tools/phone-qr-code',
color: 'text-blue-400',
bg: 'bg-blue-50'
},
{
icon: CreditCard,
name: 'PayPal',
description: 'Receive PayPal payments',
href: '/tools/paypal-qr-code',
color: 'text-blue-700',
bg: 'bg-blue-50'
},
{
icon: Video,
name: 'Zoom',
description: 'Join Zoom meeting',
href: '/tools/zoom-qr-code',
color: 'text-sky-500',
bg: 'bg-sky-50'
},
{
icon: Users,
name: 'Teams',
description: 'Join Teams meeting',
href: '/tools/teams-qr-code',
color: 'text-violet-500',
bg: 'bg-violet-50'
}
];
// Animation variants
const containerVariants: Variants = {
hidden: { opacity: 0 },
visible: {
opacity: 1,
transition: {
staggerChildren: 0.05
}
}
};
const itemVariants: Variants = {
hidden: { opacity: 0, y: 20 },
visible: {
opacity: 1,
y: 0,
transition: {
duration: 0.4
}
}
};
export function FreeToolsGrid() {
return (
<section id="tools" className="py-24 bg-slate-50/50 border-t border-slate-100">
<div className="container mx-auto px-4 sm:px-6 lg:px-8 max-w-7xl">
<motion.div
initial={{ opacity: 0, y: 20 }}
whileInView={{ opacity: 1, y: 0 }}
viewport={{ once: true, margin: "-100px" }}
transition={{ duration: 0.5 }}
className="text-center mb-16"
>
<div className="flex flex-col md:flex-row items-center justify-center gap-3 mb-4">
<h2 className="text-3xl lg:text-4xl font-bold text-slate-900">
More Free QR Code Tools
</h2>
<div className="bg-gradient-to-r from-emerald-500 to-green-500 text-white px-3 py-1 rounded-full text-xs md:text-sm font-semibold shadow-lg shadow-emerald-500/20 flex items-center gap-2">
<span className="relative flex h-2 w-2">
<span className="animate-ping absolute inline-flex h-full w-full rounded-full bg-white opacity-75"></span>
<span className="relative inline-flex rounded-full h-2 w-2 bg-white"></span>
</span>
Free Forever
</div>
</div>
<p className="text-lg text-slate-600 max-w-2xl mx-auto">
Create specialized QR codes for every need. Completely free and no signup required.
</p>
</motion.div>
<motion.div
variants={containerVariants}
initial="hidden"
whileInView="visible"
viewport={{ once: true, margin: "-50px" }}
className="grid grid-cols-2 md:grid-cols-4 lg:grid-cols-4 gap-4 md:gap-6"
>
{TOOLS.map((tool) => (
<motion.div key={tool.name} variants={itemVariants}>
<Link
href={tool.href}
className="group flex flex-col items-center p-5 md:p-6 rounded-2xl border border-slate-200/80 bg-white hover:border-primary-200 hover:shadow-xl hover:shadow-primary-500/10 transition-all duration-300"
>
<div className={`w-12 h-12 md:w-14 md:h-14 rounded-xl ${tool.bg} flex items-center justify-center mb-3 md:mb-4 group-hover:scale-110 transition-transform duration-300`}>
<tool.icon className={`w-6 h-6 md:w-7 md:h-7 ${tool.color}`} />
</div>
<h3 className="text-base md:text-lg font-semibold text-slate-900 mb-0.5">
{tool.name}
</h3>
<p className="text-xs md:text-sm text-slate-500 text-center">
{tool.description}
</p>
</Link>
</motion.div>
))}
</motion.div>
</div>
</section>
);
}

View File

@@ -5,18 +5,93 @@ import Link from 'next/link';
import { Button } from '@/components/ui/Button';
import { Badge } from '@/components/ui/Badge';
import { Card } from '@/components/ui/Card';
import { motion } from 'framer-motion';
import { Globe, User, MapPin, Phone, CheckCircle2, ArrowRight, FileText, Ticket, Smartphone, Star } from 'lucide-react';
import { useState, useEffect } from 'react';
// Sub-component for the flipping effect
const FlippingCard = ({ front, back, delay }: { front: any, back: any, delay: number }) => {
const [isFlipped, setIsFlipped] = useState(false);
useEffect(() => {
// Initial delay
const initialTimeout = setTimeout(() => {
setIsFlipped(true); // First flip
// Setup interval for subsequent flips
const interval = setInterval(() => {
setIsFlipped(prev => !prev);
}, 8000); // Toggle every 8 seconds to prevent overlap (4 cards * 2s gap)
return () => clearInterval(interval);
}, delay * 1000);
return () => clearTimeout(initialTimeout);
}, [delay]);
return (
<div className="relative h-32 w-full perspective-[1000px] group cursor-pointer">
<motion.div
animate={{ rotateY: isFlipped ? 180 : 0 }}
transition={{ duration: 0.6, type: "spring", stiffness: 260, damping: 20 }}
className="relative w-full h-full preserve-3d"
style={{ transformStyle: 'preserve-3d' }}
>
{/* Front Face */}
<div
className="absolute inset-0 backface-hidden"
style={{ backfaceVisibility: 'hidden', WebkitBackfaceVisibility: 'hidden' }}
>
<Card className="w-full h-full backdrop-blur-xl bg-white/70 border-white/50 shadow-xl shadow-gray-200/50 p-4 flex flex-col items-center justify-center hover:scale-105 transition-all duration-300">
<div className={`w-10 h-10 mb-3 rounded-xl ${front.color} flex items-center justify-center`}>
<front.icon className="w-5 h-5" />
</div>
<p className="font-semibold text-gray-800 text-sm">{front.title}</p>
</Card>
</div>
{/* Back Face */}
<div
className="absolute inset-0 backface-hidden"
style={{
backfaceVisibility: 'hidden',
WebkitBackfaceVisibility: 'hidden',
transform: 'rotateY(180deg)'
}}
>
<Card className="w-full h-full backdrop-blur-xl bg-white/80 border-white/60 shadow-xl shadow-blue-200/50 p-4 flex flex-col items-center justify-center hover:scale-105 transition-all duration-300">
<div className={`w-10 h-10 mb-3 rounded-xl ${back.color} flex items-center justify-center`}>
<back.icon className="w-5 h-5" />
</div>
<p className="font-semibold text-gray-900 text-sm">{back.title}</p>
</Card>
</div>
</motion.div>
</div>
);
};
interface HeroProps {
t: any; // i18n translation function
}
export const Hero: React.FC<HeroProps> = ({ t }) => {
const templateCards = [
{ title: 'URL/Website', color: 'bg-blue-100', icon: '🌐' },
{ title: 'Contact Card', color: 'bg-purple-100', icon: '👤' },
{ title: 'Location', color: 'bg-green-100', icon: '📍' },
{ title: 'Phone Number', color: 'bg-pink-100', icon: '📞' },
];
const containerjs = {
hidden: { opacity: 0 },
show: {
opacity: 1,
transition: {
staggerChildren: 0.1
}
}
};
const itemjs = {
hidden: { opacity: 0, y: 20 },
show: { opacity: 1, y: 0 }
};
return (
<section className="relative overflow-hidden bg-gradient-to-br from-blue-50 via-white to-purple-50 pt-12 pb-20">
@@ -43,57 +118,86 @@ export const Hero: React.FC<HeroProps> = ({ t }) => {
<span>{t.hero.badge}</span>
</Badge>
<div className="space-y-6">
<motion.div
initial={{ opacity: 0, y: 20 }}
animate={{ opacity: 1, y: 0 }}
transition={{ duration: 0.5 }}
className="space-y-6"
>
<h1 className="text-5xl lg:text-6xl font-bold text-gray-900 leading-tight">
{t.hero.title}
</h1>
<p className="text-xl text-gray-600 leading-relaxed">
<p className="text-xl text-gray-600 leading-relaxed max-w-2xl">
{t.hero.subtitle}
</p>
<div className="space-y-3">
<div className="space-y-3 pt-2">
{t.hero.features.map((feature: string, index: number) => (
<div key={index} className="flex items-center space-x-3">
<div className="flex-shrink-0 w-5 h-5 bg-success-500 rounded-full flex items-center justify-center">
<svg className="w-3 h-3 text-white" fill="currentColor" viewBox="0 0 20 20">
<path fillRule="evenodd" d="M16.707 5.293a1 1 0 010 1.414l-8 8a1 1 0 01-1.414 0l-4-4a1 1 0 011.414-1.414L8 12.586l7.293-7.293a1 1 0 011.414 0z" clipRule="evenodd" />
</svg>
</div>
<span className="text-gray-700">{feature}</span>
<motion.div
key={index}
initial={{ opacity: 0, x: -20 }}
animate={{ opacity: 1, x: 0 }}
transition={{ delay: 0.2 + (index * 0.1) }}
className="flex items-center space-x-3"
>
<div className="flex-shrink-0 w-6 h-6 bg-emerald-100 rounded-full flex items-center justify-center">
<CheckCircle2 className="w-4 h-4 text-emerald-600" />
</div>
<span className="text-gray-700 font-medium">{feature}</span>
</motion.div>
))}
</div>
</motion.div>
<div className="flex flex-col sm:flex-row gap-4">
<motion.div
initial={{ opacity: 0, y: 20 }}
animate={{ opacity: 1, y: 0 }}
transition={{ delay: 0.5 }}
className="flex flex-col sm:flex-row gap-4 pt-4"
>
<Link href="/signup">
<Button size="lg" className="text-lg px-8 py-4 w-full sm:w-auto">
<Button size="lg" className="text-lg px-8 py-6 w-full sm:w-auto shadow-lg shadow-blue-500/25 hover:shadow-blue-500/40 transition-all duration-300">
{t.hero.cta_primary}
</Button>
</Link>
<Link href="/#pricing">
<Button variant="outline" size="lg" className="text-lg px-8 py-4 w-full sm:w-auto">
<Button variant="outline" size="lg" className="text-lg px-8 py-6 w-full sm:w-auto backdrop-blur-sm bg-white/50 border-gray-200 hover:bg-white/80 transition-all duration-300">
{t.hero.cta_secondary}
</Button>
</Link>
</div>
</div>
</motion.div>
</div>
{/* Right Preview Widget */}
<div className="relative">
<div className="relative perspective-[1000px]">
<div className="grid grid-cols-2 gap-4">
{templateCards.map((card, index) => (
<Card key={index} className={`${card.color} border-0 p-6 text-center hover:scale-105 transition-transform`}>
<div className="text-3xl mb-2">{card.icon}</div>
<p className="font-semibold text-gray-800">{card.title}</p>
</Card>
{[
{
front: { title: 'URL/Website', color: 'bg-blue-500/10 text-blue-600', icon: Globe },
back: { title: 'PDF / Menu', color: 'bg-orange-500/10 text-orange-600', icon: FileText },
delay: 3 // Starts at 3s
},
{
front: { title: 'Contact Card', color: 'bg-purple-500/10 text-purple-600', icon: User },
back: { title: 'Coupon / Deals', color: 'bg-red-500/10 text-red-600', icon: Ticket },
delay: 5 // +2s
},
{
front: { title: 'Location', color: 'bg-green-500/10 text-green-600', icon: MapPin },
back: { title: 'App Store', color: 'bg-sky-500/10 text-sky-600', icon: Smartphone },
delay: 7 // +2s
},
{
front: { title: 'Phone Number', color: 'bg-pink-500/10 text-pink-600', icon: Phone },
back: { title: 'Feedback', color: 'bg-yellow-500/10 text-yellow-600', icon: Star },
delay: 9 // +2s
},
].map((card, index) => (
<FlippingCard key={index} {...card} />
))}
</div>
{/* Floating Badge */}
<div className="absolute -top-4 -right-4 bg-success-500 text-white px-4 py-2 rounded-full text-sm font-semibold shadow-lg">
{t.hero.engagement_badge}
</div>
</div>
</div>
@@ -101,6 +205,6 @@ export const Hero: React.FC<HeroProps> = ({ t }) => {
{/* Smooth Gradient Fade Transition */}
<div className="absolute bottom-0 left-0 w-full h-32 bg-gradient-to-b from-transparent to-gray-50 pointer-events-none" />
</section>
</section >
);
};

View File

@@ -12,6 +12,7 @@ import { Pricing } from '@/components/marketing/Pricing';
import { FAQ } from '@/components/marketing/FAQ';
import { Button } from '@/components/ui/Button';
import { ScrollToTop } from '@/components/ui/ScrollToTop';
import { FreeToolsGrid } from '@/components/marketing/FreeToolsGrid';
import en from '@/i18n/en.json';
export default function HomePageClient() {
@@ -30,8 +31,15 @@ export default function HomePageClient() {
return (
<>
<Hero t={t} />
<AIComingSoonBanner />
{/* Main Interaction: Generator */}
<InstantGenerator t={t} />
<AIComingSoonBanner />
{/* Free Tools Grid */}
<FreeToolsGrid />
<StaticVsDynamic t={t} />
<Features t={t} />

View File

@@ -2,6 +2,7 @@
import React, { useState } from 'react';
import { QRCodeSVG } from 'qrcode.react';
import { motion } from 'framer-motion';
import { Card } from '@/components/ui/Card';
import { Input } from '@/components/ui/Input';
import { Button } from '@/components/ui/Button';
@@ -73,22 +74,39 @@ export const InstantGenerator: React.FC<InstantGeneratorProps> = ({ t }) => {
};
return (
<section className="py-16 bg-gray-50">
<section className="pt-16 pb-32 bg-gray-50 border-t border-gray-100 relative">
<div
className="absolute bottom-0 left-0 right-0 h-32 bg-gradient-to-r from-blue-50 to-white pointer-events-none"
style={{ maskImage: 'linear-gradient(to bottom, transparent, black)', WebkitMaskImage: 'linear-gradient(to bottom, transparent, black)' }}
/>
<div className="container mx-auto px-4 sm:px-6 lg:px-8 max-w-7xl">
<div className="text-center mb-12">
<motion.div
initial={{ opacity: 0, y: 20 }}
whileInView={{ opacity: 1, y: 0 }}
viewport={{ once: true }}
transition={{ duration: 0.5 }}
className="text-center mb-12"
>
<h2 className="text-3xl lg:text-4xl font-bold text-gray-900 mb-4">
{t.generator.title}
</h2>
</div>
</motion.div>
<div className="grid lg:grid-cols-2 gap-12 max-w-6xl mx-auto">
{/* Left Form */}
<Card className="space-y-6">
<motion.div
initial={{ opacity: 0, x: -20 }}
whileInView={{ opacity: 1, x: 0 }}
viewport={{ once: true }}
transition={{ duration: 0.5, delay: 0.2 }}
>
<Card className="space-y-6 shadow-xl shadow-gray-200/50 border-gray-100">
<Input
label="URL"
value={url}
onChange={(e) => setUrl(e.target.value)}
placeholder={t.generator.url_placeholder}
className="transition-all focus:ring-2 focus:ring-primary-500/20"
/>
<div className="grid grid-cols-2 gap-4">
@@ -102,7 +120,7 @@ export const InstantGenerator: React.FC<InstantGeneratorProps> = ({ t }) => {
type="color"
value={foregroundColor}
onChange={(e) => setForegroundColor(e.target.value)}
className="w-12 h-10 rounded border border-gray-300"
className="w-14 h-12 rounded border border-gray-300 cursor-pointer"
aria-label="Foreground color picker"
/>
<Input
@@ -125,7 +143,7 @@ export const InstantGenerator: React.FC<InstantGeneratorProps> = ({ t }) => {
type="color"
value={backgroundColor}
onChange={(e) => setBackgroundColor(e.target.value)}
className="w-12 h-10 rounded border border-gray-300"
className="w-14 h-12 rounded border border-gray-300 cursor-pointer"
aria-label="Background color picker"
/>
<Input
@@ -166,7 +184,7 @@ export const InstantGenerator: React.FC<InstantGeneratorProps> = ({ t }) => {
max="400"
value={size}
onChange={(e) => setSize(Number(e.target.value))}
className="w-full"
className="w-full accent-primary-600"
aria-label={`QR code size: ${size} pixels`}
/>
<div className="text-sm text-gray-500 text-center mt-1" aria-hidden="true">{size}px</div>
@@ -183,29 +201,60 @@ export const InstantGenerator: React.FC<InstantGeneratorProps> = ({ t }) => {
</div>
<div className="flex space-x-3">
<Button variant="outline" className="flex-1" onClick={() => downloadQR('svg')}>
<Button variant="outline" className="flex-1 hover:bg-gray-50" onClick={() => downloadQR('svg')}>
{t.generator.download_svg}
</Button>
<Button variant="outline" className="flex-1" onClick={() => downloadQR('png')}>
<Button variant="outline" className="flex-1 hover:bg-gray-50" onClick={() => downloadQR('png')}>
{t.generator.download_png}
</Button>
</div>
<Button className="w-full" onClick={() => window.location.href = '/login'}>
<Button className="w-full text-lg py-6 shadow-lg shadow-primary-500/20 hover:shadow-primary-500/40 transition-all" onClick={() => window.location.href = '/login'}>
{t.generator.save_track}
</Button>
</Card>
</motion.div>
{/* Right Preview */}
<div className="flex flex-col items-center justify-center">
<Card className="text-center p-8">
<h3 className="text-lg font-semibold mb-4">{t.generator.live_preview}</h3>
<div id="instant-qr-preview" className="flex justify-center mb-4">
<motion.div
initial={{ opacity: 0, x: 20 }}
whileInView={{ opacity: 1, x: 0 }}
viewport={{ once: true }}
transition={{ duration: 0.5, delay: 0.4 }}
className="flex flex-col items-center justify-center p-8 bg-gradient-to-br from-blue-50/50 to-purple-50/50 rounded-2xl border border-blue-100/50 shadow-lg shadow-blue-500/5 relative overflow-hidden backdrop-blur-sm"
>
{/* Artistic Curved Lines Background */}
<div className="absolute inset-0 opacity-[0.4]">
<svg className="h-full w-full" viewBox="0 0 100 100" preserveAspectRatio="none">
<defs>
<linearGradient id="gradient1" x1="0%" y1="0%" x2="100%" y2="100%">
<stop offset="0%" stopColor="#60a5fa" stopOpacity="0.4" />
<stop offset="100%" stopColor="#c084fc" stopOpacity="0.4" />
</linearGradient>
<linearGradient id="gradient2" x1="100%" y1="0%" x2="0%" y2="100%">
<stop offset="0%" stopColor="#818cf8" stopOpacity="0.4" />
<stop offset="100%" stopColor="#38bdf8" stopOpacity="0.4" />
</linearGradient>
</defs>
<path d="M0 100 Q 25 30 50 70 T 100 0" fill="none" stroke="url(#gradient1)" strokeWidth="0.8" className="opacity-60" />
<path d="M0 50 Q 40 80 70 30 T 100 50" fill="none" stroke="url(#gradient2)" strokeWidth="0.8" className="opacity-60" />
<path d="M0 0 Q 30 60 60 20 T 100 80" fill="none" stroke="url(#gradient1)" strokeWidth="0.6" className="opacity-40" />
</svg>
<div className="absolute inset-0 bg-[url('https://grainy-gradients.vercel.app/noise.svg')] opacity-15 brightness-100 contrast-150 mix-blend-overlay"></div>
</div>
{/* Decorative Orbs */}
<div className="absolute -top-20 -right-20 w-64 h-64 bg-purple-200/30 rounded-full blur-3xl animate-blob"></div>
<div className="absolute -bottom-20 -left-20 w-64 h-64 bg-blue-200/30 rounded-full blur-3xl animate-blob animation-delay-2000"></div>
<div className="text-center w-full relative z-10">
<h3 className="text-xl font-bold mb-8 text-gray-800">{t.generator.live_preview}</h3>
<div id="instant-qr-preview" className="flex justify-center mb-8 transform hover:scale-105 transition-transform duration-300">
{url ? (
<div className={`${cornerStyle === 'rounded' ? 'rounded-lg overflow-hidden' : ''}`}>
<div className={`${cornerStyle === 'rounded' ? 'rounded-lg overflow-hidden' : ''} p-4 bg-white shadow-lg rounded-xl`}>
<QRCodeSVG
value={url}
size={Math.min(size, 200)}
size={size}
fgColor={foregroundColor}
bgColor={backgroundColor}
level="M"
@@ -213,17 +262,19 @@ export const InstantGenerator: React.FC<InstantGeneratorProps> = ({ t }) => {
</div>
) : (
<div
className="bg-gray-200 flex items-center justify-center text-gray-500"
className="bg-gray-100 rounded-xl flex items-center justify-center text-gray-500 animate-pulse"
style={{ width: 200, height: 200 }}
>
Enter URL
</div>
)}
</div>
<div className="text-sm text-gray-600 mb-2">URL</div>
<div className="text-xs text-gray-500">{t.generator.demo_note}</div>
</Card>
<div className="text-sm font-medium text-gray-600 mb-2 bg-gray-50 py-2 px-4 rounded-full inline-block">
{url || 'https://example.com'}
</div>
<div className="text-xs text-gray-400 mt-2">{t.generator.demo_note}</div>
</div>
</motion.div>
</div>
</div>
</section>

View File

@@ -1,6 +1,7 @@
'use client';
import React, { useState } from 'react';
import { motion } from 'framer-motion';
import Link from 'next/link';
import { Card, CardHeader, CardTitle, CardContent } from '@/components/ui/Card';
import { Button } from '@/components/ui/Button';
@@ -32,28 +33,44 @@ export const Pricing: React.FC<PricingProps> = ({ t }) => {
return (
<section id="pricing" className="py-16">
<div className="container mx-auto px-4 sm:px-6 lg:px-8 max-w-7xl">
<div className="text-center mb-12">
<motion.div
initial={{ opacity: 0, y: 20 }}
whileInView={{ opacity: 1, y: 0 }}
viewport={{ once: true }}
transition={{ duration: 0.5 }}
className="text-center mb-12"
>
<h2 className="text-3xl lg:text-4xl font-bold text-gray-900 mb-4">
{t.pricing.title}
</h2>
<p className="text-xl text-gray-600">
{t.pricing.subtitle}
</p>
</div>
</motion.div>
<div className="flex justify-center mb-8">
<BillingToggle value={billingPeriod} onChange={setBillingPeriod} />
</div>
<div className="grid md:grid-cols-3 gap-8 max-w-5xl mx-auto">
{plans.map((plan) => (
<Card
{plans.map((plan, index) => (
<motion.div
key={plan.key}
className={plan.popular ? 'border-primary-500 shadow-xl relative' : ''}
initial={{ opacity: 0, y: 20 }}
whileInView={{ opacity: 1, y: 0 }}
viewport={{ once: true }}
transition={{ duration: 0.5, delay: index * 0.1 }}
className="h-full"
>
<Card
className={`h-full flex flex-col ${plan.popular
? 'border-primary-500 shadow-xl relative scale-105 z-10'
: 'border-gray-200 hover:border-gray-300 hover:shadow-lg transition-all'
}`}
>
{plan.popular && (
<div className="absolute -top-4 left-1/2 transform -translate-x-1/2">
<Badge variant="info" className="px-3 py-1">
<div className="absolute -top-4 left-1/2 transform -translate-x-1/2 w-full text-center">
<Badge variant="info" className="px-4 py-1.5 shadow-sm">
{t.pricing[plan.key].badge}
</Badge>
</div>
@@ -90,8 +107,8 @@ export const Pricing: React.FC<PricingProps> = ({ t }) => {
</div>
</CardHeader>
<CardContent className="space-y-4">
<ul className="space-y-3">
<CardContent className="space-y-8 flex-1 flex flex-col">
<ul className="space-y-3 flex-1">
{t.pricing[plan.key].features.map((feature: string, index: number) => (
<li key={index} className="flex items-start space-x-3">
<svg className="w-5 h-5 text-success-500 flex-shrink-0 mt-0.5" fill="currentColor" viewBox="0 0 20 20">
@@ -102,6 +119,7 @@ export const Pricing: React.FC<PricingProps> = ({ t }) => {
))}
</ul>
<div className="mt-8 pt-8 border-t border-gray-100">
<Link href="/signup">
<Button
variant={plan.popular ? 'primary' : 'outline'}
@@ -111,8 +129,10 @@ export const Pricing: React.FC<PricingProps> = ({ t }) => {
Get Started
</Button>
</Link>
</div>
</CardContent>
</Card>
</motion.div>
))}
</div>
</div>

Some files were not shown because too many files have changed in this diff Show More