243243 display : none;
244244 }
245245
246+ .context-section {
247+ margin-bottom : 30px ;
248+ animation : fadeInUp 0.5s ease;
249+ }
250+
251+ .context-label {
252+ display : block;
253+ color : # 495057 ;
254+ font-size : 1.1rem ;
255+ font-weight : 600 ;
256+ margin-bottom : 10px ;
257+ text-align : left;
258+ }
259+
260+ .context-input {
261+ width : 100% ;
262+ padding : 15px 20px ;
263+ border : 2px solid # e9ecef ;
264+ border-radius : 15px ;
265+ background : linear-gradient (145deg , # f8f9fa, # e9ecef );
266+ color : # 495057 ;
267+ font-size : 1rem ;
268+ font-family : inherit;
269+ line-height : 1.5 ;
270+ resize : vertical;
271+ min-height : 100px ;
272+ transition : all 0.3s ease;
273+ outline : none;
274+ }
275+
276+ .context-input : focus {
277+ border-color : # d4af37 ;
278+ background : linear-gradient (145deg , # fdf7e6, # f5e6cc );
279+ box-shadow : 0 0 0 3px rgba (212 , 175 , 55 , 0.1 );
280+ }
281+
282+ .context-input ::placeholder {
283+ color : # 6c757d ;
284+ opacity : 0.8 ;
285+ }
286+
246287 /* Mobile Responsiveness */
247288 @media (max-width : 768px ) {
248289 .container {
292333 .upload-text {
293334 font-size : 1rem ;
294335 }
336+
337+ .context-input {
338+ padding : 12px 15px ;
339+ font-size : 0.9rem ;
340+ }
341+
342+ .context-label {
343+ font-size : 1rem ;
344+ }
295345 }
296346 </ style >
297347 </ head >
@@ -306,6 +356,18 @@ <h1>🏛️ Hereditas</h1>
306356 < p class ="upload-text "> Click to upload an image</ p >
307357 </ div >
308358
359+ < div class ="context-section ">
360+ < label for ="contextInput " class ="context-label "
361+ > Add Context (Optional)</ label
362+ >
363+ < textarea
364+ id ="contextInput "
365+ class ="context-input "
366+ placeholder ="Provide additional context about this heritage object. "
367+ rows ="4 "
368+ > </ textarea >
369+ </ div >
370+
309371 < div id ="imagePreview " class ="preview-section hidden ">
310372 < img id ="previewImg " class ="preview-img " alt ="Preview " />
311373 < button id ="analyzeBtn "> Analyze Heritage Object</ button >
@@ -336,6 +398,7 @@ <h3>Analysis Result</h3>
336398 const analysisText = document . getElementById ( "analysisText" ) ;
337399 const errorDiv = document . getElementById ( "error" ) ;
338400 const newAnalysisBtn = document . getElementById ( "newAnalysisBtn" ) ;
401+ const contextInput = document . getElementById ( "contextInput" ) ;
339402
340403 // Supabase Edge Function endpoint
341404 const EDGE_FUNCTION_URL =
@@ -393,6 +456,7 @@ <h3>Analysis Result</h3>
393456 } ,
394457 body : JSON . stringify ( {
395458 imageBase64 : currentImageBase64 ,
459+ context : contextInput . value . trim ( ) ,
396460 } ) ,
397461 } ) ;
398462
@@ -421,6 +485,7 @@ <h3>Analysis Result</h3>
421485 function resetInterface ( ) {
422486 currentImageBase64 = null ;
423487 fileInput . value = "" ;
488+ contextInput . value = "" ;
424489 imagePreview . classList . add ( "hidden" ) ;
425490 results . classList . add ( "hidden" ) ;
426491 loading . style . display = "none" ;
0 commit comments