ParulPandey commited on
Commit
9cce9c1
·
verified ·
1 Parent(s): 4eaa831

make the speed of earth increase or decrease when slider is used - Follow Up Deployment

Browse files
Files changed (1) hide show
  1. index.html +3 -3
index.html CHANGED
@@ -91,7 +91,7 @@
91
  <div class="control-panel" style="left: 2rem; transform: none;">
92
  <div class="flex flex-col space-y-2 w-40">
93
  <div>
94
- <label for="earth-speed" class="block text-xs font-medium mb-1">Earth Orbit Speed</label>
95
  <input type="range" id="earth-speed" min="0.1" max="2" step="0.1" value="0.5" class="w-full slider-thumb">
96
  </div>
97
  <div>
@@ -125,7 +125,7 @@
125
  // Event listeners for controls
126
  earthSpeedSlider.addEventListener('input', function() {
127
  earthSpeed = parseFloat(this.value);
128
- earthSpeedValue.textContent = earthSpeed;
129
  if (earth) earth.speed = earthSpeed;
130
  });
131
 
@@ -139,7 +139,7 @@
139
  sunIntensitySlider.value = 100;
140
  earthSpeed = 0.5;
141
  sunIntensity = 100;
142
- earthSpeedValue.textContent = earthSpeed;
143
  sunIntensityValue.textContent = sunIntensity;
144
  if (earth) earth.speed = earthSpeed;
145
  });
 
91
  <div class="control-panel" style="left: 2rem; transform: none;">
92
  <div class="flex flex-col space-y-2 w-40">
93
  <div>
94
+ <label for="earth-speed" class="block text-xs font-medium mb-1">Earth Orbit Speed: <span id="earth-speed-value">0.5</span></label>
95
  <input type="range" id="earth-speed" min="0.1" max="2" step="0.1" value="0.5" class="w-full slider-thumb">
96
  </div>
97
  <div>
 
125
  // Event listeners for controls
126
  earthSpeedSlider.addEventListener('input', function() {
127
  earthSpeed = parseFloat(this.value);
128
+ document.getElementById('earth-speed-value').textContent = earthSpeed.toFixed(1);
129
  if (earth) earth.speed = earthSpeed;
130
  });
131
 
 
139
  sunIntensitySlider.value = 100;
140
  earthSpeed = 0.5;
141
  sunIntensity = 100;
142
+ document.getElementById('earth-speed-value').textContent = earthSpeed.toFixed(1);
143
  sunIntensityValue.textContent = sunIntensity;
144
  if (earth) earth.speed = earthSpeed;
145
  });