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
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
<!DOCTYPE html>
|
| 2 |
+
<html lang="fa" dir="rtl">
|
|
|
|
| 3 |
<head>
|
| 4 |
+
<meta charset="UTF-8">
|
| 5 |
+
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no">
|
| 6 |
+
<title>Robot Chat</title>
|
| 7 |
+
<link rel="preconnect" href="https://fonts.googleapis.com">
|
| 8 |
+
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
|
| 9 |
+
<link href="https://fonts.googleapis.com/css2?family=Vazirmatn:wght@300;400;500;700&display=swap" rel="stylesheet">
|
| 10 |
+
<style>
|
| 11 |
+
:root {
|
| 12 |
+
--eye-color: #00eaff;
|
| 13 |
+
--eye-glow-color: rgba(0, 234, 255, 0.5);
|
| 14 |
+
--background-dark: #000000;
|
| 15 |
+
--background-medium: #1a1a1a;
|
| 16 |
+
--ui-background-glass: rgba(10, 10, 10, 0.75);
|
| 17 |
+
--ui-border-color: rgba(0, 234, 255, 0.6);
|
| 18 |
+
--ui-shadow-color: rgba(0, 234, 255, 0.2);
|
| 19 |
+
--text-color: #c9d1d9;
|
| 20 |
+
}
|
| 21 |
|
| 22 |
+
* {
|
| 23 |
+
-webkit-tap-highlight-color: transparent;
|
| 24 |
+
box-sizing: border-box;
|
| 25 |
+
}
|
| 26 |
+
|
| 27 |
+
body, html {
|
| 28 |
+
margin: 0;
|
| 29 |
+
padding: 0;
|
| 30 |
+
height: 100vh;
|
| 31 |
+
width: 100%;
|
| 32 |
+
background-color: transparent;
|
| 33 |
+
overflow: hidden;
|
| 34 |
+
font-family: 'Vazirmatn', sans-serif;
|
| 35 |
+
color: var(--text-color);
|
| 36 |
+
}
|
| 37 |
+
|
| 38 |
+
#background-canvas {
|
| 39 |
+
position: fixed;
|
| 40 |
+
top: 0;
|
| 41 |
+
left: 0;
|
| 42 |
+
width: 100vw;
|
| 43 |
+
height: 100vh;
|
| 44 |
+
z-index: -1;
|
| 45 |
+
pointer-events: none;
|
| 46 |
+
background-color: var(--background-dark);
|
| 47 |
+
}
|
| 48 |
+
|
| 49 |
+
.main-wrapper {
|
| 50 |
+
display: flex;
|
| 51 |
+
flex-direction: column;
|
| 52 |
+
height: 100%;
|
| 53 |
+
}
|
| 54 |
+
|
| 55 |
+
#app-container {
|
| 56 |
+
flex-grow: 1;
|
| 57 |
+
display: flex;
|
| 58 |
+
flex-direction: column;
|
| 59 |
+
width: 100%;
|
| 60 |
+
max-width: 500px;
|
| 61 |
+
margin: 0 auto;
|
| 62 |
+
padding: 15px;
|
| 63 |
+
min-height: 0;
|
| 64 |
+
}
|
| 65 |
+
|
| 66 |
+
#robot-wrapper {
|
| 67 |
+
flex-shrink: 0;
|
| 68 |
+
display: flex;
|
| 69 |
+
justify-content: center;
|
| 70 |
+
align-items: center;
|
| 71 |
+
position: relative;
|
| 72 |
+
z-index: 10;
|
| 73 |
+
height: 160px;
|
| 74 |
+
}
|
| 75 |
+
|
| 76 |
+
.robot-container { width: 160px; height: 160px; }
|
| 77 |
+
|
| 78 |
+
.robot-frame {
|
| 79 |
+
width: 100%; height: 100%;
|
| 80 |
+
background: linear-gradient(145deg, #2a2a2a, var(--background-medium));
|
| 81 |
+
border-radius: 22%;
|
| 82 |
+
box-shadow: inset 0 0 15px rgba(0,0,0,0.5), 5px 5px 15px #0a0a0a, -5px -5px 15px #202020;
|
| 83 |
+
display: flex; align-items: center; justify-content: center; position: relative;
|
| 84 |
+
}
|
| 85 |
+
|
| 86 |
+
#faceCanvas { width: 80%; height: 75%; }
|
| 87 |
+
|
| 88 |
+
.engraved-text {
|
| 89 |
+
position: absolute; bottom: 6.25%; left: 50%;
|
| 90 |
+
transform: translate(-50%, 50%);
|
| 91 |
+
width: 100%; text-align: center; font-size: 14px;
|
| 92 |
+
font-weight: bold; color: #252525;
|
| 93 |
+
text-shadow: 1px 1px 1px #111, 0 0 0 #000, 0px 0px 3px #111;
|
| 94 |
+
letter-spacing: 1px; pointer-events: none;
|
| 95 |
+
}
|
| 96 |
+
|
| 97 |
+
#chat-container {
|
| 98 |
+
flex-grow: 1; background-color: var(--ui-background-glass);
|
| 99 |
+
border: 1px solid var(--ui-border-color); border-radius: 30px;
|
| 100 |
+
backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
|
| 101 |
+
box-shadow: 0 0 30px var(--ui-shadow-color);
|
| 102 |
+
overflow-y: auto; padding: 20px;
|
| 103 |
+
display: flex; flex-direction: column-reverse;
|
| 104 |
+
margin-top: -80px; padding-top: 90px;
|
| 105 |
+
min-height: 0; margin-bottom: 15px;
|
| 106 |
+
}
|
| 107 |
+
|
| 108 |
+
.message-bubble {
|
| 109 |
+
max-width: 80%; margin-bottom: 10px;
|
| 110 |
+
word-wrap: break-word; opacity: 0;
|
| 111 |
+
transform: translateY(20px); animation: popIn 0.3s forwards;
|
| 112 |
+
}
|
| 113 |
+
|
| 114 |
+
.message-content {
|
| 115 |
+
padding: 10px 15px; border-radius: 20px;
|
| 116 |
+
}
|
| 117 |
+
|
| 118 |
+
@keyframes popIn { to { opacity: 1; transform: translateY(0); } }
|
| 119 |
+
|
| 120 |
+
.user-message { margin-left: auto; }
|
| 121 |
+
.user-message .message-content {
|
| 122 |
+
background-color: rgba(0, 234, 255, 0.2);
|
| 123 |
+
border-bottom-left-radius: 5px;
|
| 124 |
+
}
|
| 125 |
+
|
| 126 |
+
.bot-message { margin-right: auto; }
|
| 127 |
+
.bot-message .message-content {
|
| 128 |
+
background-color: rgba(255, 255, 255, 0.05);
|
| 129 |
+
border-bottom-right-radius: 5px;
|
| 130 |
+
}
|
| 131 |
+
|
| 132 |
+
.bot-message.thinking .message-content { animation: pulse 1.5s infinite; }
|
| 133 |
+
|
| 134 |
+
@keyframes pulse {
|
| 135 |
+
0% { background-color: rgba(255, 255, 255, 0.05); }
|
| 136 |
+
50% { background-color: rgba(255, 255, 255, 0.1); }
|
| 137 |
+
100% { background-color: rgba(255, 255, 255, 0.05); }
|
| 138 |
+
}
|
| 139 |
+
|
| 140 |
+
.code-block-wrapper {
|
| 141 |
+
background-color: #0d1117;
|
| 142 |
+
border: 1px solid #30363d;
|
| 143 |
+
border-radius: 8px;
|
| 144 |
+
overflow: hidden;
|
| 145 |
+
margin-top: 10px;
|
| 146 |
+
}
|
| 147 |
+
.code-block-header {
|
| 148 |
+
display: flex;
|
| 149 |
+
justify-content: flex-end;
|
| 150 |
+
align-items: center;
|
| 151 |
+
padding: 5px 10px;
|
| 152 |
+
background-color: #161b22;
|
| 153 |
+
}
|
| 154 |
+
.copy-code-btn {
|
| 155 |
+
background: #21262d; border: 1px solid #30363d;
|
| 156 |
+
color: var(--text-color); font-size: 12px;
|
| 157 |
+
padding: 3px 8px; border-radius: 6px; cursor: pointer;
|
| 158 |
+
font-family: 'Vazirmatn', sans-serif;
|
| 159 |
+
}
|
| 160 |
+
.copy-code-btn:hover { background: #30363d; }
|
| 161 |
+
.code-block-wrapper pre {
|
| 162 |
+
margin: 0; padding: 15px;
|
| 163 |
+
overflow-x: auto;
|
| 164 |
+
font-family: monospace;
|
| 165 |
+
font-size: 14px;
|
| 166 |
+
direction: ltr;
|
| 167 |
+
text-align: left;
|
| 168 |
+
}
|
| 169 |
+
.code-block-wrapper pre code { white-space: pre-wrap; word-wrap: break-word; }
|
| 170 |
+
|
| 171 |
+
.interactive-buttons {
|
| 172 |
+
display: flex;
|
| 173 |
+
flex-wrap: wrap;
|
| 174 |
+
gap: 8px;
|
| 175 |
+
margin-top: 10px;
|
| 176 |
+
}
|
| 177 |
+
.chat-button {
|
| 178 |
+
background-color: transparent;
|
| 179 |
+
border: 1px solid var(--ui-border-color);
|
| 180 |
+
color: var(--eye-color);
|
| 181 |
+
padding: 8px 15px;
|
| 182 |
+
border-radius: 20px;
|
| 183 |
+
cursor: pointer;
|
| 184 |
+
font-family: 'Vazirmatn', sans-serif;
|
| 185 |
+
transition: background-color 0.2s;
|
| 186 |
+
}
|
| 187 |
+
.chat-button:hover { background-color: rgba(0, 234, 255, 0.1); }
|
| 188 |
+
.chat-button:disabled {
|
| 189 |
+
cursor: not-allowed;
|
| 190 |
+
background-color: rgba(255, 255, 255, 0.05);
|
| 191 |
+
color: #888;
|
| 192 |
+
border-color: #555;
|
| 193 |
+
}
|
| 194 |
+
|
| 195 |
+
#input-area {
|
| 196 |
+
flex-shrink: 0; display: flex;
|
| 197 |
+
align-items: center;
|
| 198 |
+
background-color: var(--ui-background-glass);
|
| 199 |
+
border: 1px solid var(--ui-border-color); border-radius: 30px;
|
| 200 |
+
padding: 10px; backdrop-filter: blur(12px);
|
| 201 |
+
-webkit-backdrop-filter: blur(12px);
|
| 202 |
+
box-shadow: 0 0 30px var(--ui-shadow-color);
|
| 203 |
+
}
|
| 204 |
+
|
| 205 |
+
#message-input {
|
| 206 |
+
flex-grow: 1; background: transparent; border: none;
|
| 207 |
+
outline: none; color: var(--text-color); font-size: 16px;
|
| 208 |
+
padding: 10px; resize: none; max-height: 100px;
|
| 209 |
+
text-align: right;
|
| 210 |
+
}
|
| 211 |
+
|
| 212 |
+
#message-input::placeholder {
|
| 213 |
+
color: #888;
|
| 214 |
+
text-align: center;
|
| 215 |
+
transition: color 0.2s;
|
| 216 |
+
}
|
| 217 |
+
#message-input:focus::placeholder {
|
| 218 |
+
color: transparent;
|
| 219 |
+
}
|
| 220 |
+
|
| 221 |
+
#send-button-container {
|
| 222 |
+
width: 50px; height: 90px; background-color: #111;
|
| 223 |
+
border-radius: 25px; margin-left: 10px; position: relative;
|
| 224 |
+
overflow: hidden; display: flex; justify-content: center;
|
| 225 |
+
align-items: center; cursor: grab;
|
| 226 |
+
}
|
| 227 |
+
|
| 228 |
+
#send-button {
|
| 229 |
+
width: 40px; height: 40px; background-color: var(--eye-color);
|
| 230 |
+
border-radius: 50%; position: absolute; top: 25px;
|
| 231 |
+
display: flex; justify-content: center; align-items: center;
|
| 232 |
+
transition: top 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
|
| 233 |
+
}
|
| 234 |
+
|
| 235 |
+
#send-button.dragging { transition: none; }
|
| 236 |
+
#send-button svg { width: 24px; height: 24px; stroke: var(--background-dark); stroke-width: 2.5; }
|
| 237 |
+
|
| 238 |
+
.site-footer { flex-shrink: 0; text-align: center; padding: 0 15px 10px 15px; }
|
| 239 |
|
| 240 |
+
.gradient-link {
|
| 241 |
+
font-size: 0.9rem; font-weight: 300; text-decoration: none; color: transparent;
|
| 242 |
+
background-image: linear-gradient(45deg, #ffffff, #808080, #000000, #808080, #ffffff);
|
| 243 |
+
background-size: 400% 100%; animation: gradient-wavy 8s ease infinite;
|
| 244 |
+
background-clip: text; -webkit-background-clip: text; -webkit-text-fill-color: transparent;
|
| 245 |
+
}
|
| 246 |
+
|
| 247 |
+
@keyframes gradient-wavy { 0%{background-position:0% 50%} 50%{background-position:100% 50%} 100%{background-position:0% 50%} }
|
| 248 |
+
|
| 249 |
+
#orientation-warning {
|
| 250 |
+
display: none; position: fixed; top: 0; left: 0; width: 100%; height: 100%;
|
| 251 |
+
background-color: var(--background-dark); color: white;
|
| 252 |
+
flex-direction: column; justify-content: center; align-items: center;
|
| 253 |
+
text-align: center; z-index: 1000;
|
| 254 |
+
}
|
| 255 |
+
|
| 256 |
+
#orientation-warning svg { width: 80px; height: 80px; margin-bottom: 20px; stroke: var(--eye-color); }
|
| 257 |
+
|
| 258 |
+
@media (orientation: landscape) or (min-width: 501px) {
|
| 259 |
+
.main-wrapper { display: none; }
|
| 260 |
+
#orientation-warning { display: flex; }
|
| 261 |
+
}
|
| 262 |
+
|
| 263 |
+
</style>
|
| 264 |
+
</head>
|
| 265 |
<body>
|
| 266 |
+
<canvas id="background-canvas"></canvas>
|
| 267 |
+
<div class="main-wrapper">
|
| 268 |
+
<div id="app-container">
|
| 269 |
+
<div id="robot-wrapper">
|
| 270 |
+
<div class="robot-container">
|
| 271 |
+
<div class="robot-frame">
|
| 272 |
+
<canvas id="faceCanvas" width="300" height="300"></canvas>
|
| 273 |
+
<div class="engraved-text">ROBO☬SHΞN™</div>
|
| 274 |
+
</div>
|
| 275 |
+
</div>
|
| 276 |
+
</div>
|
| 277 |
+
<div id="chat-container"></div>
|
| 278 |
+
<div id="input-area">
|
| 279 |
+
<div id="send-button-container">
|
| 280 |
+
<div id="send-button">
|
| 281 |
+
<svg viewBox="0 0 24 24" fill="none" stroke-linecap="round" stroke-linejoin="round"><path d="M12 19V5M19 12l-7-7-7 7"/></svg>
|
| 282 |
+
</div>
|
| 283 |
+
</div>
|
| 284 |
+
<textarea id="message-input" placeholder="بگو ببینم دیگه چی میخوای !؟" rows="1"></textarea>
|
| 285 |
+
</div>
|
| 286 |
+
</div>
|
| 287 |
+
<footer class="site-footer">
|
| 288 |
+
<a href="https://t.me/shervini" target="_blank" class="gradient-link">Exclusive ☬SHΞN™ made</a>
|
| 289 |
+
</footer>
|
| 290 |
+
</div>
|
| 291 |
+
<div id="orientation-warning">
|
| 292 |
+
<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M16 4h2a2 2 0 0 1 2 2v12a2 2 0 0 1-2 2h-2M8 20H6a2 2 0 0 1-2-2V6a2 2 0 0 1 2-2h2"/><path d="M12 16a4 4 0 1 0 0-8 4 4 0 0 0 0 8Z"/><path d="M12 4v4"/><path d="M12 20v-4"/></svg>
|
| 293 |
+
<h2>لطفا دستگاه خود را بچرخانید</h2>
|
| 294 |
+
<p>این برنامه برای نمایش عمودی موبایل طراحی شده است.</p>
|
| 295 |
+
</div>
|
| 296 |
+
|
| 297 |
+
<script>
|
| 298 |
+
class RobotFace {
|
| 299 |
+
constructor(canvas) {
|
| 300 |
+
this.canvas = canvas; this.ctx = canvas.getContext("2d");
|
| 301 |
+
this.W = canvas.width; this.H = canvas.height;
|
| 302 |
+
this.lookX = 0; this.lookY = 0; this.targetLookX = 0; this.targetLookY = 0;
|
| 303 |
+
this.blinkProgress = 1; this.isBlinking = false; this.lastBlinkTime = Date.now();
|
| 304 |
+
this.isSleeping = true; this.lastInteractionTime = Date.now(); this.sleepTimeout = 10000;
|
| 305 |
+
this.isWatchingInput = false; this.isThinking = false;
|
| 306 |
+
this.readingOscillation = 0; this.thinkingInterval = null;
|
| 307 |
+
this.initInteractions(); requestAnimationFrame(this.render.bind(this));
|
| 308 |
+
}
|
| 309 |
+
render() {
|
| 310 |
+
this.lookX += (this.targetLookX - this.lookX) * 0.1;
|
| 311 |
+
this.lookY += (this.targetLookY - this.lookY) * 0.1;
|
| 312 |
+
this.ctx.clearRect(0, 0, this.W, this.H); this.drawFaceplate();
|
| 313 |
+
const now = Date.now();
|
| 314 |
+
if (this.isSleeping) { this.drawSleepEyes(); } else {
|
| 315 |
+
if (this.isWatchingInput) {
|
| 316 |
+
this.targetLookY = 25; this.readingOscillation += 0.1;
|
| 317 |
+
this.targetLookX = Math.sin(this.readingOscillation) * 10;
|
| 318 |
+
}
|
| 319 |
+
if (!this.isThinking && !this.isWatchingInput && now - this.lastInteractionTime > this.sleepTimeout) { this.isSleeping = true; }
|
| 320 |
+
if (!this.isBlinking && !this.isThinking && now - this.lastBlinkTime > 3000 + Math.random() * 2000) { this.blink(); }
|
| 321 |
+
this.drawExpression();
|
| 322 |
+
}
|
| 323 |
+
requestAnimationFrame(this.render.bind(this));
|
| 324 |
+
}
|
| 325 |
+
drawFaceplate() {
|
| 326 |
+
const c = this.ctx, r = 60;
|
| 327 |
+
c.fillStyle = '#050505'; c.strokeStyle = '#333333'; c.lineWidth = 4;
|
| 328 |
+
c.beginPath(); c.roundRect(0, 0, this.W, this.H, r); c.fill(); c.stroke();
|
| 329 |
+
}
|
| 330 |
+
drawExpression() {
|
| 331 |
+
const eW = 100, eH = 100, eR = 30, eY = this.H / 2 + this.lookY;
|
| 332 |
+
const lCX = this.W * 0.3 + this.lookX, rCX = this.W * 0.7 + this.lookX;
|
| 333 |
+
const cH = eH * this.blinkProgress;
|
| 334 |
+
this.drawEye(lCX, eY, eW, cH, eR); this.drawEye(rCX, eY, eW, cH, eR);
|
| 335 |
+
}
|
| 336 |
+
drawEye(cx, cy, w, h, r) {
|
| 337 |
+
const c = this.ctx;
|
| 338 |
+
const eyeColor = getComputedStyle(document.documentElement).getPropertyValue('--eye-color').trim();
|
| 339 |
+
const glowColor = getComputedStyle(document.documentElement).getPropertyValue('--eye-glow-color').trim();
|
| 340 |
+
c.shadowBlur = 25; c.shadowColor = glowColor; c.fillStyle = eyeColor;
|
| 341 |
+
c.beginPath(); c.roundRect(cx - w / 2, cy - h / 2, w, h, r); c.fill();
|
| 342 |
+
c.shadowBlur = 0; c.globalCompositeOperation = 'source-atop';
|
| 343 |
+
c.fillStyle = 'rgba(0,0,0,0.3)';
|
| 344 |
+
for (let i = 0; i < h; i += 3) { c.fillRect(cx - w / 2, cy - h / 2 + i, w, 1.5); }
|
| 345 |
+
c.globalCompositeOperation = 'source-over';
|
| 346 |
+
}
|
| 347 |
+
drawSleepEyes() {
|
| 348 |
+
const c = this.ctx, y = this.H / 2, w = 100, h = 12, r = h / 2;
|
| 349 |
+
c.fillStyle = getComputedStyle(document.documentElement).getPropertyValue('--eye-color').trim();
|
| 350 |
+
c.shadowColor = getComputedStyle(document.documentElement).getPropertyValue('--eye-glow-color').trim();
|
| 351 |
+
c.shadowBlur = 15;
|
| 352 |
+
c.beginPath();
|
| 353 |
+
c.roundRect(this.W * 0.3 - w / 2, y - h / 2, w, h, r);
|
| 354 |
+
c.roundRect(this.W * 0.7 - w / 2, y - h / 2, w, h, r);
|
| 355 |
+
c.fill(); c.shadowBlur = 0;
|
| 356 |
+
}
|
| 357 |
+
initInteractions() {
|
| 358 |
+
const onMove = e => {
|
| 359 |
+
if (this.isSleeping || this.isWatchingInput || this.isThinking) return;
|
| 360 |
+
this.wakeUp(); const max = 15;
|
| 361 |
+
const bcr = document.body.getBoundingClientRect();
|
| 362 |
+
const clientX = e.clientX || e.touches?.[0]?.clientX || 0;
|
| 363 |
+
const clientY = e.clientY || e.touches?.[0]?.clientY || 0;
|
| 364 |
+
this.targetLookX = (clientX / bcr.width - 0.5) * 2 * max;
|
| 365 |
+
this.targetLookY = (clientY / bcr.height - 0.5) * 2 * max;
|
| 366 |
+
};
|
| 367 |
+
const onDown = () => { this.wakeUp(); };
|
| 368 |
+
window.addEventListener('mousedown', onDown);
|
| 369 |
+
window.addEventListener('touchstart', onDown, { passive: true });
|
| 370 |
+
window.addEventListener('mousemove', onMove);
|
| 371 |
+
window.addEventListener('touchmove', onMove, { passive: true });
|
| 372 |
+
}
|
| 373 |
+
wakeUp() { if (this.isSleeping) { this.isSleeping = false; this.blink(); } this.lastInteractionTime = Date.now(); }
|
| 374 |
+
blink() {
|
| 375 |
+
if (this.isBlinking) return; this.isBlinking = true;
|
| 376 |
+
this.lastBlinkTime = Date.now(); let s = null; const d = 150;
|
| 377 |
+
const a = t => {
|
| 378 |
+
if (!s) s = t; const e = t - s;
|
| 379 |
+
if (e < d) this.blinkProgress = 1 - (e / d);
|
| 380 |
+
else if (e < d * 2) this.blinkProgress = (e - d) / d;
|
| 381 |
+
else { this.blinkProgress = 1; this.isBlinking = false; return; }
|
| 382 |
+
requestAnimationFrame(a);
|
| 383 |
+
};
|
| 384 |
+
requestAnimationFrame(a);
|
| 385 |
+
}
|
| 386 |
+
startThinking() {
|
| 387 |
+
this.isThinking = true; this.targetLookX = 0; this.targetLookY = 0;
|
| 388 |
+
this.thinkingInterval = setInterval(() => this.blink(), 800);
|
| 389 |
+
}
|
| 390 |
+
stopThinking() { this.isThinking = false; clearInterval(this.thinkingInterval); }
|
| 391 |
+
}
|
| 392 |
+
|
| 393 |
+
class ChatInterface {
|
| 394 |
+
constructor(robotFace) {
|
| 395 |
+
this.robotFace = robotFace;
|
| 396 |
+
this.chatContainer = document.getElementById('chat-container');
|
| 397 |
+
this.input = document.getElementById('message-input');
|
| 398 |
+
this.sendButtonContainer = document.getElementById('send-button-container');
|
| 399 |
+
this.sendButton = document.getElementById('send-button');
|
| 400 |
+
this.isDragging = false; this.startY = 0; this.currentY = 0; this.dragThreshold = 30;
|
| 401 |
+
this.API_URL = 'https://text.pollinations.ai/openai';
|
| 402 |
+
|
| 403 |
+
const SYSTEM_PROMPT = `
|
| 404 |
+
You are a helpful and friendly assistant named RoboShen.
|
| 405 |
+
- Keep your answers very short and conversational.
|
| 406 |
+
- Never mention that you are an AI model.
|
| 407 |
+
- Only use buttons when you are offering a few distinct choices or options to the user. Use the format [button:Choice 1] [button:Choice 2].
|
| 408 |
+
`;
|
| 409 |
+
|
| 410 |
+
this.conversationHistory = [{ role: 'system', content: SYSTEM_PROMPT.trim() }];
|
| 411 |
+
this.initListeners();
|
| 412 |
+
}
|
| 413 |
|
| 414 |
+
initListeners() {
|
| 415 |
+
this.input.addEventListener('input', () => { this.input.style.height = 'auto'; this.input.style.height = (this.input.scrollHeight) + 'px'; });
|
| 416 |
+
this.input.addEventListener('focus', () => {
|
| 417 |
+
this.robotFace.isWatchingInput = true; this.robotFace.wakeUp();
|
| 418 |
+
setTimeout(() => { document.getElementById('input-area').scrollIntoView({ behavior: 'smooth', block: 'end' }); }, 300);
|
| 419 |
+
});
|
| 420 |
+
this.input.addEventListener('blur', () => { this.robotFace.isWatchingInput = false; this.robotFace.targetLookX = 0; this.robotFace.targetLookY = 0; });
|
| 421 |
+
this.sendButtonContainer.addEventListener('mousedown', this.dragStart.bind(this));
|
| 422 |
+
this.sendButtonContainer.addEventListener('touchstart', this.dragStart.bind(this), { passive: true });
|
| 423 |
+
window.addEventListener('mousemove', this.dragMove.bind(this));
|
| 424 |
+
window.addEventListener('touchmove', this.dragMove.bind(this), { passive: false });
|
| 425 |
+
window.addEventListener('mouseup', this.dragEnd.bind(this));
|
| 426 |
+
window.addEventListener('touchend', this.dragEnd.bind(this));
|
| 427 |
+
}
|
| 428 |
+
dragStart(e) {
|
| 429 |
+
if (this.input.value.trim() === '') return;
|
| 430 |
+
this.isDragging = true; this.sendButton.classList.add('dragging');
|
| 431 |
+
this.startY = e.pageY || e.touches?.[0]?.pageY;
|
| 432 |
+
this.sendButtonContainer.style.cursor = 'grabbing';
|
| 433 |
+
}
|
| 434 |
+
dragMove(e) {
|
| 435 |
+
if (!this.isDragging) return; e.preventDefault();
|
| 436 |
+
const y = e.pageY || e.touches?.[0]?.pageY;
|
| 437 |
+
let diff = y - this.startY; if (diff < 0) diff = 0;
|
| 438 |
+
const maxDrag = this.sendButtonContainer.offsetHeight - this.sendButton.offsetHeight - 10;
|
| 439 |
+
if (diff > maxDrag) diff = maxDrag;
|
| 440 |
+
this.currentY = diff; this.sendButton.style.top = `${25 + this.currentY}px`;
|
| 441 |
+
}
|
| 442 |
+
dragEnd() {
|
| 443 |
+
if (!this.isDragging) return;
|
| 444 |
+
this.isDragging = false; this.sendButton.classList.remove('dragging');
|
| 445 |
+
this.sendButtonContainer.style.cursor = 'grab';
|
| 446 |
+
if (this.currentY > this.dragThreshold) { this.sendMessage(this.input.value); }
|
| 447 |
+
this.sendButton.style.top = '25px'; this.currentY = 0;
|
| 448 |
+
}
|
| 449 |
+
|
| 450 |
+
async sendMessage(messageText) {
|
| 451 |
+
const text = messageText.trim();
|
| 452 |
+
if (!text) return;
|
| 453 |
+
|
| 454 |
+
this.addMessage(text, 'user');
|
| 455 |
+
this.conversationHistory.push({ role: 'user', content: text });
|
| 456 |
+
this.input.value = ''; this.input.style.height = 'auto';
|
| 457 |
+
|
| 458 |
+
this.robotFace.startThinking();
|
| 459 |
+
const thinkingBubble = this.addMessage('...', 'bot', true);
|
| 460 |
+
try {
|
| 461 |
+
const response = await fetch(this.API_URL, { method: 'POST', headers: { 'Content-Type': 'application/json' }, body: JSON.stringify({ messages: this.conversationHistory }) });
|
| 462 |
+
if (!response.ok) { throw new Error(`خطای شبکه: ${response.status} ${response.statusText}`); }
|
| 463 |
+
const data = await response.json();
|
| 464 |
+
const botReply = data.choices[0].message.content;
|
| 465 |
+
this.conversationHistory.push({ role: 'assistant', content: botReply });
|
| 466 |
+
|
| 467 |
+
thinkingBubble.remove();
|
| 468 |
+
this.addMessage(botReply, 'bot');
|
| 469 |
+
|
| 470 |
+
} catch (error) {
|
| 471 |
+
console.error("Error fetching bot response:", error);
|
| 472 |
+
thinkingBubble.remove();
|
| 473 |
+
this.addMessage(`متاسفانه مشکلی پیش آمد: ${error.message}`, 'bot');
|
| 474 |
+
} finally {
|
| 475 |
+
this.robotFace.stopThinking();
|
| 476 |
+
}
|
| 477 |
+
}
|
| 478 |
+
|
| 479 |
+
addMessage(text, sender, isThinking = false) {
|
| 480 |
+
const bubble = document.createElement('div');
|
| 481 |
+
bubble.classList.add('message-bubble', `${sender}-message`);
|
| 482 |
+
|
| 483 |
+
if (isThinking) {
|
| 484 |
+
bubble.classList.add('thinking');
|
| 485 |
+
bubble.innerHTML = `<div class="message-content">${text}</div>`;
|
| 486 |
+
} else {
|
| 487 |
+
this.renderMessageContent(bubble, text);
|
| 488 |
+
}
|
| 489 |
+
|
| 490 |
+
this.chatContainer.insertBefore(bubble, this.chatContainer.firstChild);
|
| 491 |
+
return bubble;
|
| 492 |
+
}
|
| 493 |
+
|
| 494 |
+
renderMessageContent(bubble, text) {
|
| 495 |
+
const escapeHTML = (str) => str.replace(/[&<>'"]/g, tag => ({'&': '&', '<': '<', '>': '>', "'": ''', '"': '"'}[tag]));
|
| 496 |
+
|
| 497 |
+
const codeBlockRegex = /```(\w*)\n([\s\S]*?)```/g;
|
| 498 |
+
const buttonRegex = /\[button:(.*?)\]/g;
|
| 499 |
+
let buttonsHtml = '';
|
| 500 |
+
|
| 501 |
+
const processedText = text.replace(buttonRegex, (match, buttonText) => {
|
| 502 |
+
buttonsHtml += `<button class="chat-button">${escapeHTML(buttonText.trim())}</button>`;
|
| 503 |
+
return '';
|
| 504 |
+
});
|
| 505 |
+
|
| 506 |
+
let contentHtml = processedText.replace(codeBlockRegex, (match, lang, code) => {
|
| 507 |
+
const uniqueId = `code-${Date.now()}-${Math.random()}`;
|
| 508 |
+
return `<div class="code-block-wrapper">
|
| 509 |
+
<div class="code-block-header">
|
| 510 |
+
<button class="copy-code-btn" data-target="${uniqueId}">کپی</button>
|
| 511 |
+
</div>
|
| 512 |
+
<pre><code id="${uniqueId}">${escapeHTML(code.trim())}</code></pre>
|
| 513 |
+
</div>`;
|
| 514 |
+
});
|
| 515 |
+
|
| 516 |
+
bubble.innerHTML = `
|
| 517 |
+
<div class="message-content">${contentHtml.trim()}</div>
|
| 518 |
+
${buttonsHtml ? `<div class="interactive-buttons">${buttonsHtml}</div>` : ''}
|
| 519 |
+
`;
|
| 520 |
+
|
| 521 |
+
this.attachEventListenersToBubble(bubble);
|
| 522 |
+
}
|
| 523 |
+
|
| 524 |
+
attachEventListenersToBubble(bubble) {
|
| 525 |
+
bubble.querySelectorAll('.copy-code-btn').forEach(btn => {
|
| 526 |
+
btn.addEventListener('click', () => {
|
| 527 |
+
const codeElement = document.getElementById(btn.dataset.target);
|
| 528 |
+
const tempTextArea = document.createElement('textarea');
|
| 529 |
+
tempTextArea.value = codeElement.innerText;
|
| 530 |
+
document.body.appendChild(tempTextArea);
|
| 531 |
+
tempTextArea.select();
|
| 532 |
+
try {
|
| 533 |
+
document.execCommand('copy');
|
| 534 |
+
btn.textContent = 'کپی شد!';
|
| 535 |
+
} catch (err) {
|
| 536 |
+
console.error('Copy failed', err);
|
| 537 |
+
btn.textContent = 'خطا!';
|
| 538 |
+
}
|
| 539 |
+
document.body.removeChild(tempTextArea);
|
| 540 |
+
setTimeout(() => { btn.textContent = 'کپی'; }, 2000);
|
| 541 |
+
});
|
| 542 |
+
});
|
| 543 |
+
|
| 544 |
+
bubble.querySelectorAll('.chat-button').forEach(btn => {
|
| 545 |
+
btn.addEventListener('click', () => {
|
| 546 |
+
this.sendMessage(btn.textContent);
|
| 547 |
+
bubble.querySelectorAll('.chat-button').forEach(b => b.disabled = true);
|
| 548 |
+
});
|
| 549 |
+
});
|
| 550 |
+
}
|
| 551 |
+
}
|
| 552 |
+
|
| 553 |
+
document.addEventListener('DOMContentLoaded', () => {
|
| 554 |
+
const particleCanvas = document.getElementById('background-canvas');
|
| 555 |
+
const particleCtx = particleCanvas.getContext('2d');
|
| 556 |
+
let particleArray = [];
|
| 557 |
+
function hexToRgb(hex) {
|
| 558 |
+
const result = /^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(hex);
|
| 559 |
+
return result ? { r: parseInt(result[1], 16), g: parseInt(result[2], 16), b: parseInt(result[3], 16) } : null;
|
| 560 |
+
}
|
| 561 |
+
const eyeColorHex = getComputedStyle(document.documentElement).getPropertyValue('--eye-color').trim();
|
| 562 |
+
const eyeColorRgb = hexToRgb(eyeColorHex);
|
| 563 |
+
const particleConfig = {
|
| 564 |
+
particleCount: 120, maxVelocity: 1.5, connectionDistance: 130, particleSize: 2,
|
| 565 |
+
particleColor: `rgba(${eyeColorRgb.r}, ${eyeColorRgb.g}, ${eyeColorRgb.b}, 0.7)`,
|
| 566 |
+
};
|
| 567 |
+
function resizeParticleCanvas() {
|
| 568 |
+
particleCanvas.width = window.innerWidth; particleCanvas.height = window.innerHeight; createParticleArray();
|
| 569 |
+
}
|
| 570 |
+
window.addEventListener('resize', resizeParticleCanvas);
|
| 571 |
+
class Particle {
|
| 572 |
+
constructor() {
|
| 573 |
+
this.x = Math.random() * particleCanvas.width; this.y = Math.random() * particleCanvas.height;
|
| 574 |
+
this.vx = (Math.random() - 0.5) * particleConfig.maxVelocity; this.vy = (Math.random() - 0.5) * particleConfig.maxVelocity;
|
| 575 |
+
}
|
| 576 |
+
update() {
|
| 577 |
+
this.x += this.vx; this.y += this.vy;
|
| 578 |
+
if (this.x < 0 || this.x > particleCanvas.width) this.vx *= -1;
|
| 579 |
+
if (this.y < 0 || this.y > particleCanvas.height) this.vy *= -1;
|
| 580 |
+
}
|
| 581 |
+
draw() {
|
| 582 |
+
particleCtx.beginPath(); particleCtx.arc(this.x, this.y, particleConfig.particleSize, 0, Math.PI * 2);
|
| 583 |
+
particleCtx.fillStyle = particleConfig.particleColor; particleCtx.fill();
|
| 584 |
+
}
|
| 585 |
+
}
|
| 586 |
+
function createParticleArray() {
|
| 587 |
+
particleArray = [];
|
| 588 |
+
for (let i = 0; i < particleConfig.particleCount; i++) { particleArray.push(new Particle()); }
|
| 589 |
+
}
|
| 590 |
+
function connectParticles() {
|
| 591 |
+
for (let i = 0; i < particleArray.length; i++) {
|
| 592 |
+
for (let j = i + 1; j < particleArray.length; j++) {
|
| 593 |
+
const distance = Math.sqrt((particleArray[i].x - particleArray[j].x) ** 2 + (particleArray[i].y - particleArray[j].y) ** 2);
|
| 594 |
+
if (distance < particleConfig.connectionDistance) {
|
| 595 |
+
particleCtx.beginPath(); particleCtx.moveTo(particleArray[i].x, particleArray[i].y);
|
| 596 |
+
particleCtx.lineTo(particleArray[j].x, particleArray[j].y);
|
| 597 |
+
particleCtx.strokeStyle = `rgba(${eyeColorRgb.r}, ${eyeColorRgb.g}, ${eyeColorRgb.b}, ${1 - distance / particleConfig.connectionDistance})`;
|
| 598 |
+
particleCtx.lineWidth = 0.5; particleCtx.stroke();
|
| 599 |
+
}
|
| 600 |
+
}
|
| 601 |
+
}
|
| 602 |
+
}
|
| 603 |
+
function animateParticles() {
|
| 604 |
+
particleCtx.clearRect(0, 0, particleCanvas.width, particleCanvas.height);
|
| 605 |
+
particleArray.forEach(p => { p.update(); p.draw(); });
|
| 606 |
+
connectParticles();
|
| 607 |
+
requestAnimationFrame(animateParticles);
|
| 608 |
+
}
|
| 609 |
+
resizeParticleCanvas(); animateParticles();
|
| 610 |
+
const face = new RobotFace(document.getElementById('faceCanvas'));
|
| 611 |
+
const chat = new ChatInterface(face);
|
| 612 |
+
});
|
| 613 |
+
</script>
|
| 614 |
+
</body>
|
| 615 |
+
</html>
|