Skip to content
This repository was archived by the owner on Apr 12, 2024. It is now read-only.

Commit 3c3247f

Browse files
matskomhevery
authored andcommitted
fix(ngdocs): improve the animations used in the docs menu
1 parent a0bc71e commit 3c3247f

File tree

3 files changed

+41
-28
lines changed

3 files changed

+41
-28
lines changed

docs/src/templates/css/animations.css

+28-20
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
.reveal-setup {
22
-webkit-transition:1s linear all;
33
-moz-transition:1s linear all;
4-
-ms-transition:1s linear all;
54
-o-transition:1s linear all;
65
transition:1s linear all;
76

@@ -11,45 +10,55 @@
1110
opacity:1;
1211
}
1312

13+
.nav-list li {
14+
height:20px;
15+
overflow:hidden;
16+
}
17+
1418
.slide-reveal-setup {
1519
-webkit-transition:0.5s linear all;
1620
-moz-transition:0.5s linear all;
17-
-ms-transition:0.5s linear all;
1821
-o-transition:0.5s linear all;
1922
transition:0.5s linear all;
2023
opacity:0.5;
24+
25+
position:relative;
26+
opacity:0;
27+
top:10px;
2128
}
2229
.slide-reveal-setup.slide-reveal-start {
30+
top:0;
2331
opacity:1;
2432
}
2533

26-
.slide-enter-setup {
27-
-webkit-transition:0.5s linear all;
28-
-moz-transition:0.5s linear all;
29-
-ms-transition:0.5s linear all;
30-
-o-transition:0.5s linear all;
31-
transition:0.5s linear all;
34+
.expand-enter-setup {
35+
-webkit-transition:0.3s cubic-bezier(0.250, 0.460, 0.450, 0.940) all;
36+
-moz-transition:0.3s cubic-bezier(0.250, 0.460, 0.450, 0.940) all;
37+
-o-transition:0.3s cubic-bezier(0.250, 0.460, 0.450, 0.940) all;
38+
transition:0.3s cubic-bezier(0.250, 0.460, 0.450, 0.940) all;
3239

33-
position:relative;
34-
left:10px;
3540
opacity:0;
41+
line-height:0;
42+
height:0!important;
3643
}
37-
.slide-enter-setup.slide-enter-start {
38-
left:0;
44+
.expand-enter-setup.expand-enter-start {
3945
opacity:1;
46+
line-height:20px;
47+
height:20px!important;
4048
}
4149

42-
.slide-leave-setup {
43-
-webkit-transition:0.5s linear all;
44-
-moz-transition:0.5s linear all;
45-
-ms-transition:0.5s linear all;
46-
-o-transition:0.5s linear all;
47-
transition:0.5s linear all;
50+
.expand-leave-setup {
51+
-webkit-transition:0.3s cubic-bezier(0.250, 0.460, 0.450, 0.940) all;
52+
-moz-transition:0.3s cubic-bezier(0.250, 0.460, 0.450, 0.940) all;
53+
-o-transition:0.3s cubic-bezier(0.250, 0.460, 0.450, 0.940) all;
54+
transition:0.3s cubic-bezier(0.250, 0.460, 0.450, 0.940) all;
4855

4956
opacity:1;
57+
height:20px;
5058
}
51-
.slide-leave-setup.slide-leave-start {
59+
.expand-leave-setup.expand-leave-start {
5260
opacity:0;
61+
height:0;
5362
}
5463

5564
.example-animate-container {
@@ -67,7 +76,6 @@
6776
.animator-container.animations-off * {
6877
-webkit-transition: none;
6978
-moz-transition: none;
70-
-ms-transition: none;
7179
-o-transition: color 0 ease-in; /* opera is special :) */
7280
transition: none;
7381
}

docs/src/templates/css/docs.css

+6-1
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,12 @@ img.AngularJS-small {
5656
}
5757

5858
.form-search > ul.nav > li.last {
59-
margin-bottom: 1em;
59+
padding-bottom: 1em;
60+
}
61+
62+
.form-search > ul.nav > li.last + li.api-list-item {
63+
margin-top:-1em;
64+
padding-bottom: 1em;
6065
}
6166

6267
.form-search .well {

docs/src/templates/index.html

+7-7
Original file line numberDiff line numberDiff line change
@@ -217,13 +217,13 @@
217217
<div ng-show="search">Filtered results:</div>
218218

219219
<ul class="nav nav-list" ng-hide="page">
220-
<li ng-repeat="page in pages" ng-class="navClass(page)">
220+
<li ng-repeat="page in pages track by page.url" ng-class="navClass(page)" class="api-list-item">
221221
<a href="{{page.url}}" tabindex="2">{{page.shortName}}</a>
222222
</li>
223223
</ul>
224224

225225

226-
<ul class="nav nav-list well" ng-repeat="module in modules">
226+
<ul class="nav nav-list well" ng-repeat="module in modules track by module.url" class="api-list-item">
227227
<li class="nav-header module">
228228
<a class="guide" href="{{URL.module}}">module</a>
229229
<a class="code" href="{{module.url}}">{{module.name}}</a>
@@ -232,37 +232,37 @@
232232
<li class="nav-header section" ng-show="module.directives">
233233
<a href="{{URL.directive}}" class="guide">directive</a>
234234
</li>
235-
<li ng-repeat="page in module.directives" ng-class="navClass(page)" ng-animate="'slide'">
235+
<li ng-repeat="page in module.directives track by page.url" ng-class="navClass(page)" ng-animate="'expand'" class="api-list-item">
236236
<a href="{{page.url}}" tabindex="2">{{page.shortName}}</a>
237237
</li>
238238

239239
<li class="nav-header section" ng-show="module.filters">
240240
<a href="{{URL.filter}}" class="guide">filter</a>
241241
</li>
242-
<li ng-repeat="page in module.filters" ng-class="navClass(page)" ng-animate="'slide'">
242+
<li ng-repeat="page in module.filters track by page.url" ng-class="navClass(page)" ng-animate="'expand'" class="api-list-item">
243243
<a href="{{page.url}}" tabindex="2">{{page.shortName}}</a>
244244
</li>
245245

246246
<li class="nav-header section" ng-show="module.services">
247247
<a href="{{URL.service}}" class="guide">service</a>
248248
</li>
249-
<li ng-repeat="service in module.services" ng-animate="'slide'" ng-class="navClass(service.instance, service.provider)">
249+
<li ng-repeat="service in module.services track by service.instance.url" ng-animate="'expand'" ng-class="navClass(service.instance, service.provider)" class="api-list-item">
250250
<a ng-show="service.provider" class="pull-right" href="{{service.provider.url}}" tabindex="2"><i class="icon-cog"></i></a>
251251
<a href="{{service.instance.url}}" tabindex="2">{{service.name}}</a>
252252
</li>
253253

254254
<li class="nav-header section" ng-show="module.types">
255255
<a href="{{URL.type}}" class="guide">Types</a>
256256
</li>
257-
<li ng-repeat="page in module.types" ng-class="navClass(page)" ng-animate="'slide'">
257+
<li ng-repeat="page in module.types track by page.url" ng-class="navClass(page)" ng-animate="'expand'" class="api-list-item">
258258
<a href="{{page.url}}" tabindex="2">{{page.shortName}}</a>
259259
</li>
260260

261261
<li class="nav-header section" ng-show="module.globals">
262262
<a href="{{URL.api}}" class="global guide">global APIs</a>
263263
&nbsp;
264264
</li>
265-
<li ng-repeat="page in module.globals" ng-class="navClass(page)">
265+
<li ng-repeat="page in module.globals track by page.url" ng-class="navClass(page)" class="api-list-item">
266266
<a href="{{page.url}}" tabindex="2">{{page.id}}</a>
267267
</li>
268268

0 commit comments

Comments
 (0)