Skip to content

Commit cd5df3d

Browse files
committed
Add animation to ToC.
1 parent e8c7357 commit cd5df3d

3 files changed

Lines changed: 17 additions & 2 deletions

File tree

_includes/head.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -84,8 +84,8 @@
8484
<link rel="stylesheet" href="{{ site.baseurl }}/assets/css/post.css">
8585
{% if site.toc and page.toc %}
8686
<link rel="stylesheet" href="{{ site.baseurl }}/assets/lib/bootstrap-toc-1.0.1/bootstrap-toc.min.css" />
87-
<script src="{{ site.baseurl }}/assets/lib/bootstrap-toc-1.0.1/bootstrap-toc.min.js"></script>
88-
<script src="{{ site.baseurl }}/assets/js/dist/toc.min.js"></script>
87+
<script src="{{ site.baseurl }}/assets/lib/bootstrap-toc-1.0.1/bootstrap-toc.min.js" async></script>
88+
<script src="{{ site.baseurl }}/assets/js/dist/toc.min.js" async></script>
8989
{% endif %}
9090
{% endif %}
9191

assets/css/main.scss

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -404,6 +404,7 @@ footer .license a {
404404

405405

406406
/*--- Panels ---*/
407+
407408
.access {
408409
top: 2rem;
409410
transition: top 0.2s ease-in-out;

assets/css/post.scss

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,12 +7,26 @@
77
MIT License
88
*/
99

10+
@keyframes fade-up {
11+
from {
12+
opacity: 0;
13+
position: relative;
14+
top: 2rem;
15+
}
16+
to {
17+
opacity: 1;
18+
position: relative;
19+
top: 0;
20+
}
21+
}
22+
1023
#toc-wrap {
1124
border-left: 1px solid rgba(158, 158, 158, 0.17);
1225
position: -webkit-sticky;
1326
position: sticky;
1427
top: 2rem;
1528
transition: top 0.2s ease-in-out;
29+
animation: fade-up .8s;
1630
}
1731

1832
#toc-wrap.topbar-down {

0 commit comments

Comments
 (0)