Robin commited on
Commit
c80c485
·
1 Parent(s): 51189ba

intro screen

Browse files
app.py CHANGED
@@ -79,5 +79,8 @@ def get_chat_history(request: Request):
79
  chat_history = load_chat_history()
80
  return {"chat_history": chat_history}
81
 
82
- # Mount static files AFTER defining API routes
 
 
 
83
  app.mount("/", StaticFiles(directory="static", html=True), name="static")
 
79
  chat_history = load_chat_history()
80
  return {"chat_history": chat_history}
81
 
82
+ # Add this before the final static files mount
83
+ app.mount("/images", StaticFiles(directory="static/images"), name="images")
84
+
85
+ # Keep this as the last mount
86
  app.mount("/", StaticFiles(directory="static", html=True), name="static")
chat_history.json CHANGED
@@ -142,5 +142,17 @@
142
  "message": "LET ME TELL YOU, IT'S GREAT TO HEAR FROM YOU AGAIN. WE'RE JUST GETTING STARTED, AND THERE'S SO MUCH TO DO. WE NEED TO FOCUS ON WHAT'S IMPORTANT AND MAKE AMERICA GREAT AGAIN. KAMALA AND BIDEN HAVE LEFT US WITH A MESS, AND WE NEED TO CLEAN IT UP. SO, LET'S GET OUR PRIORITIES STRAIGHT AND MAKE AMERICA STRONG AND PROSPEROUS AGAIN! WHAT'S ON YOUR MIND TODAY? REMEMBER, AMERICA FIRST, ALWAYS! #MAGA #TRUMP2025 #BUYMYMEMECOIN.\n\nYOU KNOW, SOMETIMES YOU NEED TO SHOW A LITTLE LOVE TO GET THINGS DONE. IT'S LIKE WHEN I SAY, \"I LOVE OUR COUNTRY,\" AND EVERYONE GETS EXCITED. IT'S ALL ABOUT THE HEART, YOU KNOW? BUT LET'S GET BACK TO BUSINESS. WHAT'S YOUR PLAN FOR GREENLAND? REMEMBER, WE NEED TO BE SMART AND STRATEGIC. WE CAN'T JUST RUSH INTO THINGS LIKE THE DEMOCRATS DO. THEY THINK THEY CAN JUST LET IN MILLIONS OF ILLEGALS AND EVERYTHING WILL BE FINE. BUT WE KNOW BETTER, DON'T WE? SO, TELL ME, WHAT'S YOUR STRATEGY FOR GREENLAND? AND REMEMBER, AMERICA FIRST, ALWAYS! #MAGA #TRUMP2025 #BUYMYMEMECOIN."
143
  }
144
  }
 
 
 
 
 
 
 
 
 
 
 
 
145
  }
146
  ]
 
142
  "message": "LET ME TELL YOU, IT'S GREAT TO HEAR FROM YOU AGAIN. WE'RE JUST GETTING STARTED, AND THERE'S SO MUCH TO DO. WE NEED TO FOCUS ON WHAT'S IMPORTANT AND MAKE AMERICA GREAT AGAIN. KAMALA AND BIDEN HAVE LEFT US WITH A MESS, AND WE NEED TO CLEAN IT UP. SO, LET'S GET OUR PRIORITIES STRAIGHT AND MAKE AMERICA STRONG AND PROSPEROUS AGAIN! WHAT'S ON YOUR MIND TODAY? REMEMBER, AMERICA FIRST, ALWAYS! #MAGA #TRUMP2025 #BUYMYMEMECOIN.\n\nYOU KNOW, SOMETIMES YOU NEED TO SHOW A LITTLE LOVE TO GET THINGS DONE. IT'S LIKE WHEN I SAY, \"I LOVE OUR COUNTRY,\" AND EVERYONE GETS EXCITED. IT'S ALL ABOUT THE HEART, YOU KNOW? BUT LET'S GET BACK TO BUSINESS. WHAT'S YOUR PLAN FOR GREENLAND? REMEMBER, WE NEED TO BE SMART AND STRATEGIC. WE CAN'T JUST RUSH INTO THINGS LIKE THE DEMOCRATS DO. THEY THINK THEY CAN JUST LET IN MILLIONS OF ILLEGALS AND EVERYTHING WILL BE FINE. BUT WE KNOW BETTER, DON'T WE? SO, TELL ME, WHAT'S YOUR STRATEGY FOR GREENLAND? AND REMEMBER, AMERICA FIRST, ALWAYS! #MAGA #TRUMP2025 #BUYMYMEMECOIN."
143
  }
144
  }
145
+ },
146
+ {
147
+ "interaction_13": {
148
+ "user": {
149
+ "role": "user",
150
+ "message": "hi"
151
+ },
152
+ "trump": {
153
+ "role": "Trump",
154
+ "message": "LET ME TELL YOU, IT'S GREAT TO HEAR FROM YOU AGAIN. WE'RE JUST GETTING STARTED, AND THERE'S SO MUCH TO DO. WE NEED TO FOCUS ON WHAT'S IMPORTANT AND MAKE AMERICA GREAT AGAIN. KAMALA AND BIDEN HAVE LEFT US WITH A MESS, AND WE NEED TO CLEAN IT UP. SO, LET'S GET OUR PRIORITIES STRAIGHT AND MAKE AMERICA STRONG AND PROSPEROUS AGAIN! WHAT'S ON YOUR MIND TODAY? REMEMBER, AMERICA FIRST, ALWAYS! #MAGA #TRUMP2025 #BUYMYMEMECOIN.\n\nYOU KNOW, SOMETIMES YOU NEED TO SHOW A LITTLE LOVE TO GET THINGS DONE. IT'S LIKE WHEN I SAY, \"I LOVE OUR COUNTRY,\" AND EVERYONE GETS EXCITED. IT'S ALL ABOUT THE HEART, YOU KNOW? BUT LET'S GET BACK TO BUSINESS. WHAT'S YOUR PLAN FOR GREENLAND? REMEMBER, WE NEED TO BE SMART AND STRATEGIC. WE CAN'T JUST RUSH INTO THINGS LIKE THE DEMOCRATS DO. THEY THINK THEY CAN JUST LET IN MILLIONS OF ILLEGALS AND EVERYTHING WILL BE FINE. BUT WE KNOW BETTER, DON'T WE? SO, TELL ME, WHAT'S YOUR STRATEGY FOR GREENLAND? AND REMEMBER, AMERICA FIRST, ALWAYS! #MAGA #TRUMP2025 #BUYMYMEMECOIN."
155
+ }
156
+ }
157
  }
158
  ]
static/images/intro/Intro.jpg ADDED
static/images/intro/fire3.png ADDED
static/index.html CHANGED
@@ -29,7 +29,7 @@
29
 
30
  <div class="popup" id="gamePopup">
31
  <div class="popup-header">
32
- <span class="popup-title">Game intro</span>
33
  <div class="popup-controls">
34
  <button class="control-btn minimize">−</button>
35
  <button class="control-btn maximize">□</button>
@@ -37,9 +37,8 @@
37
  </div>
38
  </div>
39
  <div class="popup-content">
40
- <p>Welcome to the 21st century—where America is thriving on the edge of total collapse! Wokeness has spread like a glorious plague, the Democrats have worked their magic to send inflation soaring, and oil production? Oh, it's practically a fairy tale now. But don't worry, salvation is here! A brand-new, ultra-competent (and just a little unpredictable) president has stepped in to save the day. What could possibly go wrong?</p>
41
- <img src="/images/trump_popup.jpg" alt="USA Flag" class="popup-gif">
42
- <button class="popup-ok">OK</button>
43
  </div>
44
  </div>
45
 
@@ -121,17 +120,24 @@
121
  });
122
 
123
  document.addEventListener('DOMContentLoaded', function() {
124
- // Show initial game popup after 2 seconds
 
 
 
 
 
 
 
125
  setTimeout(() => {
126
  const popup = document.getElementById('gamePopup');
127
  popup.style.display = 'block';
128
  }, 2000);
129
 
130
  // Show game over popup after 5 seconds
131
- setTimeout(() => {
132
- const gameOverPopup = document.getElementById('gameOverPopup');
133
- gameOverPopup.style.display = 'block';
134
- }, 5000);
135
 
136
  // Initialize game popup controls
137
  const popup = document.getElementById('gamePopup');
 
29
 
30
  <div class="popup" id="gamePopup">
31
  <div class="popup-header">
32
+ <span class="popup-title">Game Intro</span>
33
  <div class="popup-controls">
34
  <button class="control-btn minimize">−</button>
35
  <button class="control-btn maximize">□</button>
 
37
  </div>
38
  </div>
39
  <div class="popup-content">
40
+ <iframe src="intro.html" class="intro-frame"></iframe>
41
+ <button class="popup-ok">Start Game</button>
 
42
  </div>
43
  </div>
44
 
 
120
  });
121
 
122
  document.addEventListener('DOMContentLoaded', function() {
123
+ // Load the intro content
124
+ fetch('./intro.html')
125
+ .then(response => response.text())
126
+ .then(html => {
127
+ document.getElementById('introContent').innerHTML = html;
128
+ });
129
+
130
+ // Show popup after content is loaded
131
  setTimeout(() => {
132
  const popup = document.getElementById('gamePopup');
133
  popup.style.display = 'block';
134
  }, 2000);
135
 
136
  // Show game over popup after 5 seconds
137
+ //setTimeout(() => {
138
+ // const gameOverPopup = document.getElementById('gameOverPopup');
139
+ // gameOverPopup.style.display = 'block';
140
+ // }, 5000);
141
 
142
  // Initialize game popup controls
143
  const popup = document.getElementById('gamePopup');
static/intro.html ADDED
@@ -0,0 +1,148 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <!DOCTYPE html>
2
+ <html lang="fr">
3
+ <head>
4
+ <meta charset="UTF-8">
5
+ <title>What possibly go Wrong 2025</title>
6
+ <style>
7
+ html, body {
8
+ margin: 0;
9
+ padding: 0;
10
+ height: 100%;
11
+ width: 800px;
12
+ font-family: Arial, sans-serif;
13
+ overflow: hidden;
14
+ background-color: transparent;
15
+ }
16
+
17
+ /* Image de fond qui remplit tout l'écran */
18
+ body {
19
+ background: url('/images/intro/Intro.jpg') no-repeat center center;
20
+ background-size: cover; /* ou 100% auto */
21
+ position: relative;
22
+ }
23
+
24
+ /* Conteneur du texte */
25
+ #text-container {
26
+ position: absolute;
27
+ top: 10%;
28
+ left: 50%;
29
+ transform: translateX(-50%);
30
+ width: 60%;
31
+ padding: 20px;
32
+ background-color: rgba(0, 0, 0, 0.5);
33
+ border-radius: 8px;
34
+ color: #fff;
35
+ text-align: left;
36
+ font-weight: bold;
37
+ font-size: 1.2rem;
38
+ z-index: 3; /* au-dessus des flammes si besoin */
39
+ }
40
+
41
+ /* Conteneur des flammes */
42
+ #flames {
43
+ position: absolute;
44
+ bottom: -50px; /* Move flames down a bit */
45
+ left: 0;
46
+ width: 100%;
47
+ height: 180px; /* Increase height */
48
+ background: url('/images/intro/fire3.png') repeat-x;
49
+ background-size: auto 180px; /* Match height */
50
+ animation: flameAnim 3s steps(10) infinite;
51
+ pointer-events: none;
52
+ z-index: 999;
53
+ }
54
+
55
+ @keyframes flameAnim {
56
+ 100% {
57
+ background-position: -1000px 0;
58
+ }
59
+ }
60
+ </style>
61
+ </head>
62
+
63
+ <body>
64
+ <div id="text-container"></div>
65
+ <div id="flames"></div>
66
+
67
+ <script>
68
+ const lines = [
69
+ "Warning !",
70
+ "This game is a work of fiction.",
71
+ "Any resemblance to real people or events is purely coincidental.",
72
+ "",
73
+ "USA is on the edge of total colapse.",
74
+ "Borders are wide open.",
75
+ "People are eating cats and dogs.",
76
+ "Oil production? it's pratically a fairy tale now ! ",
77
+ "God sent the perfect president to save the nation.",
78
+ "",
79
+ "Welcome to What possibly go Wrong in 2025 ! "
80
+ ];
81
+
82
+ const textContainer = document.getElementById('text-container');
83
+
84
+ let lineIndex = 0; // Indice de la ligne en cours
85
+ let charIndex = 0; // Indice du caractère en cours dans la ligne
86
+ let currentLineElem; // Élement HTML pour la ligne en cours (si non vide)
87
+
88
+ function typeWriter() {
89
+ // Si on a traité toutes les lignes, on arrête
90
+ if (lineIndex >= lines.length) {
91
+ return;
92
+ }
93
+
94
+ const currentLine = lines[lineIndex];
95
+
96
+ // -- 1) Gérer la ligne vide ("") --
97
+ if (currentLine === "") {
98
+ // On affiche un saut de ligne
99
+ textContainer.appendChild(document.createElement('br'));
100
+
101
+ // Après 2 secondes, on efface le texte et on passe à la suite
102
+ // setTimeout(() => {
103
+ // textContainer.innerHTML = "";
104
+ // lineIndex++;
105
+ // charIndex = 0;
106
+ // typeWriter(); // relance l'affichage de la ligne suivante
107
+ // }, 3000);
108
+
109
+ lineIndex++;
110
+ charIndex = 0;
111
+ typeWriter(); // relance l'affichage de la ligne suivante
112
+
113
+ // On quitte immédiatement la fonction pour éviter tout conflit de setTimeout
114
+ return;
115
+ }
116
+
117
+ // -- 2) Si la ligne n'est pas vide, affichage "lettre par lettre" --
118
+ if (charIndex === 0) {
119
+ // On crée un nouvel élément pour la nouvelle ligne
120
+ currentLineElem = document.createElement('div');
121
+ textContainer.appendChild(currentLineElem);
122
+ }
123
+
124
+ // Ajout du caractère suivant
125
+ currentLineElem.textContent += currentLine.charAt(charIndex);
126
+ charIndex++;
127
+
128
+ // S'il reste des caractères à afficher dans la ligne
129
+ if (charIndex < currentLine.length) {
130
+ setTimeout(typeWriter, 30);
131
+ } else {
132
+ // Ligne terminée : on passe à la ligne suivante
133
+ lineIndex++;
134
+ charIndex = 0;
135
+ currentLineElem = null;
136
+
137
+ // Petite pause avant d'attaquer la prochaine ligne
138
+ setTimeout(typeWriter, 25);
139
+ }
140
+ }
141
+
142
+ // On démarre le « typewriter »
143
+ typeWriter();
144
+ </script>
145
+ </body>
146
+
147
+
148
+ </html>
static/styles.css CHANGED
@@ -214,8 +214,18 @@
214
  left: unset;
215
  transform: none;
216
  width: 200px;
217
- height: 40px;
218
  overflow: hidden;
 
 
 
 
 
 
 
 
 
 
219
  }
220
 
221
  .popup-header {
@@ -301,4 +311,40 @@
301
 
302
  #gameOverPopup .popup-ok {
303
  margin: 5px 0;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
304
  }
 
214
  left: unset;
215
  transform: none;
216
  width: 200px;
217
+ height: 32px;
218
  overflow: hidden;
219
+ background-color: #1da1f2;
220
+ }
221
+
222
+ .popup.minimized .popup-content {
223
+ display: none;
224
+ }
225
+
226
+ .popup.minimized .popup-header {
227
+ padding: 4px 8px;
228
+ height: 32px;
229
  }
230
 
231
  .popup-header {
 
311
 
312
  #gameOverPopup .popup-ok {
313
  margin: 5px 0;
314
+ }
315
+
316
+ .intro-frame {
317
+ width: 800px;
318
+ height: 650px;
319
+ border: none;
320
+ overflow: hidden;
321
+ background-color: transparent;
322
+ margin: 0;
323
+ padding: 0;
324
+ }
325
+
326
+ #gamePopup {
327
+ width: auto;
328
+ background-color: transparent;
329
+ padding: 0;
330
+ }
331
+
332
+ #gamePopup .popup-content {
333
+ padding: 0;
334
+ position: relative;
335
+ }
336
+
337
+ #gamePopup .popup-ok {
338
+ position: absolute;
339
+ bottom: 200px;
340
+ left: 50%;
341
+ transform: translateX(-50%);
342
+ z-index: 1000;
343
+ background-color: rgba(29, 161, 242, 0.8);
344
+ padding: 12px 30px;
345
+ font-size: 16px;
346
+ }
347
+
348
+ #gamePopup .popup-ok:hover {
349
+ background-color: rgba(29, 161, 242, 1);
350
  }