forked from ionic-team/ionic-framework
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathslideBox.html
More file actions
192 lines (174 loc) · 5.33 KB
/
slideBox.html
File metadata and controls
192 lines (174 loc) · 5.33 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
<!DOCTYPE html>
<html ng-app="slideBoxTest">
<head>
<meta charset="utf-8">
<title>Slide Box</title>
<!-- Sets initial viewport load and disables zooming -->
<meta name="viewport" content="initial-scale=1, maximum-scale=1, user-scalable=no">
<link rel="stylesheet" href="../../../../dist/css/ionic.css">
<script src="../../../../dist/js/ionic.bundle.js"></script>
<style>
.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;
}
.slider-pager .slider-pager-page {
color: #000;
}
#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;
}
</style>
</head>
<body ng-init="$root.showPager = true">
<div ng-controller="SlideCtrl">
<ion-side-menus>
<ion-side-menu-content>
<ion-header-bar>
<div class="button" ng-click="$root.hideSlideBox = !$root.hideSlideBox">
Toggle
</div>
</ion-header-bar>
<ion-slide-box ng-if="!$root.hideSlideBox"
on-slide-changed="slideChanged(index)"
show-pager="{{$root.showPager}}"
pager-click="pagerClick(index)"
auto-play="false">
<ion-slide ng-controller="FirstSlideCtrl">
<h3>Thank you for choosing the Awesome App!</h3>
<div id="logo">
<img src="app_icon.png">
</div>
<p>
We've worked super hard to make you happy.
</p>
<p>
But if you are angry, too bad.
</p>
<p>
<button class="button button-dark" ng-click="toLast()">Skip to last</button>
</p>
<p>
<button class="button button-dark" ng-click="clickTest()">Click Test</button>
</p>
</ion-slide>
<ion-slide>
<h3>Using Awesome</h3>
<div id="list">
<h5>Just three steps:</h5>
<ol>
<li>Be awesome</li>
<li>Stay awesome</li>
<li>There is no step 3</li>
</ol>
</div>
</ion-slide>
<ion-slide>
<ion-content class="has-header">
<div style="width: 300px; height: 2000px; background: url('tree_bark.png') repeat"></div>
</ion-content>
</ion-slide>
</ion-slide-box>
</ion-side-menu-content>
<ion-side-menu side="left">
<header class="bar bar-header bar-assertive">
<h1 class="title">Right</h1>
</header>
<ion-content>
</ion-content>
</ion-side-menu>
</ion-side-menus>
</div>
<script>
angular.module('slideBoxTest', ['ionic'])
.controller('SlideCtrl', function($scope, $timeout) {
$scope.next = function() {
console.log('NEXT');
$scope.$broadcast('slideBox.nextSlide');
};
var clickCount = 0;
$scope.clickTest = function() {
clickCount++;
console.log('click', clickCount);
};
var rightButtons = [
{
content: 'Next',
type: 'button-positive button-clear',
tap: function(e) {
console.log('NEXT');
$scope.next();
}
}
];
var leftButtons = [
{
content: 'Skip',
type: 'button-positive button-clear',
tap: function(e) {
alert('Skipping');
}
}
];
$scope.leftButtons = leftButtons;
$scope.rightButtons = rightButtons;
$scope.pagerClick = function(index) {
alert('pagerClick ' + index);
};
$scope.slideChanged = function(index) {
console.log('Slide changed', index);
if(index > 0) {
$scope.leftButtons = [
{
content: 'Back',
type: 'button-positive button-clear',
tap: function(e) {
$scope.$broadcast('slideBox.prevSlide');
}
}
];
} else {
$scope.leftButtons = leftButtons;
}
if(index == 2) {
$scope.rightButtons = [
{
content: 'Start using MyApp',
type: 'button-positive button-clear',
tap: function(e) {
alert('Done!');
}
}
];
} else {
$scope.rightButtons = rightButtons;
}
};
})
.controller('FirstSlideCtrl', function($scope, $ionicSlideBoxDelegate) {
$scope.derp = function() {
}
$scope.toLast = function() {
$ionicSlideBoxDelegate.slide(2);
}
});
</script>
</body>
</html>