Spaces:
Running
Running
Upload folder using huggingface_hub
Browse files- DisplacementFilter.js +3 -3
- game.js +7 -6
DisplacementFilter.js
CHANGED
|
@@ -118,9 +118,9 @@ export class DisplacementFilter {
|
|
| 118 |
var freqY = 0.006 + Math.cos(this.time * 0.25) * 0.002;
|
| 119 |
this.turbulence.setAttribute('baseFrequency', freqX + ' ' + freqY);
|
| 120 |
|
| 121 |
-
// Audio-reactive Amount —
|
| 122 |
-
var videoScale =
|
| 123 |
-
var canvasScale =
|
| 124 |
this.displacement.setAttribute('scale', String(videoScale));
|
| 125 |
this.displacement2.setAttribute('scale', String(canvasScale));
|
| 126 |
|
|
|
|
| 118 |
var freqY = 0.006 + Math.cos(this.time * 0.25) * 0.002;
|
| 119 |
this.turbulence.setAttribute('baseFrequency', freqX + ' ' + freqY);
|
| 120 |
|
| 121 |
+
// Audio-reactive Amount — MAX STRENGTH displacement
|
| 122 |
+
var videoScale = 20 + amp * 30; // 20-50 range (always visible, big on audio)
|
| 123 |
+
var canvasScale = 14 + amp * 22; // 14-36 range
|
| 124 |
this.displacement.setAttribute('scale', String(videoScale));
|
| 125 |
this.displacement2.setAttribute('scale', String(canvasScale));
|
| 126 |
|
game.js
CHANGED
|
@@ -388,15 +388,16 @@ export var Game = /*#__PURE__*/ function() {
|
|
| 388 |
this.videoElement.playsInline = true;
|
| 389 |
this.videoElement.style.zIndex = '0'; // Ensure video is behind THREE canvas
|
| 390 |
this.renderDiv.appendChild(this.videoElement);
|
| 391 |
-
// Psychedelic hue rotation
|
| 392 |
var hueAngle = 0;
|
| 393 |
var videoEl = this.videoElement;
|
| 394 |
setInterval(function() {
|
| 395 |
-
hueAngle = (hueAngle +
|
| 396 |
-
var sat =
|
| 397 |
-
var bright = 1.
|
| 398 |
-
|
| 399 |
-
|
|
|
|
| 400 |
// Container for Status text (formerly Game Over) and restart hint
|
| 401 |
this.gameOverContainer = document.createElement('div');
|
| 402 |
this.gameOverContainer.style.position = 'absolute';
|
|
|
|
| 388 |
this.videoElement.playsInline = true;
|
| 389 |
this.videoElement.style.zIndex = '0'; // Ensure video is behind THREE canvas
|
| 390 |
this.renderDiv.appendChild(this.videoElement);
|
| 391 |
+
// Psychedelic hue rotation — MAX STRENGTH
|
| 392 |
var hueAngle = 0;
|
| 393 |
var videoEl = this.videoElement;
|
| 394 |
setInterval(function() {
|
| 395 |
+
hueAngle = (hueAngle + 3) % 360;
|
| 396 |
+
var sat = 3.5 + Math.sin(hueAngle * 0.04) * 1.5;
|
| 397 |
+
var bright = 1.2 + Math.sin(hueAngle * 0.025) * 0.3;
|
| 398 |
+
var cont = 1.4 + Math.sin(hueAngle * 0.03) * 0.2;
|
| 399 |
+
videoEl.style.filter = 'saturate(' + sat + ') contrast(' + cont + ') brightness(' + bright + ') hue-rotate(' + hueAngle + 'deg) url(#turbulence-displace)';
|
| 400 |
+
}, 25);
|
| 401 |
// Container for Status text (formerly Game Over) and restart hint
|
| 402 |
this.gameOverContainer = document.createElement('div');
|
| 403 |
this.gameOverContainer.style.position = 'absolute';
|