diff --git a/assets/css/custom.css b/assets/css/custom.css new file mode 100644 index 0000000..3ca1f5f --- /dev/null +++ b/assets/css/custom.css @@ -0,0 +1,3 @@ +.hero-section { + background: linear-gradient(to bottom, #F8F9FA, #E9ECEF); +} diff --git a/assets/js/main.js b/assets/js/main.js new file mode 100644 index 0000000..e69de29 diff --git a/index.php b/index.php index 7205f3d..873af29 100644 --- a/index.php +++ b/index.php @@ -1,150 +1,110 @@ - - + - - - New Style - - - - - - - - - - - - - - - - - - - + + + AI CSV Analyzer + + + + + + + + + + + -
-
-

Analyzing your requirements and generating your website…

-
- Loading… -
-

AI is collecting your requirements and applying the first changes.

-

This page will update automatically as the plan is implemented.

-

Runtime: PHP — UTC

-
-
- + + + +
+
+

Analyze Your CSV Data with AI

+

Upload your CSV file, and our AI will provide a description of the dataset and suggest relevant charts.

+ +
+
+ + +
+
+ + [ + ['role' => 'system', 'content' => 'You are a data analysis expert.'], + ['role' => 'user', 'content' => $prompt], + ], + ]); + + if (!empty($resp['success'])) { + $ai_text = LocalAIApi::extractText($resp); + // Use nl2br to preserve line breaks from the AI response + $analysis_result = "

Analysis for ".htmlspecialchars($file_name)."

" . nl2br(htmlspecialchars($ai_text)) . "

"; + } else { + $error_message = $resp['error'] ?? 'An unknown error occurred with the AI API.'; + $analysis_result = "
Error during AI analysis: " . htmlspecialchars($error_message) . "
"; + } + } else { + $analysis_result = "
Could not read data from the CSV file.
"; + } + } else { + $analysis_result = "
Error uploading file.
"; + } + echo $analysis_result; + } + ?> + +
+
+ + + + +