-
Notifications
You must be signed in to change notification settings - Fork 1
Initial virtual world project setup #1
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
ghanshyam2005singh
wants to merge
2
commits into
alphaonelabs:main
Choose a base branch
from
ghanshyam2005singh:feat/initial-project-setup
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
2 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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,2 @@ | ||
| # Base URL of the main Alpha One Labs "learn" site. | ||
| VITE_LEARN_API_BASE=https://learn.alphaonelabs.com |
This file contains hidden or 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,7 @@ | ||
| node_modules/ | ||
| dist/ | ||
| .wrangler/ | ||
| *.log | ||
| .DS_Store | ||
| .env | ||
| .env.local |
This file contains hidden or 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,25 @@ | ||
| # Virtual | ||
|
|
||
| Alpha One Labs' virtual world — a Three.js environment where users browse activities and join the virtual classroom, built as plain TypeScript with no frontend framework. | ||
|
|
||
| ## Stack | ||
|
|
||
| - TypeScript + [Three.js](https://threejs.org/), no framework | ||
| - [Vite](https://vitejs.dev/) for dev/build | ||
| - [Cloudflare Workers (static assets)](https://developers.cloudflare.com/workers/static-assets/) for hosting | ||
|
|
||
| ## Development | ||
|
|
||
| ```bash | ||
| npm install | ||
| npm run dev | ||
| ``` | ||
|
|
||
| ## Build & deploy | ||
|
|
||
| ```bash | ||
| npx wrangler login | ||
| npm run deploy | ||
| ``` | ||
|
|
||
| `npm run deploy` runs the build automatically. Set `VITE_LEARN_API_BASE` (defaults to `https://learn.alphaonelabs.com`) if the app should talk to a different Learn API instance. | ||
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 hidden or 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,213 @@ | ||
| <!doctype html> | ||
| <html lang="en"> | ||
| <head> | ||
| <meta charset="UTF-8" /> | ||
| <meta name="viewport" content="width=device-width, initial-scale=1.0" /> | ||
| <title>Alpha One Labs — Virtual</title> | ||
| <style> | ||
| html, body { | ||
| margin: 0; | ||
| padding: 0; | ||
| height: 100%; | ||
| overflow: hidden; | ||
| background: #0a0a0a; | ||
| font-family: system-ui, -apple-system, sans-serif; | ||
| } | ||
| #app { width: 100vw; height: 100vh; display: block; } | ||
|
|
||
| #blocker { | ||
| position: fixed; | ||
| inset: 0; | ||
| display: flex; | ||
| align-items: center; | ||
| justify-content: center; | ||
| background: rgba(0, 0, 0, 0.7); | ||
| color: #fff; | ||
| text-align: center; | ||
| cursor: pointer; | ||
| z-index: 10; | ||
| } | ||
| #blocker.hidden { display: none; } | ||
| #blocker > div { max-width: 26rem; max-height: 90vh; overflow-y: auto; padding: 0 1rem; } | ||
| #blocker h1 { font-size: 1.5rem; margin: 0 0 0.5rem; } | ||
| #blocker p { margin: 0 0 0.5rem; color: #ccc; } | ||
| #enter-button { | ||
| margin-top: 1rem; | ||
| padding: 0.65rem 1.5rem; | ||
| border-radius: 999px; | ||
| border: none; | ||
| background: #0d9488; | ||
| color: #fff; | ||
| font-weight: 600; | ||
| font-size: 1rem; | ||
| cursor: pointer; | ||
| } | ||
| #enter-button:hover { background: #0f766e; } | ||
| #enter-button:focus-visible { outline: 2px solid #2dd4bf; outline-offset: 2px; } | ||
|
|
||
| #activity-nav { margin-top: 2rem; text-align: left; } | ||
| #activity-nav h2 { font-size: 1rem; margin: 0 0 0.75rem; text-align: center; color: #fff; } | ||
| #activity-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 0.75rem; } | ||
| #activity-list li { | ||
| border: 1px solid rgba(255, 255, 255, 0.15); | ||
| border-radius: 0.75rem; | ||
| padding: 0.75rem 1rem; | ||
| } | ||
| #activity-list h3 { margin: 0 0 0.3rem; font-size: 0.95rem; color: #fff; } | ||
| #activity-list p { margin: 0 0 0.5rem; font-size: 0.85rem; } | ||
| #activity-list .activity-links { display: flex; flex-wrap: wrap; gap: 0.5rem; } | ||
| #activity-list a { | ||
| color: #2dd4bf; | ||
| text-decoration: none; | ||
| font-weight: 600; | ||
| font-size: 0.85rem; | ||
| } | ||
| #activity-list a:hover, | ||
| #activity-list a:focus-visible { text-decoration: underline; } | ||
|
|
||
| #crosshair { | ||
| position: fixed; | ||
| top: 50%; | ||
| left: 50%; | ||
| width: 6px; | ||
| height: 6px; | ||
| margin: -3px 0 0 -3px; | ||
| border-radius: 50%; | ||
| background: #fff; | ||
| opacity: 0.8; | ||
| z-index: 5; | ||
| pointer-events: none; | ||
| } | ||
| #crosshair.hidden { display: none; } | ||
|
|
||
| #prompt { | ||
| position: fixed; | ||
| bottom: 8%; | ||
| left: 50%; | ||
| transform: translateX(-50%); | ||
| background: rgba(0, 0, 0, 0.6); | ||
| color: #fff; | ||
| padding: 0.6rem 1.2rem; | ||
| border-radius: 999px; | ||
| font-size: 0.95rem; | ||
| z-index: 5; | ||
| pointer-events: none; | ||
| } | ||
| #prompt.hidden { display: none; } | ||
|
|
||
| #panel { | ||
| position: fixed; | ||
| inset: 0; | ||
| display: flex; | ||
| align-items: center; | ||
| justify-content: center; | ||
| background: rgba(0, 0, 0, 0.6); | ||
| z-index: 20; | ||
| } | ||
| #panel.hidden { display: none; } | ||
| #panel-card { | ||
| background: #12181c; | ||
| color: #fff; | ||
| border: 1px solid rgba(255, 255, 255, 0.15); | ||
| border-radius: 1.25rem; | ||
| padding: 2rem; | ||
| max-width: 26rem; | ||
| width: 90%; | ||
| } | ||
| #panel-card h2 { margin: 0 0 0.75rem; font-size: 1.5rem; } | ||
| #panel-card p { margin: 0 0 1.5rem; color: #b8c2c9; line-height: 1.5; } | ||
| #panel-links { display: flex; flex-direction: column; gap: 0.6rem; } | ||
| #panel-links a { | ||
| display: block; | ||
| text-align: center; | ||
| text-decoration: none; | ||
| color: #fff; | ||
| background: #0d9488; | ||
| padding: 0.75rem 1rem; | ||
| border-radius: 0.75rem; | ||
| font-weight: 600; | ||
| } | ||
| #panel-links a:hover { background: #0f766e; } | ||
| #panel-close { | ||
| margin-top: 1.25rem; | ||
| width: 100%; | ||
| padding: 0.6rem; | ||
| border-radius: 0.75rem; | ||
| border: 1px solid rgba(255, 255, 255, 0.2); | ||
| background: transparent; | ||
| color: #fff; | ||
| cursor: pointer; | ||
| } | ||
|
|
||
| #logout { | ||
| position: fixed; | ||
| top: 1rem; | ||
| right: 1rem; | ||
| /* Above #blocker (10) so it's clickable whenever the pointer is | ||
| unlocked — otherwise the full-screen blocker swallows the click. */ | ||
| z-index: 15; | ||
| padding: 0.45rem 0.9rem; | ||
| border-radius: 999px; | ||
| border: 1px solid rgba(255, 255, 255, 0.2); | ||
| background: rgba(0, 0, 0, 0.5); | ||
| color: #fff; | ||
| font-size: 0.8rem; | ||
| cursor: pointer; | ||
| } | ||
| #logout:hover { background: rgba(0, 0, 0, 0.7); } | ||
| #logout.hidden { display: none; } | ||
|
|
||
| #hint { | ||
| position: fixed; | ||
| top: 1rem; | ||
| left: 1rem; | ||
| z-index: 6; | ||
| color: #ccc; | ||
| font-size: 0.75rem; | ||
| background: rgba(0, 0, 0, 0.5); | ||
| padding: 0.4rem 0.7rem; | ||
| border-radius: 999px; | ||
| pointer-events: none; | ||
| } | ||
| #hint.hidden { display: none; } | ||
| </style> | ||
| </head> | ||
| <body> | ||
| <canvas id="app"></canvas> | ||
|
|
||
| <div id="crosshair" class="hidden"></div> | ||
| <div id="prompt" class="hidden"></div> | ||
| <button id="logout" type="button" class="hidden">Log out</button> | ||
| <div id="hint" class="hidden">Press ESC to free your cursor</div> | ||
|
|
||
| <div id="blocker"> | ||
| <div> | ||
| <h1>Alpha One Labs — Virtual</h1> | ||
| <p>Click to enter · WASD to move · Mouse to look · E to interact</p> | ||
| <p>Press ESC anytime to release your cursor and use the menu</p> | ||
| <button id="enter-button" type="button">Enter world</button> | ||
| <nav id="activity-nav" aria-label="Activities"> | ||
| <h2>Activities</h2> | ||
| <ul id="activity-list"></ul> | ||
| </nav> | ||
| </div> | ||
| </div> | ||
|
coderabbitai[bot] marked this conversation as resolved.
|
||
|
|
||
| <div id="panel" class="hidden"> | ||
| <div | ||
| id="panel-card" | ||
| role="dialog" | ||
| aria-modal="true" | ||
| aria-labelledby="panel-title" | ||
| aria-describedby="panel-description" | ||
| > | ||
| <h2 id="panel-title"></h2> | ||
| <p id="panel-description"></p> | ||
| <div id="panel-links"></div> | ||
| <button id="panel-close" type="button">Close (Esc)</button> | ||
| </div> | ||
| </div> | ||
|
coderabbitai[bot] marked this conversation as resolved.
|
||
|
|
||
| <script type="module" src="/src/main.ts"></script> | ||
| </body> | ||
| </html> | ||
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.