LOADING...

Preview

Pen ID
Unlock Campus Themeforest adv

 

Code

  
    
    
    Ionic App

    
    
    
  

  

    
        
        
    

    
    
    

    

      

       
    

    
    
  
CSS
body {
  cursor: url('https://ionicframework.com/img/finger.png'), auto;
}
.slider {
  height: 100%;
}
.slider-slide {
  padding-top: 80px;
  color: #000;
  background-color: #fff;
  text-align: center;

  font-family: "HelveticaNeue-Light", "Helvetica Neue Light", "Helvetica Neue", Helvetica, Arial, "Lucida Grande", sans-serif; 
  font-weight: 300;
}

#logo {
  margin: 30px 0px;
}

#list {
  width: 170px;
  margin: 30px auto;
  font-size: 20px;
}
#list ol {
  margin-top: 30px;
}
#list ol li {
  text-align: left;
  list-style: decimal;
  margin: 10px 0px;
}
JS
angular.module('ionicApp', ['ionic'])

.config(function($stateProvider, $urlRouterProvider) {

  $stateProvider
  .state('intro', {
    url: '/',
    templateUrl: 'intro.html',
    controller: 'IntroCtrl'
  });

  $urlRouterProvider.otherwise("/");

})

.controller('IntroCtrl', function($scope, $state, $ionicSlideBoxDelegate) {

  $scope.data = {
    numViewableSlides : 0,
    slideIndex : 0,
    initialInstruction : true,
    secondInstruction : false,
    slides : [
    {
      'template' : 'firstSlide.html',
      'viewable' : true
    },

    {
      'template' : 'bonusSlide.html',
      'viewable' : false
    },
    
    {
      'template' : 'secondSlide.html',
      'viewable' : true
    },

    {
      'template' : 'thirdSlide.html',
      'viewable' : true
    }
  ]
  };
  
  var countSlides = function() {
    $scope.data.numViewableSlides = 0;
    
    _.forEach($scope.data.slides, function(slide) {
      if(slide.viewable === true) $scope.data.numViewableSlides++;
    })
    
    console.log($scope.data.numViewableSlides + " viewable slides");
    
  }
  
  countSlides();
  
  // Called to navigate to the main app
  $scope.startApp = function() {
    $state.go('main');
  };
  $scope.next = function() {
    $ionicSlideBoxDelegate.next();
  };
  $scope.previous = function() {
    $ionicSlideBoxDelegate.previous();
  };
  
  $scope.showBonus = function() {
    var index = _.findIndex($scope.data.slides, { template : 'bonusSlide.html' });
    $scope.data.slides[index].viewable = true;
    countSlides();
    $scope.data.initialInstruction = false
    $scope.data.secondInstruction = true;

    $ionicSlideBoxDelegate.update();
  };

  // Called each time the slide changes
  $scope.slideChanged = function(index) {
    
    $scope.data.slideIndex = index;
  };
  
});
Term
Mon, 11/27/2017 - 21:32

Related Codes

Pen ID
Pen ID
Pen ID
Square Adv