bdff513466db869bcbdbcf5e812c19f5c8102c7102d1338ccdb1826dbfa7ade7

Source Code:

$(function(){
  $('.navigation-profile').on('click', function(){
    console.log('click profile')
    $(this).toggleClass('open')
  })
  
  $('.lvl-banner--button').on('click', function(){
    $([document.documentElement, document.body]).animate({
        scrollTop: $(".my_library").offset().top
    }, 300);
  })
  
  if (!$('.lvl-banner').length) {
    let userStyle = localStorage.getItem('user_style')
    
    if (userStyle) {
      if (userStyle === 'relax-styles') {
        $('.dark-logo').removeClass('hidden')
        $('.white-logo').addClass('hidden')
      }
      if (userStyle === 'active-styles') {
        $('.dark-logo').addClass('hidden')
        $('.white-logo').removeClass('hidden')
      }
    } else {
      $('.dark-logo').removeClass('hidden')
      $('.white-logo').addClass('hidden')
    }
    
    let activateRelaxStyles = () => {
      $('#body').addClass('relax-styles');
      $('#body').removeClass('active-styles');
  
      $('.js-switch-mood').removeClass('hidden');
      $('.js-switch-mood').addClass('js-switch-mood--relax')
      $('.js-switch-mood').removeClass('js-switch-mood--active') 
      
    }
        
    let activateActiveStyles = () => {
      $('#body').addClass('active-styles');
      $('#body').removeClass('relax-styles');
      
      $('.js-switch-mood').removeClass('hidden') 
      $('.js-switch-mood').addClass('js-switch-mood--active') 
      $('.js-switch-mood').removeClass('js-switch-mood--relax')
      
    }
        
    let activateChooseSide = () => {
      $('#body').addClass('relax-styles')
    }
      
    if (userStyle) {
      $('#body').addClass(userStyle)
      if (userStyle === 'relax-styles') {
        activateRelaxStyles()
      }
      if (userStyle === 'active-styles') {
        activateActiveStyles()
      }
    } else {
      activateRelaxStyles()
      $('.js-switch-mood').addClass('hidden')
    }
    
    $('.js-switch-mood').on('click', function(){
      console.log('click switch mood')
      let userContent = localStorage.getItem('user_style');
      
      if (userContent === 'relax-styles') {
       localStorage.setItem('user_style', 'active-styles')
       activateActiveStyles()
      }
      if (userContent === 'active-styles') {
        localStorage.setItem('user_style', 'relax-styles')
        activateRelaxStyles()
      }
    })
  }
  
  
  
})