Skip to content

Commit

Permalink
Update website version select drop down (apache#18188)
Browse files Browse the repository at this point in the history
* update version select drop down

* align caret

* revert scrollable content, add delayed hover effect

* bugfix

* fix new design doesn't work on mobile
# Conflicts:
#	docs/static_site/src/_includes/get_started/get_started.html
  • Loading branch information
Yang Shi authored and ys2843 committed Sep 19, 2020
1 parent 616c51b commit 3156c4d
Show file tree
Hide file tree
Showing 4 changed files with 121 additions and 0 deletions.
17 changes: 17 additions & 0 deletions docs/python_docs/themes/mx-theme/mxtheme/header_top.html
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,23 @@
<a class="page-link" href="{{theme_relative_url}}ecosystem">Ecosystem</a>
<a class="page-link page-current" href="{{theme_relative_url}}api">Docs & Tutorials</a>
<a class="page-link" href="https://github.com/apache/incubator-mxnet">GitHub</a>
<div class="dropdown">
<span class="dropdown-header">master
<svg class="dropdown-caret" viewBox="0 0 32 32" class="icon icon-caret-bottom" aria-hidden="true"><path class="dropdown-caret-path" d="M24 11.305l-7.997 11.39L8 11.305z"></path></svg>
</span>
<div class="dropdown-content">
<a class="dropdown-option-active" href="/">master</a><br>
<a class="dropdown-option" href="/versions/1.6/">1.6</a><br>
<a class="dropdown-option" href="/versions/1.5.0/">1.5.0</a><br>
<a class="dropdown-option" href="/versions/1.4.1/">1.4.1</a><br>
<a class="dropdown-option" href="/versions/1.3.1/">1.3.1</a><br>
<a class="dropdown-option" href="/versions/1.2.1/">1.2.1</a><br>
<a class="dropdown-option" href="/versions/1.1.0/">1.1.0</a><br>
<a class="dropdown-option" href="/versions/1.0.0/">1.0.0</a><br>
<a class="dropdown-option" href="/versions/0.12.1/">0.12.1</a><br>
<a class="dropdown-option" href="/versions/0.11.0/">0.11.0</a>
</div>
</div>
</div>
</nav>
</div>
Expand Down
48 changes: 48 additions & 0 deletions docs/python_docs/themes/mx-theme/mxtheme/layout.html
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,54 @@
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
<meta http-equiv="x-ua-compatible" content="ie=edge">
<style>
.dropdown {
position: relative;
display: inline-block;
}

.dropdown-content {
display: none;
position: absolute;
background-color: #f9f9f9;
min-width: 160px;
box-shadow: 0px 8px 16px 0px rgba(0,0,0,0.2);
padding: 12px 16px;
z-index: 1;
text-align: left;
}

.dropdown:hover .dropdown-content {
display: block;
}

.dropdown-option:hover {
color: #FF4500;
}

.dropdown-option-active {
color: #FF4500;
font-weight: lighter;
}

.dropdown-option {
color: #000000;
font-weight: lighter;
}

.dropdown-header {
color: #FFFFFF;
display: inline-flex;
}

.dropdown-caret {
width: 18px;
}

.dropdown-caret-path {
fill: #FFFFFF;
}
</style>
{{ super() }}
{% endblock %}

Expand Down
39 changes: 39 additions & 0 deletions docs/static_site/src/_includes/head.html
Original file line number Diff line number Diff line change
Expand Up @@ -15,4 +15,43 @@

<script src="{{'/assets/js/clipboard.js'|relative_url}}"></script>
<script src="{{'/assets/js/copycode.js'|relative_url}}"></script>
<style>
.dropdown-option-active {
color: #FF4500 !important;
font-weight: lighter;
}

.dropdown {
position: relative;
display: inline-block;
}

.dropdown-content {
display: none;
position: absolute;
background-color: #f9f9f9;
min-width: 160px;
box-shadow: 0px 8px 16px 0px rgba(0,0,0,0.2);
padding: 12px 16px;
z-index: 1;
text-align: left;
}

.dropdown:hover .dropdown-content {
display: block;
}

.dropdown-header {
color: #FFFFFF;
display: inline-flex;
}

.dropdown-caret {
width: 18px;
}

.dropdown-caret-path {
fill: #FFFFFF;
}
</style>
</head>
17 changes: 17 additions & 0 deletions docs/static_site/src/_includes/header.html
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,23 @@
<a class="page-link" href="{{'/ecosystem' | relative_url }}">Ecosystem</a>
<a class="page-link" href="{{'/api' | relative_url }}">Docs & Tutorials</a>
<a class="page-link" href="https://github.com/apache/incubator-mxnet">GitHub</a>
<div class="dropdown">
<span class="dropdown-header">master
<svg class="dropdown-caret" viewBox="0 0 32 32" class="icon icon-caret-bottom" aria-hidden="true"><path class="dropdown-caret-path" d="M24 11.305l-7.997 11.39L8 11.305z"></path></svg>
</span>
<div class="dropdown-content">
<a class="dropdown-option-active" href="/">master</a>
<a href="/versions/1.6/">1.6</a>
<a href="/versions/1.5.0/">1.5.0</a>
<a href="/versions/1.4.1/">1.4.1</a>
<a href="/versions/1.3.1/">1.3.1</a>
<a href="/versions/1.2.1/">1.2.1</a>
<a href="/versions/1.1.0/">1.1.0</a>
<a href="/versions/1.0.0/">1.0.0</a>
<a href="/versions/0.12.1/">0.12.1</a>
<a href="/versions/0.11.0/">0.11.0</a>
</div>
</div>
</div>
</nav>
</div>
Expand Down

0 comments on commit 3156c4d

Please sign in to comment.