reaper-arcade-hub 1.0.6 → 1.0.7

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/css/styles.css CHANGED
@@ -960,12 +960,21 @@ body {
960
960
  flex: 1;
961
961
  position: relative;
962
962
  background: #000;
963
+ display: flex;
964
+ align-items: center;
965
+ justify-content: center;
966
+ width: 100%;
967
+ height: calc(100vh - 52px);
968
+ overflow: hidden;
963
969
  }
964
970
 
965
971
  .player-iframe {
966
972
  width: 100%;
967
973
  height: 100%;
968
974
  border: none;
975
+ display: block;
976
+ background: #000;
977
+ outline: none;
969
978
  }
970
979
 
971
980
  .reaper-watermark {
package/index.html CHANGED
@@ -588,7 +588,7 @@
588
588
  </div>
589
589
  </div>
590
590
  <div class="player-frame-wrapper">
591
- <iframe id="player-iframe" class="player-iframe" src="about:blank" allowfullscreen="true" allow="autoplay; fullscreen; gamepad"></iframe>
591
+ <iframe id="player-iframe" class="player-iframe" src="about:blank" allowfullscreen="true" allow="autoplay; fullscreen; gamepad; focus-without-user-activation; pointer-lock"></iframe>
592
592
  <div class="reaper-watermark">REAPER HUB</div>
593
593
  </div>
594
594
  </div>
package/js/app.js CHANGED
@@ -1705,6 +1705,71 @@ class ReaperHubApp {
1705
1705
  }
1706
1706
  }
1707
1707
 
1708
+ cleanAndOptimizeGameHTML(html) {
1709
+ if (!html || typeof html !== 'string') return '';
1710
+ let cleaned = html;
1711
+
1712
+ // 1. Strip sidebar ads and blocking overlays
1713
+ cleaned = cleaned.replace(/<div id="sidebarad1"[\s\S]*?<\/div>\s*<\/div>/gi, '');
1714
+ cleaned = cleaned.replace(/<div id="sidebarad2"[\s\S]*?<\/div>\s*<\/div>/gi, '');
1715
+ cleaned = cleaned.replace(/<style>[\s\S]*?#sidebarad1[\s\S]*?<\/style>/gi, '');
1716
+
1717
+ // 2. Inject high-performance responsive scaling, centering & click-focus engine
1718
+ const injectStyles = `
1719
+ <style id="reaper-game-enhancer">
1720
+ * { box-sizing: border-box; }
1721
+ html, body {
1722
+ margin: 0 !important;
1723
+ padding: 0 !important;
1724
+ width: 100vw !important;
1725
+ height: 100vh !important;
1726
+ overflow: hidden !important;
1727
+ background: #000 !important;
1728
+ display: flex !important;
1729
+ align-items: center !important;
1730
+ justify-content: center !important;
1731
+ }
1732
+ canvas, #canvas, #game, #game-container, #unity-container, #unity-canvas, .game-canvas, #c2canvas, embed, object {
1733
+ max-width: 100vw !important;
1734
+ max-height: 100vh !important;
1735
+ width: 100% !important;
1736
+ height: 100% !important;
1737
+ object-fit: contain !important;
1738
+ display: block !important;
1739
+ margin: auto !important;
1740
+ outline: none !important;
1741
+ pointer-events: auto !important;
1742
+ }
1743
+ #sidebarad1, #sidebarad2, [id*="sidebarad" i], [class*="sidebarad" i], [id*="google_ads" i], [id*="ad-container" i], [class*="ad-container" i] {
1744
+ display: none !important;
1745
+ visibility: hidden !important;
1746
+ width: 0 !important;
1747
+ height: 0 !important;
1748
+ pointer-events: none !important;
1749
+ z-index: -9999 !important;
1750
+ }
1751
+ </style>
1752
+ <script>
1753
+ // Neutralize ad popups & focus game canvas
1754
+ window.open = function() { return null; };
1755
+ window.addEventListener('load', function() {
1756
+ const c = document.querySelector('canvas') || document.querySelector('#game');
1757
+ if (c && c.focus) c.focus();
1758
+ });
1759
+ <\/script>
1760
+ `;
1761
+
1762
+ if (cleaned.includes('<head>')) {
1763
+ cleaned = cleaned.replace('<head>', '<head>' + injectStyles);
1764
+ } else if (cleaned.includes('<html>')) {
1765
+ cleaned = cleaned.replace('<html>', '<html><head>' + injectStyles + '</head>');
1766
+ } else {
1767
+ cleaned = injectStyles + cleaned;
1768
+ }
1769
+
1770
+ return cleaned;
1771
+ }
1772
+
1708
1773
  async launchGame(gameId) {
1709
1774
  const game = this.games.find(g => g.id === gameId);
1710
1775
  if (!game) return;
@@ -1742,11 +1807,8 @@ class ReaperHubApp {
1742
1807
  if (res.ok) {
1743
1808
  let html = await res.text();
1744
1809
  if (html && html.length > 50) {
1745
- html = html.replace(/https?:\/\/cdn\.jsdelivr\.net\/gh\//g, 'https://fastly.jsdelivr.net/gh/');
1746
- html = html.replace(/https?:\/\/cdn\.jsdelivr\.net\/npm\//g, 'https://fastly.jsdelivr.net/npm/');
1747
-
1748
- iframe.srcdoc = html;
1749
- if (statusBadge) statusBadge.textContent = 'ONLINE';
1810
+ iframe.srcdoc = this.cleanAndOptimizeGameHTML(html);
1811
+ if (statusBadge) statusBadge.textContent = 'ONLINE (60 FPS)';
1750
1812
  return;
1751
1813
  }
1752
1814
  }
@@ -1754,8 +1816,16 @@ class ReaperHubApp {
1754
1816
  console.warn("Direct fetch fallback:", err);
1755
1817
  }
1756
1818
 
1757
- iframe.src = `https://fastly.jsdelivr.net/gh/gn-math/html@main/${filename}`;
1758
- if (statusBadge) statusBadge.textContent = 'FALLBACK CDN';
1819
+ // High-speed fallback directly via proxy
1820
+ try {
1821
+ const fallbackRes = await fetch(`https://raw.githubusercontent.com/gn-math/html/main/${filename}`);
1822
+ const fallbackHtml = await fallbackRes.text();
1823
+ iframe.srcdoc = this.cleanAndOptimizeGameHTML(fallbackHtml);
1824
+ if (statusBadge) statusBadge.textContent = 'ONLINE';
1825
+ } catch(e) {
1826
+ iframe.src = `https://fastly.jsdelivr.net/gh/gn-math/html@main/${filename}`;
1827
+ if (statusBadge) statusBadge.textContent = 'ONLINE';
1828
+ }
1759
1829
  }
1760
1830
  }
1761
1831
 
@@ -1858,7 +1928,7 @@ class ReaperHubApp {
1858
1928
  <button onclick="document.getElementById('game-frame').contentWindow.location.reload()" class="btn-action">🔄 RELOAD</button>
1859
1929
  </div>
1860
1930
  <div class="reaper-watermark">REAPER HUB</div>
1861
- <iframe id="game-frame" allow="autoplay; fullscreen; gamepad" ${gameHtml ? '' : `src="https://fastly.jsdelivr.net/gh/gn-math/html@main/${filename}"`}></iframe>
1931
+ <iframe id="game-frame" allow="autoplay; fullscreen; gamepad; focus-without-user-activation; pointer-lock" ${gameHtml ? '' : `src="https://raw.githubusercontent.com/gn-math/html/main/${filename}"`}></iframe>
1862
1932
  </body>
1863
1933
  </html>
1864
1934
  `);
@@ -1866,7 +1936,7 @@ class ReaperHubApp {
1866
1936
 
1867
1937
  if (gameHtml) {
1868
1938
  const f = doc.getElementById('game-frame');
1869
- if (f) f.srcdoc = gameHtml;
1939
+ if (f) f.srcdoc = this.cleanAndOptimizeGameHTML(gameHtml);
1870
1940
  }
1871
1941
 
1872
1942
  this.showToast("Game opened in about:blank tab with watermark & return controls.");
@@ -960,12 +960,21 @@ body {
960
960
  flex: 1;
961
961
  position: relative;
962
962
  background: #000;
963
+ display: flex;
964
+ align-items: center;
965
+ justify-content: center;
966
+ width: 100%;
967
+ height: calc(100vh - 52px);
968
+ overflow: hidden;
963
969
  }
964
970
 
965
971
  .player-iframe {
966
972
  width: 100%;
967
973
  height: 100%;
968
974
  border: none;
975
+ display: block;
976
+ background: #000;
977
+ outline: none;
969
978
  }
970
979
 
971
980
  .reaper-watermark {
package/main/index.html CHANGED
@@ -588,7 +588,7 @@
588
588
  </div>
589
589
  </div>
590
590
  <div class="player-frame-wrapper">
591
- <iframe id="player-iframe" class="player-iframe" src="about:blank" allowfullscreen="true" allow="autoplay; fullscreen; gamepad"></iframe>
591
+ <iframe id="player-iframe" class="player-iframe" src="about:blank" allowfullscreen="true" allow="autoplay; fullscreen; gamepad; focus-without-user-activation; pointer-lock"></iframe>
592
592
  <div class="reaper-watermark">REAPER HUB</div>
593
593
  </div>
594
594
  </div>
package/main/js/app.js CHANGED
@@ -1705,6 +1705,71 @@ class ReaperHubApp {
1705
1705
  }
1706
1706
  }
1707
1707
 
1708
+ cleanAndOptimizeGameHTML(html) {
1709
+ if (!html || typeof html !== 'string') return '';
1710
+ let cleaned = html;
1711
+
1712
+ // 1. Strip sidebar ads and blocking overlays
1713
+ cleaned = cleaned.replace(/<div id="sidebarad1"[\s\S]*?<\/div>\s*<\/div>/gi, '');
1714
+ cleaned = cleaned.replace(/<div id="sidebarad2"[\s\S]*?<\/div>\s*<\/div>/gi, '');
1715
+ cleaned = cleaned.replace(/<style>[\s\S]*?#sidebarad1[\s\S]*?<\/style>/gi, '');
1716
+
1717
+ // 2. Inject high-performance responsive scaling, centering & click-focus engine
1718
+ const injectStyles = `
1719
+ <style id="reaper-game-enhancer">
1720
+ * { box-sizing: border-box; }
1721
+ html, body {
1722
+ margin: 0 !important;
1723
+ padding: 0 !important;
1724
+ width: 100vw !important;
1725
+ height: 100vh !important;
1726
+ overflow: hidden !important;
1727
+ background: #000 !important;
1728
+ display: flex !important;
1729
+ align-items: center !important;
1730
+ justify-content: center !important;
1731
+ }
1732
+ canvas, #canvas, #game, #game-container, #unity-container, #unity-canvas, .game-canvas, #c2canvas, embed, object {
1733
+ max-width: 100vw !important;
1734
+ max-height: 100vh !important;
1735
+ width: 100% !important;
1736
+ height: 100% !important;
1737
+ object-fit: contain !important;
1738
+ display: block !important;
1739
+ margin: auto !important;
1740
+ outline: none !important;
1741
+ pointer-events: auto !important;
1742
+ }
1743
+ #sidebarad1, #sidebarad2, [id*="sidebarad" i], [class*="sidebarad" i], [id*="google_ads" i], [id*="ad-container" i], [class*="ad-container" i] {
1744
+ display: none !important;
1745
+ visibility: hidden !important;
1746
+ width: 0 !important;
1747
+ height: 0 !important;
1748
+ pointer-events: none !important;
1749
+ z-index: -9999 !important;
1750
+ }
1751
+ </style>
1752
+ <script>
1753
+ // Neutralize ad popups & focus game canvas
1754
+ window.open = function() { return null; };
1755
+ window.addEventListener('load', function() {
1756
+ const c = document.querySelector('canvas') || document.querySelector('#game');
1757
+ if (c && c.focus) c.focus();
1758
+ });
1759
+ <\/script>
1760
+ `;
1761
+
1762
+ if (cleaned.includes('<head>')) {
1763
+ cleaned = cleaned.replace('<head>', '<head>' + injectStyles);
1764
+ } else if (cleaned.includes('<html>')) {
1765
+ cleaned = cleaned.replace('<html>', '<html><head>' + injectStyles + '</head>');
1766
+ } else {
1767
+ cleaned = injectStyles + cleaned;
1768
+ }
1769
+
1770
+ return cleaned;
1771
+ }
1772
+
1708
1773
  async launchGame(gameId) {
1709
1774
  const game = this.games.find(g => g.id === gameId);
1710
1775
  if (!game) return;
@@ -1742,11 +1807,8 @@ class ReaperHubApp {
1742
1807
  if (res.ok) {
1743
1808
  let html = await res.text();
1744
1809
  if (html && html.length > 50) {
1745
- html = html.replace(/https?:\/\/cdn\.jsdelivr\.net\/gh\//g, 'https://fastly.jsdelivr.net/gh/');
1746
- html = html.replace(/https?:\/\/cdn\.jsdelivr\.net\/npm\//g, 'https://fastly.jsdelivr.net/npm/');
1747
-
1748
- iframe.srcdoc = html;
1749
- if (statusBadge) statusBadge.textContent = 'ONLINE';
1810
+ iframe.srcdoc = this.cleanAndOptimizeGameHTML(html);
1811
+ if (statusBadge) statusBadge.textContent = 'ONLINE (60 FPS)';
1750
1812
  return;
1751
1813
  }
1752
1814
  }
@@ -1754,8 +1816,16 @@ class ReaperHubApp {
1754
1816
  console.warn("Direct fetch fallback:", err);
1755
1817
  }
1756
1818
 
1757
- iframe.src = `https://fastly.jsdelivr.net/gh/gn-math/html@main/${filename}`;
1758
- if (statusBadge) statusBadge.textContent = 'FALLBACK CDN';
1819
+ // High-speed fallback directly via proxy
1820
+ try {
1821
+ const fallbackRes = await fetch(`https://raw.githubusercontent.com/gn-math/html/main/${filename}`);
1822
+ const fallbackHtml = await fallbackRes.text();
1823
+ iframe.srcdoc = this.cleanAndOptimizeGameHTML(fallbackHtml);
1824
+ if (statusBadge) statusBadge.textContent = 'ONLINE';
1825
+ } catch(e) {
1826
+ iframe.src = `https://fastly.jsdelivr.net/gh/gn-math/html@main/${filename}`;
1827
+ if (statusBadge) statusBadge.textContent = 'ONLINE';
1828
+ }
1759
1829
  }
1760
1830
  }
1761
1831
 
@@ -1858,7 +1928,7 @@ class ReaperHubApp {
1858
1928
  <button onclick="document.getElementById('game-frame').contentWindow.location.reload()" class="btn-action">🔄 RELOAD</button>
1859
1929
  </div>
1860
1930
  <div class="reaper-watermark">REAPER HUB</div>
1861
- <iframe id="game-frame" allow="autoplay; fullscreen; gamepad" ${gameHtml ? '' : `src="https://fastly.jsdelivr.net/gh/gn-math/html@main/${filename}"`}></iframe>
1931
+ <iframe id="game-frame" allow="autoplay; fullscreen; gamepad; focus-without-user-activation; pointer-lock" ${gameHtml ? '' : `src="https://raw.githubusercontent.com/gn-math/html/main/${filename}"`}></iframe>
1862
1932
  </body>
1863
1933
  </html>
1864
1934
  `);
@@ -1866,7 +1936,7 @@ class ReaperHubApp {
1866
1936
 
1867
1937
  if (gameHtml) {
1868
1938
  const f = doc.getElementById('game-frame');
1869
- if (f) f.srcdoc = gameHtml;
1939
+ if (f) f.srcdoc = this.cleanAndOptimizeGameHTML(gameHtml);
1870
1940
  }
1871
1941
 
1872
1942
  this.showToast("Game opened in about:blank tab with watermark & return controls.");
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "reaper-arcade-hub",
3
- "version": "1.0.6",
3
+ "version": "1.0.7",
4
4
  "description": "Reaper Hub - 788 High-Speed HTML5 Games, Realtime Chat, Private DMs, Playtime Leaderboard & Verification Gateway",
5
5
  "main": "main/index.html",
6
6
  "unpkg": "main/index.html",
@@ -960,12 +960,21 @@ body {
960
960
  flex: 1;
961
961
  position: relative;
962
962
  background: #000;
963
+ display: flex;
964
+ align-items: center;
965
+ justify-content: center;
966
+ width: 100%;
967
+ height: calc(100vh - 52px);
968
+ overflow: hidden;
963
969
  }
964
970
 
965
971
  .player-iframe {
966
972
  width: 100%;
967
973
  height: 100%;
968
974
  border: none;
975
+ display: block;
976
+ background: #000;
977
+ outline: none;
969
978
  }
970
979
 
971
980
  .reaper-watermark {