Spaces:
Sleeping
Sleeping
loic.ledreck
commited on
Commit
·
9b11351
1
Parent(s):
4b73dbf
fix: fix sequences
Browse files- static/index.html +23 -10
static/index.html
CHANGED
|
@@ -60,15 +60,10 @@
|
|
| 60 |
|
| 61 |
<div class="popup" id="sequencePopup">
|
| 62 |
<div class="popup-header">
|
| 63 |
-
<span class="popup-title">Sequence
|
| 64 |
-
<!-- <div class="popup-controls">
|
| 65 |
-
<button class="control-btn minimize">−</button>
|
| 66 |
-
<button class="control-btn maximize">□</button>
|
| 67 |
-
<button class="control-btn close">×</button>
|
| 68 |
-
</div> -->
|
| 69 |
</div>
|
| 70 |
<div class="popup-content">
|
| 71 |
-
<
|
| 72 |
<button class="popup-sequence-ok">Next Sequence</button>
|
| 73 |
</div>
|
| 74 |
</div>
|
|
@@ -170,8 +165,7 @@
|
|
| 170 |
if (data.chat_ended === true) {
|
| 171 |
endSequence(data.idea, data.idea_accepted);
|
| 172 |
console.log("data.idea_accepted", data.idea_accepted)
|
| 173 |
-
|
| 174 |
-
sessionStorage.setItem('idea_accepted', data.idea_accepted);
|
| 175 |
}
|
| 176 |
//addMessageToChat(data.character_response, false);
|
| 177 |
})
|
|
@@ -260,7 +254,26 @@
|
|
| 260 |
|
| 261 |
function displaySequencePopup(idea, idea_accepted) {
|
| 262 |
const popup = document.getElementById('sequencePopup');
|
| 263 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 264 |
popup.style.display = 'block';
|
| 265 |
}
|
| 266 |
|
|
|
|
| 60 |
|
| 61 |
<div class="popup" id="sequencePopup">
|
| 62 |
<div class="popup-header">
|
| 63 |
+
<span class="popup-title">Sequence Ended</span>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 64 |
</div>
|
| 65 |
<div class="popup-content">
|
| 66 |
+
<div id="text-container" class="intro-content"></div>
|
| 67 |
<button class="popup-sequence-ok">Next Sequence</button>
|
| 68 |
</div>
|
| 69 |
</div>
|
|
|
|
| 165 |
if (data.chat_ended === true) {
|
| 166 |
endSequence(data.idea, data.idea_accepted);
|
| 167 |
console.log("data.idea_accepted", data.idea_accepted)
|
| 168 |
+
console.log("data.idea", data.idea)
|
|
|
|
| 169 |
}
|
| 170 |
//addMessageToChat(data.character_response, false);
|
| 171 |
})
|
|
|
|
| 254 |
|
| 255 |
function displaySequencePopup(idea, idea_accepted) {
|
| 256 |
const popup = document.getElementById('sequencePopup');
|
| 257 |
+
|
| 258 |
+
const message = [
|
| 259 |
+
idea_accepted === "True"
|
| 260 |
+
? "You have not been able to deter Donald Trump from doing what he had in mind his idea. Then,"
|
| 261 |
+
: "You couldn't change Donald's mind, consequently he will:",
|
| 262 |
+
idea,
|
| 263 |
+
];
|
| 264 |
+
|
| 265 |
+
const textContainer = document.getElementById('text-container');
|
| 266 |
+
while (textContainer.firstChild) {
|
| 267 |
+
textContainer.removeChild(textContainer.firstChild);
|
| 268 |
+
}
|
| 269 |
+
|
| 270 |
+
// Dynamically add text to the text container
|
| 271 |
+
message.forEach((line) => {
|
| 272 |
+
const p = document.createElement('p');
|
| 273 |
+
p.textContent = line;
|
| 274 |
+
textContainer.appendChild(p);
|
| 275 |
+
});
|
| 276 |
+
|
| 277 |
popup.style.display = 'block';
|
| 278 |
}
|
| 279 |
|