import React, { useState } from "https://esm.sh/react";
import { createRoot } from "https://esm.sh/react-dom/client";
const popularCombos = [
{ name: "Alphabet", text: "abcde fghijk lmnop qrstu vwxyz" },
{ name: "Numbers", text: "0123456789" },
{ name: "Symbols", text: "!@#$%^&*()_+-=[]{}|;:,.<>?" },
{ name: "Pangram", text: "The quick brown fox jumps over the lazy dog" },
];
const fontOptions = [
"Code Pro Light",
"ET Book",
"IBM Plex Mono",
"Inter",
"Roboto",
"Lora",
"Playfair Display",
"Montserrat",
"Open Sans",
"Fira Sans",
];
const colorThemes = [
{ name: "Default", bg: "#000", text: "#ddd" },
{ name: "Light", bg: "#fff", text: "#000" },
{ name: "Blue", bg: "#001f3f", text: "#7FDBFF" },
{ name: "Green", bg: "#2ECC40", text: "#001f3f" },
{ name: "Red", bg: "#FF4136", text: "#FFDC00" },
{ name: "Purple", bg: "#B10DC9", text: "#F012BE" },
{ name: "Orange", bg: "#FF851B", text: "#0074D9" },
{ name: "Gray", bg: "#AAAAAA", text: "#111111" },
{ name: "Teal", bg: "#39CCCC", text: "#001f3f" },
{ name: "Olive", bg: "#3D9970", text: "#01FF70" },
];
function App() {
const [customText, setCustomText] = useState("abcde fghijk lmnop qrstu vwxyz");
const [font, setFont] = useState("all font");
const [theme, setTheme] = useState(colorThemes[0]);
return (
<div style={{ backgroundColor: theme.bg, color: theme.text }}>
<header>
all fonts
<span className="header-number">val.town</span>
</header>
<div className="pill-container">
{popularCombos.map((combo, index) => (
<button
key={index}
className="pill"
onClick={() => setCustomText(combo.text)}
>
{combo.name}
</button>
))}
</div>
<div className="pill-container">
{fontOptions.map((fontOption, index) => (
<button
key={index}
className="pill"
onClick={() => setFont(fontOption)}
>
{fontOption}
</button>
))}
</div>
<div className="pill-container">
{colorThemes.map((colorTheme, index) => (
<button
key={index}
className="pill"
onClick={() => setTheme(colorTheme)}
style={{ backgroundColor: colorTheme.bg, color: colorTheme.text }}
>
{colorTheme.name}
</button>
))}
</div>
<article style={{ fontFamily: font }}>{customText}</article>
<div className="input-container">
<input
type="text"
id="customText"
placeholder="Enter custom text"
value={customText}
onChange={(e) => setCustomText(e.target.value)}
style={{ backgroundColor: theme.bg, color: theme.text }}
/>
</div>
<footer>