nomandiu9 commited on
Commit
d8601d5
·
1 Parent(s): f4a4bf9

Update frontend to use HuggingFace backend URL

Browse files
Files changed (1) hide show
  1. index.html +12 -6
index.html CHANGED
@@ -1,11 +1,13 @@
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>Sentiment Analysis</title>
7
  <script src="https://cdn.tailwindcss.com"></script>
8
  </head>
 
9
  <body class="bg-gray-900 text-white min-h-screen flex items-center justify-center font-sans p-4">
10
 
11
  <div class="container mx-auto max-w-2xl w-full p-8 bg-gray-800 rounded-2xl shadow-2xl border border-gray-700">
@@ -33,9 +35,12 @@
33
  <div class="flex flex-col sm:flex-row gap-4">
34
  <button id="analyzeButton"
35
  class="w-full bg-cyan-600 hover:bg-cyan-500 text-white text-lg font-bold py-3 px-6 rounded-lg shadow-lg transition duration-300 ease-in-out transform hover:scale-105 flex items-center justify-center">
36
- <svg id="spinner" class="animate-spin -ml-1 mr-3 h-5 w-5 text-white hidden" xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24">
 
37
  <circle class="opacity-25" cx="12" cy="12" r="10" stroke="currentColor" stroke-width="4"></circle>
38
- <path class="opacity-75" fill="currentColor" d="M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4zm2 5.291A7.962 7.962 0 014 12H0c0 3.042 1.135 5.824 3 7.938l3-2.647z"></path>
 
 
39
  </svg>
40
  <span id="buttonText">Analyze Sentiment</span>
41
  </button>
@@ -69,8 +74,8 @@
69
  const buttonText = document.getElementById('buttonText');
70
 
71
  // API endpoints
72
- const predictApi = '/predict';
73
- const statusApi = '/status';
74
 
75
  // Icon SVGs
76
  const icons = {
@@ -173,13 +178,14 @@
173
  iconSvg = icons.neutral;
174
  colorClass = 'text-yellow-400';
175
  }
176
-
177
  sentimentIcon.innerHTML = iconSvg;
178
  sentimentText.className = colorClass; // Only set color class
179
-
180
  resultDiv.classList.remove('hidden');
181
  errorDiv.classList.add('hidden');
182
  }
183
  </script>
184
  </body>
 
185
  </html>
 
1
  <!DOCTYPE html>
2
  <html lang="en">
3
+
4
  <head>
5
  <meta charset="UTF-8">
6
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
7
  <title>Sentiment Analysis</title>
8
  <script src="https://cdn.tailwindcss.com"></script>
9
  </head>
10
+
11
  <body class="bg-gray-900 text-white min-h-screen flex items-center justify-center font-sans p-4">
12
 
13
  <div class="container mx-auto max-w-2xl w-full p-8 bg-gray-800 rounded-2xl shadow-2xl border border-gray-700">
 
35
  <div class="flex flex-col sm:flex-row gap-4">
36
  <button id="analyzeButton"
37
  class="w-full bg-cyan-600 hover:bg-cyan-500 text-white text-lg font-bold py-3 px-6 rounded-lg shadow-lg transition duration-300 ease-in-out transform hover:scale-105 flex items-center justify-center">
38
+ <svg id="spinner" class="animate-spin -ml-1 mr-3 h-5 w-5 text-white hidden"
39
+ xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24">
40
  <circle class="opacity-25" cx="12" cy="12" r="10" stroke="currentColor" stroke-width="4"></circle>
41
+ <path class="opacity-75" fill="currentColor"
42
+ d="M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4zm2 5.291A7.962 7.962 0 014 12H0c0 3.042 1.135 5.824 3 7.938l3-2.647z">
43
+ </path>
44
  </svg>
45
  <span id="buttonText">Analyze Sentiment</span>
46
  </button>
 
74
  const buttonText = document.getElementById('buttonText');
75
 
76
  // API endpoints
77
+ const predictApi = 'https://anis80-sentiment-analysis-api.hf.space/predict';
78
+ const statusApi = 'https://anis80-sentiment-analysis-api.hf.space/status';
79
 
80
  // Icon SVGs
81
  const icons = {
 
178
  iconSvg = icons.neutral;
179
  colorClass = 'text-yellow-400';
180
  }
181
+
182
  sentimentIcon.innerHTML = iconSvg;
183
  sentimentText.className = colorClass; // Only set color class
184
+
185
  resultDiv.classList.remove('hidden');
186
  errorDiv.classList.add('hidden');
187
  }
188
  </script>
189
  </body>
190
+
191
  </html>