<commit_before>hideHeaderOnScroll = ()->
  did_scroll = false
  last_scroll_top = 0
  delta = 40
  navbar_height = $('.Header-container').outerHeight()
  console.log "navbar_height: #{ navbar_height }"

  $(window).scroll (event)=>
    did_scroll = true

  has_scrolled = ()=>
    st = $(this).scrollTop()
    console.log "scroll top position: #{ st }"

    if Math.abs(last_scroll_top - st) < delta
      # if we move less than delta early return (do nothing)
      return

    if st < $('.Header').outerHeight()
      # reveal everything 
      $('.Header-container').removeClass('Header-container-show').removeClass('Header-container-hide')
      # coordinates = "translate3d(0px,"+st+"px,0px)"
      # $('.Header-container').css("transform",coordinates)
    else if st > last_scroll_top and st > navbar_height
      console.log "scrolling down past header --> hide everything"
      $('.Header-container').removeClass('Header-container-show').addClass('Header-container-hide')
    else if st + $(window).height() < $(document).height()
      console.log "show nav tabs --> document height: #{ $(document).height() } \n window height: #{ $(window).height() }"
      $(".Header-container").removeClass('Header-container-hide').addClass('Header-container-show')

    last_scroll_top = st    
  
  setInterval ->
    if did_scroll
      has_scrolled()
      did_scroll = false
  ,250

$(document).ready ->
  hideHeaderOnScroll()
<commit_msg>show entire header on scroll-up :nail_care:<commit_after>hideHeaderOnScroll = ()->
  did_scroll = false
  last_scroll_top = 0
  delta = 40
  navbar_height = $('.Header-container').outerHeight()
  console.log "navbar_height: #{ navbar_height }"

  $(window).scroll (event)=>
    did_scroll = true

  has_scrolled = ()=>
    st = $(this).scrollTop()
    console.log "scroll top position: #{ st }"

    if Math.abs(last_scroll_top - st) < delta
      # if we move less than delta early return (do nothing)
      return

    # if st < $('.Header').outerHeight()
      # reveal everything 
      # $('.Header-container').removeClass('Header-container-show').removeClass('Header-container-hide')
      # coordinates = "translate3d(0px,"+st+"px,0px)"
      # $('.Header-container').css("transform",coordinates)
    else if st > last_scroll_top and st > navbar_height
      console.log "scrolling down past header --> hide everything"
      $('.Header-container').removeClass('Header-container-show').addClass('Header-container-hide')
    else if st + $(window).height() < $(document).height()
      console.log "show nav tabs --> document height: #{ $(document).height() } \n window height: #{ $(window).height() }"
      $(".Header-container").removeClass('Header-container-hide').removeClass('Header-container-show')

    last_scroll_top = st    
  
  setInterval ->
    if did_scroll
      has_scrolled()
      did_scroll = false
  ,250

$(document).ready ->
  hideHeaderOnScroll()

{'fraction_non_alphanumeric': 0.15861596437136005, 'fraction_numerical': 0.006166495375128468, 'mean_word_length': 3.4716692189892804, 'pattern_counts': {'":': 0, '<': 9, '<?xml version=': 0, '>': 21, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '966410', 'n_tokens_mistral': 878, 'n_tokens_neox': 853, 'n_words': 187}