<commit_before>class @Components.Timeline extends @Components.Base
  @autoInit: ->
    $('.component-timeline').each (i, el) => new @($(el))

  constructor: (@el) ->
    @breakpoints =
      sm: 600
      md: 900

    super

    @text      = $ $('[data-text]', @el).data('text')
    @navSlider = $('[data-jq-slider]', @el)
    @slider    = $('[data-slick-carousel]', @el)

    @initNavSlider()
    @initSlider()

  initNavSlider: =>
    yearsEl     = @navSlider.find('.years')
    yearsValues = yearsEl.data('values')

    yearsValues.each (item, index) ->
      year = $("<div class='year'>#{item}</div>")
      year.css('left', (100 / (yearsValues.length - 1) * index) + '%')
      year.appendTo yearsEl

    @navSlider.slider
      values: [0]
      step:   yearsValues.length - 1

    @navSlider.on 'slide', (ev, ui) =>
      @slider.find('.slick-track')[0].style.webkitAnimationPlayState = 'paused'
      @slider.slickGoTo(ui.value / 10)

  initSlider: =>
    @slider.slick
      slide:          'article'
      slidesToShow:   1
      arrows:         true
      responsive:     [
        {
          breakpoint: 500
          settings:
            dots:   true
        }
      ]
      onBeforeChange: (slider, current, next) =>
        @navSlider.slider('values', 0, next * 10)<commit_msg>Fix Timeline step size (js)<commit_after>class @Components.Timeline extends @Components.Base
  @autoInit: ->
    $('.component-timeline').each (i, el) => new @($(el))

  constructor: (@el) ->
    @breakpoints =
      sm: 600
      md: 900

    super

    @text      = $ $('[data-text]', @el).data('text')
    @navSlider = $('[data-jq-slider]', @el)
    @slider    = $('[data-slick-carousel]', @el)

    @initNavSlider()
    @initSlider()

  initNavSlider: =>
    @yearsEl           = @navSlider.find('.years')
    @yearsValues       = @yearsEl.data('values')
    @navSliderStepSize = (100 / (@yearsValues.length - 1))

    @yearsValues.each (item, index) =>
      year = $("<div class='year'>#{item}</div>")
      year.css('left', (@navSliderStepSize * index) + '%')
      year.appendTo @yearsEl

    @navSlider.slider
      values: [0]
      step:   @navSliderStepSize

    @navSlider.on 'slide', (ev, ui) =>
      @slider.find('.slick-track')[0].style.webkitAnimationPlayState = 'paused'
      @slider.slickGoTo(ui.value / @navSliderStepSize)

  initSlider: =>
    @slider.slick
      slide:          'article'
      slidesToShow:   1
      arrows:         true
      responsive:     [
        {
          breakpoint: 500
          settings:
            dots:   true
        }
      ]
      onBeforeChange: (slider, current, next) =>
        @navSlider.slider('values', 0, next * @navSliderStepSize)
{'fraction_non_alphanumeric': 0.1698813056379822, 'fraction_numerical': 0.014465875370919881, 'mean_word_length': 2.2376950780312126, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 23, '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': '3140828', 'n_tokens_mistral': 950, 'n_tokens_neox': 900, 'n_words': 170}