forked from angular/angular.js
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.html
158 lines (150 loc) · 4.64 KB
/
index.html
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
<!DOCTYPE html>
<html ng-app="Animator" ng-controller="AppCtrl">
<head>
<script type="text/ng-template" id="no-results">
No Results Found...
</script>
<title>AngularJS Animation Demo</title>
<style type="text/css">
body, html {
padding:0;
margin:0;
position:relative;
height:100%;
}
.cell {
position:absolute;
width:50%;
height:50%;
border:2px solid red;
background:white;
overflow:scroll;
box-sizing:border-box;
}
.stage {
padding:10px;
}
header {
padding:5px;
background:red;
font-size:1.5em;
margin-bottom:10px;
}
.cell:hover {
z-index:2000!important;
box-shadow:0 0 10px #aaa;
border-color:blue;
}
#wrapper {
margin-top:50px;
position:relative;
height:100%;
}
#nav {
background:black;
position:fixed;
top:0;
right:0;
left:0;
z-index:5000;
padding:15px;
}
#one { top:0; left:0; z-index:1001; }
#two { top:0; right:0; z-index:1002; }
#three { bottom:0; left:0; z-index:1003; }
#four { bottom:0; right:0; z-index:1004; }
.other header {
background:orange;
}
.add { width:200px; }
.q { float:right; width:200px; }
.item {
padding:5px;
}
.item + .item {
border-top:1px solid #ddd;
}
.item button {
float:right;
}
</style>
</head>
<body ng-cloak>
<div id="wrapper">
<form id="nav" ng-submit="add(new_item); new_item=null">
<input class="add" type="input" ng-model="new_item" placeholder="enter something to add" />
<button ng-click="add(new_item); new_item = null">Add</button>
<button ng-click="pop()">Pop Last</button>
<button ng-click="sort('name')">Order by name</button>
<button ng-click="sort('index')">Order by index</button>
<input type="search" ng-model="q" placeholder="search" class="q" />
</form>
<div class="cell" id="one">
<header>
Noop
</header>
<div class="stage">
<div ng-show="items.length == 0" ng-include="'no-results'"></div>
<div
class="item"
ng-show="items.length > 0"
ng-repeat="item in items | filter:q | orderBy:order"
ng-animate="enter: noop-enter; leave: noop-leave; move:noop-move">
<strong>{{ $index + 1 }}:</strong> {{ item.name }} ({{ item.index }})
<button ng-click="remove(item.index)">Remove</button>
</div>
</div>
</div>
<div class="cell" id="two">
<header>
Fade In / Fade Out
</header>
<div class="stage">
<div ng-show="items.length == 0" ng-include="'no-results'"></div>
<div
class="item"
ng-show="items.length > 0"
ng-repeat="item in items | filter:q | orderBy:order"
ng-animate="enter: fade-enter; leave: fade-leave; move:fade-move">
<strong>{{ $index + 1 }}:</strong> {{ item.name }} ({{ item.index }})
<button ng-click="remove(item.index)">Remove</button>
</div>
</div>
</div>
<div class="cell" id="three">
<header>
Slide In / Slide Out
</header>
<div class="stage">
<div ng-show="items.length == 0" ng-include="'no-results'"></div>
<div
class="item"
ng-show="items.length > 0"
ng-repeat="item in items | filter:q | orderBy:order"
ng-animate="enter: slide-enter; leave: slide-leave; move:slide-move">
<strong>{{ $index + 1 }}:</strong> {{ item.name }} ({{ item.index }})
<button ng-click="remove(item.index)">Remove</button>
</div>
</div>
</div>
<div class="cell other" id="four">
<header>
ngRepeat with no ngAnimate directive at all...
</header>
<div class="stage">
<div ng-show="items.length == 0" ng-include="'no-results'"></div>
<div
class="item"
ng-show="items.length > 0"
ng-repeat="item in items | filter:q | orderBy:order">
<strong>{{ $index + 1 }}:</strong> {{ item.name }} ({{ item.index }})
<button ng-click="remove(item.index)">Remove</button>
</div>
</div>
</div>
</div>
<script src="//ajax.googleapis.com/ajax/libs/jquery/1.8.3/jquery.min.js"></script>
<script src="../build/angular.js"></script>
<script src="./index.js"></script>
<body>
</html>