kimhyunwoo commited on
Commit
1cc2786
·
verified ·
1 Parent(s): e240c2d

Update index.html

Browse files
Files changed (1) hide show
  1. index.html +9 -21
index.html CHANGED
@@ -46,17 +46,6 @@
46
  background: radial-gradient(circle, transparent 50%, rgba(0,0,0,0.4) 100%);
47
  pointer-events: none;
48
  }
49
- /* 로딩 인디케이터 스타일 */
50
- #loading-indicator {
51
- position: fixed;
52
- top: 50%;
53
- left: 50%;
54
- transform: translate(-50%, -50%);
55
- color: white;
56
- font-size: 24px;
57
- z-index: 10; /* 다른 UI 요소 위에 표시 */
58
- display: none; /* initially hidden */
59
- }
60
 
61
  /* 터치 컨트롤 스타일 (선택 사항 - 가상 조이스틱) */
62
  #joystick-zone {
@@ -90,13 +79,12 @@
90
  <div id="crosshair" class="ui">+</div>
91
  <div id="flashlight-status" class="ui">Flashlight [F]</div>
92
  <div class="vignette"></div>
93
- <div id="loading-indicator">Loading...</div>
94
  <div id="joystick-zone">
95
  <div id="joystick-knob"></div>
96
  </div>
97
 
98
  <script src="https://cdnjs.cloudflare.com/ajax/libs/three.js/r128/three.min.js"></script>
99
- <script async defer src="https://cdnjs.cloudflare.com/ajax/libs/simplex-noise/4.0.1/simplex-noise.min.js"></script> <!-- async defer 추가 -->
100
  <script>
101
  const SPAWN_POSITION = new THREE.Vector3(0, 1.7, 30);
102
  const CAVE_ENTRANCE = new THREE.Vector3(0, 1.7, -15);
@@ -124,7 +112,7 @@
124
  trees: [],
125
  vegetation: []
126
  };
127
- let isTransitioning = true; // Start with transitioning true for initial load
128
  let caveSystem = [];
129
 
130
  // --- 터치 컨트롤 변수 ---
@@ -158,6 +146,9 @@
158
  camera.position.copy(SPAWN_POSITION);
159
  camera.lookAt(0, 1.7, 0); // Look towards the origin (adjust as needed)
160
 
 
 
 
161
 
162
  document.addEventListener('keydown', onKeyDown);
163
  document.addEventListener('keyup', onKeyUp);
@@ -171,9 +162,6 @@
171
  document.addEventListener('touchend', onTouchEnd, false);
172
 
173
 
174
-
175
- document.getElementById('loading-indicator').style.display = 'block'; // Show on start
176
-
177
  // Simplex Noise 초기화 (이제 defer 때문에 여기서 가능)
178
  simplex = new SimplexNoise();
179
 
@@ -457,12 +445,12 @@
457
  Promise.all(chunkPromises)
458
  .then(() => {
459
  isTransitioning = false;
460
- document.getElementById('loading-indicator').style.display = 'none';
461
  })
462
  .catch(error => {
463
  console.error("Error loading chunks:", error);
464
  isTransitioning = false; // Ensure isTransitioning is reset
465
- document.getElementById('loading-indicator').style.display = 'none';
466
  });
467
  }
468
 
@@ -533,10 +521,10 @@
533
  function transitionEnvironment() {
534
  if (player.inCave) {
535
  scene.fog = new THREE.FogExp2(0x000000, 0.15);
536
- scene.background = new THREE.Color(0x000000);
537
  } else {
538
  scene.fog = null;
539
- scene.background = new THREE.Color(0x88ccff);
540
  }
541
  }
542
 
 
46
  background: radial-gradient(circle, transparent 50%, rgba(0,0,0,0.4) 100%);
47
  pointer-events: none;
48
  }
 
 
 
 
 
 
 
 
 
 
 
49
 
50
  /* 터치 컨트롤 스타일 (선택 사항 - 가상 조이스틱) */
51
  #joystick-zone {
 
79
  <div id="crosshair" class="ui">+</div>
80
  <div id="flashlight-status" class="ui">Flashlight [F]</div>
81
  <div class="vignette"></div>
 
82
  <div id="joystick-zone">
83
  <div id="joystick-knob"></div>
84
  </div>
85
 
86
  <script src="https://cdnjs.cloudflare.com/ajax/libs/three.js/r128/three.min.js"></script>
87
+ <script defer src="https://cdnjs.cloudflare.com/ajax/libs/simplex-noise/4.0.1/simplex-noise.min.js"></script> <!-- defer 추가 -->
88
  <script>
89
  const SPAWN_POSITION = new THREE.Vector3(0, 1.7, 30);
90
  const CAVE_ENTRANCE = new THREE.Vector3(0, 1.7, -15);
 
112
  trees: [],
113
  vegetation: []
114
  };
115
+ let isTransitioning = false; // initial load
116
  let caveSystem = [];
117
 
118
  // --- 터치 컨트롤 변수 ---
 
146
  camera.position.copy(SPAWN_POSITION);
147
  camera.lookAt(0, 1.7, 0); // Look towards the origin (adjust as needed)
148
 
149
+ //초기배경
150
+ scene.background = new THREE.Color(0x88ccff);
151
+
152
 
153
  document.addEventListener('keydown', onKeyDown);
154
  document.addEventListener('keyup', onKeyUp);
 
162
  document.addEventListener('touchend', onTouchEnd, false);
163
 
164
 
 
 
 
165
  // Simplex Noise 초기화 (이제 defer 때문에 여기서 가능)
166
  simplex = new SimplexNoise();
167
 
 
445
  Promise.all(chunkPromises)
446
  .then(() => {
447
  isTransitioning = false;
448
+ // document.getElementById('loading-indicator').style.display = 'none';
449
  })
450
  .catch(error => {
451
  console.error("Error loading chunks:", error);
452
  isTransitioning = false; // Ensure isTransitioning is reset
453
+ // document.getElementById('loading-indicator').style.display = 'none';
454
  });
455
  }
456
 
 
521
  function transitionEnvironment() {
522
  if (player.inCave) {
523
  scene.fog = new THREE.FogExp2(0x000000, 0.15);
524
+ scene.background = new THREE.Color(0x000000); //동굴안 배경
525
  } else {
526
  scene.fog = null;
527
+ scene.background = new THREE.Color(0x88ccff); //동굴밖 배경
528
  }
529
  }
530