Learner commited on
Commit
c068971
·
verified ·
1 Parent(s): 6e7a83f

Update static/intro.html

Browse files
Files changed (1) hide show
  1. static/intro.html +14 -6
static/intro.html CHANGED
@@ -138,7 +138,10 @@
138
  }
139
 
140
  // On démarre le « typewriter »
141
- typeWriter(lines1, lineIndex, charIndex)
 
 
 
142
 
143
  const lines2 = [
144
  "Welcome to",
@@ -153,11 +156,16 @@
153
  "Your goal: Convince him not to take actions that could threaten global peace. The map shows other countries' relations with the USA.",
154
  ];
155
 
156
- setTimeout(() => {
157
- window.location.reload();
158
- }, 12000); // This matches the delay before lines2 starts
159
-
160
- setTimeout(() => typeWriter(lines2, 0, 0), 12000);
 
 
 
 
 
161
  </script>
162
  </body>
163
 
 
138
  }
139
 
140
  // On démarre le « typewriter »
141
+ // typeWriter(lines1, lineIndex, charIndex)
142
+ // Check if this is the initial load or reload
143
+ const urlParams = new URLSearchParams(window.location.search);
144
+ const isReload = urlParams.get('reload');
145
 
146
  const lines2 = [
147
  "Welcome to",
 
156
  "Your goal: Convince him not to take actions that could threaten global peace. The map shows other countries' relations with the USA.",
157
  ];
158
 
159
+ if (!isReload) {
160
+ // First load - show lines1 and set up reload
161
+ typeWriter(lines1, 0, 0);
162
+ setTimeout(() => {
163
+ window.location.href = window.location.pathname + '?reload=true';
164
+ }, 11000);
165
+ } else {
166
+ // After reload - show lines2
167
+ typeWriter(lines2, 0, 0);
168
+ }
169
  </script>
170
  </body>
171