mistpe commited on
Commit
c4ae275
·
verified ·
1 Parent(s): 10f8689

Update index.html

Browse files
Files changed (1) hide show
  1. index.html +85 -47
index.html CHANGED
@@ -1771,13 +1771,11 @@
1771
  100% { transform: scale(1); }
1772
  }
1773
  </style>
1774
-
1775
  <script>
1776
  // 引入Chart.js
1777
  const script = document.createElement('script');
1778
  script.src = 'https://cdnjs.cloudflare.com/ajax/libs/Chart.js/3.7.0/chart.min.js';
1779
  document.head.appendChild(script);
1780
-
1781
  script.onload = function() {
1782
  // 雷达图配置
1783
  const ctx = document.getElementById('radarChart').getContext('2d');
@@ -1805,7 +1803,6 @@ script.onload = function() {
1805
  color: '#96ceb4'
1806
  }
1807
  ];
1808
-
1809
  new Chart(ctx, {
1810
  type: 'doughnut',
1811
  data: {
@@ -1859,51 +1856,92 @@ script.onload = function() {
1859
  });
1860
  };
1861
 
1862
- // 粒子效果配置
1863
- particlesJS('particles-js', {
1864
- particles: {
1865
- number: { value: 80, density: { enable: true, value_area: 800 } },
1866
- color: { value: '#ffd93d' },
1867
- shape: { type: 'circle' },
1868
- opacity: { value: 0.5, random: true },
1869
- size: { value: 3, random: true },
1870
- line_linked: {
1871
- enable: true,
1872
- distance: 150,
1873
- color: '#ff6b6b',
1874
- opacity: 0.2,
1875
- width: 1
1876
- },
1877
- move: {
1878
- enable: true,
1879
- speed: 2,
1880
- direction: 'none',
1881
- random: true,
1882
- straight: false,
1883
- out_mode: 'out'
1884
- }
1885
- }
1886
- });
1887
-
1888
- // 幻灯片切换逻辑
1889
- let currentSlide = 1;
1890
- const totalSlides = 16;
1891
-
1892
- document.addEventListener('click', () => {
1893
- document.querySelector(`#slide${currentSlide}`).classList.remove('active');
1894
- currentSlide = currentSlide === totalSlides ? 1 : currentSlide + 1;
1895
- document.querySelector(`#slide${currentSlide}`).classList.add('active');
1896
- updateProgressBar();
1897
- });
1898
-
1899
- // 进度条更新
1900
- function updateProgressBar() {
1901
- const progress = (currentSlide - 1) / totalSlides * 100;
1902
- document.querySelector('.progress-bar').style.width = `${progress}%`;
1903
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1904
 
1905
- // 初始化进度条
1906
- updateProgressBar();
1907
- </script>
1908
  </body>
1909
  </html>
 
1771
  100% { transform: scale(1); }
1772
  }
1773
  </style>
 
1774
  <script>
1775
  // 引入Chart.js
1776
  const script = document.createElement('script');
1777
  script.src = 'https://cdnjs.cloudflare.com/ajax/libs/Chart.js/3.7.0/chart.min.js';
1778
  document.head.appendChild(script);
 
1779
  script.onload = function() {
1780
  // 雷达图配置
1781
  const ctx = document.getElementById('radarChart').getContext('2d');
 
1803
  color: '#96ceb4'
1804
  }
1805
  ];
 
1806
  new Chart(ctx, {
1807
  type: 'doughnut',
1808
  data: {
 
1856
  });
1857
  };
1858
 
1859
+ // 粒子效果配置
1860
+ particlesJS('particles-js', {
1861
+ particles: {
1862
+ number: { value: 80, density: { enable: true, value_area: 800 } },
1863
+ color: { value: '#ffd93d' },
1864
+ shape: { type: 'circle' },
1865
+ opacity: { value: 0.5, random: true },
1866
+ size: { value: 3, random: true },
1867
+ line_linked: {
1868
+ enable: true,
1869
+ distance: 150,
1870
+ color: '#ff6b6b',
1871
+ opacity: 0.2,
1872
+ width: 1
1873
+ },
1874
+ move: {
1875
+ enable: true,
1876
+ speed: 2,
1877
+ direction: 'none',
1878
+ random: true,
1879
+ straight: false,
1880
+ out_mode: 'out'
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1881
  }
1882
+ }
1883
+ });
1884
+
1885
+ // 幻灯片切换逻辑
1886
+ let currentSlide = 1;
1887
+ const totalSlides = 16;
1888
+
1889
+ // 切换到指定幻灯片的函数
1890
+ function goToSlide(slideNumber) {
1891
+ if (slideNumber < 1 || slideNumber > totalSlides) return;
1892
+
1893
+ document.querySelector(`#slide${currentSlide}`).classList.remove('active');
1894
+ currentSlide = slideNumber;
1895
+ document.querySelector(`#slide${currentSlide}`).classList.add('active');
1896
+ updateProgressBar();
1897
+ }
1898
+
1899
+ // 下一张幻灯片
1900
+ function nextSlide() {
1901
+ goToSlide(currentSlide === totalSlides ? 1 : currentSlide + 1);
1902
+ }
1903
+
1904
+ // 上一张幻灯片
1905
+ function previousSlide() {
1906
+ goToSlide(currentSlide === 1 ? totalSlides : currentSlide - 1);
1907
+ }
1908
+
1909
+ // 点击事件处理
1910
+ document.addEventListener('click', (event) => {
1911
+ // 获取点击位置
1912
+ const clickX = event.clientX;
1913
+ const windowWidth = window.innerWidth;
1914
+
1915
+ // 如果点击在屏幕左半边,向前翻页;右半边,向后翻页
1916
+ if (clickX < windowWidth / 2) {
1917
+ previousSlide();
1918
+ } else {
1919
+ nextSlide();
1920
+ }
1921
+ });
1922
+
1923
+ // 键盘事件处理
1924
+ document.addEventListener('keydown', (event) => {
1925
+ switch(event.key) {
1926
+ case 'ArrowLeft':
1927
+ case 'ArrowUp':
1928
+ previousSlide();
1929
+ break;
1930
+ case 'ArrowRight':
1931
+ case 'ArrowDown':
1932
+ nextSlide();
1933
+ break;
1934
+ }
1935
+ });
1936
+
1937
+ // 进度条更新
1938
+ function updateProgressBar() {
1939
+ const progress = (currentSlide - 1) / totalSlides * 100;
1940
+ document.querySelector('.progress-bar').style.width = `${progress}%`;
1941
+ }
1942
 
1943
+ // 初始化进度条
1944
+ updateProgressBar();
1945
+ </script>
1946
  </body>
1947
  </html>