Prompt_Master / index.html
thenightfury's picture
Update index.html
5557c4a verified
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>TamilReal • Portrait Prompt Studio</title>
<script src="https://cdn.tailwindcss.com"></script>
<!-- Font: Inter for body text -->
<link href="https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600&display=swap" rel="stylesheet">
<link href="https://fonts.googleapis.com/css2?family=Playfair+Display:wght@700&family=Poppins:wght@400;500;600&display=swap" rel="stylesheet">
<style>
/* Accessibility: focus styles for keyboard navigation */
:focus-visible {
outline: none;
box-shadow: 0 0 0 3px var(--terracotta);
border-radius: 4px;
}
/* General interactive element focus support */
button.clay-btn:focus, button.clay-btn:focus-visible,
.clay-tab:focus, .clay-tab:focus-visible,
.clay-input:focus, .clay-input:focus-visible,
.clay-select:focus, .clay-select:focus-visible {
outline: none;
box-shadow: 0 0 0 3px var(--terracotta);
}
/* Task 1: Fluid full-bleed container */
.main-container {
width: 100vw;
margin-left: calc(-50vw + 50%);
padding-left: 2rem; /* Increased padding */
padding-right: 2rem;
box-sizing: border-box;
}
/* Content inner width control */
.content-inner {
max-width: 1200px;
margin: 0 auto;
}
/* Content0 full width styling - no borders */
#content0 {
width: 100%;
padding-left: 2rem;
padding-right: 2rem;
padding-top: 1.5rem;
padding-bottom: 1.5rem;
box-sizing: border-box;
border: none;
border-radius: 10px;
}
@media (max-width: 768px) {
#content0 {
padding-left: 1rem;
padding-right: 1rem;
}
}
/* Content1 and Content2 - same styling as content0 */
#content1, #content2 {
width: 100%;
padding-left: 2rem;
padding-right: 2rem;
padding-top: 1.5rem;
padding-bottom: 1.5rem;
box-sizing: border-box;
border: none;
border-radius: 10px;
}
@media (max-width: 768px) {
#content1, #content2 {
padding-left: 1rem;
padding-right: 1rem;
}
}
/* Identity Anchor full width */
.identity-anchor {
width: 100%;
box-sizing: border-box;
}
/* Claymorphism Theme (Default) */
:root, [data-theme="clay"] {
--bg: #2c221b;
--clay: #3f2a21;
--terracotta: #d9775a;
--terracotta-dark: #b56347;
--input-bg: #2c221b;
--input-text: #e8e0d8;
--tab-bg: rgba(0,0,0,0.25);
--tab-text: #b8a090;
--tab-hover: rgba(0,0,0,0.35);
--title-gradient: linear-gradient(135deg, var(--terracotta), #f4a261);
--shadow-sm: 5px 5px 12px rgba(0,0,0,0.35), -3px -3px 10px rgba(255,255,255,0.12);
--shadow-lg: 10px 10px 24px rgba(0,0,0,0.35), -10px -10px 24px rgba(80,60,50,0.2);
--shadow-inset: inset 4px 4px 10px rgba(0,0,0,0.45), inset -3px -3px 8px rgba(80,60,50,0.2);
--border-subtle: rgba(255,255,255,0.08);
--card-radius: 2.75rem;
--btn-radius: 9999px;
--focus-ring: 0 0 0 2px var(--terracotta);
--font-body: Inter, system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
--font-title: "Playfair Display", serif;
}
body {
font-family: var(--font-body);
background: var(--bg);
color: var(--input-text);
transition: background 0.3s ease, color 0.3s ease;
}
.clay-title {
font-family: var(--font-title);
background: var(--title-gradient);
-webkit-background-clip: text;
-webkit-text-fill-color: transparent;
background-clip: text;
}
.clay-card {
background: var(--clay);
border-radius: var(--card-radius);
box-shadow: var(--shadow-lg), inset 0 0 0 1px var(--border-subtle);
transition: all 0.3s ease;
}
.clay-input, .clay-select {
background: var(--input-bg);
border: none;
border-radius: 2rem;
box-shadow: var(--shadow-inset);
color: var(--input-text);
padding: 0.75rem 1.25rem;
transition: all 0.2s ease;
}
.clay-input:focus, .clay-select:focus {
outline: none;
box-shadow: var(--shadow-inset), var(--focus-ring);
}
/* Claymorphism specific refinements */
[data-theme="clay"] .clay-card {
position: relative;
overflow: hidden;
}
[data-theme="clay"] .clay-card::before {
content: '';
position: absolute;
inset: 0;
background:
radial-gradient(circle at 30% 20%, rgba(255,255,255,0.03) 0%, transparent 50%),
radial-gradient(circle at 70% 80%, rgba(0,0,0,0.05) 0%, transparent 50%);
pointer-events: none;
}
.clay-btn {
background: linear-gradient(145deg, var(--terracotta), var(--terracotta-dark));
border: none;
border-radius: var(--btn-radius);
color: white;
padding: 0.75rem 2rem;
font-weight: 600;
cursor: pointer;
transition: all 0.2s ease;
box-shadow: var(--shadow-sm);
}
.clay-btn:hover {
transform: translateY(-2px) scale(1.02);
box-shadow: 6px 6px 14px rgba(0,0,0,0.35), -3px -3px 10px rgba(255,255,255,0.12);
}
.clay-btn:active {
transform: translateY(0) scale(0.98);
}
.clay-tab {
background: var(--tab-bg);
border: none;
border-radius: 15px;
color: var(--tab-text);
padding: 0.6rem 1.5rem;
font-weight: 500;
cursor: pointer;
transition: all 0.2s ease;
}
.clay-tab:hover {
color: var(--input-text);
background: var(--tab-hover);
}
.clay-tab-active {
background: var(--terracotta);
color: white;
transform: scale(1.08);
box-shadow: 0 4px 12px rgba(217,119,90,0.4);
border-radius: 15px;
}
.clay-modal {
background: var(--clay);
border-radius: 1.5rem;
box-shadow: 0 25px 50px rgba(0,0,0,0.5);
}
.identity-warn {
background: #7f1d1d;
color: #fecaca;
padding: 0.25rem 0.75rem;
border-radius: 9999px;
font-size: 0.75rem;
font-weight: 500;
}
.enhancer-note {
color: #fbbf24;
border: 1px solid #fbbf24;
padding: 0.25rem 0.5rem;
border-radius: 0.375rem;
font-size: 0.7rem;
}
.hidden { display: none !important; }
#toast {
position: fixed;
bottom: 2rem;
left: 50%;
transform: translateX(-50%);
background: #1f2937;
color: white;
padding: 1rem 2rem;
border-radius: 0.75rem;
box-shadow: 0 10px 25px rgba(0,0,0,0.3);
z-index: 100;
min-width: 280px;
text-align: center;
}
@keyframes toastPop {
from { transform: translate(-50%, 30px); opacity: 0; }
to { transform: translate(-50%, 0); opacity: 1; }
}
.toast-animate {
animation: toastPop 0.3s ease-out;
}
/* Theme: Glassmorphism */
[data-theme="glass"] {
--bg: linear-gradient(135deg, #0f172a 0%, #1e1b4b 50%, #0f172a 100%);
--clay: rgba(255,255,255,0.20);
--input-bg: rgba(255,255,255,0.15);
--input-text: #e2e8f0;
--tab-bg: rgba(255,255,255,0.15);
--tab-text: #cbd5e1;
--tab-hover: rgba(255,255,255,0.25);
--terracotta: #818cf8;
--terracotta-dark: #6366f1;
--title-gradient: linear-gradient(135deg, #a5b4fc, #818cf8);
--shadow-sm: 0 8px 20px rgba(99,102,241,0.3);
--shadow-lg: 0 16px 40px rgba(0,0,0,0.25);
--shadow-inset: none;
--border-subtle: rgba(255,255,255,0.2);
--card-radius: 1.5rem;
--btn-radius: 9999px;
--font-body: Inter, system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
--font-title: "Playfair Display", serif;
--focus-ring: 0 0 0 2px #818cf8;
}
[data-theme="glass"] .clay-card {
background: rgba(255,255,255,0.20);
backdrop-filter: blur(20px) saturate(180%);
-webkit-backdrop-filter: blur(20px) saturate(180%);
border: 1px solid rgba(255,255,255,0.2);
box-shadow: var(--shadow-lg), 0 0 40px rgba(99,102,241,0.15);
}
[data-theme="glass"] .clay-input, [data-theme="glass"] .clay-select {
background: rgba(255,255,255,0.15);
border: 1px solid rgba(255,255,255,0.25);
box-shadow: none;
color: #e2e8f0;
}
[data-theme="glass"] .clay-input::placeholder, [data-theme="glass"] .clay-select option {
color: rgba(226, 232, 240, 0.6);
}
[data-theme="glass"] .clay-input:focus, [data-theme="glass"] .clay-select:focus {
border-color: rgba(129,140,248,0.6);
box-shadow: 0 0 0 3px rgba(129,140,248,0.2);
}
[data-theme="glass"] .clay-select {
color: #e2e8f0;
}
[data-theme="glass"] .clay-select option {
background: #1e1b4b;
color: #e2e8f0;
}
[data-theme="glass"] .clay-tab-active {
background: linear-gradient(145deg, #818cf8, #6366f1);
box-shadow: 0 6px 20px rgba(99,102,241,0.5);
}
[data-theme="glass"] .clay-modal {
background: rgba(30,27,75,0.85);
backdrop-filter: blur(30px) saturate(150%);
-webkit-backdrop-filter: blur(30px) saturate(150%);
border: 1px solid rgba(255,255,255,0.2);
}
[data-theme="glass"] .clay-tab-active {
background: linear-gradient(145deg, #6366f1, #4f46e5);
box-shadow: 0 4px 15px rgba(99,102,241,0.4);
}
[data-theme="glass"] .clay-modal {
background: rgba(30,27,75,0.9);
backdrop-filter: blur(20px);
border: 1px solid var(--border-subtle);
}
/* Theme: Neumorphism */
[data-theme="neo"] {
--bg: #e6ded3;
--clay: #e6ded3;
--input-bg: #e6ded3;
--input-text: #4a4039;
--tab-bg: #e6ded3;
--tab-text: #6b5e52;
--tab-hover: rgba(0,0,0,0.05);
--terracotta: #d9775a;
--terracotta-dark: #c06848;
--title-gradient: linear-gradient(135deg, #8b5a3c, #a67c52);
--shadow-sm: 5px 5px 12px #b8aea3, -5px -5px 12px #ffffff;
--shadow-lg: 10px 10px 24px #b8aea3, -10px -10px 24px #ffffff;
--shadow-inset: inset 4px 4px 10px #b8aea3, inset -4px -4px 10px #ffffff;
--border-subtle: transparent;
--card-radius: 1.5rem;
--btn-radius: 1rem;
--focus-ring: 0 0 0 2px #d9775a;
--font-body: Inter, system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
--font-title: "Playfair Display", serif;
}
[data-theme="neo"] .clay-card {
box-shadow: var(--shadow-lg), var(--shadow-inset);
}
[data-theme="neo"] .clay-tab {
box-shadow: 4px 4px 8px #b8aea3, -4px -4px 8px #ffffff;
}
[data-theme="neo"] .clay-tab-active {
box-shadow: inset 3px 3px 6px rgba(0,0,0,0.2);
background: var(--terracotta);
color: white;
}
[data-theme="neo"] .clay-input, [data-theme="neo"] .clay-select {
border-radius: 1rem;
box-shadow: var(--shadow-inset);
}
[data-theme="neo"] .clay-input:focus, [data-theme="neo"] .clay-select:focus {
box-shadow: inset 4px 4px 10px #b8aea3, inset -4px -4px 10px #ffffff, 0 0 0 2px rgba(217,119,90,0.3);
}
/* Theme: Skeuomorphism */
[data-theme="skeuo"] {
--bg: repeating-linear-gradient(45deg, #3d2914 0%, #3d2914 2px, #4a3420 2px, #4a3420 4px);
--clay: linear-gradient(145deg, #4a3420, #3d2914);
--input-bg: linear-gradient(145deg, #3d2914, #2a1d10);
--input-text: #d4c5b0;
--tab-bg: linear-gradient(145deg, #3d2914, #2a1d10);
--tab-text: #b8a080;
--tab-hover: rgba(0,0,0,0.3);
--terracotta: #e07a5f;
--terracotta-dark: #b56347;
--title-gradient: linear-gradient(135deg, #e8a87c, #d4a574);
--shadow-sm: 0 4px 12px rgba(0,0,0,0.4);
--shadow-lg: inset 0 1px 0 rgba(255,255,255,0.15), 0 6px 16px rgba(0,0,0,0.5);
--shadow-inset: inset 2px 2px 6px rgba(0,0,0,0.4), inset -1px -1px 4px rgba(255,255,255,0.08);
--border-subtle: #2a1d10;
--card-radius: 0.75rem;
--btn-radius: 0.5rem;
--focus-ring: 0 0 0 2px #e07a5f;
}
[data-theme="skeuo"] .clay-card {
border: 1px solid #2a1d10;
box-shadow: var(--shadow-lg);
}
[data-theme="skeuo"] .clay-input, [data-theme="skeuo"] .cllay-select {
border: 1px solid #1a1208;
border-radius: 0.5rem;
box-shadow: var(--shadow-inset);
}
[data-theme="skeuo"] .clay-input:focus, [data-theme="skeuo"] .clay-select:focus {
border-color: #3d2914;
box-shadow: inset 2px 2px 6px rgba(0,0,0,0.4), inset -1px -1px 4px rgba(255,255,255,0.08), 0 0 0 2px rgba(224,122,95,0.4);
}
[data-theme="skeuo"] .clay-btn {
border-bottom: 3px solid #8b472e;
box-shadow: 0 4px 10px rgba(0,0,0,0.3);
}
[data-theme="skeuo"] .clay-btn:hover {
border-bottom-color: #a75a3e;
}
[data-theme="skeuo"] .clay-tab {
border: 1px solid #1a1208;
box-shadow: 2px 2px 5px rgba(0,0,0,0.3), -1px -1px 3px rgba(255,255,255,0.08);
}
[data-theme="skeuo"] .clay-tab-active {
border-bottom-color: #8b472e;
background: linear-gradient(145deg, #4a3420, #3d2914);
box-shadow: inset 2px 2px 5px rgba(0,0,0,0.4);
}
[data-theme="skeuo"] .clay-modal {
background: linear-gradient(145deg, #4a3420, #3d2914);
border: 1px solid #2a1d10;
box-shadow: var(--shadow-lg);
}
/* Theme: Material Design */
[data-theme="material"] {
--bg: #121212;
--clay: #1e1e1e;
--input-bg: #2d2d2d;
--input-text: #e0e0e0;
--tab-bg: transparent;
--tab-text: #b0b0b0;
--tab-hover: rgba(255,255,255,0.08);
--terracotta: #ff8a65;
--terracotta-dark: #e07a5f;
--title-gradient: linear-gradient(135deg, #ffab91, #ff8a65);
--shadow-sm: 0 2px 4px rgba(0,0,0,0.3);
--shadow-md: 0 4px 8px rgba(0,0,0,0.4);
--shadow-lg: 0 8px 16px rgba(0,0,0,0.5);
--shadow-inset: none;
--border-subtle: #2d2d2d;
--card-radius: 0.5rem;
--btn-radius: 0.25rem;
--focus-ring: 0 0 0 2px #ff8a65;
--font-body: Inter, system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
--font-title: "Playfair Display", serif;
}
[data-theme="material"] .clay-card {
border: 1px solid #2d2d2d;
box-shadow: var(--shadow-md);
}
[data-theme="material"] .clay-input, [data-theme="material"] .clay-select {
border-radius: 0.25rem;
border: 1px solid #404040;
background: #252525;
}
[data-theme="material"] .clay-input:focus, [data-theme="material"] .clay-select:focus {
border-color: #ff8a65;
box-shadow: 0 0 0 2px rgba(255,138,101,0.2);
}
[data-theme="material"] .clay-btn {
box-shadow: var(--shadow-sm);
}
[data-theme="material"] .clay-btn:hover {
box-shadow: var(--shadow-md);
}
[data-theme="material"] .clay-tab {
border-radius: 0.25rem;
}
[data-theme="material"] .clay-tab-active {
background: var(--terracotta);
color: white;
box-shadow: var(--shadow-sm);
}
[data-theme="material"] .clay-modal {
background: #1e1e1e;
border: 1px solid #2d2d2d;
box-shadow: var(--shadow-lg);
}
/* Theme-specific hover/focus states */
[data-theme="glass"] .clay-btn:hover {
box-shadow: 0 6px 20px rgba(99,102,241,0.5);
}
[data-theme="glass"] .clay-tab:hover {
background: rgba(255,255,255,0.15);
}
[data-theme="neo"] .clay-btn:hover {
box-shadow: 6px 6px 14px #bab0a8, -6px -6px 14px #ffffff;
}
[data-theme="neo"] .clay-tab:hover {
background: rgba(0,0,0,0.05);
}
[data-theme="skeuo"] .clay-btn:hover {
background: linear-gradient(145deg, #e8856a, #c06850);
}
[data-theme="skeuo"] .clay-tab:hover {
background: linear-gradient(145deg, #4a3420, #2a1d10);
}
[data-theme="material"] .clay-btn:hover {
background: #e8856a;
box-shadow: 0 4px 8px rgba(0,0,0,0.4);
}
[data-theme="material"] .clay-tab:hover {
background: rgba(255,255,255,0.08);
}
/* Img2Img Tool Cards */
.tool-grid {
display: grid;
grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
gap: 1.5rem;
margin-top: 2rem;
}
.tool-card {
display: flex;
flex-direction: column;
height: 100%;
padding: 1.5rem;
position: relative;
transition: transform 0.3s ease, box-shadow 0.3s ease;
}
.tool-card:hover {
transform: translateY(-5px);
}
.tool-badge {
position: absolute;
top: 1rem;
right: 1rem;
padding: 0.25rem 0.75rem;
border-radius: 9999px;
font-size: 0.7rem;
font-weight: 600;
text-transform: uppercase;
background: var(--terracotta);
color: white;
box-shadow: 0 2px 8px rgba(0,0,0,0.2);
}
.tool-link {
margin-top: auto;
display: inline-flex;
align-items: center;
gap: 0.5rem;
color: var(--terracotta);
font-weight: 600;
transition: gap 0.2s ease;
}
.tool-card:hover .tool-link {
gap: 0.75rem;
}
/* Responsive */
@media (max-width: 768px) {
.main-container { padding-left: 1rem; padding-right: 1rem; }
.content-inner { max-width: 100%; }
.clay-card { border-radius: 1.5rem; padding: 1.25rem; }
.clay-input, .clay-select { padding: 0.6rem 1rem; }
.clay-btn { padding: 0.6rem 1.25rem; font-size: 0.9rem; }
.clay-tab { padding: 0.5rem 1rem; font-size: 0.9rem; }
.clay-title { font-size: 2rem; }
}
</style>
</head>
<body data-theme="clay" class="min-h-screen">
<div class="main-container py-6">
<div class="content-inner">
<!-- Header -->
<header class="flex justify-between items-center mb-6">
<div>
<h1 class="clay-title text-3xl md:text-4xl">TAMILREAL</h1>
<p class="text-sm opacity-70 mt-1">Portrait Prompt Studio</p>
</div>
<div class="flex gap-2">
<button onclick="showThemeModal()" class="clay-tab text-sm" aria-label="Change Theme">Change Theme</button>
</div>
</header>
<!-- Tab Navigation -->
<nav class="flex gap-6 mb-6 overflow-x-auto pb-2 justify-center" role="tablist">
<button id="tab0" onclick="switchTab(0)" class="clay-tab clay-tab-active" role="tab" aria-controls="content0" aria-selected="true">Creator</button>
<button id="tab1" onclick="switchTab(1)" class="clay-tab" role="tab" aria-controls="content1" aria-selected="false">Analyzer</button>
<button id="tab2" onclick="switchTab(2)" class="clay-tab" role="tab" aria-controls="content2" aria-selected="false">Enhancer</button>
</nav>
</div>
<!-- Content Panels -->
<!-- Creator Panel - Full Width -->
<section id="content0" class="clay-card mb-6" role="tabpanel" aria-labelledby="tab0">
<!-- Fixed Identity Block -->
<div class="bg-black/20 rounded-xl p-4 mb-6 identity-anchor">
<div class="flex items-center gap-2 mb-2">
<span class="w-2 h-2 bg-green-500 rounded-full animate-pulse"></span>
<span class="font-semibold text-sm">Identity Anchor (Applied to Every Prompt)</span>
</div>
<p class="text-xs opacity-80 leading-relaxed">
<strong>EXACT FACE COMPOSITE PROTOCOL (EFCP):</strong> This protocol ensures high-fidelity identity consistency across different scenes and styles by articulating biometric markers with extreme precision.<br><br>
<strong>STRICT IDENTITY LOCK:</strong> Maintain the exact rounded jawline and lower cheek fullness. Preserve circular eye shape and visible eyelid creases. The nose must retain its broad bridge and wider alar base. Ensure lower lip fullness and soft Cupid's bow are preserved.<br><br>
<strong>MANDATORY ACCESSORY LOCK:</strong> The subject MUST wear thick-rimmed browline/Wayfarer style glasses. Remove neckband/earphones.
</p>
</div>
<!-- Library Presets -->
<div class="grid md:grid-cols-3 gap-4 mb-6">
<div>
<label class="block text-sm font-medium mb-2">Location Preset</label>
<select id="locationPreset" class="clay-select w-full" onchange="applyPreset('location')">
<option value="">Select Location...</option>
</select>
</div>
<div>
<label class="block text-sm font-medium mb-2">Camera Angle Preset</label>
<select id="cameraAnglePreset" class="clay-select w-full" onchange="applyPreset('cameraAngle')">
<option value="">Select Angle...</option>
</select>
</div>
<div>
<label class="block text-sm font-medium mb-2">Lighting Preset</label>
<select id="lightingPreset" class="clay-select w-full" onchange="applyPreset('lighting')">
<option value="">Select Lighting...</option>
</select>
</div>
</div>
<!-- Manual Input Fields -->
<div class="grid md:grid-cols-2 gap-4 mb-6">
<div>
<label class="block text-sm font-medium mb-2">Scene</label>
<div class="flex gap-2">
<input type="text" id="scene" readonly class="clay-input flex-1" placeholder="Select from preset">
<button id="editScene" onclick="makeEditable('scene')" class="clay-btn text-sm px-3 hidden">Edit</button>
</div>
</div>
<div>
<label class="block text-sm font-medium mb-2">Pose</label>
<div class="flex gap-2">
<input type="text" id="pose" class="clay-input flex-1" placeholder="Natural relaxed standing pose">
<button onclick="randomPose(event)" class="clay-btn text-sm px-3">Random ⚠️</button>
</div>
<span id="poseWarn" class="identity-warn hidden mt-2 inline-block">⚠️ Risky pose - may obscure face</span>
</div>
<div>
<label class="block text-sm font-medium mb-2">Clothing</label>
<div class="flex gap-2">
<input type="text" id="clothing" class="clay-input flex-1" placeholder="White linen shirt & dark trousers">
<button onclick="randomClothing()" class="clay-btn text-sm px-3">Random</button>
</div>
</div>
<div>
<label class="block text-sm font-medium mb-2">Lighting</label>
<div class="flex gap-2">
<input type="text" id="lighting" readonly class="clay-input flex-1" placeholder="Select from preset">
<button id="editLighting" onclick="makeEditable('lighting')" class="clay-btn text-sm px-3 hidden">Edit</button>
</div>
</div>
<div>
<label class="block text-sm font-medium mb-2">Camera Angle</label>
<div class="flex gap-2 flex-col">
<div class="flex gap-2">
<input type="text" id="cameraAngle" readonly class="clay-input flex-1" placeholder="Select from preset">
<button id="editCameraAngle" onclick="makeEditable('cameraAngle')" class="clay-btn text-sm px-3 hidden">Edit</button>
</div>
<span id="angleWarn" class="identity-warn hidden">⚠️ Risky angle - may obscure face</span>
</div>
</div>
<div>
<label class="block text-sm font-medium mb-2">Color Grading</label>
<div class="flex gap-2">
<input type="text" id="colorGrading" class="clay-input flex-1" placeholder="Natural Canon / Sony color science">
<button onclick="randomColorGrading()" class="clay-btn text-sm px-3">Random</button>
</div>
</div>
</div>
<!-- Camera Settings -->
<div class="mb-6">
<label class="block text-sm font-medium mb-2">Camera Settings</label>
<div class="flex flex-col sm:flex-row gap-3 items-start sm:items-center">
<select id="cameraMode" class="clay-select" onchange="toggleManualCamera()">
<option value="default">Default DSLR/Mirrorless</option>
<option value="manual">Manual</option>
</select>
<input type="text" id="manualCamera" class="clay-input flex-1 hidden" placeholder="Shot on Sony A7R IV, 85mm f/1.8">
</div>
</div>
<!-- Live Length Bar -->
<div class="mb-4">
<div class="flex justify-between text-xs mb-1">
<span>Prompt Length</span>
<span id="liveLengthCount">0 chars</span>
</div>
<div class="h-2 bg-black/30 rounded-full overflow-hidden">
<div id="liveLengthBar" class="h-full bg-green-500 transition-all duration-300" style="width: 0%"></div>
</div>
</div>
<!-- Generate Buttons -->
<div class="flex flex-wrap gap-2 mb-6">
<button onclick="generatePortraitPrompt('chatgpt')" class="clay-btn text-lg px-6 py-3 flex-1 min-w-[140px]">ChatGPT Optimized</button>
<button onclick="generatePortraitPrompt('gemini')" class="clay-btn text-lg px-6 py-3 flex-1 min-w-[140px]">Gemini Optimized</button>
<button onclick="generatePortraitPrompt('general')" class="clay-btn text-lg px-6 py-3 flex-1 min-w-[140px]">General Optimized</button>
</div>
<!-- Result Area -->
<div id="creatorResult" class="hidden">
<label class="block text-sm font-medium mb-2">Generated Prompt</label>
<pre id="creatorOutput" class="bg-black/20 rounded-lg p-4 text-xs overflow-x-auto max-h-80 whitespace-pre-wrap"></pre>
<div class="flex flex-wrap gap-3 mt-4">
<button onclick="copyPrompt('creatorOutput')" class="clay-btn">Copy Prompt</button>
<button onclick="batchExport()" class="clay-btn">Generate 5 Location Variations</button>
<button onclick="saveCurrentPrompt()" class="clay-btn">Save Prompt</button>
<button onclick="loadSavedPrompts()" class="clay-tab">Library</button>
</div>
</div>
<!-- Saved Library Panel -->
<div id="libraryPanel" class="hidden mt-6 pt-6 border-t border-white/10">
<div class="flex flex-wrap justify-between items-center gap-3 mb-4">
<h3 class="font-semibold">Saved Prompts</h3>
<div class="flex gap-2 items-center">
<select id="tagFilter" class="clay-select text-sm" onchange="loadSavedPrompts()">
<option value="">All Tags</option>
<option value="ChatGPT">ChatGPT</option>
<option value="Gemini">Gemini</option>
<option value="General">General</option>
<option value="EFCP-200%">EFCP-200%</option>
</select>
<input type="text" id="librarySearch" class="clay-input text-sm" placeholder="Search..." oninput="loadSavedPrompts()">
</div>
</div>
<div id="savedPromptsList" class="space-y-3 max-h-60 overflow-y-auto"></div>
</div>
</section>
<div class="content-inner">
<!-- Analyzer Panel -->
<section id="content1" class="clay-card mb-6 hidden" role="tabpanel" aria-labelledby="tab1">
<h2 class="text-xl font-semibold mb-4">Prompt Analyzer</h2>
<textarea id="analyzeInput" class="clay-input w-full h-40 mb-4" placeholder="Paste your prompt here to analyze..."></textarea>
<button onclick="analyzePrompt()" class="clay-btn mb-4">Analyze Prompt</button>
<div id="analyzeResult" class="hidden">
<div class="grid md:grid-cols-2 gap-4 mb-4">
<div>
<div id="scoreBadge" class="text-3xl font-bold text-center py-4 rounded-xl"></div>
<p class="text-center text-sm opacity-70 mb-2">SPECIFICITY SCORE / 100</p>
</div>
<div>
<div id="faceFidelityBadge" class="text-3xl font-bold text-center py-4 rounded-xl"></div>
<p class="text-center text-sm opacity-70 mb-2">FACE FIDELITY SCORE / 100</p>
</div>
</div>
<div id="missingProtections" class="mb-4 p-3 bg-black/20 rounded-lg hidden">
<h4 class="font-medium mb-2">Missing Protections</h4>
<div id="missingList" class="space-y-2"></div>
</div>
<ul id="issuesList" class="space-y-2"></ul>
<button onclick="copyPrompt('analyzeOutput')" id="copyAnalyzeBtn" class="clay-btn mt-4 hidden">Copy Result</button>
<pre id="analyzeOutput" class="hidden"></pre>
</div>
</section>
<!-- Enhancer Panel -->
<section id="content2" class="clay-card mb-6 hidden" role="tabpanel" aria-labelledby="tab2">
<h2 class="text-xl font-semibold mb-4">Prompt Enhancer</h2>
<textarea id="enhanceInput" class="clay-input w-full h-40 mb-4" placeholder="Paste prompt to enhance..."></textarea>
<div class="flex flex-wrap gap-4 mb-4">
<label class="flex items-center gap-2">
<input type="checkbox" id="roleChk" checked class="w-4 h-4">
<span class="text-sm">Expert Role</span>
<span class="enhancer-note">LLM-only</span>
</label>
<label class="flex items-center gap-2">
<input type="checkbox" id="cot" checked class="w-4 h-4">
<span class="text-sm">Chain-of-Thought</span>
<span class="enhancer-note">LLM-only</span>
</label>
<label class="flex items-center gap-2">
<input type="checkbox" id="format" checked class="w-4 h-4">
<span class="text-sm">Output Format</span>
</label>
<label class="flex items-center gap-2">
<input type="checkbox" id="examples" checked class="w-4 h-4">
<span class="text-sm">Real Examples</span>
</label>
<label class="flex items-center gap-2">
<input type="checkbox" id="reinforceEFCP" checked class="w-4 h-4">
<span class="text-sm">Reinforce EFCP 200%</span>
</label>
<label class="flex items-center gap-2">
<input type="checkbox" id="modelTuned" class="w-4 h-4">
<span class="text-sm">Model-Tuned Booster</span>
</label>
<select id="modelBoosterSelect" class="clay-select text-sm">
<option value="chatgpt">ChatGPT</option>
<option value="gemini">Gemini</option>
<option value="general">General</option>
</select>
<label class="flex items-center gap-2">
<input type="checkbox" id="maximizeNegative" class="w-4 h-4">
<span class="text-sm">Maximize Negative Prompt</span>
</label>
</div>
<button onclick="enhancePrompt()" class="clay-btn mb-4">Enhance Prompt</button>
<div id="enhanceResult" class="hidden">
<label class="block text-sm font-medium mb-2">Enhanced Prompt</label>
<pre id="enhanceOutput" class="bg-black/20 rounded-lg p-4 text-xs overflow-x-auto max-h-80 whitespace-pre-wrap"></pre>
<button onclick="copyPrompt('enhanceOutput')" class="clay-btn mt-4">Copy Enhanced</button>
</div>
</section>
<!-- Resource Section: Verified Img2Img Tools -->
<section id="resourceSection" class="mt-12 mb-12">
<div class="text-center mb-8">
<h2 class="clay-title text-3xl md:text-4xl mb-4">Verified No-Signup Img2Img Tools</h2>
<p class="max-w-3xl mx-auto text-sm opacity-80 leading-relaxed">
These platforms are confirmed to work for true <strong>Image-to-Image (img2img)</strong> generation in March 2026.
They are 100% free, requiring no signup, no account, and no email. Just upload your photo, type a prompt, and generate instantly.
</p>
</div>
<div class="tool-grid">
<!-- EaseMate AI -->
<div class="clay-card tool-card">
<span class="tool-badge">Top Recommendation</span>
<h3 class="text-xl font-bold mb-2">EaseMate AI</h3>
<p class="text-sm opacity-70 mb-6">Upload photo + text prompt. Clean, fast, no watermark, no account. Excellent for style changes and edits.</p>
<a href="https://www.easemate.ai/image-to-image-ai-generator" target="_blank" class="tool-link">
Visit EaseMate AI <svg xmlns="http://www.w3.org/2000/svg" class="h-4 w-4" fill="none" viewBox="0 0 24 24" stroke="currentColor"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M14 5l7 7m0 0l-7 7m7-7H3" /></svg>
</a>
</div>
<!-- Image2Image.ai -->
<div class="clay-card tool-card">
<span class="tool-badge">Best Interface</span>
<h3 class="text-xl font-bold mb-2">Image2Image.ai</h3>
<p class="text-sm opacity-70 mb-6">"Start Free. No Registration Required" — literally instant. One of the cleanest interfaces for quick edits.</p>
<a href="https://www.image2image.ai/" target="_blank" class="tool-link">
Visit Image2Image.ai <svg xmlns="http://www.w3.org/2000/svg" class="h-4 w-4" fill="none" viewBox="0 0 24 24" stroke="currentColor"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M14 5l7 7m0 0l-7 7m7-7H3" /></svg>
</a>
</div>
<!-- Joyfun AI -->
<div class="clay-card tool-card">
<h3 class="text-xl font-bold mb-2">Joyfun AI</h3>
<p class="text-sm opacity-70 mb-6">Claims "free and unlimited" with no signup. Works immediately for transforming existing photos with AI.</p>
<a href="https://joyfun.ai/ai-image-to-image/" target="_blank" class="tool-link">
Visit Joyfun AI <svg xmlns="http://www.w3.org/2000/svg" class="h-4 w-4" fill="none" viewBox="0 0 24 24" stroke="currentColor"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M14 5l7 7m0 0l-7 7m7-7H3" /></svg>
</a>
</div>
<!-- Krea.ai -->
<div class="clay-card tool-card">
<h3 class="text-xl font-bold mb-2">Krea.ai</h3>
<p class="text-sm opacity-70 mb-6">"No sign up required. Transform any image with AI for free." Powerful tool with high-quality results.</p>
<a href="https://www.krea.ai/apps/edit/image-to-image" target="_blank" class="tool-link">
Visit Krea.ai <svg xmlns="http://www.w3.org/2000/svg" class="h-4 w-4" fill="none" viewBox="0 0 24 24" stroke="currentColor"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M14 5l7 7m0 0l-7 7m7-7H3" /></svg>
</a>
</div>
<!-- ImageHub.ai -->
<div class="clay-card tool-card">
<h3 class="text-xl font-bold mb-2">ImageHub.ai</h3>
<p class="text-sm opacity-70 mb-6">"100% Free • No Sign-up Required". Great for sketches-to-real or cinematic style transfers.</p>
<a href="https://imagehub.ai/free-ai-image-to-image-generator/" target="_blank" class="tool-link">
Visit ImageHub.ai <svg xmlns="http://www.w3.org/2000/svg" class="h-4 w-4" fill="none" viewBox="0 0 24 24" stroke="currentColor"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M14 5l7 7m0 0l-7 7m7-7H3" /></svg>
</a>
</div>
<!-- Arena.ai -->
<div class="clay-card tool-card">
<span class="tool-badge">Comparison Tool</span>
<h3 class="text-xl font-bold mb-2">Arena.ai</h3>
<p class="text-sm opacity-70 mb-6">A powerful platform for comparing different AI models and generating results side-by-side without friction.</p>
<a href="https://arena.ai/" target="_blank" class="tool-link">
Visit Arena.ai <svg xmlns="http://www.w3.org/2000/svg" class="h-4 w-4" fill="none" viewBox="0 0 24 24" stroke="currentColor"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M14 5l7 7m0 0l-7 7m7-7H3" /></svg>
</a>
</div>
</div>
</section>
</div>
</div>
<!-- Length Modal -->
<div id="lengthModal" class="fixed inset-0 bg-black/70 flex items-center justify-center p-4 hidden z-50">
<div class="clay-modal max-w-lg w-full p-6 relative">
<button onclick="keepPrompt()" class="absolute top-4 right-4 text-white/50 hover:text-white" aria-label="Close">
<svg xmlns="http://www.w3.org/2000/svg" class="h-6 w-6" fill="none" viewBox="0 0 24 24" stroke="currentColor">
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M6 18L18 6M6 6l12 12" />
</svg>
</button>
<h2 class="text-xl font-semibold mb-4">Length Validation</h2>
<p id="lengthDisplay" class="text-sm mb-2"></p>
<p id="statusMessage" class="mb-4"></p>
<div class="mb-4">
<label class="block text-sm font-medium mb-2">Select Model</label>
<select id="modelSelect" class="clay-select w-full" onchange="checkLength()">
<option value="chatgpt">ChatGPT (200,000 tokens)</option>
<option value="gemini">Gemini (1,000,000 tokens)</option>
<option value="general">General (500,000 tokens)</option>
<option value="custom">Custom</option>
</select>
</div>
<div id="customLimitDiv" class="mb-4 hidden">
<label class="block text-sm font-medium mb-2">Custom Limit</label>
<input type="number" id="customLimit" class="clay-input w-full" value="5000">
</div>
<div class="flex gap-3">
<button onclick="shortenPrompt()" id="shortenBtn" class="clay-btn hidden">Shorten</button>
<button onclick="keepPrompt()" class="clay-tab flex-1">Keep</button>
<button onclick="copyFromModal()" class="clay-btn flex-1">Copy</button>
</div>
</div>
</div>
<!-- Theme Modal -->
<div id="themeModal" class="fixed inset-0 bg-black/70 flex items-center justify-center p-4 hidden z-50">
<div class="clay-modal max-w-md w-full p-6">
<h2 class="text-xl font-semibold mb-4">Select Theme</h2>
<div id="themeOptions" class="space-y-3"></div>
<button onclick="hideThemeModal()" class="clay-tab w-full mt-4">Cancel</button>
</div>
</div>
<!-- Toast -->
<div id="toast" class="hidden"></div>
<script>
// Apply modal styling based on current theme
const styleEl = document.createElement('style');
styleEl.textContent = `
[data-theme="glass"] #themeModal .clay-modal {
background: rgba(255,255,255,0.15) !important;
backdrop-filter: blur(30px) saturate(180%) !important;
-webkit-backdrop-filter: blur(30px) saturate(180%) !important;
border: 1px solid rgba(255,255,255,0.25) !important;
}
[data-theme="neo"] #themeModal .clay-modal {
box-shadow: 8px 8px 20px rgba(0,0,0,0.2), -8px -8px 20px rgba(255,255,255,0.9) !important;
}
[data-theme="skeuo"] #themeModal .clay-modal {
background: linear-gradient(145deg, #4a3420, #3d2914) !important;
border: 1px solid #2a1d10 !important;
box-shadow: inset 0 1px 0 rgba(255,255,255,0.1), 0 4px 12px rgba(0,0,0,0.4) !important;
}
[data-theme="material"] #themeModal .clay-modal {
background: #1e1e1e !important;
border: 1px solid #2d2d2d !important;
box-shadow: 0 8px 32px rgba(0,0,0,0.5) !important;
}
`;
document.head.appendChild(styleEl);
</script>
<script>
// ============ DATA LIBRARIES ============
// ============ DATA LIBRARIES ============
const libraries = {
locations: [
"Marina Beach Chennai sunrise", "Besant Nagar beach evening walk",
"T Nagar shopping street Chennai", "Chennai metro station entrance",
"Chennai tea stall street", "Kapaleeshwarar Temple street Mylapore",
"Book shop street Chennai", "Ooty tea plantations",
"Ooty hill road viewpoint", "Hill fog road Ooty",
"Tea factory road Ooty", "Old railway platform Ooty toy train",
"Kodaikanal lake walkway", "Coaker's walk Kodaikanal",
"Sunset hill viewpoint Kodaikanal", "Yelagiri hill viewpoint",
"Yercaud lake park", "Madurai Meenakshi temple streets",
"Thanjavur Brihadeeswarar courtyard", "Chidambaram temple corridor",
"Tirunelveli temple street market", "Velankanni church street",
"Rameswaram beach", "Pamban bridge",
"Kanyakumari sunrise beach", "Kanyakumari Vivekananda rock",
"Courtallam waterfall", "Sunrise fishing harbor Chennai",
"Pondicherry french quarter", "Pondicherry beach promenade",
"Coimbatore cafe street", "Coimbatore race course road",
"Rural paddy field Thanjavur", "Coconut farm Pollachi",
"Banana plantation Trichy", "Village road Salem",
"Village temple entrance", "Bus stand portrait",
"Local market", "Flower market Madurai",
"Fish market village", "Small roadside tea shop",
"College campus walkway", "Government office corridor",
"Auto rickshaw background", "Rainy street Chennai monsoon",
"Temple chariot festival street", "Night food street Madurai"
],
cameraAngles: [
"Eye Level Portrait", "Low Angle Shot", "High Angle Shot",
"Street Candid Angle", "Walking Follow Shot",
"Wide Environmental Portrait", "Close Portrait", "Medium Portrait",
"Over the Shoulder Shot", "Side Profile Shot"
],
lightingSetups: [
"Golden Hour", "Morning Soft Light", "Overcast Day",
"Temple Lamp Lighting", "Street Night Lighting",
"Rainy Monsoon Light", "Beach Sunset Lighting",
"Forest Shade Lighting", "Cafe Window Lighting", "City Neon Reflection"
]
};
const RISKY_ANGLES = new Set(["Side Profile Shot", "Over the Shoulder Shot"]);
const RISKY_POSES = new Set([
"Side profile looking away from camera",
"Back to camera, walking away",
"Looking away, face partially hidden",
"Face turned away from camera",
"Backlit with face in shadow",
"Out of focus background pose"
]);
const RISKY_POSE_PATTERNS = /side profile|over shoulder|behind head|looking away|back to camera|turned away|face hidden|partial face|obscured|blurred face|out of focus|backlit|shadow on face/i;
const poses = [
"Natural relaxed standing pose, preserve reference expression",
"Walking casually toward camera, face fully visible",
"Sitting relaxed on steps, front-facing",
"Standing with hands in pockets, facing camera",
"Leaning against wall, front-facing, natural expression",
"Looking over shoulder, face partially turned",
"Side profile looking away from camera",
"Hands behind head, face visible",
"Back to camera, walking away",
"Turned away, partial face visible",
"Crouching low, face obscured",
"Holding object in front of face"
];
const clothes = [
"White linen shirt and dark trousers",
"Traditional white kurta",
"Casual blue t-shirt and jeans",
"Black cotton shirt with rolled sleeves",
"Light blue denim shirt",
"Beige linen kurta",
"Gray hoodie and black pants",
"White polo and khaki shorts"
];
const colorGradings = [
"Natural Canon / Sony color science",
"Warm cinematic Kodak tones",
"Cool Fujifilm tones",
"Vibrant National Geographic style",
"Soft pastel film look",
"High contrast dramatic",
"Balanced neutral RAW",
"Golden hour warmth",
"Cool blue hour tones",
"Vintage Polaroid feel"
];
const themes = [
{ id: "clay", name: "Claymorphism", desc: "Warm dark cards with terracotta accents" },
{ id: "glass", name: "Glassmorphism", desc: "Frosted glass with blue-purple gradient" },
{ id: "neo", name: "Neumorphism", desc: "Soft beige with extruded shadows" },
{ id: "skeuo", name: "Skeuomorphism", desc: "Dark leather texture with bevels" },
{ id: "material", name: "Material Design", desc: "Dark surface with elevation shadows" }
];
// ============ EFCP ULTRA CONSTANT ============
const efcpUltra = `EFCP 200% ENFORCEMENT LAYER (NON-NEGOTIABLE):
• Treat reference face as a literal pixel stamp — zero creative interpretation allowed.
• Face crop must include: exact hairline contour, ear shape, glasses frame thickness/position, stubble density map, neck blend line.
• Lighting, color temperature and shadow direction on the pasted face MUST match the new scene exactly (use reference as master).
• Any deviation = instant failure.
FACE STAMP PROTOCOL:
ChatGPT: RAW composite only. Paste reference face 1:1. No inpainting, no refinement.
Gemini: Biometric Lock v2 — disable all face enhancement, use reference as hard mask.
General: Maximum identity consistency mode. Zero facial morphing or aesthetic changes.`;
// ============ GLOBAL STATE ============
let currentPrompt = "";
// ============ UI UTILS ============
function populateDropdowns() {
const locSel = document.getElementById('locationPreset');
const angleSel = document.getElementById('cameraAnglePreset');
const lightSel = document.getElementById('lightingPreset');
libraries.locations.forEach(loc => { const opt = document.createElement('option'); opt.value = loc; opt.textContent = loc; locSel.appendChild(opt); });
libraries.cameraAngles.forEach(angle => { const opt = document.createElement('option'); opt.value = angle; opt.textContent = angle + (RISKY_ANGLES.has(angle) ? " ⚠️" : ""); angleSel.appendChild(opt); });
libraries.lightingSetups.forEach(light => { const opt = document.createElement('option'); opt.value = light; opt.textContent = light; lightSel.appendChild(opt); });
}
function applyPreset(type) {
const select = document.getElementById(type + 'Preset');
if (!select.value) return;
const cleanValue = select.value.replace(/\s*⚠️$/, '').trim();
const fieldMap = { location: 'scene', cameraAngle: 'cameraAngle', lighting: 'lighting' };
const field = fieldMap[type];
const input = document.getElementById(field);
input.value = cleanValue; input.readOnly = true;
const editBtn = document.getElementById('edit' + field.charAt(0).toUpperCase() + field.slice(1));
if (editBtn) editBtn.classList.remove('hidden');
if (type === 'cameraAngle') checkAngleWarn(cleanValue);
}
function makeEditable(field) {
const input = document.getElementById(field); input.readOnly = false; input.focus();
const editBtn = document.getElementById('edit' + field.charAt(0).toUpperCase() + field.slice(1));
if (editBtn) editBtn.classList.add('hidden');
}
function randomPose(event) {
const input = document.getElementById('pose');
const allowRisky = event && event.shiftKey;
let pool = allowRisky ? poses : poses.filter(p => !RISKY_POSES.has(p));
if (pool.length === 0) { showToast("⚠️ Only risky poses available. Hold Shift."); return; }
const p = pool[Math.floor(Math.random() * pool.length)];
input.value = p; checkPoseWarn(p);
}
function randomClothing() { document.getElementById('clothing').value = clothes[Math.floor(Math.random() * clothes.length)]; }
function randomColorGrading() { document.getElementById('colorGrading').value = colorGradings[Math.floor(Math.random() * colorGradings.length)]; }
function checkPoseWarn(val) { document.getElementById('poseWarn').classList.toggle('hidden', !RISKY_POSE_PATTERNS.test(val)); }
function checkAngleWarn(val) { document.getElementById('angleWarn').classList.toggle('hidden', !RISKY_ANGLES.has(val)); }
function toggleManualCamera() {
const mode = document.getElementById('cameraMode').value;
document.getElementById('manualCamera').classList.toggle('hidden', mode !== 'manual');
}
function deduplicatePrompt(text) {
if (!text) return "";
let clean = text.replace(/\n\n+/g, '\n').trim();
return clean.split('\n').map(section => {
const phrases = section.split(',').map(p => p.trim());
const seen = new Set();
return phrases.filter(p => p && !seen.has(p.toLowerCase()) && seen.add(p.toLowerCase())).join(', ');
}).join('\n\n');
}
function validateInputs() {
const errors = [];
if (!document.getElementById('scene').value.trim()) errors.push("Scene");
if (!document.getElementById('pose').value.trim()) errors.push("Pose");
if (!document.getElementById('clothing').value.trim()) errors.push("Clothing");
if (errors.length > 0) { showToast(`⚠️ Missing: ${errors.join(', ')}`); return false; }
return true;
}
// ============ TAB SWITCHING ============
function switchTab(n) {
// Hide all content sections
document.querySelectorAll('[id^="content"]').forEach(el => el.classList.add('hidden'));
// Show the target content panel
const target = document.getElementById('content' + n);
if (target) target.classList.remove('hidden');
// Explicitly update tab active states by known IDs
const tabIds = ['tab0', 'tab1', 'tab2'];
tabIds.forEach((id, idx) => {
const btn = document.getElementById(id);
if (btn) {
btn.classList.toggle('clay-tab-active', idx === n);
btn.setAttribute('aria-selected', (idx === n).toString());
}
});
}
// ============ GENERATE PROMPT ============
function generatePortraitPrompt(variant = 'general') {
if (!validateInputs()) return;
const scene = document.getElementById('scene').value.trim();
const pose = document.getElementById('pose').value.trim();
const clothing = document.getElementById('clothing').value.trim();
const lighting = document.getElementById('lighting').value.trim() || libraries.lightingSetups[0];
const colorGrading = document.getElementById('colorGrading').value.trim() || colorGradings[0];
const cameraAngle = document.getElementById('cameraAngle').value.trim() || "Eye Level Portrait";
const cameraMode = document.getElementById('cameraMode').value;
const camera = cameraMode === 'manual'
? (document.getElementById('manualCamera').value.trim() || "Shot on Sony A7R IV, 85mm f/1.8")
: "Shot on 85mm f/1.8 prime lens. Shallow depth of field with soft bokeh";
let styleNote = "Ultra photorealistic portrait photography style, Professional documentary approach, Authentic Tamil Nadu cultural context";
let rawPrompt = `${efcpUltra}
STRICT IDENTITY LOCK:
Preserve exact rounded jawline, circular eye shape, broad nasal bridge, and lower lip fullness. Thick-rimmed browline/Wayfarer glasses ONLY.
SCENE: ${scene}
CAMERA ANGLE: ${cameraAngle}
POSE: ${pose}
CLOTHING: ${clothing}
CAMERA: ${camera}
LIGHTING: ${lighting}
STYLE: ${styleNote}, High-end editorial photography, Cinematic storytelling
COLOR GRADING: ${colorGrading}
DETAILS: Realistic cloth wrinkles, natural hair strands, subtle glasses reflections
REALISM: Authentic Tamil Nadu skin tone (medium-warm). Visible skin pores, natural facial hair. No digital smoothing.
PHOTOGRAPHIC DEPTH: DSLR-style shallow depth of field, natural bokeh.
NEGATIVE PROMPT: (neckband, headphones, wires), facial slimming, sharpened chin, thin nose, narrowed eyes, plastic skin, AI art style, 3D render, beautification filter, changed identity, distorted face, unnatural smoothing`;
currentPrompt = deduplicatePrompt(rawPrompt);
showResult();
document.getElementById('lengthModal').classList.remove('hidden');
checkLength();
}
function showResult() {
document.getElementById('creatorOutput').textContent = currentPrompt;
document.getElementById('creatorResult').classList.remove('hidden');
updateLiveLengthBar();
}
function updateLiveLengthBar() {
const chars = currentPrompt.length;
const model = document.getElementById('modelSelect').value;
const limits = { chatgpt: 200000, gemini: 1000000, general: 500000, custom: 5000 };
const limit = limits[model] || 5000;
const percentage = Math.min((chars / limit) * 100, 100);
const bar = document.getElementById('liveLengthBar');
const countEl = document.getElementById('liveLengthCount');
bar.style.width = percentage + '%';
countEl.textContent = chars.toLocaleString() + ' chars';
if (percentage < 50) {
bar.className = 'h-full bg-green-500 transition-all duration-300';
} else if (percentage < 80) {
bar.className = 'h-full bg-yellow-500 transition-all duration-300';
} else {
bar.className = 'h-full bg-red-500 transition-all duration-300';
}
}
function batchExport() {
const locations = libraries.locations.slice(0, 5);
const model = document.getElementById('modelSelect').value;
let prompts = '';
locations.forEach((loc, i) => {
prompts += `=== VARIATION ${i + 1}: ${loc} ===\n\n`;
const tempPrompt = currentPrompt.replace(/SCENE: .+/, `SCENE: ${loc}`);
prompts += tempPrompt + '\n\n' + '='.repeat(40) + '\n\n';
});
const blob = new Blob([prompts], { type: 'text/plain' });
const url = URL.createObjectURL(blob);
const a = document.createElement('a');
a.href = url;
a.download = 'tamilreal_prompts_5_variations.txt';
a.click();
URL.revokeObjectURL(url);
showToast('✅ Downloaded 5 location variations!');
}
// ============ LENGTH VALIDATION ============
function checkLength() {
const chars = currentPrompt.length;
const words = currentPrompt.trim().split(/\s+/).length;
const tokens = Math.round(chars / 4);
const model = document.getElementById('modelSelect').value;
const limits = {
chatgpt: 200000,
gemini: 1000000,
general: 500000,
custom: parseInt(document.getElementById('customLimit')?.value || 5000)
};
const limit = limits[model] || 5000;
const tooLong = tokens > limit;
document.getElementById('lengthDisplay').textContent = `${chars.toLocaleString()} chars (~${words.toLocaleString()} words / ~${tokens.toLocaleString()} tokens)`;
const statusEl = document.getElementById('statusMessage');
if (tooLong) {
statusEl.innerHTML = `<span class="text-red-400">⚠️ Token count exceeds ${limit.toLocaleString()} limit for ${model}</span>`;
document.getElementById('shortenBtn').classList.remove('hidden');
} else {
statusEl.innerHTML = `<span class="text-green-400">✅ Within ${limit.toLocaleString()} token limit for ${model}</span>`;
document.getElementById('shortenBtn').classList.add('hidden');
}
document.getElementById('customLimitDiv').classList.toggle('hidden', model !== 'custom');
}
function keepPrompt() {
document.getElementById('lengthModal').classList.add('hidden');
}
function copyFromModal() {
copyPrompt('creatorOutput');
document.getElementById('lengthModal').classList.add('hidden');
}
// ============ SHORTEN PROMPT ============
function shortenPrompt() {
const originalPrompt = currentPrompt;
if (currentPrompt.length > 5200) {
const detailsMatch = currentPrompt.match(/^([\s\S]*?DETAILS: )(.*?)([\s\S]*?REALISM RULES)/);
if (detailsMatch) {
currentPrompt = detailsMatch[1] + "Realistic cloth wrinkles, natural hair strands, natural depth of field\n\n" + detailsMatch[3];
}
}
if (currentPrompt.length > 5200) {
const realismMatch = currentPrompt.match(/^([\s\S]*?REALISM RULES[\s\S]*?)(.*?)([\s\S]*?NEGATIVE PROMPT)/);
if (realismMatch) {
currentPrompt = realismMatch[1] + "Must look like a real RAW photograph by a professional photographer.\n\n" + realismMatch[3];
}
}
if (currentPrompt.length > 5200) {
const styleMatch = currentPrompt.match(/^([\s\S]*?STYLE: )(.*?)([\s\S]*?COLOR GRADING)/);
if (styleMatch) {
currentPrompt = styleMatch[1] + "Ultra photorealistic, natural skin texture, no plastic skin\n\n" + styleMatch[3];
}
}
if (currentPrompt.length > 5200) {
currentPrompt = currentPrompt.slice(0, 5200);
const lastNewline = currentPrompt.lastIndexOf('\n');
if (lastNewline > 4000) {
currentPrompt = currentPrompt.slice(0, lastNewline);
}
}
if (!currentPrompt.includes("NEGATIVE PROMPT")) {
currentPrompt = originalPrompt;
showToast("Could not safely shorten - please edit manually");
return;
}
showResult();
document.getElementById('lengthModal').classList.add('hidden');
showToast("Prompt shortened successfully");
}
// ============ CLIPBOARD ============
function copyAsJson() {
const saved = JSON.parse(localStorage.getItem('tamilreal_api_keys') || '{}');
const model = saved.lastModel || 'unknown_model';
const img = document.getElementById('generatedImage');
const data = {
prompt: currentPrompt,
model: model,
imageBase64: img ? img.src : null,
timestamp: new Date().toISOString()
};
const text = JSON.stringify(data, null, 2);
if (navigator.clipboard && navigator.clipboard.writeText) {
navigator.clipboard.writeText(text).then(() => {
showToast("✅ Copied as JSON");
}).catch(() => {
fallbackCopy(text, "✅ Copied as JSON");
});
} else {
fallbackCopy(text, "✅ Copied as JSON");
}
}
function copyPrompt(id) {
let text = document.getElementById(id).textContent;
// Auto-append upload reminder
const uploadLine = '↑↑↑ IMPORTANT: FIRST upload your reference photo in the AI tool, then paste this prompt below ↑↑↑\n\n';
text = uploadLine + text;
if (navigator.clipboard && navigator.clipboard.writeText) {
navigator.clipboard.writeText(text).then(() => {
showToast("✅ Copied with upload reminder!");
}).catch(() => {
fallbackCopy(text, "✅ Copied with upload reminder!");
});
} else {
fallbackCopy(text, "✅ Copied with upload reminder!");
}
}
function fallbackCopy(text, successMsg = "✅ Copied to clipboard") {
const textarea = document.createElement('textarea');
textarea.value = text;
textarea.style.position = 'fixed';
textarea.style.left = '-9999px';
textarea.style.top = '-9999px';
document.body.appendChild(textarea);
textarea.focus();
textarea.select();
try {
const successful = document.execCommand('copy');
if (successful) {
showToast(successMsg);
} else {
showToast("⚠️ Copy failed - please select manually");
}
} catch (err) {
showToast("⚠️ Copy failed - please select manually");
}
document.body.removeChild(textarea);
}
// ============ TOAST ============
function showToast(msg) {
const toast = document.getElementById('toast');
toast.textContent = msg;
toast.classList.remove('hidden');
toast.classList.add('toast-animate');
setTimeout(() => {
toast.classList.add('hidden');
toast.classList.remove('toast-animate');
}, 2800);
}
// ============ ANALYZER ============
function analyzePrompt() {
const input = document.getElementById('analyzeInput').value.trim();
if (!input) {
showToast("Paste a prompt first");
return;
}
setTimeout(() => {
let score = 100;
let faceFidelity = 100;
const issues = [];
const missingProtections = [];
const lower = input.toLowerCase();
// EFCP keywords for face fidelity
const efcpKeywords = ['efcp', 'face composite', 'cut-and-paste', 'biometric', 'identity lock', 'reference image', 'face stamp'];
const biometricTerms = ['jawline', 'cheek', 'nose', 'lip', 'eye shape', 'facial structure', 'skin tone', 'glasses'];
efcpKeywords.forEach(kw => {
if (!lower.includes(kw.toLowerCase())) {
faceFidelity -= 12;
}
});
biometricTerms.forEach(term => {
if (!lower.includes(term.toLowerCase())) {
faceFidelity -= 6;
}
});
if (!/(photorealistic|real photograph)/i.test(input)) {
score -= 20;
issues.push("Add stronger photorealism keywords");
}
if (!/negative prompt/i.test(input)) {
score -= 20;
issues.push("Include a Negative Prompt - protects face identity");
missingProtections.push({ name: 'Negative Prompt', text: 'NEGATIVE PROMPT: (neckband, headphones), facial slimming, V-shaped jaw, sharpened chin, thin nose, narrowed eyes, wire-rimmed glasses, rounded glasses, plastic skin, AI art style, 3D render, beautification filter, changed identity, skinny face, cartoon, CGI, illustration, over sharpened, extra fingers, distorted face' });
}
if (input.length < 180) {
score -= 15;
issues.push("Prompt is too short - add more scene, lighting and identity detail");
}
if (!/(identity|face structure|reference image)/i.test(input)) {
score -= 20;
missingProtections.push({ name: 'EFCP 200%', text: efcpUltra });
}
if (!/lighting/i.test(input)) {
score -= 10;
issues.push("No lighting specification - define lighting for realism");
}
if (!/(camera|lens|aperture|dslr|mirrorless)/i.test(input)) {
score -= 10;
issues.push("No camera/lens detail - specify for photorealistic output");
}
if (!/(distorted face|symmetry|skin smoothing)/i.test(input)) {
score -= 5;
issues.push("Add negative face-distortion terms");
}
if (!/(body structure|shoulder|posture)/i.test(input)) {
faceFidelity -= 10;
missingProtections.push({ name: 'Body Structure', text: 'BODY STRUCTURE CONSISTENCY: Preserve exact body shape, shoulder width, and posture from reference image. Maintain body proportions and muscle tone. Do not slim, elongate, or morph the torso.' });
}
if (!/(background|real-world|photographic)/i.test(input)) {
faceFidelity -= 8;
missingProtections.push({ name: 'Background Realism', text: 'REAL-WORLD BACKGROUND REALISM: Use photographic real-world environments (not AI-generated backgrounds). Include natural depth, authentic settings.' });
}
if (!/(depth of field|bokeh|perspective)/i.test(input)) {
faceFidelity -= 8;
missingProtections.push({ name: 'Photographic Depth', text: 'PHOTOGRAPHIC DEPTH: DSLR-style shallow depth of field with natural bokeh. Realistic perspective falloff. Soft out-of-focus background with authentic optical bokeh.' });
}
score = Math.max(0, score);
faceFidelity = Math.max(0, faceFidelity);
const badge = document.getElementById('scoreBadge');
badge.textContent = `${score} / 100`;
if (score >= 80) {
badge.className = "text-3xl font-bold text-center py-4 rounded-xl bg-green-500/20 text-green-400";
} else if (score >= 50) {
badge.className = "text-3xl font-bold text-center py-4 rounded-xl bg-yellow-500/20 text-yellow-400";
} else {
badge.className = "text-3xl font-bold text-center py-4 rounded-xl bg-red-500/20 text-red-400";
}
const faceBadge = document.getElementById('faceFidelityBadge');
faceBadge.textContent = `${faceFidelity} / 100`;
if (faceFidelity >= 80) {
faceBadge.className = "text-3xl font-bold text-center py-4 rounded-xl bg-green-500/20 text-green-400";
} else if (faceFidelity >= 50) {
faceBadge.className = "text-3xl font-bold text-center py-4 rounded-xl bg-yellow-500/20 text-yellow-400";
} else {
faceBadge.className = "text-3xl font-bold text-center py-4 rounded-xl bg-red-500/20 text-red-400";
}
// Show missing protections
const missingDiv = document.getElementById('missingProtections');
const missingList = document.getElementById('missingList');
if (missingProtections.length > 0) {
missingDiv.classList.remove('hidden');
missingList.innerHTML = missingProtections.map(m => `
<div class="flex items-center justify-between gap-2">
<span class="text-sm">${m.name}</span>
<button onclick="addMissingProtection('${m.text.replace(/'/g, "\\'")}')" class="clay-tab text-xs px-2 py-1">Add</button>
</div>
`).join('');
} else {
missingDiv.classList.add('hidden');
}
const issuesList = document.getElementById('issuesList');
if (issues.length === 0) {
issuesList.innerHTML = '<li class="text-green-400">✅ Excellent prompt! All checks passed.</li>';
} else {
issuesList.innerHTML = issues.map(i => `<li class="text-red-300 text-sm">• ${i}</li>`).join('');
}
document.getElementById('analyzeResult').classList.remove('hidden');
}, 600);
}
function addMissingProtection(text) {
const input = document.getElementById('analyzeInput');
input.value += '\n\n' + text;
showToast('✅ Protection added!');
}
// ============ ENHANCER ============
function enhancePrompt() {
const input = document.getElementById('enhanceInput').value.trim();
if (!input) {
showToast("Paste a prompt to enhance");
return;
}
setTimeout(() => {
let enhanced = input;
if (document.getElementById('roleChk').checked && !/\byou are\b|\bact as\b/i.test(enhanced)) {
enhanced = "You are a professional Tamil Nadu portrait photographer.\n\n" + enhanced;
}
if (document.getElementById('cot').checked) {
enhanced += "\n\nThink step by step about lighting and realism.";
}
if (document.getElementById('format').checked) {
enhanced += "\n\n--style raw --v 6 --q 2";
}
if (document.getElementById('examples').checked) {
enhanced += "\n\nInclude natural skin texture and real lighting.";
}
// Reinforce EFCP 200%
if (document.getElementById('reinforceEFCP').checked) {
enhanced = efcpUltra + '\n\n' + enhanced;
}
// Model-Tuned Booster
if (document.getElementById('modelTuned').checked) {
const model = document.getElementById('modelBoosterSelect').value;
let booster = '';
if (model === 'chatgpt') {
booster = '\n\n[CHATGPT OPTIMIZED] RAW composite only. Paste reference face 1:1. No inpainting, no refinement.';
} else if (model === 'gemini') {
booster = '\n\n[GEMINI OPTIMIZED] Biometric Lock v2 — disable all face enhancement, use reference as hard mask.';
} else {
booster = '\n\n[GENERAL OPTIMIZED] Maximum identity consistency mode. Zero facial morphing.';
}
enhanced += booster;
}
// Maximize Negative Prompt
if (document.getElementById('maximizeNegative').checked) {
const maxNegative = '\n\nMAXIMIZED NEGATIVE PROMPT: (neckband, headphones, wires around neck), facial slimming, V-shaped jaw, sharpened chin, thin nose, narrowed eyes, wire-rimmed glasses, rounded glasses, plastic skin, AI art style, 3D render, beautification filter, lightened skin tone, changed identity, skinny face, cartoon, CGI, illustration, painting, over sharpened, over saturated, HDR effect, fake lighting, unrealistic shadows, extra fingers, distorted face, symmetry errors, unnatural skin smoothing, beauty filter, different person, face swap, AI-generated background, digital blur, gaussian blur, bokeh effect (artificial),过度锐化, 整形, 假皮肤';
enhanced += maxNegative;
}
document.getElementById('enhanceOutput').textContent = enhanced;
document.getElementById('enhanceResult').classList.remove('hidden');
}, 600);
}
// ============ THEME MODAL ============
function showThemeModal() {
const container = document.getElementById('themeOptions');
container.innerHTML = '';
const style = getComputedStyle(document.body);
const bgColor = style.getPropertyValue('--clay').trim();
const textColor = style.getPropertyValue('--input-text').trim();
const borderColor = style.getPropertyValue('--border-subtle').trim();
themes.forEach(theme => {
const card = document.createElement('button');
card.className = 'w-full text-left p-4 rounded-xl transition-all hover:scale-[1.02]';
card.style.background = 'rgba(255, 255, 255, 0.30)';
card.style.backdropFilter = 'blur(20px) saturate(180%)';
card.style.webkitBackdropFilter = 'blur(20px) saturate(180%)';
card.style.color = textColor;
card.style.border = '1px solid rgba(255, 255, 255, 0.2)';
card.style.boxShadow = '0 8px 32px rgba(0, 0, 0, 0.3)';
card.innerHTML = `
<div class="font-semibold">${theme.name}</div>
<div class="text-sm opacity-70">${theme.desc}</div>
`;
card.onclick = () => {
document.body.dataset.theme = theme.id;
localStorage.setItem('tamilreal_theme', theme.id);
hideThemeModal();
};
container.appendChild(card);
});
document.getElementById('themeModal').classList.remove('hidden');
}
function hideThemeModal() {
document.getElementById('themeModal').classList.add('hidden');
}
// ============ SAVED PROMPTS ============
function saveCurrentPrompt() {
const name = prompt("Enter a name for this prompt:");
if (!name) return;
const prompts = JSON.parse(localStorage.getItem('tamilreal_prompts') || '[]');
if (prompts.length >= 50) {
prompts.shift();
showToast("Oldest prompt removed - limit reached");
}
// Auto-generate tags
const model = document.getElementById('modelSelect').value;
const tags = [model.toUpperCase(), 'EFCP-200%'];
// Add variant tag if used
if (currentPrompt.includes('[CHATGPT OPTIMIZED]')) tags.push('ChatGPT');
if (currentPrompt.includes('[GEMINI OPTIMIZED]')) tags.push('Gemini');
if (currentPrompt.includes('[GENERAL OPTIMIZED]')) tags.push('General');
prompts.push({
id: Date.now(),
name: name,
content: currentPrompt,
tags: tags.join(', '),
savedAt: new Date().toISOString()
});
localStorage.setItem('tamilreal_prompts', JSON.stringify(prompts));
showToast(`✅ Saved as "${name}" with tags: ${tags.join(', ')}`);
}
function loadSavedPrompts() {
const panel = document.getElementById('libraryPanel');
const container = document.getElementById('savedPromptsList');
const search = document.getElementById('librarySearch').value.toLowerCase();
const tagFilter = document.getElementById('tagFilter').value;
panel.classList.remove('hidden');
const prompts = JSON.parse(localStorage.getItem('tamilreal_prompts') || '[]');
let filtered = prompts.filter(p => p.name.toLowerCase().includes(search));
if (tagFilter) {
filtered = filtered.filter(p => p.tags && p.tags.toLowerCase().includes(tagFilter.toLowerCase()));
}
if (filtered.length === 0) {
container.innerHTML = '<p class="text-sm opacity-70">No saved prompts yet. Generate a prompt and hit Save.</p>';
return;
}
container.innerHTML = filtered.map(p => `
<div class="bg-black/20 rounded-lg p-3">
<div class="flex justify-between items-start mb-2">
<span class="font-medium">${p.name}</span>
<span class="text-xs opacity-60">${new Date(p.savedAt).toLocaleDateString()}</span>
</div>
<div class="flex gap-1 mb-2 flex-wrap">
${p.tags ? p.tags.split(', ').map(t => `<span class="text-xs bg-[#d9775a]/30 px-2 py-0.5 rounded">${t}</span>`).join('') : ''}
</div>
<p class="text-xs opacity-70 mb-2 line-clamp-2">${p.content.substring(0, 120)}...</p>
<div class="flex gap-2">
<button onclick="loadPrompt(${p.id})" class="clay-btn text-xs py-1 px-3">Load</button>
<button onclick="deletePrompt(${p.id})" class="clay-tab text-xs py-1 px-3">Delete</button>
</div>
</div>
`).join('');
}
function loadPrompt(id) {
const prompts = JSON.parse(localStorage.getItem('tamilreal_prompts') || '[]');
const prompt = prompts.find(p => p.id === id);
if (prompt) {
currentPrompt = prompt.content;
showResult();
showToast(`Loaded "${prompt.name}"`);
}
}
function deletePrompt(id) {
let prompts = JSON.parse(localStorage.getItem('tamilreal_prompts') || '[]');
prompts = prompts.filter(p => p.id !== id);
localStorage.setItem('tamilreal_prompts', JSON.stringify(prompts));
loadSavedPrompts();
showToast("Prompt deleted");
}
// ============ INIT ============
window.onload = function() {
populateDropdowns();
loadApiKeys();
switchTab(0);
const savedTheme = localStorage.getItem('tamilreal_theme') || 'clay';
document.body.dataset.theme = savedTheme;
};
</script>
</body>
</html>