22< html lang ="it ">
33< head >
44 < meta charset ="UTF-8 ">
5- <!-- Per una grafica desktop, rimuoviamo il meta viewport o lo impostiamo per larghezze fisse -->
5+ <!-- Layout fisso per desktop -->
66 < meta name ="viewport " content ="width=1200 ">
7- < title > PTLANCHER</ title >
7+ < title > Bonazza - PTLANCHER</ title >
88 < link id ="dynamic-favicon " rel ="icon " href ="https://i.postimg.cc/XYfBdscq/icon.png " type ="image/png ">
99 < link href ="https://fonts.googleapis.com/css2?family=Roboto:wght@400;500;700&display=swap " rel ="stylesheet ">
1010 < style >
3232 color : # fff ;
3333 padding : 10px 20px ;
3434 }
35- header h1 {
36- margin : 0 ;
37- font-size : 1.8 rem ;
35+ /* Blocco account-info presente nell'header */
36+ . account-info {
37+ font-size : 1 rem ;
3838 }
39+ .account-info a {
40+ text-decoration : none;
41+ font-weight : 500 ;
42+ /* Colore link per evidenziare il rinnovo e il logout */
43+ color : # e74c3c ;
44+ }
45+ /* Blocco online-status nell'header */
3946 # online-status {
4047 display : flex;
4148 align-items : center;
4956 background : # 00e676 ;
5057 margin-right : 8px ;
5158 }
59+ # online-count {
60+ margin : 0 5px ;
61+ }
5262 .container {
5363 padding : 20px ;
5464 }
5868 display : block;
5969 border-bottom : 1px solid # ddd ;
6070 }
61- .account-info {
62- margin : 10px 0 ;
63- text-align : right;
64- font-weight : 500 ;
65- }
66- .account-info a {
67- text-decoration : none;
68- font-weight : 500 ;
69- color : # e74c3c ;
70- }
7171 .search-bar {
7272 margin : 20px 0 ;
7373 }
104104 box-shadow : 0 4px 10px rgba (0 , 0 , 0 , 0.1 );
105105 transition : transform 0.3s ;
106106 }
107- .game-card : hover {
108- transform : scale (1.02 );
109- }
107+ .game-card : hover { transform : scale (1.02 ); }
110108 .game-card img {
111109 width : 100% ;
112110 height : 150px ;
146144 text-decoration : none;
147145 border-radius : 4px ;
148146 transition : background-color 0.3s ;
147+ cursor : pointer;
148+ /* Impedisci il trascinamento del link */
149+ -webkit-user-drag : none;
150+ user-select : none;
149151 }
150152 .download-btn : hover {
151153 background-color : # 45a049 ;
152154 }
155+ /* Logout button con sfondo bianco e testo in rosso */
153156 .logout-btn {
154- background-color : # e74c3c ;
155- color : # fff ;
157+ background-color : # fff ;
158+ color : # e74c3c ;
156159 padding : 8px 16px ;
157160 text-decoration : none;
158161 border-radius : 4px ;
159- transition : background-color 0.3s ;
162+ border : 2px solid # e74c3c ;
163+ transition : background-color 0.3s , color 0.3s ;
160164 font-weight : 500 ;
165+ cursor : pointer;
166+ -webkit-user-drag : none;
167+ user-select : none;
161168 }
162169 .logout-btn : hover {
163- background-color : # c0392b ;
170+ background-color : # e74c3c ;
171+ color : # fff ;
164172 }
165173 </ style >
166174</ head >
167175< body >
168176 < div class ="wrapper ">
169177 < header >
170- < h1 > Bonazza - PTLANCHER</ h1 >
171- <!-- Bollino online -->
178+ <!-- Rimosso il titolo, ora solo il blocco account-info e online-status -->
179+ < div class ="account-info " id ="account-info ">
180+ < span > Benvenuto, < strong > Admin</ strong > </ span > | Abbonamento scade tra 1 mese
181+ < a href ="login.html " style ="color:#e74c3c; "> Rinnova abbonamento</ a > |
182+ < a href ="# " id ="logout " class ="logout-btn "> Logout</ a >
183+ </ div >
172184 < div id ="online-status ">
173185 < span class ="online-dot "> </ span >
174186 < span id ="online-count "> 0</ span > utenti online
175187 </ div >
176188 </ header >
177189 < div class ="container ">
178- <!-- Banner -->
179190 < div class ="banner ">
180191 < img src ="https://raw.githubusercontent.com/Server21/PCGames/refs/heads/main/Best/banner.png " alt ="Banner PTLANCHER ">
181192 </ div >
182- < div class ="account-info " id ="account-info ">
183- <!-- Le informazioni dell'account verranno visualizzate qui -->
184- </ div >
185193 < div class ="search-bar ">
186194 < input type ="text " id ="search-input " placeholder ="Cerca giochi per nome, descrizione o lingua... ">
187195 </ div >
@@ -211,16 +219,9 @@ <h1>Bonazza - PTLANCHER</h1>
211219 // Mostra le informazioni dell'account
212220 function mostraAccountInfo ( user ) {
213221 const accountInfoDiv = document . getElementById ( "account-info" ) ;
214- let infoHtml = `<span>Benvenuto, <strong>${ user . username } </strong></span>` ;
215- if ( user . expires ) {
216- const mesiMancanti = calcolaMesiMancanti ( user . expires ) ;
217- infoHtml += ` | Abbonamento scade tra ${ mesiMancanti } mese${ mesiMancanti !== 1 ? "i" : "" } ` ;
218- if ( mesiMancanti <= 1 )
219- infoHtml += ` <a href="login.html" style="color:#e74c3c;">Rinnova abbonamento</a>` ;
220- } else {
221- infoHtml += ` | <a href="login.html" style="color:#e74c3c;">Attiva abbonamento</a>` ;
222- }
223- infoHtml += ` | <a href="#" id="logout" class="logout-btn">Logout</a>` ;
222+ // In questo esempio, il contenuto è statico ("Admin", "1 mese")
223+ let infoHtml = `<span>Benvenuto, <strong>${ user . username || "Admin" } </strong></span> | Abbonamento scade tra 1 mese ` ;
224+ infoHtml += `| <a href="#" id="logout" class="logout-btn">Logout</a>` ;
224225 accountInfoDiv . innerHTML = infoHtml ;
225226
226227 document . getElementById ( "logout" ) . addEventListener ( "click" , function ( e ) {
@@ -231,7 +232,7 @@ <h1>Bonazza - PTLANCHER</h1>
231232 } ) ;
232233 }
233234
234- // Funzioni per visualizzare e filtrare i giochi
235+ // Funzione per visualizzare i giochi e impostare il comportamento dei pulsanti download
235236 function displayGames ( games ) {
236237 const grid = document . getElementById ( "games-grid" ) ;
237238 grid . innerHTML = "" ;
@@ -250,6 +251,26 @@ <h3>${game.name}</h3>
250251 </div>
251252 ` ;
252253 grid . appendChild ( card ) ;
254+
255+ // Aggiungi i listener per nascondere il link durante l'hover e disabilitare il contextmenu
256+ const downloadBtn = card . querySelector ( '.download-btn' ) ;
257+ if ( downloadBtn ) {
258+ // Conserva il link originale in un data attribute
259+ downloadBtn . dataset . download = downloadBtn . getAttribute ( 'href' ) ;
260+ downloadBtn . addEventListener ( 'mouseenter' , function ( e ) {
261+ this . removeAttribute ( 'href' ) ;
262+ } ) ;
263+ downloadBtn . addEventListener ( 'mouseleave' , function ( e ) {
264+ this . setAttribute ( 'href' , this . dataset . download ) ;
265+ } ) ;
266+ downloadBtn . addEventListener ( 'click' , function ( e ) {
267+ e . preventDefault ( ) ;
268+ window . location . href = this . dataset . download ;
269+ } ) ;
270+ downloadBtn . addEventListener ( 'contextmenu' , function ( e ) {
271+ e . preventDefault ( ) ;
272+ } ) ;
273+ }
253274 } ) ;
254275 }
255276
@@ -340,23 +361,22 @@ <h3>${game.name}</h3>
340361 }
341362 }
342363
343- // Funzione per aggiornare il numero di utenti online
364+ // Funzione per aggiornare il numero di utenti online (con fallback a un valore fisso)
344365 async function updateOnlineCount ( ) {
345366 try {
346- // Sostituisci l'URL qui con l'endpoint reale che restituisce un JSON del tipo: { "online": 123 }
347367 const response = await fetch ( "https://raw.githubusercontent.com/Server21/PCGames/refs/heads/main/online_count.json" ) ;
348368 if ( response . ok ) {
349369 const data = await response . json ( ) ;
350370 document . getElementById ( "online-count" ) . innerText = data . online ;
351371 } else {
352- console . error ( "Errore nel recupero del conteggio online" ) ;
372+ document . getElementById ( " online-count" ) . innerText = 123 ;
353373 }
354374 } catch ( error ) {
355375 console . error ( "Errore nella fetch del conteggio online:" , error ) ;
376+ document . getElementById ( "online-count" ) . innerText = 123 ;
356377 }
357378 }
358379
359- // Inizializza la pagina
360380 async function init ( ) {
361381 let user = getLoggedInUser ( ) ;
362382 if ( ! user ) {
@@ -388,14 +408,14 @@ <h3>${game.name}</h3>
388408 await fetchAccounts ( ) ;
389409 await fetchVersionInfo ( ) ;
390410
391- // Avvia il polling per aggiornare il conteggio degli utenti online ogni 10 secondi
411+ // Aggiorna il conteggio degli utenti online ogni 10 secondi
392412 updateOnlineCount ( ) ;
393413 setInterval ( updateOnlineCount , 10000 ) ;
394414 }
395415
396416 document . addEventListener ( "DOMContentLoaded" , init ) ;
397417
398- // Gestione degli anchor per evitare redirect in loop
418+ // Gestione degli anchor per evitare loop di redirect
399419 document . addEventListener ( 'click' , function ( event ) {
400420 const anchor = event . target . closest ( 'a' ) ;
401421 if ( anchor && anchor . href ) {
0 commit comments