Skip to content
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
13 changes: 13 additions & 0 deletions docs/assets/javascript/theme.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,5 +20,18 @@ function checkScrollPosition() {
}
}

function initDropdownToggle() {
document.querySelectorAll(".esi-nav-header-item-dropdown").forEach((item) => {
item.addEventListener("click", (event) => {
if (item.dataset.open) {
delete item.dataset.open;
} else {
item.dataset.open = "true";
}
});
});
}

window.addEventListener("scroll", checkScrollPosition);
window.addEventListener("load", checkScrollPosition);
window.addEventListener("load", initDropdownToggle);
54 changes: 54 additions & 0 deletions docs/assets/stylesheet/theme.css
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,10 @@
padding: 0 0 8.6px;
}

.md-header > .md-grid > .md-header__button:hover {
opacity: 1;
}

.md-header > .md-grid > .md-header__title {
margin-left: 0;
}
Expand Down Expand Up @@ -202,6 +206,10 @@ body::before {
z-index: -1;
}

[data-scrolled] .md-header {
backdrop-filter: blur(4px);
}

.md-header__source {
width: var(--source-width);
margin-left: 0.5rem;
Expand Down Expand Up @@ -661,6 +669,52 @@ body::before {
width: calc(100% - 16px);
}

.esi-nav-header-item.esi-nav-header-item-dropdown {
display: flex;
flex-direction: row;
gap: 6px;
cursor: pointer;
}

.esi-nav-header-item.esi-nav-header-item-dropdown svg {
height: 18px;
width: 18px;
transition: transform 0.2s ease-in-out;
align-self: center;
}
.esi-nav-header-item.esi-nav-header-item-dropdown[data-open] svg {
transform: scaleY(-1);
}

.esi-nav-header-item-dropdown .esi-nav-header-dropdown-container {
display: none;
position: absolute;
top: 100%;
left: 0;
background-color: var(--esi-smokey-black);
box-shadow: var(--md-shadow-z2);
min-width: 195px;
padding: 13px 6px;
font-size: 16px;
line-height: 24px;
z-index: 10;
flex-direction: column;
}

.esi-nav-header-item-dropdown .esi-nav-header-dropdown-container a {
padding: 5px 12px;
text-align: left;
}

.esi-nav-header-item-dropdown .esi-nav-header-dropdown-container a:hover {
text-decoration: none;
color: var(--esi-accent);
}

.esi-nav-header-item-dropdown[data-open] .esi-nav-header-dropdown-container {
display: flex;
}

@media screen and (min-width: 60em) {
.esi-sidebar .md-nav {
margin-bottom: 0;
Expand Down
13 changes: 8 additions & 5 deletions overrides/partials/header.html
Original file line number Diff line number Diff line change
Expand Up @@ -32,11 +32,14 @@
<div class="esi-nav-header-item">
<a href="/api-explorer">API Explorer</a>
</div>
<div class="esi-nav-header-item">
<a href="/applications">Applications</a>
</div>
<div class="esi-nav-header-item">
<a href="/authorized-apps">Authorized Apps</a>
<div class="esi-nav-header-item esi-nav-header-item-dropdown">
Applications
<svg aria-hidden="true" focusable="false" data-prefix="fas" data-icon="angle-down" class="svg-inline--fa fa-angle-down fa-1x header_angleDown__Q0pUE" role="img" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 448 512" scale="1.5"><path fill="currentColor" d="M201.4 374.6c12.5 12.5 32.8 12.5 45.3 0l160-160c12.5-12.5 12.5-32.8 0-45.3s-32.8-12.5-45.3 0L224 306.7 86.6 169.4c-12.5-12.5-32.8-12.5-45.3 0s-12.5 32.8 0 45.3l160 160z"></path></svg>

<div class="esi-nav-header-dropdown-container">
<a href="/authorized-apps">Authorized Applications</a>
<a href="/applications">My Applications</a>
</div>
</div>
<div class="esi-nav-header-item">
<a href="/docs/community/">Community Showcase</a>
Expand Down