Aleksandr Sashka commited on
Commit
fd3aaaf
·
verified ·
1 Parent(s): 1bc1410

иконки перестали отображаться на сайте

Browse files
Files changed (1) hide show
  1. index.html +25 -23
index.html CHANGED
@@ -25,15 +25,20 @@
25
  </script>
26
  <!-- Combined Feather Icons from both CDN and npm for maximum compatibility -->
27
  <script src="https://cdn.jsdelivr.net/npm/feather-icons/dist/feather.min.js"></script>
28
- <script>feather.replace()</script>
29
  <script>
30
- // Fallback if primary CDN fails
31
- if(typeof feather === 'undefined') {
32
- document.write('<script src="https://unpkg.com/feather-icons"><\/script>');
33
- document.addEventListener('DOMContentLoaded', function() {
34
  feather.replace();
35
- });
36
- }
 
 
 
 
 
 
 
 
37
  </script>
38
  <style>
39
  @import url('https://fonts.googleapis.com/css2?family=Montserrat:wght@300;400;500;700;900&display=swap');
@@ -849,19 +854,16 @@ transition: max-height 0.5s ease-in-out;
849
  </div>
850
 
851
  <script>
852
- // Ensure Feather Icons are loaded
853
- if(typeof feather !== 'undefined') {
854
- feather.replace();
855
- } else {
856
- console.warn('Feather Icons not loaded - trying fallback');
857
- document.addEventListener('DOMContentLoaded', function() {
858
- if(typeof feather !== 'undefined') {
859
- feather.replace();
860
- }
861
- });
862
  }
863
-
864
- // Smooth scrolling for navigation links
 
 
865
  document.querySelectorAll('a[href^="#"]').forEach(anchor => {
866
  anchor.addEventListener('click', function (e) {
867
  e.preventDefault();
@@ -943,9 +945,9 @@ menuToggle.addEventListener('click', () => {
943
  mobileMenu.style.maxHeight = '0';
944
  menuToggle.innerHTML = '<i data-feather="menu" class="w-6 h-6"></i>';
945
  }
946
- feather.replace();
947
  });
948
- // Close mobile menu on link click with null check
949
  const mobileLinks = document.querySelectorAll('.nav-link-mobile');
950
  if(mobileLinks.length > 0) {
951
  mobileLinks.forEach(link => {
@@ -953,9 +955,9 @@ link.addEventListener('click', () => {
953
  menuOpen = false;
954
  mobileMenu.style.maxHeight = '0';
955
  menuToggle.innerHTML = '<i data-feather="menu" class="w-6 h-6"></i>';
956
- feather.replace();
957
  });
958
- });
959
  // Nav-link hover animation with null check
960
  const navLinks = document.querySelectorAll('.nav-link');
961
  if(navLinks.length > 0) {
 
25
  </script>
26
  <!-- Combined Feather Icons from both CDN and npm for maximum compatibility -->
27
  <script src="https://cdn.jsdelivr.net/npm/feather-icons/dist/feather.min.js"></script>
 
28
  <script>
29
+ document.addEventListener('DOMContentLoaded', function() {
30
+ if(typeof feather !== 'undefined') {
 
 
31
  feather.replace();
32
+ } else {
33
+ // Load from alternative CDN if primary fails
34
+ const script = document.createElement('script');
35
+ script.src = 'https://unpkg.com/feather-icons';
36
+ script.onload = function() {
37
+ feather.replace();
38
+ };
39
+ document.head.appendChild(script);
40
+ }
41
+ });
42
  </script>
43
  <style>
44
  @import url('https://fonts.googleapis.com/css2?family=Montserrat:wght@300;400;500;700;900&display=swap');
 
854
  </div>
855
 
856
  <script>
857
+ // Icon replacement on dynamic content changes
858
+ function replaceIcons() {
859
+ if(typeof feather !== 'undefined') {
860
+ feather.replace();
861
+ }
 
 
 
 
 
862
  }
863
+
864
+ // Initial icon replacement
865
+ document.addEventListener('DOMContentLoaded', replaceIcons);
866
+ // Smooth scrolling for navigation links
867
  document.querySelectorAll('a[href^="#"]').forEach(anchor => {
868
  anchor.addEventListener('click', function (e) {
869
  e.preventDefault();
 
945
  mobileMenu.style.maxHeight = '0';
946
  menuToggle.innerHTML = '<i data-feather="menu" class="w-6 h-6"></i>';
947
  }
948
+ replaceIcons();
949
  });
950
+ // Close mobile menu on link click with null check
951
  const mobileLinks = document.querySelectorAll('.nav-link-mobile');
952
  if(mobileLinks.length > 0) {
953
  mobileLinks.forEach(link => {
 
955
  menuOpen = false;
956
  mobileMenu.style.maxHeight = '0';
957
  menuToggle.innerHTML = '<i data-feather="menu" class="w-6 h-6"></i>';
958
+ replaceIcons();
959
  });
960
+ });
961
  // Nav-link hover animation with null check
962
  const navLinks = document.querySelectorAll('.nav-link');
963
  if(navLinks.length > 0) {