File size: 34,510 Bytes
1dd34bd |
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 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 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 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 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 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 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 641 642 643 644 645 646 647 648 649 650 651 652 653 654 655 656 657 658 659 660 661 662 663 664 665 666 667 668 669 670 671 672 673 674 675 676 677 678 679 680 681 |
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>WebDAW - Browser-Based Digital Audio Workstation</title>
<script src="https://cdn.tailwindcss.com"></script>
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.0/css/all.min.css">
<style>
/* Custom scrollbar */
::-webkit-scrollbar {
width: 8px;
height: 8px;
}
::-webkit-scrollbar-track {
background: #1a202c;
}
::-webkit-scrollbar-thumb {
background: #4a5568;
border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
background: #718096;
}
/* Custom waveform styling */
.waveform {
background: linear-gradient(to bottom, #2d3748, #1a202c);
height: 60px;
border-radius: 4px;
position: relative;
overflow: hidden;
}
/* Piano roll keys */
.piano-key {
border: 1px solid #4a5568;
height: 24px;
position: relative;
}
.piano-key.white {
background-color: #f7fafc;
}
.piano-key.black {
background-color: #1a202c;
height: 16px;
margin: 0 -10px;
z-index: 2;
}
/* Custom knob styling */
.knob {
width: 40px;
height: 40px;
border-radius: 50%;
background: linear-gradient(135deg, #2d3748, #4a5568);
position: relative;
cursor: pointer;
}
.knob::after {
content: '';
position: absolute;
top: 5px;
left: 50%;
width: 4px;
height: 12px;
background: #e2e8f0;
transform-origin: bottom center;
transform: translateX(-50%) rotate(0deg);
border-radius: 2px;
}
/* Custom fader styling */
.fader {
width: 24px;
height: 120px;
background: #2d3748;
border-radius: 4px;
position: relative;
}
.fader-handle {
width: 100%;
height: 8px;
background: #e2e8f0;
border-radius: 2px;
position: absolute;
cursor: pointer;
}
/* Custom transport controls */
.transport-btn {
transition: all 0.2s ease;
}
.transport-btn:hover {
transform: scale(1.1);
}
.transport-btn:active {
transform: scale(0.95);
}
/* Custom clip styling */
.audio-clip {
background: linear-gradient(135deg, #4299e1, #3182ce);
border-left: 2px solid #ebf8ff;
border-right: 2px solid #ebf8ff;
border-radius: 2px;
cursor: pointer;
transition: all 0.2s ease;
}
.audio-clip:hover {
filter: brightness(1.1);
}
.audio-clip.selected {
box-shadow: 0 0 0 2px #ebf8ff;
}
.midi-clip {
background: linear-gradient(135deg, #9f7aea, #805ad5);
border-radius: 2px;
cursor: pointer;
}
/* Custom timeline grid */
.timeline-grid {
background-image:
linear-gradient(to right, #4a5568 1px, transparent 1px),
linear-gradient(to bottom, #4a5568 1px, transparent 1px);
background-size: 20px 20px;
}
/* Custom EQ curve */
.eq-curve {
background: linear-gradient(to bottom, #1a202c, #2d3748);
border-radius: 4px;
position: relative;
overflow: hidden;
}
.eq-line {
position: absolute;
bottom: 0;
left: 0;
width: 100%;
height: 2px;
background: #4299e1;
transform-origin: left center;
}
</style>
</head>
<body class="bg-gray-900 text-gray-200 font-sans overflow-hidden">
<div class="flex flex-col h-screen">
<!-- Top Menu Bar -->
<div class="bg-gray-800 px-4 py-2 flex items-center justify-between border-b border-gray-700">
<div class="flex items-center space-x-4">
<h1 class="text-xl font-bold text-blue-400">WebDAW</h1>
<div class="flex space-x-2">
<button class="px-3 py-1 bg-gray-700 hover:bg-gray-600 rounded text-sm">File</button>
<button class="px-3 py-1 bg-gray-700 hover:bg-gray-600 rounded text-sm">Edit</button>
<button class="px-3 py-1 bg-gray-700 hover:bg-gray-600 rounded text-sm">View</button>
<button class="px-3 py-1 bg-gray-700 hover:bg-gray-600 rounded text-sm">Help</button>
</div>
</div>
<div class="flex items-center space-x-4">
<div class="flex items-center space-x-2">
<span class="text-sm">Tempo:</span>
<input type="number" value="120" class="w-16 px-2 py-1 bg-gray-700 rounded text-sm">
<span class="text-sm">BPM</span>
</div>
<div class="flex items-center space-x-2">
<span class="text-sm">Time Signature:</span>
<select class="bg-gray-700 rounded text-sm px-2 py-1">
<option>4/4</option>
<option>3/4</option>
<option>6/8</option>
</select>
</div>
</div>
</div>
<!-- Main Content Area -->
<div class="flex flex-1 overflow-hidden">
<!-- Left Sidebar - Tracks and Instruments -->
<div class="w-64 bg-gray-800 border-r border-gray-700 flex flex-col">
<div class="p-3 border-b border-gray-700">
<h2 class="font-semibold text-blue-400 mb-2">Tracks</h2>
<div class="space-y-2">
<div class="flex items-center justify-between bg-gray-700 px-3 py-2 rounded cursor-pointer hover:bg-gray-600">
<span>Audio 1</span>
<i class="fas fa-volume-up text-blue-400"></i>
</div>
<div class="flex items-center justify-between bg-gray-700 px-3 py-2 rounded cursor-pointer hover:bg-gray-600">
<span>MIDI 1</span>
<i class="fas fa-music text-purple-400"></i>
</div>
<div class="flex items-center justify-between bg-gray-700 px-3 py-2 rounded cursor-pointer hover:bg-gray-600">
<span>Drum Machine</span>
<i class="fas fa-drum text-green-400"></i>
</div>
<div class="flex items-center justify-between bg-gray-700 px-3 py-2 rounded cursor-pointer hover:bg-gray-600">
<span>Synth 1</span>
<i class="fas fa-wave-square text-yellow-400"></i>
</div>
</div>
<button class="mt-3 w-full py-1 bg-blue-600 hover:bg-blue-500 rounded text-sm">
<i class="fas fa-plus mr-1"></i> Add Track
</button>
</div>
<div class="p-3 border-b border-gray-700 flex-1 overflow-y-auto">
<h2 class="font-semibold text-blue-400 mb-2">Instruments</h2>
<div class="grid grid-cols-2 gap-2">
<div class="bg-gray-700 p-2 rounded cursor-pointer hover:bg-gray-600 text-center">
<i class="fas fa-piano text-2xl mb-1 text-purple-400"></i>
<p class="text-xs">Grand Piano</p>
</div>
<div class="bg-gray-700 p-2 rounded cursor-pointer hover:bg-gray-600 text-center">
<i class="fas fa-guitar text-2xl mb-1 text-red-400"></i>
<p class="text-xs">Electric Guitar</p>
</div>
<div class="bg-gray-700 p-2 rounded cursor-pointer hover:bg-gray-600 text-center">
<i class="fas fa-drum text-2xl mb-1 text-green-400"></i>
<p class="text-xs">Drum Kit</p>
</div>
<div class="bg-gray-700 p-2 rounded cursor-pointer hover:bg-gray-600 text-center">
<i class="fas fa-vial text-2xl mb-1 text-yellow-400"></i>
<p class="text-xs">Synth</p>
</div>
<div class="bg-gray-700 p-2 rounded cursor-pointer hover:bg-gray-600 text-center">
<i class="fas fa-violin text-2xl mb-1 text-indigo-400"></i>
<p class="text-xs">Strings</p>
</div>
<div class="bg-gray-700 p-2 rounded cursor-pointer hover:bg-gray-600 text-center">
<i class="fas fa-trumpet text-2xl mb-1 text-pink-400"></i>
<p class="text-xs">Brass</p>
</div>
</div>
</div>
<div class="p-3 border-t border-gray-700">
<h2 class="font-semibold text-blue-400 mb-2">Effects</h2>
<div class="space-y-2">
<div class="bg-gray-700 px-3 py-2 rounded cursor-pointer hover:bg-gray-600">
<span>Reverb</span>
</div>
<div class="bg-gray-700 px-3 py-2 rounded cursor-pointer hover:bg-gray-600">
<span>Delay</span>
</div>
<div class="bg-gray-700 px-3 py-2 rounded cursor-pointer hover:bg-gray-600">
<span>EQ</span>
</div>
<div class="bg-gray-700 px-3 py-2 rounded cursor-pointer hover:bg-gray-600">
<span>Compressor</span>
</div>
</div>
</div>
</div>
<!-- Main Timeline Area -->
<div class="flex-1 flex flex-col overflow-hidden">
<!-- Timeline Header -->
<div class="bg-gray-800 border-b border-gray-700 flex">
<div class="w-16 border-r border-gray-700 flex items-center justify-center">
<span class="text-xs text-gray-400">Time</span>
</div>
<div class="flex-1 overflow-x-auto">
<div class="h-8 flex items-center timeline-grid" style="min-width: 2000px;">
<div class="h-full flex items-center" style="width: 100px;">
<div class="w-full text-center text-xs text-gray-400">1.1.00</div>
</div>
<div class="h-full flex items-center" style="width: 100px;">
<div class="w-full text-center text-xs text-gray-400">1.2.00</div>
</div>
<div class="h-full flex items-center" style="width: 100px;">
<div class="w-full text-center text-xs text-gray-400">1.3.00</div>
</div>
<div class="h-full flex items-center" style="width: 100px;">
<div class="w-full text-center text-xs text-gray-400">1.4.00</div>
</div>
<div class="h-full flex items-center" style="width: 100px;">
<div class="w-full text-center text-xs text-gray-400">2.1.00</div>
</div>
<div class="h-full flex items-center" style="width: 100px;">
<div class="w-full text-center text-xs text-gray-400">2.2.00</div>
</div>
<div class="h-full flex items-center" style="width: 100px;">
<div class="w-full text-center text-xs text-gray-400">2.3.00</div>
</div>
<div class="h-full flex items-center" style="width: 100px;">
<div class="w-full text-center text-xs text-gray-400">2.4.00</div>
</div>
</div>
</div>
</div>
<!-- Track Rows -->
<div class="flex-1 overflow-y-auto">
<!-- Audio Track -->
<div class="h-20 border-b border-gray-700 flex">
<div class="w-16 border-r border-gray-700 flex flex-col items-center justify-center">
<div class="flex items-center space-x-1 mb-1">
<i class="fas fa-volume-up text-blue-400"></i>
<span class="text-xs">Audio 1</span>
</div>
<div class="knob"></div>
</div>
<div class="flex-1 relative timeline-grid" style="min-width: 2000px;">
<div class="absolute top-1/2 transform -translate-y-1/2 left-20 w-40 h-16 audio-clip">
<div class="waveform"></div>
<div class="absolute bottom-0 left-0 right-0 h-2 bg-blue-300 opacity-50"></div>
</div>
<div class="absolute top-1/2 transform -translate-y-1/2 left-200 w-60 h-16 audio-clip">
<div class="waveform"></div>
<div class="absolute bottom-0 left-0 right-0 h-2 bg-blue-300 opacity-50"></div>
</div>
</div>
</div>
<!-- MIDI Track -->
<div class="h-20 border-b border-gray-700 flex">
<div class="w-16 border-r border-gray-700 flex flex-col items-center justify-center">
<div class="flex items-center space-x-1 mb-1">
<i class="fas fa-music text-purple-400"></i>
<span class="text-xs">MIDI 1</span>
</div>
<div class="knob"></div>
</div>
<div class="flex-1 relative timeline-grid" style="min-width: 2000px;">
<div class="absolute top-1/4 left-40 w-80 h-8 midi-clip"></div>
<div class="absolute top-1/2 left-40 w-80 h-8 midi-clip"></div>
<div class="absolute top-3/4 left-40 w-80 h-8 midi-clip"></div>
</div>
</div>
<!-- Drum Track -->
<div class="h-20 border-b border-gray-700 flex">
<div class="w-16 border-r border-gray-700 flex flex-col items-center justify-center">
<div class="flex items-center space-x-1 mb-1">
<i class="fas fa-drum text-green-400"></i>
<span class="text-xs">Drums</span>
</div>
<div class="knob"></div>
</div>
<div class="flex-1 relative timeline-grid" style="min-width: 2000px;">
<div class="absolute top-1/4 left-60 w-20 h-8 midi-clip bg-red-400"></div>
<div class="absolute top-1/2 left-100 w-20 h-8 midi-clip bg-red-400"></div>
<div class="absolute top-1/2 left-140 w-20 h-8 midi-clip bg-red-400"></div>
<div class="absolute top-3/4 left-180 w-20 h-8 midi-clip bg-red-400"></div>
</div>
</div>
<!-- More tracks would go here -->
</div>
<!-- Piano Roll -->
<div class="h-64 border-t border-gray-700 flex">
<div class="w-16 bg-gray-800 border-r border-gray-700 overflow-y-auto">
<div class="piano-key white">C5</div>
<div class="piano-key black"></div>
<div class="piano-key white">B4</div>
<div class="piano-key black"></div>
<div class="piano-key white">A4</div>
<div class="piano-key white">G4</div>
<div class="piano-key black"></div>
<div class="piano-key white">F4</div>
<div class="piano-key black"></div>
<div class="piano-key white">E4</div>
<div class="piano-key white">D4</div>
<div class="piano-key black"></div>
<div class="piano-key white">C4</div>
</div>
<div class="flex-1 bg-gray-800 timeline-grid overflow-auto" style="min-width: 2000px;">
<!-- Piano roll content would go here -->
</div>
</div>
</div>
<!-- Right Sidebar - Mixer -->
<div class="w-64 bg-gray-800 border-l border-gray-700 overflow-y-auto">
<div class="p-3 border-b border-gray-700">
<h2 class="font-semibold text-blue-400 mb-3">Mixer</h2>
<div class="flex justify-between items-center mb-4">
<div class="flex items-center">
<i class="fas fa-sliders-h mr-2"></i>
<span>Master</span>
</div>
<div class="flex items-center">
<span class="text-xs mr-2">-6dB</span>
<div class="fader">
<div class="fader-handle" style="top: 40%;"></div>
</div>
</div>
</div>
<div class="space-y-4">
<!-- Audio 1 Channel -->
<div class="bg-gray-700 p-3 rounded">
<div class="flex justify-between items-center mb-2">
<span class="text-sm">Audio 1</span>
<div class="flex space-x-2">
<button class="text-xs text-gray-400 hover:text-white"><i class="fas fa-mute"></i></button>
<button class="text-xs text-gray-400 hover:text-white"><i class="fas fa-solo"></i></button>
</div>
</div>
<div class="flex justify-between items-center">
<div class="knob"></div>
<div class="fader">
<div class="fader-handle" style="top: 60%;"></div>
</div>
<div class="flex flex-col items-center">
<span class="text-xs mb-1">-12dB</span>
<div class="w-6 h-2 bg-green-400 rounded-full"></div>
</div>
</div>
</div>
<!-- MIDI 1 Channel -->
<div class="bg-gray-700 p-3 rounded">
<div class="flex justify-between items-center mb-2">
<span class="text-sm">MIDI 1</span>
<div class="flex space-x-2">
<button class="text-xs text-gray-400 hover:text-white"><i class="fas fa-mute"></i></button>
<button class="text-xs text-gray-400 hover:text-white"><i class="fas fa-solo"></i></button>
</div>
</div>
<div class="flex justify-between items-center">
<div class="knob"></div>
<div class="fader">
<div class="fader-handle" style="top: 50%;"></div>
</div>
<div class="flex flex-col items-center">
<span class="text-xs mb-1">-9dB</span>
<div class="w-6 h-2 bg-green-400 rounded-full"></div>
</div>
</div>
</div>
<!-- Drum Channel -->
<div class="bg-gray-700 p-3 rounded">
<div class="flex justify-between items-center mb-2">
<span class="text-sm">Drums</span>
<div class="flex space-x-2">
<button class="text-xs text-gray-400 hover:text-white"><i class="fas fa-mute"></i></button>
<button class="text-xs text-gray-400 hover:text-white"><i class="fas fa-solo"></i></button>
</div>
</div>
<div class="flex justify-between items-center">
<div class="knob"></div>
<div class="fader">
<div class="fader-handle" style="top: 45%;"></div>
</div>
<div class="flex flex-col items-center">
<span class="text-xs mb-1">-3dB</span>
<div class="w-6 h-2 bg-yellow-400 rounded-full"></div>
</div>
</div>
</div>
</div>
</div>
<div class="p-3 border-t border-gray-700">
<h2 class="font-semibold text-blue-400 mb-3">Effects</h2>
<div class="bg-gray-700 p-3 rounded mb-3">
<div class="flex justify-between items-center mb-2">
<span class="text-sm">Reverb</span>
<button class="text-xs text-gray-400 hover:text-white"><i class="fas fa-power-off"></i></button>
</div>
<div class="grid grid-cols-3 gap-2">
<div class="flex flex-col items-center">
<span class="text-xs mb-1">Mix</span>
<div class="knob"></div>
</div>
<div class="flex flex-col items-center">
<span class="text-xs mb-1">Decay</span>
<div class="knob"></div>
</div>
<div class="flex flex-col items-center">
<span class="text-xs mb-1">Size</span>
<div class="knob"></div>
</div>
</div>
</div>
<div class="bg-gray-700 p-3 rounded">
<div class="flex justify-between items-center mb-2">
<span class="text-sm">EQ</span>
<button class="text-xs text-gray-400 hover:text-white"><i class="fas fa-power-off"></i></button>
</div>
<div class="eq-curve h-20 mb-2">
<div class="eq-line" style="transform: scaleY(0.8)"></div>
<div class="eq-line" style="transform: scaleY(0.6) translateX(25%)"></div>
<div class="eq-line" style="transform: scaleY(0.4) translateX(50%)"></div>
<div class="eq-line" style="transform: scaleY(0.7) translateX(75%)"></div>
</div>
<div class="grid grid-cols-4 gap-2">
<div class="flex flex-col items-center">
<span class="text-xs mb-1">Low</span>
<div class="knob"></div>
</div>
<div class="flex flex-col items-center">
<span class="text-xs mb-1">Mid</span>
<div class="knob"></div>
</div>
<div class="flex flex-col items-center">
<span class="text-xs mb-1">High</span>
<div class="knob"></div>
</div>
<div class="flex flex-col items-center">
<span class="text-xs mb-1">Q</span>
<div class="knob"></div>
</div>
</div>
</div>
</div>
</div>
</div>
<!-- Transport Controls -->
<div class="bg-gray-800 border-t border-gray-700 px-4 py-2 flex items-center justify-between">
<div class="flex items-center space-x-4">
<div class="flex items-center space-x-2">
<button class="transport-btn w-8 h-8 rounded-full bg-gray-700 hover:bg-gray-600 flex items-center justify-center">
<i class="fas fa-step-backward"></i>
</button>
<button class="transport-btn w-10 h-10 rounded-full bg-blue-600 hover:bg-blue-500 flex items-center justify-center">
<i class="fas fa-play"></i>
</button>
<button class="transport-btn w-8 h-8 rounded-full bg-gray-700 hover:bg-gray-600 flex items-center justify-center">
<i class="fas fa-stop"></i>
</button>
<button class="transport-btn w-8 h-8 rounded-full bg-gray-700 hover:bg-gray-600 flex items-center justify-center">
<i class="fas fa-step-forward"></i>
</button>
<button class="transport-btn w-8 h-8 rounded-full bg-gray-700 hover:bg-gray-600 flex items-center justify-center">
<i class="fas fa-redo"></i>
</button>
</div>
<div class="flex items-center space-x-2">
<span class="text-sm">1.1.00</span>
<div class="w-24 h-2 bg-gray-700 rounded-full overflow-hidden">
<div class="h-full bg-blue-500" style="width: 30%;"></div>
</div>
<span class="text-sm">4.4.00</span>
</div>
</div>
<div class="flex items-center space-x-4">
<div class="flex items-center space-x-2">
<i class="fas fa-microphone"></i>
<div class="w-24 h-2 bg-gray-700 rounded-full overflow-hidden">
<div class="h-full bg-red-500" style="width: 60%;"></div>
</div>
</div>
<div class="flex items-center space-x-2">
<i class="fas fa-volume-up"></i>
<div class="w-24 h-2 bg-gray-700 rounded-full overflow-hidden">
<div class="h-full bg-green-500" style="width: 80%;"></div>
</div>
</div>
</div>
</div>
</div>
<script>
// Basic functionality for the DAW
document.addEventListener('DOMContentLoaded', function() {
// Make clips selectable
const clips = document.querySelectorAll('.audio-clip, .midi-clip');
clips.forEach(clip => {
clip.addEventListener('click', function(e) {
// Prevent multiple selections if clicking on a child element
e.stopPropagation();
// Remove selection from all clips
clips.forEach(c => c.classList.remove('selected'));
// Add selection to clicked clip
this.classList.add('selected');
});
});
// Play button functionality
const playButton = document.querySelector('.fa-play').parentElement;
const stopButton = document.querySelector('.fa-stop').parentElement;
const progressBar = document.querySelector('.bg-blue-500');
let isPlaying = false;
let progressInterval;
playButton.addEventListener('click', function() {
if (!isPlaying) {
isPlaying = true;
this.innerHTML = '<i class="fas fa-pause"></i>';
// Simulate playback progress
let progress = 0;
progressInterval = setInterval(() => {
progress += 0.5;
if (progress > 100) progress = 0;
progressBar.style.width = `${progress}%`;
}, 100);
} else {
isPlaying = false;
this.innerHTML = '<i class="fas fa-play"></i>';
clearInterval(progressInterval);
}
});
stopButton.addEventListener('click', function() {
isPlaying = false;
playButton.innerHTML = '<i class="fas fa-play"></i>';
clearInterval(progressInterval);
progressBar.style.width = '0%';
});
// Simple knob rotation
const knobs = document.querySelectorAll('.knob');
knobs.forEach(knob => {
let isDragging = false;
let startY = 0;
let rotation = 0;
knob.addEventListener('mousedown', function(e) {
isDragging = true;
startY = e.clientY;
document.addEventListener('mousemove', onMouseMove);
document.addEventListener('mouseup', onMouseUp);
});
function onMouseMove(e) {
if (!isDragging) return;
const deltaY = e.clientY - startY;
rotation = Math.min(Math.max(-90, rotation + deltaY * 0.5), 90);
knob.style.transform = `rotate(${rotation}deg)`;
startY = e.clientY;
}
function onMouseUp() {
isDragging = false;
document.removeEventListener('mousemove', onMouseMove);
document.removeEventListener('mouseup', onMouseUp);
}
});
// Simple fader movement
const faders = document.querySelectorAll('.fader-handle');
faders.forEach(fader => {
let isDragging = false;
let startY = 0;
fader.addEventListener('mousedown', function(e) {
isDragging = true;
startY = e.clientY;
document.addEventListener('mousemove', onFaderMove);
document.addEventListener('mouseup', onFaderUp);
});
function onFaderMove(e) {
if (!isDragging) return;
const faderParent = fader.parentElement;
const parentRect = faderParent.getBoundingClientRect();
const newTop = e.clientY - parentRect.top - (fader.offsetHeight / 2);
// Constrain to fader height
const constrainedTop = Math.max(0, Math.min(parentRect.height - fader.offsetHeight, newTop));
fader.style.top = `${constrainedTop}px`;
// Update dB value display if available
const dBDisplay = fader.closest('.bg-gray-700')?.querySelector('.text-xs');
if (dBDisplay) {
const percent = 100 - (constrainedTop / (parentRect.height - fader.offsetHeight)) * 100;
const dB = Math.round((percent / 100) * 24 - 12);
dBDisplay.textContent = `${dB}dB`;
}
}
function onFaderUp() {
isDragging = false;
document.removeEventListener('mousemove', onFaderMove);
document.removeEventListener('mouseup', onFaderUp);
}
});
});
</script>
<p style="border-radius: 8px; text-align: center; font-size: 12px; color: #fff; margin-top: 16px;position: fixed; left: 8px; bottom: 8px; z-index: 10; background: rgba(0, 0, 0, 0.8); padding: 4px 8px;">Made with <img src="https://enzostvs-deepsite.hf.space/logo.svg" alt="DeepSite Logo" style="width: 16px; height: 16px; vertical-align: middle;display:inline-block;margin-right:3px;filter:brightness(0) invert(1);"><a href="https://enzostvs-deepsite.hf.space" style="color: #fff;text-decoration: underline;" target="_blank" >DeepSite</a> - 🧬 <a href="https://enzostvs-deepsite.hf.space?remix=7Zeux/webdaw" style="color: #fff;text-decoration: underline;" target="_blank" >Remix</a></p></body>
</html> |