openfree commited on
Commit
b5e52cd
ยท
verified ยท
1 Parent(s): e23870a

Update dna-slot-machine.html

Browse files
Files changed (1) hide show
  1. dna-slot-machine.html +146 -16
dna-slot-machine.html CHANGED
@@ -203,7 +203,92 @@
203
  font-family: 'Orbitron', monospace;
204
  }
205
 
206
- /* Cell type selector with casino chips style */
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
207
  .cell-type-selector {
208
  display: flex;
209
  align-items: center;
@@ -498,6 +583,10 @@
498
  inset 0 0 20px rgba(0, 255, 0, 0.1);
499
  position: relative;
500
  min-height: 100px;
 
 
 
 
501
  }
502
 
503
  .sequence-display::before {
@@ -556,10 +645,13 @@
556
  margin-bottom: 20px;
557
  font-family: 'Courier New', monospace;
558
  font-size: 0.85rem;
 
559
  word-break: break-all;
560
  color: #00ff00;
561
  max-height: 150px;
562
  overflow-y: auto;
 
 
563
  }
564
 
565
  .protein-analysis {
@@ -727,6 +819,16 @@
727
  </div>
728
  </div>
729
 
 
 
 
 
 
 
 
 
 
 
730
  <div class="reels-container" id="reelsContainer">
731
  <div class="reels-wrapper" id="reelsWrapper"></div>
732
  <div class="lever-container">
@@ -743,11 +845,11 @@
743
  <button class="spin-button" id="spinButton"><span>๐ŸŽฒ SPIN TO WIN ๐ŸŽฒ</span></button>
744
 
745
  <div class="sequence-display" id="sequenceDisplay">
746
- ๐ŸŽฏ Pull the lever or press SPIN to generate your winning sequence! ๐ŸŽฏ
747
  </div>
748
 
749
  <div class="protein-panel" id="proteinPanel">
750
- <div class="protein-header">๐Ÿ”ฌ Protein Analysis Report ๐Ÿ”ฌ</div>
751
 
752
  <div class="protein-stats" id="proteinStats"></div>
753
 
@@ -767,7 +869,7 @@
767
  <a href="https://pinellolab.org" target="_blank" rel="noopener noreferrer">
768
  ๐Ÿงฌ Based by PINELLO LAB ๐Ÿงฌ
769
  </a>
770
- <a href="#" target="_blank" rel="noopener noreferrer">
771
  โšก Powered by VIDraft โšก
772
  </a>
773
  </div>
@@ -859,6 +961,7 @@
859
 
860
  function displayProteinAnalysis(metadata) {
861
  const panel = document.getElementById('proteinPanel');
 
862
  const statsDiv = document.getElementById('proteinStats');
863
  const sequenceDiv = document.getElementById('proteinSequence');
864
  const analysisDiv = document.getElementById('proteinAnalysis');
@@ -866,36 +969,42 @@
866
  // Show panel
867
  panel.classList.add('active');
868
 
 
 
 
 
 
 
869
  // Display stats
870
  statsDiv.innerHTML = `
871
  <div class="stat-card">
872
- <div class="stat-label">Cell Type</div>
873
  <div class="stat-value">${metadata.cell_type || 'Unknown'}</div>
874
  </div>
875
  <div class="stat-card">
876
- <div class="stat-label">DNA Length</div>
877
  <div class="stat-value">${TARGET_SEQUENCE.length} bp</div>
878
  </div>
879
  <div class="stat-card">
880
- <div class="stat-label">Protein Length</div>
881
  <div class="stat-value">${metadata.protein_length || 0} aa</div>
882
  </div>
883
  <div class="stat-card">
884
- <div class="stat-label">Generation Time</div>
885
  <div class="stat-value">${(metadata.generation_time || 0).toFixed(1)}s</div>
886
  </div>
887
  `;
888
 
889
  // Display protein sequence
890
  if (metadata.protein_sequence) {
891
- sequenceDiv.innerHTML = `<strong>Protein Sequence:</strong><br>${metadata.protein_sequence}`;
892
  }
893
 
894
  // Display analysis
895
  if (metadata.protein_analysis) {
896
- analysisDiv.innerHTML = `<h3>๐Ÿงฌ Structural & Functional Analysis</h3>${metadata.protein_analysis}`;
897
  } else {
898
- analysisDiv.innerHTML = '<h3>โณ Protein analysis pending...</h3>';
899
  }
900
  }
901
 
@@ -930,7 +1039,9 @@
930
  container.classList.remove('spinning');
931
  container.classList.add('jackpot-win');
932
 
933
- display.innerHTML = `<strong>๐ŸŽŠ JACKPOT SEQUENCE ๐ŸŽŠ</strong><br><span style="color: #00ff00; font-family: 'Courier New', monospace;">${TARGET_SEQUENCE}</span>`;
 
 
934
 
935
  // Display protein analysis if available
936
  if (metadata) {
@@ -965,26 +1076,44 @@
965
  // Pull the lever
966
  lever.classList.add('pulled');
967
 
 
 
 
968
  button.disabled = true;
969
- display.innerHTML = '๐ŸŽฒ <strong>SPINNING THE GENETIC WHEEL OF FORTUNE...</strong> ๐ŸŽฒ';
 
 
970
  container.classList.add('spinning');
971
 
972
  // Start continuous spinning immediately
973
  startContinuousSpinning();
974
 
975
- // Get selected cell type
976
  const cellType = document.querySelector('input[name="cellType"]:checked').value;
 
977
 
978
  // Send request to parent window
979
  window.parent.postMessage({
980
  type: 'generate_request',
981
- cellType: cellType
 
982
  }, '*');
983
  }
984
 
985
  // Initialize
986
  initializeReels();
987
 
 
 
 
 
 
 
 
 
 
 
 
988
  // Event listeners
989
  document.getElementById('spinButton').addEventListener('click', startGeneration);
990
 
@@ -1010,9 +1139,10 @@
1010
  const display = document.getElementById('sequenceDisplay');
1011
  const button = document.getElementById('spinButton');
1012
  const lever = document.getElementById('lever');
 
1013
 
1014
  container.classList.remove('spinning');
1015
- display.innerHTML = '<strong style="color: #ff0000;">โŒ BUST! โŒ</strong><br>' + event.data.error;
1016
  button.disabled = false;
1017
  isSpinning = false;
1018
  lever.classList.remove('pulled');
 
203
  font-family: 'Orbitron', monospace;
204
  }
205
 
206
+ /* Language selector */
207
+ .language-selector {
208
+ display: flex;
209
+ justify-content: center;
210
+ margin: 20px 0;
211
+ }
212
+
213
+ .language-toggle {
214
+ position: relative;
215
+ display: inline-block;
216
+ width: 120px;
217
+ height: 40px;
218
+ cursor: pointer;
219
+ }
220
+
221
+ .language-toggle input {
222
+ opacity: 0;
223
+ width: 0;
224
+ height: 0;
225
+ }
226
+
227
+ .toggle-slider {
228
+ position: absolute;
229
+ top: 0;
230
+ left: 0;
231
+ right: 0;
232
+ bottom: 0;
233
+ background: linear-gradient(145deg, #444, #222);
234
+ border: 2px solid #ffd700;
235
+ border-radius: 40px;
236
+ transition: all 0.4s;
237
+ display: flex;
238
+ align-items: center;
239
+ justify-content: space-between;
240
+ padding: 0 10px;
241
+ box-shadow:
242
+ 0 5px 15px rgba(0,0,0,0.5),
243
+ inset 0 2px 5px rgba(255,255,255,0.1);
244
+ }
245
+
246
+ .lang-label {
247
+ font-size: 0.9rem;
248
+ font-weight: bold;
249
+ color: #888;
250
+ transition: all 0.3s;
251
+ z-index: 2;
252
+ }
253
+
254
+ .lang-label[data-lang="en"] {
255
+ margin-left: 5px;
256
+ }
257
+
258
+ .lang-label[data-lang="ko"] {
259
+ margin-right: 5px;
260
+ }
261
+
262
+ .toggle-slider::after {
263
+ content: '';
264
+ position: absolute;
265
+ height: 32px;
266
+ width: 50px;
267
+ left: 4px;
268
+ bottom: 4px;
269
+ background: linear-gradient(145deg, #00ff00, #00cc00);
270
+ border-radius: 32px;
271
+ transition: all 0.4s;
272
+ box-shadow:
273
+ 0 2px 10px rgba(0,255,0,0.5),
274
+ inset 0 -2px 5px rgba(0,0,0,0.3);
275
+ }
276
+
277
+ .language-toggle input:checked + .toggle-slider::after {
278
+ transform: translateX(62px);
279
+ background: linear-gradient(145deg, #ff4444, #cc0000);
280
+ box-shadow:
281
+ 0 2px 10px rgba(255,0,0,0.5),
282
+ inset 0 -2px 5px rgba(0,0,0,0.3);
283
+ }
284
+
285
+ .language-toggle input:checked + .toggle-slider .lang-label[data-lang="ko"] {
286
+ color: #fff;
287
+ }
288
+
289
+ .language-toggle input:not(:checked) + .toggle-slider .lang-label[data-lang="en"] {
290
+ color: #fff;
291
+ }
292
  .cell-type-selector {
293
  display: flex;
294
  align-items: center;
 
583
  inset 0 0 20px rgba(0, 255, 0, 0.1);
584
  position: relative;
585
  min-height: 100px;
586
+ word-wrap: break-word;
587
+ word-break: break-all;
588
+ white-space: pre-wrap;
589
+ overflow-wrap: break-word;
590
  }
591
 
592
  .sequence-display::before {
 
645
  margin-bottom: 20px;
646
  font-family: 'Courier New', monospace;
647
  font-size: 0.85rem;
648
+ word-wrap: break-word;
649
  word-break: break-all;
650
  color: #00ff00;
651
  max-height: 150px;
652
  overflow-y: auto;
653
+ white-space: pre-wrap;
654
+ line-height: 1.4;
655
  }
656
 
657
  .protein-analysis {
 
819
  </div>
820
  </div>
821
 
822
+ <div class="language-selector">
823
+ <label class="language-toggle">
824
+ <input type="checkbox" id="languageToggle">
825
+ <span class="toggle-slider">
826
+ <span class="lang-label" data-lang="en">EN</span>
827
+ <span class="lang-label" data-lang="ko">ํ•œ๊ธ€</span>
828
+ </span>
829
+ </label>
830
+ </div>
831
+
832
  <div class="reels-container" id="reelsContainer">
833
  <div class="reels-wrapper" id="reelsWrapper"></div>
834
  <div class="lever-container">
 
845
  <button class="spin-button" id="spinButton"><span>๐ŸŽฒ SPIN TO WIN ๐ŸŽฒ</span></button>
846
 
847
  <div class="sequence-display" id="sequenceDisplay">
848
+ ๐ŸŽฏ <span id="initialMessage">Pull the lever or press SPIN to generate your winning sequence!</span> ๐ŸŽฏ
849
  </div>
850
 
851
  <div class="protein-panel" id="proteinPanel">
852
+ <div class="protein-header" id="proteinHeader">๐Ÿ”ฌ Protein Analysis Report ๐Ÿ”ฌ</div>
853
 
854
  <div class="protein-stats" id="proteinStats"></div>
855
 
 
869
  <a href="https://pinellolab.org" target="_blank" rel="noopener noreferrer">
870
  ๐Ÿงฌ Based by PINELLO LAB ๐Ÿงฌ
871
  </a>
872
+ <a href="https://discord.gg/openfreeai" target="_blank" rel="noopener noreferrer">
873
  โšก Powered by VIDraft โšก
874
  </a>
875
  </div>
 
961
 
962
  function displayProteinAnalysis(metadata) {
963
  const panel = document.getElementById('proteinPanel');
964
+ const header = document.getElementById('proteinHeader');
965
  const statsDiv = document.getElementById('proteinStats');
966
  const sequenceDiv = document.getElementById('proteinSequence');
967
  const analysisDiv = document.getElementById('proteinAnalysis');
 
969
  // Show panel
970
  panel.classList.add('active');
971
 
972
+ // Check language
973
+ const isKorean = document.getElementById('languageToggle').checked;
974
+
975
+ // Update header
976
+ header.textContent = isKorean ? '๐Ÿ”ฌ ๋‹จ๋ฐฑ์งˆ ๋ถ„์„ ๋ณด๊ณ ์„œ ๐Ÿ”ฌ' : '๐Ÿ”ฌ Protein Analysis Report ๐Ÿ”ฌ';
977
+
978
  // Display stats
979
  statsDiv.innerHTML = `
980
  <div class="stat-card">
981
+ <div class="stat-label">${isKorean ? '์„ธํฌ ํƒ€์ž…' : 'Cell Type'}</div>
982
  <div class="stat-value">${metadata.cell_type || 'Unknown'}</div>
983
  </div>
984
  <div class="stat-card">
985
+ <div class="stat-label">${isKorean ? 'DNA ๊ธธ์ด' : 'DNA Length'}</div>
986
  <div class="stat-value">${TARGET_SEQUENCE.length} bp</div>
987
  </div>
988
  <div class="stat-card">
989
+ <div class="stat-label">${isKorean ? '๋‹จ๋ฐฑ์งˆ ๊ธธ์ด' : 'Protein Length'}</div>
990
  <div class="stat-value">${metadata.protein_length || 0} aa</div>
991
  </div>
992
  <div class="stat-card">
993
+ <div class="stat-label">${isKorean ? '์ƒ์„ฑ ์‹œ๊ฐ„' : 'Generation Time'}</div>
994
  <div class="stat-value">${(metadata.generation_time || 0).toFixed(1)}s</div>
995
  </div>
996
  `;
997
 
998
  // Display protein sequence
999
  if (metadata.protein_sequence) {
1000
+ sequenceDiv.innerHTML = `<strong>${isKorean ? '๋‹จ๋ฐฑ์งˆ ์‹œํ€€์Šค:' : 'Protein Sequence:'}</strong><br>${metadata.protein_sequence}`;
1001
  }
1002
 
1003
  // Display analysis
1004
  if (metadata.protein_analysis) {
1005
+ analysisDiv.innerHTML = `<h3>๐Ÿงฌ ${isKorean ? '๊ตฌ์กฐ ๋ฐ ๊ธฐ๋Šฅ ๋ถ„์„' : 'Structural & Functional Analysis'}</h3>${metadata.protein_analysis}`;
1006
  } else {
1007
+ analysisDiv.innerHTML = `<h3>โณ ${isKorean ? '๋‹จ๋ฐฑ์งˆ ๋ถ„์„ ๋Œ€๊ธฐ ์ค‘...' : 'Protein analysis pending...'}</h3>`;
1008
  }
1009
  }
1010
 
 
1039
  container.classList.remove('spinning');
1040
  container.classList.add('jackpot-win');
1041
 
1042
+ const isKorean = document.getElementById('languageToggle').checked;
1043
+
1044
+ display.innerHTML = `<strong>๐ŸŽŠ ${isKorean ? '์žญํŒŸ ์‹œํ€€์Šค' : 'JACKPOT SEQUENCE'} ๐ŸŽŠ</strong><br><span style="color: #00ff00; font-family: 'Courier New', monospace; word-wrap: break-word; word-break: break-all; display: block; margin-top: 10px;">${TARGET_SEQUENCE}</span>`;
1045
 
1046
  // Display protein analysis if available
1047
  if (metadata) {
 
1076
  // Pull the lever
1077
  lever.classList.add('pulled');
1078
 
1079
+ // Check language
1080
+ const isKorean = document.getElementById('languageToggle').checked;
1081
+
1082
  button.disabled = true;
1083
+ display.innerHTML = isKorean ?
1084
+ '๐ŸŽฒ <strong>์œ ์ „์ž ๋ฃฐ๋ ›์„ ๋Œ๋ฆฌ๋Š” ์ค‘...</strong> ๐ŸŽฒ' :
1085
+ '๐ŸŽฒ <strong>SPINNING THE GENETIC WHEEL OF FORTUNE...</strong> ๐ŸŽฒ';
1086
  container.classList.add('spinning');
1087
 
1088
  // Start continuous spinning immediately
1089
  startContinuousSpinning();
1090
 
1091
+ // Get selected cell type and language
1092
  const cellType = document.querySelector('input[name="cellType"]:checked').value;
1093
+ const language = document.getElementById('languageToggle').checked ? 'ko' : 'en';
1094
 
1095
  // Send request to parent window
1096
  window.parent.postMessage({
1097
  type: 'generate_request',
1098
+ cellType: cellType,
1099
+ language: language
1100
  }, '*');
1101
  }
1102
 
1103
  // Initialize
1104
  initializeReels();
1105
 
1106
+ // Language toggle event listener
1107
+ document.getElementById('languageToggle').addEventListener('change', function() {
1108
+ const isKorean = this.checked;
1109
+ const initialMessage = document.getElementById('initialMessage');
1110
+ if (initialMessage && !isSpinning) {
1111
+ initialMessage.textContent = isKorean ?
1112
+ '๋ ˆ๋ฒ„๋ฅผ ๋‹น๊ธฐ๊ฑฐ๋‚˜ SPIN์„ ๋ˆŒ๋Ÿฌ ๋‹น์ฒจ ์‹œํ€€์Šค๋ฅผ ์ƒ์„ฑํ•˜์„ธ์š”!' :
1113
+ 'Pull the lever or press SPIN to generate your winning sequence!';
1114
+ }
1115
+ });
1116
+
1117
  // Event listeners
1118
  document.getElementById('spinButton').addEventListener('click', startGeneration);
1119
 
 
1139
  const display = document.getElementById('sequenceDisplay');
1140
  const button = document.getElementById('spinButton');
1141
  const lever = document.getElementById('lever');
1142
+ const isKorean = document.getElementById('languageToggle').checked;
1143
 
1144
  container.classList.remove('spinning');
1145
+ display.innerHTML = `<strong style="color: #ff0000;">โŒ ${isKorean ? '์‹คํŒจ!' : 'BUST!'} โŒ</strong><br>` + event.data.error;
1146
  button.disabled = false;
1147
  isSpinning = false;
1148
  lever.classList.remove('pulled');