y = document.body;

        window.addEventListener('devicelight', changeColor);

        function changeColor (e) {
          var active;
          var inactive;
          var els;

          if (e.value < 40) {
            html.classList.add('dark');
            body.classList.add('dark');
            active = 'dark';
            inactive = 'light';
          } else {
            html.classList.remove('dark');
            body.classList.remove('dark');
            active = 'light';
            inactive = 