(function () {
  'use strict';

  var querySelector = document.querySelector.bind(document);

  var navdrawerContainer = querySelector('.browse-topics');
  var body = document.body;
  var appbarElement = querySelector('.nav-bar');
  var menuBtn = querySelector('.menu');
  var main = querySelector('.main');
  var icon = querySelector('.menu-icon');

  function closeMenu() {
    appbarElement.classList.remove('open');
    navdrawerContainer.classList.remove('open');
    icon.classList.remove('x');
  }

  function toggleMenu() {
    appbarElement.classList.toggle('open');
    navdrawerContainer.classList.toggle('open');
    icon.classList.toggle('x');
  }

  main.addEventListener('click', closeMenu);
  menuBtn.addEventListener('click', toggleMenu);
  navdrawerContainer.addEventListener('click', function (event) {
    if (event.target.nodeName === 'A' || event.target.nodeName === 'LI') {
      closeMenu();
    }
  });
})();

$(document).ready(function() {
  $('.story-stream').slick({
      dots: true,
      infinite: true,
      speed: 500,
      slidesToShow: 1,
      slidesToScroll: 1
  });
});


$(function () {
  'use strict';

  var navcontent = $('.browse-topics');
  var body = $(document.body);
  var appbarElement = $('.nav-bar');
  var menuBtn = $('.menu');
  var icon = $('.menu-icon');

  function toggleMenu() {
    appbarElement.toggleClass('open');
    navcontent.toggleClass('open');
    icon.toggleClass('x');
  }

  $(menuBtn).click(function() {
    toggleMenu();
  });

})();

$(document).ready(function() {
  $('.story-stream').slick({
      dots: true,
      infinite: true,
      speed: 500,
      slidesToShow: 1,
      slidesToScroll: 1
  });
});


rewrite script in jquery, clean up