<commit_before>var React         = require('react');
var $             = require('jquery');
var ViewActions   = require('../../../actions/ViewActions');
var ViewConstants = require('../../../constants/ViewConstants');

module.exports = React.createClass({

  getInitialState: function () {
    return {
      name: 'idle',
      page: 0,
      height: 0
    };
  },

  scroll: function (page) {
    if (this.state.name === 'idle' && page >= 0 && page <= 1) {
      this.state.name = 'scrolling';
      $('body').animate({
          scrollTop: this.state.height * page
        }, {
          complete: function () {
            this.state.page = page;
            this.state.name = 'idle';
          }.bind(this)
        });
    }
  },

  scrollToSignIn: function () {
    this.scroll(1);
  },

  handleScroll: function (e) {
    e.preventDefault();
  },

  handleKey: function (e) {
    var UP = 38;
    var DOWN = 40;
    var key = e.which;
    e.preventDefault();
    if (key === UP) {
      this.scroll(this.state.page - 1);
    } else {
      this.scroll(this.state.page + 1);
    }

  },

  handleWheel: function (e) {
    e.preventDefault();
    if (e.wheelDelta < 1) {
      this.scroll(this.state.page + 1);
    } else {
      this.scroll(this.state.page - 1);
    }
  },

  setHeight: function () {
    this.state.height = window.innerHeight;
  },

  componentDidMount: function () {
    this.setHeight();<commit_msg>fix scroll bug in landing page<commit_after>var React         = require('react');
var $             = require('jquery');
var ViewActions   = require('../../../actions/ViewActions');
var ViewConstants = require('../../../constants/ViewConstants');

module.exports = React.createClass({

  getInitialState: function () {
    return {
      name: 'idle',
      page: 0,
      height: 0
    };
  },

  scroll: function (page) {
    if (this.state.name === 'idle' && page >= 0 && page <= 1) {
      this.state.name = 'scrolling';
      $('body').animate({
          scrollTop: this.state.height * page
        }, {
          complete: function () {
            this.state.page = page;
            this.state.name = 'idle';
          }.bind(this)
        });
    }
  },

  scrollToSignIn: function () {
    this.scroll(1);
  },

  handleScroll: function (e) {
    e.preventDefault();
  },

  handleKey: function (e) {
    var UP = 38;
    var DOWN = 40;
    var key = e.which;
    e.preventDefault();
    if (key === UP) {
      this.scroll(this.state.page - 1);
    } else {
      this.scroll(this.state.page + 1);
    }

  },

  handleWheel: function (e) {
    e.preventDefault();
    if (e.wheelDelta < 1) {
      this.scroll(this.state.page + 1);
    } else {
      this.scroll(this.state.page - 1);
    }
  },

  setHeight: function () {
    this.state.height = window.innerHeight;
    this.scroll(this.state.page);
  },

  componentDidMount: function () {
    this.setHeight();
{'fraction_non_alphanumeric': 0.17223561832586978, 'fraction_numerical': 0.009645194626248708, 'mean_word_length': 2.0313152400835075, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 5, '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': '5991065', 'n_tokens_mistral': 966, 'n_tokens_neox': 929, 'n_words': 189}