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
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
<!DOCTYPE html>
|
| 2 |
+
<html lang="en">
|
| 3 |
+
<head>
|
| 4 |
+
<meta charset="UTF-8">
|
| 5 |
+
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
| 6 |
+
<title>PhotoCritique - Professional Feedback Simulator</title>
|
| 7 |
+
<!-- Importing a font for modern typography -->
|
| 8 |
+
<link href="https://fonts.googleapis.com/css2?family=Inter:wght@300;400;600;800&display=swap" rel="stylesheet">
|
| 9 |
+
<!-- Importing FontAwesome for Icons -->
|
| 10 |
+
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.0/css/all.min.css">
|
| 11 |
+
|
| 12 |
+
<style>
|
| 13 |
+
:root {
|
| 14 |
+
--primary: #6366f1;
|
| 15 |
+
--primary-hover: #4f46e5;
|
| 16 |
+
--bg-dark: #0f172a;
|
| 17 |
+
--bg-card: #1e293b;
|
| 18 |
+
--text-main: #f8fafc;
|
| 19 |
+
--text-muted: #94a3b8;
|
| 20 |
+
--accent: #22d3ee;
|
| 21 |
+
--danger: #ef4444;
|
| 22 |
+
--success: #10b981;
|
| 23 |
+
--radius: 16px;
|
| 24 |
+
--shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.5);
|
| 25 |
+
}
|
| 26 |
+
|
| 27 |
+
* {
|
| 28 |
+
box-sizing: border-box;
|
| 29 |
+
margin: 0;
|
| 30 |
+
padding: 0;
|
| 31 |
+
}
|
| 32 |
+
|
| 33 |
+
body {
|
| 34 |
+
font-family: 'Inter', sans-serif;
|
| 35 |
+
background-color: var(--bg-dark);
|
| 36 |
+
color: var(--text-main);
|
| 37 |
+
min-height: 100vh;
|
| 38 |
+
display: flex;
|
| 39 |
+
flex-direction: column;
|
| 40 |
+
line-height: 1.6;
|
| 41 |
+
}
|
| 42 |
+
|
| 43 |
+
/* Header */
|
| 44 |
+
header {
|
| 45 |
+
background: rgba(30, 41, 59, 0.8);
|
| 46 |
+
backdrop-filter: blur(10px);
|
| 47 |
+
padding: 1.5rem 2rem;
|
| 48 |
+
position: sticky;
|
| 49 |
+
top: 0;
|
| 50 |
+
z-index: 100;
|
| 51 |
+
border-bottom: 1px solid rgba(255,255,255,0.1);
|
| 52 |
+
display: flex;
|
| 53 |
+
justify-content: space-between;
|
| 54 |
+
align-items: center;
|
| 55 |
+
}
|
| 56 |
+
|
| 57 |
+
.logo {
|
| 58 |
+
font-size: 1.5rem;
|
| 59 |
+
font-weight: 800;
|
| 60 |
+
background: linear-gradient(to right, var(--primary), var(--accent));
|
| 61 |
+
-webkit-background-clip: text;
|
| 62 |
+
-webkit-text-fill-color: transparent;
|
| 63 |
+
display: flex;
|
| 64 |
+
align-items: center;
|
| 65 |
+
gap: 0.5rem;
|
| 66 |
+
}
|
| 67 |
+
|
| 68 |
+
.attribution a {
|
| 69 |
+
color: var(--text-muted);
|
| 70 |
+
text-decoration: none;
|
| 71 |
+
font-size: 0.9rem;
|
| 72 |
+
transition: color 0.3s ease;
|
| 73 |
+
}
|
| 74 |
+
|
| 75 |
+
.attribution a:hover {
|
| 76 |
+
color: var(--primary);
|
| 77 |
+
}
|
| 78 |
+
|
| 79 |
+
/* Main Container */
|
| 80 |
+
main {
|
| 81 |
+
flex: 1;
|
| 82 |
+
max-width: 1200px;
|
| 83 |
+
width: 100%;
|
| 84 |
+
margin: 0 auto;
|
| 85 |
+
padding: 2rem;
|
| 86 |
+
display: flex;
|
| 87 |
+
flex-direction: column;
|
| 88 |
+
gap: 2rem;
|
| 89 |
+
}
|
| 90 |
+
|
| 91 |
+
/* Upload Section */
|
| 92 |
+
.upload-section {
|
| 93 |
+
background: var(--bg-card);
|
| 94 |
+
border-radius: var(--radius);
|
| 95 |
+
padding: 3rem;
|
| 96 |
+
text-align: center;
|
| 97 |
+
border: 2px dashed rgba(255,255,255,0.1);
|
| 98 |
+
transition: all 0.3s ease;
|
| 99 |
+
position: relative;
|
| 100 |
+
overflow: hidden;
|
| 101 |
+
}
|
| 102 |
+
|
| 103 |
+
.upload-section.drag-over {
|
| 104 |
+
border-color: var(--primary);
|
| 105 |
+
background: rgba(99, 102, 241, 0.1);
|
| 106 |
+
}
|
| 107 |
+
|
| 108 |
+
.upload-icon {
|
| 109 |
+
font-size: 4rem;
|
| 110 |
+
color: var(--text-muted);
|
| 111 |
+
margin-bottom: 1rem;
|
| 112 |
+
}
|
| 113 |
+
|
| 114 |
+
.upload-text h3 {
|
| 115 |
+
font-size: 1.5rem;
|
| 116 |
+
margin-bottom: 0.5rem;
|
| 117 |
+
}
|
| 118 |
+
|
| 119 |
+
.upload-text p {
|
| 120 |
+
color: var(--text-muted);
|
| 121 |
+
margin-bottom: 1.5rem;
|
| 122 |
+
}
|
| 123 |
+
|
| 124 |
+
.btn {
|
| 125 |
+
background: var(--primary);
|
| 126 |
+
color: white;
|
| 127 |
+
border: none;
|
| 128 |
+
padding: 0.8rem 2rem;
|
| 129 |
+
border-radius: 50px;
|
| 130 |
+
font-weight: 600;
|
| 131 |
+
cursor: pointer;
|
| 132 |
+
transition: transform 0.2s, background 0.2s;
|
| 133 |
+
font-size: 1rem;
|
| 134 |
+
display: inline-flex;
|
| 135 |
+
align-items: center;
|
| 136 |
+
gap: 0.5rem;
|
| 137 |
+
}
|
| 138 |
+
|
| 139 |
+
.btn:hover {
|
| 140 |
+
background: var(--primary-hover);
|
| 141 |
+
transform: translateY(-2px);
|
| 142 |
+
}
|
| 143 |
+
|
| 144 |
+
.btn:disabled {
|
| 145 |
+
background: var(--text-muted);
|
| 146 |
+
cursor: not-allowed;
|
| 147 |
+
transform: none;
|
| 148 |
+
}
|
| 149 |
+
|
| 150 |
+
#fileInput {
|
| 151 |
+
display: none;
|
| 152 |
+
}
|
| 153 |
+
|
| 154 |
+
/* Preview Area */
|
| 155 |
+
.preview-container {
|
| 156 |
+
display: none; /* Hidden by default */
|
| 157 |
+
background: var(--bg-card);
|
| 158 |
+
padding: 2rem;
|
| 159 |
+
border-radius: var(--radius);
|
| 160 |
+
box-shadow: var(--shadow);
|
| 161 |
+
flex-direction: column;
|
| 162 |
+
align-items: center;
|
| 163 |
+
gap: 2rem;
|
| 164 |
+
animation: fadeIn 0.5s ease;
|
| 165 |
+
}
|
| 166 |
+
|
| 167 |
+
.image-wrapper {
|
| 168 |
+
max-width: 100%;
|
| 169 |
+
max-height: 500px;
|
| 170 |
+
border-radius: 8px;
|
| 171 |
+
overflow: hidden;
|
| 172 |
+
border: 1px solid rgba(255,255,255,0.1);
|
| 173 |
+
}
|
| 174 |
+
|
| 175 |
+
.image-wrapper img {
|
| 176 |
+
width: 100%;
|
| 177 |
+
height: 100%;
|
| 178 |
+
object-fit: contain;
|
| 179 |
+
display: block;
|
| 180 |
+
}
|
| 181 |
+
|
| 182 |
+
.controls {
|
| 183 |
+
display: flex;
|
| 184 |
+
gap: 1rem;
|
| 185 |
+
flex-wrap: wrap;
|
| 186 |
+
justify-content: center;
|
| 187 |
+
}
|
| 188 |
+
|
| 189 |
+
.btn-secondary {
|
| 190 |
+
background: transparent;
|
| 191 |
+
border: 1px solid var(--text-muted);
|
| 192 |
+
color: var(--text-muted);
|
| 193 |
+
}
|
| 194 |
+
|
| 195 |
+
.btn-secondary:hover {
|
| 196 |
+
border-color: var(--text-main);
|
| 197 |
+
color: var(--text-main);
|
| 198 |
+
background: rgba(255,255,255,0.05);
|
| 199 |
+
}
|
| 200 |
+
|
| 201 |
+
/* Results Section */
|
| 202 |
+
.results-section {
|
| 203 |
+
display: none;
|
| 204 |
+
margin-top: 2rem;
|
| 205 |
+
}
|
| 206 |
+
|
| 207 |
+
.section-title {
|
| 208 |
+
font-size: 1.5rem;
|
| 209 |
+
margin-bottom: 1.5rem;
|
| 210 |
+
display: flex;
|
| 211 |
+
align-items: center;
|
| 212 |
+
gap: 0.5rem;
|
| 213 |
+
}
|
| 214 |
+
|
| 215 |
+
.reviews-grid {
|
| 216 |
+
display: grid;
|
| 217 |
+
grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
|
| 218 |
+
gap: 1.5rem;
|
| 219 |
+
}
|
| 220 |
+
|
| 221 |
+
/* Review Card */
|
| 222 |
+
.review-card {
|
| 223 |
+
background: var(--bg-card);
|
| 224 |
+
padding: 1.5rem;
|
| 225 |
+
border-radius: var(--radius);
|
| 226 |
+
border: 1px solid rgba(255,255,255,0.05);
|
| 227 |
+
display: flex;
|
| 228 |
+
flex-direction: column;
|
| 229 |
+
gap: 1rem;
|
| 230 |
+
animation: slideUp 0.5s ease forwards;
|
| 231 |
+
opacity: 0;
|
| 232 |
+
transform: translateY(20px);
|
| 233 |
+
}
|
| 234 |
+
|
| 235 |
+
.reviewer-header {
|
| 236 |
+
display: flex;
|
| 237 |
+
align-items: center;
|
| 238 |
+
gap: 1rem;
|
| 239 |
+
}
|
| 240 |
+
|
| 241 |
+
.avatar {
|
| 242 |
+
width: 50px;
|
| 243 |
+
height: 50px;
|
| 244 |
+
border-radius: 50%;
|
| 245 |
+
object-fit: cover;
|
| 246 |
+
border: 2px solid var(--primary);
|
| 247 |
+
}
|
| 248 |
+
|
| 249 |
+
.reviewer-info h4 {
|
| 250 |
+
font-size: 1rem;
|
| 251 |
+
margin-bottom: 0.2rem;
|
| 252 |
+
}
|
| 253 |
+
|
| 254 |
+
.reviewer-role {
|
| 255 |
+
font-size: 0.8rem;
|
| 256 |
+
color: var(--accent);
|
| 257 |
+
text-transform: uppercase;
|
| 258 |
+
letter-spacing: 1px;
|
| 259 |
+
font-weight: 600;
|
| 260 |
+
}
|
| 261 |
+
|
| 262 |
+
.rating-stars {
|
| 263 |
+
color: #fbbf24;
|
| 264 |
+
font-size: 0.9rem;
|
| 265 |
+
}
|
| 266 |
+
|
| 267 |
+
.review-body {
|
| 268 |
+
font-size: 0.95rem;
|
| 269 |
+
color: #cbd5e1;
|
| 270 |
+
font-style: italic;
|
| 271 |
+
background: rgba(0,0,0,0.2);
|
| 272 |
+
padding: 1rem;
|
| 273 |
+
border-radius: 8px;
|
| 274 |
+
border-left: 3px solid var(--primary);
|
| 275 |
+
}
|
| 276 |
+
|
| 277 |
+
.review-tags {
|
| 278 |
+
display: flex;
|
| 279 |
+
flex-wrap: wrap;
|
| 280 |
+
gap: 0.5rem;
|
| 281 |
+
}
|
| 282 |
+
|
| 283 |
+
.tag {
|
| 284 |
+
font-size: 0.75rem;
|
| 285 |
+
padding: 0.25rem 0.75rem;
|
| 286 |
+
border-radius: 20px;
|
| 287 |
+
background: rgba(255,255,255,0.1);
|
| 288 |
+
color: var(--text-muted);
|
| 289 |
+
}
|
| 290 |
+
|
| 291 |
+
/* Loading State */
|
| 292 |
+
.loading-overlay {
|
| 293 |
+
display: none;
|
| 294 |
+
flex-direction: column;
|
| 295 |
+
align-items: center;
|
| 296 |
+
justify-content: center;
|
| 297 |
+
padding: 3rem;
|
| 298 |
+
gap: 1rem;
|
| 299 |
+
}
|
| 300 |
+
|
| 301 |
+
.spinner {
|
| 302 |
+
width: 40px;
|
| 303 |
+
height: 40px;
|
| 304 |
+
border: 4px solid rgba(255,255,255,0.1);
|
| 305 |
+
border-left-color: var(--accent);
|
| 306 |
+
border-radius: 50%;
|
| 307 |
+
animation: spin 1s linear infinite;
|
| 308 |
+
}
|
| 309 |
+
|
| 310 |
+
@keyframes spin { 100% { transform: rotate(360deg); } }
|
| 311 |
+
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
|
| 312 |
+
@keyframes slideUp { to { opacity: 1; transform: translateY(0); } }
|
| 313 |
+
|
| 314 |
+
/* Responsive Adjustments */
|
| 315 |
+
@media (max-width: 768px) {
|
| 316 |
+
.upload-section { padding: 1.5rem; }
|
| 317 |
+
.logo span { display: none; }
|
| 318 |
+
.logo i { display: block; }
|
| 319 |
+
}
|
| 320 |
+
</style>
|
| 321 |
+
</head>
|
| 322 |
+
<body>
|
| 323 |
+
|
| 324 |
+
<header>
|
| 325 |
+
<div class="logo">
|
| 326 |
+
<i class="fa-solid fa-camera-retro"></i>
|
| 327 |
+
<span>PhotoCritique</span>
|
| 328 |
+
</div>
|
| 329 |
+
<div class="attribution">
|
| 330 |
+
Built with <a href="https://huggingface.co/spaces/akhaliq/anycoder" target="_blank">anycoder</a>
|
| 331 |
+
</div>
|
| 332 |
+
</header>
|
| 333 |
+
|
| 334 |
+
<main>
|
| 335 |
+
<!-- Upload Section -->
|
| 336 |
+
<section class="upload-section" id="dropZone">
|
| 337 |
+
<div class="upload-icon">
|
| 338 |
+
<i class="fa-solid fa-cloud-arrow-up"></i>
|
| 339 |
+
</div>
|
| 340 |
+
<div class="upload-text">
|
| 341 |
+
<h3>Upload your artwork</h3>
|
| 342 |
+
<p>Drag & drop a photo here, or click to browse</p>
|
| 343 |
+
</div>
|
| 344 |
+
<input type="file" id="fileInput" accept="image/*">
|
| 345 |
+
<button class="btn" onclick="document.getElementById('fileInput').click()">
|
| 346 |
+
Select Image
|
| 347 |
+
</button>
|
| 348 |
+
</section>
|
| 349 |
+
|
| 350 |
+
<!-- Preview & Action Section -->
|
| 351 |
+
<section class="preview-container" id="previewContainer">
|
| 352 |
+
<div class="image-wrapper">
|
| 353 |
+
<img id="imagePreview" src="" alt="Preview">
|
| 354 |
+
</div>
|
| 355 |
+
|
| 356 |
+
<div class="controls">
|
| 357 |
+
<button class="btn btn-secondary" id="resetBtn">
|
| 358 |
+
<i class="fa-solid fa-trash"></i> Clear
|
| 359 |
+
</button>
|
| 360 |
+
<button class="btn" id="analyzeBtn">
|
| 361 |
+
<i class="fa-solid fa-wand-magic-sparkles"></i> Get Critique
|
| 362 |
+
</button>
|
| 363 |
+
</div>
|
| 364 |
+
|
| 365 |
+
<!-- Loading Indicator -->
|
| 366 |
+
<div class="loading-overlay" id="loadingIndicator">
|
| 367 |
+
<div class="spinner"></div>
|
| 368 |
+
<p>Gathering reviews from top critics...</p>
|
| 369 |
+
</div>
|
| 370 |
+
</section>
|
| 371 |
+
|
| 372 |
+
<!-- Results Section -->
|
| 373 |
+
<section class="results-section" id="resultsSection">
|
| 374 |
+
<div class="section-title">
|
| 375 |
+
<i class="fa-solid fa-comments"></i> Critique Results
|
| 376 |
+
</div>
|
| 377 |
+
<div class="reviews-grid" id="reviewsGrid">
|
| 378 |
+
<!-- Reviews will be injected here via JS -->
|
| 379 |
+
</div>
|
| 380 |
+
</section>
|
| 381 |
+
</main>
|
| 382 |
+
|
| 383 |
+
<script>
|
| 384 |
+
// DOM Elements
|
| 385 |
+
const dropZone = document.getElementById('dropZone');
|
| 386 |
+
const fileInput = document.getElementById('fileInput');
|
| 387 |
+
const previewContainer = document.getElementById('previewContainer');
|
| 388 |
+
const imagePreview = document.getElementById('imagePreview');
|
| 389 |
+
const resetBtn = document.getElementById('resetBtn');
|
| 390 |
+
const analyzeBtn = document.getElementById('analyzeBtn');
|
| 391 |
+
const loadingIndicator = document.getElementById('loadingIndicator');
|
| 392 |
+
const resultsSection = document.getElementById('resultsSection');
|
| 393 |
+
const reviewsGrid = document.getElementById('reviewsGrid');
|
| 394 |
+
|
| 395 |
+
// State
|
| 396 |
+
let currentFile = null;
|
| 397 |
+
|
| 398 |
+
// --- Event Listeners ---
|
| 399 |
+
|
| 400 |
+
// Drag & Drop
|
| 401 |
+
dropZone.addEventListener('dragover', (e) => {
|
| 402 |
+
e.preventDefault();
|
| 403 |
+
dropZone.classList.add('drag-over');
|
| 404 |
+
});
|
| 405 |
+
|
| 406 |
+
dropZone.addEventListener('dragleave', () => {
|
| 407 |
+
dropZone.classList.remove('drag-over');
|
| 408 |
+
});
|
| 409 |
+
|
| 410 |
+
dropZone.addEventListener('drop', (e) => {
|
| 411 |
+
e.preventDefault();
|
| 412 |
+
dropZone.classList.remove('drag-over');
|
| 413 |
+
if (e.dataTransfer.files.length) {
|
| 414 |
+
handleFile(e.dataTransfer.files[0]);
|
| 415 |
+
}
|
| 416 |
+
});
|
| 417 |
+
|
| 418 |
+
// File Input Change
|
| 419 |
+
fileInput.addEventListener('change', (e) => {
|
| 420 |
+
if (e.target.files.length) {
|
| 421 |
+
handleFile(e.target.files[0]);
|
| 422 |
+
}
|
| 423 |
+
});
|
| 424 |
+
|
| 425 |
+
// Reset
|
| 426 |
+
resetBtn.addEventListener('click', resetApp);
|
| 427 |
+
|
| 428 |
+
// Analyze
|
| 429 |
+
analyzeBtn.addEventListener('click', generateCritiques);
|
| 430 |
+
|
| 431 |
+
// --- Functions ---
|
| 432 |
+
|
| 433 |
+
function handleFile(file) {
|
| 434 |
+
if (!file.type.startsWith('image/')) {
|
| 435 |
+
alert('Please upload a valid image file.');
|
| 436 |
+
return;
|
| 437 |
+
}
|
| 438 |
+
|
| 439 |
+
currentFile = file;
|
| 440 |
+
const reader = new FileReader();
|
| 441 |
+
reader.onload = (e) => {
|
| 442 |
+
imagePreview.src = e.target.result;
|
| 443 |
+
dropZone.style.display = 'none';
|
| 444 |
+
previewContainer.style.display = 'flex';
|
| 445 |
+
resultsSection.style.display = 'none';
|
| 446 |
+
};
|
| 447 |
+
reader.readAsDataURL(file);
|
| 448 |
+
}
|
| 449 |
+
|
| 450 |
+
function resetApp() {
|
| 451 |
+
currentFile = null;
|
| 452 |
+
fileInput.value = '';
|
| 453 |
+
dropZone.style.display = 'block';
|
| 454 |
+
previewContainer.style.display = 'none';
|
| 455 |
+
resultsSection.style.display = 'none';
|
| 456 |
+
reviewsGrid.innerHTML = '';
|
| 457 |
+
}
|
| 458 |
+
|
| 459 |
+
function generateCritiques() {
|
| 460 |
+
// UI Updates
|
| 461 |
+
analyzeBtn.disabled = true;
|
| 462 |
+
resetBtn.disabled = true;
|
| 463 |
+
loadingIndicator.style.display = 'flex';
|
| 464 |
+
resultsSection.style.display = 'none';
|
| 465 |
+
|
| 466 |
+
// Simulate API delay
|
| 467 |
+
setTimeout(() => {
|
| 468 |
+
const reviews = createMockReviews();
|
| 469 |
+
displayReviews(reviews);
|
| 470 |
+
|
| 471 |
+
// Restore UI
|
| 472 |
+
loadingIndicator.style.display = 'none';
|
| 473 |
+
analyzeBtn.disabled = false;
|
| 474 |
+
resetBtn.disabled = false;
|
| 475 |
+
resultsSection.style.display = 'block';
|
| 476 |
+
|
| 477 |
+
// Scroll to results
|
| 478 |
+
resultsSection.scrollIntoView({ behavior: 'smooth' });
|
| 479 |
+
}, 2000);
|
| 480 |
+
}
|
| 481 |
+
|
| 482 |
+
// --- Mock Data Generators ---
|
| 483 |
+
|
| 484 |
+
const personas = [
|
| 485 |
+
{
|
| 486 |
+
name: "Elena V.",
|
| 487 |
+
role: "Art Curator",
|
| 488 |
+
avatar: "https://picsum.photos/seed/elena/100/100",
|
| 489 |
+
style: "sophisticated"
|
| 490 |
+
},
|
| 491 |
+
{
|
| 492 |
+
name: "Marcus J.",
|
| 493 |
+
role: "Photography Prof",
|
| 494 |
+
avatar: "https://picsum.photos/seed/marcus/100/100",
|
| 495 |
+
style: "technical"
|
| 496 |
+
},
|
| 497 |
+
{
|
| 498 |
+
name: "Sarah L.",
|
| 499 |
+
role: "Creative Director",
|
| 500 |
+
avatar: "https://picsum.photos/seed/sarah/100/100",
|
| 501 |
+
style: "emotive"
|
| 502 |
+
}
|
| 503 |
+
];
|
| 504 |
+
|
| 505 |
+
const openers = {
|
| 506 |
+
sophisticated: [
|
| 507 |
+
"The composition here is quite striking.",
|
| 508 |
+
"There is a palpable sense of narrative in this piece.",
|
| 509 |
+
"I find the color palette rather intriguing.",
|
| 510 |
+
"This work challenges the viewer's perspective effectively."
|
| 511 |
+
],
|
| 512 |
+
technical: [
|
| 513 |
+
"The lighting setup suggests a professional approach.",
|
| 514 |
+
"I notice the depth of field is used strategically here.",
|
| 515 |
+
"The exposure balance is handled with precision.",
|
| 516 |
+
"Technically speaking, the framing adheres to the rule of thirds nicely."
|
| 517 |
+
],
|
| 518 |
+
emotive: [
|
| 519 |
+
"This image evokes a strong sense of nostalgia.",
|
| 520 |
+
"I can really feel the emotion captured in this moment.",
|
| 521 |
+
"There is a raw honesty present in this shot.",
|
| 522 |
+
"The mood conveyed is incredibly atmospheric."
|
| 523 |
+
]
|
| 524 |
+
};
|
| 525 |
+
|
| 526 |
+
const critiques = {
|
| 527 |
+
sophisticated: [
|
| 528 |
+
"However, I believe the negative space could be utilized more effectively to guide the eye. The juxtaposition of elements is clever, but perhaps slightly cluttered in the lower quadrant.",
|
| 529 |
+
"While the subject is compelling, the background elements distract slightly from the focal point. A subtle shift in aperture might have elevated this further.",
|
| 530 |
+
"The texture work is exquisite. I do wonder if a slightly warmer temperature would enhance the emotional resonance without compromising the realism."
|
| 531 |
+
],
|
| 532 |
+
technical: [
|
| 533 |
+
"Focus seems to be sharp on the primary subject, which is excellent. That said, the highlights are slightly blown out in the upper right corner; recovering those details in post would improve dynamic range.",
|
| 534 |
+
"The leading lines draw the eye well, but the horizon line appears slightly tilted. Correcting this rotation would stabilize the composition significantly.",
|
| 535 |
+
"ISO performance looks clean, indicating good lighting conditions. I would suggest experimenting with a wider shutter speed to introduce some motion blur for artistic effect."
|
| 536 |
+
],
|
| 537 |
+
emotive: [
|
| 538 |
+
"It connects with me on a personal level, though I feel the expression could be emphasized more through contrast. The story being told is clear, yet leaves room for interpretation.",
|
| 539 |
+
"There is a beautiful vulnerability here. To make it pop, I might suggest increasing the clarity slightly to bring out the textures in the shadows.",
|
| 540 |
+
"The atmosphere is undeniable. If the colors were slightly desaturated, I think it would add to the somber, reflective tone of the piece."
|
| 541 |
+
]
|
| 542 |
+
};
|
| 543 |
+
|
| 544 |
+
const tagsPool = [
|
| 545 |
+
"Creative", "Well-Lit", "Moody", "Dynamic", "Balanced",
|
| 546 |
+
"Raw", "Modern", "Classic", "Vibrant", "Detailed"
|
| 547 |
+
];
|
| 548 |
+
|
| 549 |
+
function createMockReviews() {
|
| 550 |
+
return personas.map((persona, index) => {
|
| 551 |
+
// Randomly select text parts based on persona style
|
| 552 |
+
const opener = openers[persona.style][Math.floor(Math.random() * openers[persona.style].length)];
|
| 553 |
+
const critique = critiques[persona.style][Math.floor(Math.random() * critiques[persona.style].length)];
|
| 554 |
+
|
| 555 |
+
// Generate random rating (3 to 5 stars)
|
| 556 |
+
const rating = Math.floor(Math.random() * 3) + 3;
|
| 557 |
+
|
| 558 |
+
// Generate 3 random tags
|
| 559 |
+
const shuffledTags = tagsPool.sort(() => 0.5 - Math.random());
|
| 560 |
+
const selectedTags = shuffledTags.slice(0, 3);
|
| 561 |
+
|
| 562 |
+
return {
|
| 563 |
+
...persona,
|
| 564 |
+
rating,
|
| 565 |
+
text: `${opener} ${critique}`,
|
| 566 |
+
tags: selectedTags,
|
| 567 |
+
delay: index * 200 // stagger animation
|
| 568 |
+
};
|
| 569 |
+
});
|
| 570 |
+
}
|
| 571 |
+
|
| 572 |
+
function displayReviews(reviews) {
|
| 573 |
+
reviewsGrid.innerHTML = '';
|
| 574 |
+
|
| 575 |
+
reviews.forEach(review => {
|
| 576 |
+
const card = document.createElement('article');
|
| 577 |
+
card.className = 'review-card';
|
| 578 |
+
card.style.animationDelay = `${review.delay}ms`;
|
| 579 |
+
|
| 580 |
+
// Create Stars HTML
|
| 581 |
+
let starsHtml = '';
|
| 582 |
+
for(let i=0; i<5; i++) {
|
| 583 |
+
if(i < review.rating) starsHtml += '<i class="fa-solid fa-star"></i>';
|
| 584 |
+
else starsHtml += '<i class="fa-regular fa-star"></i>';
|
| 585 |
+
}
|
| 586 |
+
|
| 587 |
+
// Create Tags HTML
|
| 588 |
+
const tagsHtml = review.tags.map(tag => `<span class="tag">#${tag}</span>`).join('');
|
| 589 |
+
|
| 590 |
+
card.innerHTML = `
|
| 591 |
+
<div class="reviewer-header">
|
| 592 |
+
<img src="${review.avatar}" alt="${review.name}" class="avatar">
|
| 593 |
+
<div class="reviewer-info">
|
| 594 |
+
<h4>${review.name}</h4>
|
| 595 |
+
<span class="reviewer-role">${review.role}</span>
|
| 596 |
+
</div>
|
| 597 |
+
</div>
|
| 598 |
+
<div class="rating-stars">${starsHtml}</div>
|
| 599 |
+
<div class="review-body">
|
| 600 |
+
"${review.text}"
|
| 601 |
+
</div>
|
| 602 |
+
<div class="review-tags">
|
| 603 |
+
${tagsHtml}
|
| 604 |
+
</div>
|
| 605 |
+
`;
|
| 606 |
+
|
| 607 |
+
reviewsGrid.appendChild(card);
|
| 608 |
+
});
|
| 609 |
+
}
|
| 610 |
+
</script>
|
| 611 |
+
</body>
|
| 612 |
+
</html>
|