Spaces:
Running
Running
Upload folder using huggingface_hub
Browse files- index.html +788 -459
index.html
CHANGED
|
@@ -1,500 +1,829 @@
|
|
| 1 |
<!DOCTYPE html>
|
| 2 |
<html lang="fa" dir="rtl">
|
|
|
|
| 3 |
<head>
|
| 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 |
-
|
| 132 |
-
|
| 133 |
-
|
| 134 |
-
|
| 135 |
-
|
| 136 |
-
|
| 137 |
-
|
| 138 |
-
|
| 139 |
-
|
| 140 |
-
|
| 141 |
-
|
| 142 |
-
|
| 143 |
-
|
| 144 |
-
|
| 145 |
-
|
| 146 |
-
|
| 147 |
-
|
| 148 |
-
|
| 149 |
-
|
| 150 |
-
|
| 151 |
-
|
| 152 |
-
|
| 153 |
-
|
| 154 |
-
|
| 155 |
-
|
| 156 |
-
|
| 157 |
-
|
| 158 |
-
|
| 159 |
-
|
| 160 |
-
|
| 161 |
-
|
| 162 |
-
|
| 163 |
-
|
| 164 |
-
|
| 165 |
-
|
| 166 |
-
|
| 167 |
-
|
| 168 |
-
|
| 169 |
-
|
| 170 |
-
|
| 171 |
-
|
| 172 |
-
|
| 173 |
-
|
| 174 |
-
|
| 175 |
-
|
| 176 |
-
|
| 177 |
-
|
| 178 |
-
|
| 179 |
-
|
| 180 |
-
|
| 181 |
-
|
| 182 |
-
|
| 183 |
-
|
| 184 |
-
|
| 185 |
-
|
| 186 |
-
|
| 187 |
-
|
| 188 |
-
|
| 189 |
-
|
| 190 |
-
|
| 191 |
-
|
| 192 |
-
|
| 193 |
-
|
| 194 |
-
|
| 195 |
-
|
| 196 |
-
|
| 197 |
-
|
| 198 |
-
|
| 199 |
-
|
| 200 |
-
|
| 201 |
-
|
| 202 |
-
|
| 203 |
-
|
| 204 |
-
|
| 205 |
-
|
| 206 |
-
|
| 207 |
-
|
| 208 |
-
|
| 209 |
-
|
| 210 |
-
|
| 211 |
-
|
| 212 |
-
|
| 213 |
-
|
| 214 |
-
|
| 215 |
-
|
| 216 |
-
|
| 217 |
-
|
| 218 |
-
|
| 219 |
-
|
| 220 |
-
|
| 221 |
-
|
| 222 |
-
|
| 223 |
-
|
| 224 |
-
|
| 225 |
-
|
| 226 |
-
|
| 227 |
-
|
| 228 |
-
|
| 229 |
-
|
| 230 |
-
|
| 231 |
-
|
| 232 |
-
|
| 233 |
-
|
| 234 |
-
|
| 235 |
-
|
| 236 |
-
|
| 237 |
-
|
| 238 |
-
|
| 239 |
-
|
| 240 |
-
|
| 241 |
-
|
| 242 |
-
|
| 243 |
-
|
| 244 |
-
|
| 245 |
-
|
| 246 |
-
|
| 247 |
-
|
| 248 |
-
|
| 249 |
-
|
| 250 |
-
|
| 251 |
-
|
| 252 |
-
|
| 253 |
-
|
| 254 |
-
|
| 255 |
-
|
| 256 |
-
|
| 257 |
-
|
| 258 |
-
|
| 259 |
-
|
| 260 |
-
|
| 261 |
-
|
| 262 |
-
|
| 263 |
-
|
| 264 |
-
|
| 265 |
-
|
| 266 |
-
|
| 267 |
-
|
| 268 |
-
|
| 269 |
-
|
| 270 |
-
|
| 271 |
-
|
| 272 |
-
|
| 273 |
-
|
| 274 |
-
|
| 275 |
-
|
| 276 |
-
|
| 277 |
-
|
| 278 |
-
|
| 279 |
-
|
| 280 |
-
|
| 281 |
-
|
| 282 |
-
|
| 283 |
-
|
| 284 |
-
|
| 285 |
-
|
| 286 |
-
|
| 287 |
-
|
| 288 |
-
|
| 289 |
-
|
| 290 |
-
|
| 291 |
-
|
| 292 |
-
|
| 293 |
-
|
| 294 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 295 |
</head>
|
| 296 |
-
<body>
|
| 297 |
|
| 298 |
-
|
| 299 |
-
|
| 300 |
-
<header>
|
| 301 |
-
<div class="logo">بساز <i class="fa-solid fa-hammer"></i></div>
|
| 302 |
-
<a href="https://huggingface.co/spaces/akhaliq/anycoder" target="_blank" class="anycoder-link">
|
| 303 |
-
Built with Anycoder <i class="fa-solid fa-code"></i>
|
| 304 |
-
</a>
|
| 305 |
-
</header>
|
| 306 |
-
|
| 307 |
-
<main>
|
| 308 |
-
<!-- Sidebar Controls -->
|
| 309 |
-
<aside>
|
| 310 |
-
<h2><i class="fa-solid fa-sliders"></i> تنظیمات کارت</h2>
|
| 311 |
-
|
| 312 |
-
<!-- Text Content -->
|
| 313 |
-
<div class="control-group">
|
| 314 |
-
<label>عنوان</label>
|
| 315 |
-
<input type="text" id="input-title" value="عنوان دلخواه">
|
| 316 |
-
</div>
|
| 317 |
-
|
| 318 |
-
<div class="control-group">
|
| 319 |
-
<label>توضیحات</label>
|
| 320 |
-
<textarea id="input-desc" rows="3">این یک متن نمونه برای کارت زیبای شماست. میتوانید این متن را تغییر دهید.</textarea>
|
| 321 |
-
</div>
|
| 322 |
-
|
| 323 |
-
<!-- Styling -->
|
| 324 |
-
<div class="control-group">
|
| 325 |
-
<label>رنگ پسزمینه کارت</label>
|
| 326 |
-
<input type="color" id="input-bg" value="#ffffff" data-opacity="0.1">
|
| 327 |
-
</div>
|
| 328 |
|
| 329 |
-
|
| 330 |
-
|
| 331 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 332 |
</div>
|
|
|
|
|
|
|
| 333 |
|
| 334 |
-
|
| 335 |
-
|
| 336 |
-
|
|
|
|
| 337 |
</div>
|
|
|
|
|
|
|
| 338 |
|
| 339 |
-
|
| 340 |
-
|
| 341 |
-
|
|
|
|
| 342 |
</div>
|
| 343 |
-
|
| 344 |
-
|
| 345 |
-
|
| 346 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 347 |
</div>
|
|
|
|
|
|
|
| 348 |
|
| 349 |
-
|
| 350 |
-
|
| 351 |
-
|
|
|
|
| 352 |
</div>
|
| 353 |
-
|
| 354 |
-
|
| 355 |
-
|
| 356 |
-
|
| 357 |
-
|
| 358 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 359 |
</div>
|
| 360 |
-
|
| 361 |
-
|
| 362 |
-
<
|
| 363 |
-
|
| 364 |
-
|
| 365 |
-
|
| 366 |
-
|
| 367 |
-
|
| 368 |
-
|
| 369 |
-
|
| 370 |
-
|
| 371 |
-
|
| 372 |
-
|
| 373 |
-
|
| 374 |
-
|
| 375 |
-
|
| 376 |
-
|
| 377 |
-
|
| 378 |
-
|
| 379 |
-
|
| 380 |
-
|
| 381 |
-
|
| 382 |
-
|
| 383 |
-
|
| 384 |
-
|
| 385 |
-
|
| 386 |
-
|
| 387 |
-
|
| 388 |
-
|
| 389 |
-
|
| 390 |
-
|
| 391 |
-
|
| 392 |
-
|
| 393 |
-
|
| 394 |
-
|
| 395 |
-
|
| 396 |
-
|
| 397 |
-
|
| 398 |
-
|
| 399 |
-
|
| 400 |
-
|
| 401 |
-
|
| 402 |
-
|
| 403 |
-
|
| 404 |
-
|
| 405 |
-
|
| 406 |
-
|
| 407 |
-
|
| 408 |
-
|
| 409 |
-
|
| 410 |
-
|
| 411 |
-
|
| 412 |
-
|
| 413 |
-
|
| 414 |
-
|
| 415 |
-
|
| 416 |
-
|
| 417 |
-
|
| 418 |
-
|
| 419 |
-
|
| 420 |
-
|
| 421 |
-
|
| 422 |
-
|
| 423 |
-
|
| 424 |
-
|
| 425 |
-
|
| 426 |
-
|
| 427 |
-
|
| 428 |
-
|
| 429 |
-
|
| 430 |
-
|
| 431 |
-
|
| 432 |
-
|
| 433 |
-
|
| 434 |
-
|
| 435 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 436 |
<!-- Glassmorphism Card -->
|
| 437 |
<style>
|
| 438 |
.glass-card {
|
| 439 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 440 |
backdrop-filter: blur(${inputs.blur.value}px);
|
| 441 |
-webkit-backdrop-filter: blur(${inputs.blur.value}px);
|
| 442 |
-
border: 1px solid ${
|
| 443 |
-
border-radius: ${inputs.radius.value}px;
|
| 444 |
-
padding: 24px;
|
| 445 |
-
width: 320px;
|
| 446 |
-
text-align: center;
|
| 447 |
-
color: ${inputs.textColor.value};
|
| 448 |
-
font-family: sans-serif;
|
| 449 |
box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.37);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 450 |
}
|
|
|
|
| 451 |
.glass-card img {
|
| 452 |
width: 100px;
|
| 453 |
height: 100px;
|
| 454 |
border-radius: 50%;
|
| 455 |
object-fit: cover;
|
| 456 |
-
|
| 457 |
}
|
|
|
|
| 458 |
.glass-card button {
|
| 459 |
-
margin-top:
|
| 460 |
-
padding:
|
| 461 |
-
background: ${inputs.
|
| 462 |
-
color: #fff; /* Assuming white text
|
| 463 |
border: none;
|
| 464 |
-
border-radius:
|
|
|
|
| 465 |
cursor: pointer;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 466 |
}
|
| 467 |
</style>
|
| 468 |
|
| 469 |
<div class="glass-card">
|
| 470 |
-
<img src="
|
| 471 |
<h3>${inputs.title.value}</h3>
|
| 472 |
<p>${inputs.desc.value}</p>
|
| 473 |
-
<button>
|
| 474 |
</div>
|
| 475 |
-
|
| 476 |
-
|
| 477 |
-
|
| 478 |
-
|
| 479 |
-
|
| 480 |
-
|
| 481 |
-
|
| 482 |
-
|
| 483 |
-
|
| 484 |
-
|
| 485 |
-
|
| 486 |
-
|
| 487 |
-
|
| 488 |
-
|
| 489 |
-
|
| 490 |
-
|
| 491 |
-
|
| 492 |
-
|
| 493 |
-
|
| 494 |
-
|
| 495 |
-
|
| 496 |
-
|
| 497 |
-
|
| 498 |
-
|
|
|
|
| 499 |
</body>
|
|
|
|
| 500 |
</html>
|
|
|
|
| 1 |
<!DOCTYPE html>
|
| 2 |
<html lang="fa" dir="rtl">
|
| 3 |
+
|
| 4 |
<head>
|
| 5 |
+
<meta charset="UTF-8">
|
| 6 |
+
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
| 7 |
+
<title>بساز | UI Builder حرفهای</title>
|
| 8 |
+
|
| 9 |
+
<!-- Fonts & Icons -->
|
| 10 |
+
<link href="https://fonts.googleapis.com/css2?family=Vazirmatn:wght@100..900&display=swap" rel="stylesheet">
|
| 11 |
+
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.0/css/all.min.css">
|
| 12 |
+
|
| 13 |
+
<style>
|
| 14 |
+
/*
|
| 15 |
+
---------------------------------------------------------
|
| 16 |
+
Core Variables & Reset
|
| 17 |
+
---------------------------------------------------------
|
| 18 |
+
*/
|
| 19 |
+
:root {
|
| 20 |
+
/* App Theme Colors */
|
| 21 |
+
--app-bg: #0f172a;
|
| 22 |
+
--panel-bg: #1e293b;
|
| 23 |
+
--panel-border: #334155;
|
| 24 |
+
--text-main: #f8fafc;
|
| 25 |
+
--text-muted: #94a3b8;
|
| 26 |
+
--accent: #38bdf8;
|
| 27 |
+
--accent-hover: #0ea5e9;
|
| 28 |
+
--danger: #ef4444;
|
| 29 |
+
|
| 30 |
+
/* Card Defaults */
|
| 31 |
+
--card-bg: rgba(255, 255, 255, 0.05);
|
| 32 |
+
--card-border: rgba(255, 255, 255, 0.1);
|
| 33 |
+
--card-blur: 12px;
|
| 34 |
+
--card-radius: 24px;
|
| 35 |
+
--card-padding: 32px;
|
| 36 |
+
--card-width: 340px;
|
| 37 |
+
--card-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.3);
|
| 38 |
+
--card-text: #ffffff;
|
| 39 |
+
--card-img-radius: 50%;
|
| 40 |
+
|
| 41 |
+
/* Button Defaults */
|
| 42 |
+
--btn-bg: #38bdf8;
|
| 43 |
+
--btn-text: #0f172a;
|
| 44 |
+
--btn-radius: 50px;
|
| 45 |
+
--btn-padding: 12px 24px;
|
| 46 |
+
|
| 47 |
+
/* Font */
|
| 48 |
+
--font-main: 'Vazirmatn', sans-serif;
|
| 49 |
+
}
|
| 50 |
+
|
| 51 |
+
* {
|
| 52 |
+
box-sizing: border-box;
|
| 53 |
+
margin: 0;
|
| 54 |
+
padding: 0;
|
| 55 |
+
}
|
| 56 |
+
|
| 57 |
+
body {
|
| 58 |
+
font-family: var(--font-main);
|
| 59 |
+
background-color: var(--app-bg);
|
| 60 |
+
color: var(--text-main);
|
| 61 |
+
height: 100vh;
|
| 62 |
+
overflow: hidden;
|
| 63 |
+
display: flex;
|
| 64 |
+
flex-direction: column;
|
| 65 |
+
}
|
| 66 |
+
|
| 67 |
+
/*
|
| 68 |
+
---------------------------------------------------------
|
| 69 |
+
Background & Effects
|
| 70 |
+
---------------------------------------------------------
|
| 71 |
+
*/
|
| 72 |
+
.bg-mesh {
|
| 73 |
+
position: absolute;
|
| 74 |
+
top: 0;
|
| 75 |
+
left: 0;
|
| 76 |
+
width: 100%;
|
| 77 |
+
height: 100%;
|
| 78 |
+
z-index: -1;
|
| 79 |
+
overflow: hidden;
|
| 80 |
+
background: radial-gradient(circle at 15% 50%, rgba(56, 189, 248, 0.15), transparent 25%),
|
| 81 |
+
radial-gradient(circle at 85% 30%, rgba(139, 92, 246, 0.15), transparent 25%);
|
| 82 |
+
}
|
| 83 |
+
|
| 84 |
+
.orb {
|
| 85 |
+
position: absolute;
|
| 86 |
+
border-radius: 50%;
|
| 87 |
+
filter: blur(80px);
|
| 88 |
+
opacity: 0.4;
|
| 89 |
+
animation: float 10s infinite ease-in-out alternate;
|
| 90 |
+
}
|
| 91 |
+
|
| 92 |
+
.orb-1 { width: 300px; height: 300px; background: #38bdf8; top: -50px; left: -50px; }
|
| 93 |
+
.orb-2 { width: 400px; height: 400px; background: #818cf8; bottom: -100px; right: -100px; animation-delay: -5s; }
|
| 94 |
+
|
| 95 |
+
@keyframes float {
|
| 96 |
+
0% { transform: translate(0, 0); }
|
| 97 |
+
100% { transform: translate(30px, 50px); }
|
| 98 |
+
}
|
| 99 |
+
|
| 100 |
+
/*
|
| 101 |
+
---------------------------------------------------------
|
| 102 |
+
Header
|
| 103 |
+
---------------------------------------------------------
|
| 104 |
+
*/
|
| 105 |
+
header {
|
| 106 |
+
height: 70px;
|
| 107 |
+
border-bottom: 1px solid var(--panel-border);
|
| 108 |
+
display: flex;
|
| 109 |
+
align-items: center;
|
| 110 |
+
justify-content: space-between;
|
| 111 |
+
padding: 0 30px;
|
| 112 |
+
background: rgba(15, 23, 42, 0.7);
|
| 113 |
+
backdrop-filter: blur(12px);
|
| 114 |
+
z-index: 100;
|
| 115 |
+
}
|
| 116 |
+
|
| 117 |
+
.brand {
|
| 118 |
+
display: flex;
|
| 119 |
+
align-items: center;
|
| 120 |
+
gap: 12px;
|
| 121 |
+
font-size: 1.6rem;
|
| 122 |
+
font-weight: 900;
|
| 123 |
+
background: linear-gradient(135deg, #fff, #94a3b8);
|
| 124 |
+
-webkit-background-clip: text;
|
| 125 |
+
-webkit-text-fill-color: transparent;
|
| 126 |
+
}
|
| 127 |
|
| 128 |
+
.brand i { -webkit-text-fill-color: var(--accent); }
|
| 129 |
+
|
| 130 |
+
.header-actions {
|
| 131 |
+
display: flex;
|
| 132 |
+
gap: 15px;
|
| 133 |
+
}
|
| 134 |
+
|
| 135 |
+
.anycoder-link {
|
| 136 |
+
text-decoration: none;
|
| 137 |
+
color: var(--text-muted);
|
| 138 |
+
font-size: 0.9rem;
|
| 139 |
+
display: flex;
|
| 140 |
+
align-items: center;
|
| 141 |
+
gap: 8px;
|
| 142 |
+
transition: 0.3s;
|
| 143 |
+
padding: 8px 16px;
|
| 144 |
+
border-radius: 12px;
|
| 145 |
+
background: rgba(255,255,255,0.05);
|
| 146 |
+
}
|
| 147 |
+
|
| 148 |
+
.anycoder-link:hover {
|
| 149 |
+
color: var(--accent);
|
| 150 |
+
background: rgba(255,255,255,0.1);
|
| 151 |
+
}
|
| 152 |
+
|
| 153 |
+
/*
|
| 154 |
+
---------------------------------------------------------
|
| 155 |
+
Main Layout
|
| 156 |
+
---------------------------------------------------------
|
| 157 |
+
*/
|
| 158 |
+
main {
|
| 159 |
+
display: flex;
|
| 160 |
+
flex: 1;
|
| 161 |
+
height: calc(100vh - 70px);
|
| 162 |
+
overflow: hidden;
|
| 163 |
+
}
|
| 164 |
+
|
| 165 |
+
/*
|
| 166 |
+
---------------------------------------------------------
|
| 167 |
+
Sidebar (Controls)
|
| 168 |
+
---------------------------------------------------------
|
| 169 |
+
*/
|
| 170 |
+
aside {
|
| 171 |
+
width: 380px;
|
| 172 |
+
background: var(--panel-bg);
|
| 173 |
+
border-left: 1px solid var(--panel-border);
|
| 174 |
+
display: flex;
|
| 175 |
+
flex-direction: column;
|
| 176 |
+
overflow: hidden;
|
| 177 |
+
box-shadow: -10px 0 30px rgba(0,0,0,0.2);
|
| 178 |
+
z-index: 10;
|
| 179 |
+
}
|
| 180 |
+
|
| 181 |
+
.sidebar-header {
|
| 182 |
+
padding: 20px;
|
| 183 |
+
border-bottom: 1px solid var(--panel-border);
|
| 184 |
+
font-weight: bold;
|
| 185 |
+
color: var(--accent);
|
| 186 |
+
display: flex;
|
| 187 |
+
justify-content: space-between;
|
| 188 |
+
align-items: center;
|
| 189 |
+
}
|
| 190 |
+
|
| 191 |
+
.scroll-area {
|
| 192 |
+
flex: 1;
|
| 193 |
+
overflow-y: auto;
|
| 194 |
+
padding: 20px;
|
| 195 |
+
display: flex;
|
| 196 |
+
flex-direction: column;
|
| 197 |
+
gap: 25px;
|
| 198 |
+
}
|
| 199 |
+
|
| 200 |
+
/* Custom Scrollbar */
|
| 201 |
+
.scroll-area::-webkit-scrollbar { width: 6px; }
|
| 202 |
+
.scroll-area::-webkit-scrollbar-track { background: transparent; }
|
| 203 |
+
.scroll-area::-webkit-scrollbar-thumb { background: var(--panel-border); border-radius: 10px; }
|
| 204 |
+
.scroll-area::-webkit-scrollbar-thumb:hover { background: var(--text-muted); }
|
| 205 |
+
|
| 206 |
+
.control-section h3 {
|
| 207 |
+
font-size: 0.85rem;
|
| 208 |
+
text-transform: uppercase;
|
| 209 |
+
letter-spacing: 1px;
|
| 210 |
+
color: var(--text-muted);
|
| 211 |
+
margin-bottom: 15px;
|
| 212 |
+
display: flex;
|
| 213 |
+
align-items: center;
|
| 214 |
+
gap: 8px;
|
| 215 |
+
}
|
| 216 |
+
|
| 217 |
+
.input-group {
|
| 218 |
+
margin-bottom: 18px;
|
| 219 |
+
}
|
| 220 |
+
|
| 221 |
+
.input-row {
|
| 222 |
+
display: flex;
|
| 223 |
+
align-items: center;
|
| 224 |
+
justify-content: space-between;
|
| 225 |
+
margin-bottom: 8px;
|
| 226 |
+
}
|
| 227 |
+
|
| 228 |
+
label {
|
| 229 |
+
font-size: 0.9rem;
|
| 230 |
+
color: var(--text-main);
|
| 231 |
+
}
|
| 232 |
+
|
| 233 |
+
.value-display {
|
| 234 |
+
font-size: 0.8rem;
|
| 235 |
+
color: var(--text-muted);
|
| 236 |
+
font-family: monospace;
|
| 237 |
+
background: rgba(0,0,0,0.2);
|
| 238 |
+
padding: 2px 6px;
|
| 239 |
+
border-radius: 4px;
|
| 240 |
+
}
|
| 241 |
+
|
| 242 |
+
/* Modern Inputs */
|
| 243 |
+
input[type="text"],
|
| 244 |
+
textarea,
|
| 245 |
+
input[type="url"] {
|
| 246 |
+
width: 100%;
|
| 247 |
+
background: rgba(15, 23, 42, 0.6);
|
| 248 |
+
border: 1px solid var(--panel-border);
|
| 249 |
+
color: white;
|
| 250 |
+
padding: 10px 12px;
|
| 251 |
+
border-radius: 8px;
|
| 252 |
+
font-family: inherit;
|
| 253 |
+
font-size: 0.95rem;
|
| 254 |
+
transition: 0.2s;
|
| 255 |
+
}
|
| 256 |
+
|
| 257 |
+
input[type="text"]:focus,
|
| 258 |
+
textarea:focus,
|
| 259 |
+
input[type="url"]:focus {
|
| 260 |
+
border-color: var(--accent);
|
| 261 |
+
box-shadow: 0 0 0 2px rgba(56, 189, 248, 0.2);
|
| 262 |
+
}
|
| 263 |
+
|
| 264 |
+
textarea { resize: vertical; min-height: 80px; }
|
| 265 |
+
|
| 266 |
+
input[type="color"] {
|
| 267 |
+
-webkit-appearance: none;
|
| 268 |
+
border: none;
|
| 269 |
+
width: 32px;
|
| 270 |
+
height: 32px;
|
| 271 |
+
border-radius: 8px;
|
| 272 |
+
cursor: pointer;
|
| 273 |
+
background: none;
|
| 274 |
+
padding: 0;
|
| 275 |
+
}
|
| 276 |
+
input[type="color"]::-webkit-color-swatch-wrapper { padding: 0; }
|
| 277 |
+
input[type="color"]::-webkit-color-swatch { border: 1px solid var(--panel-border); border-radius: 8px; }
|
| 278 |
+
|
| 279 |
+
input[type="range"] {
|
| 280 |
+
width: 100%;
|
| 281 |
+
height: 6px;
|
| 282 |
+
background: rgba(255,255,255,0.1);
|
| 283 |
+
border-radius: 5px;
|
| 284 |
+
outline: none;
|
| 285 |
+
-webkit-appearance: none;
|
| 286 |
+
}
|
| 287 |
+
|
| 288 |
+
input[type="range"]::-webkit-slider-thumb {
|
| 289 |
+
-webkit-appearance: none;
|
| 290 |
+
width: 18px;
|
| 291 |
+
height: 18px;
|
| 292 |
+
border-radius: 50%;
|
| 293 |
+
background: var(--accent);
|
| 294 |
+
cursor: pointer;
|
| 295 |
+
transition: 0.2s;
|
| 296 |
+
}
|
| 297 |
+
input[type="range"]::-webkit-slider-thumb:hover { transform: scale(1.2); }
|
| 298 |
+
|
| 299 |
+
/*
|
| 300 |
+
---------------------------------------------------------
|
| 301 |
+
Preview Area
|
| 302 |
+
---------------------------------------------------------
|
| 303 |
+
*/
|
| 304 |
+
.preview-stage {
|
| 305 |
+
flex: 1;
|
| 306 |
+
display: flex;
|
| 307 |
+
align-items: center;
|
| 308 |
+
justify-content: center;
|
| 309 |
+
position: relative;
|
| 310 |
+
perspective: 1000px;
|
| 311 |
+
overflow: hidden;
|
| 312 |
+
/* Optional: Checkerboard for transparency check */
|
| 313 |
+
background-image:
|
| 314 |
+
linear-gradient(45deg, rgba(255,255,255,0.03) 25%, transparent 25%),
|
| 315 |
+
linear-gradient(-45deg, rgba(255,255,255,0.03) 25%, transparent 25%),
|
| 316 |
+
linear-gradient(45deg, transparent 75%, rgba(255,255,255,0.03) 75%),
|
| 317 |
+
linear-gradient(-45deg, transparent 75%, rgba(255,255,255,0.03) 75%);
|
| 318 |
+
background-size: 20px 20px;
|
| 319 |
+
}
|
| 320 |
+
|
| 321 |
+
/* Floating Elements for Depth */
|
| 322 |
+
.floating-shape {
|
| 323 |
+
position: absolute;
|
| 324 |
+
border-radius: 50%;
|
| 325 |
+
background: rgba(255,255,255,0.1);
|
| 326 |
+
z-index: 0;
|
| 327 |
+
}
|
| 328 |
+
.shape-1 { width: 200px; height: 200px; top: 20%; left: 20%; background: rgba(56, 189, 248, 0.2); filter: blur(40px); animation: float 8s infinite ease-in-out; }
|
| 329 |
+
.shape-2 { width: 150px; height: 150px; bottom: 30%; right: 20%; background: rgba(139, 92, 246, 0.2); filter: blur(40px); animation: float 12s infinite ease-in-out reverse; }
|
| 330 |
+
|
| 331 |
+
/* The Card */
|
| 332 |
+
#glass-card {
|
| 333 |
+
background: var(--card-bg);
|
| 334 |
+
backdrop-filter: blur(var(--card-blur));
|
| 335 |
+
-webkit-backdrop-filter: blur(var(--card-blur));
|
| 336 |
+
border: 1px solid var(--card-border);
|
| 337 |
+
border-radius: var(--card-radius);
|
| 338 |
+
padding: var(--card-padding);
|
| 339 |
+
width: var(--card-width);
|
| 340 |
+
max-width: 90%;
|
| 341 |
+
color: var(--card-text);
|
| 342 |
+
box-shadow: var(--card-shadow);
|
| 343 |
+
display: flex;
|
| 344 |
+
flex-direction: column;
|
| 345 |
+
align-items: center;
|
| 346 |
+
text-align: center;
|
| 347 |
+
gap: 16px;
|
| 348 |
+
position: relative;
|
| 349 |
+
z-index: 1;
|
| 350 |
+
transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
|
| 351 |
+
}
|
| 352 |
+
|
| 353 |
+
#glass-card img {
|
| 354 |
+
width: 100px;
|
| 355 |
+
height: 100px;
|
| 356 |
+
border-radius: var(--card-img-radius);
|
| 357 |
+
object-fit: cover;
|
| 358 |
+
border: 2px solid rgba(255,255,255,0.2);
|
| 359 |
+
transition: 0.3s;
|
| 360 |
+
}
|
| 361 |
+
|
| 362 |
+
#glass-card h3 { font-size: 1.5rem; margin: 0; font-weight: 700; }
|
| 363 |
+
#glass-card p { font-size: 0.95rem; line-height: 1.6; opacity: 0.9; margin: 0; }
|
| 364 |
+
#glass-card button {
|
| 365 |
+
margin-top: 10px;
|
| 366 |
+
background: var(--btn-bg);
|
| 367 |
+
color: var(--btn-text);
|
| 368 |
+
border: none;
|
| 369 |
+
padding: var(--btn-padding);
|
| 370 |
+
border-radius: var(--btn-radius);
|
| 371 |
+
font-weight: bold;
|
| 372 |
+
font-family: inherit;
|
| 373 |
+
cursor: pointer;
|
| 374 |
+
transition: 0.2s;
|
| 375 |
+
box-shadow: 0 4px 15px rgba(0,0,0,0.2);
|
| 376 |
+
}
|
| 377 |
+
#glass-card button:hover {
|
| 378 |
+
transform: translateY(-2px);
|
| 379 |
+
filter: brightness(1.1);
|
| 380 |
+
box-shadow: 0 6px 20px rgba(0,0,0,0.3);
|
| 381 |
+
}
|
| 382 |
+
|
| 383 |
+
/*
|
| 384 |
+
---------------------------------------------------------
|
| 385 |
+
Code Panel (Bottom of Sidebar)
|
| 386 |
+
---------------------------------------------------------
|
| 387 |
+
*/
|
| 388 |
+
.code-panel {
|
| 389 |
+
background: #0f172a;
|
| 390 |
+
border-top: 1px solid var(--panel-border);
|
| 391 |
+
padding: 15px;
|
| 392 |
+
display: flex;
|
| 393 |
+
flex-direction: column;
|
| 394 |
+
gap: 10px;
|
| 395 |
+
}
|
| 396 |
+
|
| 397 |
+
.code-header {
|
| 398 |
+
display: flex;
|
| 399 |
+
justify-content: space-between;
|
| 400 |
+
align-items: center;
|
| 401 |
+
}
|
| 402 |
+
|
| 403 |
+
.code-output {
|
| 404 |
+
width: 100%;
|
| 405 |
+
height: 120px;
|
| 406 |
+
background: rgba(0,0,0,0.3);
|
| 407 |
+
border: 1px solid var(--panel-border);
|
| 408 |
+
border-radius: 8px;
|
| 409 |
+
color: #a5b4fc;
|
| 410 |
+
font-family: monospace;
|
| 411 |
+
font-size: 0.8rem;
|
| 412 |
+
padding: 10px;
|
| 413 |
+
resize: none;
|
| 414 |
+
}
|
| 415 |
+
|
| 416 |
+
.btn-copy {
|
| 417 |
+
width: 100%;
|
| 418 |
+
padding: 12px;
|
| 419 |
+
background: var(--accent);
|
| 420 |
+
color: #0f172a;
|
| 421 |
+
border: none;
|
| 422 |
+
border-radius: 8px;
|
| 423 |
+
font-weight: bold;
|
| 424 |
+
cursor: pointer;
|
| 425 |
+
display: flex;
|
| 426 |
+
align-items: center;
|
| 427 |
+
justify-content: center;
|
| 428 |
+
gap: 8px;
|
| 429 |
+
transition: 0.2s;
|
| 430 |
+
}
|
| 431 |
+
|
| 432 |
+
.btn-copy:hover { background: var(--accent-hover); }
|
| 433 |
+
|
| 434 |
+
.toast {
|
| 435 |
+
position: fixed;
|
| 436 |
+
bottom: 20px;
|
| 437 |
+
left: 50%;
|
| 438 |
+
transform: translateX(-50%) translateY(100px);
|
| 439 |
+
background: var(--accent);
|
| 440 |
+
color: #0f172a;
|
| 441 |
+
padding: 10px 20px;
|
| 442 |
+
border-radius: 30px;
|
| 443 |
+
font-weight: bold;
|
| 444 |
+
box-shadow: 0 10px 30px rgba(0,0,0,0.5);
|
| 445 |
+
transition: transform 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
|
| 446 |
+
z-index: 1000;
|
| 447 |
+
display: flex;
|
| 448 |
+
align-items: center;
|
| 449 |
+
gap: 8px;
|
| 450 |
+
}
|
| 451 |
+
|
| 452 |
+
.toast.show { transform: translateX(-50%) translateY(0); }
|
| 453 |
+
|
| 454 |
+
/*
|
| 455 |
+
---------------------------------------------------------
|
| 456 |
+
Responsive Design
|
| 457 |
+
---------------------------------------------------------
|
| 458 |
+
*/
|
| 459 |
+
@media (max-width: 900px) {
|
| 460 |
+
body { overflow: auto; height: auto; }
|
| 461 |
+
main { flex-direction: column; height: auto; }
|
| 462 |
+
|
| 463 |
+
aside {
|
| 464 |
+
width: 100%;
|
| 465 |
+
height: auto;
|
| 466 |
+
border-left: none;
|
| 467 |
+
border-bottom: 1px solid var(--panel-border);
|
| 468 |
+
}
|
| 469 |
+
|
| 470 |
+
.preview-stage {
|
| 471 |
+
min-height: 500px;
|
| 472 |
+
padding: 40px 20px;
|
| 473 |
+
}
|
| 474 |
+
|
| 475 |
+
.scroll-area {
|
| 476 |
+
max-height: 400px; /* Limit height on mobile sidebar */
|
| 477 |
+
}
|
| 478 |
+
}
|
| 479 |
+
</style>
|
| 480 |
</head>
|
|
|
|
| 481 |
|
| 482 |
+
<body>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 483 |
|
| 484 |
+
<!-- Background Animation -->
|
| 485 |
+
<div class="bg-mesh">
|
| 486 |
+
<div class="orb orb-1"></div>
|
| 487 |
+
<div class="orb orb-2"></div>
|
| 488 |
+
</div>
|
| 489 |
+
|
| 490 |
+
<header>
|
| 491 |
+
<div class="brand">
|
| 492 |
+
<i class="fa-solid fa-layer-group"></i>
|
| 493 |
+
بساز
|
| 494 |
+
</div>
|
| 495 |
+
<div class="header-actions">
|
| 496 |
+
<a href="https://huggingface.co/spaces/akhaliq/anycoder" target="_blank" class="anycoder-link">
|
| 497 |
+
<span>Built with Anycoder</span>
|
| 498 |
+
<i class="fa-solid fa-code"></i>
|
| 499 |
+
</a>
|
| 500 |
+
</div>
|
| 501 |
+
</header>
|
| 502 |
+
|
| 503 |
+
<main>
|
| 504 |
+
<!-- Sidebar Controls -->
|
| 505 |
+
<aside>
|
| 506 |
+
<div class="sidebar-header">
|
| 507 |
+
<span>تنظیمات ظاهری</span>
|
| 508 |
+
<i class="fa-solid fa-sliders"></i>
|
| 509 |
+
</div>
|
| 510 |
+
|
| 511 |
+
<div class="scroll-area">
|
| 512 |
+
|
| 513 |
+
<!-- Section 1: Content -->
|
| 514 |
+
<div class="control-section">
|
| 515 |
+
<h3><i class="fa-solid fa-pen-to-square"></i> محتوا</h3>
|
| 516 |
+
|
| 517 |
+
<div class="input-group">
|
| 518 |
+
<label>تصویر پروفایل (URL)</label>
|
| 519 |
+
<input type="url" id="inp-img" value="https://images.unsplash.com/photo-1535713875002-d1d0cf377fde?auto=format&fit=crop&w=500&q=80" placeholder="لینک عکس...">
|
| 520 |
+
</div>
|
| 521 |
+
|
| 522 |
+
<div class="input-group">
|
| 523 |
+
<label>عنوان</label>
|
| 524 |
+
<input type="text" id="inp-title" value="عنوان دلخواه شما">
|
| 525 |
+
</div>
|
| 526 |
+
|
| 527 |
+
<div class="input-group">
|
| 528 |
+
<label>توضیحات</label>
|
| 529 |
+
<textarea id="inp-desc">این یک متن نمونه برای کارت گلسمورفیسم است. میتوانید این متن را به راحتی ویرایش کنید.</textarea>
|
| 530 |
+
</div>
|
| 531 |
+
|
| 532 |
+
<div class="input-group">
|
| 533 |
+
<label>متن دکمه</label>
|
| 534 |
+
<input type="text" id="inp-btn-text" value="شروع کنید">
|
| 535 |
+
</div>
|
| 536 |
+
</div>
|
| 537 |
+
|
| 538 |
+
<!-- Section 2: Glass Effect -->
|
| 539 |
+
<div class="control-section">
|
| 540 |
+
<h3><i class="fa-solid fa-wand-magic-sparkles"></i> افکت شیشهای</h3>
|
| 541 |
+
|
| 542 |
+
<div class="input-group">
|
| 543 |
+
<div class="input-row">
|
| 544 |
+
<label>رنگ پسزمینه</label>
|
| 545 |
+
<input type="color" id="inp-color-bg" value="#ffffff">
|
| 546 |
</div>
|
| 547 |
+
<input type="range" id="inp-opacity" min="0" max="1" step="0.05" value="0.1">
|
| 548 |
+
</div>
|
| 549 |
|
| 550 |
+
<div class="input-group">
|
| 551 |
+
<div class="input-row">
|
| 552 |
+
<label>رنگ حاشیه</label>
|
| 553 |
+
<input type="color" id="inp-color-border" value="#ffffff">
|
| 554 |
</div>
|
| 555 |
+
<input type="range" id="inp-border-opacity" min="0" max="1" step="0.05" value="0.2">
|
| 556 |
+
</div>
|
| 557 |
|
| 558 |
+
<div class="input-group">
|
| 559 |
+
<div class="input-row">
|
| 560 |
+
<label>تاری پسزمینه (Blur)</label>
|
| 561 |
+
<span class="value-display" id="val-blur">12px</span>
|
| 562 |
</div>
|
| 563 |
+
<input type="range" id="inp-blur" min="0" max="50" value="12">
|
| 564 |
+
</div>
|
| 565 |
+
</div>
|
| 566 |
+
|
| 567 |
+
<!-- Section 3: Shape & Layout -->
|
| 568 |
+
<div class="control-section">
|
| 569 |
+
<h3><i class="fa-solid fa-border-all"></i> ابعاد و شکل</h3>
|
| 570 |
+
|
| 571 |
+
<div class="input-group">
|
| 572 |
+
<div class="input-row">
|
| 573 |
+
<label>شعاع گوشهها</label>
|
| 574 |
+
<span class="value-display" id="val-radius">24px</span>
|
| 575 |
</div>
|
| 576 |
+
<input type="range" id="inp-radius" min="0" max="60" value="24">
|
| 577 |
+
</div>
|
| 578 |
|
| 579 |
+
<div class="input-group">
|
| 580 |
+
<div class="input-row">
|
| 581 |
+
<label>عرض کارت</label>
|
| 582 |
+
<span class="value-display" id="val-width">340px</span>
|
| 583 |
</div>
|
| 584 |
+
<input type="range" id="inp-width" min="200" max="600" value="340">
|
| 585 |
+
</div>
|
| 586 |
+
|
| 587 |
+
<div class="input-group">
|
| 588 |
+
<label>رنگ متن</label>
|
| 589 |
+
<input type="color" id="inp-text-color" value="#ffffff">
|
| 590 |
+
</div>
|
| 591 |
+
</div>
|
| 592 |
+
|
| 593 |
+
<!-- Section 4: Button -->
|
| 594 |
+
<div class="control-section">
|
| 595 |
+
<h3><i class="fa-solid fa-hand-pointer"></i> استایل دکمه</h3>
|
| 596 |
+
|
| 597 |
+
<div class="input-group">
|
| 598 |
+
<label>رنگ دکمه</label>
|
| 599 |
+
<input type="color" id="inp-btn-bg" value="#38bdf8">
|
| 600 |
+
</div>
|
| 601 |
+
|
| 602 |
+
<div class="input-group">
|
| 603 |
+
<div class="input-row">
|
| 604 |
+
<label>شعاع دکمه</label>
|
| 605 |
+
<span class="value-display" id="val-btn-radius">50px</span>
|
| 606 |
</div>
|
| 607 |
+
<input type="range" id="inp-btn-radius" min="0" max="50" value="50">
|
| 608 |
+
</div>
|
| 609 |
+
</div>
|
| 610 |
+
|
| 611 |
+
</div>
|
| 612 |
+
|
| 613 |
+
<!-- Code Output -->
|
| 614 |
+
<div class="code-panel">
|
| 615 |
+
<div class="code-header">
|
| 616 |
+
<label>کد خروجی HTML & CSS</label>
|
| 617 |
+
<i class="fa-solid fa-code" style="color: var(--text-muted)"></i>
|
| 618 |
+
</div>
|
| 619 |
+
<textarea id="code-output" class="code-output" readonly></textarea>
|
| 620 |
+
<button class="btn-copy" onclick="copyCode()">
|
| 621 |
+
<i class="fa-regular fa-copy"></i> کپی کد
|
| 622 |
+
</button>
|
| 623 |
+
</div>
|
| 624 |
+
</aside>
|
| 625 |
+
|
| 626 |
+
<!-- Live Preview -->
|
| 627 |
+
<section class="preview-stage">
|
| 628 |
+
<!-- Decorative Background Shapes -->
|
| 629 |
+
<div class="floating-shape shape-1"></div>
|
| 630 |
+
<div class="floating-shape shape-2"></div>
|
| 631 |
+
|
| 632 |
+
<!-- The Card -->
|
| 633 |
+
<div id="glass-card">
|
| 634 |
+
<img src="https://images.unsplash.com/photo-1535713875002-d1d0cf377fde?auto=format&fit=crop&w=500&q=80" id="card-img" alt="Profile">
|
| 635 |
+
<h3 id="card-title">عنوان دلخواه شما</h3>
|
| 636 |
+
<p id="card-desc">این یک متن نمونه برای کارت گلسمورفیسم است. میتوانید این متن را به راحتی ویرایش کنید.</p>
|
| 637 |
+
<button id="card-btn">شروع کنید</button>
|
| 638 |
+
</div>
|
| 639 |
+
</section>
|
| 640 |
+
</main>
|
| 641 |
+
|
| 642 |
+
<!-- Toast Notification -->
|
| 643 |
+
<div id="toast" class="toast">
|
| 644 |
+
<i class="fa-solid fa-check-circle"></i>
|
| 645 |
+
کد با موفقیت کپی شد!
|
| 646 |
+
</div>
|
| 647 |
+
|
| 648 |
+
<script>
|
| 649 |
+
// --- Configuration & Selectors ---
|
| 650 |
+
const inputs = {
|
| 651 |
+
title: document.getElementById('inp-title'),
|
| 652 |
+
desc: document.getElementById('inp-desc'),
|
| 653 |
+
img: document.getElementById('inp-img'),
|
| 654 |
+
btnText: document.getElementById('inp-btn-text'),
|
| 655 |
+
|
| 656 |
+
// Colors
|
| 657 |
+
bgColor: document.getElementById('inp-color-bg'),
|
| 658 |
+
bgOpacity: document.getElementById('inp-opacity'),
|
| 659 |
+
borderColor: document.getElementById('inp-color-border'),
|
| 660 |
+
borderOpacity: document.getElementById('inp-border-opacity'),
|
| 661 |
+
textColor: document.getElementById('inp-text-color'),
|
| 662 |
+
btnBg: document.getElementById('inp-btn-bg'),
|
| 663 |
+
|
| 664 |
+
// Sliders
|
| 665 |
+
blur: document.getElementById('inp-blur'),
|
| 666 |
+
radius: document.getElementById('inp-radius'),
|
| 667 |
+
width: document.getElementById('inp-width'),
|
| 668 |
+
btnRadius: document.getElementById('inp-btn-radius'),
|
| 669 |
+
};
|
| 670 |
+
|
| 671 |
+
const card = {
|
| 672 |
+
root: document.getElementById('glass-card'),
|
| 673 |
+
img: document.getElementById('card-img'),
|
| 674 |
+
title: document.getElementById('card-title'),
|
| 675 |
+
desc: document.getElementById('card-desc'),
|
| 676 |
+
btn: document.getElementById('card-btn')
|
| 677 |
+
};
|
| 678 |
+
|
| 679 |
+
const displays = {
|
| 680 |
+
blur: document.getElementById('val-blur'),
|
| 681 |
+
radius: document.getElementById('val-radius'),
|
| 682 |
+
width: document.getElementById('val-width'),
|
| 683 |
+
btnRadius: document.getElementById('val-btn-radius'),
|
| 684 |
+
};
|
| 685 |
+
|
| 686 |
+
const codeOutput = document.getElementById('code-output');
|
| 687 |
+
const toast = document.getElementById('toast');
|
| 688 |
+
|
| 689 |
+
// --- Helper Functions ---
|
| 690 |
+
|
| 691 |
+
// Convert Hex to RGBA
|
| 692 |
+
function hexToRgba(hex, opacity) {
|
| 693 |
+
let r = 0, g = 0, b = 0;
|
| 694 |
+
// 3 digits
|
| 695 |
+
if (hex.length === 4) {
|
| 696 |
+
r = "0x" + hex[1] + hex[1];
|
| 697 |
+
g = "0x" + hex[2] + hex[2];
|
| 698 |
+
b = "0x" + hex[3] + hex[3];
|
| 699 |
+
} else if (hex.length === 7) {
|
| 700 |
+
// 6 digits
|
| 701 |
+
r = "0x" + hex[1] + hex[2];
|
| 702 |
+
g = "0x" + hex[3] + hex[4];
|
| 703 |
+
b = "0x" + hex[5] + hex[6];
|
| 704 |
+
}
|
| 705 |
+
return `rgba(${+r}, ${+g}, ${+b}, ${opacity})`;
|
| 706 |
+
}
|
| 707 |
+
|
| 708 |
+
// --- Core Logic ---
|
| 709 |
+
|
| 710 |
+
function updateUI() {
|
| 711 |
+
// 1. Content
|
| 712 |
+
card.title.textContent = inputs.title.value;
|
| 713 |
+
card.desc.textContent = inputs.desc.value;
|
| 714 |
+
card.btn.textContent = inputs.btnText.value;
|
| 715 |
+
card.img.src = inputs.img.value;
|
| 716 |
+
|
| 717 |
+
// 2. Calculate Colors
|
| 718 |
+
const bgStyle = hexToRgba(inputs.bgColor.value, inputs.bgOpacity.value);
|
| 719 |
+
const borderStyle = hexToRgba(inputs.borderColor.value, inputs.borderOpacity.value);
|
| 720 |
+
|
| 721 |
+
// 3. Apply Styles to Card
|
| 722 |
+
card.root.style.setProperty('--card-bg', bgStyle);
|
| 723 |
+
card.root.style.setProperty('--card-border', borderStyle);
|
| 724 |
+
card.root.style.setProperty('--card-blur', `${inputs.blur.value}px`);
|
| 725 |
+
card.root.style.setProperty('--card-radius', `${inputs.radius.value}px`);
|
| 726 |
+
card.root.style.setProperty('--card-width', `${inputs.width.value}px`);
|
| 727 |
+
card.root.style.setProperty('--card-text', inputs.textColor.value);
|
| 728 |
+
card.root.style.setProperty('--btn-bg', inputs.btnBg.value);
|
| 729 |
+
card.root.style.setProperty('--btn-radius', `${inputs.btnRadius.value}px`);
|
| 730 |
+
|
| 731 |
+
// 4. Update Text Displays
|
| 732 |
+
displays.blur.textContent = `${inputs.blur.value}px`;
|
| 733 |
+
displays.radius.textContent = `${inputs.radius.value}px`;
|
| 734 |
+
displays.width.textContent = `${inputs.width.value}px`;
|
| 735 |
+
displays.btnRadius.textContent = `${inputs.btnRadius.value}px`;
|
| 736 |
+
|
| 737 |
+
// 5. Generate Code
|
| 738 |
+
generateCode(bgStyle, borderStyle);
|
| 739 |
+
}
|
| 740 |
+
|
| 741 |
+
function generateCode(bgStyle, borderStyle) {
|
| 742 |
+
const code = `
|
| 743 |
<!-- Glassmorphism Card -->
|
| 744 |
<style>
|
| 745 |
.glass-card {
|
| 746 |
+
/* Dimensions */
|
| 747 |
+
width: ${inputs.width.value}px;
|
| 748 |
+
max-width: 100%;
|
| 749 |
+
padding: 32px;
|
| 750 |
+
border-radius: ${inputs.radius.value}px;
|
| 751 |
+
|
| 752 |
+
/* Glass Effect */
|
| 753 |
+
background: ${bgStyle};
|
| 754 |
backdrop-filter: blur(${inputs.blur.value}px);
|
| 755 |
-webkit-backdrop-filter: blur(${inputs.blur.value}px);
|
| 756 |
+
border: 1px solid ${borderStyle};
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 757 |
box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.37);
|
| 758 |
+
|
| 759 |
+
/* Text */
|
| 760 |
+
color: ${inputs.textColor.value};
|
| 761 |
+
font-family: 'Tahoma', sans-serif; /* Or Vazirmatn */
|
| 762 |
+
text-align: center;
|
| 763 |
+
|
| 764 |
+
/* Layout */
|
| 765 |
+
display: flex;
|
| 766 |
+
flex-direction: column;
|
| 767 |
+
align-items: center;
|
| 768 |
+
gap: 16px;
|
| 769 |
}
|
| 770 |
+
|
| 771 |
.glass-card img {
|
| 772 |
width: 100px;
|
| 773 |
height: 100px;
|
| 774 |
border-radius: 50%;
|
| 775 |
object-fit: cover;
|
| 776 |
+
border: 2px solid rgba(255,255,255,0.2);
|
| 777 |
}
|
| 778 |
+
|
| 779 |
.glass-card button {
|
| 780 |
+
margin-top: 10px;
|
| 781 |
+
padding: 12px 24px;
|
| 782 |
+
background: ${inputs.btnBg.value};
|
| 783 |
+
color: #fff; /* Assuming white text for button, use contrast checker for prod */
|
| 784 |
border: none;
|
| 785 |
+
border-radius: ${inputs.btnRadius.value}px;
|
| 786 |
+
font-weight: bold;
|
| 787 |
cursor: pointer;
|
| 788 |
+
transition: transform 0.2s;
|
| 789 |
+
}
|
| 790 |
+
|
| 791 |
+
.glass-card button:hover {
|
| 792 |
+
transform: scale(1.05);
|
| 793 |
}
|
| 794 |
</style>
|
| 795 |
|
| 796 |
<div class="glass-card">
|
| 797 |
+
<img src="${inputs.img.value}" alt="Profile">
|
| 798 |
<h3>${inputs.title.value}</h3>
|
| 799 |
<p>${inputs.desc.value}</p>
|
| 800 |
+
<button>${inputs.btnText.value}</button>
|
| 801 |
</div>
|
| 802 |
+
`;
|
| 803 |
+
codeOutput.value = code.trim();
|
| 804 |
+
}
|
| 805 |
+
|
| 806 |
+
function copyCode() {
|
| 807 |
+
codeOutput.select();
|
| 808 |
+
document.execCommand('copy');
|
| 809 |
+
|
| 810 |
+
// Show Toast
|
| 811 |
+
toast.classList.add('show');
|
| 812 |
+
setTimeout(() => {
|
| 813 |
+
toast.classList.remove('show');
|
| 814 |
+
}, 2500);
|
| 815 |
+
}
|
| 816 |
+
|
| 817 |
+
// --- Event Listeners ---
|
| 818 |
+
// Attach listener to all inputs
|
| 819 |
+
Object.values(inputs).forEach(input => {
|
| 820 |
+
input.addEventListener('input', updateUI);
|
| 821 |
+
});
|
| 822 |
+
|
| 823 |
+
// Initial Load
|
| 824 |
+
updateUI();
|
| 825 |
+
|
| 826 |
+
</script>
|
| 827 |
</body>
|
| 828 |
+
|
| 829 |
</html>
|