Skip to content

Nav updates #480

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 9 commits into from
Sep 21, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions _includes/footer_scripts.html
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,8 @@
var top = $(this).scrollTop();
var fullPosition = $(".main-background").height() - $(".header-holder").height();

if (top === 0) {
$(".header-holder").css({"backgroundColor": "transparent"});
if (top <= 40) {
$(".header-holder").css({"backgroundColor": "rgba(0, 0, 0, 0.165)"});
} else if (top >= fullPosition) {
$(".header-holder").css({"backgroundColor": "#000000"});
} else {
Expand Down
36 changes: 20 additions & 16 deletions _includes/main_menu.html
Original file line number Diff line number Diff line change
Expand Up @@ -4,22 +4,12 @@
<a href="{{ site.baseurl }}/get-started">Get Started</a>
</li>

<li class="main-menu-item {% if current[1] == 'ecosystem' or current[1] == 'hub' %}active{% endif %}">
<li class="main-menu-item {% if current[1] == 'ecosystem' %}active{% endif %}">

<div class="ecosystem-dropdown">
<a id="dropdownMenuButton" data-toggle="ecosystem-dropdown">
<div id="dropdownMenuButton" data-toggle="ecosystem-dropdown" class="ecosystem-dropdown">
<a class="ecosystem-option" href="{{ site.baseurl }}/ecosystem">
Ecosystem
</a>
<div class="ecosystem-dropdown-menu">
<a class="nav-dropdown-item" href="{{ site.baseurl }}/hub">
<span class=dropdown-title>Models (Beta)</span>
<p>Discover, publish, and reuse pre-trained models</p>
</a>
<a class="nav-dropdown-item" href="{{ site.baseurl }}/ecosystem">
<span class=dropdown-title>Tools & Libraries</span>
<p>Explore the ecosystem of tools and libraries</p>
</a>
</div>
</div>
</li>

Expand All @@ -39,10 +29,12 @@
<a href="{{ site.baseurl }}/docs">Docs</a>
</li>

<li class="main-menu-item {% if current[1] == 'resources' or current[1] == 'features' %}active{% endif %}">
{% assign resources = "resources, features, hub" | split: ", " %}

<li class="main-menu-item {% if resources contains current[1] %}active{% endif %}">

<div class="resources-dropdown">
<a id="resourcesDropdownButton" data-toggle="resources-dropdown">
<div id="resourcesDropdownButton" data-toggle="resources-dropdown" class="resources-dropdown">
<a class="resource-option {% if current[1] == {{ site.baseurl }} %}with-down-white-arrow{% else %}with-down-arrow{% endif %}">
Resources
</a>
<div class="resources-dropdown-menu">
Expand All @@ -54,6 +46,18 @@
<span class=dropdown-title>About</span>
<p>Learn about PyTorch’s features and capabilities</p>
</a>
<a class="nav-dropdown-item" href="{{ site.baseurl }}/hub">
<span class=dropdown-title>Models (Beta)</span>
<p>Discover, publish, and reuse pre-trained models</p>
</a>
<a class="nav-dropdown-item" href="{{ site.baseurl }}/#community-module">
<span class=dropdown-title>Community</span>
<p>Join the PyTorch developer community to contribute, learn, and get your questions answered.</p>
</a>
<a class="nav-dropdown-item" href="{{ site.external_urls.discuss }}" target="_blank">
<span class=dropdown-title>Forums</span>
<p>A place to discuss PyTorch code, issues, install, research</p>
</a>
</div>
</div>
</li>
Expand Down
34 changes: 24 additions & 10 deletions _includes/mobile_menu.html
Original file line number Diff line number Diff line change
Expand Up @@ -27,10 +27,6 @@
<a href="{{ site.baseurl }}/get-started">Get Started</a>
</li>

<li class="{% if current[1] == 'features' %}active{% endif %}">
<a href="{{ site.baseurl }}/features">Features</a>
</li>

<li class="{% if current[1] == 'ecosystem' %}active{% endif %}">
<a href="{{ site.baseurl }}/ecosystem">Ecosystem</a>
</li>
Expand All @@ -39,10 +35,6 @@
<a href="{{ site.baseurl }}/mobile">Mobile</a>
</li>

<li class="{% if current[1] == 'hub' %}active{% endif %}">
<a href="{{ site.baseurl }}/hub">PyTorch Hub</a>
</li>

<li class="{% if current[1] == 'blog' %}active{% endif %}">
<a href="{{ site.baseurl }}/blog">Blog</a>
</li>
Expand All @@ -55,10 +47,32 @@
<a href="{{ site.baseurl }}/docs">Docs</a>
</li>

<li class="{% if current[1] == 'resources' %}active{% endif %}">
<a href="{{ site.baseurl }}/resources">Resources</a>
<li class="resources-mobile-menu-title">
Resources
</li>

<ul class="resources-mobile-menu-items">
<li class="{% if current[1] == 'resources' %}active{% endif %}">
<a href="{{ site.baseurl }}/resources">Developer Resources</a>
</li>

<li class="{% if current[1] == 'features' %}active{% endif %}">
<a href="{{ site.baseurl }}/features">About</a>
</li>

<li class="{% if current[1] == 'hub' %}active{% endif %}">
<a href="{{ site.baseurl }}/hub">Models (Beta)</a>
</li>

<li>
<a href="{{ site.baseurl }}/#community-module">Community</a>
</li>

<li>
<a href="{{ site.external_urls.discuss }}">Forum</a>
</li>
</ul>

<li id="github-mobile-menu-link">
<a href="{{ site.external_urls.github }}">GitHub</a>
</li>
Expand Down
6 changes: 5 additions & 1 deletion _sass/homepage.scss
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,10 @@
background-color: $light_grey;
}
}

.homepage-header {
background-color: rgba(0, 0, 0, 0.165);
}
}

.homepage-feature-module {
Expand Down Expand Up @@ -368,7 +372,7 @@
&:hover {
color: $orange;
}
}
}
}

.no-banner {
Expand Down
77 changes: 67 additions & 10 deletions _sass/navigation.scss
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,10 @@
a {
color: $orange;
}

.with-down-arrow {
background-image: url($baseurl + "/assets/images/chevron-down-orange.svg");
}
}

&:last-of-type {
Expand All @@ -118,7 +122,7 @@

ul li a {
color: $white;
font-size: rem(18px);
font-size: 1.3rem;
letter-spacing: 0;
line-height: rem(34px);
text-align: center;
Expand Down Expand Up @@ -164,7 +168,7 @@
padding: 0;
}

ul li a {
ul li a, .resources-mobile-menu-title {
font-size: rem(32px);
color: $white;
letter-spacing: 0;
Expand Down Expand Up @@ -199,14 +203,14 @@
height: 100%;
min-height: 100%;
margin-top: -$mobile_header_height;
padding-top: 25%;
padding-top: 50%;
overflow-y: scroll;
@media only screen and (max-width: 320px) {
padding-top: 50%;
overflow-y: scroll;
padding-top: 75%;
}

@include small-desktop {
padding-top: 0;
padding-top: 25%;
}

.navSearchWrapper {
Expand Down Expand Up @@ -237,11 +241,56 @@
}
}

.resources, .features, .hub {
.main-menu ul li{
&.active {
&:after {
display: none;
}
}
}
}

.main-menu ul li {
.ecosystem-dropdown, .resources-dropdown a {
cursor: pointer;
}

.ecosystem-dropdown, .resources-dropdown {
.with-down-orange-arrow {
padding-right: rem(32px);
position: relative;
background-image: url($baseurl + "/assets/images/chevron-down-orange.svg");
background-size: 14px 18px;
background-position: top 7px right 10px;
background-repeat: no-repeat;
}

.with-down-white-arrow {
padding-right: rem(32px);
position: relative;
background-image: url($baseurl + "/assets/images/chevron-down-white.svg");
background-size: 14px 18px;
background-position: top 7px right 10px;
background-repeat: no-repeat;
&:hover {
background-image: url($baseurl + "/assets/images/chevron-down-orange.svg");
}
}

.with-down-arrow {
padding-right: rem(32px);
position: relative;
background-image: url($baseurl + "/assets/images/chevron-down-black.svg");
background-size: 14px 18px;
background-position: top 7px right 10px;
background-repeat: no-repeat;
&:hover {
background-image: url($baseurl + "/assets/images/chevron-down-orange.svg");
}
}
}

.dropdown-menu {
border-radius: 0;
padding: 0;
Expand Down Expand Up @@ -279,13 +328,11 @@
width: 226px;
display: none;
position: absolute;
top: rem(50px);
z-index: 1000;
display: none;
float: left;
min-width: 10rem;
padding: 0.5rem 0;
margin: 0.125rem 0 0;
font-size: 1rem;
color: #212529;
text-align: left;
Expand All @@ -296,8 +343,10 @@
border-radius: 0.25rem;
}

.ecosystem-dropdown-menu.show-menu, .resources-dropdown-menu.show-menu {
display: block;
.ecosystem-dropdown:hover, .resources-dropdown:hover {
.ecosystem-dropdown-menu, .resources-dropdown-menu {
display: block;
}
}

.main-menu ul li {
Expand Down Expand Up @@ -347,3 +396,11 @@
background-color: $orange;
color: white;
}

.mobile-main-menu-links-container {
ul.resources-mobile-menu-items {
li {
padding-left: 15px;
}
}
}
4 changes: 2 additions & 2 deletions _sass/search.scss
Original file line number Diff line number Diff line change
Expand Up @@ -321,9 +321,9 @@ input::placeholder {
color: transparent;
width: 25px;
height: 25px;
background-size: 12px 15px;
background-size: 14px 16px;
background-repeat: no-repeat;
background-position: 7px 5px;
background-position: 6px 5px;
border-radius: 25px;
cursor: pointer;
&:hover {
Expand Down
17 changes: 17 additions & 0 deletions assets/images/chevron-down-black.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
17 changes: 17 additions & 0 deletions assets/images/chevron-down-white.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
6 changes: 1 addition & 5 deletions assets/main-menu-dropdown.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,4 @@
$("[data-toggle='ecosystem-dropdown']").on("click", function() {
toggleDropdown($(this).attr("data-toggle"));
});

$("[data-toggle='resources-dropdown']").on("click", function() {
$("[data-toggle='resources-dropdown']").hover(function() {
toggleDropdown($(this).attr("data-toggle"));
});

Expand Down
2 changes: 1 addition & 1 deletion index.html
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ <h4>{{ item.title }}</h4>
{% endfor %}
</div>

<div class="row">
<div id="community-module" class="row">
<div class="col-md-12 community-heading">
<h2>Community</h2>

Expand Down