refactor: rename figlet app to ascii and update all references
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
'use client';
|
||||
|
||||
import figlet from 'figlet';
|
||||
import type { FigletOptions } from '@/types/figlet';
|
||||
import type { ASCIIOptions } from '@/types/ascii';
|
||||
import { loadFont } from './fontLoader';
|
||||
|
||||
/**
|
||||
@@ -10,7 +10,7 @@ import { loadFont } from './fontLoader';
|
||||
export async function textToAscii(
|
||||
text: string,
|
||||
fontName: string = 'Standard',
|
||||
options: FigletOptions = {}
|
||||
options: ASCIIOptions = {}
|
||||
): Promise<string> {
|
||||
if (!text) {
|
||||
return '';
|
||||
@@ -59,7 +59,7 @@ export async function textToAscii(
|
||||
export function textToAsciiSync(
|
||||
text: string,
|
||||
fontName: string = 'Standard',
|
||||
options: FigletOptions = {}
|
||||
options: ASCIIOptions = {}
|
||||
): string {
|
||||
if (!text) {
|
||||
return '';
|
||||
@@ -1,18 +1,18 @@
|
||||
import type { FigletFont } from '@/types/figlet';
|
||||
import type { ASCIIFont } from '@/types/ascii';
|
||||
|
||||
// Cache for loaded fonts
|
||||
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 {
|
||||
const response = await fetch('/api/fonts');
|
||||
if (!response.ok) {
|
||||
throw new Error('Failed to fetch font list');
|
||||
}
|
||||
const fonts: FigletFont[] = await response.json();
|
||||
const fonts: ASCIIFont[] = await response.json();
|
||||
return fonts;
|
||||
} catch (error) {
|
||||
console.error('Error fetching font list:', error);
|
||||
@@ -30,7 +30,7 @@ export async function loadFont(fontName: string): Promise<string | null> {
|
||||
}
|
||||
|
||||
try {
|
||||
const response = await fetch(`/fonts/figlet-fonts/${fontName}.flf`);
|
||||
const response = await fetch(`/fonts/ascii-fonts/${fontName}.flf`);
|
||||
if (!response.ok) {
|
||||
throw new Error(`Failed to load font: ${fontName}`);
|
||||
}
|
||||
@@ -1,7 +1,7 @@
|
||||
'use client';
|
||||
|
||||
const FAVORITES_KEY = 'figlet-ui-favorites';
|
||||
const RECENT_FONTS_KEY = 'figlet-ui-recent-fonts';
|
||||
const FAVORITES_KEY = 'ascii-ui-favorites';
|
||||
const RECENT_FONTS_KEY = 'ascii-ui-recent-fonts';
|
||||
const MAX_RECENT = 10;
|
||||
|
||||
export function getFavorites(): string[] {
|
||||
|
||||
Reference in New Issue
Block a user