<commit_before>'use strict';

/**
 * @ngdoc function
 * @name moonPhasesApp.controller:MainCtrl
 * @description
 * # MainCtrl
 * Controller of the moonPhasesApp
 */
angular.module('moonPhasesApp')
    .controller('MainCtrl', ['$scope', '$timeout', function ($scope, $timeout) {

        var moon = window.moon;

        $scope.datetime = new Date();
        $scope.animate = false;
        
        $scope.moonCentreX = 281;
        $scope.moonCentreY = 220;
        $scope.moonRadius = 205;

        $scope.shadowPath = '';
        
        $scope.update = function() {
            $scope.shadowPath = moon.buildShadowPath($scope.moonCentreX,
                                                     $scope.moonCentreY,
                                                     $scope.moonRadius,
                                                     $scope.datetime);
        };

        $scope.toggleAnimate = function() {
            (function x() {
                if ($scope.animate) {
                    $scope.datetime = new Date($scope.datetime.getTime() + 3600 * 1000);
                    $scope.update();
                    $timeout(x, 50);
                }
            })();
        };
        
        $scope.update();
  }]);<commit_msg>Animation tuning.<commit_after>'use strict';

/**
 * @ngdoc function
 * @name moonPhasesApp.controller:MainCtrl
 * @description
 * # MainCtrl
 * Controller of the moonPhasesApp
 */
angular.module('moonPhasesApp')
    .controller('MainCtrl', ['$scope', '$timeout', function ($scope, $timeout) {

        var moon = window.moon;

        $scope.datetime = new Date();
        $scope.animate = false;
        
        $scope.moonCentreX = 281;
        $scope.moonCentreY = 220;
        $scope.moonRadius = 205;

        $scope.shadowPath = '';
        
        $scope.update = function() {
            $scope.shadowPath = moon.buildShadowPath($scope.moonCentreX,
                                                     $scope.moonCentreY,
                                                     $scope.moonRadius,
                                                     $scope.datetime);
        };

        $scope.toggleAnimate = function() {
            (function x() {
                if ($scope.animate) {
                    $scope.datetime = new Date($scope.datetime.getTime() + 3600 * 1000 * 2);
                    $scope.update();
                    $timeout(x, 60);
                }
            })();
        };
        
        $scope.update();
  }]);
{'fraction_non_alphanumeric': 0.1282051282051282, 'fraction_numerical': 0.015625, 'mean_word_length': 1.3013824884792626, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 12, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5300961', 'n_tokens_mistral': 694, 'n_tokens_neox': 633, 'n_words': 114}