-
Notifications
You must be signed in to change notification settings - Fork 414
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
LostZoro476
committed
Aug 5, 2023
1 parent
1b762e5
commit cdcc95c
Showing
12 changed files
with
132 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
{ | ||
"liveServer.settings.port": 5501 | ||
} |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,40 @@ | ||
const arjunaConversation = document.getElementById("arjuna-conversation"); | ||
const krishnaConversation = document.getElementById("krishna-conversation"); | ||
|
||
const arjunaQuestions = [ | ||
"Arjuna: Who is Krishna?", | ||
"Arjuna: What is the purpose of life?", | ||
"Arjuna: How can one attain enlightenment?", | ||
]; | ||
|
||
const krishnaAnswers = [ | ||
"Krishna: I am the Supreme Personality of Godhead.", | ||
"Krishna: The purpose of life is to attain self-realization and understand the eternal soul.", | ||
"Krishna: By practicing meditation and devotional service, one can attain enlightenment.", | ||
]; | ||
|
||
let arjunaIndex = 0; | ||
let krishnaIndex = 0; | ||
|
||
function updateConversationBoxes() { | ||
arjunaConversation.innerText = arjunaQuestions[arjunaIndex]; | ||
krishnaConversation.innerText = krishnaAnswers[krishnaIndex]; | ||
} | ||
|
||
function handleKeyPress(event) { | ||
if (event.key === "ArrowRight") { | ||
arjunaIndex = (arjunaIndex + 1) % arjunaQuestions.length; | ||
krishnaIndex = (krishnaIndex + 1) % krishnaAnswers.length; | ||
updateConversationBoxes(); | ||
} else if (event.key === "ArrowLeft") { | ||
arjunaIndex = (arjunaIndex - 1 + arjunaQuestions.length) % arjunaQuestions.length; | ||
krishnaIndex = (krishnaIndex - 1 + krishnaAnswers.length) % krishnaAnswers.length; | ||
updateConversationBoxes(); | ||
} | ||
} | ||
|
||
// Attach event listener for keypress | ||
document.addEventListener("keydown", handleKeyPress); | ||
|
||
// Initial update of conversation boxes | ||
updateConversationBoxes(); |