Update index.html
Browse files- index.html +117 -19
index.html
CHANGED
|
@@ -1,19 +1,117 @@
|
|
| 1 |
-
<!
|
| 2 |
-
<html>
|
| 3 |
-
|
| 4 |
-
|
| 5 |
-
|
| 6 |
-
|
| 7 |
-
|
| 8 |
-
|
| 9 |
-
|
| 10 |
-
|
| 11 |
-
|
| 12 |
-
|
| 13 |
-
|
| 14 |
-
|
| 15 |
-
|
| 16 |
-
|
| 17 |
-
|
| 18 |
-
|
| 19 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
<!DOCTYPE html>
|
| 2 |
+
<html lang="tr">
|
| 3 |
+
<head>
|
| 4 |
+
<meta charset="UTF-8">
|
| 5 |
+
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
| 6 |
+
<title>Benim YZ Asistanım</title>
|
| 7 |
+
<style>
|
| 8 |
+
body {
|
| 9 |
+
font-family: Arial, sans-serif;
|
| 10 |
+
background-color: #0f172a;
|
| 11 |
+
color: #f8fafc;
|
| 12 |
+
display: flex;
|
| 13 |
+
justify-content: center;
|
| 14 |
+
align-items: center;
|
| 15 |
+
height: 100vh;
|
| 16 |
+
margin: 0;
|
| 17 |
+
}
|
| 18 |
+
.card {
|
| 19 |
+
background-color: #1e293b;
|
| 20 |
+
padding: 30px;
|
| 21 |
+
border-radius: 12px;
|
| 22 |
+
box-shadow: 0 10px 25px rgba(0, 0, 0, 0.5);
|
| 23 |
+
max-width: 500px;
|
| 24 |
+
width: 100%;
|
| 25 |
+
text-align: center;
|
| 26 |
+
}
|
| 27 |
+
h1 {
|
| 28 |
+
color: #38bdf8;
|
| 29 |
+
margin-bottom: 20px;
|
| 30 |
+
}
|
| 31 |
+
textarea {
|
| 32 |
+
width: 100%;
|
| 33 |
+
height: 100px;
|
| 34 |
+
padding: 10px;
|
| 35 |
+
border-radius: 8px;
|
| 36 |
+
border: 1px solid #334155;
|
| 37 |
+
background-color: #0f172a;
|
| 38 |
+
color: #fff;
|
| 39 |
+
resize: none;
|
| 40 |
+
box-sizing: border-box;
|
| 41 |
+
font-size: 14px;
|
| 42 |
+
}
|
| 43 |
+
button {
|
| 44 |
+
margin-top: 15px;
|
| 45 |
+
width: 100%;
|
| 46 |
+
padding: 12px;
|
| 47 |
+
background-color: #0284c7;
|
| 48 |
+
color: white;
|
| 49 |
+
border: none;
|
| 50 |
+
border-radius: 8px;
|
| 51 |
+
font-size: 16px;
|
| 52 |
+
cursor: pointer;
|
| 53 |
+
transition: background 0.3s;
|
| 54 |
+
}
|
| 55 |
+
button:hover {
|
| 56 |
+
background-color: #0369a1;
|
| 57 |
+
}
|
| 58 |
+
.response {
|
| 59 |
+
margin-top: 20px;
|
| 60 |
+
padding: 15px;
|
| 61 |
+
background-color: #0f172a;
|
| 62 |
+
border-radius: 8px;
|
| 63 |
+
text-align: left;
|
| 64 |
+
min-height: 50px;
|
| 65 |
+
white-space: pre-wrap;
|
| 66 |
+
border: 1px solid #334155;
|
| 67 |
+
}
|
| 68 |
+
</style>
|
| 69 |
+
</head>
|
| 70 |
+
<body>
|
| 71 |
+
|
| 72 |
+
<div class="card">
|
| 73 |
+
<h1>🤖 Yapay Zeka Asistanı</h1>
|
| 74 |
+
<p>Sorunuzu yazın, yapay zeka sizin için yanıtlasın:</p>
|
| 75 |
+
<textarea id="userInput" placeholder="Buraya bir şeyler yazın..."></textarea>
|
| 76 |
+
<button onclick="askAI()">Yapay Zekaya Sor</button>
|
| 77 |
+
<div class="response" id="output">Yanıt burada görünecek...</div>
|
| 78 |
+
</div>
|
| 79 |
+
|
| 80 |
+
<script>
|
| 81 |
+
async function askAI() {
|
| 82 |
+
const prompt = document.getElementById('userInput').value;
|
| 83 |
+
const output = document.getElementById('output');
|
| 84 |
+
|
| 85 |
+
if (!prompt) {
|
| 86 |
+
output.innerText = "Lütfen bir soru girin!";
|
| 87 |
+
return;
|
| 88 |
+
}
|
| 89 |
+
|
| 90 |
+
output.innerText = "Düşünüyor...";
|
| 91 |
+
|
| 92 |
+
try {
|
| 93 |
+
const response = await fetch("https://router.huggingface.co/hf-inference/v1/chat/completions", {
|
| 94 |
+
method: "POST",
|
| 95 |
+
headers: {
|
| 96 |
+
"Content-Type": "application/json"
|
| 97 |
+
},
|
| 98 |
+
body: JSON.stringify({
|
| 99 |
+
model: "Qwen/Qwen2.5-Coder-32B-Instruct",
|
| 100 |
+
messages: [{ role: "user", content: prompt }]
|
| 101 |
+
})
|
| 102 |
+
});
|
| 103 |
+
|
| 104 |
+
const data = await response.json();
|
| 105 |
+
if (data.choices && data.choices.length > 0) {
|
| 106 |
+
output.innerText = data.choices[0].message.content;
|
| 107 |
+
} else {
|
| 108 |
+
output.innerText = "Bir yanıt alınamadı.";
|
| 109 |
+
}
|
| 110 |
+
} catch (error) {
|
| 111 |
+
output.innerText = "Hata oluştu: " + error.message;
|
| 112 |
+
}
|
| 113 |
+
}
|
| 114 |
+
</script>
|
| 115 |
+
|
| 116 |
+
</body>
|
| 117 |
+
</html>
|