salomonsky commited on
Commit
d4bd867
·
verified ·
1 Parent(s): 4a3e3ab

Update index.html

Browse files
Files changed (1) hide show
  1. index.html +23 -14
index.html CHANGED
@@ -223,12 +223,15 @@
223
  </div>
224
  </details>
225
 
226
- <button id="visualizeButton" class="w-full bg-green-600 hover:bg-green-700 text-white font-bold py-2 px-4 rounded-lg transition duration-300 flex items-center justify-center space-x-2 mb-2">
 
 
227
  <svg class="w-5 h-5" xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke-width="1.5" stroke="currentColor">
228
  <path stroke-linecap="round" stroke-linejoin="round" d="M9.813 15.904L9 18.75l-.813-2.846a4.5 4.5 0 00-3.09-3.09L2.25 12l2.846-.813a4.5 4.5 0 003.09-3.09L9 5.25l.813 2.846a4.5 4.5 0 003.09 3.09L15.75 12l-2.846.813a4.5 4.5 0 00-3.09 3.09z" />
229
  </svg>
230
  <span>Sembrar</span>
231
- </button>
 
232
 
233
  <div id="progressBarContainer"><div id="progressBar"></div></div>
234
 
@@ -697,6 +700,7 @@
697
  scene.add(hashtagGroup);
698
 
699
  const visualizeButton = document.getElementById('visualizeButton');
 
700
  const topicInput = document.getElementById('topicInput');
701
  const level1Slider = document.getElementById('level1Slider');
702
  const level2Slider = document.getElementById('level2Slider');
@@ -715,6 +719,16 @@
715
  topicInput.placeholder = 'Ingresa un tema para sembrar (modo anónimo)';
716
  }
717
 
 
 
 
 
 
 
 
 
 
 
718
  document.getElementById('level1Slider').addEventListener('input', (e) => {
719
  document.getElementById('level1Value').innerText = e.target.value;
720
  });
@@ -994,6 +1008,9 @@
994
  } finally {
995
  button.disabled = false;
996
  button.innerText = 'Sembrar';
 
 
 
997
  progressBar.style.transition = 'width 0.3s ease-in';
998
  progressBar.style.width = '100%';
999
  setTimeout(() => {
@@ -1133,20 +1150,12 @@
1133
  }
1134
  allMapsDataCache[map.userId].push({ topic: map.topic, origin: origin, data: parsedData });
1135
 
1136
- if (map.userId === userId) {
1137
- visualizeRoot(map.topic, origin);
1138
- visualizeHashtags(parsedData.lista_palabras, origin, 1, null);
1139
- }
1140
  });
1141
 
1142
- Object.keys(userMaps).forEach(uid => {
1143
- const userMapOrigins = userMaps[uid];
1144
- const centroid = new THREE.Vector3(0, 0, 0);
1145
- userMapOrigins.forEach(origin => centroid.add(origin));
1146
- centroid.divideScalar(userMapOrigins.length);
1147
- // Mostrar siempre un sol central con el nombre del usuario, incluido el propio
1148
- visualizeUserPlaceholder(uid, centroid);
1149
- });
1150
 
1151
  const userListElement = document.getElementById('userList');
1152
  if (userListElement) {
 
223
  </div>
224
  </details>
225
 
226
+ <div class="flex items-center gap-2 mb-2">
227
+ <button id="newNeuronButton" class="bg-gray-700 hover:bg-gray-600 text-white font-semibold py-2 px-3 rounded-lg transition duration-300">+ Nueva neurona</button>
228
+ <button id="visualizeButton" class="flex-1 bg-green-600 hover:bg-green-700 text-white font-bold py-2 px-4 rounded-lg transition duration-300 flex items-center justify-center space-x-2">
229
  <svg class="w-5 h-5" xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke-width="1.5" stroke="currentColor">
230
  <path stroke-linecap="round" stroke-linejoin="round" d="M9.813 15.904L9 18.75l-.813-2.846a4.5 4.5 0 00-3.09-3.09L2.25 12l2.846-.813a4.5 4.5 0 003.09-3.09L9 5.25l.813 2.846a4.5 4.5 0 003.09 3.09L15.75 12l-2.846.813a4.5 4.5 0 00-3.09 3.09z" />
231
  </svg>
232
  <span>Sembrar</span>
233
+ </button>
234
+ </div>
235
 
236
  <div id="progressBarContainer"><div id="progressBar"></div></div>
237
 
 
700
  scene.add(hashtagGroup);
701
 
702
  const visualizeButton = document.getElementById('visualizeButton');
703
+ const newNeuronButton = document.getElementById('newNeuronButton');
704
  const topicInput = document.getElementById('topicInput');
705
  const level1Slider = document.getElementById('level1Slider');
706
  const level2Slider = document.getElementById('level2Slider');
 
719
  topicInput.placeholder = 'Ingresa un tema para sembrar (modo anónimo)';
720
  }
721
 
722
+ // Botón "Nueva neurona": limpiar input y centrar cámara en tu galaxia
723
+ if (newNeuronButton) {
724
+ newNeuronButton.addEventListener('click', () => {
725
+ const ti = document.getElementById('topicInput');
726
+ if (ti) ti.value = '';
727
+ focusOnUserMaps();
728
+ if (ti) ti.focus();
729
+ });
730
+ }
731
+
732
  document.getElementById('level1Slider').addEventListener('input', (e) => {
733
  document.getElementById('level1Value').innerText = e.target.value;
734
  });
 
1008
  } finally {
1009
  button.disabled = false;
1010
  button.innerText = 'Sembrar';
1011
+ // Limpiar el input para permitir nueva siembra inmediata
1012
+ const ti = document.getElementById('topicInput');
1013
+ if (ti) ti.value = '';
1014
  progressBar.style.transition = 'width 0.3s ease-in';
1015
  progressBar.style.width = '100%';
1016
  setTimeout(() => {
 
1150
  }
1151
  allMapsDataCache[map.userId].push({ topic: map.topic, origin: origin, data: parsedData });
1152
 
1153
+ // Visualizar TODOS los mapas (propios y de otros usuarios) de inmediato
1154
+ visualizeRoot(map.topic, origin);
1155
+ visualizeHashtags(parsedData.lista_palabras, origin, 1, null);
 
1156
  });
1157
 
1158
+ // (Placeholder de usuarios ya no es necesario porque se visualizan todas las constelaciones)
 
 
 
 
 
 
 
1159
 
1160
  const userListElement = document.getElementById('userList');
1161
  if (userListElement) {