'use strict';

angular.module('app').controller('HomeController', ['$scope', '$state', function($scope, $state) {
    $scope.counterpart = false;
    var count = 0;
    $scope.animate = function($event) {
        $scope.counterpart = true;
        count += 1;

        angular.element('.search').addClass('active');
        angular.element('.commonask').addClass('active');

        angular.element('ul>:first-child').addClass('active');
        angular.element('ul>:last-child').addClass('active');

        angular.element('.worldmessage').addClass('hiddenworld');
        angular.element('.backgroundimg').addClass('blur');
        if (count % 2 === 0) {
            $scope.counterpart = false;

            angular.element('ul>:first-child').removeClass('active');

            angular.element('ul>:last-child').removeClass('active');
            angular.element('.search').removeClass('active');
            angular.element('.commonask').removeClass('active');
            angular.element('.backgroundimg').removeClass('blur');
            angular.element('.worldmessage').removeClass('hiddenworld');
        }
    };


}]);