diff --git a/assets/css/custom.css b/assets/css/custom.css new file mode 100644 index 0000000..ad04052 --- /dev/null +++ b/assets/css/custom.css @@ -0,0 +1,17 @@ +body { + background-color: #f8f9fa; +} + +.container { + max-width: 960px; +} + +.card { + border-radius: 0.5rem; + box-shadow: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.075); +} + +.btn-primary { + background: linear-gradient(45deg, #0d6efd, #0dcaf0); + border: none; +} diff --git a/assets/js/main.js b/assets/js/main.js new file mode 100644 index 0000000..b9c977a --- /dev/null +++ b/assets/js/main.js @@ -0,0 +1 @@ +// Add any custom JS here in the future diff --git a/index.php b/index.php index 7205f3d..d19d8fb 100644 --- a/index.php +++ b/index.php @@ -1,150 +1,152 @@ - - + - - - New Style - - - - - - - - - - - - - - - - - - - + + + AI Data Analytics + + + + + + + + + + + -
-
-

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

-
-
- + +
+
+ + + AI Data Analytics + +
+
+ +
+
+
+

Analyze Your Data

+

Upload a CSV file to get started. Our AI will analyze the data and suggest the best visualizations for your dataset.

+
+ +
+
+ + +
+
+
+ + [ + ['role' => 'system', 'content' => 'You are an expert data analyst.'], + ['role' => 'user', 'content' => $prompt], + ], + ]); + + echo '
'; + echo '

AI Analysis

'; + echo '
'; + if (!empty($resp['success'])) { + $aiReply = LocalAIApi::extractText($resp); + + if (!empty($aiReply)) { + // Simple markdown to HTML + $formattedReply = nl2br(htmlspecialchars($aiReply)); + $formattedReply = preg_replace('/\*\*([^*]+)\*\*/', '$1', $formattedReply); + $formattedReply = preg_replace('/\*([^*]+)\*/', '$1', $formattedReply); + $formattedReply = preg_replace('/`([^`]+)`/', '$1', $formattedReply); + echo '
' . $formattedReply . '
'; + } else { + echo ''; + } + } else { + $error = $resp['error'] ?? 'An unknown error occurred.'; + echo ''; + } + echo '
'; + echo '
'; + } + + // Display Data Preview + if ($header) { + echo '
'; + echo '

Data Preview

'; + echo '
'; + echo '
'; + echo ''; + echo ''; + foreach ($header as $col) { + echo ''; + } + echo ''; + foreach ($dataRows as $row) { + echo ''; + foreach ($row as $cell) { + echo ''; + } + echo ''; + } + echo '
' . htmlspecialchars($col) . '
' . htmlspecialchars($cell) . '
'; + echo '
'; + } + + } else { + echo ''; + } + } + ?> +
+ + + + + - + \ No newline at end of file