Skip to content

Commit

Permalink
Added the Changes
Browse files Browse the repository at this point in the history
  • Loading branch information
LostZoro476 committed Aug 5, 2023
1 parent 1b762e5 commit cdcc95c
Show file tree
Hide file tree
Showing 12 changed files with 132 additions and 3 deletions.
3 changes: 3 additions & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"liveServer.settings.port": 5501
}
Binary file added Gita-Storyline/Arjuna/arjuna1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added Gita-Storyline/Arjuna/arjuna2.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added Gita-Storyline/Krishna/krishna1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added Gita-Storyline/Krishna/krishna2.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added Gita-Storyline/conversation.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added Gita-Storyline/left-1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added Gita-Storyline/left.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added Gita-Storyline/right.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
78 changes: 75 additions & 3 deletions Gita-Storyline/storyline.css
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
*{
* {
box-sizing: border-box;
}
}
body{
margin: 0;
padding: 0;
Expand Down Expand Up @@ -43,4 +43,76 @@ overflow-y: hidden;
animation: animate 60s linear infinite;
position: relative;
}
}
}


#left-arrow, #right-arrow {
position: absolute;
top: 50%;
transform: translateY(-50%);
height: 30px;
width: 30px;
}


#left-arrow,
#right-arrow {
position: absolute;
top: calc(50% + 16%);
transform: translateY(-50%);
height: 30px;
width: 30px;
cursor: pointer;
}

#left-arrow {
left: calc(20px + 10%);
}

#right-arrow {
right: calc(20px + 10%);
}



.image-container {
display: flex;
justify-content: center;
gap: 50px;
align-items: center;
height: 100vh;
}


#arjuna-image {

z-index: 2;
position: absolute;
top: calc(50% + 24%);
left: calc(50% - 20%);
transform: translateY(-50%);
}


#krishna-image {
z-index: 2;
position: absolute;
top: calc(50% + 19%);
left: calc(50% + 4%);
transform: translateY(-50%);
}
/* ... (existing CSS rules above) ... */

/* Styles for the conversation boxes */
.conversation-box {
position: absolute;
width: 200px;
height: 80px;
background-color: white;
border: 2px solid black;
border-radius: 5px;
padding: 10px;
font-size: 14px;
text-align: left;
z-index: 3;
}
15 changes: 15 additions & 0 deletions Gita-Storyline/storyline.html
Original file line number Diff line number Diff line change
Expand Up @@ -193,7 +193,22 @@
</ul>
</nav>
</header>

<div class="milky-way"></div>
<div id="left-arrow">
<img src="left.png" alt="left-arrow">
</div>
<div id="right-arrow">
<img src="right.png" alt="right-arrow">
</div>

<!-- <div class="conversation-box" id="arjuna-conversation"></div> -->
<img id="arjuna-image" src="./Arjuna/arjuna1.png" alt="Arjuna" />
<!-- <div class="conversation-box" id="krishna-conversation"></div> -->
<img id="krishna-image" src="./Krishna/krishna1.png" alt="Krishna" />



<script>
const hamburger = document.querySelector(".hamburger");
const navLink = document.querySelector(".nav__link");
Expand Down
39 changes: 39 additions & 0 deletions Gita-Storyline/storyline.js
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();

0 comments on commit cdcc95c

Please sign in to comment.