update faivcon when cycling themes

Hunter
Monday, June 16th, 2025 at 11:56 PM

index.html+17 

index.html
  69  			--text: var(--licorice);
  70  			--highlight: var(--wasabi);
  71  			--accent: var(--eggplant);
  72 +			--icon: '🦠';
  73  		}
  74  
  75  		:root[data-theme="swamp"] {

  77  			--text: var(--tadpole);
  78  			--highlight: var(--lilypad);
  79  			--accent: var(--reed);
  80 +			--icon: '🐸';
  81  		}
  82  
  83  		:root[data-theme="sunflower"] {

  85  			--text: var(--loam);
  86  			--highlight: var(--chlorophyll);
  87  			--accent: var(--terracotta);
  88 +			--icon: '🌻';
  89  		}
  90  
  91  		:root[data-theme="harvest"] {

  93  			--text: var(--earth);
  94  			--highlight: var(--pumpkin);
  95  			--accent: var(--tobacco);
  96 +			--icon: '🌾';
  97  		}
  98  
  99  		:root[data-theme="medieval"] {

 101  			--text: var(--goat-milk);
 102  			--highlight: var(--burl);
 103  			--accent: var(--flame);
 104 +			--icon: '🐐';
 105  			& input[type="text"] {
 106  				font-family: BasteleurMoonlight;
 107  			}

 112  			--text: var(--smoke);
 113  			--highlight: var(--ash);
 114  			--accent: var(--cinder);
 115 +			--icon: '🪵';
 116  			& input[type="text"] {
 117  				font-family: BasteleurMoonlight;
 118  			}

 126  			--text: var(--taffy);
 127  			--highlight: var(--blue-raspberry);
 128  			--accent: var(--bubblegum);
 129 +			--icon: '🍬';
 130  
 131  			.checkbox-label {
 132  				border-radius: 10px;

 150  			--text: var(--coconut);
 151  			--highlight: var(--licorice);
 152  			--accent: var(--green-apple);
 153 +			--icon: '🛠️';
 154  			& input[type="text"] {
 155  				font-family: ElectrolizeRegular;
 156  				font-weight: 200;

1107  				localStorage.setItem('currentTheme', theme);
1108  			}
1109  
1110 +			function updateFavicon() {
1111 +				const iconEmoji = getComputedStyle(document.documentElement).getPropertyValue('--icon').trim().replace(/'/g, '');
1112 +				const faviconLink = document.querySelector('link[rel="icon"]');
1113 +				if (faviconLink && iconEmoji) {
1114 +					faviconLink.href = `data:image/svg+xml,<svg xmlns=%22http://www.w3.org/2000/svg%22 viewBox=%220 0 100 100%22><text y=%22.9em%22 font-size=%2290%22>${iconEmoji}</text></svg>`;
1115 +				}
1116 +			}
1117 +
1118  			function setTheme(theme) {
1119  				document.documentElement.setAttribute('data-theme', theme);
1120  				const backgroundColor = getComputedStyle(document.documentElement).getPropertyValue('--background').trim();
1121  				document.getElementById('themeColor').setAttribute('content', backgroundColor);
1122 +				updateFavicon();
1123  			}
1124  
1125  			function setInitialTheme() {