|
3 | 3 | <head> |
4 | 4 | <meta charset="UTF-8"> |
5 | 5 | <meta name="viewport" content="width=device-width, initial-scale=1.0"> |
6 | | - <title>Rutu's Website</title> |
| 6 | + <title>Welcome Dashboard</title> |
7 | 7 | <style> |
8 | | - /* Reset */ |
9 | | - * { margin: 0; padding: 0; box-sizing: border-box; } |
10 | | - |
11 | 8 | body { |
12 | | - font-family: Arial, sans-serif; |
| 9 | + margin: 0; |
13 | 10 | height: 100vh; |
14 | | - background: linear-gradient(135deg, #6a11cb, #2575fc); |
15 | | - color: white; |
16 | 11 | display: flex; |
17 | 12 | justify-content: center; |
18 | 13 | align-items: center; |
| 14 | + background: #111; |
| 15 | + color: white; |
| 16 | + font-family: Arial, sans-serif; |
19 | 17 | overflow: hidden; |
| 18 | + flex-direction: column; |
20 | 19 | } |
21 | 20 |
|
22 | | - .fade { |
23 | | - opacity: 0; |
24 | | - transition: opacity 1s ease-in-out; |
25 | | - } |
26 | | - |
27 | | - .fade.show { |
28 | | - opacity: 1; |
29 | | - } |
30 | | - |
31 | | - .container { |
32 | | - text-align: center; |
33 | | - max-width: 400px; |
34 | | - width: 90%; |
| 21 | + #nameInputBox { |
| 22 | + display: flex; |
| 23 | + flex-direction: column; |
| 24 | + align-items: center; |
35 | 25 | } |
36 | 26 |
|
37 | | - h1, h2, p { |
38 | | - margin-bottom: 20px; |
| 27 | + input { |
| 28 | + padding: 8px; |
| 29 | + border-radius: 8px; |
| 30 | + border: none; |
| 31 | + margin-bottom: 10px; |
| 32 | + font-size: 16px; |
39 | 33 | } |
40 | 34 |
|
41 | 35 | button { |
42 | | - padding: 10px 20px; |
| 36 | + padding: 8px 15px; |
| 37 | + border-radius: 8px; |
43 | 38 | border: none; |
44 | | - border-radius: 25px; |
45 | | - background: #fff; |
46 | | - color: #2575fc; |
47 | | - font-weight: bold; |
48 | 39 | cursor: pointer; |
| 40 | + font-size: 16px; |
| 41 | + background: #0af; |
| 42 | + color: white; |
49 | 43 | transition: 0.3s; |
50 | 44 | } |
51 | 45 |
|
52 | 46 | button:hover { |
53 | | - background: #eee; |
| 47 | + background: #09c; |
54 | 48 | } |
55 | 49 |
|
56 | | - .input-container { |
57 | | - display: flex; |
58 | | - align-items: center; |
59 | | - justify-content: center; |
60 | | - gap: 10px; |
| 50 | + .flicker { |
| 51 | + margin-top: 15px; |
| 52 | + font-size: 18px; |
| 53 | + animation: flicker 1.2s infinite alternate; |
| 54 | + cursor: pointer; |
61 | 55 | } |
62 | 56 |
|
63 | | - input { |
64 | | - padding: 10px; |
65 | | - border-radius: 25px; |
66 | | - border: none; |
67 | | - outline: none; |
68 | | - width: 60%; |
| 57 | + @keyframes flicker { |
| 58 | + 0% { opacity: 1; } |
| 59 | + 50% { opacity: 0.3; } |
| 60 | + 100% { opacity: 1; } |
69 | 61 | } |
70 | 62 |
|
71 | | - #dashboard h2 { |
72 | | - font-size: 26px; |
73 | | - margin-bottom: 10px; |
| 63 | + #dashboard { |
| 64 | + display: none; |
| 65 | + width: 100%; |
| 66 | + height: 100vh; |
| 67 | + background: white; |
| 68 | + color: black; |
| 69 | + justify-content: center; |
| 70 | + align-items: center; |
| 71 | + font-size: 24px; |
74 | 72 | } |
75 | 73 | </style> |
76 | 74 | </head> |
77 | 75 | <body> |
78 | | - <!-- Welcome Screen --> |
79 | | - <div id="welcome" class="container fade show"> |
80 | | - <h1>Welcome 👋</h1> |
81 | | - <button onclick="goToName()">Next</button> |
| 76 | + |
| 77 | + <!-- Name Input --> |
| 78 | + <div id="nameInputBox"> |
| 79 | + <input type="text" id="username" placeholder="Enter your name"> |
| 80 | + <button onclick="showWelcome()">Start</button> |
82 | 81 | </div> |
83 | 82 |
|
84 | | - <!-- Name Input Screen --> |
85 | | - <div id="nameScreen" class="container fade" style="display:none;"> |
86 | | - <h2>Provide us your name</h2> |
87 | | - <p>For better conversation 😊</p> |
88 | | - <div class="input-container"> |
89 | | - <input type="text" id="nameInput" placeholder="Enter your name"> |
90 | | - <button onclick="saveName()">Done</button> |
91 | | - </div> |
| 83 | + <!-- Welcome Screen --> |
| 84 | + <div id="welcomeScreen" style="display:none; text-align:center;"> |
| 85 | + <h1 id="greeting"></h1> |
| 86 | + <div class="flicker" onclick="openDashboard()">Click on screen for next</div> |
92 | 87 | </div> |
93 | 88 |
|
94 | 89 | <!-- Dashboard --> |
95 | | - <div id="dashboard" class="container fade" style="display:none;"> |
96 | | - <h2 id="greeting"></h2> |
97 | | - <p>Welcome to your dashboard 🚀</p> |
| 90 | + <div id="dashboard"> |
| 91 | + <h2>🎮 Your White Dashboard (Game area)</h2> |
98 | 92 | </div> |
99 | 93 |
|
100 | 94 | <script> |
101 | | - const welcome = document.getElementById("welcome"); |
102 | | - const nameScreen = document.getElementById("nameScreen"); |
103 | | - const dashboard = document.getElementById("dashboard"); |
104 | | - const greeting = document.getElementById("greeting"); |
105 | | - const nameInput = document.getElementById("nameInput"); |
106 | | - |
107 | | - // Agar user pehle se name save kar chuka hai |
108 | | - window.onload = () => { |
109 | | - const savedName = localStorage.getItem("username"); |
110 | | - if (savedName) { |
111 | | - showDashboard(savedName); |
112 | | - } |
113 | | - }; |
114 | | - |
115 | | - function goToName() { |
116 | | - fadeOut(welcome, () => { |
117 | | - nameScreen.style.display = "block"; |
118 | | - fadeIn(nameScreen); |
119 | | - }); |
120 | | - } |
| 95 | + function showWelcome() { |
| 96 | + let name = document.getElementById("username").value; |
| 97 | + if (name.trim() === "") name = "User"; |
121 | 98 |
|
122 | | - function saveName() { |
123 | | - const name = nameInput.value.trim(); |
124 | | - if (name) { |
125 | | - localStorage.setItem("username", name); |
126 | | - fadeOut(nameScreen, () => { |
127 | | - showDashboard(name); |
128 | | - }); |
129 | | - } else { |
130 | | - alert("Please enter your name 🙂"); |
131 | | - } |
132 | | - } |
133 | | - |
134 | | - function showDashboard(name) { |
135 | | - greeting.textContent = `Hello, ${name}!`; |
136 | | - dashboard.style.display = "block"; |
137 | | - fadeIn(dashboard); |
138 | | - } |
| 99 | + document.getElementById("nameInputBox").style.display = "none"; |
| 100 | + document.getElementById("welcomeScreen").style.display = "block"; |
139 | 101 |
|
140 | | - // Animation helpers |
141 | | - function fadeOut(element, callback) { |
142 | | - element.classList.remove("show"); |
143 | | - setTimeout(() => { |
144 | | - element.style.display = "none"; |
145 | | - if (callback) callback(); |
146 | | - }, 1000); // 1s = same as CSS transition |
| 102 | + document.getElementById("greeting").innerText = `Hello, ${name}!`; |
147 | 103 | } |
148 | 104 |
|
149 | | - function fadeIn(element) { |
150 | | - setTimeout(() => { |
151 | | - element.classList.add("show"); |
152 | | - }, 50); |
| 105 | + function openDashboard() { |
| 106 | + document.getElementById("welcomeScreen").style.display = "none"; |
| 107 | + document.getElementById("dashboard").style.display = "flex"; |
153 | 108 | } |
154 | 109 | </script> |
| 110 | + |
155 | 111 | </body> |
156 | 112 | </html> |
0 commit comments