Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <!doctype html>
- <html lang="en" ng-app="app">
- <head>
- <meta charset="utf-8">
- <meta name="apple-mobile-web-app-capable" content="yes">
- <meta name="mobile-web-app-capable" content="yes">
- <title>My App</title>
- <link href='http://fonts.googleapis.com/css?family=Roboto:300,400,700' rel='stylesheet' type='text/css'>
- <link rel="stylesheet" href="css/reset.css"> <!-- CSS reset -->
- <link rel="stylesheet" href="css/style.css"> <!-- Resource style -->
- <script src="js/modernizr.js"></script> <!-- Modernizr -->
- <link rel="stylesheet" href="lib/onsen/css/onsenui.css">
- <link rel="stylesheet" href="styles/onsen-css-components-blue-basic-theme.css">
- <link rel="stylesheet" href="styles/app.css"/>
- <script src="lib/onsen/js/angular/angular.js"></script>
- <script src="lib/onsen/js/onsenui.js"></script>
- <script src="cordova.js"></script>
- <script>
- var module = angular.module('app', ['onsen']);
- </script>
- <style>
- .page--menu-page__background {
- background-color: #333;
- }
- .page--menu-page__content {
- color: white;
- }
- .menu-close,
- .menu-close > .toolbar-button {
- color: #999;
- }
- .menu-list,
- .menu-item:first-child,
- .menu-item:last-child,
- .menu-item {
- background-color: transparent;
- background-image: none !important;
- border-color: transparent;
- color: #fff;
- }
- .menu-item {
- padding: 0 0 0 20px;
- line-height: 52px;
- height: 52px;
- text-shadow: rgba(0, 0, 0, 0.4) 0px 1px 0px;
- }
- .menu-item:active {
- background-color: rgba(255, 255, 255, 0.1);
- }
- .menu-notification {
- display: inline-block;
- margin-top: 12px;
- font-size: 14px;
- height: 16px;
- line-height: 16px;
- min-width: 16px;
- font-weight: 600;
- }
- .bottom-menu-list,
- .bottom-menu-item:first-child,
- .bottom-menu-item:last-child,
- .bottom-menu-item {
- border-color: #393939;
- background-color: transparent;
- background-image: none !important;
- color: #ccc;
- }
- .bottom-menu-item:active {
- background-color: rgba(255, 255, 255, 0.1);
- }
- </style>
- </head>
- <body>
- <ons-sliding-menu
- menu-page="menu.html" main-page="page1.html" side="left"
- var="menu" type="reveal" max-slide-distance="260px" swipable="true">
- </ons-sliding-menu>
- <ons-template id="menu.html">
- <ons-page modifier="menu-page">
- <ons-toolbar modifier="transparent"></ons-toolbar>
- <ons-list class="menu-list">
- <ons-list-item class="menu-item" ng-click="menu.setMainPage('page1.html', {closeMenu: true})">
- <ons-icon icon="fa-plus"></ons-icon>
- First Category
- </ons-list-item>
- </ons-list>
- </ons-page>
- </ons-template>
- <ons-template id="page1.html">
- <!-- //Thanks Andreas Argelius(Stackoverflow) for his solution to Grid effect// -->
- <ons-navigator title="Navigator" var="myNavigator">
- <ons-page ng-controller="myController">
- <ons-toolbar>
- <div class="left">
- <ons-toolbar-button ng-click="menu.toggle()">
- <ons-icon icon="ion-navicon" size="28px" fixed-width="false"></ons-icon>
- </ons-toolbar-button>
- </div>
- <div class="center">Page 1</div>
- </ons-toolbar>
- <ons-bottom-toolbar>
- <div class="tab-bar">
- <label ng-click="prevPage()" class="tab-bar__item">
- <input type="radio" name="tab-bar-b" checked="checked">
- <button id="stop" class="tab-bar__button">
- <i class="fa fa-arrow-left"></i>
- </button>
- </label>
- <label class="tab-bar__item">
- <input type="radio" name="tab-bar-b" checked="checked">
- <button class="tab-bar__button">
- Page {{ currentPage + 1 }}
- </button>
- </label>
- <label ng-click="nextPage()" class="tab-bar__item">
- <input type="radio" name="tab-bar-b">
- <button id="pie" class="tab-bar__button">
- <i class="fa fa-arrow-right"></i>
- </button>
- </label>
- </div>
- </div>
- </ons-bottom-toolbar>
- <ons-row style="margin-top: 100px;">
- <ul id="cd-gallery-items" class="cd-container">
- <li ng-repeat="product in getCurrentPage()">
- <ul class="cd-item-wrapper">
- <li class="cd-item-front"><a ng-click="#"><img ng-src="http://varanjith.com/opencart/image/{{product.Imageo}}" height=250px width=100% alt="Preview image"></a></li>
- <!-- <li class="cd-item-out">...</li> -->
- </ul> <!-- cd-item-wrapper -->
- <div class="cd-item-info">
- <b><a href="#0">{{product.Name}}</a></b>
- <em>{{product.Price}}</em>
- </div> <!-- cd-item-info -->
- </li>
- </ul> <!-- cd-gallery-items -->
- </ons-row>
- </ons-page>
- </ons-template>
- <ons-template id="detail.html">
- <ons-page>
- </ons-page>
- </ons-template>
- <script>
- module.factory('productsFactory',function($http){
- return{
- getProducts: function(callback){
- $http.get('http://varanjith.com/opencart/API/getDetail.php').success(callback);
- }
- };
- });
- <!-- //Thanks Andreas Argelius(Stackoverflow) for his solution to pagination// -->
- module.controller('myController', myController);
- function myController($scope,productsFactory) {
- productsFactory.getProducts(function(results){
- $scope.products=results;
- })
- $scope.itemsPerPage = 6;
- $scope.currentPage = 0;
- $scope.getCurrentPage = function() {
- return $scope.products.slice($scope.currentPage * $scope.itemsPerPage,
- $scope.currentPage * $scope.itemsPerPage + $scope.itemsPerPage);
- };
- $scope.nextPage = function() {
- $scope.currentPage = Math.min(parseInt(($scope.products.length - 1) / $scope.itemsPerPage),
- $scope.currentPage + 1);
- }
- $scope.prevPage = function() {
- $scope.currentPage = Math.max(0, $scope.currentPage - 1);
- }
- }
- </script>
- </body>
- </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement