Lashtw commited on
Commit
b4dce81
·
verified ·
1 Parent(s): 32cc7b0

Upload index.html

Browse files
Files changed (1) hide show
  1. index.html +32 -2
index.html CHANGED
@@ -837,12 +837,42 @@
837
  if(validData.length > 0) {
838
  document.getElementById('importStatus').innerHTML = `✅ 預先查詢完畢!目前名冊榜首為:<strong style="color:var(--accent); font-size:1.3rem; margin-left: 0.5rem; text-shadow:0 0 5px rgba(252,211,77,0.5);">${validData[0].name}</strong> (隱藏深度 ${validData[0].resultVal})`;
839
  drawPodium(validData);
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
840
  } else {
841
  document.getElementById('importStatus').innerHTML = `✅ 查詢完畢!可惜匯入名冊中無人獲得神之眷顧。`;
842
  drawPodium([]);
 
843
  }
844
- // 長條圖先不畫出,等待和現場合併
845
- if(chartInstance) { chartInstance.destroy(); chartInstance = null; }
846
  }
847
 
848
  // 現場查詢後合併邏輯顯示結果
 
837
  if(validData.length > 0) {
838
  document.getElementById('importStatus').innerHTML = `✅ 預先查詢完畢!目前名冊榜首為:<strong style="color:var(--accent); font-size:1.3rem; margin-left: 0.5rem; text-shadow:0 0 5px rgba(252,211,77,0.5);">${validData[0].name}</strong> (隱藏深度 ${validData[0].resultVal})`;
839
  drawPodium(validData);
840
+
841
+ // 發射紙花特效
842
+ setTimeout(() => {
843
+ confetti({ particleCount: 200, spread: 100, origin: { y: 0.6 }, colors: ['#fde047', '#34d399', '#60a5fa'] });
844
+ }, 500);
845
+
846
+ // 將 Excel 資料預先繪製長條圖
847
+ const ctx = document.getElementById('resultChart').getContext('2d');
848
+ if (chartInstance) chartInstance.destroy();
849
+ chartInstance = new Chart(ctx, {
850
+ type: 'bar',
851
+ data: {
852
+ labels: validData.map(s => `${s.name} (${s.paddedNumber})`),
853
+ datasets: [{
854
+ label: '神之軌跡隱藏深度 (名冊)',
855
+ data: validData.map(s => s.resultVal),
856
+ backgroundColor: 'rgba(212, 175, 55, 0.7)',
857
+ borderColor: '#fcd34d',
858
+ borderWidth: 2,
859
+ borderRadius: 6
860
+ }]
861
+ },
862
+ options: {
863
+ responsive: true,
864
+ plugins: { legend: { labels: { color: '#f9fafb', font: {size: 14} } } },
865
+ scales: {
866
+ y: { ticks: { color: '#9ca3af' }, grid: { color: 'rgba(255,255,255,0.05)' } },
867
+ x: { ticks: { color: '#d1d5db', maxRotation: 45, minRotation: 45 }, grid: { display: false } }
868
+ }
869
+ }
870
+ });
871
  } else {
872
  document.getElementById('importStatus').innerHTML = `✅ 查詢完畢!可惜匯入名冊中無人獲得神之眷顧。`;
873
  drawPodium([]);
874
+ if(chartInstance) { chartInstance.destroy(); chartInstance = null; }
875
  }
 
 
876
  }
877
 
878
  // 現場查詢後合併邏輯顯示結果