refactor: rename figlet app to ascii and update all references
This commit is contained in:
@@ -8,7 +8,7 @@ This file provides foundational context and instructions for Gemini CLI when wor
|
|||||||
|
|
||||||
1. **Color**: Advanced color theory, manipulation, and accessibility suite powered by `@valknarthing/pastel-wasm`.
|
1. **Color**: Advanced color theory, manipulation, and accessibility suite powered by `@valknarthing/pastel-wasm`.
|
||||||
2. **Units**: Smart unit converter supporting 187+ units across 23 categories, including a custom `tempo` measure.
|
2. **Units**: Smart unit converter supporting 187+ units across 23 categories, including a custom `tempo` measure.
|
||||||
3. **Figlet**: ASCII Art generator with 373 fonts and multi-format export.
|
3. **ASCII**: ASCII Art generator with 373 fonts and multi-format export.
|
||||||
4. **Media**: Browser-based file converter using **FFmpeg** and **ImageMagick** via WebAssembly (Zero server uploads).
|
4. **Media**: Browser-based file converter using **FFmpeg** and **ImageMagick** via WebAssembly (Zero server uploads).
|
||||||
|
|
||||||
## 🛠️ Tech Stack & Architecture
|
## 🛠️ Tech Stack & Architecture
|
||||||
@@ -26,7 +26,7 @@ This file provides foundational context and instructions for Gemini CLI when wor
|
|||||||
```bash
|
```bash
|
||||||
.
|
.
|
||||||
├── app/ # Next.js App Router
|
├── app/ # Next.js App Router
|
||||||
│ ├── (app)/ # Core Tool Pages (color, units, figlet, media)
|
│ ├── (app)/ # Core Tool Pages (color, units, ascii, media)
|
||||||
│ └── globals.css # Tailwind 4 configuration & global styles
|
│ └── globals.css # Tailwind 4 configuration & global styles
|
||||||
├── components/ # UI Components
|
├── components/ # UI Components
|
||||||
│ ├── [tool]/ # Tool-specific components (e.g., components/color/)
|
│ ├── [tool]/ # Tool-specific components (e.g., components/color/)
|
||||||
@@ -37,7 +37,7 @@ This file provides foundational context and instructions for Gemini CLI when wor
|
|||||||
│ └── utils/ # General utilities (cn, format, etc.)
|
│ └── utils/ # General utilities (cn, format, etc.)
|
||||||
├── public/ # Static assets
|
├── public/ # Static assets
|
||||||
│ ├── wasm/ # WASM binaries (ffmpeg, imagemagick)
|
│ ├── wasm/ # WASM binaries (ffmpeg, imagemagick)
|
||||||
│ └── fonts/ # Figlet fonts (.flf)
|
│ └── fonts/ # ASCII fonts (.flf)
|
||||||
└── types/ # TypeScript definitions
|
└── types/ # TypeScript definitions
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|||||||
10
README.md
10
README.md
@@ -30,7 +30,7 @@ A powerful, intuitive converter that understands the way you work.
|
|||||||
- **Visual Comparison**: Dynamic chart views for comparing scale across different units.
|
- **Visual Comparison**: Dynamic chart views for comparing scale across different units.
|
||||||
- **Favorites & History**: Save your most-used conversions for instant access.
|
- **Favorites & History**: Save your most-used conversions for instant access.
|
||||||
|
|
||||||
### ✍️ [Figlet](./app/(app)/figlet) — ASCII Art Generator
|
### ✍️ [ASCII](./app/(app)/ascii) — ASCII Art Generator
|
||||||
Retro-inspired text banners for terminals and documentation.
|
Retro-inspired text banners for terminals and documentation.
|
||||||
- **373 Fonts**: From classic `Standard` to complex 3D and cursive styles.
|
- **373 Fonts**: From classic `Standard` to complex 3D and cursive styles.
|
||||||
- **Real-time Preview**: See your ASCII art transform as you type.
|
- **Real-time Preview**: See your ASCII art transform as you type.
|
||||||
@@ -73,20 +73,20 @@ Privacy-first, local-only media conversion powered by WebAssembly.
|
|||||||
```bash
|
```bash
|
||||||
.
|
.
|
||||||
├── app/ # Next.js App Router (Pages & Layouts)
|
├── app/ # Next.js App Router (Pages & Layouts)
|
||||||
│ ├── (app)/ # Core Tool Pages (Color, Units, Figlet, Media)
|
│ ├── (app)/ # Core Tool Pages (Color, Units, ASCII, Media)
|
||||||
│ └── api/ # Backend API routes
|
│ └── api/ # Backend API routes
|
||||||
├── components/ # Reusable UI & Logic Components
|
├── components/ # Reusable UI & Logic Components
|
||||||
│ ├── color/ # Color-specific components
|
│ ├── color/ # Color-specific components
|
||||||
│ ├── units/ # Converter-specific components
|
│ ├── units/ # Converter-specific components
|
||||||
│ ├── figlet/ # ASCII-specific components
|
│ ├── ascii/ # ASCII-specific components
|
||||||
│ ├── media/ # Media conversion components
|
│ ├── media/ # Media conversion components
|
||||||
│ └── ui/ # Base Atomic Components (Buttons, Cards, etc.)
|
│ └── ui/ # Base Atomic Components (Buttons, Cards, etc.)
|
||||||
├── lib/ # Business Logic & Utilities
|
├── lib/ # Business Logic & Utilities
|
||||||
│ ├── color/ # WASM wrappers & Color logic
|
│ ├── color/ # WASM wrappers & Color logic
|
||||||
│ ├── units/ # Conversion algorithms
|
│ ├── units/ # Conversion algorithms
|
||||||
│ ├── figlet/ # Font loading & ASCII generation
|
│ ├── ascii/ # Font loading & ASCII generation
|
||||||
│ └── media/ # FFmpeg & ImageMagick WASM orchestration
|
│ └── media/ # FFmpeg & ImageMagick WASM orchestration
|
||||||
├── public/ # Static assets & Figlet fonts
|
├── public/ # Static assets & ASCII fonts
|
||||||
├── Dockerfile # Multi-stage Docker build
|
├── Dockerfile # Multi-stage Docker build
|
||||||
└── nginx.conf # Production Nginx configuration
|
└── nginx.conf # Production Nginx configuration
|
||||||
```
|
```
|
||||||
|
|||||||
@@ -1,13 +1,13 @@
|
|||||||
import { FigletConverter } from '@/components/figlet/FigletConverter';
|
import { ASCIIConverter } from '@/components/ascii/ASCIIConverter';
|
||||||
import { AppPage } from '@/components/layout/AppPage';
|
import { AppPage } from '@/components/layout/AppPage';
|
||||||
|
|
||||||
export default function FigletPage() {
|
export default function ASCIIPage() {
|
||||||
return (
|
return (
|
||||||
<AppPage
|
<AppPage
|
||||||
title="Figlet ASCII"
|
title="ASCII Art Generator"
|
||||||
description="ASCII Art Text Generator with 373 Fonts"
|
description="ASCII Art Text Generator with 373 Fonts"
|
||||||
>
|
>
|
||||||
<FigletConverter />
|
<ASCIIConverter />
|
||||||
</AppPage>
|
</AppPage>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
@@ -6,7 +6,7 @@ export const dynamic = 'force-static';
|
|||||||
|
|
||||||
export async function GET() {
|
export async function GET() {
|
||||||
try {
|
try {
|
||||||
const fontsDir = path.join(process.cwd(), 'public/fonts/figlet-fonts');
|
const fontsDir = path.join(process.cwd(), 'public/fonts/ascii-fonts');
|
||||||
const files = fs.readdirSync(fontsDir);
|
const files = fs.readdirSync(fontsDir);
|
||||||
|
|
||||||
const fonts = files
|
const fonts = files
|
||||||
@@ -16,7 +16,7 @@ export async function GET() {
|
|||||||
return {
|
return {
|
||||||
name,
|
name,
|
||||||
fileName: file,
|
fileName: file,
|
||||||
path: `/fonts/figlet-fonts/${file}`,
|
path: `/fonts/ascii-fonts/${file}`,
|
||||||
};
|
};
|
||||||
})
|
})
|
||||||
.sort((a, b) => a.name.localeCompare(b.name));
|
.sort((a, b) => a.name.localeCompare(b.name));
|
||||||
|
|||||||
@@ -16,7 +16,7 @@ export const UnitsIcon = (props: React.SVGProps<SVGSVGElement>) => (
|
|||||||
</svg>
|
</svg>
|
||||||
);
|
);
|
||||||
|
|
||||||
export const FigletIcon = (props: React.SVGProps<SVGSVGElement>) => (
|
export const ASCIIIcon = (props: React.SVGProps<SVGSVGElement>) => (
|
||||||
<svg {...props} fill="none" stroke="currentColor" viewBox="0 0 24 24">
|
<svg {...props} fill="none" stroke="currentColor" viewBox="0 0 24 24">
|
||||||
<path strokeLinecap="round" strokeLinejoin="round" strokeWidth={2} d="M3.5 13h6" />
|
<path strokeLinecap="round" strokeLinejoin="round" strokeWidth={2} d="M3.5 13h6" />
|
||||||
<path strokeLinecap="round" strokeLinejoin="round" strokeWidth={2} d="m2 16 4.5-9 4.5 9" />
|
<path strokeLinecap="round" strokeLinejoin="round" strokeWidth={2} d="m2 16 4.5-9 4.5 9" />
|
||||||
|
|||||||
@@ -2,7 +2,7 @@
|
|||||||
|
|
||||||
import { motion } from 'framer-motion';
|
import { motion } from 'framer-motion';
|
||||||
import ToolCard from './ToolCard';
|
import ToolCard from './ToolCard';
|
||||||
import { ColorIcon, UnitsIcon, FigletIcon, MediaIcon } from '@/components/AppIcons';
|
import { ColorIcon, UnitsIcon, ASCIIIcon, MediaIcon } from '@/components/AppIcons';
|
||||||
|
|
||||||
const tools = [
|
const tools = [
|
||||||
{
|
{
|
||||||
@@ -24,13 +24,13 @@ const tools = [
|
|||||||
icon: <UnitsIcon className="w-12 h-12 text-white" />,
|
icon: <UnitsIcon className="w-12 h-12 text-white" />,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
title: 'Figlet',
|
title: 'ASCII',
|
||||||
description: 'ASCII art text generator with 373 fonts. Create stunning text banners, terminal art, and retro designs with live preview and multiple export formats.',
|
description: 'ASCII art text generator with 373 fonts. Create stunning text banners, terminal art, and retro designs with live preview and multiple export formats.',
|
||||||
url: '/figlet',
|
url: '/ascii',
|
||||||
gradient: 'gradient-yellow-amber',
|
gradient: 'gradient-yellow-amber',
|
||||||
accentColor: '#eab308',
|
accentColor: '#eab308',
|
||||||
badges: ['Open Source', 'ASCII Art', 'Free'],
|
badges: ['Open Source', 'ASCII Art', 'Free'],
|
||||||
icon: <FigletIcon className="w-12 h-12 text-white" />,
|
icon: <ASCIIIcon className="w-12 h-12 text-white" />,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
title: 'Media',
|
title: 'Media',
|
||||||
|
|||||||
@@ -4,21 +4,21 @@ import * as React from 'react';
|
|||||||
import { TextInput } from './TextInput';
|
import { TextInput } from './TextInput';
|
||||||
import { FontPreview } from './FontPreview';
|
import { FontPreview } from './FontPreview';
|
||||||
import { FontSelector } from './FontSelector';
|
import { FontSelector } from './FontSelector';
|
||||||
import { textToAscii } from '@/lib/figlet/figletService';
|
import { textToAscii } from '@/lib/ascii/asciiService';
|
||||||
import { getFontList } from '@/lib/figlet/fontLoader';
|
import { getFontList } from '@/lib/ascii/fontLoader';
|
||||||
import { debounce } from '@/lib/utils/debounce';
|
import { debounce } from '@/lib/utils/debounce';
|
||||||
import { addRecentFont } from '@/lib/storage/favorites';
|
import { addRecentFont } from '@/lib/storage/favorites';
|
||||||
import { decodeFromUrl, updateUrl, getShareableUrl } from '@/lib/utils/urlSharing';
|
import { decodeFromUrl, updateUrl, getShareableUrl } from '@/lib/utils/urlSharing';
|
||||||
import { toast } from 'sonner';
|
import { toast } from 'sonner';
|
||||||
import type { FigletFont } from '@/types/figlet';
|
import type { ASCIIFont } from '@/types/ascii';
|
||||||
import { Car } from 'lucide-react';
|
import { Car } from 'lucide-react';
|
||||||
import { Card, CardContent } from '../ui/card';
|
import { Card, CardContent } from '../ui/card';
|
||||||
|
|
||||||
export function FigletConverter() {
|
export function ASCIIConverter() {
|
||||||
const [text, setText] = React.useState('Figlet');
|
const [text, setText] = React.useState('ASCII');
|
||||||
const [selectedFont, setSelectedFont] = React.useState('Standard');
|
const [selectedFont, setSelectedFont] = React.useState('Standard');
|
||||||
const [asciiArt, setAsciiArt] = React.useState('');
|
const [asciiArt, setAsciiArt] = React.useState('');
|
||||||
const [fonts, setFonts] = React.useState<FigletFont[]>([]);
|
const [fonts, setFonts] = React.useState<ASCIIFont[]>([]);
|
||||||
const [isLoading, setIsLoading] = React.useState(false);
|
const [isLoading, setIsLoading] = React.useState(false);
|
||||||
|
|
||||||
// Load fonts and check URL params on mount
|
// Load fonts and check URL params on mount
|
||||||
@@ -88,7 +88,7 @@ export function FigletConverter() {
|
|||||||
const url = URL.createObjectURL(blob);
|
const url = URL.createObjectURL(blob);
|
||||||
const a = document.createElement('a');
|
const a = document.createElement('a');
|
||||||
a.href = url;
|
a.href = url;
|
||||||
a.download = `figlet-${selectedFont}-${Date.now()}.txt`;
|
a.download = `ascii-${selectedFont}-${Date.now()}.txt`;
|
||||||
document.body.appendChild(a);
|
document.body.appendChild(a);
|
||||||
a.click();
|
a.click();
|
||||||
document.body.removeChild(a);
|
document.body.removeChild(a);
|
||||||
@@ -45,7 +45,7 @@ export function FontPreview({ text, font, isLoading, onCopy, onDownload, onShare
|
|||||||
});
|
});
|
||||||
|
|
||||||
const link = document.createElement('a');
|
const link = document.createElement('a');
|
||||||
link.download = `figlet-${font || 'export'}-${Date.now()}.png`;
|
link.download = `ascii-${font || 'export'}-${Date.now()}.png`;
|
||||||
link.href = dataUrl;
|
link.href = dataUrl;
|
||||||
link.click();
|
link.click();
|
||||||
|
|
||||||
@@ -14,11 +14,11 @@ import {
|
|||||||
import { Search, X, Heart, Clock, List, Shuffle } from 'lucide-react';
|
import { Search, X, Heart, Clock, List, Shuffle } from 'lucide-react';
|
||||||
import { cn } from '@/lib/utils/cn';
|
import { cn } from '@/lib/utils/cn';
|
||||||
import { Button } from '@/components/ui/button';
|
import { Button } from '@/components/ui/button';
|
||||||
import type { FigletFont } from '@/types/figlet';
|
import type { ASCIIFont } from '@/types/ascii';
|
||||||
import { getFavorites, getRecentFonts, toggleFavorite, isFavorite } from '@/lib/storage/favorites';
|
import { getFavorites, getRecentFonts, toggleFavorite, isFavorite } from '@/lib/storage/favorites';
|
||||||
|
|
||||||
export interface FontSelectorProps {
|
export interface FontSelectorProps {
|
||||||
fonts: FigletFont[];
|
fonts: ASCIIFont[];
|
||||||
selectedFont: string;
|
selectedFont: string;
|
||||||
onSelectFont: (fontName: string) => void;
|
onSelectFont: (fontName: string) => void;
|
||||||
onRandomFont?: () => void;
|
onRandomFont?: () => void;
|
||||||
@@ -17,7 +17,7 @@ import { cn } from '@/lib/utils/cn';
|
|||||||
import Logo from '@/components/Logo';
|
import Logo from '@/components/Logo';
|
||||||
import { useSidebar } from './SidebarProvider';
|
import { useSidebar } from './SidebarProvider';
|
||||||
import { Button } from '@/components/ui/button';
|
import { Button } from '@/components/ui/button';
|
||||||
import { ColorIcon, UnitsIcon, FigletIcon, MediaIcon } from '@/components/AppIcons';
|
import { ColorIcon, UnitsIcon, ASCIIIcon, MediaIcon } from '@/components/AppIcons';
|
||||||
|
|
||||||
interface NavItem {
|
interface NavItem {
|
||||||
title: string;
|
title: string;
|
||||||
@@ -41,9 +41,9 @@ const navigation: NavGroup[] = [
|
|||||||
icon: <UnitsIcon className="h-4 w-4" />
|
icon: <UnitsIcon className="h-4 w-4" />
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
title: 'Figlet ASCII',
|
title: 'ASCII Art',
|
||||||
href: '/figlet',
|
href: '/ascii',
|
||||||
icon: <FigletIcon className="h-4 w-4" />
|
icon: <ASCIIIcon className="h-4 w-4" />
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
title: 'Color Manipulation',
|
title: 'Color Manipulation',
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
'use client';
|
'use client';
|
||||||
|
|
||||||
import figlet from 'figlet';
|
import figlet from 'figlet';
|
||||||
import type { FigletOptions } from '@/types/figlet';
|
import type { ASCIIOptions } from '@/types/ascii';
|
||||||
import { loadFont } from './fontLoader';
|
import { loadFont } from './fontLoader';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -10,7 +10,7 @@ import { loadFont } from './fontLoader';
|
|||||||
export async function textToAscii(
|
export async function textToAscii(
|
||||||
text: string,
|
text: string,
|
||||||
fontName: string = 'Standard',
|
fontName: string = 'Standard',
|
||||||
options: FigletOptions = {}
|
options: ASCIIOptions = {}
|
||||||
): Promise<string> {
|
): Promise<string> {
|
||||||
if (!text) {
|
if (!text) {
|
||||||
return '';
|
return '';
|
||||||
@@ -59,7 +59,7 @@ export async function textToAscii(
|
|||||||
export function textToAsciiSync(
|
export function textToAsciiSync(
|
||||||
text: string,
|
text: string,
|
||||||
fontName: string = 'Standard',
|
fontName: string = 'Standard',
|
||||||
options: FigletOptions = {}
|
options: ASCIIOptions = {}
|
||||||
): string {
|
): string {
|
||||||
if (!text) {
|
if (!text) {
|
||||||
return '';
|
return '';
|
||||||
@@ -1,18 +1,18 @@
|
|||||||
import type { FigletFont } from '@/types/figlet';
|
import type { ASCIIFont } from '@/types/ascii';
|
||||||
|
|
||||||
// Cache for loaded fonts
|
// Cache for loaded fonts
|
||||||
const fontCache = new Map<string, string>();
|
const fontCache = new Map<string, string>();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Get list of all available figlet fonts
|
* Get list of all available ascii fonts
|
||||||
*/
|
*/
|
||||||
export async function getFontList(): Promise<FigletFont[]> {
|
export async function getFontList(): Promise<ASCIIFont[]> {
|
||||||
try {
|
try {
|
||||||
const response = await fetch('/api/fonts');
|
const response = await fetch('/api/fonts');
|
||||||
if (!response.ok) {
|
if (!response.ok) {
|
||||||
throw new Error('Failed to fetch font list');
|
throw new Error('Failed to fetch font list');
|
||||||
}
|
}
|
||||||
const fonts: FigletFont[] = await response.json();
|
const fonts: ASCIIFont[] = await response.json();
|
||||||
return fonts;
|
return fonts;
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
console.error('Error fetching font list:', error);
|
console.error('Error fetching font list:', error);
|
||||||
@@ -30,7 +30,7 @@ export async function loadFont(fontName: string): Promise<string | null> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
try {
|
try {
|
||||||
const response = await fetch(`/fonts/figlet-fonts/${fontName}.flf`);
|
const response = await fetch(`/fonts/ascii-fonts/${fontName}.flf`);
|
||||||
if (!response.ok) {
|
if (!response.ok) {
|
||||||
throw new Error(`Failed to load font: ${fontName}`);
|
throw new Error(`Failed to load font: ${fontName}`);
|
||||||
}
|
}
|
||||||
@@ -1,7 +1,7 @@
|
|||||||
'use client';
|
'use client';
|
||||||
|
|
||||||
const FAVORITES_KEY = 'figlet-ui-favorites';
|
const FAVORITES_KEY = 'ascii-ui-favorites';
|
||||||
const RECENT_FONTS_KEY = 'figlet-ui-recent-fonts';
|
const RECENT_FONTS_KEY = 'ascii-ui-recent-fonts';
|
||||||
const MAX_RECENT = 10;
|
const MAX_RECENT = 10;
|
||||||
|
|
||||||
export function getFavorites(): string[] {
|
export function getFavorites(): string[] {
|
||||||
|
|||||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user