Solshine commited on
Commit
a06b807
·
verified ·
1 Parent(s): 0af6ad5

Upload folder using huggingface_hub

Browse files
Files changed (2) hide show
  1. DisplacementFilter.js +3 -3
  2. 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 — displacement scale increases with amplitude
122
- var videoScale = 10 + amp * 15; // 10-25 range (subtle to moderate)
123
- var canvasScale = 6 + amp * 12; // 6-18 range
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 on the webcam feed DRAMATIC
392
  var hueAngle = 0;
393
  var videoEl = this.videoElement;
394
  setInterval(function() {
395
- hueAngle = (hueAngle + 2) % 360;
396
- var sat = 2.5 + Math.sin(hueAngle * 0.05) * 1.0;
397
- var bright = 1.1 + Math.sin(hueAngle * 0.03) * 0.2;
398
- videoEl.style.filter = 'saturate(' + sat + ') contrast(1.3) brightness(' + bright + ') hue-rotate(' + hueAngle + 'deg)';
399
- }, 33);
 
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';