Update index.html
Browse files- index.html +43 -1
index.html
CHANGED
|
@@ -205,6 +205,26 @@
|
|
| 205 |
transform: translateX(24px);
|
| 206 |
}
|
| 207 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 208 |
.button {
|
| 209 |
background-color: #007aff;
|
| 210 |
border: none;
|
|
@@ -237,7 +257,10 @@
|
|
| 237 |
<div class="container">
|
| 238 |
<div class="toggle-switch">
|
| 239 |
<input type="checkbox" id="theme-switch">
|
| 240 |
-
<label for="theme-switch"
|
|
|
|
|
|
|
|
|
|
| 241 |
</div>
|
| 242 |
<div class="main">
|
| 243 |
<h2>Introduction</h2>
|
|
@@ -245,11 +268,13 @@
|
|
| 245 |
<h2>Installation</h2>
|
| 246 |
<p>First, make sure you have Node.js installed. Then, install the necessary dependencies:</p>
|
| 247 |
<div class="code-block">
|
|
|
|
| 248 |
<pre><code>npm install axios</code></pre>
|
| 249 |
</div>
|
| 250 |
<h2>Usage</h2>
|
| 251 |
<p>Create a file named <code>lumin.js</code> with the following content:</p>
|
| 252 |
<div class="code-block">
|
|
|
|
| 253 |
<pre><code>const axios = require('axios');
|
| 254 |
async function lumin(q, username = null, logic = null, webSearchMode = false) {
|
| 255 |
try {
|
|
@@ -271,6 +296,7 @@ module.exports = { lumin };</code></pre>
|
|
| 271 |
<h3>Basic Usage</h3>
|
| 272 |
<p>Send a query to the LuminAI API using GET:</p>
|
| 273 |
<div class="code-block">
|
|
|
|
| 274 |
<pre><code>const axios = require('axios');
|
| 275 |
function getLuminaiResponse(q) {
|
| 276 |
const url = `https://ilhamdev-luminai.hf.space/api/ai?q=${encodeURIComponent(q)}`;
|
|
@@ -293,6 +319,7 @@ getLuminaiResponse('example query')
|
|
| 293 |
</div>
|
| 294 |
<p>Send a query to the LuminAI API:</p>
|
| 295 |
<div class="code-block">
|
|
|
|
| 296 |
<pre><code>const { lumin } = require('./lumin');
|
| 297 |
lumin("query")
|
| 298 |
.then(result => console.log(result))
|
|
@@ -301,6 +328,7 @@ lumin("query")
|
|
| 301 |
<h3>Usage with Query and Username</h3>
|
| 302 |
<p>Send a query along with a username:</p>
|
| 303 |
<div class="code-block">
|
|
|
|
| 304 |
<pre><code>const { lumin } = require('./lumin');
|
| 305 |
lumin("query", "username")
|
| 306 |
.then(result => console.log(result))
|
|
@@ -309,6 +337,7 @@ lumin("query", "username")
|
|
| 309 |
<h3>Usage with Query, Username, and Logic</h3>
|
| 310 |
<p>Send a query with a username and additional logic:</p>
|
| 311 |
<div class="code-block">
|
|
|
|
| 312 |
<pre><code>const { lumin } = require('./lumin');
|
| 313 |
lumin("query", "username", "logic")
|
| 314 |
.then(result => console.log(result))
|
|
@@ -317,6 +346,7 @@ lumin("query", "username", "logic")
|
|
| 317 |
<h3>Usage with Query, Username, Logic, and Web Search Mode</h3>
|
| 318 |
<p>Send a query with a username, additional logic, and enable web search mode:</p>
|
| 319 |
<div class="code-block">
|
|
|
|
| 320 |
<pre><code>const { lumin } = require('./lumin');
|
| 321 |
lumin("query", "username", "logic", true)
|
| 322 |
.then(result => console.log(result))
|
|
@@ -355,6 +385,18 @@ lumin("query", "username", "logic", true)
|
|
| 355 |
document.getElementById('total-requests').textContent = data.totalRequests;
|
| 356 |
}
|
| 357 |
fetchStats();
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 358 |
</script>
|
| 359 |
</body>
|
| 360 |
</html>
|
|
|
|
| 205 |
transform: translateX(24px);
|
| 206 |
}
|
| 207 |
|
| 208 |
+
.toggle-switch .sun, .toggle-switch .moon {
|
| 209 |
+
position: absolute;
|
| 210 |
+
width: 22px;
|
| 211 |
+
height: 22px;
|
| 212 |
+
top: 2px;
|
| 213 |
+
transition: 0.3s;
|
| 214 |
+
}
|
| 215 |
+
|
| 216 |
+
.toggle-switch .sun {
|
| 217 |
+
left: 2px;
|
| 218 |
+
background: url('https://upload.wikimedia.org/wikipedia/commons/e/e1/Full_Sun_Clipart.svg') no-repeat center;
|
| 219 |
+
background-size: cover;
|
| 220 |
+
}
|
| 221 |
+
|
| 222 |
+
.toggle-switch .moon {
|
| 223 |
+
right: 2px;
|
| 224 |
+
background: url('https://upload.wikimedia.org/wikipedia/commons/3/3a/Moon_clipart.svg') no-repeat center;
|
| 225 |
+
background-size: cover;
|
| 226 |
+
}
|
| 227 |
+
|
| 228 |
.button {
|
| 229 |
background-color: #007aff;
|
| 230 |
border: none;
|
|
|
|
| 257 |
<div class="container">
|
| 258 |
<div class="toggle-switch">
|
| 259 |
<input type="checkbox" id="theme-switch">
|
| 260 |
+
<label for="theme-switch">
|
| 261 |
+
<div class="sun"></div>
|
| 262 |
+
<div class="moon"></div>
|
| 263 |
+
</label>
|
| 264 |
</div>
|
| 265 |
<div class="main">
|
| 266 |
<h2>Introduction</h2>
|
|
|
|
| 268 |
<h2>Installation</h2>
|
| 269 |
<p>First, make sure you have Node.js installed. Then, install the necessary dependencies:</p>
|
| 270 |
<div class="code-block">
|
| 271 |
+
<button class="copy-btn" onclick="copyToClipboard(this)"><img src="https://cdn.iconscout.com/icon/free/png-256/copy-1781607-1518582.png" alt="Copy"></button>
|
| 272 |
<pre><code>npm install axios</code></pre>
|
| 273 |
</div>
|
| 274 |
<h2>Usage</h2>
|
| 275 |
<p>Create a file named <code>lumin.js</code> with the following content:</p>
|
| 276 |
<div class="code-block">
|
| 277 |
+
<button class="copy-btn" onclick="copyToClipboard(this)"><img src="https://cdn.iconscout.com/icon/free/png-256/copy-1781607-1518582.png" alt="Copy"></button>
|
| 278 |
<pre><code>const axios = require('axios');
|
| 279 |
async function lumin(q, username = null, logic = null, webSearchMode = false) {
|
| 280 |
try {
|
|
|
|
| 296 |
<h3>Basic Usage</h3>
|
| 297 |
<p>Send a query to the LuminAI API using GET:</p>
|
| 298 |
<div class="code-block">
|
| 299 |
+
<button class="copy-btn" onclick="copyToClipboard(this)"><img src="https://cdn.iconscout.com/icon/free/png-256/copy-1781607-1518582.png" alt="Copy"></button>
|
| 300 |
<pre><code>const axios = require('axios');
|
| 301 |
function getLuminaiResponse(q) {
|
| 302 |
const url = `https://ilhamdev-luminai.hf.space/api/ai?q=${encodeURIComponent(q)}`;
|
|
|
|
| 319 |
</div>
|
| 320 |
<p>Send a query to the LuminAI API:</p>
|
| 321 |
<div class="code-block">
|
| 322 |
+
<button class="copy-btn" onclick="copyToClipboard(this)"><img src="https://cdn.iconscout.com/icon/free/png-256/copy-1781607-1518582.png" alt="Copy"></button>
|
| 323 |
<pre><code>const { lumin } = require('./lumin');
|
| 324 |
lumin("query")
|
| 325 |
.then(result => console.log(result))
|
|
|
|
| 328 |
<h3>Usage with Query and Username</h3>
|
| 329 |
<p>Send a query along with a username:</p>
|
| 330 |
<div class="code-block">
|
| 331 |
+
<button class="copy-btn" onclick="copyToClipboard(this)"><img src="https://cdn.iconscout.com/icon/free/png-256/copy-1781607-1518582.png" alt="Copy"></button>
|
| 332 |
<pre><code>const { lumin } = require('./lumin');
|
| 333 |
lumin("query", "username")
|
| 334 |
.then(result => console.log(result))
|
|
|
|
| 337 |
<h3>Usage with Query, Username, and Logic</h3>
|
| 338 |
<p>Send a query with a username and additional logic:</p>
|
| 339 |
<div class="code-block">
|
| 340 |
+
<button class="copy-btn" onclick="copyToClipboard(this)"><img src="https://cdn.iconscout.com/icon/free/png-256/copy-1781607-1518582.png" alt="Copy"></button>
|
| 341 |
<pre><code>const { lumin } = require('./lumin');
|
| 342 |
lumin("query", "username", "logic")
|
| 343 |
.then(result => console.log(result))
|
|
|
|
| 346 |
<h3>Usage with Query, Username, Logic, and Web Search Mode</h3>
|
| 347 |
<p>Send a query with a username, additional logic, and enable web search mode:</p>
|
| 348 |
<div class="code-block">
|
| 349 |
+
<button class="copy-btn" onclick="copyToClipboard(this)"><img src="https://cdn.iconscout.com/icon/free/png-256/copy-1781607-1518582.png" alt="Copy"></button>
|
| 350 |
<pre><code>const { lumin } = require('./lumin');
|
| 351 |
lumin("query", "username", "logic", true)
|
| 352 |
.then(result => console.log(result))
|
|
|
|
| 385 |
document.getElementById('total-requests').textContent = data.totalRequests;
|
| 386 |
}
|
| 387 |
fetchStats();
|
| 388 |
+
|
| 389 |
+
function copyToClipboard(button) {
|
| 390 |
+
const codeBlock = button.nextElementSibling.innerText;
|
| 391 |
+
navigator.clipboard.writeText(codeBlock).then(() => {
|
| 392 |
+
button.querySelector('img').src = 'https://cdn.iconscout.com/icon/free/png-256/check-1781599-1518574.png';
|
| 393 |
+
setTimeout(() => {
|
| 394 |
+
button.querySelector('img').src = 'https://cdn.iconscout.com/icon/free/png-256/copy-1781607-1518582.png';
|
| 395 |
+
}, 2000);
|
| 396 |
+
}).catch(err => {
|
| 397 |
+
console.error('Failed to copy: ', err);
|
| 398 |
+
});
|
| 399 |
+
}
|
| 400 |
</script>
|
| 401 |
</body>
|
| 402 |
</html>
|