Spaces:
Sleeping
Sleeping
Update client/src/App.jsx
Browse files- client/src/App.jsx +9 -6
client/src/App.jsx
CHANGED
|
@@ -7,11 +7,13 @@ const SUPABASE_ANON_KEY = "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJzdXBh
|
|
| 7 |
|
| 8 |
const supabase = createClient(SUPABASE_URL, SUPABASE_ANON_KEY);
|
| 9 |
|
| 10 |
-
//
|
|
|
|
|
|
|
| 11 |
const AI_MODELS = [
|
| 12 |
-
{ id: 'openai/dall-e-3',
|
| 13 |
-
{ id: '
|
| 14 |
-
{ id: '
|
| 15 |
];
|
| 16 |
|
| 17 |
const ASPECT_RATIOS = [
|
|
@@ -43,7 +45,7 @@ function App() {
|
|
| 43 |
// PWA Detection Logic
|
| 44 |
const isIosDevice = /ipad|iphone|ipod/.test(navigator.userAgent.toLowerCase()) && !window.MSStream;
|
| 45 |
|
| 46 |
-
//
|
| 47 |
const isInStandaloneMode = window.matchMedia('(display-mode: standalone)').matches || window.navigator.standalone === true;
|
| 48 |
|
| 49 |
if (isIosDevice && !isInStandaloneMode) {
|
|
@@ -100,7 +102,7 @@ function App() {
|
|
| 100 |
if (inputImage && !selectedModel.includes('dall-e')) {
|
| 101 |
imgElement = await window.puter.ai.txt2img(finalPrompt, { model: selectedModel, image: inputImage });
|
| 102 |
} else {
|
| 103 |
-
if (inputImage) alert("
|
| 104 |
imgElement = await window.puter.ai.txt2img(finalPrompt, { model: selectedModel });
|
| 105 |
}
|
| 106 |
setImageSrc(imgElement.src);
|
|
@@ -144,6 +146,7 @@ function App() {
|
|
| 144 |
<select className="glass-pill" value={selectedRatio} onChange={(e) => setSelectedRatio(e.target.value)}>
|
| 145 |
{ASPECT_RATIOS.map(r => <option key={r.id} value={r.id}>{r.name}</option>)}
|
| 146 |
</select>
|
|
|
|
| 147 |
<select className="glass-pill" value={selectedModel} onChange={(e) => setSelectedModel(e.target.value)} style={{maxWidth:'130px'}}>
|
| 148 |
{AI_MODELS.map(m => <option key={m.id} value={m.id}>{m.name}</option>)}
|
| 149 |
</select>
|
|
|
|
| 7 |
|
| 8 |
const supabase = createClient(SUPABASE_URL, SUPABASE_ANON_KEY);
|
| 9 |
|
| 10 |
+
// --- TEK BRANDED MODEL LIST ---
|
| 11 |
+
// The 'id' must remain the original Puter ID for functionality.
|
| 12 |
+
// The 'name' is what displays in the UI dropdown.
|
| 13 |
const AI_MODELS = [
|
| 14 |
+
{ id: 'openai/dall-e-3', name: 'TEK 3 (Best)' },
|
| 15 |
+
{ id: 'google/imagen-4.0-preview', name: 'TEK 4 HD (Real)' },
|
| 16 |
+
{ id: 'gemini-2.5-flash-image', name: 'TEK NANO HD (Fast)' },
|
| 17 |
];
|
| 18 |
|
| 19 |
const ASPECT_RATIOS = [
|
|
|
|
| 45 |
// PWA Detection Logic
|
| 46 |
const isIosDevice = /ipad|iphone|ipod/.test(navigator.userAgent.toLowerCase()) && !window.MSStream;
|
| 47 |
|
| 48 |
+
// Check if running in standalone mode
|
| 49 |
const isInStandaloneMode = window.matchMedia('(display-mode: standalone)').matches || window.navigator.standalone === true;
|
| 50 |
|
| 51 |
if (isIosDevice && !isInStandaloneMode) {
|
|
|
|
| 102 |
if (inputImage && !selectedModel.includes('dall-e')) {
|
| 103 |
imgElement = await window.puter.ai.txt2img(finalPrompt, { model: selectedModel, image: inputImage });
|
| 104 |
} else {
|
| 105 |
+
if (inputImage) alert("Note: TEK 3 ignores input images for now.");
|
| 106 |
imgElement = await window.puter.ai.txt2img(finalPrompt, { model: selectedModel });
|
| 107 |
}
|
| 108 |
setImageSrc(imgElement.src);
|
|
|
|
| 146 |
<select className="glass-pill" value={selectedRatio} onChange={(e) => setSelectedRatio(e.target.value)}>
|
| 147 |
{ASPECT_RATIOS.map(r => <option key={r.id} value={r.id}>{r.name}</option>)}
|
| 148 |
</select>
|
| 149 |
+
{/* The dropdown now shows your custom names */}
|
| 150 |
<select className="glass-pill" value={selectedModel} onChange={(e) => setSelectedModel(e.target.value)} style={{maxWidth:'130px'}}>
|
| 151 |
{AI_MODELS.map(m => <option key={m.id} value={m.id}>{m.name}</option>)}
|
| 152 |
</select>
|