-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.html
More file actions
131 lines (131 loc) · 8.06 KB
/
index.html
File metadata and controls
131 lines (131 loc) · 8.06 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
<!DOCTYPE html>
<html lang="de">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Alex Gaming – Support AI</title>
<link rel="icon" type="image/png" href="https://i.postimg.cc/nLhPrLMH/1000072572-3643adb7b6957288cd73d569e60f8263-18-11-2023-12-35-17-20240415-181847-0000-Original.png">
<link rel="stylesheet" href="https://fonts.googleapis.com/css2?family=Inter:wght@400;600;800&display=swap">
<script src="https://challenges.cloudflare.com/turnstile/v0/api.js?render=explicit"></script>
<style>
* { margin: 0; padding: 0; box-sizing: border-box; }
body { font-family: 'Inter', sans-serif; background: linear-gradient(135deg, #0f2027, #203a43, #2c5364); color: #ffffff; min-height: 100vh; display: flex; flex-direction: column; }
#page-content { opacity: 0.1; pointer-events: none; transition: opacity 0.5s; display: flex; flex-direction: column; flex: 1; }
body.authorized #page-content { opacity: 1; pointer-events: auto; }
#turnstile-container { position: fixed; top: 50%; left: 50%; transform: translate(-50%, -50%); z-index: 9999; }
body.authorized #turnstile-container { display: none; }
header { background: rgba(0, 0, 0, 0.6); padding: 1rem 2rem; display: flex; justify-content: space-between; align-items: center; position: sticky; top: 0; backdrop-filter: blur(10px); z-index: 1000; border-bottom: 1px solid rgba(0, 188, 212, 0.3); }
header img { max-height: 50px; cursor: pointer; }
.lang-menu { position: relative; }
.lang-btn { background: rgba(255, 255, 255, 0.1); border: 1px solid rgba(255, 255, 255, 0.2); color: white; padding: 10px 15px; border-radius: 8px; cursor: pointer; display: flex; align-items: center; gap: 10px; font-weight: 600; }
.lang-dropdown { display: none; position: absolute; right: 0; background: #1e3a45; min-width: 180px; border-radius: 8px; box-shadow: 0px 8px 24px rgba(0,0,0,0.5); margin-top: 8px; overflow: hidden; }
.lang-dropdown.show { display: block; }
.lang-dropdown a { display: flex; align-items: center; gap: 12px; padding: 12px 16px; color: white; text-decoration: none; font-size: 0.9rem; }
.lang-dropdown a:hover { background: #2c5364; }
.flag { width: 22px; height: 16px; object-fit: cover; border-radius: 2px; }
main { flex: 1; display: flex; justify-content: center; align-items: center; padding: 2rem 1rem; }
#chat-box { width: 100%; max-width: 900px; height: 75vh; background: rgba(255, 255, 255, 0.05); border: 1px solid rgba(0, 188, 212, 0.3); border-radius: 20px; display: flex; flex-direction: column; overflow: hidden; backdrop-filter: blur(10px); }
#chat-header { background: rgba(0, 188, 212, 0.2); padding: 15px; text-align: center; font-weight: 800; color: #00bcd4; border-bottom: 1px solid rgba(0, 188, 212, 0.3); }
#messages { flex: 1; padding: 20px; overflow-y: auto; display: flex; flex-direction: column; gap: 15px; scroll-behavior: smooth; }
.msg { padding: 12px 16px; border-radius: 15px; max-width: 80%; line-height: 1.4; font-size: 0.95rem; }
.bot { background: rgba(255, 255, 255, 0.1); align-self: flex-start; border-bottom-left-radius: 2px; }
.user { background: #00bcd4; color: white; align-self: flex-end; border-bottom-right-radius: 2px; font-weight: 600; }
#input-area { display: flex; padding: 15px; background: rgba(0,0,0,0.2); border-top: 1px solid rgba(255,255,255,0.1); gap: 10px; }
#user-input { flex: 1; background: rgba(255,255,255,0.05); border: 1px solid rgba(255,255,255,0.1); color: white; outline: none; padding: 12px; border-radius: 10px; }
#send-btn { background: #00bcd4; border: none; color: white; padding: 10px 20px; border-radius: 10px; cursor: pointer; font-weight: 800; }
footer { text-align: center; padding: 1.5rem; font-size: 0.9rem; background-color: rgba(0, 0, 0, 0.4); color: #888; }
footer a { color: #888; text-decoration: none; margin: 0 5px; }
footer a:hover { color: #00bcd4; }
</style>
</head>
<body>
<div id="turnstile-container"></div>
<div id="page-content">
<header>
<img src="https://i.postimg.cc/nLhPrLMH/1000072572-3643adb7b6957288cd73d569e60f8263-18-11-2023-12-35-17-20240415-181847-0000-Original.png" alt="Logo" onclick="window.location.href='/'">
<div class="lang-menu">
<button class="lang-btn" id="menu-trigger">
<img src="https://flagcdn.com/w40/de.png" id="cur-flag" class="flag">
<span id="cur-lang-name">Deutsch</span>
</button>
<div class="lang-dropdown" id="lang-dropdown">
<a href="#" onclick="setLang('de-de')">Deutsch</a>
<a href="#" onclick="setLang('en-us')">English</a>
</div>
</div>
</header>
<main>
<div id="chat-box">
<div id="chat-header">Support AI</div>
<div id="messages"><div class="msg bot" id="welcome-msg">...</div></div>
<div id="input-area">
<input type="text" id="user-input" onkeypress="if(event.key==='Enter') askAI()">
<button id="send-btn" onclick="askAI()">Send</button>
</div>
</div>
</main>
<footer>
© 2026 Alex Gaming – <span id="t-copy">Alle Rechte vorbehalten.</span> |
<a href="/legal/">Impressum</a> | <a href="/privacy/">Datenschutz</a>
</footer>
</div>
<script>
const API_KEY = "__GROQ_API_KEY__";
const i18n = {
"de-de": { welcome: "Moin! Ich bin deine Support KI. Wie kann ich helfen?", placeholder: "Schreib etwas...", btn: "Senden", copy: "Alle Rechte vorbehalten.", flag: "de", name: "Deutsch" },
"en-us": { welcome: "Hi! I am your support AI. How can I help?", placeholder: "Type something...", btn: "Send", copy: "All rights reserved.", flag: "us", name: "English" }
};
function setLang(langCode) {
const data = i18n[langCode] || i18n["de-de"];
document.getElementById('welcome-msg').innerHTML = data.welcome;
document.getElementById('user-input').placeholder = data.placeholder;
document.getElementById('send-btn').innerText = data.btn;
document.getElementById('t-copy').innerText = data.copy;
document.getElementById('cur-lang-name').innerText = data.name;
document.getElementById('cur-flag').src = `https://flagcdn.com/w40/${data.flag}.png`;
localStorage.setItem('lang', langCode);
}
async function askAI() {
const input = document.getElementById('user-input');
const text = input.value.trim();
if(!text || API_KEY.startsWith("__GROQ")) return;
const container = document.getElementById('messages');
container.innerHTML += `<div class="msg user">${text}</div>`;
input.value = "";
const loader = document.createElement('div');
loader.className = "msg bot"; loader.innerText = "...";
container.appendChild(loader);
container.scrollTop = container.scrollHeight;
try {
const response = await fetch("https://api.groq.com/openai/v1/chat/completions", {
method: "POST",
headers: { "Content-Type": "application/json", "Authorization": `Bearer ${API_KEY}` },
body: JSON.stringify({
model: "llama-3.3-70b-versatile",
messages: [
{ role: "system", content: "You are the support bot for Alex Gaming. Pull-Requests allowed, copying forbidden. Short answers." },
{ role: "user", content: text }
]
})
});
const resData = await response.json();
loader.innerText = resData.choices[0].message.content;
} catch (e) { loader.innerText = "Error."; }
container.scrollTop = container.scrollHeight;
}
window.onload = () => {
turnstile.render('#turnstile-container', {
sitekey: '0x4AAAAAACVEfjxkDrA2Xmi6',
callback: function() {
document.body.classList.add('authorized');
setLang(localStorage.getItem('lang') || 'de-de');
}
});
};
const trigger = document.getElementById('menu-trigger');
const dropdown = document.getElementById('lang-dropdown');
trigger.onclick = (e) => { e.stopPropagation(); dropdown.classList.toggle('show'); };
window.onclick = () => dropdown.classList.remove('show');
</script>
</body>
</html>