From 07ad0fa8f96f4e3b8b3680b7908f8306bd8bbca3 Mon Sep 17 00:00:00 2001 From: Julian Ng Date: Thu, 22 Jun 2023 17:19:51 +0100 Subject: [PATCH 01/11] Add game containers --- index.html | 28 ++++++++++++++++------------ style.css | 9 +++++++++ 2 files changed, 25 insertions(+), 12 deletions(-) diff --git a/index.html b/index.html index db3d537..78472a0 100644 --- a/index.html +++ b/index.html @@ -25,20 +25,24 @@

ChatVenture

Hello PLAYER! Welcome to the text adventure game where the story is made up by GPT :)

- +
+ - + -
- - - -
+
+ +
+ + + +
+
diff --git a/style.css b/style.css index 35b898a..2f6addd 100644 --- a/style.css +++ b/style.css @@ -29,6 +29,15 @@ header { padding: 32px; } +.container { + max-width: 720px; + margin: 0 auto; +} + +.container > * { + margin-bottom: 32px; +} + .loading { display: flex; justify-content: center; From 9047d7a48da104bf46f7f4ee1a6236f31f9aa81d Mon Sep 17 00:00:00 2001 From: Julian Ng Date: Thu, 22 Jun 2023 17:20:11 +0100 Subject: [PATCH 02/11] Add stage-template elements --- index.html | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/index.html b/index.html index 78472a0..77df42d 100644 --- a/index.html +++ b/index.html @@ -43,6 +43,25 @@

ChatVenture

+ + + From 43f907bad04ec0fb48d2e4ea1156389adf98cf2f Mon Sep 17 00:00:00 2001 From: Julian Ng Date: Thu, 22 Jun 2023 17:22:23 +0100 Subject: [PATCH 03/11] Extract functions to utils file --- index.html | 1 + main.js | 33 --------------------------------- utils.js | 32 ++++++++++++++++++++++++++++++++ 3 files changed, 33 insertions(+), 33 deletions(-) create mode 100644 utils.js diff --git a/index.html b/index.html index 77df42d..4c504bd 100644 --- a/index.html +++ b/index.html @@ -15,6 +15,7 @@ + diff --git a/main.js b/main.js index f2816c1..2c8a041 100644 --- a/main.js +++ b/main.js @@ -1,38 +1,5 @@ const chatGptMessages = []; -const makeRequest = async (url, data) => { - const response = await fetch(url, { - headers: { - 'Content-Type': 'application/json', - 'Authorization': `Bearer ${_CONFIG_.API_KEY}`, - // Our _CONFIG data is imported in the HTML file using the