Skip to content

Commit

Permalink
updated the text
Browse files Browse the repository at this point in the history
  • Loading branch information
romyilano committed Aug 14, 2024
1 parent 0380ec5 commit 4815cb7
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 1 deletion.
1 change: 0 additions & 1 deletion index.html
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,6 @@
event-set__leave="_event: mouseleave; material.opacity: 0.5">
<a-text value="Stare here to transport" align="center" position="0 0.6 0" scale="0.5 0.5 0.5"></a-text>
</a-entity>

<a-entity position="0 1.8 2">
<a-entity camera look-controls wasd-controls>
<a-cursor></a-cursor>
Expand Down
12 changes: 12 additions & 0 deletions js/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ document.addEventListener('DOMContentLoaded', function() {
const portal1 = document.querySelector('#portal1');
const portal2 = document.querySelector('#portal2');
const portal3 = document.querySelector('#portal3');
const textEntity = document.querySelector('a-text[value="SudoRoom & Fix-It Clinic"]');

const skyboxTextures = ['#skyTexture1', '#skyTexture2', '#skyTexture3'];
let currentTextureIndex = 0;
Expand All @@ -17,6 +18,17 @@ document.addEventListener('DOMContentLoaded', function() {
portal1.setAttribute('visible', currentTextureIndex === 0);
portal2.setAttribute('visible', currentTextureIndex === 1);
portal3.setAttribute('visible', currentTextureIndex === 2);

// Update text content based on the current scene
if (currentTextureIndex === 1) {
textEntity.setAttribute('value', "Math and Art SudoRoom Visits SF Moma with Noisebridge");
textEntity.setAttribute('width', 8); // Increase width to accommodate longer text
textEntity.setAttribute('position', '-4 1 -1.5'); // Adjust position if needed
} else {
textEntity.setAttribute('value', "SudoRoom & Fix-It Clinic");
textEntity.setAttribute('width', 6); // Reset to original width
textEntity.setAttribute('position', '-2.5 1 -1.5'); // Reset to original position
}
}

function setupPortalListener(portal, nextTextureIndex) {
Expand Down

0 comments on commit 4815cb7

Please sign in to comment.