Spaces:
Running
Running
Update index.html
Browse files- index.html +48 -57
index.html
CHANGED
|
@@ -3,12 +3,12 @@
|
|
| 3 |
<head>
|
| 4 |
<meta charset="UTF-8">
|
| 5 |
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
| 6 |
-
<title>My
|
| 7 |
<style>
|
| 8 |
body {
|
| 9 |
font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
|
| 10 |
-
background-color: #
|
| 11 |
-
color:
|
| 12 |
display: flex;
|
| 13 |
flex-direction: column;
|
| 14 |
align-items: center;
|
|
@@ -16,102 +16,93 @@
|
|
| 16 |
margin: 0;
|
| 17 |
}
|
| 18 |
.container {
|
| 19 |
-
background: #
|
| 20 |
-
padding:
|
| 21 |
-
border-radius:
|
| 22 |
-
box-shadow: 0
|
| 23 |
max-width: 500px;
|
| 24 |
width: 100%;
|
| 25 |
text-align: center;
|
| 26 |
-
border: 1px solid #
|
| 27 |
}
|
| 28 |
-
h1 { color: #
|
|
|
|
| 29 |
input, button {
|
| 30 |
width: 100%;
|
| 31 |
-
padding:
|
| 32 |
-
margin:
|
| 33 |
-
border-radius:
|
| 34 |
-
border: 1px solid #
|
| 35 |
box-sizing: border-box;
|
| 36 |
font-size: 16px;
|
| 37 |
-
background: #
|
| 38 |
color: white;
|
|
|
|
| 39 |
}
|
|
|
|
| 40 |
button {
|
| 41 |
-
background-color: #
|
| 42 |
-
color:
|
| 43 |
border: none;
|
| 44 |
font-weight: bold;
|
| 45 |
cursor: pointer;
|
| 46 |
transition: 0.2s;
|
| 47 |
}
|
| 48 |
-
button:hover { background-color: #
|
| 49 |
#output {
|
| 50 |
margin-top: 20px;
|
| 51 |
-
padding:
|
| 52 |
-
background: #
|
| 53 |
-
border-radius:
|
| 54 |
-
border-left: 5px solid #
|
| 55 |
text-align: left;
|
| 56 |
-
min-height:
|
| 57 |
white-space: pre-wrap;
|
| 58 |
line-height: 1.6;
|
|
|
|
| 59 |
}
|
| 60 |
</style>
|
| 61 |
</head>
|
| 62 |
<body>
|
| 63 |
|
| 64 |
<div class="container">
|
| 65 |
-
<h1>
|
| 66 |
-
<p>
|
| 67 |
|
| 68 |
-
<input type="text" id="userInput" placeholder="Type
|
| 69 |
-
<button onclick="askAI()">
|
| 70 |
|
| 71 |
-
<div id="output">
|
| 72 |
</div>
|
| 73 |
|
| 74 |
<script>
|
| 75 |
-
// Built-in smart database that works offline instantly if public servers crash!
|
| 76 |
-
const smartOfflineAI = {
|
| 77 |
-
"tiger": "π
AI Concept: A majestic cybernetic beast cloaked in glowing neon stripes. It stalks through the rainy streets of a futuristic cyberpunk city with eyes like lasers. Mechanical gears hum softly inside its paws as it leaps across metal rooftops.",
|
| 78 |
-
"cyber": "π AI Concept: A high-tech world glowing with neon wires, hologram signs, and flying cars slicing through dark storm clouds. Technology runs everything, and robots walk side-by-side with humans.",
|
| 79 |
-
"wizard": "π§ AI Concept: A mystical sorcerer holding a staff crafted from cosmic glass and starlight. Ancient runes swirl through the air, casting brilliant blue shadows as a magical doorway opens to an unknown realm.",
|
| 80 |
-
"robot": "π€ AI Concept: A friendly metallic companion operating with glowing solar processors. It speeds through tasks on tiny tracks, flashing bright emoji expressions across its digital screen face to make everyone laugh.",
|
| 81 |
-
"cat": "π AI Concept: A zero-gravity space kitten wearing a tiny bubble helmet. It floats happily around a cosmic control room, batting at glowing constellation buttons and chasing passing shooting stars.",
|
| 82 |
-
"default": "β¨ AI Concept: A spectacular vision flashing with colorful futuristic energy! It blends advanced technology with creative imagination, forming a unique masterpiece that stands out across the digital world."
|
| 83 |
-
};
|
| 84 |
-
|
| 85 |
async function askAI() {
|
| 86 |
-
const input = document.getElementById('userInput').value.
|
| 87 |
const outputDiv = document.getElementById('output');
|
| 88 |
|
| 89 |
if (!input) return;
|
| 90 |
-
outputDiv.innerText = "
|
| 91 |
|
| 92 |
try {
|
| 93 |
-
//
|
| 94 |
-
const response = await fetch(
|
| 95 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 96 |
|
| 97 |
const aiText = await response.text();
|
| 98 |
outputDiv.innerText = aiText.trim();
|
| 99 |
} catch (error) {
|
| 100 |
-
|
| 101 |
-
outputDiv.innerText = "π Cloud busy... Activating Backup AI Brain:\n\n";
|
| 102 |
-
|
| 103 |
-
setTimeout(() => {
|
| 104 |
-
let matchedText = smartOfflineAI["default"];
|
| 105 |
-
|
| 106 |
-
// Check what words the user typed to give them a matching custom story
|
| 107 |
-
if (input.includes("tiger")) matchedText = smartOfflineAI["tiger"];
|
| 108 |
-
else if (input.includes("cyber")) matchedText = smartOfflineAI["cyber"];
|
| 109 |
-
else if (input.includes("wizard")) matchedText = smartOfflineAI["wizard"];
|
| 110 |
-
else if (input.includes("robot")) matchedText = smartOfflineAI["robot"];
|
| 111 |
-
else if (input.includes("cat")) matchedText = smartOfflineAI["cat"];
|
| 112 |
-
|
| 113 |
-
outputDiv.innerText += matchedText;
|
| 114 |
-
}, 400);
|
| 115 |
}
|
| 116 |
}
|
| 117 |
</script>
|
|
|
|
| 3 |
<head>
|
| 4 |
<meta charset="UTF-8">
|
| 5 |
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
| 6 |
+
<title>My Professional AI App</title>
|
| 7 |
<style>
|
| 8 |
body {
|
| 9 |
font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
|
| 10 |
+
background-color: #0b0f19;
|
| 11 |
+
color: #f3f4f6;
|
| 12 |
display: flex;
|
| 13 |
flex-direction: column;
|
| 14 |
align-items: center;
|
|
|
|
| 16 |
margin: 0;
|
| 17 |
}
|
| 18 |
.container {
|
| 19 |
+
background: #111827;
|
| 20 |
+
padding: 30px;
|
| 21 |
+
border-radius: 20px;
|
| 22 |
+
box-shadow: 0 10px 25px rgba(0,0,0,0.5);
|
| 23 |
max-width: 500px;
|
| 24 |
width: 100%;
|
| 25 |
text-align: center;
|
| 26 |
+
border: 1px solid #1f2937;
|
| 27 |
}
|
| 28 |
+
h1 { color: #3b82f6; margin-top: 0; text-shadow: 0 0 15px rgba(59,130,246,0.3); }
|
| 29 |
+
p { color: #9ca3af; font-size: 14px; }
|
| 30 |
input, button {
|
| 31 |
width: 100%;
|
| 32 |
+
padding: 14px;
|
| 33 |
+
margin: 12px 0;
|
| 34 |
+
border-radius: 10px;
|
| 35 |
+
border: 1px solid #374151;
|
| 36 |
box-sizing: border-box;
|
| 37 |
font-size: 16px;
|
| 38 |
+
background: #1f2937;
|
| 39 |
color: white;
|
| 40 |
+
outline: none;
|
| 41 |
}
|
| 42 |
+
input:focus { border-color: #3b82f6; }
|
| 43 |
button {
|
| 44 |
+
background-color: #3b82f6;
|
| 45 |
+
color: white;
|
| 46 |
border: none;
|
| 47 |
font-weight: bold;
|
| 48 |
cursor: pointer;
|
| 49 |
transition: 0.2s;
|
| 50 |
}
|
| 51 |
+
button:hover { background-color: #2563eb; box-shadow: 0 0 15px rgba(59,130,246,0.5); }
|
| 52 |
#output {
|
| 53 |
margin-top: 20px;
|
| 54 |
+
padding: 18px;
|
| 55 |
+
background: #1f2937;
|
| 56 |
+
border-radius: 10px;
|
| 57 |
+
border-left: 5px solid #3b82f6;
|
| 58 |
text-align: left;
|
| 59 |
+
min-height: 60px;
|
| 60 |
white-space: pre-wrap;
|
| 61 |
line-height: 1.6;
|
| 62 |
+
font-size: 15px;
|
| 63 |
}
|
| 64 |
</style>
|
| 65 |
</head>
|
| 66 |
<body>
|
| 67 |
|
| 68 |
<div class="container">
|
| 69 |
+
<h1>π€ Advanced AI Generator v2</h1>
|
| 70 |
+
<p>Upgraded to a high-speed, infinite-capacity cloud server!</p>
|
| 71 |
|
| 72 |
+
<input type="text" id="userInput" placeholder="Type absolutely anything (e.g., weird chicken)...">
|
| 73 |
+
<button onclick="askAI()">Ask Advanced AI</button>
|
| 74 |
|
| 75 |
+
<div id="output">Type an idea and tap the button to wake up the AI...</div>
|
| 76 |
</div>
|
| 77 |
|
| 78 |
<script>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 79 |
async function askAI() {
|
| 80 |
+
const input = document.getElementById('userInput').value.trim();
|
| 81 |
const outputDiv = document.getElementById('output');
|
| 82 |
|
| 83 |
if (!input) return;
|
| 84 |
+
outputDiv.innerText = "β‘ Cloud Brain is processing your request...";
|
| 85 |
|
| 86 |
try {
|
| 87 |
+
// This hits a fast, modern API router designed to accept direct web traffic without keys
|
| 88 |
+
const response = await fetch("https://pollinations.ai", {
|
| 89 |
+
method: "POST",
|
| 90 |
+
headers: { "Content-Type": "application/json" },
|
| 91 |
+
body: JSON.stringify({
|
| 92 |
+
messages: [
|
| 93 |
+
{ role: "system", content: "You are an imaginative sci-fi story generator. Provide a creative, detailed 3-sentence description of the user's idea." },
|
| 94 |
+
{ role: "user", content: input }
|
| 95 |
+
],
|
| 96 |
+
model: "searchgpt" // Switches to an ultra-stable corporate network pipeline
|
| 97 |
+
})
|
| 98 |
+
});
|
| 99 |
+
|
| 100 |
+
if (!response.ok) throw new Error("Server hiccup");
|
| 101 |
|
| 102 |
const aiText = await response.text();
|
| 103 |
outputDiv.innerText = aiText.trim();
|
| 104 |
} catch (error) {
|
| 105 |
+
outputDiv.innerText = "π€ Just a small cloud traffic delay! Please tap the button one more time.";
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 106 |
}
|
| 107 |
}
|
| 108 |
</script>
|