function initSwitchTheme () {
  Array.from(document.getElementsByClassName('theme-switch')).forEach(themeSwitch => {
    themeSwitch.addEventListener('click', () => {
      const currentTheme = document.body.getAttribute('theme')
      if (currentTheme === 'dark') {
        setColorTheme('black')
      } else if (currentTheme === 'black') {
        setColorTheme('light')
      } else {
        setColorTheme('dark')
      }
      for (const event of window.switchThemeEventSet) event()
    })
  })
}
/**
 * Initialize the switch theme button.
 */
Initialize the switch theme button.
Initialize the switch theme button .
function initSwitchTheme () {
  Array.from(document.getElementsByClassName('theme-switch')).forEach(themeSwitch => {
    themeSwitch.addEventListener('click', () => {
      const currentTheme = document.body.getAttribute('theme')
      if (currentTheme === 'dark') {
        setColorTheme('black')
      } else if (currentTheme === 'black') {
        setColorTheme('light')
      } else {
        setColorTheme('dark')
      }
      for (const event of window.switchThemeEventSet) event()
    })
  })
}
function initSwitchTheme ( ) { Array . from ( document . getElementsByClassName ( 'theme-switch' ) ) . forEach ( themeSwitch => { themeSwitch . addEventListener ( 'click' , ( ) => { const currentTheme = document . body . getAttribute ( 'theme' ) if ( currentTheme === 'dark' ) { setColorTheme ( 'black' ) } else if ( currentTheme === 'black' ) { setColorTheme ( 'light' ) } else { setColorTheme ( 'dark' ) } for ( const event of window . switchThemeEventSet ) event ( ) } ) } ) }
Initialize the switch theme button.
Initialize the switch theme button .