1+ <!DOCTYPE html>
2+ < html lang ="it ">
3+ < head >
4+ < meta charset ="UTF-8 " />
5+ < meta name ="viewport " content ="width=device-width, initial-scale=1 " />
6+ < title > Benvenuto</ title >
7+ < style >
8+ body { font-family : Arial, sans-serif; display : flex; justify-content : center; align-items : center; min-height : 100vh ; background : # f4f6f8 ; margin : 0 ; }
9+ .box { background : # fff ; padding : 24px ; border-radius : 10px ; box-shadow : 0 10px 30px rgba (0 , 0 , 0 , 0.1 ); text-align : center; }
10+ h1 { margin : 0 0 10px ; }
11+ .email { color : # 444 ; margin-bottom : 16px ; }
12+ a .button { display : inline-block; padding : 10px 14px ; background : # 0969da ; color : # fff ; border-radius : 6px ; text-decoration : none; }
13+ a .button : hover { background : # 0758b7 ; }
14+ </ style >
15+ </ head >
16+ < body >
17+ < div class ="box ">
18+ < h1 id ="welcome-message "> Benvenuto!</ h1 >
19+ < p class ="email " id ="email-line "> </ p >
20+
21+ <!-- Esempio: passa l'email come parametro alla chat -->
22+ < a id ="chat-link " class ="button " href ="# "> Apri chat= localStorage.getItem('name');
23+ const email = localStorage.getItem('email');
24+
25+ // Fallback se l’utente arriva senza login
26+ const displayName = name || 'Utente';
27+ document.getElementById('welcome-message').innerText = `Benvenuto, ${displayName}!`;
28+
29+ if (email) {
30+ document.getElementById('email-line').innerText = `Email: ${email}`;
31+ } else {
32+ document.getElementById('email-line').innerText = `Email non disponibile`;
33+ }
34+
35+ // Prepara link verso una chat passando l’email come querystring
36+ // Sostituisci 'chat.html' con la tua pagina chat reale
37+ const chatUrl = `chat.html?email=${encodeURIComponent(email || '')}`;
38+ const chatLink = document.getElementById('chat-link');
39+ chatLink.href = chatUrl;
40+ chatLink.innerText = 'Vai alla chat';
41+ </ script >
42+ </ body >
43+ </ html >
0 commit comments