BrandonMoodaley commited on
Commit
4b852e5
·
verified ·
1 Parent(s): 42af856

I want to start over - Initial Deployment

Browse files
Files changed (3) hide show
  1. README.md +6 -4
  2. index.html +153 -19
  3. prompts.txt +3 -0
README.md CHANGED
@@ -1,10 +1,12 @@
1
  ---
2
- title: Test
3
- emoji: 👀
4
  colorFrom: gray
5
- colorTo: indigo
6
  sdk: static
7
  pinned: false
 
 
8
  ---
9
 
10
- Check out the configuration reference at https://huggingface.co/docs/hub/spaces-config-reference
 
1
  ---
2
+ title: test
3
+ emoji: 🐳
4
  colorFrom: gray
5
+ colorTo: red
6
  sdk: static
7
  pinned: false
8
+ tags:
9
+ - deepsite
10
  ---
11
 
12
+ Check out the configuration reference at https://huggingface.co/docs/hub/spaces-config-reference
index.html CHANGED
@@ -1,19 +1,153 @@
1
- <!doctype html>
2
- <html>
3
- <head>
4
- <meta charset="utf-8" />
5
- <meta name="viewport" content="width=device-width" />
6
- <title>My static Space</title>
7
- <link rel="stylesheet" href="style.css" />
8
- </head>
9
- <body>
10
- <div class="card">
11
- <h1>Welcome to your static Space!</h1>
12
- <p>You can modify this app directly by editing <i>index.html</i> in the Files and versions tab.</p>
13
- <p>
14
- Also don't forget to check the
15
- <a href="https://huggingface.co/docs/hub/spaces" target="_blank">Spaces documentation</a>.
16
- </p>
17
- </div>
18
- </body>
19
- </html>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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>Excel Data App</title>
7
+ <script src="https://cdn.tailwindcss.com"></script>
8
+ <script src="https://unpkg.com/feather-icons"></script>
9
+ <script src="https://cdn.jsdelivr.net/npm/feather-icons/dist/feather.min.js"></script>
10
+ <link href="https://unpkg.com/aos@2.3.1/dist/aos.css" rel="stylesheet">
11
+ <script src="https://unpkg.com/aos@2.3.1/dist/aos.js"></script>
12
+ <script src="https://cdn.sheetjs.com/xlsx-0.19.3/package/dist/xlsx.full.min.js"></script>
13
+ </head>
14
+ <body class="bg-gray-50">
15
+ <div class="container mx-auto px-4 py-8">
16
+ <header class="mb-8">
17
+ <h1 class="text-3xl font-bold text-indigo-700">Excel Data Dashboard</h1>
18
+ <p class="text-gray-600">Upload and visualize your spreadsheet data</p>
19
+ </header>
20
+
21
+ <div class="bg-white rounded-lg shadow-md p-6 mb-8">
22
+ <div class="flex items-center justify-between mb-4">
23
+ <h2 class="text-xl font-semibold">Upload File</h2>
24
+ <label for="file-upload" class="cursor-pointer bg-indigo-600 text-white px-4 py-2 rounded-md hover:bg-indigo-700 transition flex items-center">
25
+ <i data-feather="upload" class="mr-2"></i>
26
+ Choose Excel File
27
+ </label>
28
+ <input id="file-upload" type="file" accept=".xlsx, .xls" class="hidden">
29
+ </div>
30
+ <div id="file-info" class="text-gray-500 italic">
31
+ No file selected
32
+ </div>
33
+ </div>
34
+
35
+ <div id="data-display" class="bg-white rounded-lg shadow-md p-6 hidden">
36
+ <div class="flex justify-between items-center mb-4">
37
+ <h2 class="text-xl font-semibold">Your Data</h2>
38
+ <div class="flex space-x-2">
39
+ <button class="bg-gray-200 px-3 py-1 rounded-md hover:bg-gray-300 transition">
40
+ <i data-feather="filter" class="w-4 h-4"></i>
41
+ </button>
42
+ <button class="bg-gray-200 px-3 py-1 rounded-md hover:bg-gray-300 transition">
43
+ <i data-feather="download" class="w-4 h-4"></i>
44
+ </button>
45
+ </div>
46
+ </div>
47
+ <div class="overflow-x-auto">
48
+ <table id="data-table" class="min-w-full divide-y divide-gray-200">
49
+ <thead class="bg-gray-50">
50
+ <!-- Table headers will be inserted here -->
51
+ </thead>
52
+ <tbody class="bg-white divide-y divide-gray-200">
53
+ <!-- Table data will be inserted here -->
54
+ </tbody>
55
+ </table>
56
+ </div>
57
+ </div>
58
+ </div>
59
+
60
+ <script>
61
+ AOS.init();
62
+ feather.replace();
63
+
64
+ document.getElementById('file-upload').addEventListener('change', function(e) {
65
+ const file = e.target.files[0];
66
+ if (!file) return;
67
+
68
+ document.getElementById('file-info').textContent = `Selected: ${file.name} (${(file.size/1024).toFixed(2)} KB)`;
69
+
70
+ // Process Excel file
71
+ const reader = new FileReader();
72
+ reader.onload = function(e) {
73
+ try {
74
+ const data = new Uint8Array(e.target.result);
75
+ const workbook = XLSX.read(data, { type: 'array' });
76
+
77
+ // Get first sheet
78
+ const firstSheet = workbook.Sheets[workbook.SheetNames[0]];
79
+ const jsonData = XLSX.utils.sheet_to_json(firstSheet);
80
+
81
+ // Display data
82
+ displayData(jsonData);
83
+
84
+ // Update file info
85
+ document.getElementById('file-info').textContent =
86
+ `Loaded: ${file.name} (${jsonData.length} rows)`;
87
+
88
+ } catch (error) {
89
+ document.getElementById('file-info').textContent =
90
+ `Error processing file: ${error.message}`;
91
+ console.error(error);
92
+ }
93
+ };
94
+ reader.onerror = function() {
95
+ document.getElementById('file-info').textContent =
96
+ 'Error reading file. Please try again.';
97
+ };
98
+ reader.readAsArrayBuffer(file);
99
+ });
100
+
101
+ function displayData(data) {
102
+ if (!data || data.length === 0) {
103
+ alert('No data found in the file');
104
+ return;
105
+ }
106
+
107
+ const table = document.getElementById('data-table');
108
+ const thead = table.querySelector('thead');
109
+ const tbody = table.querySelector('tbody');
110
+
111
+ // Clear existing data
112
+ thead.innerHTML = '';
113
+ tbody.innerHTML = '';
114
+
115
+ // Create headers
116
+ const headerRow = document.createElement('tr');
117
+ Object.keys(data[0]).forEach(key => {
118
+ const th = document.createElement('th');
119
+ th.textContent = key;
120
+ th.className = 'px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider';
121
+ headerRow.appendChild(th);
122
+ });
123
+ thead.appendChild(headerRow);
124
+
125
+ // Create rows (limit to 100 for performance)
126
+ const displayData = data.length > 100 ? data.slice(0, 100) : data;
127
+ displayData.forEach(row => {
128
+ const tr = document.createElement('tr');
129
+ Object.values(row).forEach(value => {
130
+ const td = document.createElement('td');
131
+ td.textContent = value !== undefined ? value : '';
132
+ td.className = 'px-6 py-4 whitespace-nowrap text-sm text-gray-500';
133
+ tr.appendChild(td);
134
+ });
135
+ tbody.appendChild(tr);
136
+ });
137
+
138
+ if (data.length > 100) {
139
+ const tr = document.createElement('tr');
140
+ const td = document.createElement('td');
141
+ td.colSpan = Object.keys(data[0]).length;
142
+ td.className = 'px-6 py-4 text-sm text-gray-500 italic text-center';
143
+ td.textContent = `Showing 100 of ${data.length} rows...`;
144
+ tr.appendChild(td);
145
+ tbody.appendChild(tr);
146
+ }
147
+
148
+ // Show table
149
+ document.getElementById('data-display').classList.remove('hidden');
150
+ }
151
+ </script>
152
+ </body>
153
+ </html>
prompts.txt ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ Can i upload an excel file here and ask you to create and app from it
2
+ file uploaded
3
+ I want to start over