Metaprime commited on
Commit
6ec7aee
Β·
verified Β·
1 Parent(s): c0cdbcc

Update index.html

Browse files
Files changed (1) hide show
  1. index.html +44 -35
index.html CHANGED
@@ -18,25 +18,26 @@
18
  border-radius:16px; padding:12px; display:none; flex-direction:column; gap:8px;
19
  z-index:1002;
20
  }
21
- .joystick {
22
- position:fixed; bottom:90px; left:30px; width:90px; height:90px;
23
- background:rgba(255,50,50,0.15); border:3px solid #ff3366; border-radius:50%;
24
- z-index:1010; box-shadow:0 0 20px #ff3366;
25
- }
26
- .joy-knob {
27
- position:absolute; top:50%; left:50%; width:38px; height:38px;
28
- background:#ff3366; border-radius:50%; transform:translate(-50%, -50%);
29
- box-shadow:0 0 15px #ff3366;
30
- }
31
  button {
32
  background:rgba(255,50,50,0.15); color:#ff99aa; border:1px solid #ff3366;
33
  box-shadow:0 0 12px #ff3366; padding:12px 14px; border-radius:10px;
34
  font-size:15px; text-align:left;
35
  }
36
  .control-btn {
37
- position:fixed; background:rgba(255,50,50,0.2); color:white; border:2px solid #ff3366;
38
- width:48px; height:48px; border-radius:50%; display:flex; align-items:center; justify-content:center;
39
- font-size:24px; z-index:1010; box-shadow:0 0 15px #ff3366;
 
 
 
 
 
 
 
 
 
 
 
40
  }
41
  </style>
42
  </head>
@@ -44,7 +45,7 @@
44
 
45
  <a-scene background="color: #000000">
46
  <a-sky id="sky" src="galaxy.jpg"></a-sky>
47
- <a-camera id="camera" position="0 2 0" wasd-controls look-controls></a-camera>
48
  </a-scene>
49
 
50
  <div id="bead" onclick="togglePanel()"></div>
@@ -52,19 +53,15 @@
52
  <div id="panel">
53
  <button onclick="launchSky()">🌌 Sky Launcher</button>
54
  <button onclick="addCurvedScreen()">πŸ“Ί Add New Curved Screen</button>
55
- <button onclick="resizeAll(1.3)">πŸ” Make All Bigger</button>
56
- <button onclick="resizeAll(0.7)">πŸ” Make All Smaller</button>
57
  </div>
58
 
59
- <!-- N64-style movement -->
60
- <div class="joystick" id="joystick">
61
- <div class="joy-knob" id="knob"></div>
62
- </div>
63
-
64
- <div class="control-btn" style="bottom:160px; right:30px;" onclick="moveHeight(1)">β–²</div>
65
- <div class="control-btn" style="bottom:90px; right:30px;" onclick="moveHeight(-1)">β–Ό</div>
66
- <div class="control-btn" style="bottom:125px; right:90px;" onclick="rotateCamera(-15)">β†Ί</div>
67
- <div class="control-btn" style="bottom:125px; right:-30px;" onclick="rotateCamera(15)">↻</div>
68
 
69
  <input type="file" id="skyInput" accept="image/*,video/*" style="display:none;">
70
 
@@ -76,9 +73,7 @@
76
  panel.style.display = panel.style.display === 'flex' ? 'none' : 'flex';
77
  }
78
 
79
- function launchSky() {
80
- document.getElementById('skyInput').click();
81
- }
82
 
83
  function addCurvedScreen() {
84
  const scene = document.querySelector('a-scene');
@@ -135,19 +130,33 @@
135
  });
136
  }
137
 
138
- // Simple movement helpers
139
- function moveHeight(dir) {
140
  const cam = document.getElementById('camera');
141
  let pos = cam.getAttribute('position');
142
- pos.y += dir * 0.5;
143
  cam.setAttribute('position', pos);
144
  }
145
 
146
- function rotateCamera(deg) {
147
  const cam = document.getElementById('camera');
148
- let rot = cam.getAttribute('rotation') || {x:0, y:0, z:0};
149
- rot.y += deg;
150
- cam.setAttribute('rotation', rot);
 
 
 
 
 
 
 
 
 
 
 
 
 
 
151
  }
152
 
153
  document.getElementById('skyInput').addEventListener('change', function(e) {
 
18
  border-radius:16px; padding:12px; display:none; flex-direction:column; gap:8px;
19
  z-index:1002;
20
  }
 
 
 
 
 
 
 
 
 
 
21
  button {
22
  background:rgba(255,50,50,0.15); color:#ff99aa; border:1px solid #ff3366;
23
  box-shadow:0 0 12px #ff3366; padding:12px 14px; border-radius:10px;
24
  font-size:15px; text-align:left;
25
  }
26
  .control-btn {
27
+ position:fixed;
28
+ background:rgba(255,50,50,0.2);
29
+ color:white;
30
+ border:3px solid #ff3366;
31
+ width:55px;
32
+ height:55px;
33
+ border-radius:50%;
34
+ display:flex;
35
+ align-items:center;
36
+ justify-content:center;
37
+ font-size:28px;
38
+ z-index:1010;
39
+ box-shadow:0 0 20px #ff3366;
40
+ user-select:none;
41
  }
42
  </style>
43
  </head>
 
45
 
46
  <a-scene background="color: #000000">
47
  <a-sky id="sky" src="galaxy.jpg"></a-sky>
48
+ <a-camera id="camera" position="0 1.6 0" wasd-controls look-controls></a-camera>
49
  </a-scene>
50
 
51
  <div id="bead" onclick="togglePanel()"></div>
 
53
  <div id="panel">
54
  <button onclick="launchSky()">🌌 Sky Launcher</button>
55
  <button onclick="addCurvedScreen()">πŸ“Ί Add New Curved Screen</button>
56
+ <button onclick="resizeAll(1.3)">πŸ” Bigger</button>
57
+ <button onclick="resizeAll(0.7)">πŸ” Smaller</button>
58
  </div>
59
 
60
+ <!-- Movement Controls -->
61
+ <div class="control-btn" style="bottom:160px; right:25px;" onclick="moveForward()">↑</div>
62
+ <div class="control-btn" style="bottom:90px; right:25px;" onclick="moveBack()">↓</div>
63
+ <div class="control-btn" style="bottom:125px; left:25px;" onclick="strafeLeft()">←</div>
64
+ <div class="control-btn" style="bottom:125px; right:90px;" onclick="strafeRight()">β†’</div>
 
 
 
 
65
 
66
  <input type="file" id="skyInput" accept="image/*,video/*" style="display:none;">
67
 
 
73
  panel.style.display = panel.style.display === 'flex' ? 'none' : 'flex';
74
  }
75
 
76
+ function launchSky() { document.getElementById('skyInput').click(); }
 
 
77
 
78
  function addCurvedScreen() {
79
  const scene = document.querySelector('a-scene');
 
130
  });
131
  }
132
 
133
+ // Movement functions
134
+ function moveForward() {
135
  const cam = document.getElementById('camera');
136
  let pos = cam.getAttribute('position');
137
+ pos.z -= 0.8;
138
  cam.setAttribute('position', pos);
139
  }
140
 
141
+ function moveBack() {
142
  const cam = document.getElementById('camera');
143
+ let pos = cam.getAttribute('position');
144
+ pos.z += 0.8;
145
+ cam.setAttribute('position', pos);
146
+ }
147
+
148
+ function strafeLeft() {
149
+ const cam = document.getElementById('camera');
150
+ let pos = cam.getAttribute('position');
151
+ pos.x -= 0.8;
152
+ cam.setAttribute('position', pos);
153
+ }
154
+
155
+ function strafeRight() {
156
+ const cam = document.getElementById('camera');
157
+ let pos = cam.getAttribute('position');
158
+ pos.x += 0.8;
159
+ cam.setAttribute('position', pos);
160
  }
161
 
162
  document.getElementById('skyInput').addEventListener('change', function(e) {