<commit_before>/*!
 * SCRIPT
 */
;
$(document).ready(function() {
  var $window = $(window)
  var mainContentTop = $('.main-content').offset().top


  /*------------------------------------*\
    MENU ICON SHOWS & HIDES
  \*------------------------------------*/
  var $menuIcon = $('.menu-icon')

  var isMenuDisappear = true
  var isMenuHide = false

  $menuIcon.on('tap swipeRight', function(evt) {
    evt.preventDefault()
    evt.stopPropagation()
    $menuIcon.removeClass('menu-icon--hide menu-icon--disappear')
    isMenuDisappear = isMenuHide = false
  })

  $window.scroll(function() {
    // main content shows
    if ($window.scrollTop() >= mainContentTop) {
      if (isMenuDisappear) {
        isMenuDisappear = false
        $menuIcon.removeClass('menu-icon--disappear')
        isMenuHide = true
        setTimeout(function() {
          $menuIcon.addClass('menu-icon--hide')
        }, 700)
      } else if (!isMenuHide){
        isMenuHide = true
        $menuIcon.addClass('menu-icon--hide')
      }
    } else { // on top of main content
      if (!isMenuDisappear) {
        isMenuDisappear = true
        $menuIcon.addClass('menu-icon--disappear')
      }
      if (isMenuHide) {
        isMenuHide = false
        $menuIcon.removeClass('menu-icon--hide')
      }
    }
  })


  /*------------------------------------*\
    LOGO FITS IN
  \*------------------------------------*/

  var $logo = $('#cover-logo')
  var logoOffset = $logo.offset()
  var logoFavHeight = $('.site-cover').offset().height - $('.title-wrapper').offset().height
  var logoCss = {}
  if (logoOffset.height >= logoFavHeight) {
    logoCss.height = logoFavHeight * .8 + 'px';
  }
  logoCss.top = (logoFavHeight - logoOffset.height) * .4 + 'px'
  $logo.css(logoCss)


  
})
;<commit_msg>fix center logic<commit_after>/*!
 * SCRIPT
 */

$(document).ready(function () {
  var $window = $(window)
  var mainContentTop = $('.main-content').offset().top

  /*------------------------------------*\
    MENU ICON SHOWS & HIDES
  \*------------------------------------*/
  var $menuIcon = $('.menu-icon')

  var isMenuDisappear = true
  var isMenuHide = false

  $menuIcon.on('tap swipeRight', function (evt) {
    evt.preventDefault()
    evt.stopPropagation()
    $menuIcon.removeClass('menu-icon--hide menu-icon--disappear')
    isMenuDisappear = isMenuHide = false
  })

  $window.scroll(function () {
    // main content shows
    if ($window.scrollTop() >= mainContentTop) {
      if (isMenuDisappear) {
        isMenuDisappear = false
        $menuIcon.removeClass('menu-icon--disappear')
        isMenuHide = true
        setTimeout(function () {
          $menuIcon.addClass('menu-icon--hide')
        }, 700)
      } else if (!isMenuHide) {
        isMenuHide = true
        $menuIcon.addClass('menu-icon--hide')
      }
    } else { // on top of main content
      if (!isMenuDisappear) {
        isMenuDisappear = true
        $menuIcon.addClass('menu-icon--disappear')
      }
      if (isMenuHide) {
        isMenuHide = false
        $menuIcon.removeClass('menu-icon--hide')
      }
    }
  })

  /*------------------------------------*\
    LOGO FITS IN
  \*------------------------------------*/

  var $logo = $('#cover-logo')
  var logoOffset = $logo.offset()
  var logoFavHeight = $('.site-cover').offset().height - $('.title-wrapper').offset().height
  var logoCss = {
    // shrink logo if necessery
    height: (logoOffset.height >= logoFavHeight ? logoFavHeight * .8 : logoOffset.height) + 'px'
  }
  // center logo within the remain space
  logoCss.top = (logoFavHeight - logoCss.height) * .4 + 'px'
  $logo.css(logoCss)
})
{'fraction_non_alphanumeric': 0.22634763476347636, 'fraction_numerical': 0.0027502750275027505, 'mean_word_length': 1.9142628205128205, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 7, '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': '5694269', 'n_tokens_mistral': 1148, 'n_tokens_neox': 1123, 'n_words': 211}