reaper-arcade-hub 2.0.7 → 2.0.9

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.
Files changed (3) hide show
  1. package/js/app.js +52 -32
  2. package/main/js/app.js +52 -32
  3. package/package.json +2 -2
package/js/app.js CHANGED
@@ -1654,20 +1654,20 @@ class ReaperHubApp {
1654
1654
  const coverUrl = game.cover || `https://placehold.co/400x250/041022/ffffff?text=${encodeURIComponent(game.name)}`;
1655
1655
 
1656
1656
  return `
1657
- <div class="game-card" onclick="app.launchGame('${game.id}')">
1657
+ <div class="game-card" data-id="${game.id}" onclick="app.launchGame('${game.id}')">
1658
1658
  <div class="game-thumb-container">
1659
- <img class="game-thumb" src="${coverUrl}" alt="${game.name}" loading="lazy" onerror="this.onerror=null; this.src='https://placehold.co/400x250/041022/ffffff?text=${encodeURIComponent(game.name)}';" />
1659
+ <img class="game-thumb" src="${coverUrl}" alt="${this.escapeHtml(game.name)}" loading="lazy" onerror="this.onerror=null; this.src='https://placehold.co/400x250/041022/ffffff?text=${encodeURIComponent(game.name)}';" />
1660
1660
  ${game.featured ? '<span class="game-badge-featured">FEATURED</span>' : ''}
1661
1661
  </div>
1662
1662
  <div class="game-info">
1663
- <div class="game-title" title="${game.name}">${game.name}</div>
1663
+ <div class="game-title" title="${this.escapeHtml(game.name)}">${this.escapeHtml(game.name)}</div>
1664
1664
  <div class="game-meta">
1665
- <span class="game-author">${game.author || 'GN-Math'}</span>
1666
- <button class="btn-fav ${isFav ? 'active' : ''}" onclick="event.stopPropagation(); app.toggleFavorite('${game.id}')" title="${isFav ? 'Remove from favorites' : 'Add to favorites'}">
1665
+ <span class="game-author">${this.escapeHtml(game.author || 'GN-Math')}</span>
1666
+ <button class="btn-fav ${isFav ? 'active' : ''}" data-id="${game.id}" onclick="event.stopPropagation(); app.toggleFavorite('${game.id}')" title="${isFav ? 'Remove from favorites' : 'Add to favorites'}">
1667
1667
  ${isFav ? '★ SAVED' : '☆ FAV'}
1668
1668
  </button>
1669
1669
  </div>
1670
- <button class="btn-card-play" onclick="event.stopPropagation(); app.launchGame('${game.id}')">PLAY GAME</button>
1670
+ <button class="btn-card-play" data-id="${game.id}" onclick="event.stopPropagation(); app.launchGame('${game.id}')">PLAY GAME</button>
1671
1671
  </div>
1672
1672
  </div>
1673
1673
  `;
@@ -1932,7 +1932,7 @@ class ReaperHubApp {
1932
1932
 
1933
1933
  const filename = game.url.split('/').pop();
1934
1934
  iframe.removeAttribute('srcdoc');
1935
- iframe.src = `https://raw.githack.com/gn-math/html/main/${filename}`;
1935
+ iframe.src = `https://gn-math.github.io/html/${filename}`;
1936
1936
 
1937
1937
  setTimeout(() => {
1938
1938
  try {
@@ -1979,23 +1979,10 @@ class ReaperHubApp {
1979
1979
  const filename = this.currentGame.url.split('/').pop();
1980
1980
  const gameName = this.currentGame.name;
1981
1981
  const siteUrl = window.location.href;
1982
+ const gameUrl = `https://gn-math.github.io/html/${filename}`;
1982
1983
  const win = window.open('about:blank', '_blank');
1983
1984
  if (win) {
1984
1985
  const doc = win.document;
1985
- doc.title = "Home - Google Classroom";
1986
-
1987
- let gameHtml = '';
1988
- try {
1989
- const res = await fetch(`https://raw.githubusercontent.com/gn-math/html/main/${filename}`);
1990
- if (res.ok) {
1991
- gameHtml = await res.text();
1992
- if (gameHtml && gameHtml.length > 50) {
1993
- gameHtml = gameHtml.replace(/https?:\/\/cdn\.jsdelivr\.net\/gh\//g, 'https://fastly.jsdelivr.net/gh/');
1994
- gameHtml = gameHtml.replace(/https?:\/\/cdn\.jsdelivr\.net\/npm\//g, 'https://fastly.jsdelivr.net/npm/');
1995
- }
1996
- }
1997
- } catch (e) {}
1998
-
1999
1986
  doc.open();
2000
1987
  doc.write(`
2001
1988
  <!DOCTYPE html>
@@ -2030,10 +2017,6 @@ class ReaperHubApp {
2030
2017
  pointer-events: none; user-select: none;
2031
2018
  }
2032
2019
  </style>
2033
- <script>
2034
- // Client-Side Ad & Pop-up Blocker
2035
- window.open = function() { console.log('[REAPER SHIELD] Ad pop-up blocked'); return null; };
2036
- <\/script>
2037
2020
  </head>
2038
2021
  <body>
2039
2022
  <div class="reaper-bar">
@@ -2042,18 +2025,13 @@ class ReaperHubApp {
2042
2025
  <button onclick="document.getElementById('game-frame').contentWindow.location.reload()" class="btn-action">🔄 RELOAD</button>
2043
2026
  </div>
2044
2027
  <div class="reaper-watermark">REAPER HUB</div>
2045
- <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>
2028
+ <iframe id="game-frame" src="${gameUrl}" allow="autoplay; fullscreen; gamepad; focus-without-user-activation; pointer-lock"></iframe>
2046
2029
  </body>
2047
2030
  </html>
2048
2031
  `);
2049
2032
  doc.close();
2050
2033
 
2051
- if (gameHtml) {
2052
- const f = doc.getElementById('game-frame');
2053
- if (f) f.srcdoc = this.cleanAndOptimizeGameHTML(gameHtml);
2054
- }
2055
-
2056
- this.showToast("Game opened in about:blank tab with watermark & return controls.");
2034
+ this.showToast("Game opened in disguised about:blank tab.");
2057
2035
  }
2058
2036
  }
2059
2037
 
@@ -2531,6 +2509,48 @@ class ReaperHubApp {
2531
2509
  }
2532
2510
  }
2533
2511
  });
2512
+
2513
+ // Guaranteed Click Delegation for Games Grid & Recent Games Grid
2514
+ const gamesGrid = document.getElementById('games-grid');
2515
+ if (gamesGrid) {
2516
+ gamesGrid.addEventListener('click', (e) => {
2517
+ const favBtn = e.target.closest('.btn-fav');
2518
+ if (favBtn) {
2519
+ e.preventDefault();
2520
+ e.stopPropagation();
2521
+ const id = favBtn.getAttribute('data-id');
2522
+ if (id !== null) this.toggleFavorite(id);
2523
+ return;
2524
+ }
2525
+
2526
+ const card = e.target.closest('.game-card');
2527
+ const playBtn = e.target.closest('.btn-card-play');
2528
+ if (card || playBtn) {
2529
+ e.preventDefault();
2530
+ e.stopPropagation();
2531
+ const target = playBtn || card;
2532
+ const id = target.getAttribute('data-id') || (card ? card.getAttribute('data-id') : null);
2533
+ if (id !== null) {
2534
+ this.launchGame(id);
2535
+ }
2536
+ }
2537
+ });
2538
+ }
2539
+
2540
+ const recentGrid = document.getElementById('recent-games-grid');
2541
+ if (recentGrid) {
2542
+ recentGrid.addEventListener('click', (e) => {
2543
+ const card = e.target.closest('.recent-card');
2544
+ if (card) {
2545
+ e.preventDefault();
2546
+ e.stopPropagation();
2547
+ const id = card.getAttribute('data-id');
2548
+ if (id !== null) {
2549
+ this.launchGame(id);
2550
+ }
2551
+ }
2552
+ });
2553
+ }
2534
2554
  }
2535
2555
 
2536
2556
  openSettingsModal() {
package/main/js/app.js CHANGED
@@ -1654,20 +1654,20 @@ class ReaperHubApp {
1654
1654
  const coverUrl = game.cover || `https://placehold.co/400x250/041022/ffffff?text=${encodeURIComponent(game.name)}`;
1655
1655
 
1656
1656
  return `
1657
- <div class="game-card" onclick="app.launchGame('${game.id}')">
1657
+ <div class="game-card" data-id="${game.id}" onclick="app.launchGame('${game.id}')">
1658
1658
  <div class="game-thumb-container">
1659
- <img class="game-thumb" src="${coverUrl}" alt="${game.name}" loading="lazy" onerror="this.onerror=null; this.src='https://placehold.co/400x250/041022/ffffff?text=${encodeURIComponent(game.name)}';" />
1659
+ <img class="game-thumb" src="${coverUrl}" alt="${this.escapeHtml(game.name)}" loading="lazy" onerror="this.onerror=null; this.src='https://placehold.co/400x250/041022/ffffff?text=${encodeURIComponent(game.name)}';" />
1660
1660
  ${game.featured ? '<span class="game-badge-featured">FEATURED</span>' : ''}
1661
1661
  </div>
1662
1662
  <div class="game-info">
1663
- <div class="game-title" title="${game.name}">${game.name}</div>
1663
+ <div class="game-title" title="${this.escapeHtml(game.name)}">${this.escapeHtml(game.name)}</div>
1664
1664
  <div class="game-meta">
1665
- <span class="game-author">${game.author || 'GN-Math'}</span>
1666
- <button class="btn-fav ${isFav ? 'active' : ''}" onclick="event.stopPropagation(); app.toggleFavorite('${game.id}')" title="${isFav ? 'Remove from favorites' : 'Add to favorites'}">
1665
+ <span class="game-author">${this.escapeHtml(game.author || 'GN-Math')}</span>
1666
+ <button class="btn-fav ${isFav ? 'active' : ''}" data-id="${game.id}" onclick="event.stopPropagation(); app.toggleFavorite('${game.id}')" title="${isFav ? 'Remove from favorites' : 'Add to favorites'}">
1667
1667
  ${isFav ? '★ SAVED' : '☆ FAV'}
1668
1668
  </button>
1669
1669
  </div>
1670
- <button class="btn-card-play" onclick="event.stopPropagation(); app.launchGame('${game.id}')">PLAY GAME</button>
1670
+ <button class="btn-card-play" data-id="${game.id}" onclick="event.stopPropagation(); app.launchGame('${game.id}')">PLAY GAME</button>
1671
1671
  </div>
1672
1672
  </div>
1673
1673
  `;
@@ -1932,7 +1932,7 @@ class ReaperHubApp {
1932
1932
 
1933
1933
  const filename = game.url.split('/').pop();
1934
1934
  iframe.removeAttribute('srcdoc');
1935
- iframe.src = `https://raw.githack.com/gn-math/html/main/${filename}`;
1935
+ iframe.src = `https://gn-math.github.io/html/${filename}`;
1936
1936
 
1937
1937
  setTimeout(() => {
1938
1938
  try {
@@ -1979,23 +1979,10 @@ class ReaperHubApp {
1979
1979
  const filename = this.currentGame.url.split('/').pop();
1980
1980
  const gameName = this.currentGame.name;
1981
1981
  const siteUrl = window.location.href;
1982
+ const gameUrl = `https://gn-math.github.io/html/${filename}`;
1982
1983
  const win = window.open('about:blank', '_blank');
1983
1984
  if (win) {
1984
1985
  const doc = win.document;
1985
- doc.title = "Home - Google Classroom";
1986
-
1987
- let gameHtml = '';
1988
- try {
1989
- const res = await fetch(`https://raw.githubusercontent.com/gn-math/html/main/${filename}`);
1990
- if (res.ok) {
1991
- gameHtml = await res.text();
1992
- if (gameHtml && gameHtml.length > 50) {
1993
- gameHtml = gameHtml.replace(/https?:\/\/cdn\.jsdelivr\.net\/gh\//g, 'https://fastly.jsdelivr.net/gh/');
1994
- gameHtml = gameHtml.replace(/https?:\/\/cdn\.jsdelivr\.net\/npm\//g, 'https://fastly.jsdelivr.net/npm/');
1995
- }
1996
- }
1997
- } catch (e) {}
1998
-
1999
1986
  doc.open();
2000
1987
  doc.write(`
2001
1988
  <!DOCTYPE html>
@@ -2030,10 +2017,6 @@ class ReaperHubApp {
2030
2017
  pointer-events: none; user-select: none;
2031
2018
  }
2032
2019
  </style>
2033
- <script>
2034
- // Client-Side Ad & Pop-up Blocker
2035
- window.open = function() { console.log('[REAPER SHIELD] Ad pop-up blocked'); return null; };
2036
- <\/script>
2037
2020
  </head>
2038
2021
  <body>
2039
2022
  <div class="reaper-bar">
@@ -2042,18 +2025,13 @@ class ReaperHubApp {
2042
2025
  <button onclick="document.getElementById('game-frame').contentWindow.location.reload()" class="btn-action">🔄 RELOAD</button>
2043
2026
  </div>
2044
2027
  <div class="reaper-watermark">REAPER HUB</div>
2045
- <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>
2028
+ <iframe id="game-frame" src="${gameUrl}" allow="autoplay; fullscreen; gamepad; focus-without-user-activation; pointer-lock"></iframe>
2046
2029
  </body>
2047
2030
  </html>
2048
2031
  `);
2049
2032
  doc.close();
2050
2033
 
2051
- if (gameHtml) {
2052
- const f = doc.getElementById('game-frame');
2053
- if (f) f.srcdoc = this.cleanAndOptimizeGameHTML(gameHtml);
2054
- }
2055
-
2056
- this.showToast("Game opened in about:blank tab with watermark & return controls.");
2034
+ this.showToast("Game opened in disguised about:blank tab.");
2057
2035
  }
2058
2036
  }
2059
2037
 
@@ -2531,6 +2509,48 @@ class ReaperHubApp {
2531
2509
  }
2532
2510
  }
2533
2511
  });
2512
+
2513
+ // Guaranteed Click Delegation for Games Grid & Recent Games Grid
2514
+ const gamesGrid = document.getElementById('games-grid');
2515
+ if (gamesGrid) {
2516
+ gamesGrid.addEventListener('click', (e) => {
2517
+ const favBtn = e.target.closest('.btn-fav');
2518
+ if (favBtn) {
2519
+ e.preventDefault();
2520
+ e.stopPropagation();
2521
+ const id = favBtn.getAttribute('data-id');
2522
+ if (id !== null) this.toggleFavorite(id);
2523
+ return;
2524
+ }
2525
+
2526
+ const card = e.target.closest('.game-card');
2527
+ const playBtn = e.target.closest('.btn-card-play');
2528
+ if (card || playBtn) {
2529
+ e.preventDefault();
2530
+ e.stopPropagation();
2531
+ const target = playBtn || card;
2532
+ const id = target.getAttribute('data-id') || (card ? card.getAttribute('data-id') : null);
2533
+ if (id !== null) {
2534
+ this.launchGame(id);
2535
+ }
2536
+ }
2537
+ });
2538
+ }
2539
+
2540
+ const recentGrid = document.getElementById('recent-games-grid');
2541
+ if (recentGrid) {
2542
+ recentGrid.addEventListener('click', (e) => {
2543
+ const card = e.target.closest('.recent-card');
2544
+ if (card) {
2545
+ e.preventDefault();
2546
+ e.stopPropagation();
2547
+ const id = card.getAttribute('data-id');
2548
+ if (id !== null) {
2549
+ this.launchGame(id);
2550
+ }
2551
+ }
2552
+ });
2553
+ }
2534
2554
  }
2535
2555
 
2536
2556
  openSettingsModal() {
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "reaper-arcade-hub",
3
- "version": "2.0.7",
4
- "description": "Reaper Hub - Strict HWID Key Gatekeeper, 788 High-Speed Games, Security Shield, Realtime Chat & DMs, Playtime Leaderboard & Working Game Launcher",
3
+ "version": "2.0.9",
4
+ "description": "Reaper Hub - Full Click Delegation & Recoded Games Tab, Direct 788-Game Loading (GitHub Pages CDN), Strict Key Gatekeeper, Security Shield & Realtime Chat",
5
5
  "main": "main/index.html",
6
6
  "unpkg": "main/index.html",
7
7
  "jsdelivr": "main/index.html",