Compare commits
2 Commits
e44dc1c6bb
...
feature/mo
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
3c6d75b6bb | ||
|
|
a7180e3b9b |
2
.gitignore
vendored
@@ -36,7 +36,7 @@ yarn-error.log*
|
|||||||
next-env.d.ts
|
next-env.d.ts
|
||||||
|
|
||||||
# prisma
|
# prisma
|
||||||
/prisma/migrations/
|
|
||||||
|
|
||||||
# docker
|
# docker
|
||||||
docker-compose.override.yml
|
docker-compose.override.yml
|
||||||
|
|||||||
@@ -1,87 +0,0 @@
|
|||||||
# Indexing Setup & Usage Guide
|
|
||||||
|
|
||||||
This guide explains how to fast-track your content indexing on **Google** and **Bing/Yandex** using the provided scripts.
|
|
||||||
|
|
||||||
> [!IMPORTANT]
|
|
||||||
> **WAIT UNTIL LIVE:** Do not run these scripts until your new URLs are live and returning a `200 OK` status. If you submit a `404` URL, it may negatively impact your crawling budget or cause errors.
|
|
||||||
|
|
||||||
---
|
|
||||||
|
|
||||||
## 1. Google Indexing API
|
|
||||||
|
|
||||||
The Google Indexing API allows you to notify Google when pages are added or removed. It is faster than waiting for the Googlebot to crawl your sitemap.
|
|
||||||
|
|
||||||
### Prerequisites: `service_account.json`
|
|
||||||
|
|
||||||
To use the script `scripts/trigger-indexing.js`, you need a **Service Account Key** from Google Cloud.
|
|
||||||
|
|
||||||
1. **Go to Google Cloud Console:** [https://console.cloud.google.com/](https://console.cloud.google.com/)
|
|
||||||
2. **Create a Project:** (e.g., "QR Master Indexing").
|
|
||||||
3. **Enable API:** Search for "Web Search Indexing API" and enable it.
|
|
||||||
4. **Create Service Account:**
|
|
||||||
* Go to "IAM & Admin" > "Service Accounts".
|
|
||||||
* Click "Create Service Account".
|
|
||||||
* Name it (e.g., "indexer").
|
|
||||||
* Grant it the "Owner" role (simplest for this) or a custom role with Indexing permissions.
|
|
||||||
5. **Create Key:**
|
|
||||||
* Click on the newly created service account email.
|
|
||||||
* Go to "Keys" tab -> "Add Key" -> "Create new key" -> **JSON**.
|
|
||||||
* This will download a JSON file.
|
|
||||||
6. **Save Key:**
|
|
||||||
* Rename the file to `service_account.json`.
|
|
||||||
* Place it in the **root** of your project (same folder as `package.json`).
|
|
||||||
* **NOTE:** This file is ignored by git for security (`.gitignore`), so you must copy it manually if you switch laptops.
|
|
||||||
7. **Authorize in Search Console:**
|
|
||||||
* Open the JSON file and copy the `client_email` address.
|
|
||||||
* Go to **Google Search Console** property for `qrmaster.net`.
|
|
||||||
* Go to "Settings" > "Users and permissions".
|
|
||||||
* **Add User:** Paste the service account email and give it **"Owner"** permission. (This is required for the API to work).
|
|
||||||
|
|
||||||
### How to Run
|
|
||||||
|
|
||||||
1. **Run the script:**
|
|
||||||
```bash
|
|
||||||
npm run trigger:indexing
|
|
||||||
```
|
|
||||||
*(Or manually: `npx tsx scripts/trigger-indexing.ts`)*
|
|
||||||
|
|
||||||
2. The script will automatically fetch ALL active URLs from the project (including tools and blog posts) and submit them to Google. You should see a "Success" message for each URL.
|
|
||||||
|
|
||||||
---
|
|
||||||
|
|
||||||
## 2. IndexNow (Bing, Yandex, etc.)
|
|
||||||
|
|
||||||
IndexNow is a protocol used by Bing and others. It's much simpler than Google's API.
|
|
||||||
|
|
||||||
### Prerequisites: API Key
|
|
||||||
|
|
||||||
1. **Get Key:** Go to [Bing Webmaster Tools](https://www.bing.com/webmasters) or generate one at [indexnow.org](https://www.indexnow.org/).
|
|
||||||
2. **Verify Setup:**
|
|
||||||
* The key is typically a long random string (e.g., `abc123...`).
|
|
||||||
* Ensure you have a text file named after the key (e.g., `abc123....txt`) containing the key itself inside your `public/` folder so it's accessible at `https://www.qrmaster.net/abc123....txt`.
|
|
||||||
* Alternatively, set the environment variable in your `.env` file:
|
|
||||||
```
|
|
||||||
INDEXNOW_KEY=your_key_here
|
|
||||||
```
|
|
||||||
|
|
||||||
### How to Run
|
|
||||||
|
|
||||||
This script (`scripts/submit-indexnow.ts`) automatically gathers all meaningful URLs from your project (tools, blog posts, main pages) and submits them.
|
|
||||||
|
|
||||||
1. Run the script:
|
|
||||||
```bash
|
|
||||||
npm run submit:indexnow
|
|
||||||
```
|
|
||||||
*(Or manually: `npx tsx scripts/submit-indexnow.ts`)*
|
|
||||||
|
|
||||||
2. It will output which URLs were submitted.
|
|
||||||
|
|
||||||
---
|
|
||||||
|
|
||||||
## Summary Checklist
|
|
||||||
|
|
||||||
- [ ] New page is published and live.
|
|
||||||
- [ ] `service_account.json` is in the project root.
|
|
||||||
- [ ] Service Account email is added as Owner in Google Search Console.
|
|
||||||
- [ ] Run `npm run trigger:indexing` (for Google).
|
|
||||||
- [ ] Run `npm run submit:indexnow` (for Bing/Yandex).
|
|
||||||
@@ -1,464 +0,0 @@
|
|||||||
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
|
|
||||||
641
new_issues_seo.md
Normal file
@@ -0,0 +1,641 @@
|
|||||||
|
Issues
|
||||||
|
/
|
||||||
|
Open Graph tags incomplete
|
||||||
|
|
||||||
|
Why and how to fix
|
||||||
|
|
||||||
|
Submit to IndexNow
|
||||||
|
|
||||||
|
Create new issue
|
||||||
|
|
||||||
|
All URLs
|
||||||
|
|
||||||
|
Pages
|
||||||
|
|
||||||
|
Resources
|
||||||
|
|
||||||
|
Content
|
||||||
|
|
||||||
|
Links
|
||||||
|
|
||||||
|
Redirects
|
||||||
|
|
||||||
|
Indexability
|
||||||
|
|
||||||
|
Sitemaps
|
||||||
|
|
||||||
|
Ahrefs metrics
|
||||||
|
Word or phrase
|
||||||
|
|
||||||
|
URL
|
||||||
|
|
||||||
|
Advanced filter
|
||||||
|
Crawl history
|
||||||
|
Hide chart
|
||||||
|
12 Jan
|
||||||
|
13 Jan
|
||||||
|
13 Jan
|
||||||
|
14 Jan
|
||||||
|
14 Jan
|
||||||
|
15 Jan
|
||||||
|
0
|
||||||
|
2
|
||||||
|
4
|
||||||
|
6
|
||||||
|
8
|
||||||
|
All filter results
|
||||||
|
|
||||||
|
All filter results
|
||||||
|
8
|
||||||
|
|
||||||
|
Lost from filter results
|
||||||
|
0
|
||||||
|
|
||||||
|
Lost
|
||||||
|
0
|
||||||
|
|
||||||
|
Patches
|
||||||
|
|
||||||
|
Changes: Don't show
|
||||||
|
|
||||||
|
Columns
|
||||||
|
|
||||||
|
Export
|
||||||
|
PR
|
||||||
|
URL
|
||||||
|
Organic traffic
|
||||||
|
Is valid Open graph
|
||||||
|
Open graph attributes
|
||||||
|
Open graph values
|
||||||
|
Depth
|
||||||
|
Is indexable page
|
||||||
|
No. of all inlinks
|
||||||
|
24
|
||||||
|
html
|
||||||
|
Free vCard QR Generator: Digital Cards | QR Master
|
||||||
|
https://www.qrmaster.net/blog/vcard-qr-code-generator
|
||||||
|
0
|
||||||
|
No
|
||||||
|
og:type
|
||||||
|
og:image:alt
|
||||||
|
og:image
|
||||||
|
og:description
|
||||||
|
og:title
|
||||||
|
article
|
||||||
|
Professional business card with vCard QR code being scanned by smartphone
|
||||||
|
https://www.qrmaster.net/blog/vcard-qr-code.png
|
||||||
|
Create professional vCard QR codes for digital business cards. Share contact info instantly with a scan—includes templates and best practices.
|
||||||
|
Free vCard QR Generator: Digital Cards
|
||||||
|
0
|
||||||
|
Yes
|
||||||
|
8
|
||||||
|
24
|
||||||
|
html
|
||||||
|
Restaurant Menu QR Codes: 2025 Guide | QR Master
|
||||||
|
https://www.qrmaster.net/blog/qr-code-restaurant-menu
|
||||||
|
0
|
||||||
|
No
|
||||||
|
og:type
|
||||||
|
og:image:alt
|
||||||
|
og:image
|
||||||
|
og:description
|
||||||
|
og:title
|
||||||
|
article
|
||||||
|
Restaurant table with QR code menu card and smartphone scanning
|
||||||
|
https://www.qrmaster.net/blog/restaurant-qr-menu.png
|
||||||
|
Step-by-step guide to creating digital menu QR codes for your restaurant. Learn best practices for touchless menus, placement tips, and tracking.
|
||||||
|
Restaurant Menu QR Codes: 2025 Guide
|
||||||
|
0
|
||||||
|
Yes
|
||||||
|
8
|
||||||
|
24
|
||||||
|
html
|
||||||
|
QR Code Analytics: The Complete Guide | QR Master
|
||||||
|
https://www.qrmaster.net/blog/qr-code-analytics
|
||||||
|
0
|
||||||
|
No
|
||||||
|
og:type
|
||||||
|
og:image:alt
|
||||||
|
og:image
|
||||||
|
og:description
|
||||||
|
og:title
|
||||||
|
article
|
||||||
|
QR Code Analytics dashboard displaying scan metrics and user data
|
||||||
|
https://www.qrmaster.net/blog/qr-code-analytics-hero.webp
|
||||||
|
Master QR Code Analytics with our complete guide. Learn how to track scans, measure ROI, and optimize your marketing campaigns using real-time data.
|
||||||
|
QR Code Analytics: The Complete Guide
|
||||||
|
0
|
||||||
|
Yes
|
||||||
|
8
|
||||||
|
24
|
||||||
|
html
|
||||||
|
Dynamic vs Static QR Codes: The Ultimate Comparison | QR Master
|
||||||
|
https://www.qrmaster.net/blog/dynamic-vs-static-qr-codes
|
||||||
|
0
|
||||||
|
No
|
||||||
|
og:type
|
||||||
|
og:image:alt
|
||||||
|
og:image
|
||||||
|
og:description
|
||||||
|
og:title
|
||||||
|
article
|
||||||
|
Comparison graphic showing features of static versus dynamic QR codes
|
||||||
|
https://www.qrmaster.net/blog/static-vs-dynamic-qr-codes-hero.png
|
||||||
|
Static vs Dynamic QR Codes: Which should you choose? Learn the key differences, pros and cons, and why dynamic codes are better for business.
|
||||||
|
Dynamic vs Static QR Codes: The Ultimate Comparison
|
||||||
|
0
|
||||||
|
Yes
|
||||||
|
8
|
||||||
|
24
|
||||||
|
html
|
||||||
|
How to Generate Bulk QR Codes from Excel | QR Master
|
||||||
|
https://www.qrmaster.net/blog/bulk-qr-code-generator-excel
|
||||||
|
0
|
||||||
|
No
|
||||||
|
og:type
|
||||||
|
og:image:alt
|
||||||
|
og:image
|
||||||
|
og:description
|
||||||
|
og:title
|
||||||
|
article
|
||||||
|
Excel spreadsheet being converted into multiple QR codes
|
||||||
|
https://www.qrmaster.net/blog/building-qr-generator.png
|
||||||
|
Generate hundreds of QR codes from Excel or CSV files in minutes. Step-by-step guide with templates, best practices, and free tools.
|
||||||
|
How to Generate Bulk QR Codes from Excel
|
||||||
|
0
|
||||||
|
Yes
|
||||||
|
8
|
||||||
|
24
|
||||||
|
html
|
||||||
|
QR Code Print Size Guide: Minimum Sizes for Every Use Case | QR Master
|
||||||
|
https://www.qrmaster.net/blog/qr-code-print-size-guide
|
||||||
|
0
|
||||||
|
No
|
||||||
|
og:type
|
||||||
|
og:image:alt
|
||||||
|
og:image
|
||||||
|
og:description
|
||||||
|
og:title
|
||||||
|
article
|
||||||
|
Various print materials showing different QR code sizes
|
||||||
|
https://www.qrmaster.net/blog/qr-print-sizes.png
|
||||||
|
Complete guide to QR code print sizes. Learn minimum dimensions for business cards, posters, banners, and more to ensure reliable scanning.
|
||||||
|
QR Code Print Size Guide: Minimum Sizes for Every Use Case
|
||||||
|
0
|
||||||
|
Yes
|
||||||
|
8
|
||||||
|
24
|
||||||
|
html
|
||||||
|
Best QR Code Generator for Small Business 2025 | QR Master
|
||||||
|
https://www.qrmaster.net/blog/qr-code-small-business
|
||||||
|
0
|
||||||
|
No
|
||||||
|
og:type
|
||||||
|
og:image:alt
|
||||||
|
og:image
|
||||||
|
og:description
|
||||||
|
og:title
|
||||||
|
article
|
||||||
|
Small business owner using QR codes for customer engagement
|
||||||
|
https://www.qrmaster.net/blog/small-business-qr.png
|
||||||
|
Find the best QR code solution for your small business. Compare features, pricing, and use cases for marketing, payments, and operations.
|
||||||
|
Best QR Code Generator for Small Business 2025
|
||||||
|
0
|
||||||
|
Yes
|
||||||
|
8
|
||||||
|
24
|
||||||
|
html
|
||||||
|
QR Code Tracking: Complete Guide 2025 | QR Master
|
||||||
|
https://www.qrmaster.net/blog/qr-code-tracking-guide-2025
|
||||||
|
0
|
||||||
|
No
|
||||||
|
og:type
|
||||||
|
og:image:alt
|
||||||
|
og:image
|
||||||
|
og:description
|
||||||
|
og:title
|
||||||
|
article
|
||||||
|
QR Code Tracking and analytics dashboard visualization
|
||||||
|
https://www.qrmaster.net/blog/qr-code-tracking-guide-hero.webp
|
||||||
|
The complete guide to QR Code Tracking in 2025. Learn how to track scans, measure ROI, and optimize your marketing campaigns.
|
||||||
|
QR Code Tracking: Complete Guide 2025
|
||||||
|
0
|
||||||
|
Yes
|
||||||
|
8
|
||||||
|
Showing 8 of 8
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
Issues
|
||||||
|
/
|
||||||
|
Pages to submit to IndexNow
|
||||||
|
|
||||||
|
Why and how to fix
|
||||||
|
|
||||||
|
Submit to IndexNow
|
||||||
|
|
||||||
|
Create new issue
|
||||||
|
|
||||||
|
All URLs
|
||||||
|
|
||||||
|
Pages
|
||||||
|
|
||||||
|
Resources
|
||||||
|
|
||||||
|
Content
|
||||||
|
|
||||||
|
Links
|
||||||
|
|
||||||
|
Redirects
|
||||||
|
|
||||||
|
Indexability
|
||||||
|
|
||||||
|
Sitemaps
|
||||||
|
|
||||||
|
Ahrefs metrics
|
||||||
|
Word or phrase
|
||||||
|
|
||||||
|
URL
|
||||||
|
|
||||||
|
Advanced filter
|
||||||
|
Crawl history
|
||||||
|
Hide chart
|
||||||
|
12 Jan
|
||||||
|
13 Jan
|
||||||
|
13 Jan
|
||||||
|
14 Jan
|
||||||
|
14 Jan
|
||||||
|
15 Jan
|
||||||
|
0
|
||||||
|
9
|
||||||
|
18
|
||||||
|
27
|
||||||
|
36
|
||||||
|
All filter results
|
||||||
|
|
||||||
|
All filter results
|
||||||
|
12
|
||||||
|
|
||||||
|
Lost from filter results
|
||||||
|
|
||||||
|
Lost
|
||||||
|
|
||||||
|
Patches: Show all
|
||||||
|
|
||||||
|
Changes: Absolute
|
||||||
|
|
||||||
|
Columns
|
||||||
|
|
||||||
|
Export
|
||||||
|
PR
|
||||||
|
URL
|
||||||
|
Organic traffic
|
||||||
|
Changes
|
||||||
|
HTTP status code
|
||||||
|
Content type
|
||||||
|
Is indexable page
|
||||||
|
Title
|
||||||
|
Patch it
|
||||||
|
|
||||||
|
Batch AI
|
||||||
|
Meta description
|
||||||
|
Patch it
|
||||||
|
|
||||||
|
Batch AI
|
||||||
|
H1
|
||||||
|
H2
|
||||||
|
No. of content words
|
||||||
|
Changes
|
||||||
|
No. of internal outlinks
|
||||||
|
Changes
|
||||||
|
No. of external outlinks
|
||||||
|
Changes
|
||||||
|
Page text
|
||||||
|
First found at
|
||||||
|
40
|
||||||
|
html
|
||||||
|
QR Master: Dynamic QR Generator
|
||||||
|
https://www.qrmaster.net/
|
||||||
|
0
|
||||||
|
200
|
||||||
|
text/html; charset=utf-8
|
||||||
|
Yes
|
||||||
|
QR Master: Dynamic QR Generator
|
||||||
|
Enter new title
|
||||||
|
Create professional QR codes with QR Master. Dynamic QR with tracking, bulk generation, custom branding, and real-time analytics for all your campaigns.
|
||||||
|
Enter new meta description
|
||||||
|
QR Master: Dynamic QR Code Generator with Analytics
|
||||||
|
Create QR Codes That Work Everywhere
|
||||||
|
Create QR Codes That Work Everywhere
|
||||||
|
Instant QR Code Generator
|
||||||
|
The Future of QR Codes is AI-Powered
|
||||||
|
More Free QR Code Tools
|
||||||
|
Why Dynamic QR Codes Save You Money
|
||||||
|
All 8
|
||||||
|
777
|
||||||
|
29
|
||||||
|
0
|
||||||
|
View text
|
||||||
|
5 KB
|
||||||
|
38
|
||||||
|
html
|
||||||
|
QR Insights: Latest QR Strategies | QR Master
|
||||||
|
https://www.qrmaster.net/blog
|
||||||
|
0
|
||||||
|
200
|
||||||
|
text/html; charset=utf-8
|
||||||
|
Yes
|
||||||
|
QR Insights: Latest QR Strategies | QR Master
|
||||||
|
Enter new title
|
||||||
|
Expert guides on QR code analytics, dynamic vs static codes, bulk generation, and smart marketing use cases. Learn how to maximize your QR campaign ROI.
|
||||||
|
Enter new meta description
|
||||||
|
QR Code Insights
|
||||||
|
481
|
||||||
|
495
|
||||||
|
−14
|
||||||
|
37
|
||||||
|
0
|
||||||
|
View changes
|
||||||
|
3 KB
|
||||||
|
3 KB
|
||||||
|
38
|
||||||
|
html
|
||||||
|
Pricing Plans | QR Master
|
||||||
|
https://www.qrmaster.net/pricing
|
||||||
|
0
|
||||||
|
200
|
||||||
|
text/html; charset=utf-8
|
||||||
|
Yes
|
||||||
|
Pricing Plans | QR Master
|
||||||
|
Enter new title
|
||||||
|
Choose the perfect QR code plan for your needs. Free, Pro, and Business plans with dynamic QR codes, analytics, bulk generation, and custom branding.
|
||||||
|
Enter new meta description
|
||||||
|
QR Master Pricing – Choose Your QR Code Plan
|
||||||
|
Choose Your Plan
|
||||||
|
Compare our plans
|
||||||
|
Choose Your Plan
|
||||||
|
271
|
||||||
|
29
|
||||||
|
30
|
||||||
|
−1
|
||||||
|
0
|
||||||
|
View text
|
||||||
|
2 KB
|
||||||
|
38
|
||||||
|
html
|
||||||
|
QR Code Erstellen – Kostenlos | QR Master
|
||||||
|
https://www.qrmaster.net/qr-code-erstellen
|
||||||
|
0
|
||||||
|
200
|
||||||
|
text/html; charset=utf-8
|
||||||
|
Yes
|
||||||
|
QR Code Erstellen – Kostenlos | QR Master
|
||||||
|
Enter new title
|
||||||
|
Erstellen Sie QR Codes kostenlos in Sekunden. Dynamische QR-Codes mit Tracking, Branding und Massen-Erstellung. Für immer kostenlos.
|
||||||
|
Enter new meta description
|
||||||
|
QR Code Erstellen – Kostenloser QR Code Generator mit Tracking
|
||||||
|
Erstellen Sie QR-Codes, die überall funktionieren
|
||||||
|
Erstellen Sie QR-Codes, die überall funktionieren
|
||||||
|
Sofortiger QR-Code-Generator
|
||||||
|
Warum dynamische QR-Codes Geld sparen
|
||||||
|
Alles was Sie brauchen, um professionelle QR-Codes zu erstellen
|
||||||
|
Wählen Sie Ihren Plan
|
||||||
|
All 6
|
||||||
|
554
|
||||||
|
29
|
||||||
|
0
|
||||||
|
View text
|
||||||
|
4 KB
|
||||||
|
24
|
||||||
|
html
|
||||||
|
Free vCard QR Generator: Digital Cards | QR Master
|
||||||
|
https://www.qrmaster.net/blog/vcard-qr-code-generator
|
||||||
|
0
|
||||||
|
200
|
||||||
|
text/html; charset=utf-8
|
||||||
|
Yes
|
||||||
|
Free vCard QR Generator: Digital Cards | QR Master
|
||||||
|
Enter new title
|
||||||
|
Create professional vCard QR codes for digital business cards. Share contact info instantly with a scan—includes templates and best practices.
|
||||||
|
Enter new meta description
|
||||||
|
Free vCard QR Generator: Digital Cards
|
||||||
|
Quick Answer
|
||||||
|
What is a vCard QR Code?
|
||||||
|
Why Use a Digital Business Card QR Code?
|
||||||
|
Information You Can Include in a vCard
|
||||||
|
Static vs Dynamic vCard QR Codes
|
||||||
|
All 13
|
||||||
|
1,135
|
||||||
|
1,149
|
||||||
|
−14
|
||||||
|
37
|
||||||
|
0
|
||||||
|
View changes
|
||||||
|
7 KB
|
||||||
|
7 KB
|
||||||
|
24
|
||||||
|
html
|
||||||
|
Restaurant Menu QR Codes: 2025 Guide | QR Master
|
||||||
|
https://www.qrmaster.net/blog/qr-code-restaurant-menu
|
||||||
|
0
|
||||||
|
200
|
||||||
|
text/html; charset=utf-8
|
||||||
|
Yes
|
||||||
|
Restaurant Menu QR Codes: 2025 Guide | QR Master
|
||||||
|
Enter new title
|
||||||
|
Step-by-step guide to creating digital menu QR codes for your restaurant. Learn best practices for touchless menus, placement tips, and tracking.
|
||||||
|
Enter new meta description
|
||||||
|
Restaurant Menu QR Codes: 2025 Guide
|
||||||
|
Quick Answer
|
||||||
|
Why Restaurants Need QR Code Menus in 2025
|
||||||
|
Step 1: Prepare Your Digital Menu
|
||||||
|
Step 2: Create Your QR Code with QR Master
|
||||||
|
Step 3: Customize Your Restaurant QR Code
|
||||||
|
All 13
|
||||||
|
1,242
|
||||||
|
1,256
|
||||||
|
−14
|
||||||
|
38
|
||||||
|
0
|
||||||
|
View changes
|
||||||
|
8 KB
|
||||||
|
8 KB
|
||||||
|
24
|
||||||
|
html
|
||||||
|
QR Code Analytics: The Complete Guide | QR Master
|
||||||
|
https://www.qrmaster.net/blog/qr-code-analytics
|
||||||
|
0
|
||||||
|
200
|
||||||
|
text/html; charset=utf-8
|
||||||
|
Yes
|
||||||
|
QR Code Analytics: The Complete Guide | QR Master
|
||||||
|
Enter new title
|
||||||
|
Master QR Code Analytics with our complete guide. Learn how to track scans, measure ROI, and optimize your marketing campaigns using real-time data.
|
||||||
|
Master QR Code Analytics with our complete guide. Learn how to track scans, measure ROI, and optimize your marketing campaigns using real-time data and insights.
|
||||||
|
Enter new meta description
|
||||||
|
QR Code Analytics: The Complete Guide
|
||||||
|
Quick Answer
|
||||||
|
What Are Scan Analytics?
|
||||||
|
How to Set Up QR Code Analytics
|
||||||
|
Key Metrics in QR Code Analytics
|
||||||
|
Advanced Campaign Tracking Strategies
|
||||||
|
All 12
|
||||||
|
1,526
|
||||||
|
1,538
|
||||||
|
−12
|
||||||
|
37
|
||||||
|
0
|
||||||
|
View changes
|
||||||
|
10 KB
|
||||||
|
10 KB
|
||||||
|
24
|
||||||
|
html
|
||||||
|
Dynamic vs Static QR Codes: The Ultimate Comparison | QR Master
|
||||||
|
https://www.qrmaster.net/blog/dynamic-vs-static-qr-codes
|
||||||
|
0
|
||||||
|
200
|
||||||
|
text/html; charset=utf-8
|
||||||
|
Yes
|
||||||
|
Dynamic vs Static QR Codes: The Ultimate Comparison | QR Master
|
||||||
|
Enter new title
|
||||||
|
Static vs Dynamic QR Codes: Which should you choose? Learn the key differences, pros and cons, and why dynamic codes are better for business.
|
||||||
|
Static vs Dynamic QR Codes: Which one should you choose? Learn the key differences, pros and cons, and why dynamic QR codes are the better choice for business and marketing.
|
||||||
|
Enter new meta description
|
||||||
|
Dynamic vs Static QR Codes: The Ultimate Comparison
|
||||||
|
Quick Answer
|
||||||
|
What is a Static QR Code?
|
||||||
|
What is a Dynamic QR Code?
|
||||||
|
Direct Comparison: Static vs Dynamic
|
||||||
|
Why Dynamic QR Codes Are Better for Business
|
||||||
|
All 10
|
||||||
|
1,074
|
||||||
|
1,082
|
||||||
|
−8
|
||||||
|
37
|
||||||
|
0
|
||||||
|
View changes
|
||||||
|
7 KB
|
||||||
|
7 KB
|
||||||
|
24
|
||||||
|
html
|
||||||
|
How to Generate Bulk QR Codes from Excel | QR Master
|
||||||
|
https://www.qrmaster.net/blog/bulk-qr-code-generator-excel
|
||||||
|
0
|
||||||
|
200
|
||||||
|
text/html; charset=utf-8
|
||||||
|
Yes
|
||||||
|
How to Generate Bulk QR Codes from Excel | QR Master
|
||||||
|
Enter new title
|
||||||
|
Generate hundreds of QR codes from Excel or CSV files in minutes. Step-by-step guide with templates, best practices, and free tools.
|
||||||
|
Enter new meta description
|
||||||
|
How to Generate Bulk QR Codes from Excel
|
||||||
|
Quick Answer
|
||||||
|
How Bulk QR Code Generation Works
|
||||||
|
Step-by-Step Guide: Excel to QR Codes
|
||||||
|
Use Cases for Bulk QR Codes
|
||||||
|
Free vs Paid Bulk QR Tools
|
||||||
|
All 12
|
||||||
|
1,882
|
||||||
|
1,896
|
||||||
|
−14
|
||||||
|
37
|
||||||
|
1
|
||||||
|
View changes
|
||||||
|
12 KB
|
||||||
|
13 KB
|
||||||
|
24
|
||||||
|
html
|
||||||
|
QR Code Print Size Guide: Minimum Sizes for Every Use Case | QR Master
|
||||||
|
https://www.qrmaster.net/blog/qr-code-print-size-guide
|
||||||
|
0
|
||||||
|
200
|
||||||
|
text/html; charset=utf-8
|
||||||
|
Yes
|
||||||
|
QR Code Print Size Guide: Minimum Sizes for Every Use Case | QR Master
|
||||||
|
Enter new title
|
||||||
|
Complete guide to QR code print sizes. Learn minimum dimensions for business cards, posters, banners, and more to ensure reliable scanning.
|
||||||
|
Enter new meta description
|
||||||
|
QR Code Print Size Guide: Minimum Sizes for Every Use Case
|
||||||
|
Quick Answer
|
||||||
|
Why QR Code Size Matters
|
||||||
|
The Scanning Distance Formula
|
||||||
|
QR Code Sizes by Application
|
||||||
|
Factors Affecting Scanability
|
||||||
|
All 12
|
||||||
|
948
|
||||||
|
962
|
||||||
|
−14
|
||||||
|
37
|
||||||
|
0
|
||||||
|
View changes
|
||||||
|
6 KB
|
||||||
|
6 KB
|
||||||
|
24
|
||||||
|
html
|
||||||
|
Best QR Code Generator for Small Business 2025 | QR Master
|
||||||
|
https://www.qrmaster.net/blog/qr-code-small-business
|
||||||
|
0
|
||||||
|
200
|
||||||
|
text/html; charset=utf-8
|
||||||
|
Yes
|
||||||
|
Best QR Code Generator for Small Business 2025 | QR Master
|
||||||
|
Enter new title
|
||||||
|
Find the best QR code solution for your small business. Compare features, pricing, and use cases for marketing, payments, and operations.
|
||||||
|
Enter new meta description
|
||||||
|
Best QR Code Generator for Small Business 2025
|
||||||
|
Quick Answer
|
||||||
|
Why Small Businesses Need QR Codes
|
||||||
|
Top 10 QR Code Use Cases for Small Business
|
||||||
|
What to Look for in a Small Business QR Solution
|
||||||
|
QR Master for Small Business
|
||||||
|
All 11
|
||||||
|
1,034
|
||||||
|
1,048
|
||||||
|
−14
|
||||||
|
37
|
||||||
|
0
|
||||||
|
View changes
|
||||||
|
7 KB
|
||||||
|
7 KB
|
||||||
|
24
|
||||||
|
html
|
||||||
|
QR Code Tracking: Complete Guide 2025 | QR Master
|
||||||
|
https://www.qrmaster.net/blog/qr-code-tracking-guide-2025
|
||||||
|
0
|
||||||
|
200
|
||||||
|
text/html; charset=utf-8
|
||||||
|
Yes
|
||||||
|
QR Code Tracking: Complete Guide 2025 | QR Master
|
||||||
|
Enter new title
|
||||||
|
The complete guide to QR Code Tracking in 2025. Learn how to track scans, measure ROI, and optimize your marketing campaigns.
|
||||||
|
The complete guide to QR Code Tracking in 2025. Learn how to track scans, measure ROI with analytics tools, and optimize your marketing campaigns for maximum engagement.
|
||||||
|
Enter new meta description
|
||||||
|
QR Code Tracking: Complete Guide 2025
|
||||||
|
Quick Answer
|
||||||
|
What is QR Code Tracking?
|
||||||
|
Why Track QR Codes? Key Benefits
|
||||||
|
How to Track QR Code Scans: 4 Methods
|
||||||
|
QR Code Tracking Tools Comparison
|
||||||
|
All 15
|
||||||
|
2,959
|
||||||
|
2,967
|
||||||
|
−8
|
||||||
|
38
|
||||||
|
1
|
||||||
|
View changes
|
||||||
|
19 KB
|
||||||
|
19 KB
|
||||||
|
Showing 12 of 12
|
||||||
@@ -1,42 +0,0 @@
|
|||||||
/** @type {import('next-sitemap').IConfig} */
|
|
||||||
module.exports = {
|
|
||||||
siteUrl: 'https://www.qrmaster.net',
|
|
||||||
generateRobotsTxt: true,
|
|
||||||
robotsTxtOptions: {
|
|
||||||
policies: [
|
|
||||||
{
|
|
||||||
userAgent: '*',
|
|
||||||
allow: '/',
|
|
||||||
},
|
|
||||||
],
|
|
||||||
},
|
|
||||||
transform: async (config, path) => {
|
|
||||||
// Custom priority and changefreq based on path
|
|
||||||
let priority = 0.7;
|
|
||||||
let changefreq = 'weekly';
|
|
||||||
|
|
||||||
if (path === '/') {
|
|
||||||
priority = 0.9;
|
|
||||||
changefreq = 'daily';
|
|
||||||
} else if (path === '/blog') {
|
|
||||||
priority = 0.7;
|
|
||||||
changefreq = 'daily';
|
|
||||||
} else if (path === '/pricing') {
|
|
||||||
priority = 0.8;
|
|
||||||
changefreq = 'weekly';
|
|
||||||
} else if (path === '/faq') {
|
|
||||||
priority = 0.6;
|
|
||||||
changefreq = 'weekly';
|
|
||||||
} else if (path.startsWith('/blog/')) {
|
|
||||||
priority = 0.6;
|
|
||||||
changefreq = 'weekly';
|
|
||||||
}
|
|
||||||
|
|
||||||
return {
|
|
||||||
loc: path,
|
|
||||||
changefreq,
|
|
||||||
priority,
|
|
||||||
lastmod: new Date().toISOString(),
|
|
||||||
};
|
|
||||||
},
|
|
||||||
};
|
|
||||||
@@ -20,6 +20,16 @@ const nextConfig = {
|
|||||||
pagesBufferLength: 2,
|
pagesBufferLength: 2,
|
||||||
},
|
},
|
||||||
poweredByHeader: false,
|
poweredByHeader: false,
|
||||||
|
async redirects() {
|
||||||
|
return [
|
||||||
|
{
|
||||||
|
source: '/blog/bulk-qr-codes-excel',
|
||||||
|
destination: '/blog/bulk-qr-code-generator-excel',
|
||||||
|
permanent: true,
|
||||||
|
},
|
||||||
|
|
||||||
|
];
|
||||||
|
},
|
||||||
};
|
};
|
||||||
|
|
||||||
export default nextConfig;
|
export default nextConfig;
|
||||||
|
|||||||
2446
package-lock.json
generated
@@ -6,7 +6,6 @@
|
|||||||
"scripts": {
|
"scripts": {
|
||||||
"dev": "next dev -p 3050",
|
"dev": "next dev -p 3050",
|
||||||
"build": "prisma generate && next build",
|
"build": "prisma generate && next build",
|
||||||
"trigger:indexing": "tsx scripts/trigger-indexing.ts",
|
|
||||||
"submit:indexnow": "tsx scripts/submit-indexnow.ts",
|
"submit:indexnow": "tsx scripts/submit-indexnow.ts",
|
||||||
"start": "next start",
|
"start": "next start",
|
||||||
"lint": "next lint",
|
"lint": "next lint",
|
||||||
@@ -29,8 +28,6 @@
|
|||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@auth/prisma-adapter": "^2.11.1",
|
"@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",
|
"@edge-runtime/cookies": "^6.0.0",
|
||||||
"@prisma/client": "^5.7.0",
|
"@prisma/client": "^5.7.0",
|
||||||
"@stripe/stripe-js": "^8.0.0",
|
"@stripe/stripe-js": "^8.0.0",
|
||||||
@@ -39,14 +36,12 @@
|
|||||||
"bcryptjs": "^2.4.3",
|
"bcryptjs": "^2.4.3",
|
||||||
"chart.js": "^4.4.0",
|
"chart.js": "^4.4.0",
|
||||||
"clsx": "^2.0.0",
|
"clsx": "^2.0.0",
|
||||||
"copy-image-clipboard": "^2.1.2",
|
|
||||||
"d3-scale": "^4.0.2",
|
"d3-scale": "^4.0.2",
|
||||||
"dayjs": "^1.11.10",
|
"dayjs": "^1.11.10",
|
||||||
"dotenv": "^17.2.3",
|
"dotenv": "^17.2.3",
|
||||||
"exceljs": "^4.4.0",
|
"exceljs": "^4.4.0",
|
||||||
"file-saver": "^2.0.5",
|
"file-saver": "^2.0.5",
|
||||||
"framer-motion": "^12.24.10",
|
"framer-motion": "^12.24.10",
|
||||||
"googleapis": "^170.1.0",
|
|
||||||
"html-to-image": "^1.11.13",
|
"html-to-image": "^1.11.13",
|
||||||
"i18next": "^23.7.6",
|
"i18next": "^23.7.6",
|
||||||
"ioredis": "^5.3.2",
|
"ioredis": "^5.3.2",
|
||||||
@@ -56,12 +51,11 @@
|
|||||||
"next": "^14.2.35",
|
"next": "^14.2.35",
|
||||||
"next-auth": "^4.24.5",
|
"next-auth": "^4.24.5",
|
||||||
"papaparse": "^5.4.1",
|
"papaparse": "^5.4.1",
|
||||||
"posthog-js": "^1.332.0",
|
"posthog-js": "^1.276.0",
|
||||||
"qr-code-styling": "^1.9.2",
|
"qr-code-styling": "^1.9.2",
|
||||||
"qrcode": "^1.5.3",
|
"qrcode": "^1.5.3",
|
||||||
"qrcode.react": "^3.1.0",
|
"qrcode.react": "^3.1.0",
|
||||||
"react": "^18.2.0",
|
"react": "^18.2.0",
|
||||||
"react-barcode": "^1.6.1",
|
|
||||||
"react-chartjs-2": "^5.2.0",
|
"react-chartjs-2": "^5.2.0",
|
||||||
"react-dom": "^18.2.0",
|
"react-dom": "^18.2.0",
|
||||||
"react-dropzone": "^14.2.3",
|
"react-dropzone": "^14.2.3",
|
||||||
|
|||||||
@@ -112,10 +112,6 @@ enum ContentType {
|
|||||||
SMS
|
SMS
|
||||||
TEXT
|
TEXT
|
||||||
WHATSAPP
|
WHATSAPP
|
||||||
PDF
|
|
||||||
APP
|
|
||||||
COUPON
|
|
||||||
FEEDBACK
|
|
||||||
}
|
}
|
||||||
|
|
||||||
enum QRStatus {
|
enum QRStatus {
|
||||||
@@ -166,3 +162,17 @@ model NewsletterSubscription {
|
|||||||
@@index([email])
|
@@index([email])
|
||||||
@@index([createdAt])
|
@@index([createdAt])
|
||||||
}
|
}
|
||||||
|
|
||||||
|
model Lead {
|
||||||
|
id String @id @default(cuid())
|
||||||
|
email String
|
||||||
|
source String @default("reprint-calculator")
|
||||||
|
reprintCost Float?
|
||||||
|
updatesPerYear Int?
|
||||||
|
annualSavings Float?
|
||||||
|
createdAt DateTime @default(now())
|
||||||
|
|
||||||
|
@@index([email])
|
||||||
|
@@index([createdAt])
|
||||||
|
@@index([source])
|
||||||
|
}
|
||||||
|
Before Width: | Height: | Size: 398 KiB |
|
Before Width: | Height: | Size: 804 KiB |
|
Before Width: | Height: | Size: 860 KiB |
|
Before Width: | Height: | Size: 630 KiB |
|
Before Width: | Height: | Size: 863 KiB |
|
Before Width: | Height: | Size: 454 KiB |
|
Before Width: | Height: | Size: 646 KiB |
|
Before Width: | Height: | Size: 699 KiB |
BIN
public/blog/qr_master_cover.png
Normal file
|
After Width: | Height: | Size: 545 KiB |
BIN
public/blog/qr_master_profile.png
Normal file
|
After Width: | Height: | Size: 440 KiB |
@@ -1,33 +0,0 @@
|
|||||||
<?xml version="1.0" encoding="UTF-8"?>
|
|
||||||
<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">
|
|
||||||
<url>
|
|
||||||
<loc>https://www.qrmaster.net/</loc>
|
|
||||||
<lastmod>2025-10-16T00:00:00Z</lastmod>
|
|
||||||
<changefreq>daily</changefreq>
|
|
||||||
<priority>0.9</priority>
|
|
||||||
</url>
|
|
||||||
<url>
|
|
||||||
<loc>https://www.qrmaster.net/blog</loc>
|
|
||||||
<lastmod>2025-10-16T00:00:00Z</lastmod>
|
|
||||||
<changefreq>daily</changefreq>
|
|
||||||
<priority>0.7</priority>
|
|
||||||
</url>
|
|
||||||
<url>
|
|
||||||
<loc>https://www.qrmaster.net/pricing</loc>
|
|
||||||
<lastmod>2025-10-16T00:00:00Z</lastmod>
|
|
||||||
<changefreq>weekly</changefreq>
|
|
||||||
<priority>0.8</priority>
|
|
||||||
</url>
|
|
||||||
<url>
|
|
||||||
<loc>https://www.qrmaster.net/faq</loc>
|
|
||||||
<lastmod>2025-10-16T00:00:00Z</lastmod>
|
|
||||||
<changefreq>weekly</changefreq>
|
|
||||||
<priority>0.6</priority>
|
|
||||||
</url>
|
|
||||||
<url>
|
|
||||||
<loc>https://www.qrmaster.net/blog/qr-code-analytics</loc>
|
|
||||||
<lastmod>2025-10-16T00:00:00Z</lastmod>
|
|
||||||
<changefreq>weekly</changefreq>
|
|
||||||
<priority>0.6</priority>
|
|
||||||
</url>
|
|
||||||
</urlset>
|
|
||||||
@@ -1,23 +1,21 @@
|
|||||||
|
|
||||||
// Helper script to run IndexNow submission
|
// Helper script to run IndexNow submission
|
||||||
// Run with: npm run submit:indexnow
|
// Run with: npx tsx scripts/submit-indexnow.ts
|
||||||
|
|
||||||
import { getAllIndexableUrls, submitToIndexNow } from '../src/lib/indexnow';
|
import { getAllIndexableUrls, submitToIndexNow } from '../src/lib/indexnow';
|
||||||
|
|
||||||
async function main() {
|
async function main() {
|
||||||
console.log('🚀 Starting IndexNow Submission Script...');
|
|
||||||
|
|
||||||
console.log('Gathering URLs for IndexNow submission...');
|
console.log('Gathering URLs for IndexNow submission...');
|
||||||
const urls = getAllIndexableUrls();
|
const urls = getAllIndexableUrls();
|
||||||
console.log(`Found ${urls.length} indexable URLs.`);
|
console.log(`Found ${urls.length} indexable URLs.`);
|
||||||
|
|
||||||
// Basic validation of key presence (logic can be improved)
|
// Basic validation of key presence (logic can be improved)
|
||||||
if (!process.env.INDEXNOW_KEY) {
|
if (!process.env.INDEXNOW_KEY) {
|
||||||
console.warn('⚠️ WARNING: INDEXNOW_KEY environment variable is not set.');
|
console.warn('⚠️ WARNING: INDEXNOW_KEY environment variable is not set. Using placeholder.');
|
||||||
console.warn(' The submission might fail if the key is not hardcoded in src/lib/indexnow.ts');
|
// In production, you'd fail here. For dev/demo, we proceed but expect failure from API.
|
||||||
}
|
}
|
||||||
|
|
||||||
await submitToIndexNow(urls);
|
await submitToIndexNow(urls);
|
||||||
console.log('\n✨ IndexNow submission process completed.');
|
|
||||||
}
|
}
|
||||||
|
|
||||||
main().catch(console.error);
|
main().catch(console.error);
|
||||||
|
|||||||
@@ -1,81 +0,0 @@
|
|||||||
|
|
||||||
import { google } from 'googleapis';
|
|
||||||
import fs from 'fs';
|
|
||||||
import path from 'path';
|
|
||||||
import { getAllIndexableUrls } from '../src/lib/indexnow';
|
|
||||||
|
|
||||||
// ==========================================
|
|
||||||
// CONFIGURATION
|
|
||||||
// ==========================================
|
|
||||||
|
|
||||||
// Path to your Service Account Key (JSON file)
|
|
||||||
const KEY_FILE = path.join(__dirname, '../service_account.json');
|
|
||||||
|
|
||||||
// Urls are now fetched dynamically from src/lib/indexnow.ts
|
|
||||||
// ==========================================
|
|
||||||
|
|
||||||
async function runUsingServiceAccount() {
|
|
||||||
console.log('🚀 Starting Google Indexing Script (All Pages)...');
|
|
||||||
|
|
||||||
if (!fs.existsSync(KEY_FILE)) {
|
|
||||||
console.error('\n❌ ERROR: Service Account Key not found!');
|
|
||||||
console.error(` Expected path: ${KEY_FILE}`);
|
|
||||||
console.error(' Please follow the instructions in INDEXING_GUIDE.md to create and save the key.');
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
console.log(`🔑 Authenticating with key file: ${path.basename(KEY_FILE)}...`);
|
|
||||||
|
|
||||||
const auth = new google.auth.GoogleAuth({
|
|
||||||
keyFile: KEY_FILE,
|
|
||||||
scopes: ['https://www.googleapis.com/auth/indexing'],
|
|
||||||
});
|
|
||||||
|
|
||||||
try {
|
|
||||||
const client = await auth.getClient();
|
|
||||||
console.log('✅ Authentication successful.');
|
|
||||||
|
|
||||||
console.log(' Gathering URLs to index...');
|
|
||||||
const allUrls = getAllIndexableUrls();
|
|
||||||
console.log(` Found ${allUrls.length} URLs to index.`);
|
|
||||||
|
|
||||||
for (const url of allUrls) {
|
|
||||||
console.log(`\n📄 Processing: ${url}`);
|
|
||||||
|
|
||||||
try {
|
|
||||||
const result = await google.indexing('v3').urlNotifications.publish({
|
|
||||||
auth: client,
|
|
||||||
requestBody: {
|
|
||||||
url: url,
|
|
||||||
type: 'URL_UPDATED'
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
console.log(` 👉 Status: ${result.status} ${result.statusText}`);
|
|
||||||
// Optional: Log more details from result.data if needed
|
|
||||||
|
|
||||||
} catch (innerError: any) {
|
|
||||||
console.error(` ❌ Failed to index ${url}`);
|
|
||||||
if (innerError.response) {
|
|
||||||
console.error(` Reason: ${innerError.response.status} - ${JSON.stringify(innerError.response.data)}`);
|
|
||||||
// 429 = Quota exceeded
|
|
||||||
// 403 = Permission denied (check service account owner status)
|
|
||||||
} else {
|
|
||||||
console.error(` Reason: ${innerError.message}`);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// Optional: Add a small delay to avoid hitting rate limits too fast if you have hundreds of URLs
|
|
||||||
// await new Promise(resolve => setTimeout(resolve, 500));
|
|
||||||
}
|
|
||||||
|
|
||||||
console.log('\n✨ Done! All requests processed.');
|
|
||||||
console.log(' Note: Check Google Search Console for actual indexing status over time.');
|
|
||||||
|
|
||||||
} catch (error: any) {
|
|
||||||
console.error('\n❌ Fatal error occurred:');
|
|
||||||
console.error(error.message);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
runUsingServiceAccount();
|
|
||||||
742
searchvolume.md
@@ -1,742 +0,0 @@
|
|||||||
Overview: qr code generator
|
|
||||||
View Cached Page
|
|
||||||
|
|
||||||
Create Report
|
|
||||||
370,000
|
|
||||||
Monthly Volume
|
|
||||||
337,000
|
|
||||||
Estimated Clicks
|
|
||||||
Clicked any result
|
|
||||||
Low
|
|
||||||
91%
|
|
||||||
High
|
|
||||||
Mobile vs Desktop
|
|
||||||
Mobile
|
|
||||||
Desktop
|
|
||||||
Not Enough Data
|
|
||||||
Paid clicks
|
|
||||||
Low
|
|
||||||
0‑3%
|
|
||||||
12%
|
|
||||||
High
|
|
||||||
13%+
|
|
||||||
Difficulty
|
|
||||||
73
|
|
||||||
Google Provided Data
|
|
||||||
|
|
||||||
Expand
|
|
||||||
Cost Per Click
|
|
||||||
$0.51
|
|
||||||
Monthly Cost
|
|
||||||
$3,072
|
|
||||||
Search Volume
|
|
||||||
90,500
|
|
||||||
Advertisers
|
|
||||||
15
|
|
||||||
Homepages
|
|
||||||
6
|
|
||||||
Fresh SV
|
|
||||||
918,000
|
|
||||||
Universal search in SERP
|
|
||||||
8,191
|
|
||||||
Similar keywords
|
|
||||||
qr code generator
|
|
||||||
370,000
|
|
||||||
qr code generator free
|
|
||||||
43,300
|
|
||||||
free qr code generator
|
|
||||||
34,400
|
|
||||||
generate qr code
|
|
||||||
10,800
|
|
||||||
google qr code generator
|
|
||||||
8,000
|
|
||||||
Log in to see all results
|
|
||||||
--
|
|
||||||
Log in to see all results
|
|
||||||
--
|
|
||||||
Log in to see all results
|
|
||||||
--
|
|
||||||
Log in to see all results
|
|
||||||
--
|
|
||||||
Log in to see all results
|
|
||||||
--
|
|
||||||
View All
|
|
||||||
655
|
|
||||||
Questions
|
|
||||||
How to generate a qr code
|
|
||||||
1,700
|
|
||||||
How to generate qr code
|
|
||||||
630
|
|
||||||
How to generate qr code for url
|
|
||||||
270
|
|
||||||
What is the best qr code generator?
|
|
||||||
220
|
|
||||||
How to generate bank qr code without edge
|
|
||||||
200
|
|
||||||
Log in to see all results
|
|
||||||
--
|
|
||||||
Log in to see all results
|
|
||||||
--
|
|
||||||
Log in to see all results
|
|
||||||
--
|
|
||||||
Log in to see all results
|
|
||||||
--
|
|
||||||
Log in to see all results
|
|
||||||
--
|
|
||||||
View All
|
|
||||||
19,120,108
|
|
||||||
Also ranks for
|
|
||||||
qr code generator free
|
|
||||||
43,300
|
|
||||||
qr code maker
|
|
||||||
52,000
|
|
||||||
free qr code generator
|
|
||||||
34,400
|
|
||||||
qr generator
|
|
||||||
25,300
|
|
||||||
create qr code
|
|
||||||
29,500
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
Overview: barcode generator
|
|
||||||
View Cached Page
|
|
||||||
|
|
||||||
Create Report
|
|
||||||
58,300
|
|
||||||
Monthly Volume
|
|
||||||
51,000
|
|
||||||
Estimated Clicks
|
|
||||||
Clicked any result
|
|
||||||
Low
|
|
||||||
87%
|
|
||||||
High
|
|
||||||
Mobile vs Desktop
|
|
||||||
Mobile
|
|
||||||
Desktop
|
|
||||||
Low Mobile
|
|
||||||
Paid clicks
|
|
||||||
Low
|
|
||||||
0‑3%
|
|
||||||
1%
|
|
||||||
High
|
|
||||||
13%+
|
|
||||||
Difficulty
|
|
||||||
22
|
|
||||||
Google Provided Data
|
|
||||||
|
|
||||||
Expand
|
|
||||||
Cost Per Click
|
|
||||||
$1.68
|
|
||||||
Monthly Cost
|
|
||||||
$5,316
|
|
||||||
Search Volume
|
|
||||||
110,000
|
|
||||||
Advertisers
|
|
||||||
5
|
|
||||||
Homepages
|
|
||||||
21
|
|
||||||
Fresh SV
|
|
||||||
72,800
|
|
||||||
Universal search in SERP
|
|
||||||
5,381
|
|
||||||
Similar keywords
|
|
||||||
barcode generator
|
|
||||||
58,300
|
|
||||||
free barcode generator
|
|
||||||
4,000
|
|
||||||
upc barcode generator
|
|
||||||
3,200
|
|
||||||
2d barcode generator
|
|
||||||
1,300
|
|
||||||
generate barcode
|
|
||||||
1,300
|
|
||||||
Log in to see all results
|
|
||||||
--
|
|
||||||
Log in to see all results
|
|
||||||
--
|
|
||||||
Log in to see all results
|
|
||||||
--
|
|
||||||
Log in to see all results
|
|
||||||
--
|
|
||||||
Log in to see all results
|
|
||||||
--
|
|
||||||
View All
|
|
||||||
326
|
|
||||||
Questions
|
|
||||||
How to store barcodes generated into a folder in linux python
|
|
||||||
250
|
|
||||||
How to generate barcodes
|
|
||||||
180
|
|
||||||
How to generate barcodes in excel
|
|
||||||
180
|
|
||||||
How to generate barcodes for products
|
|
||||||
135
|
|
||||||
How to generate a third party barcode for j1 waiver
|
|
||||||
110
|
|
||||||
Log in to see all results
|
|
||||||
--
|
|
||||||
Log in to see all results
|
|
||||||
--
|
|
||||||
Log in to see all results
|
|
||||||
--
|
|
||||||
Log in to see all results
|
|
||||||
--
|
|
||||||
Log in to see all results
|
|
||||||
--
|
|
||||||
View All
|
|
||||||
27,933,196
|
|
||||||
Also ranks for
|
|
||||||
free barcode generator
|
|
||||||
4,000
|
|
||||||
barcode maker
|
|
||||||
6,100
|
|
||||||
upc code generator
|
|
||||||
3,600
|
|
||||||
upc generator
|
|
||||||
4,500
|
|
||||||
2d barcode generator
|
|
||||||
1,300
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
Overview: qr code maker
|
|
||||||
View Cached Page
|
|
||||||
|
|
||||||
Create Report
|
|
||||||
52,000
|
|
||||||
Monthly Volume
|
|
||||||
48,200
|
|
||||||
Estimated Clicks
|
|
||||||
Clicked any result
|
|
||||||
Low
|
|
||||||
93%
|
|
||||||
High
|
|
||||||
Mobile vs Desktop
|
|
||||||
Mobile
|
|
||||||
Desktop
|
|
||||||
Not Enough Data
|
|
||||||
Paid clicks
|
|
||||||
Low
|
|
||||||
0‑3%
|
|
||||||
12%
|
|
||||||
High
|
|
||||||
13%+
|
|
||||||
Difficulty
|
|
||||||
47
|
|
||||||
Google Provided Data
|
|
||||||
|
|
||||||
Expand
|
|
||||||
Cost Per Click
|
|
||||||
$0.37
|
|
||||||
Monthly Cost
|
|
||||||
$209
|
|
||||||
Search Volume
|
|
||||||
18,100
|
|
||||||
Advertisers
|
|
||||||
11
|
|
||||||
Homepages
|
|
||||||
32
|
|
||||||
Fresh SV
|
|
||||||
71,300
|
|
||||||
Universal search in SERP
|
|
||||||
601
|
|
||||||
Similar keywords
|
|
||||||
qr code maker
|
|
||||||
52,000
|
|
||||||
animal crossing qr code maker
|
|
||||||
2,000
|
|
||||||
free qr code maker
|
|
||||||
2,000
|
|
||||||
qr code maker free
|
|
||||||
1,900
|
|
||||||
mini qr code maker
|
|
||||||
380
|
|
||||||
Log in to see all results
|
|
||||||
--
|
|
||||||
Log in to see all results
|
|
||||||
--
|
|
||||||
Log in to see all results
|
|
||||||
--
|
|
||||||
Log in to see all results
|
|
||||||
--
|
|
||||||
Log in to see all results
|
|
||||||
--
|
|
||||||
View All
|
|
||||||
13
|
|
||||||
Questions
|
|
||||||
How to maker qr code for cia
|
|
||||||
70
|
|
||||||
How to make qr codes with brother label maker
|
|
||||||
70
|
|
||||||
How to make a qr code qr code maker
|
|
||||||
50
|
|
||||||
How to post qr codes online mii maker
|
|
||||||
40
|
|
||||||
How to get qr code watch maker
|
|
||||||
28
|
|
||||||
Log in to see all results
|
|
||||||
--
|
|
||||||
Log in to see all results
|
|
||||||
--
|
|
||||||
Log in to see all results
|
|
||||||
--
|
|
||||||
Log in to see all results
|
|
||||||
--
|
|
||||||
Log in to see all results
|
|
||||||
--
|
|
||||||
View All
|
|
||||||
84,638,180
|
|
||||||
Also ranks for
|
|
||||||
qr code generator free
|
|
||||||
43,300
|
|
||||||
free qr code generator
|
|
||||||
34,400
|
|
||||||
create a qr code
|
|
||||||
17,100
|
|
||||||
create qr code
|
|
||||||
29,500
|
|
||||||
qr generator
|
|
||||||
25,300
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
Overview: google qr code generator
|
|
||||||
View Cached Page
|
|
||||||
|
|
||||||
Create Report
|
|
||||||
8,000
|
|
||||||
Monthly Volume
|
|
||||||
5,100
|
|
||||||
Estimated Clicks
|
|
||||||
Clicked any result
|
|
||||||
Low
|
|
||||||
64%
|
|
||||||
High
|
|
||||||
Mobile vs Desktop
|
|
||||||
Mobile
|
|
||||||
Desktop
|
|
||||||
Low Mobile
|
|
||||||
Paid clicks
|
|
||||||
Low
|
|
||||||
0‑3%
|
|
||||||
2%
|
|
||||||
High
|
|
||||||
13%+
|
|
||||||
Difficulty
|
|
||||||
52
|
|
||||||
Google Provided Data
|
|
||||||
|
|
||||||
Expand
|
|
||||||
Cost Per Click
|
|
||||||
$3.53
|
|
||||||
Monthly Cost
|
|
||||||
$0.00
|
|
||||||
Search Volume
|
|
||||||
2,900
|
|
||||||
Advertisers
|
|
||||||
9
|
|
||||||
Homepages
|
|
||||||
20
|
|
||||||
Fresh SV
|
|
||||||
11,500
|
|
||||||
Universal search in SERP
|
|
||||||
336
|
|
||||||
Similar keywords
|
|
||||||
google qr code generator
|
|
||||||
8,000
|
|
||||||
qr code generator google
|
|
||||||
4,800
|
|
||||||
free qr code generator google
|
|
||||||
720
|
|
||||||
qr code generator google form
|
|
||||||
440
|
|
||||||
google form qr code generator
|
|
||||||
320
|
|
||||||
Log in to see all results
|
|
||||||
--
|
|
||||||
Log in to see all results
|
|
||||||
--
|
|
||||||
Log in to see all results
|
|
||||||
--
|
|
||||||
Log in to see all results
|
|
||||||
--
|
|
||||||
Log in to see all results
|
|
||||||
--
|
|
||||||
View All
|
|
||||||
59
|
|
||||||
Questions
|
|
||||||
Does google have a qr code generator?
|
|
||||||
135
|
|
||||||
How to generate qr code for google authenticator
|
|
||||||
100
|
|
||||||
Does google have a qr code generator for contact info?
|
|
||||||
90
|
|
||||||
How to generate qr code for google form
|
|
||||||
90
|
|
||||||
How to generate a qr code for a google form
|
|
||||||
90
|
|
||||||
Log in to see all results
|
|
||||||
--
|
|
||||||
Log in to see all results
|
|
||||||
--
|
|
||||||
Log in to see all results
|
|
||||||
--
|
|
||||||
Log in to see all results
|
|
||||||
--
|
|
||||||
Log in to see all results
|
|
||||||
--
|
|
||||||
View All
|
|
||||||
27,918,916
|
|
||||||
Also ranks for
|
|
||||||
qr code generator free
|
|
||||||
43,300
|
|
||||||
qr code maker
|
|
||||||
52,000
|
|
||||||
create qr code
|
|
||||||
29,500
|
|
||||||
qr generator
|
|
||||||
25,300
|
|
||||||
free qr code generator
|
|
||||||
34,400
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
Overview: create qr code
|
|
||||||
View Cached Page
|
|
||||||
|
|
||||||
Create Report
|
|
||||||
29,500
|
|
||||||
Monthly Volume
|
|
||||||
26,400
|
|
||||||
Estimated Clicks
|
|
||||||
Clicked any result
|
|
||||||
Low
|
|
||||||
89%
|
|
||||||
High
|
|
||||||
Mobile vs Desktop
|
|
||||||
Mobile
|
|
||||||
Desktop
|
|
||||||
Not Enough Data
|
|
||||||
Paid clicks
|
|
||||||
Low
|
|
||||||
0‑3%
|
|
||||||
16%
|
|
||||||
High
|
|
||||||
13%+
|
|
||||||
Difficulty
|
|
||||||
52
|
|
||||||
Google Provided Data
|
|
||||||
|
|
||||||
Expand
|
|
||||||
Cost Per Click
|
|
||||||
$3.32
|
|
||||||
Monthly Cost
|
|
||||||
$1,406
|
|
||||||
Search Volume
|
|
||||||
14,800
|
|
||||||
Advertisers
|
|
||||||
15
|
|
||||||
Homepages
|
|
||||||
25
|
|
||||||
Fresh SV
|
|
||||||
50,000
|
|
||||||
Universal search in SERP
|
|
||||||
3,223
|
|
||||||
Similar keywords
|
|
||||||
create qr code
|
|
||||||
29,500
|
|
||||||
create a qr code
|
|
||||||
17,100
|
|
||||||
How to create a qr code
|
|
||||||
9,200
|
|
||||||
create qr code free
|
|
||||||
5,500
|
|
||||||
How to create a qr code free
|
|
||||||
1,400
|
|
||||||
Log in to see all results
|
|
||||||
--
|
|
||||||
Log in to see all results
|
|
||||||
--
|
|
||||||
Log in to see all results
|
|
||||||
--
|
|
||||||
Log in to see all results
|
|
||||||
--
|
|
||||||
Log in to see all results
|
|
||||||
--
|
|
||||||
View All
|
|
||||||
1,110
|
|
||||||
Questions
|
|
||||||
How to create a qr code
|
|
||||||
9,200
|
|
||||||
How to create a qr code free
|
|
||||||
1,400
|
|
||||||
How to create qr codes
|
|
||||||
1,300
|
|
||||||
How to create qr code
|
|
||||||
1,300
|
|
||||||
How to create a qr code for a google form
|
|
||||||
1,100
|
|
||||||
Log in to see all results
|
|
||||||
--
|
|
||||||
Log in to see all results
|
|
||||||
--
|
|
||||||
Log in to see all results
|
|
||||||
--
|
|
||||||
Log in to see all results
|
|
||||||
--
|
|
||||||
Log in to see all results
|
|
||||||
--
|
|
||||||
View All
|
|
||||||
18,733,729
|
|
||||||
Also ranks for
|
|
||||||
qr code generator free
|
|
||||||
43,300
|
|
||||||
qr code maker
|
|
||||||
52,000
|
|
||||||
create a qr code
|
|
||||||
17,100
|
|
||||||
free qr code generator
|
|
||||||
34,400
|
|
||||||
qr generator
|
|
||||||
25,300
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
Overview: qr code with logo
|
|
||||||
View Cached Page
|
|
||||||
|
|
||||||
Create Report
|
|
||||||
1,600
|
|
||||||
Monthly Volume
|
|
||||||
1,300
|
|
||||||
Estimated Clicks
|
|
||||||
Clicked any result
|
|
||||||
Low
|
|
||||||
81%
|
|
||||||
High
|
|
||||||
Mobile vs Desktop
|
|
||||||
Mobile
|
|
||||||
Desktop
|
|
||||||
Low Mobile
|
|
||||||
Paid clicks
|
|
||||||
Low
|
|
||||||
0‑3%
|
|
||||||
8%
|
|
||||||
High
|
|
||||||
13%+
|
|
||||||
Difficulty
|
|
||||||
48
|
|
||||||
Google Provided Data
|
|
||||||
|
|
||||||
Expand
|
|
||||||
Cost Per Click
|
|
||||||
$0.00
|
|
||||||
Monthly Cost
|
|
||||||
$0.00
|
|
||||||
Search Volume
|
|
||||||
-
|
|
||||||
Advertisers
|
|
||||||
1
|
|
||||||
Homepages
|
|
||||||
25
|
|
||||||
Fresh SV
|
|
||||||
2,900
|
|
||||||
Universal search in SERP
|
|
||||||
291
|
|
||||||
Similar keywords
|
|
||||||
qr code generator with logo
|
|
||||||
4,100
|
|
||||||
qr code with logo
|
|
||||||
1,600
|
|
||||||
create qr code with logo
|
|
||||||
440
|
|
||||||
qr code generator with logo free
|
|
||||||
400
|
|
||||||
android studio qr code generator with logo
|
|
||||||
300
|
|
||||||
Log in to see all results
|
|
||||||
--
|
|
||||||
Log in to see all results
|
|
||||||
--
|
|
||||||
Log in to see all results
|
|
||||||
--
|
|
||||||
Log in to see all results
|
|
||||||
--
|
|
||||||
Log in to see all results
|
|
||||||
--
|
|
||||||
View All
|
|
||||||
17
|
|
||||||
Questions
|
|
||||||
How to make qr code with logo
|
|
||||||
40
|
|
||||||
How to design qr code with logo
|
|
||||||
40
|
|
||||||
How to create qr code with logo
|
|
||||||
28
|
|
||||||
How to make own qr code with logo
|
|
||||||
24
|
|
||||||
How to create your own qr code with logo
|
|
||||||
24
|
|
||||||
Log in to see all results
|
|
||||||
--
|
|
||||||
Log in to see all results
|
|
||||||
--
|
|
||||||
Log in to see all results
|
|
||||||
--
|
|
||||||
Log in to see all results
|
|
||||||
--
|
|
||||||
Log in to see all results
|
|
||||||
--
|
|
||||||
View All
|
|
||||||
37,452,720
|
|
||||||
Also ranks for
|
|
||||||
qr code maker
|
|
||||||
52,000
|
|
||||||
qr code generator free
|
|
||||||
43,300
|
|
||||||
create qr code
|
|
||||||
29,500
|
|
||||||
free qr code generator
|
|
||||||
34,400
|
|
||||||
create a qr code
|
|
||||||
17,100
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
Overview: spotify code generator
|
|
||||||
View Cached Page
|
|
||||||
|
|
||||||
Create Report
|
|
||||||
840
|
|
||||||
Monthly Volume
|
|
||||||
630
|
|
||||||
Estimated Clicks
|
|
||||||
Clicked any result
|
|
||||||
Low
|
|
||||||
76%
|
|
||||||
High
|
|
||||||
Mobile vs Desktop
|
|
||||||
Mobile
|
|
||||||
Desktop
|
|
||||||
Not Enough Data
|
|
||||||
Paid clicks
|
|
||||||
Not Enough Data
|
|
||||||
Difficulty
|
|
||||||
21
|
|
||||||
Google Provided Data
|
|
||||||
|
|
||||||
Expand
|
|
||||||
Cost Per Click
|
|
||||||
$0.00
|
|
||||||
Monthly Cost
|
|
||||||
$0.00
|
|
||||||
Search Volume
|
|
||||||
90
|
|
||||||
Advertisers
|
|
||||||
0
|
|
||||||
Homepages
|
|
||||||
5
|
|
||||||
Fresh SV
|
|
||||||
2,400
|
|
||||||
Universal search in SERP
|
|
||||||
106
|
|
||||||
Similar keywords
|
|
||||||
spotify code generator
|
|
||||||
840
|
|
||||||
spotify premium code generator no survey
|
|
||||||
420
|
|
||||||
spotify premium codes generator
|
|
||||||
300
|
|
||||||
spotify premium code generator no survey 2017
|
|
||||||
290
|
|
||||||
spotify code generator 2019
|
|
||||||
290
|
|
||||||
Log in to see all results
|
|
||||||
--
|
|
||||||
Log in to see all results
|
|
||||||
--
|
|
||||||
Log in to see all results
|
|
||||||
--
|
|
||||||
Log in to see all results
|
|
||||||
--
|
|
||||||
Log in to see all results
|
|
||||||
--
|
|
||||||
View All
|
|
||||||
5
|
|
||||||
Questions
|
|
||||||
How to generate spotify code
|
|
||||||
90
|
|
||||||
How to get spotify premium code free generator 2018
|
|
||||||
70
|
|
||||||
How to get code for spotify premium spotify premium free code generator
|
|
||||||
24
|
|
||||||
Where is spotify pin code generator?
|
|
||||||
12
|
|
||||||
How to generate a spotify code
|
|
||||||
-
|
|
||||||
Log in to see all results
|
|
||||||
--
|
|
||||||
Log in to see all results
|
|
||||||
--
|
|
||||||
Log in to see all results
|
|
||||||
--
|
|
||||||
Log in to see all results
|
|
||||||
--
|
|
||||||
Log in to see all results
|
|
||||||
--
|
|
||||||
View All
|
|
||||||
82,799,750
|
|
||||||
Also ranks for
|
|
||||||
qr code maker
|
|
||||||
52,000
|
|
||||||
spotify codes
|
|
||||||
7,100
|
|
||||||
spotify code
|
|
||||||
5,700
|
|
||||||
qrcode
|
|
||||||
11,900
|
|
||||||
create qr code
|
|
||||||
29,500
|
|
||||||
506
seo-strategy.md
@@ -1,506 +0,0 @@
|
|||||||
## A) Executive summary (max 12 bullets)
|
|
||||||
|
|
||||||
* **Win fast (0–60 days)** by launching a *“wedge” set* of low-KD, high-intent tool pages (WhatsApp / Instagram / vCard / Bulk / PDF) + one differentiated feature hub (**QR Code Analytics + Tracking**) that every tool page upsells into.
|
|
||||||
* **Build an intent ladder**: *Free generator → Dynamic QR → Tracking/Analytics → Bulk/API/Teams → Custom domains + integrations* (this mirrors how category leaders gate value). ([qr-code-generator.com][1])
|
|
||||||
* **Exploit SERP splits**: head terms (“qr code generator”) are crowded with generalist tools (Canva/Adobe) + legacy generators, while **dynamic/tracking** queries skew toward SaaS platforms—your product sweet spot. ([qr-code-generator.com][1])
|
|
||||||
* **Turn “Google QR Code Generator” into a capture page**: Google/Chrome already generates a basic QR for a URL; your angle is *“Chrome is static-only → here’s dynamic + analytics + UTM + campaign dashboards.”* ([Google Hilfe][2])
|
|
||||||
* **Programmatic SEO (pSEO) is mandatory** in this space: competitors scale with templated “solutions” pages by QR type (vCard, WiFi, Spotify, Instagram, etc.). ([qr-code-generator.com][3])
|
|
||||||
* **Avoid pSEO index bloat** with strict canonical + noindex rules and *minimum content thresholds* per template (examples below).
|
|
||||||
* **Differentiate on trust**: QR scams (“quishing”) are rising; bake “safe redirect + link preview + scan security” into product messaging and content. ([Der Guardian][4])
|
|
||||||
* **Make “Barcode Generator” a top-of-funnel traffic engine** (58k SV / KD 22 in your data) but route conversions toward QR analytics + dynamic capabilities; barcode SERPs are full of embed-only utilities and hardware vendors. ([Free Online Barcode Generator by TEC-IT][5])
|
|
||||||
* **Ship IA early**: a scalable sitemap with `/tools/`, `/features/`, `/integrations/`, `/compare/`, `/learn/`, and `/templates/` prevents cannibalization and makes internal linking deterministic.
|
|
||||||
* **Measure leading indicators**: indexation coverage, impressions, tool-page CVR to signup, activation (QR created), and upgrades (dynamic/tracking enabled).
|
|
||||||
* **Link acquisition**: win with embed widgets, UTM/GA4 tracking guides, open-source SDKs, and directory placements (10 angles below).
|
|
||||||
* **Assumptions used** (adjustable): **EN**, **Global/US focus**, **Freemium SaaS → subscription**, primary conversion **signup → generate → enable tracking**.
|
|
||||||
|
|
||||||
---
|
|
||||||
|
|
||||||
## B) Competitor landscape (top competitors + what they do best + weaknesses)
|
|
||||||
|
|
||||||
Below is a **SERP-driven** view of recurring domains across “QR code generator”, “dynamic QR”, “tracking/analytics”, and “type” queries (vCard/Instagram/Spotify/etc.):
|
|
||||||
|
|
||||||
### 1) QR Code Generator (Bitly) — `qr-code-generator.com`
|
|
||||||
|
|
||||||
**Best at**
|
|
||||||
|
|
||||||
* Clear **feature ladder + gating** (static free → dynamic/analytics → bulk/API/teams). ([qr-code-generator.com][1])
|
|
||||||
* Massive **“solutions” library** (SEO scale by QR type). ([qr-code-generator.com][3])
|
|
||||||
**Weaknesses to exploit**
|
|
||||||
* Heavy gating/upsell can frustrate “free” intent.
|
|
||||||
* Many “solution” pages trend toward **marketing copy**—opportunity for deeper “how-to + templates + examples + tracking instrumentation”.
|
|
||||||
|
|
||||||
### 2) QRCode Monkey — `qrcode-monkey.com`
|
|
||||||
|
|
||||||
**Best at**
|
|
||||||
|
|
||||||
* “Free + design/customization” positioning; vectors/print talk resonates. ([QRCode Monkey][6])
|
|
||||||
* Has an **API pitch** (some scaling). ([QRCode Monkey][7])
|
|
||||||
**Weaknesses**
|
|
||||||
* Less credible on analytics-first workflows; your advantage is *campaign measurement + dashboards*.
|
|
||||||
|
|
||||||
### 3) The QR Code Generator (TQRCG) — `the-qrcode-generator.com`
|
|
||||||
|
|
||||||
**Best at**
|
|
||||||
|
|
||||||
* Trust messaging: “free means free” + warns about expiring codes. ([the-qrcode-generator.com][8])
|
|
||||||
**Weaknesses**
|
|
||||||
* Content often “how-to guide” oriented; you can outrank with **better tools + richer templates + integrations**.
|
|
||||||
|
|
||||||
### 4) Hovercode — `hovercode.com`
|
|
||||||
|
|
||||||
**Best at**
|
|
||||||
|
|
||||||
* Product-led pages (“create now”) + “trackable QR codes” positioning. ([Hovercode][9])
|
|
||||||
* pSEO via many generator variants (logo, circle, etc.). ([Hovercode][10])
|
|
||||||
**Weaknesses**
|
|
||||||
* Opportunity to beat them with **comparison pages + GA4 instrumentation + bulk workflows**.
|
|
||||||
|
|
||||||
### 5) Scanova — `scanova.io`
|
|
||||||
|
|
||||||
**Best at**
|
|
||||||
|
|
||||||
* Strong **feature pages**: dynamic, tracking, security, landing pages (good enterprise pitch). ([Scanova][11])
|
|
||||||
**Weaknesses**
|
|
||||||
* Many blogs are long; you can win snippets with **structured templates + FAQs + exact steps + schema**.
|
|
||||||
|
|
||||||
### 6) Flowcode — `flowcode.com`
|
|
||||||
|
|
||||||
**Best at**
|
|
||||||
|
|
||||||
* Owns “offline conversions + analytics” narrative (enterprise). ([flowcode.com][12])
|
|
||||||
**Weaknesses**
|
|
||||||
* Often skewed to demos; you can capture SMB/free intent and upgrade later.
|
|
||||||
|
|
||||||
### 7) QRCodeChimp — `qrcodechimp.com`
|
|
||||||
|
|
||||||
**Best at**
|
|
||||||
|
|
||||||
* Huge template catalog (menus, forms, cards, etc.) + GA integration content. ([QR Code Chimp][13])
|
|
||||||
**Weaknesses**
|
|
||||||
* Template sprawl risks thin pages—beat them on **quality thresholds + tighter topical clusters**.
|
|
||||||
|
|
||||||
### 8) ME-QR — `me-qr.com`
|
|
||||||
|
|
||||||
**Best at**
|
|
||||||
|
|
||||||
* Aggressive pSEO for types (PDF/Instagram/WhatsApp/Spotify). ([me-qr.com][14])
|
|
||||||
**Weaknesses**
|
|
||||||
* Many pages feel commodity; you can differentiate with **better UX + security + analytics clarity**.
|
|
||||||
|
|
||||||
### 9) Canva / Adobe Express (generalists)
|
|
||||||
|
|
||||||
* Canva and Adobe rank on “free QR code generator” intent via ecosystem pull. ([Canva][15])
|
|
||||||
**Your play**: don’t “out-brand” them—**out-specialize** on dynamic/tracking/bulk/API and win long-tail + mid-tail.
|
|
||||||
|
|
||||||
### 10) Barcode generators (for your “Barcode Generator” gold mine)
|
|
||||||
|
|
||||||
* TEC-IT (embed + backlink requirement) and Barcodes Inc (hardware upsell). ([Free Online Barcode Generator by TEC-IT][5])
|
|
||||||
**Your play**: best-in-class UX + formats + bulk + API docs + “barcode vs QR” education to route users into QR analytics.
|
|
||||||
|
|
||||||
---
|
|
||||||
|
|
||||||
## C) Keyword clusters + priority order (explain why)
|
|
||||||
|
|
||||||
### Intent model (how to cluster)
|
|
||||||
|
|
||||||
* **Do / Generate (tool intent)**: “X QR code generator”, “bulk”, “PDF to QR”, “WiFi QR”, “Instagram QR”, “WhatsApp QR”.
|
|
||||||
* **Decide (commercial investigation)**: “dynamic vs static”, “trackable QR codes”, “best QR code generator”, “QR code analytics”.
|
|
||||||
* **Implement (technical)**: “QR code API”, “track QR codes in GA4”, “UTM QR code”, “bulk QR from CSV / Sheets”.
|
|
||||||
* **Navigate (platform-native)**: “Google QR code generator”, “Spotify code generator”, “Instagram QR code”.
|
|
||||||
|
|
||||||
### Priority ladder (P0 → P2)
|
|
||||||
|
|
||||||
**P0 (launch first; fastest to rank + high upsell value)**
|
|
||||||
|
|
||||||
1. **WhatsApp QR Code Generator** (SV 180 / KD 17 in your list) → high intent + low KD + SMB conversion path.
|
|
||||||
2. **Instagram QR Code Generator** (SV 440 / KD 23) → same logic + add “IG has native QR; here’s branded + tracked campaigns”. ([Instagram Hilfe][16])
|
|
||||||
3. **vCard QR Code Generator** (SV 180 / KD 24) → business use case; great signup driver.
|
|
||||||
4. **QR Code Analytics** (SV 135 / KD 24) → *your core differentiator*; becomes the internal-link destination from every tool page.
|
|
||||||
5. **Trackable QR Codes** (SV 135 / KD 0) → perfect wedge term; map to a commercial page that demonstrates tracking dashboard and “dynamic”.
|
|
||||||
6. **Barcode Generator** (58k / KD 22) → big traffic engine; route to QR features + analytics.
|
|
||||||
|
|
||||||
**P1 (build authority + revenue features)**
|
|
||||||
|
|
||||||
* **Bulk QR Code Generator** (SV 360 / KD 33)
|
|
||||||
* **QR Code Tracking** (SV 320 / KD 37) (map carefully vs “analytics”)
|
|
||||||
* **WiFi QR Code Generator** (SV 1,400 / KD 34)
|
|
||||||
* **PDF to QR Code Generator** (SV ~260 / KD 36, CPC high)
|
|
||||||
* **Google QR Code Generator** (SV 8k) (capture via “Chrome static QR” + upsell). ([Google Hilfe][2])
|
|
||||||
|
|
||||||
**P2 (long-term mid/high competition)**
|
|
||||||
|
|
||||||
* **Dynamic QR Code Generator** (SV 1,200 / KD 43)
|
|
||||||
* **Free QR Code Generator** (SV 34,400 / KD 34)
|
|
||||||
* **QR code maker** (SV 52k / KD 47)
|
|
||||||
* **QR Code Generator** (SV 370k) — pillar target supported by everything above.
|
|
||||||
|
|
||||||
### Cannibalization rule (critical)
|
|
||||||
|
|
||||||
* **One primary intent per page.** Example mapping:
|
|
||||||
|
|
||||||
* `/features/qr-code-analytics/` = “qr code analytics” (feature/commercial)
|
|
||||||
* `/learn/qr-code-tracking/` = “qr code tracking” (educational/how it works + GA4)
|
|
||||||
* `/tools/trackable-qr-code-generator/` = “trackable qr codes” (tool + demo dashboard)
|
|
||||||
|
|
||||||
---
|
|
||||||
|
|
||||||
## D) Recommended sitemap / IA (with URL examples)
|
|
||||||
|
|
||||||
### Core structure (scalable + pSEO-safe)
|
|
||||||
|
|
||||||
**1) Tools (transactional)**
|
|
||||||
|
|
||||||
* `/qr-code-generator/` (core tool hub, not a blog post)
|
|
||||||
* `/tools/vcard-qr-code-generator/`
|
|
||||||
* `/tools/whatsapp-qr-code-generator/`
|
|
||||||
* `/tools/instagram-qr-code-generator/`
|
|
||||||
* `/tools/wifi-qr-code-generator/`
|
|
||||||
* `/tools/pdf-to-qr-code-generator/`
|
|
||||||
* `/tools/bulk-qr-code-generator/`
|
|
||||||
* `/barcode-generator/` (separate category; include QR/2D + 1D)
|
|
||||||
|
|
||||||
**2) Features (commercial)**
|
|
||||||
|
|
||||||
* `/features/dynamic-qr-codes/`
|
|
||||||
* `/features/qr-code-analytics/`
|
|
||||||
* `/features/qr-code-campaigns/` (folders, tags, exports)
|
|
||||||
* `/features/custom-domain/`
|
|
||||||
* `/features/teams-roles/`
|
|
||||||
* `/features/security-anti-phishing/` (trust wedge; see “quishing”). ([Der Guardian][4])
|
|
||||||
|
|
||||||
**3) Integrations (high-intent + linkable)**
|
|
||||||
|
|
||||||
* `/integrations/google-analytics-4/`
|
|
||||||
* `/integrations/hubspot/`
|
|
||||||
* `/integrations/zapier/`
|
|
||||||
* `/integrations/shopify/`
|
|
||||||
(Ship GA4 first; it supports your “tracking” narrative.)
|
|
||||||
|
|
||||||
**4) Learn Hub (educational; supports rankings + conversions)**
|
|
||||||
|
|
||||||
* `/learn/dynamic-vs-static-qr-codes/`
|
|
||||||
* `/learn/how-to-track-qr-codes-in-ga4/`
|
|
||||||
* `/learn/qr-code-size-guide/`
|
|
||||||
* `/learn/qr-code-error-correction/`
|
|
||||||
* `/learn/google-qr-code-generator/` (Chrome’s built-in QR + limitations). ([Google Hilfe][2])
|
|
||||||
* `/learn/spotify-code-generator/` (Spotify Codes explainer + CTA to your tool). ([SpotifyCodes][17])
|
|
||||||
|
|
||||||
**5) Templates / Use cases (pSEO with guardrails)**
|
|
||||||
|
|
||||||
* `/templates/restaurant-menu-qr/`
|
|
||||||
* `/templates/business-card-qr/`
|
|
||||||
* `/templates/event-check-in-qr/`
|
|
||||||
Each template must include: examples, copy/paste CTAs, recommended QR type, tracking setup, and links to the tool.
|
|
||||||
|
|
||||||
### Breadcrumb + internal linking rules (hub-and-spoke)
|
|
||||||
|
|
||||||
* **Tool pages** link up to:
|
|
||||||
|
|
||||||
* `/features/qr-code-analytics/`
|
|
||||||
* `/features/dynamic-qr-codes/`
|
|
||||||
* `/learn/dynamic-vs-static-qr-codes/`
|
|
||||||
* the **closest** templates + GA4 integration (where relevant)
|
|
||||||
* **Learn pages** link down to:
|
|
||||||
|
|
||||||
* the *single best-matching tool page* (primary CTA)
|
|
||||||
* 2–4 related learn pages (cluster reinforcement)
|
|
||||||
* **Integrations** link to:
|
|
||||||
|
|
||||||
* analytics feature + tracking learn guide + relevant tool pages
|
|
||||||
|
|
||||||
---
|
|
||||||
|
|
||||||
## E) “Wedge” plan: what to launch first to rank within 30–60 days
|
|
||||||
|
|
||||||
### Launch set (minimum viable topical authority)
|
|
||||||
|
|
||||||
**Week 1–3 shipping goal: 8 pages that create a ranking flywheel**
|
|
||||||
|
|
||||||
**Tool pages (P0)**
|
|
||||||
|
|
||||||
1. `/tools/whatsapp-qr-code-generator/` (KD 17)
|
|
||||||
2. `/tools/instagram-qr-code-generator/` (KD 23)
|
|
||||||
3. `/tools/vcard-qr-code-generator/` (KD 24)
|
|
||||||
4. `/tools/trackable-qr-code-generator/` (KD 0 term → commercial wedge)
|
|
||||||
5. `/barcode-generator/` (traffic engine)
|
|
||||||
|
|
||||||
**Feature + Learn pages (conversion + trust)**
|
|
||||||
6) `/features/qr-code-analytics/` (your core differentiator)
|
|
||||||
7) `/learn/dynamic-vs-static-qr-codes/` (decision content)
|
|
||||||
8) `/learn/google-qr-code-generator/` (steal “Google/Chrome” demand; Chrome is static URL sharing). ([Google Hilfe][2])
|
|
||||||
|
|
||||||
### Why this ranks fast on a new domain
|
|
||||||
|
|
||||||
* Low-KD type terms are less “brand dominated” than head terms.
|
|
||||||
* Every tool page naturally links to analytics + dynamic, so **internal PageRank concentrates** on your money features.
|
|
||||||
* “Google QR code generator” content can win featured snippets because it’s step-based and grounded in official Chrome documentation. ([Google Hilfe][2])
|
|
||||||
|
|
||||||
---
|
|
||||||
|
|
||||||
## F) 90-day execution roadmap (week-by-week)
|
|
||||||
|
|
||||||
### Weeks 1–2: Foundations (technical + tracking + SEO hygiene)
|
|
||||||
|
|
||||||
* **Tech SEO**
|
|
||||||
|
|
||||||
* Set up GSC + GA4 (or PostHog) + server-side event pipeline for “QR created / downloaded / scan events”.
|
|
||||||
* Define **indexation policy**: which templates get indexed, which are noindex.
|
|
||||||
* Implement: XML sitemaps by type (`/sitemap-tools.xml`, `/sitemap-learn.xml`), robots, canonicals, hreflang plan (even if EN-only now).
|
|
||||||
* **Schema baseline**
|
|
||||||
|
|
||||||
* Organization, WebSite, BreadcrumbList sitewide.
|
|
||||||
* SoftwareApplication/WebApplication on core tool hub.
|
|
||||||
* **Information architecture**
|
|
||||||
|
|
||||||
* Ship nav for Tools / Features / Learn / Pricing / API.
|
|
||||||
|
|
||||||
### Week 3: Ship the wedge tool pages (P0)
|
|
||||||
|
|
||||||
* Publish WhatsApp / Instagram / vCard / Trackable tool pages.
|
|
||||||
* Each ships with: FAQ, examples, “Static vs Dynamic” block, “Enable analytics” CTA, and internal links to `/features/qr-code-analytics/`.
|
|
||||||
|
|
||||||
### Week 4: Ship the analytics feature hub + dynamic feature hub
|
|
||||||
|
|
||||||
* `/features/qr-code-analytics/` + `/features/dynamic-qr-codes/`
|
|
||||||
* Add product screenshots/GIFs and a simple “How tracking works” diagram (dynamic redirect → logging → dashboard).
|
|
||||||
|
|
||||||
### Week 5: Learn cluster for decision + “Google QR”
|
|
||||||
|
|
||||||
* `/learn/dynamic-vs-static-qr-codes/`
|
|
||||||
* `/learn/google-qr-code-generator/` (include “Chrome creates QR for a page” and limitations). ([Google Hilfe][2])
|
|
||||||
|
|
||||||
### Week 6: Barcode Generator tool + “Barcode vs QR” guide
|
|
||||||
|
|
||||||
* Launch `/barcode-generator/` + `/learn/barcode-vs-qr-code/` to route barcode traffic into QR use cases.
|
|
||||||
* Add bulk export formats and “print quality” section to compete with incumbents. ([Free Online Barcode Generator by TEC-IT][5])
|
|
||||||
|
|
||||||
### Week 7: Bulk + PDF tools (P1)
|
|
||||||
|
|
||||||
* `/tools/bulk-qr-code-generator/` (CSV upload; align with SERP expectations like “download ZIP”). ([quickchart.io][18])
|
|
||||||
* `/tools/pdf-to-qr-code-generator/` (CPC-heavy query → strong conversion)
|
|
||||||
|
|
||||||
### Week 8: GA4 integration page (linkable asset)
|
|
||||||
|
|
||||||
* `/integrations/google-analytics-4/`
|
|
||||||
* Companion guide: `/learn/how-to-track-qr-codes-in-ga4/` (UTMs, events, attribution).
|
|
||||||
|
|
||||||
### Week 9: Authority pieces (start the pillar support)
|
|
||||||
|
|
||||||
Publish 2 of these 5 (see section below):
|
|
||||||
|
|
||||||
* “QR Code Size Guide”
|
|
||||||
* “QR Code Error Correction Explained”
|
|
||||||
* “UTM Builder for QR Campaigns”
|
|
||||||
* “QR Code Security / Quishing Prevention”
|
|
||||||
* “QR Code Analytics Benchmarks”
|
|
||||||
|
|
||||||
### Week 10: pSEO expansion (controlled)
|
|
||||||
|
|
||||||
* Add 10–20 additional `/tools/{type}/` pages (WiFi, email, SMS, etc.) only if they meet your thin-content threshold.
|
|
||||||
* Add 10–20 `/templates/` pages tied to real use cases.
|
|
||||||
|
|
||||||
### Week 11: Comparisons (conversion-focused)
|
|
||||||
|
|
||||||
* `/compare/qr-code-generator-vs-canva/`
|
|
||||||
* `/compare/qr-code-generator-vs-qrcode-monkey/`
|
|
||||||
* `/compare/dynamic-qr-code-generators/` (listicle with your wedge terms)
|
|
||||||
|
|
||||||
### Week 12–13: Iterate based on GSC data
|
|
||||||
|
|
||||||
* Optimize pages with impressions but low CTR (titles/meta).
|
|
||||||
* Expand FAQs to match PAA.
|
|
||||||
* Strengthen internal links from high-impression pages to money pages.
|
|
||||||
|
|
||||||
---
|
|
||||||
|
|
||||||
## G) Page briefs for the top 5 money pages (H1, sections, schema, CTA, internal links)
|
|
||||||
|
|
||||||
### 1) Dynamic QR Code Generator
|
|
||||||
|
|
||||||
**URL:** `/features/dynamic-qr-codes/` (feature) + optional `/tools/dynamic-qr-code-generator/` (tool demo)
|
|
||||||
**Primary keyword:** dynamic qr code generator
|
|
||||||
**H1:** Dynamic QR Code Generator (Editable + Trackable)
|
|
||||||
**Sections (order matters)**
|
|
||||||
|
|
||||||
* What is a dynamic QR code? (vs static)
|
|
||||||
* Edit destination after printing (URL, file, page)
|
|
||||||
* Tracking/analytics overview (scans, time, location, device)
|
|
||||||
* Use cases (menus, flyers, events, packaging)
|
|
||||||
* How it works (redirect + logging)
|
|
||||||
* Pricing preview + free tier
|
|
||||||
* FAQ (Do they expire? Can I change the URL? Can I export data?)
|
|
||||||
**Schema**
|
|
||||||
* FAQPage
|
|
||||||
* SoftwareApplication (or WebApplication)
|
|
||||||
* BreadcrumbList
|
|
||||||
**Primary CTA**
|
|
||||||
* “Create a dynamic QR code” (signup)
|
|
||||||
**Internal links**
|
|
||||||
* To `/features/qr-code-analytics/`, `/learn/dynamic-vs-static-qr-codes/`, `/integrations/google-analytics-4/`
|
|
||||||
|
|
||||||
> Competitor pattern to beat: strong gating + feature ladder is common. ([qr-code-generator.com][1])
|
|
||||||
|
|
||||||
---
|
|
||||||
|
|
||||||
### 2) QR Code Analytics
|
|
||||||
|
|
||||||
**URL:** `/features/qr-code-analytics/`
|
|
||||||
**Primary keyword:** qr code analytics
|
|
||||||
**H1:** QR Code Analytics: Track Scans, Measure Campaign ROI
|
|
||||||
**Sections**
|
|
||||||
|
|
||||||
* What you can measure (total/unique scans, geo, device, time)
|
|
||||||
* Campaign organization (folders/tags, UTM conventions)
|
|
||||||
* Export + integrations (GA4 first)
|
|
||||||
* Dashboards (examples: restaurant menu, event check-in, retail)
|
|
||||||
* Data accuracy & privacy notes
|
|
||||||
* FAQ (“Can I track a static QR?” → explain dynamic requirement)
|
|
||||||
**Schema**
|
|
||||||
* FAQPage
|
|
||||||
* SoftwareApplication
|
|
||||||
* BreadcrumbList
|
|
||||||
**CTA**
|
|
||||||
* “Enable analytics on your QR code” (upgrade nudges)
|
|
||||||
**Internal links**
|
|
||||||
* From **every tool page** (sticky sidebar “Track scans with Analytics”)
|
|
||||||
* To `/learn/how-to-track-qr-codes-in-ga4/`
|
|
||||||
|
|
||||||
> This is exactly what SaaS competitors highlight for upsell. ([flowcode.com][12])
|
|
||||||
|
|
||||||
---
|
|
||||||
|
|
||||||
### 3) Bulk QR Code Generator
|
|
||||||
|
|
||||||
**URL:** `/tools/bulk-qr-code-generator/`
|
|
||||||
**Primary keyword:** bulk qr code generator
|
|
||||||
**H1:** Bulk QR Code Generator (CSV Upload → Download ZIP)
|
|
||||||
**Sections**
|
|
||||||
|
|
||||||
* Upload CSV / paste data / Google Sheets import (later)
|
|
||||||
* Output formats (PNG/SVG/PDF), naming conventions
|
|
||||||
* Dynamic vs static toggle per row (upsell!)
|
|
||||||
* Common workflows: inventory labels, invites, coupons
|
|
||||||
* QA: scan testing, error correction, print sizing
|
|
||||||
* FAQ
|
|
||||||
**Schema**
|
|
||||||
* FAQPage
|
|
||||||
* HowTo (only if you include step-by-step with images)
|
|
||||||
**CTA**
|
|
||||||
* “Generate bulk QR codes” + secondary “Enable tracking for all”
|
|
||||||
**Internal links**
|
|
||||||
* To `/features/qr-code-analytics/` + `/features/dynamic-qr-codes/`
|
|
||||||
|
|
||||||
> SERPs often expect “free bulk + zip”; match that intent. ([QR Explore][19])
|
|
||||||
|
|
||||||
---
|
|
||||||
|
|
||||||
### 4) vCard QR Code Generator
|
|
||||||
|
|
||||||
**URL:** `/tools/vcard-qr-code-generator/`
|
|
||||||
**Primary keyword:** vCard qr code generator
|
|
||||||
**H1:** vCard QR Code Generator (Digital Business Card)
|
|
||||||
**Sections**
|
|
||||||
|
|
||||||
* vCard fields + preview (VCF standard)
|
|
||||||
* iOS/Android compatibility + best practices
|
|
||||||
* Static vs dynamic vCard (edit contact later)
|
|
||||||
* Examples: sales reps, events, storefront QR
|
|
||||||
* CTA: “Add scan tracking to your business cards”
|
|
||||||
* FAQ (works on Android/iOS; does it expire; can I add photo; etc.)
|
|
||||||
**Schema**
|
|
||||||
* FAQPage
|
|
||||||
* SoftwareApplication
|
|
||||||
**CTA**
|
|
||||||
* “Create vCard QR” + upsell “Track scans / update later”
|
|
||||||
**Internal links**
|
|
||||||
* To `/learn/dynamic-vs-static-qr-codes/` + analytics feature
|
|
||||||
|
|
||||||
---
|
|
||||||
|
|
||||||
### 5) QR Code API (developer money page)
|
|
||||||
|
|
||||||
**URL:** `/features/qr-code-api/` + `/docs/api/`
|
|
||||||
**Primary keyword:** qr code api, qr code generator api
|
|
||||||
**H1:** QR Code API (Generate QR Codes at Scale)
|
|
||||||
**Sections**
|
|
||||||
|
|
||||||
* Authentication, endpoints, rate limits
|
|
||||||
* Generate static/dynamic, bulk endpoints, webhooks (scan events)
|
|
||||||
* Code samples (JS/Python/cURL)
|
|
||||||
* Compliance + uptime
|
|
||||||
* Pricing tiers
|
|
||||||
**Schema**
|
|
||||||
* SoftwareApplication (feature page)
|
|
||||||
* TechArticle (docs pages)
|
|
||||||
**CTA**
|
|
||||||
* “Get API key” / “Start trial”
|
|
||||||
**Internal links**
|
|
||||||
* From bulk generator + analytics pages
|
|
||||||
|
|
||||||
---
|
|
||||||
|
|
||||||
## H) Risks + mitigation (cannibalization, programmatic pitfalls, E-E-A-T, index bloat)
|
|
||||||
|
|
||||||
### 1) Keyword cannibalization (very likely in this niche)
|
|
||||||
|
|
||||||
**Risk:** “qr code tracking”, “trackable qr codes”, “qr code analytics” collapse into the same intent.
|
|
||||||
**Mitigation:** hard-map intents:
|
|
||||||
|
|
||||||
* Analytics = feature/commercial
|
|
||||||
* Tracking = learn/how-to + GA4
|
|
||||||
* Trackable QR = tool landing with demo dashboard
|
|
||||||
|
|
||||||
### 2) Programmatic SEO thin pages / index bloat
|
|
||||||
|
|
||||||
**Risk:** hundreds of near-identical “{type} QR generator” pages get ignored/deindexed.
|
|
||||||
**Mitigation (hard rules)**
|
|
||||||
|
|
||||||
* Index only pages that include **unique elements**:
|
|
||||||
|
|
||||||
* type-specific fields + validation (real tool)
|
|
||||||
* 2–3 examples
|
|
||||||
* type-specific FAQs
|
|
||||||
* type-specific tracking use case
|
|
||||||
* **Noindex**: parameter pages, empty states, duplicate locale stubs, search/filter pages.
|
|
||||||
|
|
||||||
### 3) Trust & QR scam concerns (reputation risk, but also opportunity)
|
|
||||||
|
|
||||||
**Risk:** Users fear scanning QR codes; Google may reward safety content.
|
|
||||||
**Mitigation:** ship “Security” feature page + learn content about safe scanning and link previews, referencing real-world scam patterns. ([Der Guardian][4])
|
|
||||||
|
|
||||||
### 4) Over-reliance on “Google QR Code Generator” traffic
|
|
||||||
|
|
||||||
**Risk:** users only want Chrome’s built-in static QR and bounce.
|
|
||||||
**Mitigation:** page structure: “How to do it in Chrome” (satisfy intent) → “When you need dynamic + analytics” (convert). ([Google Hilfe][2])
|
|
||||||
|
|
||||||
### 5) E-E-A-T gap vs incumbents
|
|
||||||
|
|
||||||
**Risk:** new domain lacks credibility.
|
|
||||||
**Mitigation**
|
|
||||||
|
|
||||||
* Publish 2–3 “benchmarks / research” assets with original data (even small): scan-rate benchmarks, print-size testing, or campaign case studies.
|
|
||||||
* Add transparent pricing, uptime, privacy policy, and author/editor pages for Learn content.
|
|
||||||
|
|
||||||
---
|
|
||||||
|
|
||||||
If you tell me your **target market (US vs DACH vs global), language (EN/DE), and monetization (freemium vs trials)**, I can *tighten the sitemap + 90-day calendar* so it perfectly matches your rollout (especially internationalization + URL strategy).
|
|
||||||
|
|
||||||
[1]: https://www.qr-code-generator.com/?utm_source=chatgpt.com "QR Code Generator | Create Your Free QR Codes"
|
|
||||||
[2]: https://support.google.com/chrome/answer/10051760?co=GENIE.Platform%3DDesktop&hl=en&utm_source=chatgpt.com "Share pages in Chrome - Computer"
|
|
||||||
[3]: https://www.qr-code-generator.com/solutions/?utm_source=chatgpt.com "QR Code Solution for Every Purpose"
|
|
||||||
[4]: https://www.theguardian.com/money/2025/may/25/qr-code-scam-what-is-quishing-drivers-app-phone-parking-payment?utm_source=chatgpt.com "'Pay here': the QR code 'quishing' scam targeting drivers"
|
|
||||||
[5]: https://barcode.tec-it.com/en?utm_source=chatgpt.com "Free Online Barcode Generator: Create Barcodes for Free!"
|
|
||||||
[6]: https://www.qrcode-monkey.com/?utm_source=chatgpt.com "QRCode Monkey - The free QR Code Generator to create ..."
|
|
||||||
[7]: https://www.qrcode-monkey.com/de/qr-code-service/?utm_source=chatgpt.com "QR Code API for Static Codes"
|
|
||||||
[8]: https://www.the-qrcode-generator.com/?utm_source=chatgpt.com "The QR Code Generator (TQRCG): Create Free QR Codes"
|
|
||||||
[9]: https://hovercode.com/?utm_source=chatgpt.com "QR Code Generator | Create Free Dynamic QR Codes"
|
|
||||||
[10]: https://hovercode.com/circle-qr-code-generator/?utm_source=chatgpt.com "Generate circle QR codes (no sign up required)"
|
|
||||||
[11]: https://scanova.io/features/?utm_source=chatgpt.com "Powerful features for all QR Code use cases"
|
|
||||||
[12]: https://www.flowcode.com/product/analytics?utm_source=chatgpt.com "Gain insight into your offline marketing with in-depth Analytics"
|
|
||||||
[13]: https://www.qrcodechimp.com/qr-code-analytics-guide/?utm_source=chatgpt.com "QR Code Analytics: Track, Analyze & Optimize Your ..."
|
|
||||||
[14]: https://me-qr.com/qr-code-generator/pdf?srsltid=AfmBOooK1o7kkjaSizlEOWcEcYcDWfKhZuuM3XvrJGQlm2xdiTbw1exS&utm_source=chatgpt.com "Create QR Code For PDF FREE"
|
|
||||||
[15]: https://www.canva.com/qr-code-generator/?utm_source=chatgpt.com "Free QR Code Generator - Create QR codes with ease"
|
|
||||||
[16]: https://help.instagram.com/925529167647849/?utm_source=chatgpt.com "Find and customize the QR code of your Instagram profile"
|
|
||||||
[17]: https://www.spotifycodes.com/?utm_source=chatgpt.com "Spotify Codes"
|
|
||||||
[18]: https://quickchart.io/bulk-qr-code-generator/?utm_source=chatgpt.com "Bulk QR Code Generator | Custom colors and logo, free"
|
|
||||||
[19]: https://qrexplore.com/generate/?utm_source=chatgpt.com "Bulk QR Code Generator"
|
|
||||||
156
seo_2026_jan.md
@@ -1,156 +0,0 @@
|
|||||||
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 1k–10k/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?
|
|
||||||
@@ -1,13 +0,0 @@
|
|||||||
{
|
|
||||||
"type": "service_account",
|
|
||||||
"project_id": "gen-lang-client-0595806638",
|
|
||||||
"private_key_id": "e44bc1717f1cf413521149de272bf13bfa89a336",
|
|
||||||
"private_key": "-----BEGIN PRIVATE KEY-----\nMIIEvQIBADANBgkqhkiG9w0BAQEFAASCBKcwggSjAgEAAoIBAQC0xJkozHODpcpD\nu3dTHPfprZk6eKiOT05h+uG8Clm8i8LLaS/eHT+B02qxFYMBX0VH9O2GvPp/VnfC\nB/Clc7bofN5VDpQMjVUiPDqMbUVEAiQHNOTp9pkfJltaHAl/J5Cc/DccCaOn89xT\nFD5b7dTn29suuBZHTqsaFDlydnU2xJAwcrWBm7/A0JZM85d76yhY0Jxcg9w8XlpE\n+TWN8OxSUIfubaac0mfI40RH2EfugmA7M45t7B3sEbmHk5tVQSItvncz2ls9fUE4\neB6u4foMFp4Z9k5Ejs7y4N3Yft0JWS+RjI0bcvvvQ/wcnDfcwCdDFFn2Y+hflKMm\nS9+ZRnmBAgMBAAECggEAAztAeo3JifZD3nzEUcDte9cHgN7AMtlJ3Wvc7va5Sw50\nizkCmSlwPoc4/0MvoMo0+701JVxbenXveMpEb3fZMoszkdU9U9iPZCfzB4wQErOa\nppuprbbOXtO9JzZVinWzflPSIUVK16lUVvYVrmfpHYou1G/dIMIXQkVsD7NR9t/B\nafD0w/q1nwwyPB08BjSemKXDQo6NF0cE/TIvaMj8vtxuouAL+fea0n/XxMQNoIoJ\nF+pJtPQ1hkQrpayzuj3smQ11PFpYuvsZHuS3dG9j4gPjGClezK3Sflt7vwNywIRc\ntJ0Qx58on0dy0YnppMWrHh/nykraVLusvMI04joqwQKBgQDlE1Mbi8dpeKn7zkV9\nLS/O6S5Ql2k2G6KxI8GHn3qxB5yfU8G2xqk64r04YB6SMCXscIQu1Tmro8kDMTZk\n5b/issH3+7uqGcJMYhZczWsjax3S1ugepXt29dF26VnbyfvD7h9qleKLhIq32z9P\nxzZGhptTCa0swypi7prNE0MhZwKBgQDKA75g8UhVULA6q3hFEG+24ICd3Gekdz1y\nmaDrPjSJmeMSUlDl4QhGRbZBSJcAfcFKk4+Nme3sTYvjMMz6per4a5TC/+IlSufm\nOSL+CSVijvVYwCMyLyiAcm5Pqcjw16S6enHIidnOYP8e8OM0H2aNKfFTKq30B3ww\nAF8ipa+01wKBgQC24JaYhx7LtOj/fc08AbcJGF9BN59m8ukPQdxeyZLJgaooCFW9\n9RtlR16IgzPkwUuFVs4wFUnVHQx83+zs3/4wnUT9FJrdUXMsR6JStCu0Ou+0Qp1M\n2g+XCOgQZnq2XKoB4ThzfvU9LLMR1JbWudM6unuF71OxSJ2uHY636YjOQQKBgBs6\n+fSTUY6+e6LM7j9RAd4C0RN2XDodIJlMABb1oZtStPsJQYJbHQRr7S9Lm58jVGS7\nE0ShFSMfKNYNA/RdXRjzV3AZkeA5Ap1T4lWf4fwxDP1TmOrw1GLMCfaPClj8mGXS\nj3farRNWm80N53JlMSuiFbeCL0SPpbvKsQg4kUCtAoGAUORyhW70nhZJ1BbmvyRf\n17fcwenK/3GmWgqsrzN7/ucPwjqIzLGVoAXd2euxpE49/VW2xYpJjyHJHuoXDc66\n+AUog0bsxcKpM5tL3VelQl3SkUlCG7jYe20rMm01y35uM2REvQv3/r9F7Bbaq/9n\nSCwu/45QobgLCUx0B7wDqWA=\n-----END PRIVATE KEY-----\n",
|
|
||||||
"client_email": "indexer@gen-lang-client-0595806638.iam.gserviceaccount.com",
|
|
||||||
"client_id": "111279247752160222047",
|
|
||||||
"auth_uri": "https://accounts.google.com/o/oauth2/auth",
|
|
||||||
"token_uri": "https://oauth2.googleapis.com/token",
|
|
||||||
"auth_provider_x509_cert_url": "https://www.googleapis.com/oauth2/v1/certs",
|
|
||||||
"client_x509_cert_url": "https://www.googleapis.com/robot/v1/metadata/x509/indexer%40gen-lang-client-0595806638.iam.gserviceaccount.com",
|
|
||||||
"universe_domain": "googleapis.com"
|
|
||||||
}
|
|
||||||
@@ -14,20 +14,6 @@ import { calculateContrast, cn } from '@/lib/utils';
|
|||||||
import { useTranslation } from '@/hooks/useTranslation';
|
import { useTranslation } from '@/hooks/useTranslation';
|
||||||
import { useCsrf } from '@/hooks/useCsrf';
|
import { useCsrf } from '@/hooks/useCsrf';
|
||||||
import { showToast } from '@/components/ui/Toast';
|
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
|
// Content-type specific frame options
|
||||||
const getFrameOptionsForContentType = (contentType: string) => {
|
const getFrameOptionsForContentType = (contentType: string) => {
|
||||||
@@ -48,14 +34,6 @@ const getFrameOptionsForContentType = (contentType: string) => {
|
|||||||
return [...baseOptions, { id: 'chatme', label: 'Chat Me' }, { id: 'whatsapp', label: 'WhatsApp' }];
|
return [...baseOptions, { id: 'chatme', label: 'Chat Me' }, { id: 'whatsapp', label: 'WhatsApp' }];
|
||||||
case 'TEXT':
|
case 'TEXT':
|
||||||
return [...baseOptions, { id: 'read', label: 'Read' }, { id: 'info', label: 'Info' }];
|
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:
|
default:
|
||||||
return [...baseOptions, { id: 'website', label: 'Website' }, { id: 'visit', label: 'Visit' }];
|
return [...baseOptions, { id: 'website', label: 'Website' }, { id: 'visit', label: 'Visit' }];
|
||||||
}
|
}
|
||||||
@@ -66,7 +44,6 @@ export default function CreatePage() {
|
|||||||
const { t } = useTranslation();
|
const { t } = useTranslation();
|
||||||
const { fetchWithCsrf } = useCsrf();
|
const { fetchWithCsrf } = useCsrf();
|
||||||
const [loading, setLoading] = useState(false);
|
const [loading, setLoading] = useState(false);
|
||||||
const [uploading, setUploading] = useState(false);
|
|
||||||
const [userPlan, setUserPlan] = useState<string>('FREE');
|
const [userPlan, setUserPlan] = useState<string>('FREE');
|
||||||
const qrRef = useRef<HTMLDivElement>(null);
|
const qrRef = useRef<HTMLDivElement>(null);
|
||||||
|
|
||||||
@@ -125,14 +102,10 @@ export default function CreatePage() {
|
|||||||
const hasGoodContrast = contrast >= 4.5;
|
const hasGoodContrast = contrast >= 4.5;
|
||||||
|
|
||||||
const contentTypes = [
|
const contentTypes = [
|
||||||
{ value: 'URL', label: 'URL / Website', icon: Globe },
|
{ value: 'URL', label: 'URL / Website' },
|
||||||
{ value: 'VCARD', label: 'Contact Card', icon: User },
|
{ value: 'VCARD', label: 'Contact Card' },
|
||||||
{ value: 'GEO', label: 'Location / Maps', icon: MapPin },
|
{ value: 'GEO', label: 'Location/Maps' },
|
||||||
{ value: 'PHONE', label: 'Phone Number', icon: Phone },
|
{ value: 'PHONE', label: 'Phone Number' },
|
||||||
{ 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
|
// Get QR content based on content type
|
||||||
@@ -155,14 +128,6 @@ export default function CreatePage() {
|
|||||||
return content.text || 'Sample text';
|
return content.text || 'Sample text';
|
||||||
case 'WHATSAPP':
|
case 'WHATSAPP':
|
||||||
return `https://wa.me/${content.phone || '+1234567890'}${content.message ? `?text=${encodeURIComponent(content.message)}` : ''}`;
|
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:
|
default:
|
||||||
return 'https://example.com';
|
return 'https://example.com';
|
||||||
}
|
}
|
||||||
@@ -433,208 +398,6 @@ export default function CreatePage() {
|
|||||||
/>
|
/>
|
||||||
</div>
|
</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:
|
default:
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
@@ -665,31 +428,12 @@ export default function CreatePage() {
|
|||||||
required
|
required
|
||||||
/>
|
/>
|
||||||
|
|
||||||
{/* Custom Content Type Selector with Icons */}
|
<Select
|
||||||
<div>
|
label="Content Type"
|
||||||
<label className="block text-sm font-medium text-gray-700 mb-2">Content Type</label>
|
value={contentType}
|
||||||
<div className="grid grid-cols-2 sm:grid-cols-4 gap-2">
|
onChange={(e) => setContentType(e.target.value)}
|
||||||
{contentTypes.map((type) => {
|
options={contentTypes}
|
||||||
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()}
|
{renderContentFields()}
|
||||||
</CardContent>
|
</CardContent>
|
||||||
|
|||||||
@@ -7,18 +7,6 @@ import { Button } from '@/components/ui/Button';
|
|||||||
import { Input } from '@/components/ui/Input';
|
import { Input } from '@/components/ui/Input';
|
||||||
import { showToast } from '@/components/ui/Toast';
|
import { showToast } from '@/components/ui/Toast';
|
||||||
import { useCsrf } from '@/hooks/useCsrf';
|
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() {
|
export default function EditQRPage() {
|
||||||
const router = useRouter();
|
const router = useRouter();
|
||||||
@@ -28,7 +16,6 @@ export default function EditQRPage() {
|
|||||||
|
|
||||||
const [loading, setLoading] = useState(true);
|
const [loading, setLoading] = useState(true);
|
||||||
const [saving, setSaving] = useState(false);
|
const [saving, setSaving] = useState(false);
|
||||||
const [uploading, setUploading] = useState(false);
|
|
||||||
const [qrCode, setQrCode] = useState<any>(null);
|
const [qrCode, setQrCode] = useState<any>(null);
|
||||||
const [title, setTitle] = useState('');
|
const [title, setTitle] = useState('');
|
||||||
const [content, setContent] = useState<any>({});
|
const [content, setContent] = useState<any>({});
|
||||||
@@ -58,41 +45,6 @@ export default function EditQRPage() {
|
|||||||
fetchQRCode();
|
fetchQRCode();
|
||||||
}, [qrId, router]);
|
}, [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 () => {
|
const handleSave = async () => {
|
||||||
setSaving(true);
|
setSaving(true);
|
||||||
|
|
||||||
@@ -290,153 +242,6 @@ export default function EditQRPage() {
|
|||||||
</div>
|
</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">
|
<div className="flex justify-end space-x-4 pt-4">
|
||||||
<Button
|
<Button
|
||||||
variant="outline"
|
variant="outline"
|
||||||
|
|||||||
@@ -1,196 +0,0 @@
|
|||||||
'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>
|
|
||||||
);
|
|
||||||
}
|
|
||||||
@@ -1,287 +0,0 @@
|
|||||||
'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>
|
|
||||||
);
|
|
||||||
}
|
|
||||||
@@ -1,11 +1,38 @@
|
|||||||
export default function AuthLayout({
|
import '@/styles/globals.css';
|
||||||
|
import { Providers } from '@/components/Providers';
|
||||||
|
import type { Metadata } from 'next';
|
||||||
|
|
||||||
|
export const metadata: Metadata = {
|
||||||
|
title: 'Authentication | QR Master',
|
||||||
|
description: 'Securely login or sign up to QR Master to manage your dynamic QR codes, track analytics, and access premium features. Your gateway to professional QR management.',
|
||||||
|
icons: {
|
||||||
|
icon: [
|
||||||
|
{ url: '/favicon.svg', type: 'image/svg+xml' },
|
||||||
|
{ url: '/logo.svg', type: 'image/svg+xml' },
|
||||||
|
],
|
||||||
|
apple: '/logo.svg',
|
||||||
|
},
|
||||||
|
};
|
||||||
|
|
||||||
|
export default function AuthRootLayout({
|
||||||
children,
|
children,
|
||||||
}: {
|
}: {
|
||||||
children: React.ReactNode;
|
children: React.ReactNode;
|
||||||
}) {
|
}) {
|
||||||
return (
|
return (
|
||||||
|
<html lang="en">
|
||||||
|
<body className="font-sans">
|
||||||
|
<Providers>
|
||||||
<div className="min-h-screen bg-gradient-to-br from-primary-50 to-white">
|
<div className="min-h-screen bg-gradient-to-br from-primary-50 to-white">
|
||||||
{children}
|
{children}
|
||||||
|
<div className="py-6 text-center text-sm text-slate-500 space-x-4">
|
||||||
|
<a href="/" className="hover:text-primary-600 transition-colors">Home</a>
|
||||||
|
<a href="/privacy" className="hover:text-primary-600 transition-colors">Privacy</a>
|
||||||
|
<a href="/faq" className="hover:text-primary-600 transition-colors">FAQ</a>
|
||||||
</div>
|
</div>
|
||||||
|
</div>
|
||||||
|
</Providers>
|
||||||
|
</body>
|
||||||
|
</html>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
@@ -1,76 +1,38 @@
|
|||||||
'use client';
|
import React, { Suspense } from 'react';
|
||||||
|
import type { Metadata } from 'next';
|
||||||
import React, { useState, useEffect } from 'react';
|
|
||||||
import { useRouter, useSearchParams } from 'next/navigation';
|
|
||||||
import Link from 'next/link';
|
import Link from 'next/link';
|
||||||
import { Card, CardHeader, CardTitle, CardContent } from '@/components/ui/Card';
|
import LoginClientPage from './ClientPage';
|
||||||
import { Input } from '@/components/ui/Input';
|
|
||||||
import { Button } from '@/components/ui/Button';
|
export const metadata: Metadata = {
|
||||||
import { useTranslation } from '@/hooks/useTranslation';
|
title: {
|
||||||
import { useCsrf } from '@/hooks/useCsrf';
|
absolute: 'Login to QR Master | Access Your Dashboard'
|
||||||
|
},
|
||||||
|
description: 'Sign in to QR Master to create, manage, and track your QR codes. Access your dashboard and view analytics.',
|
||||||
|
alternates: {
|
||||||
|
canonical: 'https://www.qrmaster.net/login',
|
||||||
|
},
|
||||||
|
openGraph: {
|
||||||
|
title: 'Login to QR Master | Access Your Dashboard',
|
||||||
|
description: 'Sign in to QR Master to create, manage, and track your QR codes.',
|
||||||
|
url: 'https://www.qrmaster.net/login',
|
||||||
|
type: 'website',
|
||||||
|
images: [{
|
||||||
|
url: 'https://www.qrmaster.net/og-image.png',
|
||||||
|
width: 1200,
|
||||||
|
height: 630,
|
||||||
|
alt: 'QR Master Login',
|
||||||
|
}],
|
||||||
|
},
|
||||||
|
twitter: {
|
||||||
|
card: 'summary_large_image',
|
||||||
|
title: 'Login to QR Master | Access Your Dashboard',
|
||||||
|
description: 'Sign in to QR Master to create, manage, and track your QR codes.',
|
||||||
|
images: ['https://www.qrmaster.net/og-image.png'],
|
||||||
|
},
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
export default function LoginPage() {
|
export default function LoginPage() {
|
||||||
const router = useRouter();
|
|
||||||
const searchParams = useSearchParams();
|
|
||||||
const { t } = useTranslation();
|
|
||||||
const { fetchWithCsrf, loading: csrfLoading } = useCsrf();
|
|
||||||
const [email, setEmail] = useState('');
|
|
||||||
const [password, setPassword] = useState('');
|
|
||||||
const [loading, setLoading] = useState(false);
|
|
||||||
const [error, setError] = useState('');
|
|
||||||
|
|
||||||
const handleSubmit = async (e: React.FormEvent) => {
|
|
||||||
e.preventDefault();
|
|
||||||
setLoading(true);
|
|
||||||
setError('');
|
|
||||||
|
|
||||||
try {
|
|
||||||
const response = await fetchWithCsrf('/api/auth/simple-login', {
|
|
||||||
method: 'POST',
|
|
||||||
body: JSON.stringify({ email, password }),
|
|
||||||
});
|
|
||||||
|
|
||||||
const data = await response.json();
|
|
||||||
|
|
||||||
if (response.ok && data.success) {
|
|
||||||
// Store user in localStorage for client-side
|
|
||||||
localStorage.setItem('user', JSON.stringify(data.user));
|
|
||||||
|
|
||||||
// Track successful login with PostHog
|
|
||||||
try {
|
|
||||||
const { identifyUser, trackEvent } = await import('@/components/PostHogProvider');
|
|
||||||
identifyUser(data.user.id, {
|
|
||||||
email: data.user.email,
|
|
||||||
name: data.user.name,
|
|
||||||
plan: data.user.plan || 'FREE',
|
|
||||||
});
|
|
||||||
trackEvent('user_login', {
|
|
||||||
method: 'email',
|
|
||||||
email: data.user.email,
|
|
||||||
});
|
|
||||||
} catch (error) {
|
|
||||||
console.error('PostHog tracking error:', error);
|
|
||||||
}
|
|
||||||
|
|
||||||
// Check for redirect parameter
|
|
||||||
const redirectUrl = searchParams.get('redirect') || '/dashboard';
|
|
||||||
router.push(redirectUrl);
|
|
||||||
router.refresh();
|
|
||||||
} else {
|
|
||||||
setError(data.error || 'Invalid email or password');
|
|
||||||
}
|
|
||||||
} catch (err) {
|
|
||||||
setError('An error occurred. Please try again.');
|
|
||||||
} finally {
|
|
||||||
setLoading(false);
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
const handleGoogleSignIn = () => {
|
|
||||||
// Redirect to Google OAuth API route
|
|
||||||
window.location.href = '/api/auth/google';
|
|
||||||
};
|
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div className="min-h-screen bg-gradient-to-br from-primary-50 to-white flex items-center justify-center p-4">
|
<div className="min-h-screen bg-gradient-to-br from-primary-50 to-white flex items-center justify-center p-4">
|
||||||
<div className="w-full max-w-md">
|
<div className="w-full max-w-md">
|
||||||
@@ -86,94 +48,13 @@ export default function LoginPage() {
|
|||||||
</Link>
|
</Link>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<Card>
|
<Suspense fallback={
|
||||||
<CardContent className="p-6">
|
<div className="bg-white rounded-xl shadow-sm border border-slate-200 p-8 flex items-center justify-center min-h-[400px]">
|
||||||
<form onSubmit={handleSubmit} className="space-y-4">
|
<div className="animate-spin rounded-full h-8 w-8 border-b-2 border-primary-600"></div>
|
||||||
{error && (
|
|
||||||
<div className="bg-red-50 text-red-600 p-3 rounded-lg text-sm">
|
|
||||||
{error}
|
|
||||||
</div>
|
</div>
|
||||||
)}
|
}>
|
||||||
|
<LoginClientPage />
|
||||||
<Input
|
</Suspense>
|
||||||
label="Email"
|
|
||||||
type="email"
|
|
||||||
value={email}
|
|
||||||
onChange={(e) => setEmail(e.target.value)}
|
|
||||||
placeholder="you@example.com"
|
|
||||||
required
|
|
||||||
/>
|
|
||||||
|
|
||||||
<Input
|
|
||||||
label="Password"
|
|
||||||
type="password"
|
|
||||||
value={password}
|
|
||||||
onChange={(e) => setPassword(e.target.value)}
|
|
||||||
placeholder="••••••••"
|
|
||||||
required
|
|
||||||
/>
|
|
||||||
|
|
||||||
<div className="flex items-center justify-between">
|
|
||||||
<label className="flex items-center">
|
|
||||||
<input type="checkbox" className="mr-2" />
|
|
||||||
<span className="text-sm text-gray-600">Remember me</span>
|
|
||||||
</label>
|
|
||||||
<Link href="/forgot-password" className="text-sm text-primary-600 hover:text-primary-700">
|
|
||||||
Forgot password?
|
|
||||||
</Link>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<Button type="submit" className="w-full" loading={loading} disabled={csrfLoading || loading}>
|
|
||||||
{csrfLoading ? 'Loading...' : 'Sign In'}
|
|
||||||
</Button>
|
|
||||||
|
|
||||||
<div className="relative my-6">
|
|
||||||
<div className="absolute inset-0 flex items-center">
|
|
||||||
<div className="w-full border-t border-gray-300"></div>
|
|
||||||
</div>
|
|
||||||
<div className="relative flex justify-center text-sm">
|
|
||||||
<span className="px-2 bg-white text-gray-500">Or continue with</span>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<Button
|
|
||||||
type="button"
|
|
||||||
variant="outline"
|
|
||||||
className="w-full"
|
|
||||||
onClick={handleGoogleSignIn}
|
|
||||||
>
|
|
||||||
<svg className="w-5 h-5 mr-2" viewBox="0 0 24 24">
|
|
||||||
<path
|
|
||||||
fill="#4285F4"
|
|
||||||
d="M22.56 12.25c0-.78-.07-1.53-.2-2.25H12v4.26h5.92c-.26 1.37-1.04 2.53-2.21 3.31v2.77h3.57c2.08-1.92 3.28-4.74 3.28-8.09z"
|
|
||||||
/>
|
|
||||||
<path
|
|
||||||
fill="#34A853"
|
|
||||||
d="M12 23c2.97 0 5.46-.98 7.28-2.66l-3.57-2.77c-.98.66-2.23 1.06-3.71 1.06-2.86 0-5.29-1.93-6.16-4.53H2.18v2.84C3.99 20.53 7.7 23 12 23z"
|
|
||||||
/>
|
|
||||||
<path
|
|
||||||
fill="#FBBC05"
|
|
||||||
d="M5.84 14.09c-.22-.66-.35-1.36-.35-2.09s.13-1.43.35-2.09V7.07H2.18C1.43 8.55 1 10.22 1 12s.43 3.45 1.18 4.93l2.85-2.22.81-.62z"
|
|
||||||
/>
|
|
||||||
<path
|
|
||||||
fill="#EA4335"
|
|
||||||
d="M12 5.38c1.62 0 3.06.56 4.21 1.64l3.15-3.15C17.45 2.09 14.97 1 12 1 7.7 1 3.99 3.47 2.18 7.07l3.66 2.84c.87-2.6 3.3-4.53 6.16-4.53z"
|
|
||||||
/>
|
|
||||||
</svg>
|
|
||||||
Sign in with Google
|
|
||||||
</Button>
|
|
||||||
</form>
|
|
||||||
|
|
||||||
<div className="mt-6 text-center">
|
|
||||||
<p className="text-sm text-gray-600">
|
|
||||||
Don't have an account?{' '}
|
|
||||||
<Link href="/signup" className="text-primary-600 hover:text-primary-700 font-medium">
|
|
||||||
Sign up
|
|
||||||
</Link>
|
|
||||||
</p>
|
|
||||||
</div>
|
|
||||||
</CardContent>
|
|
||||||
</Card>
|
|
||||||
|
|
||||||
<p className="text-center text-sm text-gray-500 mt-6">
|
<p className="text-center text-sm text-gray-500 mt-6">
|
||||||
By signing in, you agree to our{' '}
|
By signing in, you agree to our{' '}
|
||||||
|
|||||||
@@ -8,7 +8,9 @@ import { Input } from '@/components/ui/Input';
|
|||||||
import { Button } from '@/components/ui/Button';
|
import { Button } from '@/components/ui/Button';
|
||||||
import { useCsrf } from '@/hooks/useCsrf';
|
import { useCsrf } from '@/hooks/useCsrf';
|
||||||
|
|
||||||
export default function ResetPasswordPage() {
|
import { Suspense } from 'react';
|
||||||
|
|
||||||
|
function ResetPasswordContent() {
|
||||||
const { fetchWithCsrf, loading: csrfLoading } = useCsrf();
|
const { fetchWithCsrf, loading: csrfLoading } = useCsrf();
|
||||||
const searchParams = useSearchParams();
|
const searchParams = useSearchParams();
|
||||||
const router = useRouter();
|
const router = useRouter();
|
||||||
@@ -206,3 +208,11 @@ export default function ResetPasswordPage() {
|
|||||||
</div>
|
</div>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
export default function ResetPasswordPage() {
|
||||||
|
return (
|
||||||
|
<Suspense fallback={<div className="min-h-screen flex items-center justify-center">Loading...</div>}>
|
||||||
|
<ResetPasswordContent />
|
||||||
|
</Suspense>
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|||||||
@@ -1,89 +1,39 @@
|
|||||||
'use client';
|
import React, { Suspense } from 'react';
|
||||||
|
import type { Metadata } from 'next';
|
||||||
import React, { useState } from 'react';
|
|
||||||
import { useRouter } from 'next/navigation';
|
|
||||||
import Link from 'next/link';
|
import Link from 'next/link';
|
||||||
import { Card, CardHeader, CardTitle, CardContent } from '@/components/ui/Card';
|
import SignupClientPage from './ClientPage';
|
||||||
import { Input } from '@/components/ui/Input';
|
|
||||||
import { Button } from '@/components/ui/Button';
|
export const metadata: Metadata = {
|
||||||
import { useTranslation } from '@/hooks/useTranslation';
|
title: {
|
||||||
import { useCsrf } from '@/hooks/useCsrf';
|
absolute: 'Create Free Account | QR Master'
|
||||||
|
},
|
||||||
|
description: 'Sign up for QR Master to create free QR codes. Start with tracking, customization, and bulk generation features.',
|
||||||
|
alternates: {
|
||||||
|
canonical: 'https://www.qrmaster.net/signup',
|
||||||
|
},
|
||||||
|
openGraph: {
|
||||||
|
title: 'Create Free Account | QR Master',
|
||||||
|
description: 'Sign up for QR Master to create free QR codes with tracking and customization.',
|
||||||
|
url: 'https://www.qrmaster.net/signup',
|
||||||
|
type: 'website',
|
||||||
|
images: [{
|
||||||
|
url: 'https://www.qrmaster.net/og-image.png',
|
||||||
|
width: 1200,
|
||||||
|
height: 630,
|
||||||
|
alt: 'QR Master Sign Up',
|
||||||
|
}],
|
||||||
|
},
|
||||||
|
twitter: {
|
||||||
|
card: 'summary_large_image',
|
||||||
|
title: 'Create Free Account | QR Master',
|
||||||
|
description: 'Sign up for QR Master to create free QR codes with tracking and customization.',
|
||||||
|
images: ['https://www.qrmaster.net/og-image.png'],
|
||||||
|
},
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
export default function SignupPage() {
|
export default function SignupPage() {
|
||||||
const router = useRouter();
|
|
||||||
const { t } = useTranslation();
|
|
||||||
const { fetchWithCsrf } = useCsrf();
|
|
||||||
const [name, setName] = useState('');
|
|
||||||
const [email, setEmail] = useState('');
|
|
||||||
const [password, setPassword] = useState('');
|
|
||||||
const [confirmPassword, setConfirmPassword] = useState('');
|
|
||||||
const [loading, setLoading] = useState(false);
|
|
||||||
const [error, setError] = useState('');
|
|
||||||
|
|
||||||
const handleSubmit = async (e: React.FormEvent) => {
|
|
||||||
e.preventDefault();
|
|
||||||
setLoading(true);
|
|
||||||
setError('');
|
|
||||||
|
|
||||||
if (password !== confirmPassword) {
|
|
||||||
setError('Passwords do not match');
|
|
||||||
setLoading(false);
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (password.length < 8) {
|
|
||||||
setError('Password must be at least 8 characters');
|
|
||||||
setLoading(false);
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
try {
|
|
||||||
const response = await fetchWithCsrf('/api/auth/signup', {
|
|
||||||
method: 'POST',
|
|
||||||
body: JSON.stringify({ name, email, password }),
|
|
||||||
});
|
|
||||||
|
|
||||||
const data = await response.json();
|
|
||||||
|
|
||||||
if (response.ok && data.success) {
|
|
||||||
// Store user in localStorage for client-side
|
|
||||||
localStorage.setItem('user', JSON.stringify(data.user));
|
|
||||||
|
|
||||||
// Track successful signup with PostHog
|
|
||||||
try {
|
|
||||||
const { identifyUser, trackEvent } = await import('@/components/PostHogProvider');
|
|
||||||
identifyUser(data.user.id, {
|
|
||||||
email: data.user.email,
|
|
||||||
name: data.user.name,
|
|
||||||
plan: data.user.plan || 'FREE',
|
|
||||||
signupMethod: 'email',
|
|
||||||
});
|
|
||||||
trackEvent('user_signup', {
|
|
||||||
method: 'email',
|
|
||||||
email: data.user.email,
|
|
||||||
});
|
|
||||||
} catch (error) {
|
|
||||||
console.error('PostHog tracking error:', error);
|
|
||||||
}
|
|
||||||
|
|
||||||
// Redirect to dashboard
|
|
||||||
router.push('/dashboard');
|
|
||||||
router.refresh();
|
|
||||||
} else {
|
|
||||||
setError(data.error || 'Failed to create account');
|
|
||||||
}
|
|
||||||
} catch (err) {
|
|
||||||
setError('An error occurred. Please try again.');
|
|
||||||
} finally {
|
|
||||||
setLoading(false);
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
const handleGoogleSignIn = () => {
|
|
||||||
// Redirect to Google OAuth API route
|
|
||||||
window.location.href = '/api/auth/google';
|
|
||||||
};
|
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div className="min-h-screen bg-gradient-to-br from-primary-50 to-white flex items-center justify-center p-4">
|
<div className="min-h-screen bg-gradient-to-br from-primary-50 to-white flex items-center justify-center p-4">
|
||||||
<div className="w-full max-w-md">
|
<div className="w-full max-w-md">
|
||||||
@@ -99,102 +49,13 @@ export default function SignupPage() {
|
|||||||
</Link>
|
</Link>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<Card>
|
<Suspense fallback={
|
||||||
<CardContent className="p-6">
|
<div className="bg-white rounded-xl shadow-sm border border-slate-200 p-8 flex items-center justify-center min-h-[500px]">
|
||||||
<form onSubmit={handleSubmit} className="space-y-4">
|
<div className="animate-spin rounded-full h-8 w-8 border-b-2 border-primary-600"></div>
|
||||||
{error && (
|
|
||||||
<div className="bg-red-50 text-red-600 p-3 rounded-lg text-sm">
|
|
||||||
{error}
|
|
||||||
</div>
|
</div>
|
||||||
)}
|
}>
|
||||||
|
<SignupClientPage />
|
||||||
<Input
|
</Suspense>
|
||||||
label="Full Name"
|
|
||||||
type="text"
|
|
||||||
value={name}
|
|
||||||
onChange={(e) => setName(e.target.value)}
|
|
||||||
placeholder="John Doe"
|
|
||||||
required
|
|
||||||
/>
|
|
||||||
|
|
||||||
<Input
|
|
||||||
label="Email"
|
|
||||||
type="email"
|
|
||||||
value={email}
|
|
||||||
onChange={(e) => setEmail(e.target.value)}
|
|
||||||
placeholder="you@example.com"
|
|
||||||
required
|
|
||||||
/>
|
|
||||||
|
|
||||||
<Input
|
|
||||||
label="Password"
|
|
||||||
type="password"
|
|
||||||
value={password}
|
|
||||||
onChange={(e) => setPassword(e.target.value)}
|
|
||||||
placeholder="••••••••"
|
|
||||||
required
|
|
||||||
/>
|
|
||||||
|
|
||||||
<Input
|
|
||||||
label="Confirm Password"
|
|
||||||
type="password"
|
|
||||||
value={confirmPassword}
|
|
||||||
onChange={(e) => setConfirmPassword(e.target.value)}
|
|
||||||
placeholder="••••••••"
|
|
||||||
required
|
|
||||||
/>
|
|
||||||
|
|
||||||
<Button type="submit" className="w-full" loading={loading}>
|
|
||||||
Create Account
|
|
||||||
</Button>
|
|
||||||
|
|
||||||
<div className="relative my-6">
|
|
||||||
<div className="absolute inset-0 flex items-center">
|
|
||||||
<div className="w-full border-t border-gray-300"></div>
|
|
||||||
</div>
|
|
||||||
<div className="relative flex justify-center text-sm">
|
|
||||||
<span className="px-2 bg-white text-gray-500">Or continue with</span>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<Button
|
|
||||||
type="button"
|
|
||||||
variant="outline"
|
|
||||||
className="w-full"
|
|
||||||
onClick={handleGoogleSignIn}
|
|
||||||
>
|
|
||||||
<svg className="w-5 h-5 mr-2" viewBox="0 0 24 24">
|
|
||||||
<path
|
|
||||||
fill="#4285F4"
|
|
||||||
d="M22.56 12.25c0-.78-.07-1.53-.2-2.25H12v4.26h5.92c-.26 1.37-1.04 2.53-2.21 3.31v2.77h3.57c2.08-1.92 3.28-4.74 3.28-8.09z"
|
|
||||||
/>
|
|
||||||
<path
|
|
||||||
fill="#34A853"
|
|
||||||
d="M12 23c2.97 0 5.46-.98 7.28-2.66l-3.57-2.77c-.98.66-2.23 1.06-3.71 1.06-2.86 0-5.29-1.93-6.16-4.53H2.18v2.84C3.99 20.53 7.7 23 12 23z"
|
|
||||||
/>
|
|
||||||
<path
|
|
||||||
fill="#FBBC05"
|
|
||||||
d="M5.84 14.09c-.22-.66-.35-1.36-.35-2.09s.13-1.43.35-2.09V7.07H2.18C1.43 8.55 1 10.22 1 12s.43 3.45 1.18 4.93l2.85-2.22.81-.62z"
|
|
||||||
/>
|
|
||||||
<path
|
|
||||||
fill="#EA4335"
|
|
||||||
d="M12 5.38c1.62 0 3.06.56 4.21 1.64l3.15-3.15C17.45 2.09 14.97 1 12 1 7.7 1 3.99 3.47 2.18 7.07l3.66 2.84c.87-2.6 3.3-4.53 6.16-4.53z"
|
|
||||||
/>
|
|
||||||
</svg>
|
|
||||||
Sign up with Google
|
|
||||||
</Button>
|
|
||||||
</form>
|
|
||||||
|
|
||||||
<div className="mt-6 text-center">
|
|
||||||
<p className="text-sm text-gray-600">
|
|
||||||
Already have an account?{' '}
|
|
||||||
<Link href="/login" className="text-primary-600 hover:text-primary-700 font-medium">
|
|
||||||
Sign in
|
|
||||||
</Link>
|
|
||||||
</p>
|
|
||||||
</div>
|
|
||||||
</CardContent>
|
|
||||||
</Card>
|
|
||||||
|
|
||||||
<p className="text-center text-sm text-gray-500 mt-6">
|
<p className="text-center text-sm text-gray-500 mt-6">
|
||||||
By signing up, you agree to our{' '}
|
By signing up, you agree to our{' '}
|
||||||
|
|||||||
@@ -6,7 +6,7 @@ import { usePathname } from 'next/navigation';
|
|||||||
import { Button } from '@/components/ui/Button';
|
import { Button } from '@/components/ui/Button';
|
||||||
import { Footer } from '@/components/ui/Footer';
|
import { Footer } from '@/components/ui/Footer';
|
||||||
import en from '@/i18n/en.json';
|
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, Barcode as BarcodeIcon } from 'lucide-react';
|
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 { cn } from '@/lib/utils';
|
||||||
import { AnimatePresence, motion } from 'framer-motion';
|
import { AnimatePresence, motion } from 'framer-motion';
|
||||||
|
|
||||||
@@ -62,7 +62,6 @@ export default function MarketingLayout({
|
|||||||
{ name: 'PayPal', description: 'Receive payments', href: '/tools/paypal-qr-code', icon: CreditCard, color: 'text-blue-700', bgColor: 'bg-blue-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: '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' },
|
{ name: 'Teams', description: 'Join Teams meeting', href: '/tools/teams-qr-code', icon: Users, color: 'text-violet-500', bgColor: 'bg-violet-50' },
|
||||||
{ name: 'Barcode', description: 'Generate barcodes', href: '/tools/barcode-generator', icon: BarcodeIcon, color: 'text-slate-800', bgColor: 'bg-slate-100' },
|
|
||||||
];
|
];
|
||||||
|
|
||||||
return (
|
return (
|
||||||
@@ -97,7 +96,6 @@ export default function MarketingLayout({
|
|||||||
<li><a href="/tools/paypal-qr-code">PayPal QR Code</a></li>
|
<li><a href="/tools/paypal-qr-code">PayPal QR Code</a></li>
|
||||||
<li><a href="/tools/zoom-qr-code">Zoom QR Code</a></li>
|
<li><a href="/tools/zoom-qr-code">Zoom QR Code</a></li>
|
||||||
<li><a href="/tools/teams-qr-code">Teams QR Code</a></li>
|
<li><a href="/tools/teams-qr-code">Teams QR Code</a></li>
|
||||||
<li><a href="/tools/barcode-generator">Barcode Generator</a></li>
|
|
||||||
</ul>
|
</ul>
|
||||||
</nav>
|
</nav>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -7,6 +7,7 @@ import { websiteSchema, breadcrumbSchema } from '@/lib/schema';
|
|||||||
import { Card, CardHeader, CardTitle, CardContent } from '@/components/ui/Card';
|
import { Card, CardHeader, CardTitle, CardContent } from '@/components/ui/Card';
|
||||||
import { Badge } from '@/components/ui/Badge';
|
import { Badge } from '@/components/ui/Badge';
|
||||||
import Breadcrumbs, { BreadcrumbItem } from '@/components/Breadcrumbs';
|
import Breadcrumbs, { BreadcrumbItem } from '@/components/Breadcrumbs';
|
||||||
|
import { blogPostList } from '@/lib/blog-data';
|
||||||
|
|
||||||
function truncateAtWord(text: string, maxLength: number): string {
|
function truncateAtWord(text: string, maxLength: number): string {
|
||||||
if (text.length <= maxLength) return text;
|
if (text.length <= maxLength) return text;
|
||||||
@@ -18,7 +19,7 @@ function truncateAtWord(text: string, maxLength: number): string {
|
|||||||
export async function generateMetadata(): Promise<Metadata> {
|
export async function generateMetadata(): Promise<Metadata> {
|
||||||
const title = truncateAtWord('QR Insights: Latest QR Strategies', 60);
|
const title = truncateAtWord('QR Insights: Latest QR Strategies', 60);
|
||||||
const description = truncateAtWord(
|
const description = truncateAtWord(
|
||||||
'Expert guides on QR analytics, dynamic codes & smart marketing uses.',
|
'Expert guides on QR code analytics, dynamic vs static codes, bulk generation, and smart marketing use cases. Learn how to maximize your QR campaign ROI.',
|
||||||
160
|
160
|
||||||
);
|
);
|
||||||
|
|
||||||
@@ -37,6 +38,14 @@ export async function generateMetadata(): Promise<Metadata> {
|
|||||||
description,
|
description,
|
||||||
url: 'https://www.qrmaster.net/blog',
|
url: 'https://www.qrmaster.net/blog',
|
||||||
type: 'website',
|
type: 'website',
|
||||||
|
images: [
|
||||||
|
{
|
||||||
|
url: 'https://www.qrmaster.net/og-image.png',
|
||||||
|
width: 1200,
|
||||||
|
height: 630,
|
||||||
|
alt: 'QR Insights - QR Code Marketing & Analytics Blog',
|
||||||
|
},
|
||||||
|
],
|
||||||
},
|
},
|
||||||
twitter: {
|
twitter: {
|
||||||
title,
|
title,
|
||||||
@@ -45,82 +54,7 @@ export async function generateMetadata(): Promise<Metadata> {
|
|||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
const blogPosts = [
|
|
||||||
// NEW POSTS (January 2026)
|
|
||||||
{
|
|
||||||
slug: 'qr-code-restaurant-menu',
|
|
||||||
title: 'How to Create a QR Code for Restaurant Menu',
|
|
||||||
excerpt: 'Step-by-step guide to creating digital menu QR codes for your restaurant. Learn best practices for touchless menus, placement tips, and tracking.',
|
|
||||||
date: 'January 5, 2026',
|
|
||||||
readTime: '12 Min',
|
|
||||||
category: 'Restaurant',
|
|
||||||
image: '/blog/restaurant-qr-menu.png',
|
|
||||||
},
|
|
||||||
{
|
|
||||||
slug: 'vcard-qr-code-generator',
|
|
||||||
title: 'Free vCard QR Code Generator: Digital Business Cards',
|
|
||||||
excerpt: 'Create professional vCard QR codes for digital business cards. Share contact info instantly with a scan—includes templates and best practices.',
|
|
||||||
date: 'January 5, 2026',
|
|
||||||
readTime: '10 Min',
|
|
||||||
category: 'Business Cards',
|
|
||||||
image: '/blog/vcard-qr-code.png',
|
|
||||||
},
|
|
||||||
{
|
|
||||||
slug: 'qr-code-small-business',
|
|
||||||
title: 'Best QR Code Generator for Small Business: 2025 Guide',
|
|
||||||
excerpt: 'Find the best QR code solution for your small business. Compare features, pricing, and use cases for marketing, payments, and operations.',
|
|
||||||
date: 'January 5, 2026',
|
|
||||||
readTime: '14 Min',
|
|
||||||
category: 'Business',
|
|
||||||
image: '/blog/small-business-qr.png',
|
|
||||||
},
|
|
||||||
{
|
|
||||||
slug: 'qr-code-print-size-guide',
|
|
||||||
title: 'QR Code Print Size Guide: Minimum Sizes for Every Use Case',
|
|
||||||
excerpt: 'Complete guide to QR code print sizes. Learn minimum dimensions for business cards, posters, banners, and more to ensure reliable scanning.',
|
|
||||||
date: 'January 5, 2026',
|
|
||||||
readTime: '8 Min',
|
|
||||||
category: 'Printing',
|
|
||||||
image: '/blog/qr-print-sizes.png',
|
|
||||||
},
|
|
||||||
// EXISTING POSTS
|
|
||||||
{
|
|
||||||
slug: 'qr-code-tracking-guide-2025',
|
|
||||||
title: 'QR Code Tracking: Complete Guide 2025',
|
|
||||||
excerpt: 'Learn how to track QR code scans with real-time analytics. Compare free vs paid tracking tools, setup Google Analytics, and measure ROI.',
|
|
||||||
date: 'October 18, 2025',
|
|
||||||
readTime: '12 Min',
|
|
||||||
category: 'Tracking & Analytics',
|
|
||||||
image: '/blog/1-hero.png',
|
|
||||||
},
|
|
||||||
{
|
|
||||||
slug: 'dynamic-vs-static-qr-codes',
|
|
||||||
title: 'Dynamic vs Static QR Codes: Which Should You Use?',
|
|
||||||
excerpt: 'Understand the difference between static and dynamic QR codes. Learn when to use each type, pros/cons, and how dynamic QR codes save money.',
|
|
||||||
date: 'October 17, 2025',
|
|
||||||
readTime: '10 Min',
|
|
||||||
category: 'QR Code Basics',
|
|
||||||
image: '/blog/2-hero.png',
|
|
||||||
},
|
|
||||||
{
|
|
||||||
slug: 'bulk-qr-code-generator-excel',
|
|
||||||
title: 'How to Generate Bulk QR Codes from Excel',
|
|
||||||
excerpt: 'Generate hundreds of QR codes from Excel or CSV files in minutes. Step-by-step guide with templates, best practices, and free tools.',
|
|
||||||
date: 'October 16, 2025',
|
|
||||||
readTime: '13 Min',
|
|
||||||
category: 'Bulk Generation',
|
|
||||||
image: '/blog/3-hero.png',
|
|
||||||
},
|
|
||||||
{
|
|
||||||
slug: 'qr-code-analytics',
|
|
||||||
title: 'QR Code Analytics: Track, Measure & Optimize Campaigns',
|
|
||||||
excerpt: 'Learn how to leverage scan analytics, campaign tracking, and dashboard insights to maximize QR code ROI.',
|
|
||||||
date: 'October 16, 2025',
|
|
||||||
readTime: '15 Min',
|
|
||||||
category: 'Analytics',
|
|
||||||
image: '/blog/4-hero.png',
|
|
||||||
},
|
|
||||||
];
|
|
||||||
|
|
||||||
export default function BlogPage() {
|
export default function BlogPage() {
|
||||||
const breadcrumbItems: BreadcrumbItem[] = [
|
const breadcrumbItems: BreadcrumbItem[] = [
|
||||||
@@ -145,8 +79,8 @@ export default function BlogPage() {
|
|||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div className="grid md:grid-cols-2 lg:grid-cols-3 gap-8 max-w-6xl mx-auto">
|
<div className="grid md:grid-cols-2 lg:grid-cols-3 gap-8 max-w-6xl mx-auto">
|
||||||
{blogPosts.map((post) => (
|
{blogPostList.map((post: any) => (
|
||||||
<Link key={post.slug} href={`/blog/${post.slug}`}>
|
<Link key={post.slug} href={post.link || `/blog/${post.slug}`}>
|
||||||
<Card hover className="h-full overflow-hidden shadow-md hover:shadow-xl transition-all duration-300">
|
<Card hover className="h-full overflow-hidden shadow-md hover:shadow-xl transition-all duration-300">
|
||||||
<div className="relative h-56 overflow-hidden">
|
<div className="relative h-56 overflow-hidden">
|
||||||
<Image
|
<Image
|
||||||
@@ -168,7 +102,9 @@ export default function BlogPage() {
|
|||||||
<p className="text-gray-600 mb-4 leading-relaxed">{post.excerpt}</p>
|
<p className="text-gray-600 mb-4 leading-relaxed">{post.excerpt}</p>
|
||||||
<div className="flex items-center justify-between pt-4 border-t border-gray-100">
|
<div className="flex items-center justify-between pt-4 border-t border-gray-100">
|
||||||
<p className="text-sm text-gray-500">{post.date}</p>
|
<p className="text-sm text-gray-500">{post.date}</p>
|
||||||
<span className="text-primary-600 text-sm font-medium">Read more →</span>
|
<span className="text-primary-600 text-sm font-medium">
|
||||||
|
{post.link ? 'Try Now →' : 'Read Article →'}
|
||||||
|
</span>
|
||||||
</div>
|
</div>
|
||||||
</CardContent>
|
</CardContent>
|
||||||
</Card>
|
</Card>
|
||||||
|
|||||||
@@ -8,8 +8,8 @@ import Breadcrumbs, { BreadcrumbItem } from '@/components/Breadcrumbs';
|
|||||||
import { breadcrumbSchema } from '@/lib/schema';
|
import { breadcrumbSchema } from '@/lib/schema';
|
||||||
|
|
||||||
export const metadata: Metadata = {
|
export const metadata: Metadata = {
|
||||||
title: 'Bulk QR Code Generator - Create 1000s of QR Codes from Excel | QR Master',
|
title: 'Bulk QR Code Generator | Create from Excel | QR Master',
|
||||||
description: 'Generate hundreds of QR codes at once from CSV or Excel files. Create URLs, vCards, locations, phone numbers, and text QR codes in bulk. Perfect for products, events, inventory management.',
|
description: 'Generate hundreds of QR codes instantly from Excel/CSV. Create URLs, vCards, and text codes in bulk. Perfect for inventory, events, and product tagging.',
|
||||||
keywords: 'bulk qr code generator, batch qr code, qr code from excel, csv qr code generator, mass qr code generation, bulk vcard qr code, bulk qr codes free',
|
keywords: 'bulk qr code generator, batch qr code, qr code from excel, csv qr code generator, mass qr code generation, bulk vcard qr code, bulk qr codes free',
|
||||||
alternates: {
|
alternates: {
|
||||||
canonical: 'https://www.qrmaster.net/bulk-qr-code-generator',
|
canonical: 'https://www.qrmaster.net/bulk-qr-code-generator',
|
||||||
@@ -23,6 +23,14 @@ export const metadata: Metadata = {
|
|||||||
description: 'Generate hundreds of QR codes at once from CSV or Excel files. Perfect for products, events, and inventory.',
|
description: 'Generate hundreds of QR codes at once from CSV or Excel files. Perfect for products, events, and inventory.',
|
||||||
url: 'https://www.qrmaster.net/bulk-qr-code-generator',
|
url: 'https://www.qrmaster.net/bulk-qr-code-generator',
|
||||||
type: 'website',
|
type: 'website',
|
||||||
|
images: [
|
||||||
|
{
|
||||||
|
url: 'https://www.qrmaster.net/og-image.png',
|
||||||
|
width: 1200,
|
||||||
|
height: 630,
|
||||||
|
alt: 'Bulk QR Code Generator - QR Master',
|
||||||
|
},
|
||||||
|
],
|
||||||
},
|
},
|
||||||
twitter: {
|
twitter: {
|
||||||
title: 'Bulk QR Code Generator - Create 1000s of QR Codes from Excel',
|
title: 'Bulk QR Code Generator - Create 1000s of QR Codes from Excel',
|
||||||
@@ -46,7 +54,7 @@ export default function BulkQRCodeGeneratorPage() {
|
|||||||
title: 'Contact Cards',
|
title: 'Contact Cards',
|
||||||
description: 'Create vCard QR codes with contact information',
|
description: 'Create vCard QR codes with contact information',
|
||||||
format: 'FirstName,LastName,Email,Phone,Organization,Title',
|
format: 'FirstName,LastName,Email,Phone,Organization,Title',
|
||||||
example: 'John Doe,VCARD,John,Doe,john@example.com,+1234567890,Company Inc,CEO',
|
example: 'John Doe,VCARD,John,Doe,john' + '@' + 'example.com,+1234567890,Company Inc,CEO',
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
type: 'GEO',
|
type: 'GEO',
|
||||||
@@ -333,7 +341,7 @@ export default function BulkQRCodeGeneratorPage() {
|
|||||||
Start Bulk Generation
|
Start Bulk Generation
|
||||||
</Button>
|
</Button>
|
||||||
</Link>
|
</Link>
|
||||||
<Link href="/create">
|
<Link href="/signup">
|
||||||
<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-4 w-full sm:w-auto">
|
||||||
Try Single QR First
|
Try Single QR First
|
||||||
</Button>
|
</Button>
|
||||||
@@ -440,7 +448,7 @@ export default function BulkQRCodeGeneratorPage() {
|
|||||||
<tr className="border-b border-gray-200">
|
<tr className="border-b border-gray-200">
|
||||||
<td className="py-2 px-3">John Doe</td>
|
<td className="py-2 px-3">John Doe</td>
|
||||||
<td className="py-2 px-3">VCARD</td>
|
<td className="py-2 px-3">VCARD</td>
|
||||||
<td className="py-2 px-3">John,Doe,john@example.com,+1234567890,Company,CEO</td>
|
<td className="py-2 px-3">John,Doe,john{'@'}example.com,+1234567890,Company,CEO</td>
|
||||||
<td className="py-2 px-3">contact</td>
|
<td className="py-2 px-3">contact</td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr className="border-b border-gray-200">
|
<tr className="border-b border-gray-200">
|
||||||
@@ -633,26 +641,35 @@ Product C,https://example.com/product-c,Budget Widget,electronics,sale`}
|
|||||||
</section>
|
</section>
|
||||||
|
|
||||||
{/* CTA Section */}
|
{/* CTA Section */}
|
||||||
<section className="py-20 bg-gradient-to-r from-green-600 to-blue-600 text-white">
|
{/* CTA Section */}
|
||||||
<div className="container mx-auto px-4 sm:px-6 lg:px-8 max-w-4xl text-center">
|
<section className="py-24 bg-slate-900 relative overflow-hidden">
|
||||||
<h2 className="text-4xl font-bold mb-6">
|
{/* Background Decorations */}
|
||||||
Generate 1000s of QR Codes in Minutes
|
<div className="absolute top-0 right-0 -mr-20 -mt-20 w-96 h-96 bg-blue-500/20 rounded-full blur-3xl opacity-50" />
|
||||||
|
<div className="absolute bottom-0 left-0 -ml-20 -mb-20 w-80 h-80 bg-green-500/20 rounded-full blur-3xl opacity-50" />
|
||||||
|
|
||||||
|
<div className="container mx-auto px-4 sm:px-6 lg:px-8 max-w-4xl text-center relative z-10">
|
||||||
|
<h2 className="text-4xl lg:text-5xl font-bold mb-6 text-white tracking-tight">
|
||||||
|
Ready to Generate <span className="text-transparent bg-clip-text bg-gradient-to-r from-green-400 to-blue-400">1000s of Codes?</span>
|
||||||
</h2>
|
</h2>
|
||||||
<p className="text-xl mb-8 text-green-100">
|
<p className="text-xl mb-10 text-slate-300 leading-relaxed max-w-2xl mx-auto">
|
||||||
Save hours of manual work. Upload your file and get all QR codes ready instantly.
|
Stop doing it manually. Upload your Excel file and get your QR codes in seconds. Professional, branded, and trackable.
|
||||||
</p>
|
</p>
|
||||||
<div className="flex flex-col sm:flex-row gap-4 justify-center">
|
<div className="flex flex-col sm:flex-row gap-5 justify-center">
|
||||||
<Link href="/signup">
|
<Link href="/signup">
|
||||||
<Button size="lg" variant="secondary" className="text-lg px-8 py-4 w-full sm:w-auto bg-white text-green-600 hover:bg-gray-100">
|
<Button size="lg" className="text-lg px-8 py-6 h-auto w-full sm:w-auto bg-white text-slate-900 hover:bg-slate-50 font-bold shadow-xl shadow-blue-900/20 transition-all hover:-translate-y-1">
|
||||||
Start Bulk Generation
|
Start Bulk Generation
|
||||||
</Button>
|
</Button>
|
||||||
</Link>
|
</Link>
|
||||||
<Link href="/pricing">
|
<Link href="/pricing">
|
||||||
<Button size="lg" variant="outline" className="text-lg px-8 py-4 w-full sm:w-auto border-white text-white hover:bg-white/10">
|
<Button size="lg" variant="outline" className="text-lg px-8 py-6 h-auto w-full sm:w-auto border-slate-700 text-white hover:bg-slate-800 hover:border-slate-600 transition-all">
|
||||||
View Pricing
|
View Pricing
|
||||||
</Button>
|
</Button>
|
||||||
</Link>
|
</Link>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
<p className="mt-8 text-sm text-slate-500">
|
||||||
|
No credit card required for free trial.
|
||||||
|
</p>
|
||||||
</div>
|
</div>
|
||||||
</section>
|
</section>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -8,8 +8,8 @@ import Breadcrumbs, { BreadcrumbItem } from '@/components/Breadcrumbs';
|
|||||||
import { breadcrumbSchema } from '@/lib/schema';
|
import { breadcrumbSchema } from '@/lib/schema';
|
||||||
|
|
||||||
export const metadata: Metadata = {
|
export const metadata: Metadata = {
|
||||||
title: 'Dynamic QR Code Generator - Edit QR Codes Anytime | QR Master',
|
title: 'Dynamic QR Code Generator | Edit & Track QR | QR Master',
|
||||||
description: 'Create dynamic QR codes that can be edited after printing. Change destination URL, track scans, and update content without reprinting. Free dynamic QR code generator.',
|
description: 'Create editable dynamic QR codes. Update destination URLs, track scans, and manage content anytime without reprinting. Free generator with analytics.',
|
||||||
keywords: 'dynamic qr code generator, editable qr code, dynamic qr code, free dynamic qr code, qr code generator dynamic, best dynamic qr code generator',
|
keywords: 'dynamic qr code generator, editable qr code, dynamic qr code, free dynamic qr code, qr code generator dynamic, best dynamic qr code generator',
|
||||||
alternates: {
|
alternates: {
|
||||||
canonical: 'https://www.qrmaster.net/dynamic-qr-code-generator',
|
canonical: 'https://www.qrmaster.net/dynamic-qr-code-generator',
|
||||||
@@ -23,6 +23,14 @@ export const metadata: Metadata = {
|
|||||||
description: 'Create dynamic QR codes that can be edited after printing. Change URLs, track scans, and update content anytime.',
|
description: 'Create dynamic QR codes that can be edited after printing. Change URLs, track scans, and update content anytime.',
|
||||||
url: 'https://www.qrmaster.net/dynamic-qr-code-generator',
|
url: 'https://www.qrmaster.net/dynamic-qr-code-generator',
|
||||||
type: 'website',
|
type: 'website',
|
||||||
|
images: [
|
||||||
|
{
|
||||||
|
url: 'https://www.qrmaster.net/og-image.png',
|
||||||
|
width: 1200,
|
||||||
|
height: 630,
|
||||||
|
alt: 'Dynamic QR Code Generator - QR Master',
|
||||||
|
},
|
||||||
|
],
|
||||||
},
|
},
|
||||||
twitter: {
|
twitter: {
|
||||||
title: 'Dynamic QR Code Generator - Edit QR Codes Anytime | QR Master',
|
title: 'Dynamic QR Code Generator - Edit QR Codes Anytime | QR Master',
|
||||||
@@ -180,7 +188,7 @@ export default function DynamicQRCodeGeneratorPage() {
|
|||||||
position: 2,
|
position: 2,
|
||||||
name: 'Generate QR Code',
|
name: 'Generate QR Code',
|
||||||
text: 'Enter your destination URL and customize the design with your branding',
|
text: 'Enter your destination URL and customize the design with your branding',
|
||||||
url: 'https://www.qrmaster.net/create',
|
url: 'https://www.qrmaster.net/signup',
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
'@type': 'HowToStep',
|
'@type': 'HowToStep',
|
||||||
@@ -504,7 +512,7 @@ export default function DynamicQRCodeGeneratorPage() {
|
|||||||
Get Started Free
|
Get Started Free
|
||||||
</Button>
|
</Button>
|
||||||
</Link>
|
</Link>
|
||||||
<Link href="/create">
|
<Link href="/signup">
|
||||||
<Button size="lg" variant="outline" className="text-lg px-8 py-4 w-full sm:w-auto border-white text-white hover:bg-white/10">
|
<Button size="lg" variant="outline" className="text-lg px-8 py-4 w-full sm:w-auto border-white text-white hover:bg-white/10">
|
||||||
Create QR Code Now
|
Create QR Code Now
|
||||||
</Button>
|
</Button>
|
||||||
|
|||||||
@@ -3,6 +3,7 @@ import type { Metadata } from 'next';
|
|||||||
import SeoJsonLd from '@/components/SeoJsonLd';
|
import SeoJsonLd from '@/components/SeoJsonLd';
|
||||||
import { faqPageSchema } from '@/lib/schema';
|
import { faqPageSchema } from '@/lib/schema';
|
||||||
import { Card, CardContent } from '@/components/ui/Card';
|
import { Card, CardContent } from '@/components/ui/Card';
|
||||||
|
import { ContactSupport } from './ContactSupport';
|
||||||
|
|
||||||
function truncateAtWord(text: string, maxLength: number): string {
|
function truncateAtWord(text: string, maxLength: number): string {
|
||||||
if (text.length <= maxLength) return text;
|
if (text.length <= maxLength) return text;
|
||||||
@@ -14,7 +15,7 @@ function truncateAtWord(text: string, maxLength: number): string {
|
|||||||
export async function generateMetadata(): Promise<Metadata> {
|
export async function generateMetadata(): Promise<Metadata> {
|
||||||
const title = truncateAtWord('QR Master FAQ: Dynamic & Bulk QR', 60);
|
const title = truncateAtWord('QR Master FAQ: Dynamic & Bulk QR', 60);
|
||||||
const description = truncateAtWord(
|
const description = truncateAtWord(
|
||||||
'All answers: dynamic QR, security, analytics, bulk, events & print.',
|
'Find answers about dynamic QR codes, scan tracking, security, bulk generation, and event QR codes. Everything you need to know about QR Master features.',
|
||||||
160
|
160
|
||||||
);
|
);
|
||||||
|
|
||||||
@@ -33,6 +34,14 @@ export async function generateMetadata(): Promise<Metadata> {
|
|||||||
description,
|
description,
|
||||||
url: 'https://www.qrmaster.net/faq',
|
url: 'https://www.qrmaster.net/faq',
|
||||||
type: 'website',
|
type: 'website',
|
||||||
|
images: [
|
||||||
|
{
|
||||||
|
url: 'https://www.qrmaster.net/og-image.png',
|
||||||
|
width: 1200,
|
||||||
|
height: 630,
|
||||||
|
alt: 'QR Master FAQ',
|
||||||
|
},
|
||||||
|
],
|
||||||
},
|
},
|
||||||
twitter: {
|
twitter: {
|
||||||
title,
|
title,
|
||||||
@@ -123,18 +132,7 @@ export default function FAQPage() {
|
|||||||
))}
|
))}
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div className="mt-16 bg-blue-50 border-l-4 border-blue-500 p-8 rounded-r-lg">
|
<ContactSupport />
|
||||||
<h2 className="text-2xl font-bold mb-4 text-gray-900">
|
|
||||||
Still have questions?
|
|
||||||
</h2>
|
|
||||||
<p className="text-lg text-gray-700 mb-6 leading-relaxed">
|
|
||||||
Our support team is here to help. Contact us at{' '}
|
|
||||||
<a href="mailto:support@qrmaster.net" className="text-blue-600 hover:text-blue-700 font-semibold">
|
|
||||||
support@qrmaster.net
|
|
||||||
</a>{' '}
|
|
||||||
or reach out through our live chat.
|
|
||||||
</p>
|
|
||||||
</div>
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -1,6 +1,8 @@
|
|||||||
import React from 'react';
|
import React from 'react';
|
||||||
import Link from 'next/link';
|
import Link from 'next/link';
|
||||||
import { Button } from '@/components/ui/Button';
|
|
||||||
|
|
||||||
|
import '@/styles/globals.css';
|
||||||
|
|
||||||
export default function NotFound() {
|
export default function NotFound() {
|
||||||
return (
|
return (
|
||||||
@@ -37,8 +39,7 @@ export default function NotFound() {
|
|||||||
|
|
||||||
{/* Action Button */}
|
{/* Action Button */}
|
||||||
<div className="flex justify-center">
|
<div className="flex justify-center">
|
||||||
<Link href="/">
|
<Link href="/" className="inline-flex items-center justify-center px-4 py-2 border border-transparent text-base font-medium rounded-md shadow-sm text-white bg-primary-600 hover:bg-primary-700 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-primary-500">
|
||||||
<Button size="lg">
|
|
||||||
<svg
|
<svg
|
||||||
className="w-5 h-5 mr-2"
|
className="w-5 h-5 mr-2"
|
||||||
fill="none"
|
fill="none"
|
||||||
@@ -54,7 +55,6 @@ export default function NotFound() {
|
|||||||
/>
|
/>
|
||||||
</svg>
|
</svg>
|
||||||
Back to Home
|
Back to Home
|
||||||
</Button>
|
|
||||||
</Link>
|
</Link>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -3,6 +3,8 @@ import type { Metadata } from 'next';
|
|||||||
import SeoJsonLd from '@/components/SeoJsonLd';
|
import SeoJsonLd from '@/components/SeoJsonLd';
|
||||||
import { organizationSchema, websiteSchema } from '@/lib/schema';
|
import { organizationSchema, websiteSchema } from '@/lib/schema';
|
||||||
import HomePageClient from '@/components/marketing/HomePageClient';
|
import HomePageClient from '@/components/marketing/HomePageClient';
|
||||||
|
import { generateFaqSchema } from '@/lib/schema-utils';
|
||||||
|
import en from '@/i18n/en.json'; // Import English translations for schema generation
|
||||||
|
|
||||||
function truncateAtWord(text: string, maxLength: number): string {
|
function truncateAtWord(text: string, maxLength: number): string {
|
||||||
if (text.length <= maxLength) return text;
|
if (text.length <= maxLength) return text;
|
||||||
@@ -14,7 +16,7 @@ function truncateAtWord(text: string, maxLength: number): string {
|
|||||||
export async function generateMetadata(): Promise<Metadata> {
|
export async function generateMetadata(): Promise<Metadata> {
|
||||||
const title = truncateAtWord('QR Master: Dynamic QR Generator', 60);
|
const title = truncateAtWord('QR Master: Dynamic QR Generator', 60);
|
||||||
const description = truncateAtWord(
|
const description = truncateAtWord(
|
||||||
'Dynamic QR, branding, bulk generation & analytics for all campaigns.',
|
'Create professional QR codes with QR Master. Dynamic QR with tracking, bulk generation, custom branding, and real-time analytics for all your campaigns.',
|
||||||
160
|
160
|
||||||
);
|
);
|
||||||
|
|
||||||
@@ -26,6 +28,7 @@ export async function generateMetadata(): Promise<Metadata> {
|
|||||||
languages: {
|
languages: {
|
||||||
'x-default': 'https://www.qrmaster.net/',
|
'x-default': 'https://www.qrmaster.net/',
|
||||||
en: 'https://www.qrmaster.net/',
|
en: 'https://www.qrmaster.net/',
|
||||||
|
de: 'https://www.qrmaster.net/qr-code-erstellen',
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
openGraph: {
|
openGraph: {
|
||||||
@@ -33,10 +36,19 @@ export async function generateMetadata(): Promise<Metadata> {
|
|||||||
description,
|
description,
|
||||||
url: 'https://www.qrmaster.net/',
|
url: 'https://www.qrmaster.net/',
|
||||||
type: 'website',
|
type: 'website',
|
||||||
|
images: [
|
||||||
|
{
|
||||||
|
url: 'https://www.qrmaster.net/og-image.png',
|
||||||
|
width: 1200,
|
||||||
|
height: 630,
|
||||||
|
alt: 'QR Master - Dynamic QR Code Generator and Analytics Platform',
|
||||||
|
},
|
||||||
|
],
|
||||||
},
|
},
|
||||||
twitter: {
|
twitter: {
|
||||||
title,
|
title,
|
||||||
description,
|
description,
|
||||||
|
images: ['https://www.qrmaster.net/og-image.png'],
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
@@ -44,11 +56,13 @@ export async function generateMetadata(): Promise<Metadata> {
|
|||||||
export default function HomePage() {
|
export default function HomePage() {
|
||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
<SeoJsonLd data={[organizationSchema(), websiteSchema()]} />
|
<SeoJsonLd data={[organizationSchema(), websiteSchema(), generateFaqSchema(en.faq.questions)]} />
|
||||||
|
|
||||||
|
{/* Server-rendered H1 for SEO - visually hidden but crawlable */}
|
||||||
|
<h1 className="sr-only">QR Master: Dynamic QR Code Generator with Analytics</h1>
|
||||||
|
|
||||||
{/* Server-rendered SEO content for crawlers */}
|
{/* Server-rendered SEO content for crawlers */}
|
||||||
<div className="sr-only" aria-hidden="false">
|
<div className="sr-only" aria-hidden="false">
|
||||||
<h1>QR Master: Free Dynamic QR Code Generator with Tracking & Analytics</h1>
|
|
||||||
<p>
|
<p>
|
||||||
Create professional QR codes for your business with QR Master. Our dynamic QR code generator
|
Create professional QR codes for your business with QR Master. Our dynamic QR code generator
|
||||||
lets you create trackable QR codes, edit destinations anytime, and view detailed analytics.
|
lets you create trackable QR codes, edit destinations anytime, and view detailed analytics.
|
||||||
|
|||||||
@@ -7,8 +7,9 @@ import { Badge } from '@/components/ui/Badge';
|
|||||||
import { showToast } from '@/components/ui/Toast';
|
import { showToast } from '@/components/ui/Toast';
|
||||||
import { useRouter } from 'next/navigation';
|
import { useRouter } from 'next/navigation';
|
||||||
import { BillingToggle } from '@/components/ui/BillingToggle';
|
import { BillingToggle } from '@/components/ui/BillingToggle';
|
||||||
|
import { ObfuscatedMailto } from '@/components/ui/ObfuscatedMailto';
|
||||||
|
|
||||||
export default function PricingPage() {
|
export default function PricingClient() {
|
||||||
const router = useRouter();
|
const router = useRouter();
|
||||||
const [loading, setLoading] = useState<string | null>(null);
|
const [loading, setLoading] = useState<string | null>(null);
|
||||||
const [currentPlan, setCurrentPlan] = useState<string>('FREE');
|
const [currentPlan, setCurrentPlan] = useState<string>('FREE');
|
||||||
@@ -182,9 +183,9 @@ export default function PricingPage() {
|
|||||||
return (
|
return (
|
||||||
<div className="container mx-auto px-4 py-12">
|
<div className="container mx-auto px-4 py-12">
|
||||||
<div className="text-center mb-12">
|
<div className="text-center mb-12">
|
||||||
<h1 className="text-4xl font-bold text-gray-900 mb-4">
|
<h2 className="text-4xl font-bold text-gray-900 mb-4">
|
||||||
Choose Your Plan
|
Choose Your Plan
|
||||||
</h1>
|
</h2>
|
||||||
<p className="text-xl text-gray-600">
|
<p className="text-xl text-gray-600">
|
||||||
Select the perfect plan for your QR code needs
|
Select the perfect plan for your QR code needs
|
||||||
</p>
|
</p>
|
||||||
@@ -260,7 +261,7 @@ export default function PricingPage() {
|
|||||||
All plans include unlimited static QR codes and basic customization.
|
All plans include unlimited static QR codes and basic customization.
|
||||||
</p>
|
</p>
|
||||||
<p className="text-gray-600 mt-2">
|
<p className="text-gray-600 mt-2">
|
||||||
Need help choosing? <a href="mailto:support@qrmaster.net" className="text-primary-600 hover:text-primary-700 underline">Contact our team</a>
|
Need help choosing? <ObfuscatedMailto email="support@qrmaster.net" className="text-primary-600 hover:text-primary-700 underline">Contact our team</ObfuscatedMailto>
|
||||||
</p>
|
</p>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -1,9 +1,27 @@
|
|||||||
import React from 'react';
|
import React from 'react';
|
||||||
import Link from 'next/link';
|
import Link from 'next/link';
|
||||||
|
import { PrivacyEmailLink } from './PrivacyEmailLink';
|
||||||
|
|
||||||
export const metadata = {
|
export const metadata = {
|
||||||
title: 'Privacy Policy | QR Master',
|
title: 'Privacy Policy | QR Master',
|
||||||
description: 'Privacy Policy and data protection information for QR Master',
|
description: 'Read our Privacy Policy to understand how QR Master collects, uses, and protects your data. We are committed to GDPR compliance and data security.',
|
||||||
|
alternates: {
|
||||||
|
canonical: 'https://www.qrmaster.net/privacy',
|
||||||
|
},
|
||||||
|
openGraph: {
|
||||||
|
title: 'Privacy Policy | QR Master',
|
||||||
|
description: 'Read our Privacy Policy to understand how QR Master collects, uses, and protects your data.',
|
||||||
|
url: 'https://www.qrmaster.net/privacy',
|
||||||
|
type: 'website',
|
||||||
|
images: [
|
||||||
|
{
|
||||||
|
url: 'https://www.qrmaster.net/og-image.png',
|
||||||
|
width: 1200,
|
||||||
|
height: 630,
|
||||||
|
alt: 'QR Master Privacy Policy',
|
||||||
|
},
|
||||||
|
],
|
||||||
|
},
|
||||||
};
|
};
|
||||||
|
|
||||||
export default function PrivacyPage() {
|
export default function PrivacyPage() {
|
||||||
@@ -93,9 +111,7 @@ export default function PrivacyPage() {
|
|||||||
</ul>
|
</ul>
|
||||||
<p className="text-gray-700 mb-4">
|
<p className="text-gray-700 mb-4">
|
||||||
To exercise these rights, contact us at{' '}
|
To exercise these rights, contact us at{' '}
|
||||||
<a href="mailto:support@qrmaster.net" className="text-primary-600 hover:text-primary-700">
|
<PrivacyEmailLink />
|
||||||
support@qrmaster.net
|
|
||||||
</a>
|
|
||||||
</p>
|
</p>
|
||||||
<p className="text-gray-700 mb-4">
|
<p className="text-gray-700 mb-4">
|
||||||
Our service is for users 16 years and older. If you're in the EEA and have concerns,
|
Our service is for users 16 years and older. If you're in the EEA and have concerns,
|
||||||
@@ -111,9 +127,7 @@ export default function PrivacyPage() {
|
|||||||
<div className="bg-gray-50 p-6 rounded-lg">
|
<div className="bg-gray-50 p-6 rounded-lg">
|
||||||
<p className="text-gray-700 mb-2">
|
<p className="text-gray-700 mb-2">
|
||||||
<strong>Email:</strong>{' '}
|
<strong>Email:</strong>{' '}
|
||||||
<a href="mailto:support@qrmaster.net" className="text-primary-600 hover:text-primary-700">
|
<PrivacyEmailLink />
|
||||||
support@qrmaster.net
|
|
||||||
</a>
|
|
||||||
</p>
|
</p>
|
||||||
<p className="text-gray-700 mb-2"><strong>Website:</strong> <a href="/" className="text-primary-600 hover:text-primary-700">qrmaster.net</a></p>
|
<p className="text-gray-700 mb-2"><strong>Website:</strong> <a href="/" className="text-primary-600 hover:text-primary-700">qrmaster.net</a></p>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -8,7 +8,7 @@ import Breadcrumbs, { BreadcrumbItem } from '@/components/Breadcrumbs';
|
|||||||
import { breadcrumbSchema } from '@/lib/schema';
|
import { breadcrumbSchema } from '@/lib/schema';
|
||||||
|
|
||||||
export const metadata: Metadata = {
|
export const metadata: Metadata = {
|
||||||
title: 'QR Code Tracking & Analytics - Track Every Scan | QR Master',
|
title: 'QR Code Tracking & Analytics - Track Scans | QR Master',
|
||||||
description: 'Track QR code scans with real-time analytics. Monitor location, device, time, and user behavior. Free QR code tracking software with detailed reports.',
|
description: 'Track QR code scans with real-time analytics. Monitor location, device, time, and user behavior. Free QR code tracking software with detailed reports.',
|
||||||
keywords: 'qr code tracking, qr code analytics, track qr scans, qr code statistics, free qr tracking, qr code monitoring',
|
keywords: 'qr code tracking, qr code analytics, track qr scans, qr code statistics, free qr tracking, qr code monitoring',
|
||||||
alternates: {
|
alternates: {
|
||||||
@@ -19,13 +19,21 @@ export const metadata: Metadata = {
|
|||||||
},
|
},
|
||||||
},
|
},
|
||||||
openGraph: {
|
openGraph: {
|
||||||
title: 'QR Code Tracking & Analytics - Track Every Scan | QR Master',
|
title: 'QR Code Tracking & Analytics - Track Scans | QR Master',
|
||||||
description: 'Track QR code scans with real-time analytics. Monitor location, device, time, and user behavior.',
|
description: 'Track QR code scans with real-time analytics. Monitor location, device, time, and user behavior.',
|
||||||
url: 'https://www.qrmaster.net/qr-code-tracking',
|
url: 'https://www.qrmaster.net/qr-code-tracking',
|
||||||
type: 'website',
|
type: 'website',
|
||||||
|
images: [
|
||||||
|
{
|
||||||
|
url: 'https://www.qrmaster.net/og-image.png',
|
||||||
|
width: 1200,
|
||||||
|
height: 630,
|
||||||
|
alt: 'QR Code Tracking & Analytics - QR Master',
|
||||||
|
},
|
||||||
|
],
|
||||||
},
|
},
|
||||||
twitter: {
|
twitter: {
|
||||||
title: 'QR Code Tracking & Analytics - Track Every Scan | QR Master',
|
title: 'QR Code Tracking & Analytics - Track Scans | QR Master',
|
||||||
description: 'Track QR code scans with real-time analytics. Monitor location, device, time, and user behavior.',
|
description: 'Track QR code scans with real-time analytics. Monitor location, device, time, and user behavior.',
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
@@ -154,7 +162,7 @@ export default function QRCodeTrackingPage() {
|
|||||||
position: 3,
|
position: 3,
|
||||||
name: 'Monitor Analytics',
|
name: 'Monitor Analytics',
|
||||||
text: 'View real-time scan data including location, device, and time patterns in your dashboard',
|
text: 'View real-time scan data including location, device, and time patterns in your dashboard',
|
||||||
url: 'https://www.qrmaster.net/analytics',
|
url: 'https://www.qrmaster.net/signup',
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
'@type': 'HowToStep',
|
'@type': 'HowToStep',
|
||||||
@@ -199,7 +207,7 @@ export default function QRCodeTrackingPage() {
|
|||||||
Start Tracking Free
|
Start Tracking Free
|
||||||
</Button>
|
</Button>
|
||||||
</Link>
|
</Link>
|
||||||
<Link href="/create">
|
<Link href="/signup">
|
||||||
<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-4 w-full sm:w-auto">
|
||||||
Create Trackable QR Code
|
Create Trackable QR Code
|
||||||
</Button>
|
</Button>
|
||||||
@@ -370,26 +378,35 @@ export default function QRCodeTrackingPage() {
|
|||||||
</section>
|
</section>
|
||||||
|
|
||||||
{/* CTA Section */}
|
{/* CTA Section */}
|
||||||
<section className="py-20 bg-gradient-to-r from-primary-600 to-purple-600 text-white">
|
{/* CTA Section */}
|
||||||
<div className="container mx-auto px-4 sm:px-6 lg:px-8 max-w-4xl text-center">
|
<section className="py-24 bg-slate-900 relative overflow-hidden">
|
||||||
<h2 className="text-4xl font-bold mb-6">
|
{/* Background Decorations */}
|
||||||
Start Tracking Your QR Codes Today
|
<div className="absolute top-0 right-0 -mr-20 -mt-20 w-96 h-96 bg-primary-500/20 rounded-full blur-3xl opacity-50" />
|
||||||
|
<div className="absolute bottom-0 left-0 -ml-20 -mb-20 w-80 h-80 bg-purple-500/20 rounded-full blur-3xl opacity-50" />
|
||||||
|
|
||||||
|
<div className="container mx-auto px-4 sm:px-6 lg:px-8 max-w-4xl text-center relative z-10">
|
||||||
|
<h2 className="text-4xl lg:text-5xl font-bold mb-6 text-white tracking-tight">
|
||||||
|
Start Tracking Your <span className="text-transparent bg-clip-text bg-gradient-to-r from-primary-400 to-purple-400">QR Codes Today</span>
|
||||||
</h2>
|
</h2>
|
||||||
<p className="text-xl mb-8 text-primary-100">
|
<p className="text-xl mb-10 text-slate-300 leading-relaxed max-w-2xl mx-auto">
|
||||||
Join thousands of businesses using QR Master to track and optimize their QR code campaigns
|
Join thousands of businesses using QR Master to optimize their campaigns with real-time analytics.
|
||||||
</p>
|
</p>
|
||||||
<div className="flex flex-col sm:flex-row gap-4 justify-center">
|
<div className="flex flex-col sm:flex-row gap-5 justify-center">
|
||||||
<Link href="/signup">
|
<Link href="/signup">
|
||||||
<Button size="lg" variant="secondary" className="text-lg px-8 py-4 w-full sm:w-auto bg-white text-primary-600 hover:bg-gray-100">
|
<Button size="lg" className="text-lg px-8 py-6 h-auto w-full sm:w-auto bg-white text-slate-900 hover:bg-slate-50 font-bold shadow-xl shadow-primary-900/20 transition-all hover:-translate-y-1">
|
||||||
Create Free Account
|
Create Free Account
|
||||||
</Button>
|
</Button>
|
||||||
</Link>
|
</Link>
|
||||||
<Link href="/pricing">
|
<Link href="/pricing">
|
||||||
<Button size="lg" variant="outline" className="text-lg px-8 py-4 w-full sm:w-auto border-white text-white hover:bg-white/10">
|
<Button size="lg" variant="outline" className="text-lg px-8 py-6 h-auto w-full sm:w-auto border-slate-700 text-white hover:bg-slate-800 hover:border-slate-600 transition-all">
|
||||||
View Pricing
|
View Pricing
|
||||||
</Button>
|
</Button>
|
||||||
</Link>
|
</Link>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
<p className="mt-8 text-sm text-slate-500">
|
||||||
|
Full analytics accessible on free plan.
|
||||||
|
</p>
|
||||||
</div>
|
</div>
|
||||||
</section>
|
</section>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -1,435 +0,0 @@
|
|||||||
'use client';
|
|
||||||
|
|
||||||
import React, { useState, useRef } from 'react';
|
|
||||||
import Barcode from 'react-barcode';
|
|
||||||
import Link from 'next/link';
|
|
||||||
import { Download, Printer, Barcode as BarcodeIcon, Sparkles, Sliders, Check, Info, Copy } from 'lucide-react';
|
|
||||||
import { Button } from '@/components/ui/Button';
|
|
||||||
import { Input } from '@/components/ui/Input';
|
|
||||||
import { Select } from '@/components/ui/Select';
|
|
||||||
import { showToast } from '@/components/ui/Toast';
|
|
||||||
import { cn } from '@/lib/utils';
|
|
||||||
import { toPng, toSvg, toBlob } from 'html-to-image';
|
|
||||||
|
|
||||||
// Brand Colors
|
|
||||||
const BRAND = {
|
|
||||||
paleGrey: '#EBEBDF',
|
|
||||||
slate900: '#0f172a',
|
|
||||||
};
|
|
||||||
|
|
||||||
const BARCODE_COLORS = [
|
|
||||||
{ name: 'Classic Black', value: '#000000' },
|
|
||||||
{ name: 'Dark Blue', value: '#1A1265' },
|
|
||||||
{ name: 'Rich Indigo', value: '#4338CA' },
|
|
||||||
{ name: 'Deep Emerald', value: '#065F46' },
|
|
||||||
{ name: 'Crimson', value: '#991B1B' },
|
|
||||||
{ name: 'Slate Gray', value: '#334155' },
|
|
||||||
{ name: 'Business Navy', value: '#1E293B' },
|
|
||||||
];
|
|
||||||
|
|
||||||
const FRAME_OPTIONS = [
|
|
||||||
{ id: 'none', label: 'No Frame' },
|
|
||||||
{ id: 'scanme', label: 'Scan Me' },
|
|
||||||
{ id: 'product', label: 'Product' },
|
|
||||||
{ id: 'serial', label: 'Serial' },
|
|
||||||
];
|
|
||||||
|
|
||||||
const FORMAT_INFO: Record<string, string> = {
|
|
||||||
'CODE128': 'High-density alphanumeric format. Best for general purpose use.',
|
|
||||||
'EAN13': 'International retail standard for products worldwide.',
|
|
||||||
'UPC': 'Standard retail format used primarily in North America.',
|
|
||||||
'CODE39': 'Older industrial standard supporting uppercase letters and numbers.',
|
|
||||||
'ITF14': 'Used on shipping containers and logistics packaging.',
|
|
||||||
'MSI': 'Specialized format for retail shelf labeling and inventory.',
|
|
||||||
'pharmacode': 'Pharmaceutical packaging control standard.',
|
|
||||||
};
|
|
||||||
|
|
||||||
export default function BarcodeGeneratorClient() {
|
|
||||||
const [value, setValue] = useState('123456789');
|
|
||||||
const [format, setFormat] = useState('CODE128');
|
|
||||||
const [width, setWidth] = useState(2);
|
|
||||||
const [height, setHeight] = useState(100);
|
|
||||||
const [displayValue, setDisplayValue] = useState(true);
|
|
||||||
const [lineColor, setLineColor] = useState('#000000');
|
|
||||||
const [frameType, setFrameType] = useState('none');
|
|
||||||
const [error, setError] = useState<string | null>(null);
|
|
||||||
|
|
||||||
const barcodeRef = useRef<HTMLDivElement>(null);
|
|
||||||
|
|
||||||
// Validation Logic
|
|
||||||
React.useEffect(() => {
|
|
||||||
setError(null);
|
|
||||||
if (!value) return;
|
|
||||||
|
|
||||||
if (format === 'EAN13' && !/^\d{12,13}$/.test(value)) {
|
|
||||||
setError('EAN-13 requires 12 or 13 digits.');
|
|
||||||
} else if (format === 'UPC' && !/^\d{11,12}$/.test(value)) {
|
|
||||||
setError('UPC requires 11 or 12 digits.');
|
|
||||||
} else if (format === 'CODE39' && !/^[0-9A-Z\-\.\ \$\/\+\%]+$/.test(value)) {
|
|
||||||
setError('Code 39 only supports numbers, uppercase letters, and - . $ / + % spaces.');
|
|
||||||
} else if ((format === 'ITF14' || format === 'MSI') && !/^\d+$/.test(value)) {
|
|
||||||
setError('This format only supports numbers.');
|
|
||||||
}
|
|
||||||
}, [value, format]);
|
|
||||||
|
|
||||||
const downloadBarcode = async (extension: 'png' | 'svg') => {
|
|
||||||
if (!barcodeRef.current) return;
|
|
||||||
|
|
||||||
try {
|
|
||||||
let dataUrl;
|
|
||||||
if (extension === 'png') {
|
|
||||||
dataUrl = await toPng(barcodeRef.current, {
|
|
||||||
backgroundColor: '#ffffff',
|
|
||||||
pixelRatio: 3,
|
|
||||||
});
|
|
||||||
} else {
|
|
||||||
dataUrl = await toSvg(barcodeRef.current, {
|
|
||||||
backgroundColor: '#ffffff',
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
const link = document.createElement('a');
|
|
||||||
link.href = dataUrl;
|
|
||||||
link.download = `barcode-${value || 'generator'}.${extension}`;
|
|
||||||
document.body.appendChild(link);
|
|
||||||
link.click();
|
|
||||||
document.body.removeChild(link);
|
|
||||||
|
|
||||||
showToast(`Barcode downloaded as ${extension.toUpperCase()}`, 'success');
|
|
||||||
} catch (err) {
|
|
||||||
console.error('Download failed', err);
|
|
||||||
showToast('Download failed', 'error');
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
const copyBarcode = async () => {
|
|
||||||
if (!barcodeRef.current) return;
|
|
||||||
try {
|
|
||||||
// Use toBlob directly for better performance and compatibility
|
|
||||||
const blob = await toBlob(barcodeRef.current, {
|
|
||||||
backgroundColor: '#ffffff',
|
|
||||||
pixelRatio: 3,
|
|
||||||
});
|
|
||||||
|
|
||||||
if (!blob) {
|
|
||||||
throw new Error('Failed to generate image blob');
|
|
||||||
}
|
|
||||||
|
|
||||||
await navigator.clipboard.write([
|
|
||||||
new ClipboardItem({
|
|
||||||
'image/png': blob,
|
|
||||||
}),
|
|
||||||
]);
|
|
||||||
showToast('Barcode copied to clipboard', 'success');
|
|
||||||
} catch (err) {
|
|
||||||
console.error('Copy failed', err);
|
|
||||||
showToast('Failed to copy barcode', 'error');
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
const formats = [
|
|
||||||
{ value: 'CODE128', label: 'Code 128 (Standard)' },
|
|
||||||
{ value: 'EAN13', label: 'EAN-13 (Retail)' },
|
|
||||||
{ value: 'UPC', label: 'UPC-A (US Retail)' },
|
|
||||||
{ value: 'CODE39', label: 'Code 39' },
|
|
||||||
{ value: 'ITF14', label: 'ITF-14' },
|
|
||||||
{ value: 'MSI', label: 'MSI' },
|
|
||||||
{ value: 'pharmacode', label: 'Pharmacode' },
|
|
||||||
];
|
|
||||||
|
|
||||||
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-6 md:p-8 lg:p-10 space-y-8 border-r border-slate-100">
|
|
||||||
|
|
||||||
{/* Configuration */}
|
|
||||||
<div className="space-y-6">
|
|
||||||
<h2 className="text-lg font-bold text-slate-900 flex items-center gap-2">
|
|
||||||
<Sliders className="w-5 h-5 text-slate-900" aria-hidden="true" />
|
|
||||||
Configuration
|
|
||||||
</h2>
|
|
||||||
|
|
||||||
<div className="space-y-4">
|
|
||||||
<div>
|
|
||||||
<label htmlFor="barcode-content" className="block text-sm font-medium text-slate-700 mb-2">Content</label>
|
|
||||||
<Input
|
|
||||||
id="barcode-content"
|
|
||||||
value={value}
|
|
||||||
onChange={(e) => setValue(e.target.value)}
|
|
||||||
placeholder="Enter barcode data (e.g. 12345678)"
|
|
||||||
className="h-12 text-base rounded-xl border-slate-200 focus:border-slate-900 focus:ring-slate-900"
|
|
||||||
aria-label="Barcode content"
|
|
||||||
/>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div>
|
|
||||||
<div className="flex items-center justify-between mb-2">
|
|
||||||
<label className="block text-sm font-medium text-slate-700">Format</label>
|
|
||||||
<div className="group relative">
|
|
||||||
<Info className="w-4 h-4 text-slate-400 cursor-help" />
|
|
||||||
<div className="absolute right-0 bottom-full mb-2 w-64 p-3 bg-slate-900 text-white text-[11px] rounded-xl opacity-0 group-hover:opacity-100 transition-opacity pointer-events-none shadow-xl z-50">
|
|
||||||
<p className="font-bold mb-1">Format Guide:</p>
|
|
||||||
<p>{FORMAT_INFO[format]}</p>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
<Select
|
|
||||||
value={format}
|
|
||||||
onChange={(e) => setFormat(e.target.value)}
|
|
||||||
className="h-12 rounded-xl border-slate-200"
|
|
||||||
options={formats}
|
|
||||||
aria-label="Format"
|
|
||||||
/>
|
|
||||||
<p className="text-[10px] text-slate-500 mt-2 px-1">
|
|
||||||
{FORMAT_INFO[format]}
|
|
||||||
</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-slate-900" aria-hidden="true" />
|
|
||||||
Design Options
|
|
||||||
</h2>
|
|
||||||
|
|
||||||
<div className="grid grid-cols-2 gap-6">
|
|
||||||
<div className="space-y-3">
|
|
||||||
<div className="flex justify-between">
|
|
||||||
<label htmlFor="width-range" className="text-sm font-medium text-slate-700">Width</label>
|
|
||||||
<span className="text-xs text-slate-500 bg-slate-100 px-2 py-1 rounded-md font-bold">{width}px</span>
|
|
||||||
</div>
|
|
||||||
<input
|
|
||||||
id="width-range"
|
|
||||||
type="range"
|
|
||||||
min="1"
|
|
||||||
max="4"
|
|
||||||
step="0.5"
|
|
||||||
value={width}
|
|
||||||
onChange={(e) => setWidth(parseFloat(e.target.value))}
|
|
||||||
className="w-full h-2 bg-slate-200 rounded-lg appearance-none cursor-pointer accent-slate-900"
|
|
||||||
aria-label="Barcode width"
|
|
||||||
/>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div className="space-y-3">
|
|
||||||
<div className="flex justify-between">
|
|
||||||
<label htmlFor="height-range" className="text-sm font-medium text-slate-700">Height</label>
|
|
||||||
<span className="text-xs text-slate-500 bg-slate-100 px-2 py-1 rounded-md font-bold">{height}px</span>
|
|
||||||
</div>
|
|
||||||
<input
|
|
||||||
id="height-range"
|
|
||||||
type="range"
|
|
||||||
min="30"
|
|
||||||
max="200"
|
|
||||||
step="5"
|
|
||||||
value={height}
|
|
||||||
onChange={(e) => setHeight(parseInt(e.target.value))}
|
|
||||||
className="w-full h-2 bg-slate-200 rounded-lg appearance-none cursor-pointer accent-slate-900"
|
|
||||||
aria-label="Barcode height"
|
|
||||||
/>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div>
|
|
||||||
<label className="block text-sm font-medium text-slate-700 mb-3">Line Color</label>
|
|
||||||
<div className="flex flex-wrap gap-2">
|
|
||||||
{BARCODE_COLORS.map((c) => (
|
|
||||||
<button
|
|
||||||
key={c.name}
|
|
||||||
onClick={() => setLineColor(c.value)}
|
|
||||||
className={cn(
|
|
||||||
"w-9 h-9 rounded-full border-2 flex items-center justify-center transition-all hover:scale-110",
|
|
||||||
lineColor === c.value ? "border-slate-900 ring-2 ring-offset-2 ring-slate-200" : "border-white shadow-md"
|
|
||||||
)}
|
|
||||||
style={{ backgroundColor: c.value }}
|
|
||||||
aria-label={`Select color ${c.name}`}
|
|
||||||
title={c.name}
|
|
||||||
>
|
|
||||||
{lineColor === c.value && <Check className="w-4 h-4 text-white" strokeWidth={3} aria-hidden="true" />}
|
|
||||||
</button>
|
|
||||||
))}
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div>
|
|
||||||
<label className="block text-sm font-medium text-slate-700 mb-3">Frame Label</label>
|
|
||||||
<div className="grid grid-cols-2 sm: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>
|
|
||||||
|
|
||||||
<label className="flex items-center gap-3 cursor-pointer group p-3 border border-slate-200 rounded-xl hover:border-slate-900 transition-colors bg-slate-50/50">
|
|
||||||
<div className={cn(
|
|
||||||
"w-5 h-5 rounded border-2 flex items-center justify-center transition-all",
|
|
||||||
displayValue ? "bg-slate-900 border-slate-900" : "border-slate-300 group-hover:border-slate-400"
|
|
||||||
)}>
|
|
||||||
{displayValue && <Check className="w-3.5 h-3.5 text-white" strokeWidth={3} />}
|
|
||||||
</div>
|
|
||||||
<input
|
|
||||||
type="checkbox"
|
|
||||||
checked={displayValue}
|
|
||||||
onChange={(e) => setDisplayValue(e.target.checked)}
|
|
||||||
className="sr-only"
|
|
||||||
/>
|
|
||||||
<span className="text-sm font-medium text-slate-700">Show Value Text</span>
|
|
||||||
</label>
|
|
||||||
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
{/* RIGHT: Preview Section */}
|
|
||||||
<div className="p-6 md:p-8 lg:p-10 flex flex-col items-center justify-center" style={{ backgroundColor: BRAND.paleGrey }}>
|
|
||||||
|
|
||||||
{/* Barcode Card */}
|
|
||||||
<div
|
|
||||||
className="bg-white rounded-3xl shadow-xl p-8 flex flex-col items-center justify-center min-h-[300px] w-full max-w-[400px] border border-slate-100 relative"
|
|
||||||
>
|
|
||||||
<div className="absolute top-4 right-4">
|
|
||||||
<div className="flex items-center gap-1.5 px-2 py-1 bg-slate-100 rounded-md text-[10px] font-bold text-slate-500 uppercase tracking-wider">
|
|
||||||
Live Preview
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div ref={barcodeRef} className="py-4 bg-white flex flex-col items-center justify-center overflow-hidden w-full">
|
|
||||||
{frameType !== 'none' && !error && (
|
|
||||||
<div
|
|
||||||
className="mb-4 px-6 py-2 rounded-full text-white font-bold text-xs tracking-widest uppercase shadow-md"
|
|
||||||
style={{ backgroundColor: lineColor }}
|
|
||||||
>
|
|
||||||
{FRAME_OPTIONS.find(f => f.id === frameType)?.label}
|
|
||||||
</div>
|
|
||||||
)}
|
|
||||||
|
|
||||||
{error ? (
|
|
||||||
<div className="flex flex-col items-center text-center p-6 animate-in fade-in zoom-in duration-200">
|
|
||||||
<div className="w-12 h-12 bg-red-100 rounded-full flex items-center justify-center mb-3">
|
|
||||||
<Info className="w-6 h-6 text-red-500" />
|
|
||||||
</div>
|
|
||||||
<p className="text-red-500 font-bold text-sm">{error}</p>
|
|
||||||
<p className="text-slate-400 text-xs mt-1">Please correct your input.</p>
|
|
||||||
</div>
|
|
||||||
) : value ? (
|
|
||||||
<Barcode
|
|
||||||
key={`${format}-${lineColor}-${value}-${width}-${height}-${displayValue}`}
|
|
||||||
value={value}
|
|
||||||
format={format as any}
|
|
||||||
width={width}
|
|
||||||
height={height}
|
|
||||||
displayValue={displayValue}
|
|
||||||
background="#ffffff"
|
|
||||||
lineColor={lineColor}
|
|
||||||
margin={10}
|
|
||||||
/>
|
|
||||||
) : (
|
|
||||||
<div className="text-center text-slate-400 p-6">
|
|
||||||
<BarcodeIcon className="w-12 h-12 mx-auto mb-3 opacity-30" />
|
|
||||||
<p className="text-sm font-medium">Enter data to generate</p>
|
|
||||||
</div>
|
|
||||||
)}
|
|
||||||
</div>
|
|
||||||
|
|
||||||
{/* Info Preview */}
|
|
||||||
<div className="mt-6 text-center w-full">
|
|
||||||
<h3 className="font-bold text-slate-900 text-lg flex items-center justify-center gap-2 truncate">
|
|
||||||
<span className="truncate">{formats.find(f => f.value === format)?.label}</span>
|
|
||||||
</h3>
|
|
||||||
<div className="text-xs text-slate-600 mt-1 truncate px-2 font-mono">
|
|
||||||
{value || 'Barcode Value'}
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
{/* Download Buttons */}
|
|
||||||
<div className="flex flex-col gap-4 mt-8 w-full max-w-[450px]">
|
|
||||||
<div className="flex flex-col sm:flex-row items-center gap-3 w-full">
|
|
||||||
<Button
|
|
||||||
onClick={() => downloadBarcode('png')}
|
|
||||||
className="w-full sm:flex-1 bg-slate-900 hover:bg-black text-white shadow-lg h-12 rounded-xl"
|
|
||||||
aria-label="Download barcode as PNG"
|
|
||||||
>
|
|
||||||
<Download className="w-4 h-4 mr-2" aria-hidden="true" />
|
|
||||||
Download PNG
|
|
||||||
</Button>
|
|
||||||
<div className="relative w-full sm:w-auto">
|
|
||||||
<div className="absolute -top-3 left-1/2 -translate-x-1/2 bg-indigo-600 text-white text-[9px] font-bold px-2 py-0.5 rounded-full whitespace-nowrap shadow-sm z-10 pointer-events-none">
|
|
||||||
BEST FOR PRINT
|
|
||||||
</div>
|
|
||||||
<Button
|
|
||||||
onClick={() => downloadBarcode('svg')}
|
|
||||||
variant="outline"
|
|
||||||
className="w-full sm:w-auto px-6 border-slate-300 hover:bg-white h-12 rounded-xl font-bold"
|
|
||||||
aria-label="Download barcode as SVG"
|
|
||||||
>
|
|
||||||
SVG
|
|
||||||
</Button>
|
|
||||||
</div>
|
|
||||||
<Button
|
|
||||||
onClick={copyBarcode}
|
|
||||||
variant="outline"
|
|
||||||
className="w-full sm:w-auto px-4 border-slate-300 hover:bg-white h-12 rounded-xl"
|
|
||||||
title="Copy to Clipboard"
|
|
||||||
aria-label="Copy barcode image to clipboard"
|
|
||||||
>
|
|
||||||
<Copy className="w-4 h-4 text-slate-600" aria-hidden="true" />
|
|
||||||
</Button>
|
|
||||||
<Button
|
|
||||||
onClick={() => window.print()}
|
|
||||||
variant="outline"
|
|
||||||
className="w-full sm:w-auto px-4 border-slate-300 hover:bg-white h-12 rounded-xl"
|
|
||||||
title="Print"
|
|
||||||
aria-label="Print barcode"
|
|
||||||
>
|
|
||||||
<Printer className="w-4 h-4 text-slate-600" aria-hidden="true" />
|
|
||||||
</Button>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div className="text-center">
|
|
||||||
<Link href="/signup" className="text-xs font-medium text-slate-400 hover:text-indigo-600 transition-colors flex items-center justify-center gap-1 group">
|
|
||||||
Need bulk generation?
|
|
||||||
<span className="underline decoration-slate-300 group-hover:decoration-indigo-300 underline-offset-4">Available in Pro →</span>
|
|
||||||
</Link>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</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">Need Dynamic QR Codes?</h3>
|
|
||||||
<p className="text-white/80 text-sm mt-1">
|
|
||||||
Switch to QR codes to edit content later and track your scans.
|
|
||||||
</p>
|
|
||||||
</div>
|
|
||||||
<Link href="/signup">
|
|
||||||
<Button className="bg-white text-slate-900 hover:bg-slate-100 shrink-0 shadow-lg px-8">
|
|
||||||
Get Started Free
|
|
||||||
</Button>
|
|
||||||
</Link>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
);
|
|
||||||
}
|
|
||||||
@@ -1,321 +0,0 @@
|
|||||||
import { BookOpen, CheckCircle, HelpCircle, Layers, Settings, ShoppingCart, Tag, Activity, Factory } from 'lucide-react';
|
|
||||||
import Link from 'next/link';
|
|
||||||
|
|
||||||
export function BarcodeGuide() {
|
|
||||||
return (
|
|
||||||
<section className="py-16 px-4 sm:px-6 lg:px-8 bg-white" id="guide">
|
|
||||||
<div className="max-w-3xl mx-auto prose prose-slate prose-lg">
|
|
||||||
|
|
||||||
<div className="flex items-center gap-3 mb-8 not-prose">
|
|
||||||
<div className="p-3 bg-blue-100/50 rounded-xl">
|
|
||||||
<BookOpen className="w-8 h-8 text-blue-600" />
|
|
||||||
</div>
|
|
||||||
<h2 className="text-3xl font-bold text-slate-900 m-0">
|
|
||||||
Barcode Generator – How Barcodes Work and Why They Matter
|
|
||||||
</h2>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<p className="lead text-xl text-slate-600">
|
|
||||||
Barcodes are an essential part of modern commerce, logistics, and inventory management. A <strong>Barcode Generator</strong> allows businesses and individuals to create scannable barcodes quickly and efficiently for products, packaging, and internal systems. Whether you run an online shop, manage a warehouse, or sell products locally, understanding how barcodes work can save time and reduce errors.
|
|
||||||
</p>
|
|
||||||
<p>
|
|
||||||
In this article, you will learn what barcodes are, how they work, and how a <strong>Barcode Generator</strong> helps you create professional barcodes in seconds.
|
|
||||||
</p>
|
|
||||||
|
|
||||||
{/* SEO Image */}
|
|
||||||
<div className="my-8 rounded-2xl overflow-hidden shadow-lg not-prose border border-slate-100">
|
|
||||||
<img
|
|
||||||
src="/barcode-generator-preview.png"
|
|
||||||
alt="Free Online Barcode Generator Preview - Create EAN, UPC, and Code 128 Barcodes"
|
|
||||||
className="w-full h-64 sm:h-80 object-cover"
|
|
||||||
width="800"
|
|
||||||
height="320"
|
|
||||||
/>
|
|
||||||
<div className="bg-slate-50 p-4 text-sm text-slate-500 text-center border-t border-slate-100">
|
|
||||||
Use our <strong>free barcode generator</strong> to create scannable codes.
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<h2>What Is a Barcode?</h2>
|
|
||||||
<p>
|
|
||||||
A barcode is a visual representation of data that can be read by machines. It consists of vertical lines with different widths and spacing, which encode numbers or characters. When scanned with a barcode scanner or smartphone, the information is instantly translated into readable data.
|
|
||||||
</p>
|
|
||||||
<p>
|
|
||||||
Barcodes are commonly used to identify products, track inventory, manage logistics, and speed up checkout processes. They reduce manual input and significantly lower the risk of human error.
|
|
||||||
</p>
|
|
||||||
|
|
||||||
<h2>How Does a Barcode Generator Work?</h2>
|
|
||||||
<p>
|
|
||||||
A Barcode Generator converts text or numeric input into a barcode format that scanners can read. The process is simple:
|
|
||||||
</p>
|
|
||||||
<ul className="list-none pl-0 space-y-4 not-prose my-8">
|
|
||||||
<li className="flex gap-4">
|
|
||||||
<div className="w-8 h-8 mt-1 rounded-full bg-slate-100 flex items-center justify-center shrink-0 text-slate-600 font-bold text-sm">1</div>
|
|
||||||
<div>
|
|
||||||
<strong className="text-slate-900 block mb-1">Input Data</strong>
|
|
||||||
<p className="text-slate-600 m-0 text-base">You enter a number or text (for example, a product ID).</p>
|
|
||||||
</div>
|
|
||||||
</li>
|
|
||||||
<li className="flex gap-4">
|
|
||||||
<div className="w-8 h-8 mt-1 rounded-full bg-slate-100 flex items-center justify-center shrink-0 text-slate-600 font-bold text-sm">2</div>
|
|
||||||
<div>
|
|
||||||
<strong className="text-slate-900 block mb-1">Select Format</strong>
|
|
||||||
<p className="text-slate-600 m-0 text-base">You select a barcode format such as EAN-13 or Code 128.</p>
|
|
||||||
</div>
|
|
||||||
</li>
|
|
||||||
<li className="flex gap-4">
|
|
||||||
<div className="w-8 h-8 mt-1 rounded-full bg-slate-100 flex items-center justify-center shrink-0 text-slate-600 font-bold text-sm">3</div>
|
|
||||||
<div>
|
|
||||||
<strong className="text-slate-900 block mb-1">Generate</strong>
|
|
||||||
<p className="text-slate-600 m-0 text-base">The generator creates a scannable barcode image instantly.</p>
|
|
||||||
</div>
|
|
||||||
</li>
|
|
||||||
<li className="flex gap-4">
|
|
||||||
<div className="w-8 h-8 mt-1 rounded-full bg-slate-100 flex items-center justify-center shrink-0 text-slate-600 font-bold text-sm">4</div>
|
|
||||||
<div>
|
|
||||||
<strong className="text-slate-900 block mb-1">Download</strong>
|
|
||||||
<p className="text-slate-600 m-0 text-base">You download or print the barcode for use.</p>
|
|
||||||
</div>
|
|
||||||
</li>
|
|
||||||
</ul>
|
|
||||||
<p>
|
|
||||||
A modern <strong>Barcode Generator</strong> works directly in the browser and does not require additional software.
|
|
||||||
</p>
|
|
||||||
|
|
||||||
<h2>Common Types of Barcodes</h2>
|
|
||||||
<p>
|
|
||||||
Different barcode formats are used for different purposes. Choosing the right one is important for compatibility and scanning accuracy.
|
|
||||||
</p>
|
|
||||||
|
|
||||||
<div className="grid md:grid-cols-2 gap-6 not-prose my-8">
|
|
||||||
{/* EAN-13 Card */}
|
|
||||||
<div className="bg-white p-6 rounded-xl border border-slate-200 shadow-sm hover:shadow-md transition-shadow">
|
|
||||||
<div className="flex items-center gap-3 mb-3">
|
|
||||||
<Tag className="w-5 h-5 text-blue-500" />
|
|
||||||
<h4 className="text-lg font-bold text-slate-900 m-0">EAN-13</h4>
|
|
||||||
</div>
|
|
||||||
<div className="text-xs font-mono bg-slate-100 inline-block px-2 py-1 rounded text-slate-500 mb-3">Retail • Europe</div>
|
|
||||||
<div className="mb-3 bg-slate-50 rounded border border-slate-100 p-2 flex justify-center">
|
|
||||||
<img src="/barcode-generator-preview.png" alt="EAN-13 Barcode Sample for International Products" className="h-10 object-contain opacity-75 grayscale" width="200" height="40" />
|
|
||||||
</div>
|
|
||||||
<p className="text-sm text-slate-600 m-0">
|
|
||||||
EAN-13 is widely used in retail, especially in Europe. It is designed for consumer products sold in stores and supermarkets.
|
|
||||||
</p>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
{/* UPC-A Card */}
|
|
||||||
<div className="bg-white p-6 rounded-xl border border-slate-200 shadow-sm hover:shadow-md transition-shadow">
|
|
||||||
<div className="flex items-center gap-3 mb-3">
|
|
||||||
<ShoppingCart className="w-5 h-5 text-indigo-500" />
|
|
||||||
<h4 className="text-lg font-bold text-slate-900 m-0">UPC-A</h4>
|
|
||||||
</div>
|
|
||||||
<div className="text-xs font-mono bg-slate-100 inline-block px-2 py-1 rounded text-slate-500 mb-3">Retail • USA/Canada</div>
|
|
||||||
<div className="mb-3 bg-slate-50 rounded border border-slate-100 p-2 flex justify-center">
|
|
||||||
<img src="/barcode-generator-preview.png" alt="UPC-A Barcode Example for Retail Products in USA" className="h-10 object-contain opacity-75 grayscale" width="200" height="40" />
|
|
||||||
</div>
|
|
||||||
<p className="text-sm text-slate-600 m-0">
|
|
||||||
UPC-A is similar to EAN-13 but is mainly used in the United States and Canada for retail products.
|
|
||||||
</p>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
{/* Code 128 Card */}
|
|
||||||
<div className="bg-white p-6 rounded-xl border border-slate-200 shadow-sm hover:shadow-md transition-shadow">
|
|
||||||
<div className="flex items-center gap-3 mb-3">
|
|
||||||
<Settings className="w-5 h-5 text-emerald-500" />
|
|
||||||
<h4 className="text-lg font-bold text-slate-900 m-0">Code 128</h4>
|
|
||||||
</div>
|
|
||||||
<div className="text-xs font-mono bg-slate-100 inline-block px-2 py-1 rounded text-slate-500 mb-3">Logistics • Universal</div>
|
|
||||||
<div className="mb-3 bg-slate-50 rounded border border-slate-100 p-2 flex justify-center">
|
|
||||||
<img src="/barcode-generator-preview.png" alt="Code 128 Barcode for Inventory and Shipping Labels" className="h-10 object-contain opacity-75 grayscale" width="200" height="40" />
|
|
||||||
</div>
|
|
||||||
<p className="text-sm text-slate-600 m-0">
|
|
||||||
Code 128 is a flexible barcode format that supports letters and numbers. It is commonly used in logistics, shipping, and internal tracking systems.
|
|
||||||
</p>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
{/* Code 39 Card */}
|
|
||||||
<div className="bg-white p-6 rounded-xl border border-slate-200 shadow-sm hover:shadow-md transition-shadow">
|
|
||||||
<div className="flex items-center gap-3 mb-3">
|
|
||||||
<Factory className="w-5 h-5 text-orange-500" />
|
|
||||||
<h4 className="text-lg font-bold text-slate-900 m-0">Code 39</h4>
|
|
||||||
</div>
|
|
||||||
<div className="text-xs font-mono bg-slate-100 inline-block px-2 py-1 rounded text-slate-500 mb-3">Industrial • Military</div>
|
|
||||||
<div className="mb-3 bg-slate-50 rounded border border-slate-100 p-2 flex justify-center">
|
|
||||||
<img src="/barcode-generator-preview.png" alt="Code 39 Barcode for Industrial Use" className="h-10 object-contain opacity-75 grayscale" width="200" height="40" />
|
|
||||||
</div>
|
|
||||||
<p className="text-sm text-slate-600 m-0">
|
|
||||||
The first alphanumeric barcode, Code 39 is still widely used in automotive and defense industries. It supports numbers and uppercase letters.
|
|
||||||
</p>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
{/* MSI Card */}
|
|
||||||
<div className="bg-white p-6 rounded-xl border border-slate-200 shadow-sm hover:shadow-md transition-shadow">
|
|
||||||
<div className="flex items-center gap-3 mb-3">
|
|
||||||
<Layers className="w-5 h-5 text-purple-500" />
|
|
||||||
<h4 className="text-lg font-bold text-slate-900 m-0">MSI</h4>
|
|
||||||
</div>
|
|
||||||
<div className="text-xs font-mono bg-slate-100 inline-block px-2 py-1 rounded text-slate-500 mb-3">Inventory • Shelves</div>
|
|
||||||
<div className="mb-3 bg-slate-50 rounded border border-slate-100 p-2 flex justify-center">
|
|
||||||
<img src="/barcode-generator-preview.png" alt="MSI Barcode for Inventory Management" className="h-10 object-contain opacity-75 grayscale" width="200" height="40" />
|
|
||||||
</div>
|
|
||||||
<p className="text-sm text-slate-600 m-0">
|
|
||||||
MSI (Modified Plessey) is often used for inventory control in retail environments, such as labeling shelves in supermarkets and warehouses.
|
|
||||||
</p>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
{/* Pharmacode Card */}
|
|
||||||
<div className="bg-white p-6 rounded-xl border border-slate-200 shadow-sm hover:shadow-md transition-shadow">
|
|
||||||
<div className="flex items-center gap-3 mb-3">
|
|
||||||
<Activity className="w-5 h-5 text-red-500" />
|
|
||||||
<h4 className="text-lg font-bold text-slate-900 m-0">Pharmacode</h4>
|
|
||||||
</div>
|
|
||||||
<div className="text-xs font-mono bg-slate-100 inline-block px-2 py-1 rounded text-slate-500 mb-3">Pharma • Packaging</div>
|
|
||||||
<div className="mb-3 bg-slate-50 rounded border border-slate-100 p-2 flex justify-center">
|
|
||||||
<img src="/barcode-generator-preview.png" alt="Pharmacode for Pharmaceutical Packaging" className="h-10 object-contain opacity-75 grayscale" width="200" height="40" />
|
|
||||||
</div>
|
|
||||||
<p className="text-sm text-slate-600 m-0">
|
|
||||||
Pharmacode is a specialized barcode standard used in the pharmaceutical industry for packaging control to prevent medication errors.
|
|
||||||
</p>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<h2>Why Use a Barcode Generator?</h2>
|
|
||||||
<p>Using a Barcode Generator offers several advantages:</p>
|
|
||||||
<div className="not-prose grid gap-4 mb-8">
|
|
||||||
<div className="flex gap-4 items-start">
|
|
||||||
<CheckCircle className="w-5 h-5 text-green-500 mt-1 shrink-0" />
|
|
||||||
<div>
|
|
||||||
<h5 className="font-bold text-slate-900 m-0">Speed</h5>
|
|
||||||
<p className="text-slate-600 text-sm m-0">Create barcodes instantly without technical knowledge.</p>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
<div className="flex gap-4 items-start">
|
|
||||||
<CheckCircle className="w-5 h-5 text-green-500 mt-1 shrink-0" />
|
|
||||||
<div>
|
|
||||||
<h5 className="font-bold text-slate-900 m-0">Accuracy</h5>
|
|
||||||
<p className="text-slate-600 text-sm m-0">Reduce manual data entry errors.</p>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
<div className="flex gap-4 items-start">
|
|
||||||
<CheckCircle className="w-5 h-5 text-green-500 mt-1 shrink-0" />
|
|
||||||
<div>
|
|
||||||
<h5 className="font-bold text-slate-900 m-0">Flexibility</h5>
|
|
||||||
<p className="text-slate-600 text-sm m-0">Generate barcodes for different formats and use cases.</p>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
<div className="flex gap-4 items-start">
|
|
||||||
<CheckCircle className="w-5 h-5 text-green-500 mt-1 shrink-0" />
|
|
||||||
<div>
|
|
||||||
<h5 className="font-bold text-slate-900 m-0">Cost-effective</h5>
|
|
||||||
<p className="text-slate-600 text-sm m-0">No need for expensive software or hardware.</p>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
<p>
|
|
||||||
For small businesses, online shops, and startups, a <strong>free Barcode Generator</strong> is often the easiest way to get started.
|
|
||||||
</p>
|
|
||||||
|
|
||||||
<h2>Barcode vs QR Code</h2>
|
|
||||||
<p>
|
|
||||||
Although barcodes and QR codes are often confused, they serve different purposes. A barcode stores data horizontally and is mainly used for product identification. A <Link href="/tools/url-qr-code" className="text-blue-600 hover:underline">QR code</Link> stores data both horizontally and vertically and can contain more complex information such as URLs or <Link href="/tools/vcard-qr-code" className="text-blue-600 hover:underline">contact details</Link>.
|
|
||||||
</p>
|
|
||||||
<p>
|
|
||||||
If you only need to identify products or inventory items, a classic barcode is usually the better choice.
|
|
||||||
</p>
|
|
||||||
|
|
||||||
<h2>Are Barcodes Free to Use?</h2>
|
|
||||||
<p>
|
|
||||||
The barcode image itself can be generated for free using a Barcode Generator. However, for retail products sold internationally, the barcode number may need to be officially registered through organizations such as GS1. This ensures that the barcode is unique and recognized globally.
|
|
||||||
</p>
|
|
||||||
<p>
|
|
||||||
For internal use, testing, or small projects, free barcode generation is usually sufficient.
|
|
||||||
</p>
|
|
||||||
|
|
||||||
<h2>Use Cases for Barcodes</h2>
|
|
||||||
<p>Barcodes are used in many industries, including:</p>
|
|
||||||
<ul className="list-disc pl-6 space-y-2 mb-8">
|
|
||||||
<li>Retail and e-commerce</li>
|
|
||||||
<li>Inventory and warehouse management</li>
|
|
||||||
<li>Shipping and logistics</li>
|
|
||||||
<li>Libraries and document tracking</li>
|
|
||||||
<li>Event tickets and labeling</li>
|
|
||||||
</ul>
|
|
||||||
<p>
|
|
||||||
A reliable <strong>Barcode Generator</strong> helps streamline these processes and improves efficiency.
|
|
||||||
</p>
|
|
||||||
|
|
||||||
<h2>Understanding Check Digits</h2>
|
|
||||||
<p>
|
|
||||||
Most barcodes (like EAN and UPC) include a "Check Digit"—the last number in the sequence. This digit is calculated mathematically from the other numbers to ensure the barcode is scanned correctly. Even if a barcode is slightly damaged or scratched, the scanner uses the check digit to verify the integrity of the data.
|
|
||||||
</p>
|
|
||||||
|
|
||||||
<h2>Best Practices for Printing Barcodes</h2>
|
|
||||||
<p>
|
|
||||||
To ensure your barcodes scan instantly at the checkout or in the warehouse, follow these printing tips:
|
|
||||||
</p>
|
|
||||||
<ul className="list-disc pl-6 space-y-2 mb-8">
|
|
||||||
<li><strong>High Contrast:</strong> Always print black bars on a white background. Reverse colors (white bars on black) often fail to scan.</li>
|
|
||||||
<li><strong>Quiet Zone:</strong> Leave enough white space (margins) on the left and right sides of the barcode.</li>
|
|
||||||
<li><strong>Resolution:</strong> For professional labels, use <strong>SVG format</strong> (vector) or high-resolution PNGs (at least 300 DPI) to avoid blurry edges.</li>
|
|
||||||
<li><strong>Size:</strong> Do not scale the barcode too small. Standard EAN-13 codes should be at least 30mm wide for reliable scanning.</li>
|
|
||||||
</ul>
|
|
||||||
|
|
||||||
<hr className="my-12 border-slate-200" />
|
|
||||||
|
|
||||||
<div className="flex items-center gap-3 mb-6 not-prose">
|
|
||||||
<HelpCircle className="w-6 h-6 text-blue-500" />
|
|
||||||
<h2 className="text-2xl font-bold text-slate-900 m-0">Frequently Asked Questions (FAQ)</h2>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div className="not-prose space-y-8">
|
|
||||||
<div>
|
|
||||||
<h5 className="font-bold text-slate-900 text-lg mb-2">❓ What is a Barcode Generator?</h5>
|
|
||||||
<p className="text-slate-600">A Barcode Generator is an online tool that converts numbers or text into scannable barcode images that can be used for products, labels, and inventory systems.</p>
|
|
||||||
</div>
|
|
||||||
<div>
|
|
||||||
<h5 className="font-bold text-slate-900 text-lg mb-2">❓ Is this barcode generator free to use?</h5>
|
|
||||||
<p className="text-slate-600">Yes, our online barcode generator is completely free to use with no hidden costs or sign-ups required. You can generate, download, and print barcodes instantly.</p>
|
|
||||||
</div>
|
|
||||||
<div>
|
|
||||||
<h5 className="font-bold text-slate-900 text-lg mb-2">❓ Which barcode format should I use?</h5>
|
|
||||||
<p className="text-slate-600">
|
|
||||||
<strong>EAN-13:</strong> Standard for retail products in Europe and globally.<br />
|
|
||||||
<strong>UPC-A:</strong> Standard for retail products in USA/Canada.<br />
|
|
||||||
<strong>Code 128:</strong> Best for logistics, shipping, and internal tracking (supports letters & numbers).
|
|
||||||
</p>
|
|
||||||
</div>
|
|
||||||
<div>
|
|
||||||
<h5 className="font-bold text-slate-900 text-lg mb-2">❓ Can I download barcodes in vector format (SVG)?</h5>
|
|
||||||
<p className="text-slate-600">Yes! We offer <strong>SVG downloads</strong>. SVG files are vector-based, meaning they can be scaled to any size without losing quality—perfect for professional product packaging.</p>
|
|
||||||
</div>
|
|
||||||
<div>
|
|
||||||
<h5 className="font-bold text-slate-900 text-lg mb-2">❓ How do I generate a barcode online?</h5>
|
|
||||||
<p className="text-slate-600">To generate a barcode online, enter your product number or text, select the desired barcode format (such as EAN-13 or Code 128), and click the generate button. The barcode will be created instantly.</p>
|
|
||||||
</div>
|
|
||||||
<div>
|
|
||||||
<h5 className="font-bold text-slate-900 text-lg mb-2">❓ Are generated barcodes scannable?</h5>
|
|
||||||
<p className="text-slate-600">Yes, barcodes generated with a proper barcode generator are fully scannable. We generate standard-compliant barcodes readable by any standard optical or laser barcode scanner.</p>
|
|
||||||
</div>
|
|
||||||
<div>
|
|
||||||
<h5 className="font-bold text-slate-900 text-lg mb-2">❓ Can I use these barcodes for Amazon (EAN/UPC)?</h5>
|
|
||||||
<p className="text-slate-600">You can generate the <em>image</em> for Amazon here if you already have your EAN/UPC number. However, you cannot "create" a valid global EAN number here—you must purchase those official numbers from GS1 to sell on major platforms like Amazon.</p>
|
|
||||||
</div>
|
|
||||||
<div>
|
|
||||||
<h5 className="font-bold text-slate-900 text-lg mb-2">❓ What is the difference between a barcode and a QR code?</h5>
|
|
||||||
<p className="text-slate-600">A barcode stores data horizontally (1D) and is mainly used for product IDs. A QR code stores data in 2D (matrix) and can hold much more information, such as URLs, vCards, or WiFi credentials.</p>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div className="mt-12 p-6 bg-slate-900 rounded-xl text-white not-prose">
|
|
||||||
<h4 className="text-lg font-bold mb-2">Final Thoughts</h4>
|
|
||||||
<p className="text-slate-300 m-0">
|
|
||||||
A Barcode Generator is a simple yet powerful tool that helps businesses save time, reduce errors, and improve operational efficiency. By choosing the right barcode format and using a reliable generator, you can create professional barcodes that work across different systems and industries.
|
|
||||||
</p>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
</div>
|
|
||||||
</section>
|
|
||||||
);
|
|
||||||
}
|
|
||||||
@@ -1,303 +0,0 @@
|
|||||||
|
|
||||||
import React from 'react';
|
|
||||||
import type { Metadata } from 'next';
|
|
||||||
import BarcodeGeneratorClient from './BarcodeGeneratorClient';
|
|
||||||
import { BarcodeGuide } from './BarcodeGuide';
|
|
||||||
import { Barcode as BarcodeIcon, Shield, Zap, Printer, Download, Share2, Sparkles, Sliders, Check } from 'lucide-react';
|
|
||||||
import { ToolBreadcrumb } from '@/components/seo/BreadcrumbSchema';
|
|
||||||
import { RelatedTools } from '@/components/marketing/RelatedTools';
|
|
||||||
import { generateSoftwareAppSchema, generateFaqSchema } from '@/lib/schema-utils';
|
|
||||||
|
|
||||||
// SEO Optimized Metadata
|
|
||||||
export const metadata: Metadata = {
|
|
||||||
title: {
|
|
||||||
absolute: 'Barcode Generator – Create Barcodes Online for Free',
|
|
||||||
},
|
|
||||||
description: 'Use a free Barcode Generator to create scannable barcodes online. Supports EAN, UPC and Code 128 for products, labels and inventory.',
|
|
||||||
keywords: ['barcode generator', 'online barcode maker', 'create barcode free', 'ean-13 generator', 'upc-a generator', 'code 128 generator', 'barcode creator', 'printable barcodes'],
|
|
||||||
alternates: {
|
|
||||||
canonical: 'https://www.qrmaster.net/tools/barcode-generator',
|
|
||||||
},
|
|
||||||
openGraph: {
|
|
||||||
title: 'Barcode Generator: Create EAN, UPC & Code 128',
|
|
||||||
description: 'Barcode Generator: Create professional labels instantly. Free & Secured.',
|
|
||||||
url: 'https://www.qrmaster.net/tools/barcode-generator',
|
|
||||||
siteName: 'QR Master',
|
|
||||||
locale: 'en_US',
|
|
||||||
type: 'website',
|
|
||||||
images: [{ url: '/barcode-generator-preview.png', width: 1200, height: 630 }],
|
|
||||||
},
|
|
||||||
twitter: {
|
|
||||||
card: 'summary_large_image',
|
|
||||||
title: 'Free Barcode Generator',
|
|
||||||
description: 'Create custom barcodes in seconds. Download high-quality PNG/SVG.',
|
|
||||||
},
|
|
||||||
robots: {
|
|
||||||
index: true,
|
|
||||||
follow: true,
|
|
||||||
},
|
|
||||||
};
|
|
||||||
|
|
||||||
// JSON-LD Structured Data
|
|
||||||
const jsonLd = {
|
|
||||||
'@context': 'https://schema.org',
|
|
||||||
'@graph': [
|
|
||||||
generateSoftwareAppSchema(
|
|
||||||
'Barcode Generator',
|
|
||||||
'Generate custom printable barcodes instantly for EAN, UPC, Code 128 and more.',
|
|
||||||
'/og-barcode-generator.png',
|
|
||||||
'UtilitiesApplication'
|
|
||||||
),
|
|
||||||
{
|
|
||||||
'@type': 'HowTo',
|
|
||||||
name: 'How to Create a Barcode',
|
|
||||||
description: 'Create custom barcodes for products or inventory.',
|
|
||||||
step: [
|
|
||||||
{
|
|
||||||
'@type': 'HowToStep',
|
|
||||||
position: 1,
|
|
||||||
name: 'Enter Content',
|
|
||||||
text: 'Type or paste the numeric or alphanumeric data for your barcode.',
|
|
||||||
},
|
|
||||||
{
|
|
||||||
'@type': 'HowToStep',
|
|
||||||
position: 2,
|
|
||||||
name: 'Select Format',
|
|
||||||
text: 'Choose the appropriate barcode type (e.g., Code 128 for general use, EAN-13 for retail).',
|
|
||||||
},
|
|
||||||
{
|
|
||||||
'@type': 'HowToStep',
|
|
||||||
position: 3,
|
|
||||||
name: 'Customize Design',
|
|
||||||
text: 'Adjust the height and width of the barcode to fit your needs.',
|
|
||||||
},
|
|
||||||
{
|
|
||||||
'@type': 'HowToStep',
|
|
||||||
position: 4,
|
|
||||||
name: 'Toggle Text',
|
|
||||||
text: 'Decide if you want the human-readable value to appear below the barcode.',
|
|
||||||
},
|
|
||||||
{
|
|
||||||
'@type': 'HowToStep',
|
|
||||||
position: 5,
|
|
||||||
name: 'Download & Print',
|
|
||||||
text: 'Save your barcode as PNG or SVG and print it for labels or inventory.',
|
|
||||||
},
|
|
||||||
],
|
|
||||||
totalTime: 'PT20S',
|
|
||||||
},
|
|
||||||
generateFaqSchema({
|
|
||||||
'What is a Barcode Generator?': {
|
|
||||||
question: 'What is a Barcode Generator?',
|
|
||||||
answer: 'A Barcode Generator is an online tool that converts numbers or text into scannable barcode images that can be used for products, labels, and inventory systems.',
|
|
||||||
},
|
|
||||||
'Is this barcode generator free to use?': {
|
|
||||||
question: 'Is this barcode generator free to use?',
|
|
||||||
answer: 'Yes, our online barcode generator is completely free to use with no hidden costs or sign-ups required. You can generate, download, and print barcodes instantly.',
|
|
||||||
},
|
|
||||||
'Which barcode format should I use?': {
|
|
||||||
question: 'Which barcode format should I use?',
|
|
||||||
answer: 'EAN-13 is standard for retail in Europe/Global. UPC-A is standard for retail in USA/Canada. Code 128 is best for logistics and internal tracking as it supports letters and numbers.',
|
|
||||||
},
|
|
||||||
'Can I download barcodes in vector format (SVG)?': {
|
|
||||||
question: 'Can I download barcodes in vector format (SVG)?',
|
|
||||||
answer: 'Yes! We offer SVG downloads. SVG files are vector-based, meaning they can be scaled to any size without losing quality—perfect for professional product packaging.',
|
|
||||||
},
|
|
||||||
'How do I generate a barcode online?': {
|
|
||||||
question: 'How do I generate a barcode online?',
|
|
||||||
answer: 'To generate a barcode online, enter your product number or text, select the desired barcode format (such as EAN-13 or Code 128), and click the generate button. The barcode will be created instantly.',
|
|
||||||
},
|
|
||||||
'Are generated barcodes scannable?': {
|
|
||||||
question: 'Are generated barcodes scannable?',
|
|
||||||
answer: 'Yes, barcodes generated with a proper barcode generator are fully scannable. We generate standard-compliant barcodes readable by any standard optical or laser barcode scanner.',
|
|
||||||
},
|
|
||||||
'Can I use these barcodes for Amazon (EAN/UPC)?': {
|
|
||||||
question: 'Can I use these barcodes for Amazon (EAN/UPC)?',
|
|
||||||
answer: 'You can generate the image for Amazon here if you already have your EAN/UPC number. However, you cannot "create" a valid global EAN number here—you must purchase those official numbers from GS1 to sell on major platforms like Amazon.',
|
|
||||||
},
|
|
||||||
'What is the difference between a barcode and a QR code?': {
|
|
||||||
question: 'What is the difference between a barcode and a QR code?',
|
|
||||||
answer: 'A barcode stores data horizontally (1D) and is mainly used for product IDs. A QR code stores data in 2D (matrix) and can hold much more information, such as URLs, vCards, or WiFi credentials.',
|
|
||||||
},
|
|
||||||
}),
|
|
||||||
],
|
|
||||||
};
|
|
||||||
|
|
||||||
export default function BarcodeGeneratorPage() {
|
|
||||||
return (
|
|
||||||
<>
|
|
||||||
<script
|
|
||||||
type="application/ld+json"
|
|
||||||
dangerouslySetInnerHTML={{ __html: JSON.stringify(jsonLd) }}
|
|
||||||
/>
|
|
||||||
<ToolBreadcrumb toolName="Barcode Generator" toolSlug="barcode-generator" />
|
|
||||||
|
|
||||||
<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-10">
|
|
||||||
{/* Barcode Pattern */}
|
|
||||||
<svg className="w-full h-full" width="100%" height="100%" xmlns="http://www.w3.org/2000/svg">
|
|
||||||
<defs>
|
|
||||||
<pattern id="barcode_pattern" width="60" height="60" patternUnits="userSpaceOnUse">
|
|
||||||
<path d="M5 0 V 60 M15 0 V 60 M20 0 V 60 M35 0 V 60 M40 0 V 60 M55 0 V 60" stroke="white" strokeWidth="2" strokeOpacity="0.5" />
|
|
||||||
</pattern>
|
|
||||||
</defs>
|
|
||||||
<rect width="100%" height="100%" fill="url(#barcode_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-400 opacity-75"></span>
|
|
||||||
<span className="relative inline-flex rounded-full h-2 w-2 bg-blue-400"></span>
|
|
||||||
</span>
|
|
||||||
Free Tool — Professional & Fast
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<h1 className="text-4xl md:text-5xl lg:text-6xl font-extrabold text-white tracking-tight leading-tight mb-6">
|
|
||||||
Free Online <span className="text-blue-400">Barcode Generator</span>
|
|
||||||
</h1>
|
|
||||||
|
|
||||||
<p className="text-lg md:text-xl text-slate-400 max-w-2xl mx-auto lg:mx-0 mb-8 leading-relaxed">
|
|
||||||
Our <strong>barcode generator</strong> makes it easy to create and print high-quality labels for products and inventory.
|
|
||||||
<span className="text-white block sm:inline mt-2 sm:mt-0"> Supports EAN, UPC, Code 128.</span>
|
|
||||||
</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">
|
|
||||||
<Check className="w-4 h-4 text-blue-400" />
|
|
||||||
Retail Ready
|
|
||||||
</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">
|
|
||||||
<Check className="w-4 h-4 text-blue-400" />
|
|
||||||
Vector SVG Export
|
|
||||||
</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">
|
|
||||||
<Check className="w-4 h-4 text-blue-400" />
|
|
||||||
No Registration
|
|
||||||
</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-gradient-to-br from-blue-400 to-indigo-600 rounded-xl shadow-lg p-5 mb-6 relative overflow-hidden text-white">
|
|
||||||
<div className="flex justify-between items-start mb-4">
|
|
||||||
<BarcodeIcon className="w-8 h-8 opacity-80" />
|
|
||||||
<div className="bg-white/20 px-2 py-1 rounded text-xs font-bold uppercase tracking-wider">Label</div>
|
|
||||||
</div>
|
|
||||||
<div className="text-xl font-bold tracking-wider mb-1">PROD-98234</div>
|
|
||||||
<div className="text-xs opacity-70">Inventory ID</div>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div className="w-48 h-32 bg-white rounded-xl p-4 shadow-inner relative overflow-hidden flex flex-col items-center justify-center">
|
|
||||||
<div className="w-full h-16 bg-black flex gap-1 mb-2">
|
|
||||||
{[2, 4, 1, 3, 2, 1, 4, 2, 1, 3].map((w, i) => (
|
|
||||||
<div key={i} className="bg-black flex-1" style={{ flex: w }} />
|
|
||||||
))}
|
|
||||||
</div>
|
|
||||||
<div className="text-[10px] font-mono font-bold tracking-widest uppercase">98234001A</div>
|
|
||||||
</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-blue-500/20 p-2 rounded-full">
|
|
||||||
<Printer className="w-5 h-5 text-blue-500" />
|
|
||||||
</div>
|
|
||||||
<div className="text-left">
|
|
||||||
<div className="text-[10px] text-slate-400 font-bold uppercase tracking-wider">Ready</div>
|
|
||||||
<div className="text-sm font-bold text-white">Print Instantly</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</section>
|
|
||||||
|
|
||||||
{/* GENERATOR SECTION */}
|
|
||||||
<section className="py-12 px-4 sm:px-6 lg:px-8 -mt-8">
|
|
||||||
<BarcodeGeneratorClient />
|
|
||||||
</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 Our Barcode Generator Works
|
|
||||||
</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">
|
|
||||||
<Sliders className="w-6 h-6 text-white" />
|
|
||||||
</div>
|
|
||||||
<h3 className="font-bold text-slate-900 mb-2">1. Configure</h3>
|
|
||||||
<p className="text-slate-600 text-xs leading-relaxed">
|
|
||||||
Enter your data and select the format.
|
|
||||||
</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">2. Customize</h3>
|
|
||||||
<p className="text-slate-600 text-xs leading-relaxed">
|
|
||||||
Adjust height, width and text display.
|
|
||||||
</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. Preview</h3>
|
|
||||||
<p className="text-slate-600 text-xs leading-relaxed">
|
|
||||||
See your barcode update in real-time.
|
|
||||||
</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">4. Download</h3>
|
|
||||||
<p className="text-slate-600 text-xs leading-relaxed">
|
|
||||||
Save as professional PNG or SVG.
|
|
||||||
</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">
|
|
||||||
<Printer className="w-6 h-6 text-white" />
|
|
||||||
</div>
|
|
||||||
<h3 className="font-bold text-slate-900 mb-2">5. Print</h3>
|
|
||||||
<p className="text-slate-600 text-xs leading-relaxed">
|
|
||||||
Print labels directly from your browser.
|
|
||||||
</p>
|
|
||||||
</article>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</section>
|
|
||||||
|
|
||||||
{/* RELATED TOOLS */}
|
|
||||||
<RelatedTools />
|
|
||||||
|
|
||||||
{/* SEO GUIDE */}
|
|
||||||
<BarcodeGuide />
|
|
||||||
|
|
||||||
</div>
|
|
||||||
</>
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
@@ -3,7 +3,6 @@
|
|||||||
import React, { useState, useRef } from 'react';
|
import React, { useState, useRef } from 'react';
|
||||||
import Link from 'next/link';
|
import Link from 'next/link';
|
||||||
import { QRCodeSVG } from 'qrcode.react';
|
import { QRCodeSVG } from 'qrcode.react';
|
||||||
import { toPng } from 'html-to-image';
|
|
||||||
|
|
||||||
import {
|
import {
|
||||||
Link as LinkIcon,
|
Link as LinkIcon,
|
||||||
@@ -53,6 +52,7 @@ export default function URLGenerator() {
|
|||||||
if (!qrRef.current) return;
|
if (!qrRef.current) return;
|
||||||
try {
|
try {
|
||||||
if (format === 'png') {
|
if (format === 'png') {
|
||||||
|
const { toPng } = await import('html-to-image');
|
||||||
const dataUrl = await toPng(qrRef.current, { cacheBust: true, pixelRatio: 3 });
|
const dataUrl = await toPng(qrRef.current, { cacheBust: true, pixelRatio: 3 });
|
||||||
const link = document.createElement('a');
|
const link = document.createElement('a');
|
||||||
link.download = `url-qr-code.png`;
|
link.download = `url-qr-code.png`;
|
||||||
|
|||||||
@@ -6,7 +6,7 @@ import { usePathname } from 'next/navigation';
|
|||||||
import { Button } from '@/components/ui/Button';
|
import { Button } from '@/components/ui/Button';
|
||||||
import { Footer } from '@/components/ui/Footer';
|
import { Footer } from '@/components/ui/Footer';
|
||||||
import de from '@/i18n/de.json';
|
import de from '@/i18n/de.json';
|
||||||
import { ChevronDown, Wifi, Contact, MessageCircle, QrCode, Link2, Type, Mail, MessageSquare, Phone, Calendar, MapPin, Facebook, Instagram, Twitter, Youtube, Music, Bitcoin, CreditCard, Video, Users, Barcode as BarcodeIcon } from 'lucide-react';
|
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 { cn } from '@/lib/utils';
|
||||||
import { AnimatePresence, motion } from 'framer-motion';
|
import { AnimatePresence, motion } from 'framer-motion';
|
||||||
|
|
||||||
@@ -62,7 +62,6 @@ export default function MarketingLayout({
|
|||||||
{ name: 'PayPal', description: 'Receive payments', href: '/tools/paypal-qr-code', icon: CreditCard, color: 'text-blue-700', bgColor: 'bg-blue-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: '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' },
|
{ name: 'Teams', description: 'Join Teams meeting', href: '/tools/teams-qr-code', icon: Users, color: 'text-violet-500', bgColor: 'bg-violet-50' },
|
||||||
{ name: 'Barcode', description: 'Barcode erstellen', href: '/tools/barcode-generator', icon: BarcodeIcon, color: 'text-slate-800', bgColor: 'bg-slate-100' },
|
|
||||||
];
|
];
|
||||||
|
|
||||||
return (
|
return (
|
||||||
@@ -97,7 +96,6 @@ export default function MarketingLayout({
|
|||||||
<li><a href="/tools/paypal-qr-code">PayPal QR Code</a></li>
|
<li><a href="/tools/paypal-qr-code">PayPal QR Code</a></li>
|
||||||
<li><a href="/tools/zoom-qr-code">Zoom QR Code</a></li>
|
<li><a href="/tools/zoom-qr-code">Zoom QR Code</a></li>
|
||||||
<li><a href="/tools/teams-qr-code">Teams QR Code</a></li>
|
<li><a href="/tools/teams-qr-code">Teams QR Code</a></li>
|
||||||
<li><a href="/tools/barcode-generator">Barcode Generator</a></li>
|
|
||||||
</ul>
|
</ul>
|
||||||
</nav>
|
</nav>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -10,7 +10,6 @@ import { Features } from '@/components/marketing/Features';
|
|||||||
import { Pricing } from '@/components/marketing/Pricing';
|
import { Pricing } from '@/components/marketing/Pricing';
|
||||||
import { FAQ } from '@/components/marketing/FAQ';
|
import { FAQ } from '@/components/marketing/FAQ';
|
||||||
import { ScrollToTop } from '@/components/ui/ScrollToTop';
|
import { ScrollToTop } from '@/components/ui/ScrollToTop';
|
||||||
import { FreeToolsGrid } from '@/components/marketing/FreeToolsGrid';
|
|
||||||
import de from '@/i18n/de.json';
|
import de from '@/i18n/de.json';
|
||||||
|
|
||||||
function truncateAtWord(text: string, maxLength: number): string {
|
function truncateAtWord(text: string, maxLength: number): string {
|
||||||
@@ -103,9 +102,6 @@ export default function QRCodeErstellenPage() {
|
|||||||
{/* Main Interaction: Generator */}
|
{/* Main Interaction: Generator */}
|
||||||
<InstantGenerator t={t} />
|
<InstantGenerator t={t} />
|
||||||
|
|
||||||
{/* Free Tools Grid */}
|
|
||||||
<FreeToolsGrid />
|
|
||||||
|
|
||||||
<StaticVsDynamic t={t} />
|
<StaticVsDynamic t={t} />
|
||||||
<Features t={t} />
|
<Features t={t} />
|
||||||
|
|
||||||
|
|||||||
@@ -1,41 +0,0 @@
|
|||||||
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 });
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,122 +0,0 @@
|
|||||||
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] : '',
|
|
||||||
};
|
|
||||||
}
|
|
||||||
@@ -1,37 +0,0 @@
|
|||||||
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 });
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -63,6 +63,7 @@ export async function POST(request: NextRequest) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
const userId = cookies().get('userId')?.value;
|
const userId = cookies().get('userId')?.value;
|
||||||
|
console.log('POST /api/qrs - userId from cookie:', userId);
|
||||||
|
|
||||||
// Rate Limiting (user-based)
|
// Rate Limiting (user-based)
|
||||||
const clientId = userId || getClientIdentifier(request);
|
const clientId = userId || getClientIdentifier(request);
|
||||||
@@ -89,16 +90,20 @@ export async function POST(request: NextRequest) {
|
|||||||
return NextResponse.json({ error: 'Unauthorized - no userId cookie' }, { status: 401 });
|
return NextResponse.json({ error: 'Unauthorized - no userId cookie' }, { status: 401 });
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Check if user exists and get their plan
|
||||||
const user = await db.user.findUnique({
|
const user = await db.user.findUnique({
|
||||||
where: { id: userId },
|
where: { id: userId },
|
||||||
select: { plan: true },
|
select: { plan: true },
|
||||||
});
|
});
|
||||||
|
|
||||||
|
console.log('User exists:', !!user);
|
||||||
|
|
||||||
if (!user) {
|
if (!user) {
|
||||||
return NextResponse.json({ error: `User not found: ${userId}` }, { status: 404 });
|
return NextResponse.json({ error: `User not found: ${userId}` }, { status: 404 });
|
||||||
}
|
}
|
||||||
|
|
||||||
const body = await request.json();
|
const body = await request.json();
|
||||||
|
console.log('Request body:', body);
|
||||||
|
|
||||||
// Validate request body with Zod (only for non-static QRs or simplified validation)
|
// 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
|
// Note: Static QRs have complex nested content structure, so we do basic validation
|
||||||
@@ -177,18 +182,6 @@ END:VCARD`;
|
|||||||
case 'WHATSAPP':
|
case 'WHATSAPP':
|
||||||
qrContent = `https://wa.me/${body.content.phone}${body.content.message ? `?text=${encodeURIComponent(body.content.message)}` : ''}`;
|
qrContent = `https://wa.me/${body.content.phone}${body.content.message ? `?text=${encodeURIComponent(body.content.message)}` : ''}`;
|
||||||
break;
|
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:
|
default:
|
||||||
qrContent = body.content.url || 'https://example.com';
|
qrContent = body.content.url || 'https://example.com';
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,82 +0,0 @@
|
|||||||
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 }
|
|
||||||
);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,167 +0,0 @@
|
|||||||
'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>
|
|
||||||
);
|
|
||||||
}
|
|
||||||
@@ -1,195 +0,0 @@
|
|||||||
'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>
|
|
||||||
);
|
|
||||||
}
|
|
||||||
@@ -1,72 +0,0 @@
|
|||||||
import type { Metadata } from 'next';
|
|
||||||
import { Suspense } from 'react';
|
|
||||||
import '@/styles/globals.css';
|
|
||||||
import { ToastContainer } from '@/components/ui/Toast';
|
|
||||||
import AuthProvider from '@/components/SessionProvider';
|
|
||||||
import { PostHogProvider } from '@/components/PostHogProvider';
|
|
||||||
import CookieBanner from '@/components/CookieBanner';
|
|
||||||
|
|
||||||
const isIndexable = process.env.NEXT_PUBLIC_INDEXABLE === 'true';
|
|
||||||
|
|
||||||
export const metadata: Metadata = {
|
|
||||||
metadataBase: new URL('https://www.qrmaster.net'),
|
|
||||||
title: {
|
|
||||||
default: 'QR Master – Smart QR Generator & Analytics',
|
|
||||||
template: '%s | QR Master',
|
|
||||||
},
|
|
||||||
description: 'Create dynamic QR codes, track scans, and scale campaigns with secure analytics.',
|
|
||||||
keywords: 'QR code, QR generator, dynamic QR, QR tracking, QR analytics, branded QR, bulk QR generator',
|
|
||||||
robots: isIndexable
|
|
||||||
? { index: true, follow: true }
|
|
||||||
: { index: false, follow: false },
|
|
||||||
icons: {
|
|
||||||
icon: [
|
|
||||||
{ url: '/favicon.svg', type: 'image/svg+xml' },
|
|
||||||
{ url: '/logo.svg', type: 'image/svg+xml' },
|
|
||||||
],
|
|
||||||
apple: '/logo.svg',
|
|
||||||
},
|
|
||||||
twitter: {
|
|
||||||
card: 'summary_large_image',
|
|
||||||
site: '@qrmaster',
|
|
||||||
images: ['https://www.qrmaster.net/static/og-image.png'],
|
|
||||||
},
|
|
||||||
openGraph: {
|
|
||||||
type: 'website',
|
|
||||||
siteName: 'QR Master',
|
|
||||||
title: 'QR Master – Smart QR Generator & Analytics',
|
|
||||||
description: 'Create dynamic QR codes, track scans, and scale campaigns with secure analytics.',
|
|
||||||
url: 'https://www.qrmaster.net',
|
|
||||||
images: [
|
|
||||||
{
|
|
||||||
url: 'https://www.qrmaster.net/static/og-image.png',
|
|
||||||
width: 1200,
|
|
||||||
height: 630,
|
|
||||||
alt: 'QR Master - Dynamic QR Code Generator and Analytics Platform',
|
|
||||||
},
|
|
||||||
],
|
|
||||||
locale: 'en_US',
|
|
||||||
},
|
|
||||||
};
|
|
||||||
|
|
||||||
export default function RootLayout({
|
|
||||||
children,
|
|
||||||
}: {
|
|
||||||
children: React.ReactNode;
|
|
||||||
}) {
|
|
||||||
return (
|
|
||||||
<html lang="en">
|
|
||||||
<body className="font-sans">
|
|
||||||
<Suspense fallback={null}>
|
|
||||||
<PostHogProvider>
|
|
||||||
<AuthProvider>
|
|
||||||
{children}
|
|
||||||
</AuthProvider>
|
|
||||||
<CookieBanner />
|
|
||||||
<ToastContainer />
|
|
||||||
</PostHogProvider>
|
|
||||||
</Suspense>
|
|
||||||
</body>
|
|
||||||
</html>
|
|
||||||
);
|
|
||||||
}
|
|
||||||
@@ -59,34 +59,6 @@ export async function GET(
|
|||||||
const baseUrlText = process.env.NEXT_PUBLIC_APP_URL || 'http://localhost:3050';
|
const baseUrlText = process.env.NEXT_PUBLIC_APP_URL || 'http://localhost:3050';
|
||||||
destination = `${baseUrlText}/display?text=${encodeURIComponent(content.text || '')}`;
|
destination = `${baseUrlText}/display?text=${encodeURIComponent(content.text || '')}`;
|
||||||
break;
|
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:
|
default:
|
||||||
destination = 'https://example.com';
|
destination = 'https://example.com';
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -4,18 +4,18 @@ export default function robots(): MetadataRoute.Robots {
|
|||||||
const baseUrl = 'https://www.qrmaster.net';
|
const baseUrl = 'https://www.qrmaster.net';
|
||||||
|
|
||||||
return {
|
return {
|
||||||
rules: [
|
rules: {
|
||||||
{
|
|
||||||
userAgent: '*',
|
userAgent: '*',
|
||||||
allow: '/',
|
allow: ['/', '/_next/static/', '/_next/image/'],
|
||||||
disallow: [
|
disallow: [
|
||||||
'/api/',
|
'/api/',
|
||||||
'/dashboard/',
|
'/dashboard/',
|
||||||
'/create/',
|
'/create/',
|
||||||
'/settings/',
|
'/settings/',
|
||||||
|
'/newsletter/',
|
||||||
|
'/cdn-cgi/',
|
||||||
],
|
],
|
||||||
},
|
},
|
||||||
],
|
|
||||||
sitemap: `${baseUrl}/sitemap.xml`,
|
sitemap: `${baseUrl}/sitemap.xml`,
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -25,7 +25,6 @@ export default function sitemap(): MetadataRoute.Sitemap {
|
|||||||
'paypal-qr-code',
|
'paypal-qr-code',
|
||||||
'zoom-qr-code',
|
'zoom-qr-code',
|
||||||
'teams-qr-code',
|
'teams-qr-code',
|
||||||
'barcode-generator',
|
|
||||||
];
|
];
|
||||||
|
|
||||||
// All blog posts
|
// All blog posts
|
||||||
|
|||||||
@@ -1,9 +1,9 @@
|
|||||||
'use client';
|
'use client';
|
||||||
|
|
||||||
import React, { useEffect, useState } from 'react';
|
import React, { useEffect, useState, Suspense } from 'react';
|
||||||
import { useSearchParams } from 'next/navigation';
|
import { useSearchParams } from 'next/navigation';
|
||||||
|
|
||||||
export default function VCardPage() {
|
function VCardContent() {
|
||||||
const searchParams = useSearchParams();
|
const searchParams = useSearchParams();
|
||||||
const [isLoading, setIsLoading] = useState(true);
|
const [isLoading, setIsLoading] = useState(true);
|
||||||
const [firstName, setFirstName] = useState('');
|
const [firstName, setFirstName] = useState('');
|
||||||
@@ -272,3 +272,26 @@ END:VCARD`;
|
|||||||
</div>
|
</div>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
export default function VCardPage() {
|
||||||
|
return (
|
||||||
|
<Suspense fallback={
|
||||||
|
<div style={{
|
||||||
|
minHeight: '100vh',
|
||||||
|
display: 'flex',
|
||||||
|
alignItems: 'center',
|
||||||
|
justifyContent: 'center',
|
||||||
|
fontFamily: '-apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif',
|
||||||
|
backgroundColor: '#ffffff'
|
||||||
|
}}>
|
||||||
|
<div style={{ textAlign: 'center' }}>
|
||||||
|
<div style={{ fontSize: '48px', marginBottom: '16px' }}>👤</div>
|
||||||
|
<p style={{ color: '#666' }}>Loading...</p>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
}>
|
||||||
|
<VCardContent />
|
||||||
|
</Suspense>
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -4,10 +4,30 @@ import { useEffect, useState, useRef } from 'react';
|
|||||||
import { usePathname, useSearchParams } from 'next/navigation';
|
import { usePathname, useSearchParams } from 'next/navigation';
|
||||||
import posthog from 'posthog-js';
|
import posthog from 'posthog-js';
|
||||||
|
|
||||||
export function PostHogProvider({ children }: { children: React.ReactNode }) {
|
export function PostHogPageView() {
|
||||||
const pathname = usePathname();
|
const pathname = usePathname();
|
||||||
const searchParams = useSearchParams();
|
const searchParams = useSearchParams();
|
||||||
const [isInitialized, setIsInitialized] = useState(false);
|
|
||||||
|
// Track page views
|
||||||
|
useEffect(() => {
|
||||||
|
const cookieConsent = localStorage.getItem('cookieConsent');
|
||||||
|
|
||||||
|
if (cookieConsent === 'accepted' && pathname) {
|
||||||
|
let url = window.origin + pathname;
|
||||||
|
if (searchParams && searchParams.toString()) {
|
||||||
|
url = url + `?${searchParams.toString()}`;
|
||||||
|
}
|
||||||
|
|
||||||
|
posthog.capture('$pageview', {
|
||||||
|
$current_url: url,
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}, [pathname, searchParams]);
|
||||||
|
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
export function PostHogProvider({ children }: { children: React.ReactNode }) {
|
||||||
const initializationAttempted = useRef(false);
|
const initializationAttempted = useRef(false);
|
||||||
|
|
||||||
// Initialize PostHog once
|
// Initialize PostHog once
|
||||||
@@ -18,6 +38,9 @@ export function PostHogProvider({ children }: { children: React.ReactNode }) {
|
|||||||
|
|
||||||
const cookieConsent = localStorage.getItem('cookieConsent');
|
const cookieConsent = localStorage.getItem('cookieConsent');
|
||||||
|
|
||||||
|
// Check if we should initialize based on consent
|
||||||
|
// If not accepted yet, we don't init. CookieBanner deals with setting 'accepted' and reloading or calling init.
|
||||||
|
// Ideally we should listen to consent changes, but for now matching previous behavior.
|
||||||
if (cookieConsent === 'accepted') {
|
if (cookieConsent === 'accepted') {
|
||||||
const apiKey = process.env.NEXT_PUBLIC_POSTHOG_KEY;
|
const apiKey = process.env.NEXT_PUBLIC_POSTHOG_KEY;
|
||||||
const apiHost = process.env.NEXT_PUBLIC_POSTHOG_HOST;
|
const apiHost = process.env.NEXT_PUBLIC_POSTHOG_HOST;
|
||||||
@@ -27,49 +50,24 @@ export function PostHogProvider({ children }: { children: React.ReactNode }) {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Check if already initialized (using _loaded property)
|
|
||||||
if (!(posthog as any)._loaded) {
|
if (!(posthog as any)._loaded) {
|
||||||
posthog.init(apiKey, {
|
posthog.init(apiKey, {
|
||||||
api_host: apiHost || 'https://us.i.posthog.com',
|
api_host: apiHost || 'https://us.i.posthog.com',
|
||||||
person_profiles: 'identified_only',
|
person_profiles: 'identified_only',
|
||||||
capture_pageview: false, // Manual pageview tracking
|
capture_pageview: false, // We handle this manually
|
||||||
capture_pageleave: true,
|
capture_pageleave: true,
|
||||||
autocapture: true,
|
autocapture: true,
|
||||||
respect_dnt: true,
|
respect_dnt: true,
|
||||||
opt_out_capturing_by_default: false,
|
opt_out_capturing_by_default: false,
|
||||||
});
|
});
|
||||||
|
|
||||||
// Enable debug mode in development
|
|
||||||
if (process.env.NODE_ENV === 'development') {
|
if (process.env.NODE_ENV === 'development') {
|
||||||
posthog.debug();
|
posthog.debug();
|
||||||
}
|
}
|
||||||
|
|
||||||
// Set initialized immediately after init
|
|
||||||
setIsInitialized(true);
|
|
||||||
} else {
|
|
||||||
setIsInitialized(true); // Already loaded
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// NO cleanup function - PostHog should persist across page navigation
|
|
||||||
}, []);
|
}, []);
|
||||||
|
|
||||||
// Track page views ONLY after PostHog is initialized
|
|
||||||
useEffect(() => {
|
|
||||||
const cookieConsent = localStorage.getItem('cookieConsent');
|
|
||||||
|
|
||||||
if (cookieConsent === 'accepted' && pathname && isInitialized) {
|
|
||||||
let url = window.origin + pathname;
|
|
||||||
if (searchParams && searchParams.toString()) {
|
|
||||||
url = url + `?${searchParams.toString()}`;
|
|
||||||
}
|
|
||||||
|
|
||||||
posthog.capture('$pageview', {
|
|
||||||
$current_url: url,
|
|
||||||
});
|
|
||||||
}
|
|
||||||
}, [pathname, searchParams, isInitialized]); // Added isInitialized dependency
|
|
||||||
|
|
||||||
return <>{children}</>;
|
return <>{children}</>;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -9,15 +9,22 @@ export default function SeoJsonLd({ data }: SeoJsonLdProps) {
|
|||||||
|
|
||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
{jsonLdArray.map((item, index) => (
|
{jsonLdArray.map((item, index) => {
|
||||||
|
// Only add @context if it doesn't already exist in the item
|
||||||
|
const schema = (item as any)['@context']
|
||||||
|
? item
|
||||||
|
: { '@context': 'https://schema.org', ...item };
|
||||||
|
|
||||||
|
return (
|
||||||
<script
|
<script
|
||||||
key={index}
|
key={index}
|
||||||
type="application/ld+json"
|
type="application/ld+json"
|
||||||
dangerouslySetInnerHTML={{
|
dangerouslySetInnerHTML={{
|
||||||
__html: JSON.stringify(item, null, 0),
|
__html: JSON.stringify(schema, null, 0),
|
||||||
}}
|
}}
|
||||||
/>
|
/>
|
||||||
))}
|
);
|
||||||
|
})}
|
||||||
</>
|
</>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -168,7 +168,6 @@ END:VCARD`;
|
|||||||
</button>
|
</button>
|
||||||
}
|
}
|
||||||
>
|
>
|
||||||
<DropdownItem onClick={() => window.location.href = `/qr/${qr.id}`}>View Details</DropdownItem>
|
|
||||||
<DropdownItem onClick={() => downloadQR('png')}>Download PNG</DropdownItem>
|
<DropdownItem onClick={() => downloadQR('png')}>Download PNG</DropdownItem>
|
||||||
<DropdownItem onClick={() => downloadQR('svg')}>Download SVG</DropdownItem>
|
<DropdownItem onClick={() => downloadQR('svg')}>Download SVG</DropdownItem>
|
||||||
{qr.type === 'DYNAMIC' && (
|
{qr.type === 'DYNAMIC' && (
|
||||||
@@ -247,15 +246,6 @@ END:VCARD`;
|
|||||||
</p>
|
</p>
|
||||||
</div>
|
</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>
|
</div>
|
||||||
</CardContent>
|
</CardContent>
|
||||||
</Card>
|
</Card>
|
||||||
|
|||||||
77
src/components/marketing/AnimatedBackground.tsx
Normal file
@@ -0,0 +1,77 @@
|
|||||||
|
'use client';
|
||||||
|
|
||||||
|
import React from 'react';
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Modern animated grid background for Hero section
|
||||||
|
* Replaces the overused "blob" animations with a more premium, tech-forward aesthetic
|
||||||
|
*/
|
||||||
|
export const AnimatedBackground: React.FC = () => {
|
||||||
|
return (
|
||||||
|
<div className="absolute inset-0 overflow-hidden pointer-events-none">
|
||||||
|
{/* Subtle gradient overlay */}
|
||||||
|
<div className="absolute inset-0 bg-gradient-to-br from-blue-50 via-white to-purple-50" />
|
||||||
|
|
||||||
|
{/* Animated grid pattern */}
|
||||||
|
<svg
|
||||||
|
className="absolute inset-0 w-full h-full"
|
||||||
|
xmlns="http://www.w3.org/2000/svg"
|
||||||
|
>
|
||||||
|
<defs>
|
||||||
|
{/* Gradient for grid lines */}
|
||||||
|
<linearGradient id="grid-gradient" x1="0%" y1="0%" x2="100%" y2="100%">
|
||||||
|
<stop offset="0%" stopColor="#6366f1" stopOpacity="0.1" />
|
||||||
|
<stop offset="50%" stopColor="#8b5cf6" stopOpacity="0.15" />
|
||||||
|
<stop offset="100%" stopColor="#d946ef" stopOpacity="0.1" />
|
||||||
|
</linearGradient>
|
||||||
|
|
||||||
|
{/* Pattern definition */}
|
||||||
|
<pattern
|
||||||
|
id="grid-pattern"
|
||||||
|
width="50"
|
||||||
|
height="50"
|
||||||
|
patternUnits="userSpaceOnUse"
|
||||||
|
>
|
||||||
|
{/* Vertical line */}
|
||||||
|
<line
|
||||||
|
x1="0"
|
||||||
|
y1="0"
|
||||||
|
x2="0"
|
||||||
|
y2="50"
|
||||||
|
stroke="url(#grid-gradient)"
|
||||||
|
strokeWidth="1"
|
||||||
|
strokeDasharray="4 4"
|
||||||
|
className="animate-dash"
|
||||||
|
/>
|
||||||
|
{/* Horizontal line */}
|
||||||
|
<line
|
||||||
|
x1="0"
|
||||||
|
y1="0"
|
||||||
|
x2="50"
|
||||||
|
y2="0"
|
||||||
|
stroke="url(#grid-gradient)"
|
||||||
|
strokeWidth="1"
|
||||||
|
strokeDasharray="4 4"
|
||||||
|
className="animate-dash"
|
||||||
|
/>
|
||||||
|
</pattern>
|
||||||
|
</defs>
|
||||||
|
|
||||||
|
{/* Grid overlay */}
|
||||||
|
<rect width="100%" height="100%" fill="url(#grid-pattern)" />
|
||||||
|
</svg>
|
||||||
|
|
||||||
|
{/* Floating gradient orbs (subtle, as accents) */}
|
||||||
|
<div className="absolute top-1/4 -left-48 w-96 h-96 bg-blue-400/5 rounded-full blur-3xl animate-float" />
|
||||||
|
<div className="absolute bottom-1/4 -right-48 w-96 h-96 bg-purple-400/5 rounded-full blur-3xl animate-float" style={{ animationDelay: '2s' }} />
|
||||||
|
|
||||||
|
{/* Noise texture overlay for depth */}
|
||||||
|
<div
|
||||||
|
className="absolute inset-0 opacity-[0.015] mix-blend-overlay"
|
||||||
|
style={{
|
||||||
|
backgroundImage: `url("data:image/svg+xml,%3Csvg viewBox='0 0 400 400' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noiseFilter'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noiseFilter)'/%3E%3C/svg%3E")`,
|
||||||
|
}}
|
||||||
|
/>
|
||||||
|
</div>
|
||||||
|
);
|
||||||
|
};
|
||||||
50
src/components/marketing/BentoGrid.tsx
Normal file
@@ -0,0 +1,50 @@
|
|||||||
|
'use client';
|
||||||
|
|
||||||
|
import React from 'react';
|
||||||
|
import { motion } from 'framer-motion';
|
||||||
|
|
||||||
|
interface BentoGridProps {
|
||||||
|
children: React.ReactNode[];
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Modern Bento Box Grid Layout
|
||||||
|
* Features are displayed in different sizes based on importance
|
||||||
|
*/
|
||||||
|
export const BentoGrid: React.FC<BentoGridProps> = ({ children }) => {
|
||||||
|
return (
|
||||||
|
<div className="grid grid-cols-1 md:grid-cols-6 gap-6 max-w-6xl mx-auto">
|
||||||
|
{children}
|
||||||
|
</div>
|
||||||
|
);
|
||||||
|
};
|
||||||
|
|
||||||
|
interface BentoItemProps {
|
||||||
|
children: React.ReactNode;
|
||||||
|
size?: 'small' | 'medium' | 'large';
|
||||||
|
className?: string;
|
||||||
|
}
|
||||||
|
|
||||||
|
export const BentoItem: React.FC<BentoItemProps> = ({
|
||||||
|
children,
|
||||||
|
size = 'medium',
|
||||||
|
className = '',
|
||||||
|
}) => {
|
||||||
|
const sizeClasses = {
|
||||||
|
small: 'md:col-span-2',
|
||||||
|
medium: 'md:col-span-3',
|
||||||
|
large: 'md:col-span-6',
|
||||||
|
};
|
||||||
|
|
||||||
|
return (
|
||||||
|
<motion.div
|
||||||
|
initial={{ opacity: 0, y: 20 }}
|
||||||
|
whileInView={{ opacity: 1, y: 0 }}
|
||||||
|
viewport={{ once: true, margin: '-50px' }}
|
||||||
|
transition={{ duration: 0.5 }}
|
||||||
|
className={`${sizeClasses[size]} ${className}`}
|
||||||
|
>
|
||||||
|
{children}
|
||||||
|
</motion.div>
|
||||||
|
);
|
||||||
|
};
|
||||||
95
src/components/marketing/FeatureAnalyticsDemo.tsx
Normal file
@@ -0,0 +1,95 @@
|
|||||||
|
'use client';
|
||||||
|
|
||||||
|
import React from 'react';
|
||||||
|
import { motion } from 'framer-motion';
|
||||||
|
import { TrendingUp, Eye, MousePointer } from 'lucide-react';
|
||||||
|
|
||||||
|
export const FeatureAnalyticsDemo: React.FC = () => {
|
||||||
|
const data = [30, 45, 35, 60, 50, 75, 65, 85];
|
||||||
|
|
||||||
|
return (
|
||||||
|
<div className="relative h-full min-h-[300px] bg-gradient-to-br from-blue-50 to-blue-100 rounded-2xl p-8 overflow-hidden group">
|
||||||
|
{/* Background Pattern */}
|
||||||
|
<div className="absolute inset-0 opacity-10">
|
||||||
|
<svg width="100%" height="100%">
|
||||||
|
<pattern id="analytics-grid" width="20" height="20" patternUnits="userSpaceOnUse">
|
||||||
|
<circle cx="1" cy="1" r="1" fill="currentColor" />
|
||||||
|
</pattern>
|
||||||
|
<rect width="100%" height="100%" fill="url(#analytics-grid)" />
|
||||||
|
</svg>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div className="relative z-10 h-full flex flex-col">
|
||||||
|
{/* Header */}
|
||||||
|
<div className="mb-6">
|
||||||
|
<div className="flex items-center gap-2 mb-2">
|
||||||
|
<TrendingUp className="w-6 h-6 text-blue-600" />
|
||||||
|
<h3 className="text-2xl font-bold text-gray-900">Analytics</h3>
|
||||||
|
</div>
|
||||||
|
<p className="text-gray-600">Real-time tracking and insights</p>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
{/* Animated Chart */}
|
||||||
|
<div className="flex-1 flex items-end gap-2 mb-6">
|
||||||
|
{data.map((value, index) => (
|
||||||
|
<motion.div
|
||||||
|
key={index}
|
||||||
|
initial={{ height: 0 }}
|
||||||
|
whileInView={{ height: `${value}%` }}
|
||||||
|
viewport={{ once: true }}
|
||||||
|
transition={{
|
||||||
|
duration: 0.8,
|
||||||
|
delay: index * 0.1,
|
||||||
|
ease: [0.34, 1.56, 0.64, 1]
|
||||||
|
}}
|
||||||
|
className="flex-1 bg-gradient-to-t from-blue-600 to-blue-400 rounded-t-lg relative group-hover:from-blue-500 group-hover:to-blue-300 transition-all"
|
||||||
|
>
|
||||||
|
<motion.div
|
||||||
|
initial={{ opacity: 0 }}
|
||||||
|
whileInView={{ opacity: 1 }}
|
||||||
|
transition={{ delay: 1 + index * 0.1 }}
|
||||||
|
className="absolute -top-6 left-1/2 -translate-x-1/2 text-xs font-bold text-blue-700 whitespace-nowrap"
|
||||||
|
>
|
||||||
|
{value}
|
||||||
|
</motion.div>
|
||||||
|
</motion.div>
|
||||||
|
))}
|
||||||
|
</div>
|
||||||
|
|
||||||
|
{/* Stats */}
|
||||||
|
<div className="grid grid-cols-2 gap-3">
|
||||||
|
<div className="bg-white/80 backdrop-blur-sm rounded-lg p-3">
|
||||||
|
<div className="flex items-center gap-2 text-sm text-gray-600 mb-1">
|
||||||
|
<Eye className="w-4 h-4" />
|
||||||
|
<span>Total Scans</span>
|
||||||
|
</div>
|
||||||
|
<motion.div
|
||||||
|
initial={{ opacity: 0, scale: 0.5 }}
|
||||||
|
whileInView={{ opacity: 1, scale: 1 }}
|
||||||
|
viewport={{ once: true }}
|
||||||
|
transition={{ delay: 1.2 }}
|
||||||
|
className="text-2xl font-bold text-gray-900"
|
||||||
|
>
|
||||||
|
12,547
|
||||||
|
</motion.div>
|
||||||
|
</div>
|
||||||
|
<div className="bg-white/80 backdrop-blur-sm rounded-lg p-3">
|
||||||
|
<div className="flex items-center gap-2 text-sm text-gray-600 mb-1">
|
||||||
|
<MousePointer className="w-4 h-4" />
|
||||||
|
<span>Click Rate</span>
|
||||||
|
</div>
|
||||||
|
<motion.div
|
||||||
|
initial={{ opacity: 0, scale: 0.5 }}
|
||||||
|
whileInView={{ opacity: 1, scale: 1 }}
|
||||||
|
viewport={{ once: true }}
|
||||||
|
transition={{ delay: 1.4 }}
|
||||||
|
className="text-2xl font-bold text-green-600"
|
||||||
|
>
|
||||||
|
87%
|
||||||
|
</motion.div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
);
|
||||||
|
};
|
||||||
111
src/components/marketing/FeatureBulkDemo.tsx
Normal file
@@ -0,0 +1,111 @@
|
|||||||
|
'use client';
|
||||||
|
|
||||||
|
import React, { useState, useEffect } from 'react';
|
||||||
|
import { motion } from 'framer-motion';
|
||||||
|
import { QRCodeSVG } from 'qrcode.react';
|
||||||
|
import { FileSpreadsheet, ArrowRight } from 'lucide-react';
|
||||||
|
|
||||||
|
export const FeatureBulkDemo: React.FC = () => {
|
||||||
|
const [showQRs, setShowQRs] = useState(false);
|
||||||
|
const [hasAnimated, setHasAnimated] = useState(false);
|
||||||
|
|
||||||
|
useEffect(() => {
|
||||||
|
if (hasAnimated) return;
|
||||||
|
|
||||||
|
const timer = setTimeout(() => {
|
||||||
|
setShowQRs(true);
|
||||||
|
setHasAnimated(true);
|
||||||
|
}, 500);
|
||||||
|
|
||||||
|
return () => clearTimeout(timer);
|
||||||
|
}, [hasAnimated]);
|
||||||
|
|
||||||
|
const qrCodes = [
|
||||||
|
{ id: 1, url: 'product-1', delay: 0 },
|
||||||
|
{ id: 2, url: 'product-2', delay: 0.1 },
|
||||||
|
{ id: 3, url: 'product-3', delay: 0.2 },
|
||||||
|
{ id: 4, url: 'product-4', delay: 0.3 },
|
||||||
|
{ id: 5, url: 'product-5', delay: 0.4 },
|
||||||
|
{ id: 6, url: 'product-6', delay: 0.5 },
|
||||||
|
];
|
||||||
|
|
||||||
|
return (
|
||||||
|
<div className="relative h-full min-h-[300px] bg-gradient-to-br from-emerald-50 to-teal-100 rounded-2xl p-8 overflow-hidden">
|
||||||
|
<div className="relative z-10 h-full flex flex-col">
|
||||||
|
{/* Header */}
|
||||||
|
<div className="mb-6">
|
||||||
|
<div className="flex items-center gap-2 mb-2">
|
||||||
|
<FileSpreadsheet className="w-6 h-6 text-emerald-600" />
|
||||||
|
<h3 className="text-2xl font-bold text-gray-900">Bulk Creation</h3>
|
||||||
|
</div>
|
||||||
|
<p className="text-gray-600">Generate hundreds at once</p>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
{/* Animation */}
|
||||||
|
<div className="flex-1 flex items-center justify-center gap-8">
|
||||||
|
{/* CSV Icon */}
|
||||||
|
<motion.div
|
||||||
|
animate={{
|
||||||
|
scale: showQRs ? 0.8 : 1,
|
||||||
|
opacity: showQRs ? 0.5 : 1,
|
||||||
|
}}
|
||||||
|
transition={{ duration: 0.5 }}
|
||||||
|
className="flex flex-col items-center"
|
||||||
|
>
|
||||||
|
<div className="w-20 h-24 bg-white rounded-lg shadow-md flex items-center justify-center border-2 border-emerald-200">
|
||||||
|
<FileSpreadsheet className="w-10 h-10 text-emerald-600" />
|
||||||
|
</div>
|
||||||
|
<p className="text-xs text-gray-600 mt-2 font-medium">products.csv</p>
|
||||||
|
</motion.div>
|
||||||
|
|
||||||
|
{/* Arrow */}
|
||||||
|
<motion.div
|
||||||
|
animate={{
|
||||||
|
x: showQRs ? [0, 10, 0] : 0,
|
||||||
|
opacity: showQRs ? 1 : 0.3,
|
||||||
|
}}
|
||||||
|
transition={{ duration: 0.5, repeat: showQRs ? Infinity : 0, repeatDelay: 1 }}
|
||||||
|
>
|
||||||
|
<ArrowRight className="w-8 h-8 text-emerald-600" />
|
||||||
|
</motion.div>
|
||||||
|
|
||||||
|
{/* QR Codes Grid */}
|
||||||
|
<div className="grid grid-cols-3 gap-2">
|
||||||
|
{qrCodes.map((qr) => (
|
||||||
|
<motion.div
|
||||||
|
key={qr.id}
|
||||||
|
initial={{ scale: 0, opacity: 0 }}
|
||||||
|
animate={{
|
||||||
|
scale: showQRs ? 1 : 0,
|
||||||
|
opacity: showQRs ? 1 : 0,
|
||||||
|
}}
|
||||||
|
transition={{
|
||||||
|
duration: 0.4,
|
||||||
|
delay: showQRs ? qr.delay : 0,
|
||||||
|
ease: [0.34, 1.56, 0.64, 1]
|
||||||
|
}}
|
||||||
|
className="p-1.5 bg-white rounded shadow-sm"
|
||||||
|
>
|
||||||
|
<QRCodeSVG
|
||||||
|
value={`https://qrmaster.net/${qr.url}`}
|
||||||
|
size={32}
|
||||||
|
level="L"
|
||||||
|
/>
|
||||||
|
</motion.div>
|
||||||
|
))}
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
{/* Counter */}
|
||||||
|
<motion.div
|
||||||
|
animate={{ opacity: showQRs ? 1 : 0 }}
|
||||||
|
className="text-center"
|
||||||
|
>
|
||||||
|
<p className="text-sm font-semibold text-emerald-700">
|
||||||
|
✓ 6 QR codes generated
|
||||||
|
</p>
|
||||||
|
</motion.div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
);
|
||||||
|
};
|
||||||
93
src/components/marketing/FeatureCustomizationDemo.tsx
Normal file
@@ -0,0 +1,93 @@
|
|||||||
|
'use client';
|
||||||
|
|
||||||
|
import React, { useState, useEffect } from 'react';
|
||||||
|
import { motion, AnimatePresence } from 'framer-motion';
|
||||||
|
import { QRCodeSVG } from 'qrcode.react';
|
||||||
|
import { Palette } from 'lucide-react';
|
||||||
|
|
||||||
|
const colorPresets = [
|
||||||
|
{ fg: '#000000', bg: '#FFFFFF' },
|
||||||
|
{ fg: '#0ea5e9', bg: '#e0f2fe' },
|
||||||
|
{ fg: '#8b5cf6', bg: '#f3e8ff' },
|
||||||
|
{ fg: '#f59e0b', bg: '#fef3c7' },
|
||||||
|
];
|
||||||
|
|
||||||
|
export const FeatureCustomizationDemo: React.FC = () => {
|
||||||
|
const [activeIndex, setActiveIndex] = useState(0);
|
||||||
|
const [hasAnimated, setHasAnimated] = useState(false);
|
||||||
|
|
||||||
|
useEffect(() => {
|
||||||
|
if (hasAnimated) return;
|
||||||
|
|
||||||
|
const interval = setInterval(() => {
|
||||||
|
setActiveIndex((prev) => {
|
||||||
|
const next = prev + 1;
|
||||||
|
if (next >= colorPresets.length) {
|
||||||
|
clearInterval(interval);
|
||||||
|
setHasAnimated(true);
|
||||||
|
return 0; // Reset to first
|
||||||
|
}
|
||||||
|
return next;
|
||||||
|
});
|
||||||
|
}, 1500);
|
||||||
|
|
||||||
|
return () => clearInterval(interval);
|
||||||
|
}, [hasAnimated]);
|
||||||
|
|
||||||
|
const currentPreset = colorPresets[activeIndex];
|
||||||
|
|
||||||
|
return (
|
||||||
|
<div className="relative h-full min-h-[300px] bg-gradient-to-br from-purple-50 to-pink-100 rounded-2xl p-8 overflow-hidden">
|
||||||
|
<div className="relative z-10 h-full flex flex-col">
|
||||||
|
{/* Header */}
|
||||||
|
<div className="mb-6">
|
||||||
|
<div className="flex items-center gap-2 mb-2">
|
||||||
|
<Palette className="w-6 h-6 text-purple-600" />
|
||||||
|
<h3 className="text-2xl font-bold text-gray-900">Customization</h3>
|
||||||
|
</div>
|
||||||
|
<p className="text-gray-600">Brand your QR codes</p>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
{/* QR Code with Morphing */}
|
||||||
|
<div className="flex-1 flex items-center justify-center">
|
||||||
|
<AnimatePresence mode="wait">
|
||||||
|
<motion.div
|
||||||
|
key={activeIndex}
|
||||||
|
initial={{ scale: 0.8, rotate: -10, opacity: 0 }}
|
||||||
|
animate={{ scale: 1, rotate: 0, opacity: 1 }}
|
||||||
|
exit={{ scale: 0.8, rotate: 10, opacity: 0 }}
|
||||||
|
transition={{ duration: 0.5, ease: [0.34, 1.56, 0.64, 1] }}
|
||||||
|
className="p-6 bg-white rounded-2xl shadow-lg"
|
||||||
|
>
|
||||||
|
<QRCodeSVG
|
||||||
|
value="https://qrmaster.net"
|
||||||
|
size={140}
|
||||||
|
fgColor={currentPreset.fg}
|
||||||
|
bgColor={currentPreset.bg}
|
||||||
|
level="M"
|
||||||
|
/>
|
||||||
|
</motion.div>
|
||||||
|
</AnimatePresence>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
{/* Color Dots Indicator */}
|
||||||
|
<div className="flex justify-center gap-2 mt-6">
|
||||||
|
{colorPresets.map((preset, index) => (
|
||||||
|
<motion.button
|
||||||
|
key={index}
|
||||||
|
onClick={() => setActiveIndex(index)}
|
||||||
|
className={`w-3 h-3 rounded-full transition-all ${
|
||||||
|
index === activeIndex ? 'scale-125' : 'scale-100 opacity-50'
|
||||||
|
}`}
|
||||||
|
style={{
|
||||||
|
background: `linear-gradient(135deg, ${preset.fg}, ${preset.bg})`
|
||||||
|
}}
|
||||||
|
whileHover={{ scale: 1.3 }}
|
||||||
|
whileTap={{ scale: 0.9 }}
|
||||||
|
/>
|
||||||
|
))}
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
);
|
||||||
|
};
|
||||||
@@ -2,83 +2,109 @@
|
|||||||
|
|
||||||
import React from 'react';
|
import React from 'react';
|
||||||
import { motion } from 'framer-motion';
|
import { motion } from 'framer-motion';
|
||||||
import { Card, CardHeader, CardTitle, CardContent } from '@/components/ui/Card';
|
import { BentoGrid, BentoItem } from './BentoGrid';
|
||||||
|
import { FeatureAnalyticsDemo } from './FeatureAnalyticsDemo';
|
||||||
|
import { FeatureCustomizationDemo } from './FeatureCustomizationDemo';
|
||||||
|
import { FeatureBulkDemo } from './FeatureBulkDemo';
|
||||||
|
import { Infinity as InfinityIcon, Clock, Shield } from 'lucide-react';
|
||||||
|
|
||||||
interface FeaturesProps {
|
interface FeaturesProps {
|
||||||
t: any; // i18n translation function
|
t: any; // i18n translation function
|
||||||
}
|
}
|
||||||
|
|
||||||
export const Features: React.FC<FeaturesProps> = ({ t }) => {
|
export const Features: React.FC<FeaturesProps> = ({ t }) => {
|
||||||
const features = [
|
|
||||||
{
|
|
||||||
key: 'analytics',
|
|
||||||
icon: (
|
|
||||||
<svg className="w-6 h-6" fill="none" stroke="currentColor" viewBox="0 0 24 24" aria-hidden="true">
|
|
||||||
<path strokeLinecap="round" strokeLinejoin="round" strokeWidth={2} d="M9 19v-6a2 2 0 00-2-2H5a2 2 0 00-2 2v6a2 2 0 002 2h2a2 2 0 002-2zm0 0V9a2 2 0 012-2h2a2 2 0 012 2v10m-6 0a2 2 0 002 2h2a2 2 0 002-2m0 0V5a2 2 0 012-2h2a2 2 0 012 2v14a2 2 0 01-2 2h-2a2 2 0 01-2-2z" />
|
|
||||||
</svg>
|
|
||||||
),
|
|
||||||
color: 'text-blue-600 bg-blue-100',
|
|
||||||
},
|
|
||||||
{
|
|
||||||
key: 'customization',
|
|
||||||
icon: (
|
|
||||||
<svg className="w-6 h-6" fill="none" stroke="currentColor" viewBox="0 0 24 24" aria-hidden="true">
|
|
||||||
<path strokeLinecap="round" strokeLinejoin="round" strokeWidth={2} d="M7 21a4 4 0 01-4-4V5a2 2 0 012-2h4a2 2 0 012 2v12a4 4 0 01-4 4zm0 0h12a2 2 0 002-2v-4a2 2 0 00-2-2h-2.343M11 7.343l1.657-1.657a2 2 0 012.828 0l2.829 2.829a2 2 0 010 2.828l-8.486 8.485M7 17h.01" />
|
|
||||||
</svg>
|
|
||||||
),
|
|
||||||
color: 'text-purple-600 bg-purple-100',
|
|
||||||
},
|
|
||||||
{
|
|
||||||
key: 'unlimited',
|
|
||||||
icon: (
|
|
||||||
<svg className="w-6 h-6" fill="none" stroke="currentColor" viewBox="0 0 24 24" aria-hidden="true">
|
|
||||||
<path strokeLinecap="round" strokeLinejoin="round" strokeWidth={2} d="M12 8v4l3 3m6-3a9 9 0 11-18 0 9 9 0 0118 0z" />
|
|
||||||
</svg>
|
|
||||||
),
|
|
||||||
color: 'text-green-600 bg-green-100',
|
|
||||||
},
|
|
||||||
];
|
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<section className="py-16 bg-gray-50">
|
<section className="py-20 bg-gray-50">
|
||||||
<div className="container mx-auto px-4 sm:px-6 lg:px-8 max-w-7xl">
|
<div className="container mx-auto px-4 sm:px-6 lg:px-8 max-w-7xl">
|
||||||
|
{/* Section Header */}
|
||||||
<motion.div
|
<motion.div
|
||||||
initial={{ opacity: 0, y: 20 }}
|
initial={{ opacity: 0, y: 20 }}
|
||||||
whileInView={{ opacity: 1, y: 0 }}
|
whileInView={{ opacity: 1, y: 0 }}
|
||||||
viewport={{ once: true }}
|
viewport={{ once: true }}
|
||||||
transition={{ duration: 0.5 }}
|
transition={{ duration: 0.5 }}
|
||||||
className="text-center mb-12"
|
className="text-center mb-16"
|
||||||
>
|
>
|
||||||
<h2 className="text-3xl lg:text-4xl font-bold text-gray-900 mb-4">
|
<h2 className="text-4xl lg:text-5xl font-bold text-gray-900 mb-4">
|
||||||
{t.features.title}
|
{t.features.title}
|
||||||
</h2>
|
</h2>
|
||||||
|
<p className="text-xl text-gray-600 max-w-2xl mx-auto">
|
||||||
|
Everything you need to create, manage, and track QR codes at scale
|
||||||
|
</p>
|
||||||
</motion.div>
|
</motion.div>
|
||||||
|
|
||||||
<div className="grid md:grid-cols-2 lg:grid-cols-3 gap-6 max-w-6xl mx-auto">
|
{/* Bento Grid */}
|
||||||
{features.map((feature, index) => (
|
<BentoGrid>
|
||||||
<motion.div
|
{/* Analytics - Large */}
|
||||||
key={feature.key}
|
<BentoItem size="large">
|
||||||
initial={{ opacity: 0, y: 20 }}
|
<FeatureAnalyticsDemo />
|
||||||
whileInView={{ opacity: 1, y: 0 }}
|
</BentoItem>
|
||||||
viewport={{ once: true }}
|
|
||||||
transition={{ duration: 0.5, delay: index * 0.1 }}
|
{/* Customization - Medium */}
|
||||||
>
|
<BentoItem size="medium">
|
||||||
<Card hover className="h-full border-gray-100 hover:border-primary-100 hover:shadow-lg transition-all">
|
<FeatureCustomizationDemo />
|
||||||
<CardHeader>
|
</BentoItem>
|
||||||
<div className={`w-12 h-12 rounded-lg ${feature.color} flex items-center justify-center mb-4`}>
|
|
||||||
{feature.icon}
|
{/* Bulk Creation - Medium */}
|
||||||
</div>
|
<BentoItem size="medium">
|
||||||
<CardTitle>{t.features[feature.key].title}</CardTitle>
|
<FeatureBulkDemo />
|
||||||
</CardHeader>
|
</BentoItem>
|
||||||
<CardContent>
|
|
||||||
<p className="text-gray-600">
|
{/* Unlimited - Small */}
|
||||||
{t.features[feature.key].description}
|
<BentoItem size="small">
|
||||||
|
<div className="h-full min-h-[200px] bg-gradient-to-br from-indigo-50 to-indigo-100 rounded-2xl p-6 flex flex-col justify-between">
|
||||||
|
<div>
|
||||||
|
<InfinityIcon className="w-8 h-8 text-indigo-600 mb-3" />
|
||||||
|
<h3 className="text-xl font-bold text-gray-900 mb-2">
|
||||||
|
{t.features.unlimited.title}
|
||||||
|
</h3>
|
||||||
|
<p className="text-sm text-gray-600">
|
||||||
|
{t.features.unlimited.description}
|
||||||
</p>
|
</p>
|
||||||
</CardContent>
|
|
||||||
</Card>
|
|
||||||
</motion.div>
|
|
||||||
))}
|
|
||||||
</div>
|
</div>
|
||||||
|
<div className="self-end">
|
||||||
|
<InfinityIcon className="w-16 h-16 text-indigo-200" />
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</BentoItem>
|
||||||
|
|
||||||
|
{/* Reliable - Small */}
|
||||||
|
<BentoItem size="small">
|
||||||
|
<div className="h-full min-h-[200px] bg-gradient-to-br from-green-50 to-green-100 rounded-2xl p-6 flex flex-col justify-between">
|
||||||
|
<div>
|
||||||
|
<Clock className="w-8 h-8 text-green-600 mb-3" />
|
||||||
|
<h3 className="text-xl font-bold text-gray-900 mb-2">
|
||||||
|
24/7 Reliable
|
||||||
|
</h3>
|
||||||
|
<p className="text-sm text-gray-600">
|
||||||
|
99.9% uptime guarantee with enterprise-grade infrastructure
|
||||||
|
</p>
|
||||||
|
</div>
|
||||||
|
<div className="self-end">
|
||||||
|
<div className="text-4xl font-bold text-green-600">
|
||||||
|
99.9<span className="text-2xl">%</span>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</BentoItem>
|
||||||
|
|
||||||
|
{/* Secure - Small */}
|
||||||
|
<BentoItem size="small">
|
||||||
|
<div className="h-full min-h-[200px] bg-gradient-to-br from-amber-50 to-amber-100 rounded-2xl p-6 flex flex-col justify-between">
|
||||||
|
<div>
|
||||||
|
<Shield className="w-8 h-8 text-amber-600 mb-3" />
|
||||||
|
<h3 className="text-xl font-bold text-gray-900 mb-2">
|
||||||
|
Enterprise Security
|
||||||
|
</h3>
|
||||||
|
<p className="text-sm text-gray-600">
|
||||||
|
Bank-level encryption and GDPR compliant data handling
|
||||||
|
</p>
|
||||||
|
</div>
|
||||||
|
<div className="self-end">
|
||||||
|
<Shield className="w-16 h-16 text-amber-200" />
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</BentoItem>
|
||||||
|
</BentoGrid>
|
||||||
</div>
|
</div>
|
||||||
</section>
|
</section>
|
||||||
);
|
);
|
||||||
|
|||||||
@@ -22,8 +22,7 @@ import {
|
|||||||
MapPin,
|
MapPin,
|
||||||
CreditCard,
|
CreditCard,
|
||||||
Video,
|
Video,
|
||||||
Users,
|
Users
|
||||||
Barcode
|
|
||||||
} from 'lucide-react';
|
} from 'lucide-react';
|
||||||
|
|
||||||
const TOOLS = [
|
const TOOLS = [
|
||||||
@@ -178,14 +177,6 @@ const TOOLS = [
|
|||||||
href: '/tools/teams-qr-code',
|
href: '/tools/teams-qr-code',
|
||||||
color: 'text-violet-500',
|
color: 'text-violet-500',
|
||||||
bg: 'bg-violet-50'
|
bg: 'bg-violet-50'
|
||||||
},
|
|
||||||
{
|
|
||||||
icon: Barcode,
|
|
||||||
name: 'Barcode',
|
|
||||||
description: 'Create standard barcodes',
|
|
||||||
href: '/tools/barcode-generator',
|
|
||||||
color: 'text-slate-900',
|
|
||||||
bg: 'bg-slate-100'
|
|
||||||
}
|
}
|
||||||
];
|
];
|
||||||
|
|
||||||
@@ -222,18 +213,9 @@ export function FreeToolsGrid() {
|
|||||||
transition={{ duration: 0.5 }}
|
transition={{ duration: 0.5 }}
|
||||||
className="text-center mb-16"
|
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 mb-4">
|
||||||
<h2 className="text-3xl lg:text-4xl font-bold text-slate-900">
|
|
||||||
More Free QR Code Tools
|
More Free QR Code Tools
|
||||||
</h2>
|
</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">
|
<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.
|
Create specialized QR codes for every need. Completely free and no signup required.
|
||||||
</p>
|
</p>
|
||||||
|
|||||||
@@ -4,207 +4,156 @@ import React from 'react';
|
|||||||
import Link from 'next/link';
|
import Link from 'next/link';
|
||||||
import { Button } from '@/components/ui/Button';
|
import { Button } from '@/components/ui/Button';
|
||||||
import { Badge } from '@/components/ui/Badge';
|
import { Badge } from '@/components/ui/Badge';
|
||||||
import { Card } from '@/components/ui/Card';
|
|
||||||
import { motion } from 'framer-motion';
|
import { motion } from 'framer-motion';
|
||||||
import { Globe, User, MapPin, Phone, CheckCircle2, ArrowRight, FileText, Ticket, Smartphone, Star } from 'lucide-react';
|
import { CheckCircle2, ArrowRight, Zap } from 'lucide-react';
|
||||||
import { useState, useEffect } from 'react';
|
import { AnimatedBackground } from './AnimatedBackground';
|
||||||
|
import { QRTypesShowcase } from './QRTypesShowcase';
|
||||||
// Sub-component for the flipping effect
|
import { PhoneMockup } from './PhoneMockup';
|
||||||
const FlippingCard = ({ front, back, delay }: { front: any, back: any, delay: number }) => {
|
import { StatsCounter, defaultStats } from './StatsCounter';
|
||||||
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 {
|
interface HeroProps {
|
||||||
t: any; // i18n translation function
|
t: any; // i18n translation function
|
||||||
}
|
}
|
||||||
|
|
||||||
export const Hero: React.FC<HeroProps> = ({ t }) => {
|
export const Hero: React.FC<HeroProps> = ({ t }) => {
|
||||||
|
|
||||||
|
|
||||||
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 (
|
return (
|
||||||
<section className="relative overflow-hidden bg-gradient-to-br from-blue-50 via-white to-purple-50 pt-12 pb-20">
|
<section className="relative overflow-hidden pt-20 pb-32 min-h-[90vh] flex items-center">
|
||||||
{/* Animated Background Orbs */}
|
{/* Modern Animated Background */}
|
||||||
<div className="absolute inset-0 overflow-hidden pointer-events-none">
|
<AnimatedBackground />
|
||||||
{/* Orb 1 - Blue (top-left) */}
|
|
||||||
<div className="absolute -top-24 -left-24 w-96 h-96 bg-blue-400/30 rounded-full blur-3xl animate-blob" />
|
|
||||||
|
|
||||||
{/* Orb 2 - Purple (top-right) */}
|
|
||||||
<div className="absolute -top-12 -right-12 w-96 h-96 bg-purple-400/30 rounded-full blur-3xl animate-blob animation-delay-2000" />
|
|
||||||
|
|
||||||
{/* Orb 3 - Pink (bottom-left) */}
|
|
||||||
<div className="absolute -bottom-24 -left-12 w-96 h-96 bg-pink-400/20 rounded-full blur-3xl animate-blob animation-delay-4000" />
|
|
||||||
|
|
||||||
{/* Orb 4 - Cyan (center-right) */}
|
|
||||||
<div className="absolute top-1/2 -right-24 w-80 h-80 bg-cyan-400/20 rounded-full blur-3xl animate-blob animation-delay-6000" />
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div className="container mx-auto px-4 sm:px-6 lg:px-8 max-w-7xl relative z-10">
|
<div className="container mx-auto px-4 sm:px-6 lg:px-8 max-w-7xl relative z-10">
|
||||||
<div className="grid lg:grid-cols-2 gap-12 items-center">
|
{/* Main Content Grid */}
|
||||||
{/* Left Content */}
|
<div className="grid lg:grid-cols-2 gap-12 lg:gap-16 items-center">
|
||||||
<div className="space-y-8">
|
{/* Left: Content */}
|
||||||
<Badge variant="info" className="inline-flex items-center space-x-2">
|
|
||||||
<span>{t.hero.badge}</span>
|
|
||||||
</Badge>
|
|
||||||
|
|
||||||
<motion.div
|
<motion.div
|
||||||
initial={{ opacity: 0, y: 20 }}
|
initial={{ opacity: 0, y: 20 }}
|
||||||
animate={{ opacity: 1, y: 0 }}
|
animate={{ opacity: 1, y: 0 }}
|
||||||
transition={{ duration: 0.5 }}
|
transition={{ duration: 0.5 }}
|
||||||
|
className="space-y-8 text-center lg:text-left"
|
||||||
|
>
|
||||||
|
{/* Badge */}
|
||||||
|
<motion.div
|
||||||
|
initial={{ opacity: 0, scale: 0.9 }}
|
||||||
|
animate={{ opacity: 1, scale: 1 }}
|
||||||
|
transition={{ delay: 0.1, duration: 0.3 }}
|
||||||
|
className="flex justify-center lg:justify-start"
|
||||||
|
>
|
||||||
|
<Badge variant="info" className="inline-flex items-center space-x-2 px-4 py-2 shadow-sm">
|
||||||
|
<Zap className="w-4 h-4" />
|
||||||
|
<span className="font-semibold">{t.hero.badge}</span>
|
||||||
|
</Badge>
|
||||||
|
</motion.div>
|
||||||
|
|
||||||
|
{/* Headline */}
|
||||||
|
<motion.div
|
||||||
|
initial={{ opacity: 0, y: 20 }}
|
||||||
|
animate={{ opacity: 1, y: 0 }}
|
||||||
|
transition={{ delay: 0.2, duration: 0.4 }}
|
||||||
className="space-y-6"
|
className="space-y-6"
|
||||||
>
|
>
|
||||||
<h1 className="text-5xl lg:text-6xl font-bold text-gray-900 leading-tight">
|
<h2 className="text-5xl sm:text-6xl lg:text-7xl font-bold text-gray-900 leading-tight">
|
||||||
{t.hero.title}
|
{t.hero.title}
|
||||||
</h1>
|
</h2>
|
||||||
|
|
||||||
<p className="text-xl text-gray-600 leading-relaxed max-w-2xl">
|
<p className="text-xl lg:text-2xl text-gray-600 leading-relaxed max-w-2xl mx-auto lg:mx-0">
|
||||||
{t.hero.subtitle}
|
{t.hero.subtitle}
|
||||||
</p>
|
</p>
|
||||||
|
</motion.div>
|
||||||
|
|
||||||
<div className="space-y-3 pt-2">
|
{/* Feature List */}
|
||||||
|
<motion.div
|
||||||
|
initial={{ opacity: 0 }}
|
||||||
|
animate={{ opacity: 1 }}
|
||||||
|
transition={{ delay: 0.3, duration: 0.4 }}
|
||||||
|
className="space-y-4 pt-4"
|
||||||
|
>
|
||||||
{t.hero.features.map((feature: string, index: number) => (
|
{t.hero.features.map((feature: string, index: number) => (
|
||||||
<motion.div
|
<motion.div
|
||||||
key={index}
|
key={index}
|
||||||
initial={{ opacity: 0, x: -20 }}
|
initial={{ opacity: 0, x: -20 }}
|
||||||
animate={{ opacity: 1, x: 0 }}
|
animate={{ opacity: 1, x: 0 }}
|
||||||
transition={{ delay: 0.2 + (index * 0.1) }}
|
transition={{ delay: 0.4 + index * 0.08, duration: 0.3 }}
|
||||||
className="flex items-center space-x-3"
|
className="flex items-center space-x-3 justify-center lg:justify-start"
|
||||||
>
|
>
|
||||||
<div className="flex-shrink-0 w-6 h-6 bg-emerald-100 rounded-full flex items-center justify-center">
|
<div className="flex-shrink-0 w-7 h-7 rounded-full bg-gradient-to-br from-emerald-400 to-emerald-600 flex items-center justify-center shadow-sm">
|
||||||
<CheckCircle2 className="w-4 h-4 text-emerald-600" />
|
<CheckCircle2 className="w-4 h-4 text-white" />
|
||||||
</div>
|
</div>
|
||||||
<span className="text-gray-700 font-medium">{feature}</span>
|
<span className="text-gray-700 font-medium text-lg">{feature}</span>
|
||||||
</motion.div>
|
</motion.div>
|
||||||
))}
|
))}
|
||||||
</div>
|
|
||||||
</motion.div>
|
</motion.div>
|
||||||
|
|
||||||
|
{/* CTAs */}
|
||||||
<motion.div
|
<motion.div
|
||||||
initial={{ opacity: 0, y: 20 }}
|
initial={{ opacity: 0, y: 20 }}
|
||||||
animate={{ opacity: 1, y: 0 }}
|
animate={{ opacity: 1, y: 0 }}
|
||||||
transition={{ delay: 0.5 }}
|
transition={{ delay: 0.6, duration: 0.3 }}
|
||||||
className="flex flex-col sm:flex-row gap-4 pt-4"
|
className="flex flex-col sm:flex-row gap-4 pt-6 justify-center lg:justify-start"
|
||||||
>
|
>
|
||||||
<Link href="/signup">
|
<Link href="/signup">
|
||||||
<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">
|
<Button
|
||||||
{t.hero.cta_primary}
|
size="lg"
|
||||||
|
className="text-lg px-10 py-7 w-full sm:w-auto shadow-primary-lg hover:shadow-primary-lg hover:scale-105 transition-all duration-300 group"
|
||||||
|
>
|
||||||
|
<span>{t.hero.cta_primary}</span>
|
||||||
|
<ArrowRight className="ml-2 w-5 h-5 group-hover:translate-x-1 transition-transform" />
|
||||||
</Button>
|
</Button>
|
||||||
</Link>
|
</Link>
|
||||||
<Link href="/#pricing">
|
<Link href="/#pricing">
|
||||||
<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">
|
<Button
|
||||||
|
variant="outline"
|
||||||
|
size="lg"
|
||||||
|
className="text-lg px-10 py-7 w-full sm:w-auto glass border-gray-300 hover:glass-strong hover:scale-105 transition-all duration-300"
|
||||||
|
>
|
||||||
{t.hero.cta_secondary}
|
{t.hero.cta_secondary}
|
||||||
</Button>
|
</Button>
|
||||||
</Link>
|
</Link>
|
||||||
</motion.div>
|
</motion.div>
|
||||||
</div>
|
|
||||||
|
|
||||||
{/* Right Preview Widget */}
|
{/* Trust Indicator */}
|
||||||
<div className="relative">
|
<motion.div
|
||||||
<div className="relative perspective-[1000px]">
|
initial={{ opacity: 0 }}
|
||||||
<div className="grid grid-cols-2 gap-4">
|
animate={{ opacity: 1 }}
|
||||||
{[
|
transition={{ delay: 0.8, duration: 0.3 }}
|
||||||
{
|
className="flex items-center gap-2 text-sm text-gray-500 justify-center lg:justify-start"
|
||||||
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 },
|
<div className="flex -space-x-2">
|
||||||
delay: 3 // Starts at 3s
|
{[1, 2, 3].map((i) => (
|
||||||
},
|
<div
|
||||||
{
|
key={i}
|
||||||
front: { title: 'Contact Card', color: 'bg-purple-500/10 text-purple-600', icon: User },
|
className="w-8 h-8 rounded-full bg-gradient-to-br from-blue-400 to-purple-400 border-2 border-white"
|
||||||
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>
|
</div>
|
||||||
|
<span>Trusted by 25,000+ professionals worldwide</span>
|
||||||
|
</motion.div>
|
||||||
|
</motion.div>
|
||||||
|
|
||||||
|
{/* Right: QR Types Showcase + Phone */}
|
||||||
|
<motion.div
|
||||||
|
initial={{ opacity: 0, x: 50 }}
|
||||||
|
animate={{ opacity: 1, x: 0 }}
|
||||||
|
transition={{ delay: 0.3, duration: 0.5 }}
|
||||||
|
className="relative space-y-8"
|
||||||
|
>
|
||||||
|
{/* QR Types Grid */}
|
||||||
|
<QRTypesShowcase />
|
||||||
|
|
||||||
|
{/* Phone Mockup with Auto-Rotation */}
|
||||||
|
<div className="flex justify-center">
|
||||||
|
<PhoneMockup autoRotate={true} />
|
||||||
</div>
|
</div>
|
||||||
|
</motion.div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
{/* Stats Counter - Subtiler */}
|
||||||
|
<div className="mt-20">
|
||||||
|
<StatsCounter stats={defaultStats} />
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
{/* Smooth Gradient Fade Transition */}
|
{/* Smooth Gradient Fade Transition to next section */}
|
||||||
<div className="absolute bottom-0 left-0 w-full h-32 bg-gradient-to-b from-transparent to-gray-50 pointer-events-none" />
|
<div className="absolute bottom-0 left-0 w-full h-32 bg-gradient-to-b from-transparent to-white pointer-events-none" />
|
||||||
</section>
|
</section>
|
||||||
);
|
);
|
||||||
};
|
};
|
||||||
201
src/components/marketing/HeroQRInteractive.tsx
Normal file
@@ -0,0 +1,201 @@
|
|||||||
|
'use client';
|
||||||
|
|
||||||
|
import React, { useState, useCallback } from 'react';
|
||||||
|
import { QRCodeSVG } from 'qrcode.react';
|
||||||
|
import { motion, AnimatePresence } from 'framer-motion';
|
||||||
|
import { Input } from '@/components/ui/Input';
|
||||||
|
import { Sparkles } from 'lucide-react';
|
||||||
|
|
||||||
|
interface ColorPreset {
|
||||||
|
name: string;
|
||||||
|
fg: string;
|
||||||
|
bg: string;
|
||||||
|
gradient?: string;
|
||||||
|
}
|
||||||
|
|
||||||
|
const colorPresets: ColorPreset[] = [
|
||||||
|
{ name: 'Classic', fg: '#000000', bg: '#FFFFFF' },
|
||||||
|
{ name: 'Ocean', fg: '#0ea5e9', bg: '#e0f2fe' },
|
||||||
|
{ name: 'Forest', fg: '#059669', bg: '#d1fae5' },
|
||||||
|
{ name: 'Sunset', fg: '#f59e0b', bg: '#fef3c7' },
|
||||||
|
{ name: 'Purple', fg: '#8b5cf6', bg: '#f3e8ff' },
|
||||||
|
{ name: 'Pink', fg: '#ec4899', bg: '#fce7f3' },
|
||||||
|
];
|
||||||
|
|
||||||
|
export const HeroQRInteractive: React.FC = () => {
|
||||||
|
const [url, setUrl] = useState('https://qrmaster.net');
|
||||||
|
const [foreground, setForeground] = useState('#000000');
|
||||||
|
const [background, setBackground] = useState('#FFFFFF');
|
||||||
|
const [selectedPreset, setSelectedPreset] = useState(0);
|
||||||
|
|
||||||
|
const handlePresetClick = useCallback((preset: ColorPreset, index: number) => {
|
||||||
|
setForeground(preset.fg);
|
||||||
|
setBackground(preset.bg);
|
||||||
|
setSelectedPreset(index);
|
||||||
|
}, []);
|
||||||
|
|
||||||
|
const handleUrlChange = (e: React.ChangeEvent<HTMLInputElement>) => {
|
||||||
|
setUrl(e.target.value || 'https://qrmaster.net');
|
||||||
|
};
|
||||||
|
|
||||||
|
return (
|
||||||
|
<div className="relative">
|
||||||
|
{/* Main QR Container */}
|
||||||
|
<motion.div
|
||||||
|
initial={{ opacity: 0, scale: 0.9 }}
|
||||||
|
animate={{ opacity: 1, scale: 1 }}
|
||||||
|
transition={{ duration: 0.6, ease: [0.34, 1.56, 0.64, 1] }}
|
||||||
|
className="relative"
|
||||||
|
>
|
||||||
|
{/* Glass card container */}
|
||||||
|
<div className="glass-strong rounded-3xl p-8 lg:p-12 shadow-elevation-4 relative overflow-hidden">
|
||||||
|
{/* Decorative corner accents */}
|
||||||
|
<div className="absolute top-0 right-0 w-32 h-32 bg-gradient-primary-vibrant opacity-10 blur-3xl" />
|
||||||
|
<div className="absolute bottom-0 left-0 w-32 h-32 bg-gradient-accent opacity-10 blur-3xl" />
|
||||||
|
|
||||||
|
{/* QR Code Display */}
|
||||||
|
<div className="flex justify-center mb-8">
|
||||||
|
<motion.div
|
||||||
|
key={`${foreground}-${background}`}
|
||||||
|
initial={{ scale: 0.95, opacity: 0 }}
|
||||||
|
animate={{ scale: 1, opacity: 1 }}
|
||||||
|
transition={{ duration: 0.3 }}
|
||||||
|
className="relative group"
|
||||||
|
>
|
||||||
|
{/* QR Code with hover effect */}
|
||||||
|
<div className="relative p-6 bg-white rounded-2xl shadow-lg group-hover:shadow-xl transition-shadow duration-300">
|
||||||
|
<AnimatePresence mode="wait">
|
||||||
|
<motion.div
|
||||||
|
key={url}
|
||||||
|
initial={{ opacity: 0 }}
|
||||||
|
animate={{ opacity: 1 }}
|
||||||
|
exit={{ opacity: 0 }}
|
||||||
|
transition={{ duration: 0.2 }}
|
||||||
|
>
|
||||||
|
<QRCodeSVG
|
||||||
|
value={url}
|
||||||
|
size={280}
|
||||||
|
fgColor={foreground}
|
||||||
|
bgColor={background}
|
||||||
|
level="H"
|
||||||
|
includeMargin={false}
|
||||||
|
/>
|
||||||
|
</motion.div>
|
||||||
|
</AnimatePresence>
|
||||||
|
|
||||||
|
{/* Scan indicator */}
|
||||||
|
<motion.div
|
||||||
|
className="absolute inset-0 border-2 border-primary-500/30 rounded-2xl"
|
||||||
|
initial={{ scale: 1, opacity: 0 }}
|
||||||
|
animate={{
|
||||||
|
scale: [1, 1.05, 1],
|
||||||
|
opacity: [0, 0.5, 0],
|
||||||
|
}}
|
||||||
|
transition={{
|
||||||
|
duration: 2,
|
||||||
|
repeat: Infinity,
|
||||||
|
ease: 'easeInOut',
|
||||||
|
}}
|
||||||
|
/>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
{/* Live indicator */}
|
||||||
|
<motion.div
|
||||||
|
className="absolute -top-3 -right-3 bg-gradient-to-r from-success-500 to-emerald-500 text-white px-3 py-1.5 rounded-full text-xs font-semibold shadow-lg flex items-center gap-2"
|
||||||
|
initial={{ scale: 0 }}
|
||||||
|
animate={{ scale: 1 }}
|
||||||
|
transition={{ delay: 0.5, type: 'spring' }}
|
||||||
|
>
|
||||||
|
<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>
|
||||||
|
Live Preview
|
||||||
|
</motion.div>
|
||||||
|
</motion.div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
{/* Input Field */}
|
||||||
|
<motion.div
|
||||||
|
initial={{ opacity: 0, y: 20 }}
|
||||||
|
animate={{ opacity: 1, y: 0 }}
|
||||||
|
transition={{ delay: 0.3, duration: 0.4 }}
|
||||||
|
className="mb-6"
|
||||||
|
>
|
||||||
|
<div className="relative">
|
||||||
|
<Input
|
||||||
|
value={url}
|
||||||
|
onChange={handleUrlChange}
|
||||||
|
placeholder="Enter your URL..."
|
||||||
|
className="text-center text-lg font-medium pr-12 bg-white/80 backdrop-blur-sm border-2 border-gray-200 focus:border-primary-400 transition-colors"
|
||||||
|
/>
|
||||||
|
<Sparkles className="absolute right-4 top-1/2 -translate-y-1/2 w-5 h-5 text-primary-500" />
|
||||||
|
</div>
|
||||||
|
</motion.div>
|
||||||
|
|
||||||
|
{/* Color Presets */}
|
||||||
|
<motion.div
|
||||||
|
initial={{ opacity: 0, y: 20 }}
|
||||||
|
animate={{ opacity: 1, y: 0 }}
|
||||||
|
transition={{ delay: 0.4, duration: 0.4 }}
|
||||||
|
>
|
||||||
|
<p className="text-center text-sm font-medium text-gray-600 mb-3">
|
||||||
|
Choose a style:
|
||||||
|
</p>
|
||||||
|
<div className="flex justify-center gap-2 flex-wrap">
|
||||||
|
{colorPresets.map((preset, index) => (
|
||||||
|
<motion.button
|
||||||
|
key={preset.name}
|
||||||
|
onClick={() => handlePresetClick(preset, index)}
|
||||||
|
className={`relative px-4 py-2 rounded-xl font-medium text-sm transition-all ${
|
||||||
|
selectedPreset === index
|
||||||
|
? 'bg-white shadow-md ring-2 ring-primary-500 ring-offset-2'
|
||||||
|
: 'bg-white/60 hover:bg-white hover:shadow-sm'
|
||||||
|
}`}
|
||||||
|
whileHover={{ scale: 1.05 }}
|
||||||
|
whileTap={{ scale: 0.95 }}
|
||||||
|
>
|
||||||
|
<div className="flex items-center gap-2">
|
||||||
|
<div
|
||||||
|
className="w-4 h-4 rounded-full border-2 border-gray-200"
|
||||||
|
style={{
|
||||||
|
background: `linear-gradient(135deg, ${preset.fg} 0%, ${preset.bg} 100%)`,
|
||||||
|
}}
|
||||||
|
/>
|
||||||
|
<span style={{ color: preset.fg }}>{preset.name}</span>
|
||||||
|
</div>
|
||||||
|
</motion.button>
|
||||||
|
))}
|
||||||
|
</div>
|
||||||
|
</motion.div>
|
||||||
|
</div>
|
||||||
|
</motion.div>
|
||||||
|
|
||||||
|
{/* Decorative floating elements */}
|
||||||
|
<motion.div
|
||||||
|
className="absolute -top-8 -left-8 w-16 h-16 bg-blue-400/20 rounded-full blur-xl"
|
||||||
|
animate={{
|
||||||
|
y: [-10, 10, -10],
|
||||||
|
scale: [1, 1.1, 1],
|
||||||
|
}}
|
||||||
|
transition={{
|
||||||
|
duration: 4,
|
||||||
|
repeat: Infinity,
|
||||||
|
ease: 'easeInOut',
|
||||||
|
}}
|
||||||
|
/>
|
||||||
|
<motion.div
|
||||||
|
className="absolute -bottom-8 -right-8 w-20 h-20 bg-purple-400/20 rounded-full blur-xl"
|
||||||
|
animate={{
|
||||||
|
y: [10, -10, 10],
|
||||||
|
scale: [1.1, 1, 1.1],
|
||||||
|
}}
|
||||||
|
transition={{
|
||||||
|
duration: 5,
|
||||||
|
repeat: Infinity,
|
||||||
|
ease: 'easeInOut',
|
||||||
|
}}
|
||||||
|
/>
|
||||||
|
</div>
|
||||||
|
);
|
||||||
|
};
|
||||||
@@ -2,29 +2,48 @@
|
|||||||
|
|
||||||
import React, { useState } from 'react';
|
import React, { useState } from 'react';
|
||||||
import { QRCodeSVG } from 'qrcode.react';
|
import { QRCodeSVG } from 'qrcode.react';
|
||||||
import { motion } from 'framer-motion';
|
import { motion, AnimatePresence } from 'framer-motion';
|
||||||
import { Card } from '@/components/ui/Card';
|
import { Card } from '@/components/ui/Card';
|
||||||
import { Input } from '@/components/ui/Input';
|
import { Input } from '@/components/ui/Input';
|
||||||
import { Button } from '@/components/ui/Button';
|
import { Button } from '@/components/ui/Button';
|
||||||
import { Badge } from '@/components/ui/Badge';
|
import { Badge } from '@/components/ui/Badge';
|
||||||
import { calculateContrast } from '@/lib/utils';
|
import { calculateContrast } from '@/lib/utils';
|
||||||
|
import { PresetGallery, qrPresets, type QRPreset } from './PresetGallery';
|
||||||
|
import { PhoneMockup } from './PhoneMockup';
|
||||||
|
import { Download, Smartphone, Palette, Settings2, Sparkles } from 'lucide-react';
|
||||||
|
|
||||||
interface InstantGeneratorProps {
|
interface InstantGeneratorProps {
|
||||||
t: any; // i18n translation function
|
t: any; // i18n translation function
|
||||||
}
|
}
|
||||||
|
|
||||||
|
type TabType = 'basic' | 'presets' | 'advanced';
|
||||||
|
|
||||||
export const InstantGenerator: React.FC<InstantGeneratorProps> = ({ t }) => {
|
export const InstantGenerator: React.FC<InstantGeneratorProps> = ({ t }) => {
|
||||||
const [url, setUrl] = useState('https://example.com');
|
const [activeTab, setActiveTab] = useState<TabType>('basic');
|
||||||
|
const [url, setUrl] = useState('https://qrmaster.net');
|
||||||
const [foregroundColor, setForegroundColor] = useState('#000000');
|
const [foregroundColor, setForegroundColor] = useState('#000000');
|
||||||
const [backgroundColor, setBackgroundColor] = useState('#FFFFFF');
|
const [backgroundColor, setBackgroundColor] = useState('#FFFFFF');
|
||||||
|
const [selectedPreset, setSelectedPreset] = useState('bold-1');
|
||||||
const [cornerStyle, setCornerStyle] = useState('square');
|
const [cornerStyle, setCornerStyle] = useState('square');
|
||||||
const [size, setSize] = useState(200);
|
const [size, setSize] = useState(256);
|
||||||
|
|
||||||
const contrast = calculateContrast(foregroundColor, backgroundColor);
|
const contrast = calculateContrast(foregroundColor, backgroundColor);
|
||||||
const hasGoodContrast = contrast >= 4.5;
|
const hasGoodContrast = contrast >= 4.5;
|
||||||
|
|
||||||
|
const tabs = [
|
||||||
|
{ id: 'basic' as TabType, label: 'Basic', icon: Sparkles },
|
||||||
|
{ id: 'presets' as TabType, label: 'Presets', icon: Palette },
|
||||||
|
{ id: 'advanced' as TabType, label: 'Advanced', icon: Settings2 },
|
||||||
|
];
|
||||||
|
|
||||||
|
const handlePresetSelect = (preset: QRPreset) => {
|
||||||
|
setForegroundColor(preset.fg);
|
||||||
|
setBackgroundColor(preset.bg);
|
||||||
|
setSelectedPreset(preset.id);
|
||||||
|
};
|
||||||
|
|
||||||
const downloadQR = (format: 'svg' | 'png') => {
|
const downloadQR = (format: 'svg' | 'png') => {
|
||||||
const svg = document.querySelector('#instant-qr-preview svg');
|
const svg = document.querySelector('#generator-qr-preview svg');
|
||||||
if (!svg || !url) return;
|
if (!svg || !url) return;
|
||||||
|
|
||||||
if (format === 'svg') {
|
if (format === 'svg') {
|
||||||
@@ -39,13 +58,12 @@ export const InstantGenerator: React.FC<InstantGeneratorProps> = ({ t }) => {
|
|||||||
document.body.removeChild(a);
|
document.body.removeChild(a);
|
||||||
URL.revokeObjectURL(downloadUrl);
|
URL.revokeObjectURL(downloadUrl);
|
||||||
} else {
|
} else {
|
||||||
// Convert SVG to PNG using Canvas
|
|
||||||
const canvas = document.createElement('canvas');
|
const canvas = document.createElement('canvas');
|
||||||
const ctx = canvas.getContext('2d');
|
const ctx = canvas.getContext('2d');
|
||||||
const img = new Image();
|
const img = new Image();
|
||||||
const svgData = new XMLSerializer().serializeToString(svg);
|
const svgData = new XMLSerializer().serializeToString(svg);
|
||||||
const blob = new Blob([svgData], { type: 'image/svg+xml' });
|
const blob = new Blob([svgData], { type: 'image/svg+xml' });
|
||||||
const url = URL.createObjectURL(blob);
|
const blobUrl = URL.createObjectURL(blob);
|
||||||
|
|
||||||
img.onload = () => {
|
img.onload = () => {
|
||||||
canvas.width = size;
|
canvas.width = size;
|
||||||
@@ -55,9 +73,9 @@ export const InstantGenerator: React.FC<InstantGeneratorProps> = ({ t }) => {
|
|||||||
ctx.fillRect(0, 0, size, size);
|
ctx.fillRect(0, 0, size, size);
|
||||||
ctx.drawImage(img, 0, 0, size, size);
|
ctx.drawImage(img, 0, 0, size, size);
|
||||||
}
|
}
|
||||||
canvas.toBlob((blob) => {
|
canvas.toBlob((canvasBlob) => {
|
||||||
if (blob) {
|
if (canvasBlob) {
|
||||||
const downloadUrl = URL.createObjectURL(blob);
|
const downloadUrl = URL.createObjectURL(canvasBlob);
|
||||||
const a = document.createElement('a');
|
const a = document.createElement('a');
|
||||||
a.href = downloadUrl;
|
a.href = downloadUrl;
|
||||||
a.download = 'qrcode.png';
|
a.download = 'qrcode.png';
|
||||||
@@ -67,19 +85,16 @@ export const InstantGenerator: React.FC<InstantGeneratorProps> = ({ t }) => {
|
|||||||
URL.revokeObjectURL(downloadUrl);
|
URL.revokeObjectURL(downloadUrl);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
URL.revokeObjectURL(url);
|
URL.revokeObjectURL(blobUrl);
|
||||||
};
|
};
|
||||||
img.src = url;
|
img.src = blobUrl;
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<section className="pt-16 pb-32 bg-gray-50 border-t border-gray-100 relative">
|
<section className="py-20 bg-gradient-to-b from-white to-gray-50">
|
||||||
<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="container mx-auto px-4 sm:px-6 lg:px-8 max-w-7xl">
|
||||||
|
{/* Section Header */}
|
||||||
<motion.div
|
<motion.div
|
||||||
initial={{ opacity: 0, y: 20 }}
|
initial={{ opacity: 0, y: 20 }}
|
||||||
whileInView={{ opacity: 1, y: 0 }}
|
whileInView={{ opacity: 1, y: 0 }}
|
||||||
@@ -87,83 +102,141 @@ export const InstantGenerator: React.FC<InstantGeneratorProps> = ({ t }) => {
|
|||||||
transition={{ duration: 0.5 }}
|
transition={{ duration: 0.5 }}
|
||||||
className="text-center mb-12"
|
className="text-center mb-12"
|
||||||
>
|
>
|
||||||
<h2 className="text-3xl lg:text-4xl font-bold text-gray-900 mb-4">
|
<Badge variant="info" className="mb-4">
|
||||||
|
<Sparkles className="w-4 h-4 mr-2" />
|
||||||
|
Try It Now
|
||||||
|
</Badge>
|
||||||
|
<h2 className="text-4xl lg:text-5xl font-bold text-gray-900 mb-4">
|
||||||
{t.generator.title}
|
{t.generator.title}
|
||||||
</h2>
|
</h2>
|
||||||
|
<p className="text-xl text-gray-600 max-w-2xl mx-auto">
|
||||||
|
Create and customize your QR code in seconds. No signup required.
|
||||||
|
</p>
|
||||||
</motion.div>
|
</motion.div>
|
||||||
|
|
||||||
<div className="grid lg:grid-cols-2 gap-12 max-w-6xl mx-auto">
|
<div className="grid lg:grid-cols-2 gap-8 lg:gap-12 max-w-6xl mx-auto">
|
||||||
{/* Left Form */}
|
{/* Left: Controls */}
|
||||||
<motion.div
|
<motion.div
|
||||||
initial={{ opacity: 0, x: -20 }}
|
initial={{ opacity: 0, x: -20 }}
|
||||||
whileInView={{ opacity: 1, x: 0 }}
|
whileInView={{ opacity: 1, x: 0 }}
|
||||||
viewport={{ once: true }}
|
viewport={{ once: true }}
|
||||||
transition={{ duration: 0.5, delay: 0.2 }}
|
transition={{ duration: 0.5, delay: 0.2 }}
|
||||||
>
|
>
|
||||||
<Card className="space-y-6 shadow-xl shadow-gray-200/50 border-gray-100">
|
<Card className="shadow-elevation-3 border-gray-100">
|
||||||
|
{/* Tab Navigation */}
|
||||||
|
<div className="flex gap-2 mb-6 p-1 bg-gray-100 rounded-xl">
|
||||||
|
{tabs.map((tab) => (
|
||||||
|
<button
|
||||||
|
key={tab.id}
|
||||||
|
onClick={() => setActiveTab(tab.id)}
|
||||||
|
className={`flex-1 flex items-center justify-center gap-2 px-4 py-3 rounded-lg font-medium text-sm transition-all ${
|
||||||
|
activeTab === tab.id
|
||||||
|
? 'bg-white text-primary-600 shadow-sm'
|
||||||
|
: 'text-gray-600 hover:text-gray-900'
|
||||||
|
}`}
|
||||||
|
>
|
||||||
|
<tab.icon className="w-4 h-4" />
|
||||||
|
{tab.label}
|
||||||
|
</button>
|
||||||
|
))}
|
||||||
|
</div>
|
||||||
|
|
||||||
|
{/* Tab Content */}
|
||||||
|
<AnimatePresence mode="wait">
|
||||||
|
<motion.div
|
||||||
|
key={activeTab}
|
||||||
|
initial={{ opacity: 0, y: 10 }}
|
||||||
|
animate={{ opacity: 1, y: 0 }}
|
||||||
|
exit={{ opacity: 0, y: -10 }}
|
||||||
|
transition={{ duration: 0.2 }}
|
||||||
|
className="space-y-6"
|
||||||
|
>
|
||||||
|
{/* Basic Tab */}
|
||||||
|
{activeTab === 'basic' && (
|
||||||
|
<>
|
||||||
<Input
|
<Input
|
||||||
label="URL"
|
label="Your URL"
|
||||||
value={url}
|
value={url}
|
||||||
onChange={(e) => setUrl(e.target.value)}
|
onChange={(e) => setUrl(e.target.value)}
|
||||||
placeholder={t.generator.url_placeholder}
|
placeholder="https://your-website.com"
|
||||||
className="transition-all focus:ring-2 focus:ring-primary-500/20"
|
|
||||||
/>
|
/>
|
||||||
|
|
||||||
<div className="grid grid-cols-2 gap-4">
|
<div className="grid grid-cols-2 gap-4">
|
||||||
<div>
|
<div>
|
||||||
<label htmlFor="foreground-color" className="block text-sm font-medium text-gray-700 mb-2">
|
<label className="block text-sm font-medium text-gray-700 mb-2">
|
||||||
{t.generator.foreground}
|
Foreground
|
||||||
</label>
|
</label>
|
||||||
<div className="flex items-center space-x-2">
|
<div className="flex items-center space-x-2">
|
||||||
<input
|
<input
|
||||||
id="foreground-color"
|
|
||||||
type="color"
|
type="color"
|
||||||
value={foregroundColor}
|
value={foregroundColor}
|
||||||
onChange={(e) => setForegroundColor(e.target.value)}
|
onChange={(e) => setForegroundColor(e.target.value)}
|
||||||
className="w-14 h-12 rounded border border-gray-300 cursor-pointer"
|
className="w-14 h-12 rounded-lg border border-gray-300 cursor-pointer"
|
||||||
aria-label="Foreground color picker"
|
|
||||||
/>
|
/>
|
||||||
<Input
|
<Input
|
||||||
id="foreground-color-text"
|
|
||||||
value={foregroundColor}
|
value={foregroundColor}
|
||||||
onChange={(e) => setForegroundColor(e.target.value)}
|
onChange={(e) => setForegroundColor(e.target.value)}
|
||||||
className="flex-1"
|
className="flex-1 font-mono text-sm"
|
||||||
aria-label="Foreground color hex value"
|
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div>
|
<div>
|
||||||
<label htmlFor="background-color" className="block text-sm font-medium text-gray-700 mb-2">
|
<label className="block text-sm font-medium text-gray-700 mb-2">
|
||||||
{t.generator.background}
|
Background
|
||||||
</label>
|
</label>
|
||||||
<div className="flex items-center space-x-2">
|
<div className="flex items-center space-x-2">
|
||||||
<input
|
<input
|
||||||
id="background-color"
|
|
||||||
type="color"
|
type="color"
|
||||||
value={backgroundColor}
|
value={backgroundColor}
|
||||||
onChange={(e) => setBackgroundColor(e.target.value)}
|
onChange={(e) => setBackgroundColor(e.target.value)}
|
||||||
className="w-14 h-12 rounded border border-gray-300 cursor-pointer"
|
className="w-14 h-12 rounded-lg border border-gray-300 cursor-pointer"
|
||||||
aria-label="Background color picker"
|
|
||||||
/>
|
/>
|
||||||
<Input
|
<Input
|
||||||
id="background-color-text"
|
|
||||||
value={backgroundColor}
|
value={backgroundColor}
|
||||||
onChange={(e) => setBackgroundColor(e.target.value)}
|
onChange={(e) => setBackgroundColor(e.target.value)}
|
||||||
className="flex-1"
|
className="flex-1 font-mono text-sm"
|
||||||
aria-label="Background color hex value"
|
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div className="grid grid-cols-2 gap-4">
|
<div className="flex items-center justify-between pt-2">
|
||||||
|
<Badge variant={hasGoodContrast ? 'success' : 'warning'}>
|
||||||
|
{hasGoodContrast ? '✓ Good contrast' : '⚠ Low contrast'}
|
||||||
|
</Badge>
|
||||||
|
<span className="text-sm text-gray-500">
|
||||||
|
Ratio: {contrast.toFixed(1)}:1
|
||||||
|
</span>
|
||||||
|
</div>
|
||||||
|
</>
|
||||||
|
)}
|
||||||
|
|
||||||
|
{/* Presets Tab */}
|
||||||
|
{activeTab === 'presets' && (
|
||||||
|
<>
|
||||||
|
<Input
|
||||||
|
label="Your URL"
|
||||||
|
value={url}
|
||||||
|
onChange={(e) => setUrl(e.target.value)}
|
||||||
|
placeholder="https://your-website.com"
|
||||||
|
/>
|
||||||
|
<PresetGallery
|
||||||
|
selectedPreset={selectedPreset}
|
||||||
|
onPresetSelect={handlePresetSelect}
|
||||||
|
url={url}
|
||||||
|
/>
|
||||||
|
</>
|
||||||
|
)}
|
||||||
|
|
||||||
|
{/* Advanced Tab */}
|
||||||
|
{activeTab === 'advanced' && (
|
||||||
|
<>
|
||||||
<div>
|
<div>
|
||||||
<label htmlFor="corner-style" className="block text-sm font-medium text-gray-700 mb-2">
|
<label className="block text-sm font-medium text-gray-700 mb-2">
|
||||||
{t.generator.corners}
|
Corner Style
|
||||||
</label>
|
</label>
|
||||||
<select
|
<select
|
||||||
id="corner-style"
|
|
||||||
value={cornerStyle}
|
value={cornerStyle}
|
||||||
onChange={(e) => setCornerStyle(e.target.value)}
|
onChange={(e) => setCornerStyle(e.target.value)}
|
||||||
className="w-full px-3 py-2 border border-gray-300 rounded-lg focus:outline-none focus:ring-2 focus:ring-primary-500"
|
className="w-full px-3 py-2 border border-gray-300 rounded-lg focus:outline-none focus:ring-2 focus:ring-primary-500"
|
||||||
@@ -174,106 +247,98 @@ export const InstantGenerator: React.FC<InstantGeneratorProps> = ({ t }) => {
|
|||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div>
|
<div>
|
||||||
<label htmlFor="qr-size" className="block text-sm font-medium text-gray-700 mb-2">
|
<label className="block text-sm font-medium text-gray-700 mb-2">
|
||||||
{t.generator.size}
|
Size: {size}px
|
||||||
</label>
|
</label>
|
||||||
<input
|
<input
|
||||||
id="qr-size"
|
|
||||||
type="range"
|
type="range"
|
||||||
min="100"
|
min="128"
|
||||||
max="400"
|
max="512"
|
||||||
|
step="32"
|
||||||
value={size}
|
value={size}
|
||||||
onChange={(e) => setSize(Number(e.target.value))}
|
onChange={(e) => setSize(Number(e.target.value))}
|
||||||
className="w-full accent-primary-600"
|
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>
|
<div className="flex justify-between text-xs text-gray-500 mt-1">
|
||||||
|
<span>128px</span>
|
||||||
|
<span>512px</span>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div className="flex items-center justify-between">
|
<div className="p-4 bg-blue-50 rounded-lg border border-blue-100">
|
||||||
<Badge variant={hasGoodContrast ? 'success' : 'warning'}>
|
<p className="text-sm text-blue-900">
|
||||||
{hasGoodContrast ? t.generator.contrast_good : 'Low contrast'}
|
<strong>Pro Tip:</strong> Higher resolution is better for print materials. For digital use, 256px is usually sufficient.
|
||||||
</Badge>
|
</p>
|
||||||
<div className="text-sm text-gray-500">
|
|
||||||
Contrast: {contrast.toFixed(1)}:1
|
|
||||||
</div>
|
|
||||||
</div>
|
</div>
|
||||||
|
</>
|
||||||
|
)}
|
||||||
|
</motion.div>
|
||||||
|
</AnimatePresence>
|
||||||
|
|
||||||
<div className="flex space-x-3">
|
{/* Download Actions */}
|
||||||
<Button variant="outline" className="flex-1 hover:bg-gray-50" onClick={() => downloadQR('svg')}>
|
<div className="mt-8 pt-6 border-t border-gray-100 space-y-3">
|
||||||
{t.generator.download_svg}
|
<div className="grid grid-cols-2 gap-3">
|
||||||
|
<Button
|
||||||
|
variant="outline"
|
||||||
|
onClick={() => downloadQR('svg')}
|
||||||
|
className="hover:bg-gray-50"
|
||||||
|
>
|
||||||
|
<Download className="w-4 h-4 mr-2" />
|
||||||
|
SVG
|
||||||
</Button>
|
</Button>
|
||||||
<Button variant="outline" className="flex-1 hover:bg-gray-50" onClick={() => downloadQR('png')}>
|
<Button
|
||||||
{t.generator.download_png}
|
variant="outline"
|
||||||
|
onClick={() => downloadQR('png')}
|
||||||
|
className="hover:bg-gray-50"
|
||||||
|
>
|
||||||
|
<Download className="w-4 h-4 mr-2" />
|
||||||
|
PNG
|
||||||
</Button>
|
</Button>
|
||||||
</div>
|
</div>
|
||||||
|
<Button
|
||||||
<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'}>
|
className="w-full shadow-primary-md hover:shadow-primary-lg transition-all"
|
||||||
{t.generator.save_track}
|
onClick={() => window.location.href = '/signup'}
|
||||||
|
>
|
||||||
|
<Sparkles className="w-4 h-4 mr-2" />
|
||||||
|
Save & Track Analytics
|
||||||
</Button>
|
</Button>
|
||||||
|
</div>
|
||||||
</Card>
|
</Card>
|
||||||
</motion.div>
|
</motion.div>
|
||||||
|
|
||||||
{/* Right Preview */}
|
{/* Right: Preview */}
|
||||||
<motion.div
|
<motion.div
|
||||||
initial={{ opacity: 0, x: 20 }}
|
initial={{ opacity: 0, x: 20 }}
|
||||||
whileInView={{ opacity: 1, x: 0 }}
|
whileInView={{ opacity: 1, x: 0 }}
|
||||||
viewport={{ once: true }}
|
viewport={{ once: true }}
|
||||||
transition={{ duration: 0.5, delay: 0.4 }}
|
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"
|
className="space-y-8"
|
||||||
|
>
|
||||||
|
{/* Large QR Preview */}
|
||||||
|
<div className="flex justify-center">
|
||||||
|
<div id="generator-qr-preview" className="relative group">
|
||||||
|
<div
|
||||||
|
className={`p-8 bg-white rounded-3xl shadow-elevation-3 border-2 border-gray-100 transition-all duration-300 group-hover:shadow-elevation-4 group-hover:scale-105 ${
|
||||||
|
cornerStyle === 'rounded' ? 'overflow-hidden' : ''
|
||||||
|
}`}
|
||||||
>
|
>
|
||||||
{/* 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' : ''} p-4 bg-white shadow-lg rounded-xl`}>
|
|
||||||
<QRCodeSVG
|
<QRCodeSVG
|
||||||
value={url}
|
value={url}
|
||||||
size={size}
|
size={size}
|
||||||
fgColor={foregroundColor}
|
fgColor={foregroundColor}
|
||||||
bgColor={backgroundColor}
|
bgColor={backgroundColor}
|
||||||
level="M"
|
level="H"
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
) : (
|
|
||||||
<div
|
|
||||||
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>
|
|
||||||
<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>
|
</div>
|
||||||
|
|
||||||
|
{/* Phone Mockup Preview */}
|
||||||
|
<PhoneMockup
|
||||||
|
url={url}
|
||||||
|
foreground={foregroundColor}
|
||||||
|
background={backgroundColor}
|
||||||
|
/>
|
||||||
</motion.div>
|
</motion.div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
184
src/components/marketing/PhoneMockup.tsx
Normal file
@@ -0,0 +1,184 @@
|
|||||||
|
'use client';
|
||||||
|
|
||||||
|
import React, { useEffect, useState } from 'react';
|
||||||
|
import { motion, AnimatePresence } from 'framer-motion';
|
||||||
|
import { QRCodeSVG } from 'qrcode.react';
|
||||||
|
import { Wifi, Battery, Signal } from 'lucide-react';
|
||||||
|
import { qrTypes } from './QRTypesShowcase';
|
||||||
|
|
||||||
|
interface PhoneMockupProps {
|
||||||
|
url?: string;
|
||||||
|
foreground?: string;
|
||||||
|
background?: string;
|
||||||
|
autoRotate?: boolean;
|
||||||
|
}
|
||||||
|
|
||||||
|
export const PhoneMockup: React.FC<PhoneMockupProps> = ({
|
||||||
|
url,
|
||||||
|
foreground = '#000000',
|
||||||
|
background = '#FFFFFF',
|
||||||
|
autoRotate = false,
|
||||||
|
}) => {
|
||||||
|
const [currentTypeIndex, setCurrentTypeIndex] = useState(0);
|
||||||
|
const [isScanning, setIsScanning] = useState(false);
|
||||||
|
const [showResult, setShowResult] = useState(false);
|
||||||
|
|
||||||
|
const currentType = autoRotate ? qrTypes[currentTypeIndex] : null;
|
||||||
|
const displayUrl = url || (currentType ? currentType.data : 'https://qrmaster.net');
|
||||||
|
const displayName = currentType ? currentType.name : 'QR Master';
|
||||||
|
|
||||||
|
// Auto-rotate through QR types
|
||||||
|
useEffect(() => {
|
||||||
|
if (!autoRotate) return;
|
||||||
|
|
||||||
|
const interval = setInterval(() => {
|
||||||
|
setCurrentTypeIndex((prev) => (prev + 1) % qrTypes.length);
|
||||||
|
|
||||||
|
// Trigger scan animation
|
||||||
|
setIsScanning(true);
|
||||||
|
setTimeout(() => {
|
||||||
|
setIsScanning(false);
|
||||||
|
setShowResult(true);
|
||||||
|
setTimeout(() => {
|
||||||
|
setShowResult(false);
|
||||||
|
}, 2000);
|
||||||
|
}, 1000);
|
||||||
|
}, 5000);
|
||||||
|
|
||||||
|
return () => clearInterval(interval);
|
||||||
|
}, [autoRotate]);
|
||||||
|
|
||||||
|
const getDomain = (urlString: string) => {
|
||||||
|
try {
|
||||||
|
if (urlString.startsWith('http')) {
|
||||||
|
const urlObj = new URL(urlString);
|
||||||
|
return urlObj.hostname.replace('www.', '');
|
||||||
|
}
|
||||||
|
return urlString.substring(0, 20);
|
||||||
|
} catch {
|
||||||
|
return 'qrmaster.net';
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
return (
|
||||||
|
<div className="relative w-full max-w-[280px] mx-auto">
|
||||||
|
{/* Phone Frame */}
|
||||||
|
<div className="relative">
|
||||||
|
{/* Phone outline */}
|
||||||
|
<div className="relative bg-gray-900 rounded-[2.5rem] p-2.5 shadow-2xl">
|
||||||
|
{/* Screen */}
|
||||||
|
<div className="relative bg-white rounded-[2rem] overflow-hidden aspect-[9/19.5]">
|
||||||
|
{/* Status Bar */}
|
||||||
|
<div className="absolute top-0 left-0 right-0 z-20 px-6 pt-2 pb-1 bg-gradient-to-b from-black/5 to-transparent">
|
||||||
|
<div className="flex justify-between items-center">
|
||||||
|
<span className="text-xs font-semibold">9:41</span>
|
||||||
|
<div className="flex items-center gap-1">
|
||||||
|
<Signal className="w-3 h-3" />
|
||||||
|
<Wifi className="w-3 h-3" />
|
||||||
|
<Battery className="w-3 h-3" />
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
{/* Camera Notch */}
|
||||||
|
<div className="absolute top-0 left-1/2 -translate-x-1/2 w-20 h-5 bg-gray-900 rounded-b-2xl z-30" />
|
||||||
|
|
||||||
|
{/* Screen Content */}
|
||||||
|
<div className="relative h-full bg-gray-50 pt-8">
|
||||||
|
<div className="px-4 h-full flex flex-col">
|
||||||
|
{/* Camera App Header */}
|
||||||
|
<div className="text-center mb-3">
|
||||||
|
<h3 className="font-semibold text-gray-900 text-sm">QR Scanner</h3>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
{/* QR Code Display Area */}
|
||||||
|
<div className="flex-1 flex items-center justify-center relative">
|
||||||
|
<AnimatePresence mode="wait">
|
||||||
|
<motion.div
|
||||||
|
key={autoRotate ? currentTypeIndex : displayUrl}
|
||||||
|
initial={{ scale: 0.8, opacity: 0 }}
|
||||||
|
animate={{ scale: isScanning ? 0.95 : 1, opacity: 1 }}
|
||||||
|
exit={{ scale: 0.8, opacity: 0 }}
|
||||||
|
transition={{ duration: 0.3 }}
|
||||||
|
className="relative"
|
||||||
|
>
|
||||||
|
<div className="p-3 bg-white rounded-xl shadow-lg">
|
||||||
|
<QRCodeSVG
|
||||||
|
value={displayUrl}
|
||||||
|
size={120}
|
||||||
|
fgColor={foreground}
|
||||||
|
bgColor={background}
|
||||||
|
level="M"
|
||||||
|
/>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
{/* Scan Overlay */}
|
||||||
|
<AnimatePresence>
|
||||||
|
{isScanning && (
|
||||||
|
<motion.div
|
||||||
|
initial={{ y: -80, opacity: 0 }}
|
||||||
|
animate={{ y: 0, opacity: 1 }}
|
||||||
|
exit={{ y: 80, opacity: 0 }}
|
||||||
|
transition={{ duration: 0.8, ease: 'linear' }}
|
||||||
|
className="absolute inset-0 flex items-center justify-center"
|
||||||
|
>
|
||||||
|
<div className="w-full h-0.5 bg-gradient-to-r from-transparent via-primary-500 to-transparent shadow-lg" />
|
||||||
|
</motion.div>
|
||||||
|
)}
|
||||||
|
</AnimatePresence>
|
||||||
|
|
||||||
|
{/* Corner Brackets */}
|
||||||
|
<div className="absolute top-1 left-1 w-5 h-5 border-t-2 border-l-2 border-primary-500 rounded-tl-lg" />
|
||||||
|
<div className="absolute top-1 right-1 w-5 h-5 border-t-2 border-r-2 border-primary-500 rounded-tr-lg" />
|
||||||
|
<div className="absolute bottom-1 left-1 w-5 h-5 border-b-2 border-l-2 border-primary-500 rounded-bl-lg" />
|
||||||
|
<div className="absolute bottom-1 right-1 w-5 h-5 border-b-2 border-r-2 border-primary-500 rounded-br-lg" />
|
||||||
|
</motion.div>
|
||||||
|
</AnimatePresence>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
{/* Result Notification */}
|
||||||
|
<AnimatePresence>
|
||||||
|
{showResult && (
|
||||||
|
<motion.div
|
||||||
|
initial={{ y: 100, opacity: 0 }}
|
||||||
|
animate={{ y: 0, opacity: 1 }}
|
||||||
|
exit={{ y: 100, opacity: 0 }}
|
||||||
|
className="mb-3 p-3 bg-white rounded-xl shadow-lg border border-gray-100"
|
||||||
|
>
|
||||||
|
<div className="flex items-center gap-2">
|
||||||
|
<div className="flex-shrink-0 w-8 h-8 bg-success-100 rounded-full flex items-center justify-center">
|
||||||
|
<svg className="w-5 h-5 text-success-600" 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>
|
||||||
|
<div className="flex-1 min-w-0">
|
||||||
|
<p className="text-xs font-semibold text-gray-900">{displayName}</p>
|
||||||
|
<p className="text-[10px] text-gray-500 truncate">{getDomain(displayUrl)}</p>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</motion.div>
|
||||||
|
)}
|
||||||
|
</AnimatePresence>
|
||||||
|
|
||||||
|
{/* Instruction Text */}
|
||||||
|
<div className="text-center pb-4">
|
||||||
|
<p className="text-[10px] text-gray-500">
|
||||||
|
{isScanning ? 'Scanning...' : autoRotate ? 'Auto-scanning demo' : 'Point camera at QR code'}
|
||||||
|
</p>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
{/* Side buttons */}
|
||||||
|
<div className="absolute right-0 top-16 w-0.5 h-10 bg-gray-800 rounded-r" />
|
||||||
|
<div className="absolute right-0 top-28 w-0.5 h-6 bg-gray-800 rounded-r" />
|
||||||
|
<div className="absolute left-0 top-20 w-0.5 h-12 bg-gray-800 rounded-l" />
|
||||||
|
</div>
|
||||||
|
|
||||||
|
{/* Phone Shadow */}
|
||||||
|
<div className="absolute inset-0 bg-gradient-to-br from-black/20 to-black/40 rounded-[2.5rem] -z-10 blur-xl translate-y-3" />
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
);
|
||||||
|
};
|
||||||
135
src/components/marketing/PresetGallery.tsx
Normal file
@@ -0,0 +1,135 @@
|
|||||||
|
'use client';
|
||||||
|
|
||||||
|
import React from 'react';
|
||||||
|
import { motion } from 'framer-motion';
|
||||||
|
import { QRCodeSVG } from 'qrcode.react';
|
||||||
|
|
||||||
|
export interface QRPreset {
|
||||||
|
id: string;
|
||||||
|
name: string;
|
||||||
|
category: 'bold' | 'minimal' | 'gradient' | 'brand';
|
||||||
|
fg: string;
|
||||||
|
bg: string;
|
||||||
|
description?: string;
|
||||||
|
}
|
||||||
|
|
||||||
|
export const qrPresets: QRPreset[] = [
|
||||||
|
// Bold
|
||||||
|
{ id: 'bold-1', name: 'Classic Black', category: 'bold', fg: '#000000', bg: '#FFFFFF', description: 'Timeless professional' },
|
||||||
|
{ id: 'bold-2', name: 'Deep Ocean', category: 'bold', fg: '#0369a1', bg: '#e0f2fe', description: 'Trust and reliability' },
|
||||||
|
{ id: 'bold-3', name: 'Forest Green', category: 'bold', fg: '#047857', bg: '#d1fae5', description: 'Growth and nature' },
|
||||||
|
{ id: 'bold-4', name: 'Royal Purple', category: 'bold', fg: '#7c3aed', bg: '#f3e8ff', description: 'Premium and luxury' },
|
||||||
|
|
||||||
|
// Minimal
|
||||||
|
{ id: 'minimal-1', name: 'Soft Gray', category: 'minimal', fg: '#6b7280', bg: '#f9fafb', description: 'Subtle elegance' },
|
||||||
|
{ id: 'minimal-2', name: 'Gentle Blue', category: 'minimal', fg: '#60a5fa', bg: '#eff6ff', description: 'Calm and clean' },
|
||||||
|
{ id: 'minimal-3', name: 'Muted Green', category: 'minimal', fg: '#34d399', bg: '#ecfdf5', description: 'Fresh and light' },
|
||||||
|
{ id: 'minimal-4', name: 'Soft Pink', category: 'minimal', fg: '#f472b6', bg: '#fdf2f8', description: 'Friendly warmth' },
|
||||||
|
|
||||||
|
// Gradient-inspired
|
||||||
|
{ id: 'gradient-1', name: 'Sunset', category: 'gradient', fg: '#f59e0b', bg: '#fef3c7', description: 'Warm energy' },
|
||||||
|
{ id: 'gradient-2', name: 'Cotton Candy', category: 'gradient', fg: '#ec4899', bg: '#fce7f3', description: 'Playful fun' },
|
||||||
|
{ id: 'gradient-3', name: 'Sky Blue', category: 'gradient', fg: '#0ea5e9', bg: '#e0f2fe', description: 'Open freedom' },
|
||||||
|
{ id: 'gradient-4', name: 'Mint Fresh', category: 'gradient', fg: '#14b8a6', bg: '#ccfbf1', description: 'Modern clean' },
|
||||||
|
];
|
||||||
|
|
||||||
|
interface PresetGalleryProps {
|
||||||
|
selectedPreset: string;
|
||||||
|
onPresetSelect: (preset: QRPreset) => void;
|
||||||
|
url: string;
|
||||||
|
}
|
||||||
|
|
||||||
|
export const PresetGallery: React.FC<PresetGalleryProps> = ({
|
||||||
|
selectedPreset,
|
||||||
|
onPresetSelect,
|
||||||
|
url,
|
||||||
|
}) => {
|
||||||
|
const [activeCategory, setActiveCategory] = React.useState<string>('all');
|
||||||
|
|
||||||
|
const categories = ['all', 'bold', 'minimal', 'gradient'] as const;
|
||||||
|
|
||||||
|
const filteredPresets = activeCategory === 'all'
|
||||||
|
? qrPresets
|
||||||
|
: qrPresets.filter(p => p.category === activeCategory);
|
||||||
|
|
||||||
|
return (
|
||||||
|
<div className="space-y-6">
|
||||||
|
{/* Category Filter */}
|
||||||
|
<div className="flex gap-2 flex-wrap">
|
||||||
|
{categories.map((cat) => (
|
||||||
|
<button
|
||||||
|
key={cat}
|
||||||
|
onClick={() => setActiveCategory(cat)}
|
||||||
|
className={`px-4 py-2 rounded-lg font-medium text-sm transition-all capitalize ${
|
||||||
|
activeCategory === cat
|
||||||
|
? 'bg-primary-600 text-white shadow-md'
|
||||||
|
: 'bg-gray-100 text-gray-700 hover:bg-gray-200'
|
||||||
|
}`}
|
||||||
|
>
|
||||||
|
{cat}
|
||||||
|
</button>
|
||||||
|
))}
|
||||||
|
</div>
|
||||||
|
|
||||||
|
{/* Preset Grid */}
|
||||||
|
<div className="grid grid-cols-2 md:grid-cols-4 gap-4">
|
||||||
|
{filteredPresets.map((preset, index) => (
|
||||||
|
<motion.button
|
||||||
|
key={preset.id}
|
||||||
|
onClick={() => onPresetSelect(preset)}
|
||||||
|
initial={{ opacity: 0, scale: 0.9 }}
|
||||||
|
animate={{ opacity: 1, scale: 1 }}
|
||||||
|
transition={{ delay: index * 0.05, duration: 0.3 }}
|
||||||
|
className={`group relative p-4 rounded-xl border-2 transition-all ${
|
||||||
|
selectedPreset === preset.id
|
||||||
|
? 'border-primary-500 bg-primary-50 shadow-md'
|
||||||
|
: 'border-gray-200 bg-white hover:border-primary-300 hover:shadow-sm'
|
||||||
|
}`}
|
||||||
|
>
|
||||||
|
{/* Mini QR Preview */}
|
||||||
|
<div className="flex justify-center mb-3">
|
||||||
|
<div
|
||||||
|
className="p-2 rounded-lg transition-transform group-hover:scale-105"
|
||||||
|
style={{ backgroundColor: preset.bg }}
|
||||||
|
>
|
||||||
|
<QRCodeSVG
|
||||||
|
value={url || 'https://qrmaster.net'}
|
||||||
|
size={64}
|
||||||
|
fgColor={preset.fg}
|
||||||
|
bgColor={preset.bg}
|
||||||
|
level="M"
|
||||||
|
/>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
{/* Preset Info */}
|
||||||
|
<div className="text-center">
|
||||||
|
<p className="font-semibold text-sm text-gray-900 mb-1">
|
||||||
|
{preset.name}
|
||||||
|
</p>
|
||||||
|
<p className="text-xs text-gray-500 line-clamp-1">
|
||||||
|
{preset.description}
|
||||||
|
</p>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
{/* Selected Indicator */}
|
||||||
|
{selectedPreset === preset.id && (
|
||||||
|
<motion.div
|
||||||
|
initial={{ scale: 0 }}
|
||||||
|
animate={{ scale: 1 }}
|
||||||
|
className="absolute top-2 right-2 w-6 h-6 bg-primary-600 rounded-full flex items-center justify-center"
|
||||||
|
>
|
||||||
|
<svg className="w-4 h-4 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>
|
||||||
|
</motion.div>
|
||||||
|
)}
|
||||||
|
|
||||||
|
{/* Hover Glow */}
|
||||||
|
<div className="absolute inset-0 rounded-xl bg-gradient-primary opacity-0 group-hover:opacity-5 transition-opacity pointer-events-none" />
|
||||||
|
</motion.button>
|
||||||
|
))}
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
);
|
||||||
|
};
|
||||||
@@ -31,19 +31,19 @@ export const Pricing: React.FC<PricingProps> = ({ t }) => {
|
|||||||
];
|
];
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<section id="pricing" className="py-16">
|
<section id="pricing" className="py-20 bg-gradient-to-b from-gray-50 to-white">
|
||||||
<div className="container mx-auto px-4 sm:px-6 lg:px-8 max-w-7xl">
|
<div className="container mx-auto px-4 sm:px-6 lg:px-8 max-w-7xl">
|
||||||
<motion.div
|
<motion.div
|
||||||
initial={{ opacity: 0, y: 20 }}
|
initial={{ opacity: 0, y: 20 }}
|
||||||
whileInView={{ opacity: 1, y: 0 }}
|
whileInView={{ opacity: 1, y: 0 }}
|
||||||
viewport={{ once: true }}
|
viewport={{ once: true }}
|
||||||
transition={{ duration: 0.5 }}
|
transition={{ duration: 0.5 }}
|
||||||
className="text-center mb-12"
|
className="text-center mb-16"
|
||||||
>
|
>
|
||||||
<h2 className="text-3xl lg:text-4xl font-bold text-gray-900 mb-4">
|
<h2 className="text-4xl lg:text-5xl font-bold text-gray-900 mb-4">
|
||||||
{t.pricing.title}
|
{t.pricing.title}
|
||||||
</h2>
|
</h2>
|
||||||
<p className="text-xl text-gray-600">
|
<p className="text-xl text-gray-600 max-w-2xl mx-auto">
|
||||||
{t.pricing.subtitle}
|
{t.pricing.subtitle}
|
||||||
</p>
|
</p>
|
||||||
</motion.div>
|
</motion.div>
|
||||||
@@ -63,11 +63,15 @@ export const Pricing: React.FC<PricingProps> = ({ t }) => {
|
|||||||
className="h-full"
|
className="h-full"
|
||||||
>
|
>
|
||||||
<Card
|
<Card
|
||||||
className={`h-full flex flex-col ${plan.popular
|
className={`h-full flex flex-col relative overflow-hidden ${plan.popular
|
||||||
? 'border-primary-500 shadow-xl relative scale-105 z-10'
|
? 'border-primary-500 shadow-primary-lg scale-105 z-10 bg-gradient-to-br from-white to-blue-50'
|
||||||
: 'border-gray-200 hover:border-gray-300 hover:shadow-lg transition-all'
|
: 'border-gray-200 hover:border-primary-200 hover:shadow-elevation-3 transition-all'
|
||||||
}`}
|
}`}
|
||||||
>
|
>
|
||||||
|
{/* Gradient overlay for popular */}
|
||||||
|
{plan.popular && (
|
||||||
|
<div className="absolute top-0 right-0 w-32 h-32 bg-gradient-primary-vibrant opacity-5 blur-3xl" />
|
||||||
|
)}
|
||||||
{plan.popular && (
|
{plan.popular && (
|
||||||
<div className="absolute -top-4 left-1/2 transform -translate-x-1/2 w-full text-center">
|
<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">
|
<Badge variant="info" className="px-4 py-1.5 shadow-sm">
|
||||||
|
|||||||
143
src/components/marketing/QRTypesShowcase.tsx
Normal file
@@ -0,0 +1,143 @@
|
|||||||
|
'use client';
|
||||||
|
|
||||||
|
import React from 'react';
|
||||||
|
import { QRCodeSVG } from 'qrcode.react';
|
||||||
|
import { motion } from 'framer-motion';
|
||||||
|
import { Globe, User, Wifi, Mail, MessageSquare, Phone, MapPin, Calendar, FileText } from 'lucide-react';
|
||||||
|
|
||||||
|
export interface QRType {
|
||||||
|
id: string;
|
||||||
|
name: string;
|
||||||
|
icon: React.ComponentType<{ className?: string }>;
|
||||||
|
data: string;
|
||||||
|
color: string;
|
||||||
|
}
|
||||||
|
|
||||||
|
const qrTypes: QRType[] = [
|
||||||
|
{
|
||||||
|
id: 'url',
|
||||||
|
name: 'URL/Website',
|
||||||
|
icon: Globe,
|
||||||
|
data: 'https://qrmaster.net',
|
||||||
|
color: 'text-blue-600 bg-blue-50'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
id: 'vcard',
|
||||||
|
name: 'vCard',
|
||||||
|
icon: User,
|
||||||
|
data: 'BEGIN:VCARD\nVERSION:3.0\nFN:John Doe\nEND:VCARD',
|
||||||
|
color: 'text-purple-600 bg-purple-50'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
id: 'wifi',
|
||||||
|
name: 'WiFi',
|
||||||
|
icon: Wifi,
|
||||||
|
data: 'WIFI:T:WPA;S:MyNetwork;P:password;;',
|
||||||
|
color: 'text-cyan-600 bg-cyan-50'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
id: 'email',
|
||||||
|
name: 'Email',
|
||||||
|
icon: Mail,
|
||||||
|
data: 'mailto:hello@qrmaster.net',
|
||||||
|
color: 'text-red-600 bg-red-50'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
id: 'sms',
|
||||||
|
name: 'SMS',
|
||||||
|
icon: MessageSquare,
|
||||||
|
data: 'SMSTO:+1234567890:Hello!',
|
||||||
|
color: 'text-green-600 bg-green-50'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
id: 'phone',
|
||||||
|
name: 'Phone',
|
||||||
|
icon: Phone,
|
||||||
|
data: 'tel:+1234567890',
|
||||||
|
color: 'text-emerald-600 bg-emerald-50'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
id: 'location',
|
||||||
|
name: 'Location',
|
||||||
|
icon: MapPin,
|
||||||
|
data: 'geo:37.7749,-122.4194',
|
||||||
|
color: 'text-pink-600 bg-pink-50'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
id: 'event',
|
||||||
|
name: 'Event',
|
||||||
|
icon: Calendar,
|
||||||
|
data: 'BEGIN:VEVENT\nSUMMARY:Meeting\nEND:VEVENT',
|
||||||
|
color: 'text-indigo-600 bg-indigo-50'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
id: 'menu',
|
||||||
|
name: 'Menu/PDF',
|
||||||
|
icon: FileText,
|
||||||
|
data: 'https://qrmaster.net/menu.pdf',
|
||||||
|
color: 'text-orange-600 bg-orange-50'
|
||||||
|
}
|
||||||
|
];
|
||||||
|
|
||||||
|
interface QRTypesShowcaseProps {
|
||||||
|
onTypeSelect?: (type: QRType) => void;
|
||||||
|
}
|
||||||
|
|
||||||
|
export const QRTypesShowcase: React.FC<QRTypesShowcaseProps> = ({ onTypeSelect }) => {
|
||||||
|
return (
|
||||||
|
<div className="space-y-8">
|
||||||
|
{/* Grid of QR Types */}
|
||||||
|
<div className="grid grid-cols-3 gap-4">
|
||||||
|
{qrTypes.map((type, index) => (
|
||||||
|
<motion.button
|
||||||
|
key={type.id}
|
||||||
|
initial={{ opacity: 0, scale: 0.9 }}
|
||||||
|
animate={{ opacity: 1, scale: 1 }}
|
||||||
|
transition={{
|
||||||
|
delay: index * 0.05,
|
||||||
|
duration: 0.3,
|
||||||
|
ease: [0.25, 0.1, 0.25, 1]
|
||||||
|
}}
|
||||||
|
onClick={() => onTypeSelect?.(type)}
|
||||||
|
className="group relative p-4 bg-white rounded-2xl border-2 border-gray-100 hover:border-primary-200 hover:shadow-lg transition-all duration-300 focus:outline-none focus:ring-2 focus:ring-primary-500 focus:ring-offset-2"
|
||||||
|
whileHover={{ scale: 1.05 }}
|
||||||
|
whileTap={{ scale: 0.95 }}
|
||||||
|
>
|
||||||
|
{/* Icon Badge */}
|
||||||
|
<div className={`w-10 h-10 ${type.color} rounded-xl flex items-center justify-center mb-3 mx-auto transition-transform group-hover:scale-110`}>
|
||||||
|
<type.icon className="w-5 h-5" />
|
||||||
|
</div>
|
||||||
|
|
||||||
|
{/* QR Code */}
|
||||||
|
<div className="flex justify-center mb-2">
|
||||||
|
<div className="p-2 bg-white rounded-lg">
|
||||||
|
<QRCodeSVG
|
||||||
|
value={type.data}
|
||||||
|
size={60}
|
||||||
|
level="L"
|
||||||
|
fgColor="#000000"
|
||||||
|
bgColor="#FFFFFF"
|
||||||
|
/>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
{/* Label */}
|
||||||
|
<p className="text-xs font-semibold text-gray-700 text-center group-hover:text-primary-600 transition-colors">
|
||||||
|
{type.name}
|
||||||
|
</p>
|
||||||
|
|
||||||
|
{/* Subtle glow on hover */}
|
||||||
|
<div className="absolute inset-0 rounded-2xl bg-gradient-primary opacity-0 group-hover:opacity-5 transition-opacity pointer-events-none" />
|
||||||
|
</motion.button>
|
||||||
|
))}
|
||||||
|
</div>
|
||||||
|
|
||||||
|
{/* Caption */}
|
||||||
|
<p className="text-center text-sm text-gray-500">
|
||||||
|
Support for all major QR code types
|
||||||
|
</p>
|
||||||
|
</div>
|
||||||
|
);
|
||||||
|
};
|
||||||
|
|
||||||
|
export { qrTypes };
|
||||||
@@ -18,8 +18,7 @@ import {
|
|||||||
Bitcoin,
|
Bitcoin,
|
||||||
CreditCard,
|
CreditCard,
|
||||||
Video,
|
Video,
|
||||||
Users,
|
Users
|
||||||
Barcode
|
|
||||||
} from 'lucide-react';
|
} from 'lucide-react';
|
||||||
|
|
||||||
const tools = [
|
const tools = [
|
||||||
@@ -30,7 +29,7 @@ const tools = [
|
|||||||
{ name: 'Email', href: '/tools/email-qr-code', icon: Mail, color: 'text-amber-500', bgColor: 'bg-amber-50' },
|
{ name: 'Email', href: '/tools/email-qr-code', icon: Mail, color: 'text-amber-500', bgColor: 'bg-amber-50' },
|
||||||
{ name: 'SMS', href: '/tools/sms-qr-code', icon: MessageSquare, color: 'text-cyan-500', bgColor: 'bg-cyan-50' },
|
{ name: 'SMS', href: '/tools/sms-qr-code', icon: MessageSquare, color: 'text-cyan-500', bgColor: 'bg-cyan-50' },
|
||||||
{ name: 'Instagram', href: '/tools/instagram-qr-code', icon: Instagram, color: 'text-pink-600', bgColor: 'bg-pink-50' },
|
{ name: 'Instagram', href: '/tools/instagram-qr-code', icon: Instagram, color: 'text-pink-600', bgColor: 'bg-pink-50' },
|
||||||
{ name: 'Barcode', href: '/tools/barcode-generator', icon: Barcode, color: 'text-slate-900', bgColor: 'bg-slate-100' },
|
{ name: 'TikTok', href: '/tools/tiktok-qr-code', icon: Music, color: 'text-slate-800', bgColor: 'bg-slate-100' },
|
||||||
];
|
];
|
||||||
|
|
||||||
export function RelatedTools() {
|
export function RelatedTools() {
|
||||||
|
|||||||
116
src/components/marketing/StatsCounter.tsx
Normal file
@@ -0,0 +1,116 @@
|
|||||||
|
'use client';
|
||||||
|
|
||||||
|
import React from 'react';
|
||||||
|
import { motion, useInView, useMotionValue, useSpring } from 'framer-motion';
|
||||||
|
|
||||||
|
interface Stat {
|
||||||
|
label: string;
|
||||||
|
value: number;
|
||||||
|
suffix?: string;
|
||||||
|
prefix?: string;
|
||||||
|
decimals?: number;
|
||||||
|
}
|
||||||
|
|
||||||
|
interface StatsCounterProps {
|
||||||
|
stats: Stat[];
|
||||||
|
}
|
||||||
|
|
||||||
|
const AnimatedNumber: React.FC<{
|
||||||
|
value: number;
|
||||||
|
prefix?: string;
|
||||||
|
suffix?: string;
|
||||||
|
decimals?: number;
|
||||||
|
}> = ({ value, prefix = '', suffix = '', decimals = 0 }) => {
|
||||||
|
const ref = React.useRef<HTMLSpanElement>(null);
|
||||||
|
const isInView = useInView(ref, { once: true, margin: '-100px' });
|
||||||
|
const motionValue = useMotionValue(0);
|
||||||
|
const springValue = useSpring(motionValue, {
|
||||||
|
damping: 80,
|
||||||
|
stiffness: 60,
|
||||||
|
});
|
||||||
|
const [displayValue, setDisplayValue] = React.useState('0');
|
||||||
|
|
||||||
|
React.useEffect(() => {
|
||||||
|
if (isInView) {
|
||||||
|
motionValue.set(value);
|
||||||
|
}
|
||||||
|
}, [isInView, motionValue, value]);
|
||||||
|
|
||||||
|
React.useEffect(() => {
|
||||||
|
const unsubscribe = springValue.on('change', (latest) => {
|
||||||
|
setDisplayValue(latest.toFixed(decimals));
|
||||||
|
});
|
||||||
|
|
||||||
|
return unsubscribe;
|
||||||
|
}, [springValue, decimals]);
|
||||||
|
|
||||||
|
return (
|
||||||
|
<span ref={ref} className="gradient-text-vibrant text-3xl lg:text-4xl font-bold">
|
||||||
|
{prefix}
|
||||||
|
{displayValue}
|
||||||
|
{suffix}
|
||||||
|
</span>
|
||||||
|
);
|
||||||
|
};
|
||||||
|
|
||||||
|
export const StatsCounter: React.FC<StatsCounterProps> = ({ stats }) => {
|
||||||
|
return (
|
||||||
|
<motion.div
|
||||||
|
initial={{ opacity: 0, y: 20 }}
|
||||||
|
whileInView={{ opacity: 1, y: 0 }}
|
||||||
|
viewport={{ once: true, margin: '-100px' }}
|
||||||
|
transition={{ duration: 0.5 }}
|
||||||
|
className="grid grid-cols-2 lg:grid-cols-4 gap-6 mt-16"
|
||||||
|
>
|
||||||
|
{stats.map((stat, index) => (
|
||||||
|
<motion.div
|
||||||
|
key={index}
|
||||||
|
initial={{ opacity: 0, scale: 0.95 }}
|
||||||
|
whileInView={{ opacity: 1, scale: 1 }}
|
||||||
|
viewport={{ once: true }}
|
||||||
|
transition={{ delay: index * 0.1, duration: 0.3 }}
|
||||||
|
className="text-center"
|
||||||
|
>
|
||||||
|
<div className="mb-2">
|
||||||
|
<AnimatedNumber
|
||||||
|
value={stat.value}
|
||||||
|
prefix={stat.prefix}
|
||||||
|
suffix={stat.suffix}
|
||||||
|
decimals={stat.decimals}
|
||||||
|
/>
|
||||||
|
</div>
|
||||||
|
<p className="text-xs font-medium text-gray-600">{stat.label}</p>
|
||||||
|
</motion.div>
|
||||||
|
))}
|
||||||
|
</motion.div>
|
||||||
|
);
|
||||||
|
};
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Default stats - can be overridden with real data
|
||||||
|
* For now using generic/aspirational numbers
|
||||||
|
*/
|
||||||
|
export const defaultStats: Stat[] = [
|
||||||
|
{
|
||||||
|
label: 'QR Codes Created',
|
||||||
|
value: 850,
|
||||||
|
suffix: 'K+',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
label: 'Total Scans',
|
||||||
|
value: 12.5,
|
||||||
|
suffix: 'M+',
|
||||||
|
decimals: 1,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
label: 'Active Users',
|
||||||
|
value: 25,
|
||||||
|
suffix: 'K+',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
label: 'Uptime',
|
||||||
|
value: 99.9,
|
||||||
|
suffix: '%',
|
||||||
|
decimals: 1,
|
||||||
|
},
|
||||||
|
];
|
||||||
@@ -9,7 +9,10 @@
|
|||||||
"create_qr": "QR erstellen",
|
"create_qr": "QR erstellen",
|
||||||
"bulk_creation": "Massen-Erstellung",
|
"bulk_creation": "Massen-Erstellung",
|
||||||
"analytics": "Analytik",
|
"analytics": "Analytik",
|
||||||
"settings": "Einstellungen"
|
"settings": "Einstellungen",
|
||||||
|
"cta": "Kostenlos loslegen",
|
||||||
|
"tools": "Kostenlose Tools",
|
||||||
|
"all_free": "Alle Generatoren sind 100% kostenlos"
|
||||||
},
|
},
|
||||||
"hero": {
|
"hero": {
|
||||||
"badge": "Kostenloser QR-Code-Generator",
|
"badge": "Kostenloser QR-Code-Generator",
|
||||||
@@ -64,6 +67,8 @@
|
|||||||
"demo_note": "Dies ist ein Demo-QR-Code"
|
"demo_note": "Dies ist ein Demo-QR-Code"
|
||||||
},
|
},
|
||||||
"static_vs_dynamic": {
|
"static_vs_dynamic": {
|
||||||
|
"title": "Warum dynamische QR-Codes Geld sparen",
|
||||||
|
"description": "Hören Sie auf, Materialien neu zu drucken. Ändern Sie Zielorte sofort und verfolgen Sie jeden Scan.",
|
||||||
"static": {
|
"static": {
|
||||||
"title": "Statische QR-Codes",
|
"title": "Statische QR-Codes",
|
||||||
"subtitle": "Immer kostenlos",
|
"subtitle": "Immer kostenlos",
|
||||||
@@ -97,6 +102,10 @@
|
|||||||
"title": "Vollständige Anpassung",
|
"title": "Vollständige Anpassung",
|
||||||
"description": "Branden Sie Ihre QR-Codes mit individuellen Farben, Logos und Styling-Optionen."
|
"description": "Branden Sie Ihre QR-Codes mit individuellen Farben, Logos und Styling-Optionen."
|
||||||
},
|
},
|
||||||
|
"unlimited": {
|
||||||
|
"title": "Unbegrenzte statische QR-Codes",
|
||||||
|
"description": "Erstellen Sie so viele statische QR-Codes wie Sie möchten. Für immer kostenlos, ohne Limits."
|
||||||
|
},
|
||||||
"bulk": {
|
"bulk": {
|
||||||
"title": "Bulk-Operationen",
|
"title": "Bulk-Operationen",
|
||||||
"description": "Erstellen Sie hunderte von QR-Codes auf einmal mit CSV-Import und Batch-Verarbeitung."
|
"description": "Erstellen Sie hunderte von QR-Codes auf einmal mit CSV-Import und Batch-Verarbeitung."
|
||||||
@@ -370,5 +379,22 @@
|
|||||||
"loading": "Lädt...",
|
"loading": "Lädt...",
|
||||||
"error": "Ein Fehler ist aufgetreten",
|
"error": "Ein Fehler ist aufgetreten",
|
||||||
"success": "Erfolgreich!"
|
"success": "Erfolgreich!"
|
||||||
|
},
|
||||||
|
"footer": {
|
||||||
|
"product": "Produkt",
|
||||||
|
"features": "Funktionen",
|
||||||
|
"pricing": "Preise",
|
||||||
|
"faq": "FAQ",
|
||||||
|
"blog": "Blog",
|
||||||
|
"resources": "Ressourcen",
|
||||||
|
"full_pricing": "Alle Preise",
|
||||||
|
"all_questions": "Alle Fragen",
|
||||||
|
"all_articles": "Alle Artikel",
|
||||||
|
"get_started": "Loslegen",
|
||||||
|
"legal": "Rechtliches",
|
||||||
|
"privacy_policy": "Datenschutzerklärung",
|
||||||
|
"tagline": "Erstellen Sie individuelle QR-Codes in Sekunden mit erweitertem Tracking und Analytik.",
|
||||||
|
"newsletter": "Newsletter Anmeldung",
|
||||||
|
"rights_reserved": "QR Master. Alle Rechte vorbehalten."
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
249
src/lib/animations.ts
Normal file
@@ -0,0 +1,249 @@
|
|||||||
|
/**
|
||||||
|
* Centralized Animation Variants for Framer Motion
|
||||||
|
* Premium animation library for QR Master landing page
|
||||||
|
*/
|
||||||
|
|
||||||
|
import type { Variants } from 'framer-motion';
|
||||||
|
|
||||||
|
// Custom easing curves
|
||||||
|
export const easings = {
|
||||||
|
smooth: [0.25, 0.1, 0.25, 1],
|
||||||
|
snappy: [0.34, 1.56, 0.64, 1], // Bounce effect
|
||||||
|
elegant: [0.43, 0.13, 0.23, 0.96],
|
||||||
|
} as const;
|
||||||
|
|
||||||
|
// Fade & Scale animations
|
||||||
|
export const fadeIn: Variants = {
|
||||||
|
initial: { opacity: 0 },
|
||||||
|
animate: {
|
||||||
|
opacity: 1,
|
||||||
|
transition: { duration: 0.5, ease: easings.smooth }
|
||||||
|
},
|
||||||
|
};
|
||||||
|
|
||||||
|
export const scaleIn: Variants = {
|
||||||
|
initial: { opacity: 0, scale: 0.95 },
|
||||||
|
animate: {
|
||||||
|
opacity: 1,
|
||||||
|
scale: 1,
|
||||||
|
transition: { duration: 0.3, ease: easings.smooth }
|
||||||
|
},
|
||||||
|
};
|
||||||
|
|
||||||
|
export const scaleInBounce: Variants = {
|
||||||
|
initial: { opacity: 0, scale: 0.8 },
|
||||||
|
animate: {
|
||||||
|
opacity: 1,
|
||||||
|
scale: 1,
|
||||||
|
transition: { duration: 0.5, ease: easings.snappy }
|
||||||
|
},
|
||||||
|
};
|
||||||
|
|
||||||
|
// Slide animations
|
||||||
|
export const slideUp: Variants = {
|
||||||
|
initial: { opacity: 0, y: 30 },
|
||||||
|
animate: {
|
||||||
|
opacity: 1,
|
||||||
|
y: 0,
|
||||||
|
transition: { duration: 0.5, ease: easings.smooth }
|
||||||
|
},
|
||||||
|
};
|
||||||
|
|
||||||
|
export const slideUpBounce: Variants = {
|
||||||
|
initial: { opacity: 0, y: 30 },
|
||||||
|
animate: {
|
||||||
|
opacity: 1,
|
||||||
|
y: 0,
|
||||||
|
transition: { duration: 0.5, ease: easings.snappy }
|
||||||
|
},
|
||||||
|
};
|
||||||
|
|
||||||
|
export const slideDown: Variants = {
|
||||||
|
initial: { opacity: 0, y: -30 },
|
||||||
|
animate: {
|
||||||
|
opacity: 1,
|
||||||
|
y: 0,
|
||||||
|
transition: { duration: 0.5, ease: easings.smooth }
|
||||||
|
},
|
||||||
|
};
|
||||||
|
|
||||||
|
export const slideLeft: Variants = {
|
||||||
|
initial: { opacity: 0, x: 30 },
|
||||||
|
animate: {
|
||||||
|
opacity: 1,
|
||||||
|
x: 0,
|
||||||
|
transition: { duration: 0.5, ease: easings.smooth }
|
||||||
|
},
|
||||||
|
};
|
||||||
|
|
||||||
|
export const slideRight: Variants = {
|
||||||
|
initial: { opacity: 0, x: -30 },
|
||||||
|
animate: {
|
||||||
|
opacity: 1,
|
||||||
|
x: 0,
|
||||||
|
transition: { duration: 0.5, ease: easings.smooth }
|
||||||
|
},
|
||||||
|
};
|
||||||
|
|
||||||
|
// Container animations with stagger
|
||||||
|
export const staggerContainer: Variants = {
|
||||||
|
initial: {},
|
||||||
|
animate: {
|
||||||
|
transition: {
|
||||||
|
staggerChildren: 0.1,
|
||||||
|
delayChildren: 0.1,
|
||||||
|
}
|
||||||
|
},
|
||||||
|
};
|
||||||
|
|
||||||
|
export const staggerContainerFast: Variants = {
|
||||||
|
initial: {},
|
||||||
|
animate: {
|
||||||
|
transition: {
|
||||||
|
staggerChildren: 0.05,
|
||||||
|
delayChildren: 0,
|
||||||
|
}
|
||||||
|
},
|
||||||
|
};
|
||||||
|
|
||||||
|
export const staggerItem: Variants = {
|
||||||
|
initial: { opacity: 0, y: 20 },
|
||||||
|
animate: {
|
||||||
|
opacity: 1,
|
||||||
|
y: 0,
|
||||||
|
transition: { duration: 0.4, ease: easings.smooth }
|
||||||
|
},
|
||||||
|
};
|
||||||
|
|
||||||
|
// Morph animations (for QR code transformations)
|
||||||
|
export const colorMorph: Variants = {
|
||||||
|
initial: { scale: 1 },
|
||||||
|
animate: {
|
||||||
|
scale: [1, 1.02, 1],
|
||||||
|
transition: { duration: 0.4, ease: easings.smooth }
|
||||||
|
},
|
||||||
|
};
|
||||||
|
|
||||||
|
// Hover states
|
||||||
|
export const hoverScale = {
|
||||||
|
scale: 1.05,
|
||||||
|
transition: { duration: 0.2, ease: easings.smooth }
|
||||||
|
};
|
||||||
|
|
||||||
|
export const hoverScaleSmall = {
|
||||||
|
scale: 1.02,
|
||||||
|
transition: { duration: 0.2, ease: easings.smooth }
|
||||||
|
};
|
||||||
|
|
||||||
|
export const hoverLift = {
|
||||||
|
y: -4,
|
||||||
|
transition: { duration: 0.2, ease: easings.smooth }
|
||||||
|
};
|
||||||
|
|
||||||
|
export const hoverGlow = {
|
||||||
|
boxShadow: '0 8px 32px rgba(99, 102, 241, 0.25)',
|
||||||
|
transition: { duration: 0.3, ease: easings.smooth }
|
||||||
|
};
|
||||||
|
|
||||||
|
// Rotate animations
|
||||||
|
export const rotate360: Variants = {
|
||||||
|
initial: { rotate: 0 },
|
||||||
|
animate: {
|
||||||
|
rotate: 360,
|
||||||
|
transition: { duration: 0.6, ease: easings.smooth }
|
||||||
|
},
|
||||||
|
};
|
||||||
|
|
||||||
|
export const pulseGlow: Variants = {
|
||||||
|
initial: { opacity: 0.7 },
|
||||||
|
animate: {
|
||||||
|
opacity: [0.7, 1, 0.7],
|
||||||
|
transition: {
|
||||||
|
duration: 2,
|
||||||
|
repeat: Infinity,
|
||||||
|
ease: 'easeInOut'
|
||||||
|
}
|
||||||
|
},
|
||||||
|
};
|
||||||
|
|
||||||
|
// Advanced entrance animations
|
||||||
|
export const revealFromBottom: Variants = {
|
||||||
|
initial: {
|
||||||
|
opacity: 0,
|
||||||
|
y: 50,
|
||||||
|
clipPath: 'inset(100% 0 0 0)'
|
||||||
|
},
|
||||||
|
animate: {
|
||||||
|
opacity: 1,
|
||||||
|
y: 0,
|
||||||
|
clipPath: 'inset(0% 0 0 0)',
|
||||||
|
transition: {
|
||||||
|
duration: 0.7,
|
||||||
|
ease: easings.elegant
|
||||||
|
}
|
||||||
|
},
|
||||||
|
};
|
||||||
|
|
||||||
|
// Scroll-triggered animation preset
|
||||||
|
export const scrollReveal = {
|
||||||
|
initial: "initial",
|
||||||
|
whileInView: "animate",
|
||||||
|
viewport: { once: true, margin: "-100px" }
|
||||||
|
} as const;
|
||||||
|
|
||||||
|
// Interactive button animations
|
||||||
|
export const buttonTap = {
|
||||||
|
scale: 0.95,
|
||||||
|
transition: { duration: 0.1 }
|
||||||
|
};
|
||||||
|
|
||||||
|
export const buttonHover = {
|
||||||
|
scale: 1.02,
|
||||||
|
boxShadow: '0 12px 32px rgba(99, 102, 241, 0.3)',
|
||||||
|
transition: { duration: 0.2 }
|
||||||
|
};
|
||||||
|
|
||||||
|
// Float animation (for decorative elements)
|
||||||
|
export const float: Variants = {
|
||||||
|
initial: { y: 0 },
|
||||||
|
animate: {
|
||||||
|
y: [-10, 10, -10],
|
||||||
|
transition: {
|
||||||
|
duration: 4,
|
||||||
|
repeat: Infinity,
|
||||||
|
ease: 'easeInOut'
|
||||||
|
}
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
// Shimmer effect
|
||||||
|
export const shimmer: Variants = {
|
||||||
|
initial: { backgroundPosition: '-200% 0' },
|
||||||
|
animate: {
|
||||||
|
backgroundPosition: '200% 0',
|
||||||
|
transition: {
|
||||||
|
duration: 2,
|
||||||
|
repeat: Infinity,
|
||||||
|
ease: 'linear'
|
||||||
|
}
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
// Drawing animation (for borders/lines)
|
||||||
|
export const drawLine: Variants = {
|
||||||
|
initial: { pathLength: 0, opacity: 0 },
|
||||||
|
animate: {
|
||||||
|
pathLength: 1,
|
||||||
|
opacity: 1,
|
||||||
|
transition: { duration: 1.5, ease: easings.smooth }
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
// Count-up animation helper
|
||||||
|
export const createCountUpVariant = (from: number, to: number, duration = 2): Variants => ({
|
||||||
|
initial: { value: from },
|
||||||
|
animate: {
|
||||||
|
value: to,
|
||||||
|
transition: { duration, ease: easings.smooth }
|
||||||
|
}
|
||||||
|
});
|
||||||
@@ -27,7 +27,7 @@ export const blogPosts: Record<string, BlogPostData> = {
|
|||||||
dateModified: '2025-10-16T09:00:00Z',
|
dateModified: '2025-10-16T09:00:00Z',
|
||||||
readTime: '15 Min',
|
readTime: '15 Min',
|
||||||
category: 'Analytics',
|
category: 'Analytics',
|
||||||
image: '/blog/qr-code-analytics-hero-v2.png',
|
image: '/blog/qr-code-analytics-hero.webp',
|
||||||
imageAlt: 'QR Code Analytics dashboard displaying scan metrics and user data',
|
imageAlt: 'QR Code Analytics dashboard displaying scan metrics and user data',
|
||||||
author: 'QR Master Team',
|
author: 'QR Master Team',
|
||||||
authorUrl: 'https://www.qrmaster.net/about',
|
authorUrl: 'https://www.qrmaster.net/about',
|
||||||
@@ -88,7 +88,7 @@ export const blogPosts: Record<string, BlogPostData> = {
|
|||||||
<p>Measure downstream actions after the scan—form submissions, purchases, app downloads, or content engagement. Integrate with your CRM and marketing stack to attribute revenue to specific QR campaigns.</p>
|
<p>Measure downstream actions after the scan—form submissions, purchases, app downloads, or content engagement. Integrate with your CRM and marketing stack to attribute revenue to specific QR campaigns.</p>
|
||||||
|
|
||||||
<div class="my-8">
|
<div class="my-8">
|
||||||
<img loading="lazy" src="/blog/qr-code-analytics-dashboard.png" alt="QR Code Analytics dashboard showing real-time scan data" class="rounded-lg shadow-lg w-full" />
|
<img src="/blog/qr-code-analytics-dashboard.png" alt="QR Code Analytics dashboard showing real-time scan data" class="rounded-lg shadow-lg w-full" />
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<h2>Advanced Campaign Tracking Strategies</h2>
|
<h2>Advanced Campaign Tracking Strategies</h2>
|
||||||
@@ -148,7 +148,7 @@ export const blogPosts: Record<string, BlogPostData> = {
|
|||||||
dateModified: '2025-10-18T09:00:00Z',
|
dateModified: '2025-10-18T09:00:00Z',
|
||||||
readTime: '12 Min',
|
readTime: '12 Min',
|
||||||
category: 'Tracking & Analytics',
|
category: 'Tracking & Analytics',
|
||||||
image: '/blog/qr-code-tracking-hero-v2.png',
|
image: '/blog/qr-code-tracking-guide-hero.webp',
|
||||||
imageAlt: 'QR Code Tracking and analytics dashboard visualization',
|
imageAlt: 'QR Code Tracking and analytics dashboard visualization',
|
||||||
author: 'QR Master Team',
|
author: 'QR Master Team',
|
||||||
authorUrl: 'https://www.qrmaster.net/about',
|
authorUrl: 'https://www.qrmaster.net/about',
|
||||||
@@ -349,7 +349,7 @@ app.get('/qr/:id', async (req, res) => {
|
|||||||
<p>Privacy Note: Always hash IP addresses, respect Do Not Track headers, and comply with GDPR when collecting scan data.</p>
|
<p>Privacy Note: Always hash IP addresses, respect Do Not Track headers, and comply with GDPR when collecting scan data.</p>
|
||||||
|
|
||||||
<div class="my-8">
|
<div class="my-8">
|
||||||
<img loading="lazy" src="/blog/qr-code-tracking-guide-body.png" alt="Person using QR Code Tracking on mobile device in office" class="rounded-lg shadow-lg w-full" />
|
<img src="/blog/qr-code-tracking-guide-body.png" alt="Person using QR Code Tracking on mobile device in office" class="rounded-lg shadow-lg w-full" />
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<h2>QR Code Tracking Tools Comparison</h2>
|
<h2>QR Code Tracking Tools Comparison</h2>
|
||||||
@@ -674,7 +674,7 @@ app.get('/qr/:id', async (req, res) => {
|
|||||||
dateModified: '2025-10-17T09:00:00Z',
|
dateModified: '2025-10-17T09:00:00Z',
|
||||||
readTime: '10 Min',
|
readTime: '10 Min',
|
||||||
category: 'QR Code Basics',
|
category: 'QR Code Basics',
|
||||||
image: '/blog/dynamic-vs-static-hero-v2.png',
|
image: '/blog/static-vs-dynamic-qr-codes-hero.png',
|
||||||
imageAlt: 'Comparison graphic showing features of static versus dynamic QR codes',
|
imageAlt: 'Comparison graphic showing features of static versus dynamic QR codes',
|
||||||
author: 'QR Master Team',
|
author: 'QR Master Team',
|
||||||
authorUrl: 'https://www.qrmaster.net/about',
|
authorUrl: 'https://www.qrmaster.net/about',
|
||||||
@@ -710,7 +710,7 @@ app.get('/qr/:id', async (req, res) => {
|
|||||||
</ul>
|
</ul>
|
||||||
|
|
||||||
<div class="my-8">
|
<div class="my-8">
|
||||||
<img loading="lazy" src="/blog/static-vs-dynamic-qr-codes-body.png" alt="Visual comparison of static and dynamic QR code patterns" class="rounded-lg shadow-lg w-full" />
|
<img src="/blog/static-vs-dynamic-qr-codes-body.png" alt="Visual comparison of static and dynamic QR code patterns" class="rounded-lg shadow-lg w-full" />
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<h2>Direct Comparison: Static vs Dynamic</h2>
|
<h2>Direct Comparison: Static vs Dynamic</h2>
|
||||||
@@ -877,7 +877,7 @@ app.get('/qr/:id', async (req, res) => {
|
|||||||
<p>Go to the <a href="/signup">QR Master Bulk Dashboard</a> (requires Business plan). Click "Upload CSV" and select your file. The system will validate your rows to ensure no missing URLs.</p>
|
<p>Go to the <a href="/signup">QR Master Bulk Dashboard</a> (requires Business plan). Click "Upload CSV" and select your file. The system will validate your rows to ensure no missing URLs.</p>
|
||||||
|
|
||||||
<div class="my-8">
|
<div class="my-8">
|
||||||
<img loading="lazy" src="/blog/2-body.webp" alt="Screenshot of bulk CSV upload interface" class="rounded-lg shadow-lg w-full" />
|
<img src="/blog/2-body.webp" alt="Screenshot of bulk CSV upload interface" class="rounded-lg shadow-lg w-full" />
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<h3>Step 4: Customize Design</h3>
|
<h3>Step 4: Customize Design</h3>
|
||||||
@@ -1212,7 +1212,7 @@ const response = await fetch('https://api.qrmaster.net/v1/bulk', {
|
|||||||
<h2>Step 2: Create Your QR Code with QR Master</h2>
|
<h2>Step 2: Create Your QR Code with QR Master</h2>
|
||||||
|
|
||||||
<div class="my-8">
|
<div class="my-8">
|
||||||
<img loading="lazy" src="/blog/restaurant-qr-body.png" alt="Customer scanning QR code menu at restaurant" class="rounded-lg shadow-lg w-full" />
|
<img src="/blog/restaurant-qr-body.png" alt="Customer scanning QR code menu at restaurant" class="rounded-lg shadow-lg w-full" />
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<p>Using a <a href="/dynamic-qr-code-generator">dynamic QR code generator</a> is essential for restaurants. Unlike static codes, dynamic QR codes let you:</p>
|
<p>Using a <a href="/dynamic-qr-code-generator">dynamic QR code generator</a> is essential for restaurants. Unlike static codes, dynamic QR codes let you:</p>
|
||||||
@@ -1354,7 +1354,7 @@ const response = await fetch('https://api.qrmaster.net/v1/bulk', {
|
|||||||
</ul>
|
</ul>
|
||||||
|
|
||||||
<div class="my-8">
|
<div class="my-8">
|
||||||
<img loading="lazy" src="/blog/vcard-qr-body.png" alt="Business professionals exchanging digital business cards" class="rounded-lg shadow-lg w-full" />
|
<img src="/blog/vcard-qr-body.png" alt="Business professionals exchanging digital business cards" class="rounded-lg shadow-lg w-full" />
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<h2>Information You Can Include in a vCard</h2>
|
<h2>Information You Can Include in a vCard</h2>
|
||||||
@@ -1480,7 +1480,7 @@ const response = await fetch('https://api.qrmaster.net/v1/bulk', {
|
|||||||
<p>QR codes have become essential tools for small businesses looking to bridge the gap between physical and digital experiences. From contactless payments to customer feedback, <strong>QR codes for small business</strong> offer affordable, versatile solutions that previously required expensive custom apps.</p>
|
<p>QR codes have become essential tools for small businesses looking to bridge the gap between physical and digital experiences. From contactless payments to customer feedback, <strong>QR codes for small business</strong> offer affordable, versatile solutions that previously required expensive custom apps.</p>
|
||||||
|
|
||||||
<div class="my-8">
|
<div class="my-8">
|
||||||
<img loading="lazy" src="/blog/small-business-body.png" alt="Customer scanning QR code at retail checkout" class="rounded-lg shadow-lg w-full" />
|
<img src="/blog/small-business-body.png" alt="Customer scanning QR code at retail checkout" class="rounded-lg shadow-lg w-full" />
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<h2>Top 10 QR Code Use Cases for Small Business</h2>
|
<h2>Top 10 QR Code Use Cases for Small Business</h2>
|
||||||
@@ -1610,7 +1610,7 @@ const response = await fetch('https://api.qrmaster.net/v1/bulk', {
|
|||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="my-8">
|
<div class="my-8">
|
||||||
<img loading="lazy" src="/blog/qr-sizes-body.png" alt="Various QR code print sizes comparison" class="rounded-lg shadow-lg w-full" />
|
<img src="/blog/qr-sizes-body.png" alt="Various QR code print sizes comparison" class="rounded-lg shadow-lg w-full" />
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<h2>QR Code Sizes by Application</h2>
|
<h2>QR Code Sizes by Application</h2>
|
||||||
|
|||||||
@@ -6,6 +6,8 @@ const globalForPrisma = globalThis as unknown as {
|
|||||||
|
|
||||||
export const db =
|
export const db =
|
||||||
globalForPrisma.prisma ??
|
globalForPrisma.prisma ??
|
||||||
new PrismaClient();
|
new PrismaClient({
|
||||||
|
log: ['query'],
|
||||||
|
});
|
||||||
|
|
||||||
if (process.env.NODE_ENV !== 'production') globalForPrisma.prisma = db;
|
if (process.env.NODE_ENV !== 'production') globalForPrisma.prisma = db;
|
||||||
@@ -11,14 +11,6 @@ const envSchema = z.object({
|
|||||||
REDIS_URL: z.string().optional(),
|
REDIS_URL: z.string().optional(),
|
||||||
IP_SALT: z.string().default('development-salt-change-in-production'),
|
IP_SALT: z.string().default('development-salt-change-in-production'),
|
||||||
ENABLE_DEMO: z.string().default('false'),
|
ENABLE_DEMO: z.string().default('false'),
|
||||||
|
|
||||||
// Cloudflare R2 (S3 Compatible)
|
|
||||||
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_UPLOAD_SIZE: z.string().default('10485760'), // 10MB default
|
|
||||||
});
|
});
|
||||||
|
|
||||||
// During build, we might not have all env vars, so we'll use defaults
|
// During build, we might not have all env vars, so we'll use defaults
|
||||||
|
|||||||
@@ -8,7 +8,7 @@ const INDEXNOW_ENDPOINT = 'https://api.indexnow.org/indexnow';
|
|||||||
const HOST = 'www.qrmaster.net';
|
const HOST = 'www.qrmaster.net';
|
||||||
// You need to generate a key from https://www.bing.com/indexnow and place it in your public folder
|
// You need to generate a key from https://www.bing.com/indexnow and place it in your public folder
|
||||||
// For now, we'll assume a key exists or is provided via env
|
// For now, we'll assume a key exists or is provided via env
|
||||||
const KEY = process.env.INDEXNOW_KEY || 'bb6dfaacf1ed41a880281c426c54ed7c';
|
const KEY = process.env.INDEXNOW_KEY || 'your-indexnow-key';
|
||||||
const KEY_LOCATION = `https://${HOST}/${KEY}.txt`;
|
const KEY_LOCATION = `https://${HOST}/${KEY}.txt`;
|
||||||
|
|
||||||
export async function submitToIndexNow(urls: string[]) {
|
export async function submitToIndexNow(urls: string[]) {
|
||||||
@@ -48,7 +48,6 @@ export function getAllIndexableUrls(): string[] {
|
|||||||
|
|
||||||
// Free tools
|
// Free tools
|
||||||
const freeTools = [
|
const freeTools = [
|
||||||
'barcode-generator', // Added as per request
|
|
||||||
'url-qr-code', 'vcard-qr-code', 'text-qr-code', 'email-qr-code', 'sms-qr-code',
|
'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',
|
'wifi-qr-code', 'crypto-qr-code', 'event-qr-code', 'facebook-qr-code',
|
||||||
'instagram-qr-code', 'twitter-qr-code', 'youtube-qr-code', 'whatsapp-qr-code',
|
'instagram-qr-code', 'twitter-qr-code', 'youtube-qr-code', 'whatsapp-qr-code',
|
||||||
|
|||||||
@@ -1,65 +0,0 @@
|
|||||||
import { S3Client, PutObjectCommand, DeleteObjectCommand } from '@aws-sdk/client-s3';
|
|
||||||
import { env } from './env';
|
|
||||||
import crypto from 'crypto';
|
|
||||||
|
|
||||||
// Initialize S3 client for Cloudflare R2
|
|
||||||
const r2Client = new S3Client({
|
|
||||||
region: 'auto',
|
|
||||||
endpoint: `https://${env.R2_ACCOUNT_ID || 'placeholder'}.r2.cloudflarestorage.com`,
|
|
||||||
credentials: {
|
|
||||||
accessKeyId: env.R2_ACCESS_KEY_ID || '',
|
|
||||||
secretAccessKey: env.R2_SECRET_ACCESS_KEY || '',
|
|
||||||
},
|
|
||||||
});
|
|
||||||
|
|
||||||
export async function uploadFileToR2(
|
|
||||||
file: Buffer,
|
|
||||||
filename: string,
|
|
||||||
contentType: string = 'application/pdf'
|
|
||||||
): Promise<string> {
|
|
||||||
// Generate a unique key for the file
|
|
||||||
const ext = filename.split('.').pop() || 'pdf';
|
|
||||||
const randomId = crypto.randomBytes(8).toString('hex');
|
|
||||||
const timestamp = Date.now();
|
|
||||||
const key = `uploads/${timestamp}_${randomId}.${ext}`;
|
|
||||||
|
|
||||||
await r2Client.send(
|
|
||||||
new PutObjectCommand({
|
|
||||||
Bucket: env.R2_BUCKET_NAME,
|
|
||||||
Key: key,
|
|
||||||
Body: file,
|
|
||||||
ContentType: contentType,
|
|
||||||
ContentDisposition: `inline; filename="${filename}"`,
|
|
||||||
// Cache for 1 year, as these are static files
|
|
||||||
CacheControl: 'public, max-age=31536000',
|
|
||||||
})
|
|
||||||
);
|
|
||||||
|
|
||||||
// Return the public URL
|
|
||||||
// If R2_PUBLIC_URL is set, use it (custom domain or r2.dev subdomain)
|
|
||||||
// Otherwise, construct a fallback (which might not work without public access enabled on bucket)
|
|
||||||
const publicUrl = env.R2_PUBLIC_URL
|
|
||||||
? `${env.R2_PUBLIC_URL}/${key}`
|
|
||||||
: `https://${env.R2_BUCKET_NAME}.r2.dev/${key}`;
|
|
||||||
|
|
||||||
return publicUrl;
|
|
||||||
}
|
|
||||||
|
|
||||||
export async function deleteFileFromR2(fileUrl: string): Promise<void> {
|
|
||||||
try {
|
|
||||||
// Extract key from URL
|
|
||||||
// URL format: https://domain.com/uploads/filename.pdf
|
|
||||||
const url = new URL(fileUrl);
|
|
||||||
const key = url.pathname.substring(1); // Remove leading slash
|
|
||||||
|
|
||||||
await r2Client.send(
|
|
||||||
new DeleteObjectCommand({
|
|
||||||
Bucket: env.R2_BUCKET_NAME,
|
|
||||||
Key: key,
|
|
||||||
})
|
|
||||||
);
|
|
||||||
} catch (error) {
|
|
||||||
console.error('Error deleting file from R2:', error);
|
|
||||||
// Suppress error, as deletion failure shouldn't block main flow
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -40,21 +40,28 @@ export interface HowToTask {
|
|||||||
totalTime?: string;
|
totalTime?: string;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const BASE_URL = 'https://www.qrmaster.net';
|
||||||
|
|
||||||
|
function toAbsoluteUrl(path: string): string {
|
||||||
|
if (path.startsWith('http')) return path;
|
||||||
|
return `${BASE_URL}${path.startsWith('/') ? '' : '/'}${path}`;
|
||||||
|
}
|
||||||
|
|
||||||
export function organizationSchema() {
|
export function organizationSchema() {
|
||||||
return {
|
return {
|
||||||
'@context': 'https://schema.org',
|
'@context': 'https://schema.org',
|
||||||
'@type': 'Organization',
|
'@type': 'Organization',
|
||||||
'@id': 'https://www.qrmaster.net/#organization',
|
'@id': `${BASE_URL}/#organization`,
|
||||||
name: 'QR Master',
|
name: 'QR Master',
|
||||||
alternateName: 'QRMaster',
|
alternateName: 'QRMaster',
|
||||||
url: 'https://www.qrmaster.net',
|
url: BASE_URL,
|
||||||
logo: {
|
logo: {
|
||||||
'@type': 'ImageObject',
|
'@type': 'ImageObject',
|
||||||
url: 'https://www.qrmaster.net/static/og-image.png',
|
url: `${BASE_URL}/og-image.png`,
|
||||||
width: 1200,
|
width: 1200,
|
||||||
height: 630,
|
height: 630,
|
||||||
},
|
},
|
||||||
image: 'https://www.qrmaster.net/static/og-image.png',
|
image: `${BASE_URL}/og-image.png`,
|
||||||
sameAs: [
|
sameAs: [
|
||||||
'https://twitter.com/qrmaster',
|
'https://twitter.com/qrmaster',
|
||||||
],
|
],
|
||||||
@@ -68,8 +75,6 @@ export function organizationSchema() {
|
|||||||
slogan: 'Dynamic QR codes that work smarter',
|
slogan: 'Dynamic QR codes that work smarter',
|
||||||
foundingDate: '2025',
|
foundingDate: '2025',
|
||||||
areaServed: 'Worldwide',
|
areaServed: 'Worldwide',
|
||||||
serviceType: 'Software as a Service',
|
|
||||||
priceRange: '$0 - $29',
|
|
||||||
knowsAbout: [
|
knowsAbout: [
|
||||||
'QR Code Generation',
|
'QR Code Generation',
|
||||||
'Marketing Analytics',
|
'Marketing Analytics',
|
||||||
@@ -88,6 +93,16 @@ export function organizationSchema() {
|
|||||||
name: 'QR Master Free',
|
name: 'QR Master Free',
|
||||||
applicationCategory: 'BusinessApplication',
|
applicationCategory: 'BusinessApplication',
|
||||||
operatingSystem: 'Web Browser',
|
operatingSystem: 'Web Browser',
|
||||||
|
offers: {
|
||||||
|
'@type': 'Offer',
|
||||||
|
price: '0',
|
||||||
|
priceCurrency: 'EUR',
|
||||||
|
},
|
||||||
|
aggregateRating: {
|
||||||
|
'@type': 'AggregateRating',
|
||||||
|
ratingValue: '4.8',
|
||||||
|
ratingCount: '1250',
|
||||||
|
},
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
@@ -97,12 +112,21 @@ export function organizationSchema() {
|
|||||||
name: 'QR Master Pro',
|
name: 'QR Master Pro',
|
||||||
applicationCategory: 'BusinessApplication',
|
applicationCategory: 'BusinessApplication',
|
||||||
operatingSystem: 'Web Browser',
|
operatingSystem: 'Web Browser',
|
||||||
|
offers: {
|
||||||
|
'@type': 'Offer',
|
||||||
|
price: '9',
|
||||||
|
priceCurrency: 'EUR',
|
||||||
|
},
|
||||||
|
aggregateRating: {
|
||||||
|
'@type': 'AggregateRating',
|
||||||
|
ratingValue: '4.9',
|
||||||
|
ratingCount: '850',
|
||||||
|
},
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
},
|
},
|
||||||
inLanguage: 'en',
|
mainEntityOfPage: BASE_URL,
|
||||||
mainEntityOfPage: 'https://www.qrmaster.net',
|
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -110,19 +134,19 @@ export function websiteSchema() {
|
|||||||
return {
|
return {
|
||||||
'@context': 'https://schema.org',
|
'@context': 'https://schema.org',
|
||||||
'@type': 'WebSite',
|
'@type': 'WebSite',
|
||||||
'@id': 'https://www.qrmaster.net/#website',
|
'@id': `${BASE_URL}/#website`,
|
||||||
name: 'QR Master',
|
name: 'QR Master',
|
||||||
url: 'https://www.qrmaster.net',
|
url: BASE_URL,
|
||||||
inLanguage: 'en',
|
inLanguage: 'en',
|
||||||
mainEntityOfPage: 'https://www.qrmaster.net',
|
mainEntityOfPage: BASE_URL,
|
||||||
publisher: {
|
publisher: {
|
||||||
'@id': 'https://www.qrmaster.net/#organization',
|
'@id': `${BASE_URL}/#organization`,
|
||||||
},
|
},
|
||||||
potentialAction: {
|
potentialAction: {
|
||||||
'@type': 'SearchAction',
|
'@type': 'SearchAction',
|
||||||
target: {
|
target: {
|
||||||
'@type': 'EntryPoint',
|
'@type': 'EntryPoint',
|
||||||
urlTemplate: 'https://www.qrmaster.net/blog?q={search_term_string}',
|
urlTemplate: `${BASE_URL}/blog?q={search_term_string}`,
|
||||||
},
|
},
|
||||||
'query-input': 'required name=search_term_string',
|
'query-input': 'required name=search_term_string',
|
||||||
},
|
},
|
||||||
@@ -133,14 +157,14 @@ export function breadcrumbSchema(items: BreadcrumbItem[]) {
|
|||||||
return {
|
return {
|
||||||
'@context': 'https://schema.org',
|
'@context': 'https://schema.org',
|
||||||
'@type': 'BreadcrumbList',
|
'@type': 'BreadcrumbList',
|
||||||
'@id': `https://www.qrmaster.net${items[items.length - 1]?.url}#breadcrumb`,
|
'@id': `${BASE_URL}${items[items.length - 1]?.url}#breadcrumb`,
|
||||||
inLanguage: 'en',
|
inLanguage: 'en',
|
||||||
mainEntityOfPage: `https://www.qrmaster.net${items[items.length - 1]?.url}`,
|
mainEntityOfPage: `${BASE_URL}${items[items.length - 1]?.url}`,
|
||||||
itemListElement: items.map((item, index) => ({
|
itemListElement: items.map((item, index) => ({
|
||||||
'@type': 'ListItem',
|
'@type': 'ListItem',
|
||||||
position: index + 1,
|
position: index + 1,
|
||||||
name: item.name,
|
name: item.name,
|
||||||
item: `https://www.qrmaster.net${item.url}`,
|
item: toAbsoluteUrl(item.url),
|
||||||
})),
|
})),
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
@@ -149,14 +173,14 @@ export function blogPostingSchema(post: BlogPost) {
|
|||||||
return {
|
return {
|
||||||
'@context': 'https://schema.org',
|
'@context': 'https://schema.org',
|
||||||
'@type': 'BlogPosting',
|
'@type': 'BlogPosting',
|
||||||
'@id': `https://www.qrmaster.net/blog/${post.slug}#article`,
|
'@id': `${BASE_URL}/blog/${post.slug}#article`,
|
||||||
headline: post.title,
|
headline: post.title,
|
||||||
description: post.description,
|
description: post.description,
|
||||||
image: post.image,
|
image: toAbsoluteUrl(post.image),
|
||||||
datePublished: post.datePublished,
|
datePublished: post.datePublished,
|
||||||
dateModified: post.dateModified,
|
dateModified: post.dateModified,
|
||||||
inLanguage: 'en',
|
inLanguage: 'en',
|
||||||
mainEntityOfPage: `https://www.qrmaster.net/blog/${post.slug}`,
|
mainEntityOfPage: `${BASE_URL}/blog/${post.slug}`,
|
||||||
author: {
|
author: {
|
||||||
'@type': 'Person',
|
'@type': 'Person',
|
||||||
name: post.author,
|
name: post.author,
|
||||||
@@ -165,19 +189,19 @@ export function blogPostingSchema(post: BlogPost) {
|
|||||||
publisher: {
|
publisher: {
|
||||||
'@type': 'Organization',
|
'@type': 'Organization',
|
||||||
name: 'QR Master',
|
name: 'QR Master',
|
||||||
url: 'https://www.qrmaster.net',
|
url: BASE_URL,
|
||||||
logo: {
|
logo: {
|
||||||
'@type': 'ImageObject',
|
'@type': 'ImageObject',
|
||||||
url: 'https://www.qrmaster.net/static/og-image.png',
|
url: `${BASE_URL}/og-image.png`,
|
||||||
width: 1200,
|
width: 1200,
|
||||||
height: 630,
|
height: 630,
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
isPartOf: {
|
isPartOf: {
|
||||||
'@type': 'Blog',
|
'@type': 'Blog',
|
||||||
'@id': 'https://www.qrmaster.net/blog#blog',
|
'@id': `${BASE_URL}/blog#blog`,
|
||||||
name: 'QR Master Blog',
|
name: 'QR Master Blog',
|
||||||
url: 'https://www.qrmaster.net/blog',
|
url: `${BASE_URL}/blog`,
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
@@ -186,9 +210,9 @@ export function faqPageSchema(faqs: FAQItem[]) {
|
|||||||
return {
|
return {
|
||||||
'@context': 'https://schema.org',
|
'@context': 'https://schema.org',
|
||||||
'@type': 'FAQPage',
|
'@type': 'FAQPage',
|
||||||
'@id': 'https://www.qrmaster.net/faq#faqpage',
|
'@id': `${BASE_URL}/faq#faqpage`,
|
||||||
inLanguage: 'en',
|
inLanguage: 'en',
|
||||||
mainEntityOfPage: 'https://www.qrmaster.net/faq',
|
mainEntityOfPage: `${BASE_URL}/faq`,
|
||||||
mainEntity: faqs.map((faq) => ({
|
mainEntity: faqs.map((faq) => ({
|
||||||
'@type': 'Question',
|
'@type': 'Question',
|
||||||
name: faq.question,
|
name: faq.question,
|
||||||
@@ -204,11 +228,11 @@ export function productSchema(product: { name: string; description: string; offe
|
|||||||
return {
|
return {
|
||||||
'@context': 'https://schema.org',
|
'@context': 'https://schema.org',
|
||||||
'@type': 'Product',
|
'@type': 'Product',
|
||||||
'@id': 'https://www.qrmaster.net/pricing#product',
|
'@id': `${BASE_URL}/pricing#product`,
|
||||||
name: product.name,
|
name: product.name,
|
||||||
description: product.description,
|
description: product.description,
|
||||||
inLanguage: 'en',
|
inLanguage: 'en',
|
||||||
mainEntityOfPage: 'https://www.qrmaster.net/pricing',
|
mainEntityOfPage: `${BASE_URL}/pricing`,
|
||||||
brand: {
|
brand: {
|
||||||
'@type': 'Organization',
|
'@type': 'Organization',
|
||||||
name: 'QR Master',
|
name: 'QR Master',
|
||||||
@@ -219,7 +243,7 @@ export function productSchema(product: { name: string; description: string; offe
|
|||||||
price: offer.price,
|
price: offer.price,
|
||||||
priceCurrency: offer.priceCurrency,
|
priceCurrency: offer.priceCurrency,
|
||||||
availability: offer.availability,
|
availability: offer.availability,
|
||||||
url: offer.url,
|
url: toAbsoluteUrl(offer.url),
|
||||||
})),
|
})),
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
@@ -228,18 +252,18 @@ export function howToSchema(task: HowToTask) {
|
|||||||
return {
|
return {
|
||||||
'@context': 'https://schema.org',
|
'@context': 'https://schema.org',
|
||||||
'@type': 'HowTo',
|
'@type': 'HowTo',
|
||||||
'@id': `https://www.qrmaster.net/blog/${task.name.toLowerCase().replace(/\s+/g, '-')}#howto`,
|
'@id': `${BASE_URL}/blog/${task.name.toLowerCase().replace(/\s+/g, '-')}#howto`,
|
||||||
name: task.name,
|
name: task.name,
|
||||||
description: task.description,
|
description: task.description,
|
||||||
inLanguage: 'en',
|
inLanguage: 'en',
|
||||||
mainEntityOfPage: `https://www.qrmaster.net/blog/${task.name.toLowerCase().replace(/\s+/g, '-')}`,
|
mainEntityOfPage: `${BASE_URL}/blog/${task.name.toLowerCase().replace(/\s+/g, '-')}`,
|
||||||
totalTime: task.totalTime || 'PT5M',
|
totalTime: task.totalTime || 'PT5M',
|
||||||
step: task.steps.map((step, index) => ({
|
step: task.steps.map((step, index) => ({
|
||||||
'@type': 'HowToStep',
|
'@type': 'HowToStep',
|
||||||
position: index + 1,
|
position: index + 1,
|
||||||
name: step.name,
|
name: step.name,
|
||||||
text: step.text,
|
text: step.text,
|
||||||
url: step.url,
|
url: step.url ? toAbsoluteUrl(step.url) : undefined,
|
||||||
})),
|
})),
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -25,7 +25,7 @@ export const createQRSchema = z.object({
|
|||||||
|
|
||||||
isStatic: z.boolean().optional(),
|
isStatic: z.boolean().optional(),
|
||||||
|
|
||||||
contentType: z.enum(['URL', 'VCARD', 'GEO', 'PHONE', 'SMS', 'WHATSAPP', 'TEXT', 'PDF', 'APP', 'COUPON', 'FEEDBACK'], {
|
contentType: z.enum(['URL', 'VCARD', 'GEO', 'PHONE', 'SMS', 'WHATSAPP', 'TEXT'], {
|
||||||
errorMap: () => ({ message: 'Invalid content type' })
|
errorMap: () => ({ message: 'Invalid content type' })
|
||||||
}),
|
}),
|
||||||
|
|
||||||
@@ -60,7 +60,7 @@ export const bulkQRSchema = z.object({
|
|||||||
z.object({
|
z.object({
|
||||||
title: z.string().min(1).max(100),
|
title: z.string().min(1).max(100),
|
||||||
content: z.string().min(1).max(5000),
|
content: z.string().min(1).max(5000),
|
||||||
contentType: z.enum(['URL', 'VCARD', 'GEO', 'PHONE', 'SMS', 'WHATSAPP', 'TEXT', 'PDF', 'APP', 'COUPON', 'FEEDBACK']),
|
contentType: z.enum(['URL', 'VCARD', 'GEO', 'PHONE', 'SMS', 'WHATSAPP', 'TEXT']),
|
||||||
})
|
})
|
||||||
).min(1, 'At least one QR code is required')
|
).min(1, 'At least one QR code is required')
|
||||||
.max(100, 'Maximum 100 QR codes per bulk creation'),
|
.max(100, 'Maximum 100 QR codes per bulk creation'),
|
||||||
|
|||||||
@@ -20,7 +20,6 @@ export function middleware(req: NextRequest) {
|
|||||||
'/bulk-qr-code-generator',
|
'/bulk-qr-code-generator',
|
||||||
'/qr-code-tracking',
|
'/qr-code-tracking',
|
||||||
'/reprint-calculator',
|
'/reprint-calculator',
|
||||||
'/barcode-generator',
|
|
||||||
];
|
];
|
||||||
|
|
||||||
// Check if path is public
|
// Check if path is public
|
||||||
|
|||||||
@@ -4,22 +4,21 @@
|
|||||||
|
|
||||||
@layer utilities {
|
@layer utilities {
|
||||||
|
|
||||||
/* Floating blob animation for hero background */
|
/* =======================
|
||||||
@keyframes blob {
|
ANIMATIONS
|
||||||
|
======================= */
|
||||||
|
|
||||||
0%,
|
/* Floating blob animation for hero background (DEPRECATED - use grid instead) */
|
||||||
100% {
|
@keyframes blob {
|
||||||
|
0%, 100% {
|
||||||
transform: translate(0, 0) scale(1);
|
transform: translate(0, 0) scale(1);
|
||||||
}
|
}
|
||||||
|
|
||||||
25% {
|
25% {
|
||||||
transform: translate(20px, -30px) scale(1.1);
|
transform: translate(20px, -30px) scale(1.1);
|
||||||
}
|
}
|
||||||
|
|
||||||
50% {
|
50% {
|
||||||
transform: translate(-20px, 20px) scale(0.9);
|
transform: translate(-20px, 20px) scale(0.9);
|
||||||
}
|
}
|
||||||
|
|
||||||
75% {
|
75% {
|
||||||
transform: translate(30px, 10px) scale(1.05);
|
transform: translate(30px, 10px) scale(1.05);
|
||||||
}
|
}
|
||||||
@@ -40,6 +39,147 @@
|
|||||||
.animation-delay-6000 {
|
.animation-delay-6000 {
|
||||||
animation-delay: 6s;
|
animation-delay: 6s;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* Grid dash animation for modern background */
|
||||||
|
@keyframes dashMove {
|
||||||
|
0% {
|
||||||
|
stroke-dashoffset: 0;
|
||||||
|
}
|
||||||
|
100% {
|
||||||
|
stroke-dashoffset: 24;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.animate-dash {
|
||||||
|
animation: dashMove 20s linear infinite;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Shimmer effect for loading/highlights */
|
||||||
|
@keyframes shimmer {
|
||||||
|
0% {
|
||||||
|
background-position: -200% 0;
|
||||||
|
}
|
||||||
|
100% {
|
||||||
|
background-position: 200% 0;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.animate-shimmer {
|
||||||
|
background: linear-gradient(
|
||||||
|
90deg,
|
||||||
|
transparent 0%,
|
||||||
|
rgba(255, 255, 255, 0.4) 50%,
|
||||||
|
transparent 100%
|
||||||
|
);
|
||||||
|
background-size: 200% 100%;
|
||||||
|
animation: shimmer 2s infinite;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Pulse glow for interactive elements */
|
||||||
|
@keyframes pulseGlow {
|
||||||
|
0%, 100% {
|
||||||
|
opacity: 0.7;
|
||||||
|
transform: scale(1);
|
||||||
|
}
|
||||||
|
50% {
|
||||||
|
opacity: 1;
|
||||||
|
transform: scale(1.05);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.animate-pulse-glow {
|
||||||
|
animation: pulseGlow 2s ease-in-out infinite;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Float animation for decorative elements */
|
||||||
|
@keyframes float {
|
||||||
|
0%, 100% {
|
||||||
|
transform: translateY(0px);
|
||||||
|
}
|
||||||
|
50% {
|
||||||
|
transform: translateY(-20px);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.animate-float {
|
||||||
|
animation: float 4s ease-in-out infinite;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* =======================
|
||||||
|
GLASSMORPHISM
|
||||||
|
======================= */
|
||||||
|
|
||||||
|
.glass {
|
||||||
|
background: rgba(255, 255, 255, 0.1);
|
||||||
|
backdrop-filter: blur(10px);
|
||||||
|
-webkit-backdrop-filter: blur(10px);
|
||||||
|
border: 1px solid rgba(255, 255, 255, 0.2);
|
||||||
|
box-shadow: 0 8px 32px 0 rgba(31, 38, 135, 0.07);
|
||||||
|
}
|
||||||
|
|
||||||
|
.glass-strong {
|
||||||
|
background: rgba(255, 255, 255, 0.25);
|
||||||
|
backdrop-filter: blur(20px);
|
||||||
|
-webkit-backdrop-filter: blur(20px);
|
||||||
|
border: 1px solid rgba(255, 255, 255, 0.3);
|
||||||
|
box-shadow: 0 8px 32px 0 rgba(31, 38, 135, 0.15);
|
||||||
|
}
|
||||||
|
|
||||||
|
.glass-dark {
|
||||||
|
background: rgba(0, 0, 0, 0.2);
|
||||||
|
backdrop-filter: blur(10px);
|
||||||
|
-webkit-backdrop-filter: blur(10px);
|
||||||
|
border: 1px solid rgba(255, 255, 255, 0.1);
|
||||||
|
}
|
||||||
|
|
||||||
|
/* =======================
|
||||||
|
ADVANCED SHADOWS
|
||||||
|
======================= */
|
||||||
|
|
||||||
|
.shadow-primary-sm {
|
||||||
|
box-shadow: 0 2px 8px rgba(99, 102, 241, 0.1);
|
||||||
|
}
|
||||||
|
|
||||||
|
.shadow-primary-md {
|
||||||
|
box-shadow: 0 4px 16px rgba(99, 102, 241, 0.15);
|
||||||
|
}
|
||||||
|
|
||||||
|
.shadow-primary-lg {
|
||||||
|
box-shadow: 0 20px 40px rgba(99, 102, 241, 0.2);
|
||||||
|
}
|
||||||
|
|
||||||
|
.shadow-success {
|
||||||
|
box-shadow: 0 8px 24px rgba(16, 185, 129, 0.2);
|
||||||
|
}
|
||||||
|
|
||||||
|
.shadow-warning {
|
||||||
|
box-shadow: 0 8px 24px rgba(245, 158, 11, 0.2);
|
||||||
|
}
|
||||||
|
|
||||||
|
.shadow-elevation-1 {
|
||||||
|
box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
|
||||||
|
}
|
||||||
|
|
||||||
|
.shadow-elevation-2 {
|
||||||
|
box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
|
||||||
|
}
|
||||||
|
|
||||||
|
.shadow-elevation-3 {
|
||||||
|
box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
|
||||||
|
}
|
||||||
|
|
||||||
|
.shadow-elevation-4 {
|
||||||
|
box-shadow: 0 12px 40px rgba(0, 0, 0, 0.15);
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Colored inner glow */
|
||||||
|
.glow-primary {
|
||||||
|
box-shadow: inset 0 0 20px rgba(99, 102, 241, 0.3);
|
||||||
|
}
|
||||||
|
|
||||||
|
.glow-success {
|
||||||
|
box-shadow: inset 0 0 20px rgba(16, 185, 129, 0.3);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
:root {
|
:root {
|
||||||
@@ -155,13 +295,82 @@ a {
|
|||||||
@apply animate-pulse bg-gray-200 rounded;
|
@apply animate-pulse bg-gray-200 rounded;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Gradient backgrounds */
|
/* =======================
|
||||||
|
PREMIUM GRADIENTS
|
||||||
|
======================= */
|
||||||
|
|
||||||
|
/* Primary gradients */
|
||||||
.gradient-primary {
|
.gradient-primary {
|
||||||
background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
|
background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.gradient-primary-vibrant {
|
||||||
|
background: linear-gradient(135deg, #6366f1 0%, #8b5cf6 50%, #d946ef 100%);
|
||||||
|
}
|
||||||
|
|
||||||
|
.gradient-primary-subtle {
|
||||||
|
background: linear-gradient(135deg, #eef2ff 0%, #f5f3ff 100%);
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Success gradients */
|
||||||
.gradient-success {
|
.gradient-success {
|
||||||
background: linear-gradient(135deg, #84fab0 0%, #8fd3f4 100%);
|
background: linear-gradient(135deg, #10b981 0%, #059669 100%);
|
||||||
|
}
|
||||||
|
|
||||||
|
.gradient-success-vibrant {
|
||||||
|
background: linear-gradient(135deg, #34d399 0%, #10b981 50%, #059669 100%);
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Accent gradients */
|
||||||
|
.gradient-accent {
|
||||||
|
background: linear-gradient(135deg, #06b6d4 0%, #3b82f6 100%);
|
||||||
|
}
|
||||||
|
|
||||||
|
.gradient-warm {
|
||||||
|
background: linear-gradient(135deg, #f59e0b 0%, #ef4444 100%);
|
||||||
|
}
|
||||||
|
|
||||||
|
.gradient-cool {
|
||||||
|
background: linear-gradient(135deg, #06b6d4 0%, #8b5cf6 100%);
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Gradient text */
|
||||||
|
.gradient-text {
|
||||||
|
background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
|
||||||
|
-webkit-background-clip: text;
|
||||||
|
-webkit-text-fill-color: transparent;
|
||||||
|
background-clip: text;
|
||||||
|
}
|
||||||
|
|
||||||
|
.gradient-text-vibrant {
|
||||||
|
background: linear-gradient(135deg, #6366f1 0%, #8b5cf6 50%, #d946ef 100%);
|
||||||
|
-webkit-background-clip: text;
|
||||||
|
-webkit-text-fill-color: transparent;
|
||||||
|
background-clip: text;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Gradient borders */
|
||||||
|
.gradient-border {
|
||||||
|
border: 2px solid transparent;
|
||||||
|
background-clip: padding-box, border-box;
|
||||||
|
background-origin: padding-box, border-box;
|
||||||
|
background-image: linear-gradient(white, white), linear-gradient(135deg, #667eea 0%, #764ba2 100%);
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Animated gradient background */
|
||||||
|
@keyframes gradientShift {
|
||||||
|
0%, 100% {
|
||||||
|
background-position: 0% 50%;
|
||||||
|
}
|
||||||
|
50% {
|
||||||
|
background-position: 100% 50%;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.gradient-animated {
|
||||||
|
background: linear-gradient(270deg, #667eea, #764ba2, #8b5cf6);
|
||||||
|
background-size: 200% 200%;
|
||||||
|
animation: gradientShift 8s ease infinite;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Chart container */
|
/* Chart container */
|
||||||
|
|||||||
2
src/types/next-auth.d.ts
vendored
@@ -4,10 +4,12 @@ declare module 'next-auth' {
|
|||||||
interface Session {
|
interface Session {
|
||||||
user: {
|
user: {
|
||||||
id: string;
|
id: string;
|
||||||
|
plan?: string | null;
|
||||||
} & DefaultSession['user'];
|
} & DefaultSession['user'];
|
||||||
}
|
}
|
||||||
|
|
||||||
interface User {
|
interface User {
|
||||||
id: string;
|
id: string;
|
||||||
|
plan?: string | null;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||