Update index.html
Browse files- index.html +177 -84
index.html
CHANGED
@@ -10,51 +10,58 @@
|
|
10 |
<style>
|
11 |
body {
|
12 |
font-family: 'Roboto', sans-serif;
|
13 |
-
background-color: #f4faff;
|
14 |
-
color: #333;
|
15 |
margin: 0;
|
16 |
padding: 0;
|
17 |
line-height: 1.6;
|
|
|
18 |
}
|
|
|
19 |
.container {
|
20 |
max-width: 1000px;
|
21 |
margin: 40px auto;
|
22 |
padding: 0 20px;
|
23 |
}
|
|
|
24 |
header {
|
25 |
-
background: #
|
26 |
color: #fff;
|
27 |
padding: 30px 0;
|
28 |
text-align: center;
|
29 |
-
border-bottom: 3px solid #
|
30 |
-
box-shadow: 0 4px 8px rgba(0,0,0,0.1);
|
31 |
}
|
|
|
32 |
header h1 {
|
33 |
margin: 0;
|
34 |
font-size: 2.5em;
|
35 |
font-weight: 400;
|
36 |
}
|
|
|
37 |
.main {
|
38 |
margin-top: 20px;
|
39 |
}
|
|
|
40 |
h2, h3 {
|
41 |
-
color: #
|
42 |
font-weight: 400;
|
43 |
}
|
|
|
44 |
.code-block {
|
45 |
background: #e0f7ff;
|
46 |
padding: 15px;
|
47 |
-
border-left: 5px solid #
|
48 |
margin: 20px 0;
|
49 |
position: relative;
|
50 |
border-radius: 5px;
|
51 |
-
box-shadow: 0 2px 4px rgba(0,0,0,0.1);
|
52 |
}
|
|
|
53 |
.code-block pre {
|
54 |
margin: 0;
|
55 |
overflow-x: auto;
|
56 |
font-size: 0.9em;
|
57 |
}
|
|
|
58 |
.copy-btn {
|
59 |
position: absolute;
|
60 |
top: 10px;
|
@@ -64,45 +71,53 @@
|
|
64 |
cursor: pointer;
|
65 |
outline: none;
|
66 |
}
|
|
|
67 |
.copy-btn img {
|
68 |
width: 24px;
|
69 |
height: 24px;
|
70 |
}
|
|
|
71 |
.stats-container {
|
72 |
display: grid;
|
73 |
grid-template-columns: 1fr 1fr;
|
74 |
gap: 20px;
|
75 |
margin-top: 40px;
|
76 |
}
|
|
|
77 |
.stat-box {
|
78 |
background: #fff;
|
79 |
padding: 20px;
|
80 |
border-radius: 10px;
|
81 |
text-align: center;
|
82 |
-
box-shadow: 0 4px 8px rgba(0,0,0,0.1);
|
83 |
transition: transform 0.3s, box-shadow 0.3s;
|
84 |
}
|
|
|
85 |
.stat-box:hover {
|
86 |
transform: translateY(-10px);
|
87 |
-
box-shadow: 0 12px 24px rgba(0,0,0,0.1);
|
88 |
}
|
|
|
89 |
.stat-box h3 {
|
90 |
margin: 0;
|
91 |
font-size: 1.2em;
|
92 |
-
color: #
|
93 |
font-weight: 400;
|
94 |
}
|
|
|
95 |
.stat-box p {
|
96 |
margin: 10px 0 0;
|
97 |
font-size: 2.5em;
|
98 |
font-weight: bold;
|
99 |
color: #333;
|
100 |
}
|
|
|
101 |
.stat-box.full-width {
|
102 |
grid-column: span 2;
|
103 |
}
|
|
|
104 |
footer {
|
105 |
-
background: #
|
106 |
color: #fff;
|
107 |
text-align: center;
|
108 |
padding: 20px 0;
|
@@ -110,31 +125,106 @@
|
|
110 |
bottom: 0;
|
111 |
width: 100%;
|
112 |
margin-top: 40px;
|
113 |
-
box-shadow: 0 -4px 8px rgba(0,0,0,0.1);
|
114 |
}
|
|
|
115 |
footer p {
|
116 |
margin: 0;
|
117 |
font-size: 0.9em;
|
118 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
119 |
</style>
|
120 |
</head>
|
121 |
<body>
|
122 |
-
<header>
|
123 |
-
|
124 |
-
</header>
|
125 |
-
<div class="container">
|
126 |
-
|
127 |
-
|
128 |
-
|
129 |
-
<h2>Installation</h2>
|
130 |
-
<p>First, make sure you have Node.js installed. Then, install the necessary dependencies:</p>
|
131 |
-
<div class="code-block">
|
132 |
-
<pre><code>npm install axios</code></pre>
|
133 |
</div>
|
134 |
-
<
|
135 |
-
|
136 |
-
|
137 |
-
<
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
138 |
async function lumin(q, username = null, logic = null, webSearchMode = false) {
|
139 |
try {
|
140 |
const payload = { content: q };
|
@@ -149,85 +239,88 @@ async function lumin(q, username = null, logic = null, webSearchMode = false) {
|
|
149 |
}
|
150 |
}
|
151 |
module.exports = { lumin };</code></pre>
|
152 |
-
|
153 |
-
|
154 |
-
|
155 |
-
|
156 |
-
|
157 |
-
|
158 |
-
|
159 |
-
|
160 |
function getLuminaiResponse(q) {
|
161 |
-
|
162 |
-
|
163 |
-
|
164 |
-
|
165 |
-
|
166 |
-
|
167 |
-
|
168 |
-
});
|
169 |
}
|
170 |
|
171 |
// Example usage:
|
172 |
getLuminaiResponse('example query')
|
173 |
-
|
174 |
-
|
175 |
-
|
176 |
-
|
177 |
-
|
178 |
-
|
179 |
-
</div>
|
180 |
-
|
181 |
-
|
182 |
-
|
183 |
lumin("query")
|
184 |
.then(result => console.log(result))
|
185 |
.catch(error => console.error(error));</code></pre>
|
186 |
-
|
187 |
-
|
188 |
-
|
189 |
-
|
190 |
-
|
191 |
lumin("query", "username")
|
192 |
.then(result => console.log(result))
|
193 |
.catch(error => console.error(error));</code></pre>
|
194 |
-
|
195 |
-
|
196 |
-
|
197 |
-
|
198 |
-
|
199 |
lumin("query", "username", "logic")
|
200 |
.then(result => console.log(result))
|
201 |
.catch(error => console.error(error));</code></pre>
|
202 |
-
|
203 |
-
|
204 |
-
|
205 |
-
|
206 |
-
|
207 |
lumin("query", "username", "logic", true)
|
208 |
.then(result => console.log(result))
|
209 |
.catch(error => console.error(error));</code></pre>
|
210 |
-
</div>
|
211 |
-
<h2>Closing</h2>
|
212 |
-
<p>Thank you to everyone who has used LuminAI. We hope this API will continue to provide positive impacts to its users.</p>
|
213 |
-
<h2>Special Thanks</h2>
|
214 |
-
<p>This API leverages the Blackbox.ai platform. We extend our deepest gratitude to the Blackbox.ai team for their incredible work.</p>
|
215 |
-
<div class="stats-container">
|
216 |
-
<div class="stat-box">
|
217 |
-
<h3>Rps</h3>
|
218 |
-
<p id="rps">0</p>
|
219 |
</div>
|
220 |
-
<
|
221 |
-
|
222 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
223 |
</div>
|
224 |
</div>
|
225 |
</div>
|
226 |
-
|
227 |
-
<footer>
|
228 |
<p>LuminAI API Client © 2024</p>
|
229 |
</footer>
|
230 |
<script>
|
|
|
|
|
|
|
|
|
|
|
231 |
async function fetchStats() {
|
232 |
const response = await fetch('/api/stats');
|
233 |
const data = await response.json();
|
@@ -237,4 +330,4 @@ lumin("query", "username", "logic", true)
|
|
237 |
fetchStats();
|
238 |
</script>
|
239 |
</body>
|
240 |
-
</html>
|
|
|
10 |
<style>
|
11 |
body {
|
12 |
font-family: 'Roboto', sans-serif;
|
|
|
|
|
13 |
margin: 0;
|
14 |
padding: 0;
|
15 |
line-height: 1.6;
|
16 |
+
transition: background-color 0.3s, color 0.3s;
|
17 |
}
|
18 |
+
|
19 |
.container {
|
20 |
max-width: 1000px;
|
21 |
margin: 40px auto;
|
22 |
padding: 0 20px;
|
23 |
}
|
24 |
+
|
25 |
header {
|
26 |
+
background: #5A9BD3;
|
27 |
color: #fff;
|
28 |
padding: 30px 0;
|
29 |
text-align: center;
|
30 |
+
border-bottom: 3px solid #41729F;
|
31 |
+
box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
|
32 |
}
|
33 |
+
|
34 |
header h1 {
|
35 |
margin: 0;
|
36 |
font-size: 2.5em;
|
37 |
font-weight: 400;
|
38 |
}
|
39 |
+
|
40 |
.main {
|
41 |
margin-top: 20px;
|
42 |
}
|
43 |
+
|
44 |
h2, h3 {
|
45 |
+
color: #5A9BD3;
|
46 |
font-weight: 400;
|
47 |
}
|
48 |
+
|
49 |
.code-block {
|
50 |
background: #e0f7ff;
|
51 |
padding: 15px;
|
52 |
+
border-left: 5px solid #5A9BD3;
|
53 |
margin: 20px 0;
|
54 |
position: relative;
|
55 |
border-radius: 5px;
|
56 |
+
box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
|
57 |
}
|
58 |
+
|
59 |
.code-block pre {
|
60 |
margin: 0;
|
61 |
overflow-x: auto;
|
62 |
font-size: 0.9em;
|
63 |
}
|
64 |
+
|
65 |
.copy-btn {
|
66 |
position: absolute;
|
67 |
top: 10px;
|
|
|
71 |
cursor: pointer;
|
72 |
outline: none;
|
73 |
}
|
74 |
+
|
75 |
.copy-btn img {
|
76 |
width: 24px;
|
77 |
height: 24px;
|
78 |
}
|
79 |
+
|
80 |
.stats-container {
|
81 |
display: grid;
|
82 |
grid-template-columns: 1fr 1fr;
|
83 |
gap: 20px;
|
84 |
margin-top: 40px;
|
85 |
}
|
86 |
+
|
87 |
.stat-box {
|
88 |
background: #fff;
|
89 |
padding: 20px;
|
90 |
border-radius: 10px;
|
91 |
text-align: center;
|
92 |
+
box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
|
93 |
transition: transform 0.3s, box-shadow 0.3s;
|
94 |
}
|
95 |
+
|
96 |
.stat-box:hover {
|
97 |
transform: translateY(-10px);
|
98 |
+
box-shadow: 0 12px 24px rgba(0, 0, 0, 0.1);
|
99 |
}
|
100 |
+
|
101 |
.stat-box h3 {
|
102 |
margin: 0;
|
103 |
font-size: 1.2em;
|
104 |
+
color: #5A9BD3;
|
105 |
font-weight: 400;
|
106 |
}
|
107 |
+
|
108 |
.stat-box p {
|
109 |
margin: 10px 0 0;
|
110 |
font-size: 2.5em;
|
111 |
font-weight: bold;
|
112 |
color: #333;
|
113 |
}
|
114 |
+
|
115 |
.stat-box.full-width {
|
116 |
grid-column: span 2;
|
117 |
}
|
118 |
+
|
119 |
footer {
|
120 |
+
background: #5A9BD3;
|
121 |
color: #fff;
|
122 |
text-align: center;
|
123 |
padding: 20px 0;
|
|
|
125 |
bottom: 0;
|
126 |
width: 100%;
|
127 |
margin-top: 40px;
|
128 |
+
box-shadow: 0 -4px 8px rgba(0, 0, 0, 0.1);
|
129 |
}
|
130 |
+
|
131 |
footer p {
|
132 |
margin: 0;
|
133 |
font-size: 0.9em;
|
134 |
}
|
135 |
+
|
136 |
+
.dark-mode {
|
137 |
+
background-color: #121212;
|
138 |
+
color: #e0e0e0;
|
139 |
+
}
|
140 |
+
|
141 |
+
.dark-mode header {
|
142 |
+
background: #333;
|
143 |
+
border-bottom-color: #444;
|
144 |
+
}
|
145 |
+
|
146 |
+
.dark-mode .code-block {
|
147 |
+
background: #1e1e1e;
|
148 |
+
border-left-color: #5A9BD3;
|
149 |
+
color: #ccc;
|
150 |
+
}
|
151 |
+
|
152 |
+
.dark-mode .stat-box {
|
153 |
+
background: #1e1e1e;
|
154 |
+
color: #ccc;
|
155 |
+
}
|
156 |
+
|
157 |
+
.dark-mode footer {
|
158 |
+
background: #333;
|
159 |
+
}
|
160 |
+
|
161 |
+
.dark-mode h2, .dark-mode h3 {
|
162 |
+
color: #5A9BD3;
|
163 |
+
}
|
164 |
+
|
165 |
+
.toggle-switch {
|
166 |
+
display: flex;
|
167 |
+
justify-content: center;
|
168 |
+
align-items: center;
|
169 |
+
margin: 20px 0;
|
170 |
+
}
|
171 |
+
|
172 |
+
.toggle-switch input {
|
173 |
+
display: none;
|
174 |
+
}
|
175 |
+
|
176 |
+
.toggle-switch label {
|
177 |
+
background-color: #ccc;
|
178 |
+
border-radius: 34px;
|
179 |
+
cursor: pointer;
|
180 |
+
display: inline-block;
|
181 |
+
height: 26px;
|
182 |
+
position: relative;
|
183 |
+
width: 50px;
|
184 |
+
}
|
185 |
+
|
186 |
+
.toggle-switch label:before {
|
187 |
+
background-color: #fff;
|
188 |
+
border-radius: 50%;
|
189 |
+
content: '';
|
190 |
+
height: 22px;
|
191 |
+
left: 2px;
|
192 |
+
position: absolute;
|
193 |
+
top: 2px;
|
194 |
+
transition: 0.3s;
|
195 |
+
width: 22px;
|
196 |
+
}
|
197 |
+
|
198 |
+
.toggle-switch input:checked + label {
|
199 |
+
background-color: #5A9BD3;
|
200 |
+
}
|
201 |
+
|
202 |
+
.toggle-switch input:checked + label:before {
|
203 |
+
transform: translateX(24px);
|
204 |
+
}
|
205 |
</style>
|
206 |
</head>
|
207 |
<body>
|
208 |
+
<header>
|
209 |
+
<h1>LuminAI API Client</h1>
|
210 |
+
</header>
|
211 |
+
<div class="container">
|
212 |
+
<div class="toggle-switch">
|
213 |
+
<input type="checkbox" id="theme-switch">
|
214 |
+
<label for="theme-switch"></label>
|
|
|
|
|
|
|
|
|
215 |
</div>
|
216 |
+
<div class="main">
|
217 |
+
<h2>Introduction</h2>
|
218 |
+
<p>This document provides a simple JavaScript client for interacting with the LuminAI API. The client allows you to send requests with various parameters and receive results from the API.</p>
|
219 |
+
<h2>Installation</h2>
|
220 |
+
<p>First, make sure you have Node.js installed. Then, install the necessary dependencies:</p>
|
221 |
+
<div class="code-block">
|
222 |
+
<pre><code>npm install axios</code></pre>
|
223 |
+
</div>
|
224 |
+
<h2>Usage</h2>
|
225 |
+
<p>Create a file named <code>lumin.js</code> with the following content:</p>
|
226 |
+
<div class="code-block">
|
227 |
+
<pre><code>const axios = require('axios');
|
228 |
async function lumin(q, username = null, logic = null, webSearchMode = false) {
|
229 |
try {
|
230 |
const payload = { content: q };
|
|
|
239 |
}
|
240 |
}
|
241 |
module.exports = { lumin };</code></pre>
|
242 |
+
</div>
|
243 |
+
<h2>Example Usage</h2>
|
244 |
+
<p>Below are some examples of how to use the <code>lumin</code> function.</p>
|
245 |
+
<h3>Basic Usage</h3>
|
246 |
+
<p>Send a query to the LuminAI API using GET:</p>
|
247 |
+
<div class="code-block">
|
248 |
+
<pre><code>const axios = require('axios');
|
|
|
249 |
function getLuminaiResponse(q) {
|
250 |
+
const url = `https://ilhamdev-luminai.hf.space/api/ai?q=${encodeURIComponent(q)}`;
|
251 |
+
return axios.get(url)
|
252 |
+
.then(response => response.data)
|
253 |
+
.catch(error => {
|
254 |
+
console.error(`Error fetching data from ${url}:`, error);
|
255 |
+
throw error;
|
256 |
+
});
|
|
|
257 |
}
|
258 |
|
259 |
// Example usage:
|
260 |
getLuminaiResponse('example query')
|
261 |
+
.then(data => {
|
262 |
+
console.log('Data:', data);
|
263 |
+
})
|
264 |
+
.catch(error => {
|
265 |
+
console.error('Error:', error);
|
266 |
+
});</code></pre>
|
267 |
+
</div>
|
268 |
+
<p>Send a query to the LuminAI API:</p>
|
269 |
+
<div class="code-block">
|
270 |
+
<pre><code>const { lumin } = require('./lumin');
|
271 |
lumin("query")
|
272 |
.then(result => console.log(result))
|
273 |
.catch(error => console.error(error));</code></pre>
|
274 |
+
</div>
|
275 |
+
<h3>Usage with Query and Username</h3>
|
276 |
+
<p>Send a query along with a username:</p>
|
277 |
+
<div class="code-block">
|
278 |
+
<pre><code>const { lumin } = require('./lumin');
|
279 |
lumin("query", "username")
|
280 |
.then(result => console.log(result))
|
281 |
.catch(error => console.error(error));</code></pre>
|
282 |
+
</div>
|
283 |
+
<h3>Usage with Query, Username, and Logic</h3>
|
284 |
+
<p>Send a query with a username and additional logic:</p>
|
285 |
+
<div class="code-block">
|
286 |
+
<pre><code>const { lumin } = require('./lumin');
|
287 |
lumin("query", "username", "logic")
|
288 |
.then(result => console.log(result))
|
289 |
.catch(error => console.error(error));</code></pre>
|
290 |
+
</div>
|
291 |
+
<h3>Usage with Query, Username, Logic, and Web Search Mode</h3>
|
292 |
+
<p>Send a query with a username, additional logic, and enable web search mode:</p>
|
293 |
+
<div class="code-block">
|
294 |
+
<pre><code>const { lumin } = require('./lumin');
|
295 |
lumin("query", "username", "logic", true)
|
296 |
.then(result => console.log(result))
|
297 |
.catch(error => console.error(error));</code></pre>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
298 |
</div>
|
299 |
+
<h2>Closing</h2>
|
300 |
+
<p>Thank you to everyone who has used LuminAI. We hope this API will continue to provide positive impacts to its users.</p>
|
301 |
+
<h2>Special Thanks</h2>
|
302 |
+
<p>This API leverages the Blackbox.ai platform. We extend our deepest gratitude to the Blackbox.ai team for their incredible work.</p>
|
303 |
+
<div class="stats-container">
|
304 |
+
<div class="stat-box">
|
305 |
+
<h3>Rps</h3>
|
306 |
+
<p id="rps">0</p>
|
307 |
+
</div>
|
308 |
+
<div class="stat-box">
|
309 |
+
<h3>Total Requests</h3>
|
310 |
+
<p id="total-requests">0</p>
|
311 |
+
</div>
|
312 |
</div>
|
313 |
</div>
|
314 |
</div>
|
315 |
+
<footer>
|
|
|
316 |
<p>LuminAI API Client © 2024</p>
|
317 |
</footer>
|
318 |
<script>
|
319 |
+
const themeSwitch = document.getElementById('theme-switch');
|
320 |
+
themeSwitch.addEventListener('change', () => {
|
321 |
+
document.body.classList.toggle('dark-mode', themeSwitch.checked);
|
322 |
+
});
|
323 |
+
|
324 |
async function fetchStats() {
|
325 |
const response = await fetch('/api/stats');
|
326 |
const data = await response.json();
|
|
|
330 |
fetchStats();
|
331 |
</script>
|
332 |
</body>
|
333 |
+
</html>
|