Rox-Turbo commited on
Commit
ce6d545
·
verified ·
1 Parent(s): b1da039

Create app.js

Browse files
Files changed (1) hide show
  1. public/app.js +33 -0
public/app.js CHANGED
@@ -2327,6 +2327,9 @@ class RoxAI {
2327
  this.sidebarOverlay?.classList.remove('show');
2328
  this.sidebar?.classList.remove('open');
2329
  }
 
 
 
2330
  }, 100)));
2331
 
2332
  // Keyboard shortcuts
@@ -10449,6 +10452,19 @@ class RoxAI {
10449
 
10450
  if (!btnGetCode || !apiOverlay || !apiContent) return;
10451
 
 
 
 
 
 
 
 
 
 
 
 
 
 
10452
  // Store event listeners for cleanup
10453
  this._apiModalListeners = [];
10454
 
@@ -10499,6 +10515,23 @@ class RoxAI {
10499
  this._apiModalDynamicListeners = [];
10500
  }
10501
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
10502
  /**
10503
  * Show API code modal with model selector
10504
  * @private
 
2327
  this.sidebarOverlay?.classList.remove('show');
2328
  this.sidebar?.classList.remove('open');
2329
  }
2330
+
2331
+ // Toggle API button visibility based on device type
2332
+ this._updateAPIButtonVisibility();
2333
  }, 100)));
2334
 
2335
  // Keyboard shortcuts
 
10452
 
10453
  if (!btnGetCode || !apiOverlay || !apiContent) return;
10454
 
10455
+ // Hide API button on mobile devices (desktop-only feature)
10456
+ const isMobile = window.innerWidth < 1024 ||
10457
+ 'ontouchstart' in window ||
10458
+ navigator.maxTouchPoints > 0;
10459
+
10460
+ if (isMobile) {
10461
+ btnGetCode.style.display = 'none';
10462
+ return; // Skip initialization on mobile
10463
+ }
10464
+
10465
+ // Show button on desktop
10466
+ btnGetCode.style.display = 'flex';
10467
+
10468
  // Store event listeners for cleanup
10469
  this._apiModalListeners = [];
10470
 
 
10515
  this._apiModalDynamicListeners = [];
10516
  }
10517
 
10518
+ /**
10519
+ * Update API button visibility based on device type
10520
+ * @private
10521
+ */
10522
+ _updateAPIButtonVisibility() {
10523
+ const btnGetCode = document.getElementById('btnGetCode');
10524
+ if (!btnGetCode) return;
10525
+
10526
+ // Check if device is mobile
10527
+ const isMobile = window.innerWidth < 1024 ||
10528
+ 'ontouchstart' in window ||
10529
+ navigator.maxTouchPoints > 0;
10530
+
10531
+ // Hide on mobile, show on desktop
10532
+ btnGetCode.style.display = isMobile ? 'none' : 'flex';
10533
+ }
10534
+
10535
  /**
10536
  * Show API code modal with model selector
10537
  * @private