Skip to content
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

Updated mobile menu on Dev portal page #1363

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
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
5 changes: 5 additions & 0 deletions qdrant-landing/content/headless/docs-header.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,18 +10,23 @@ menuItems:
- id: menu-0
name: Qdrant
url: /documentation/
icon: menu-documentation-white.svg
- id: menu-1
name: Cloud
url: /documentation/cloud-intro/
icon: cloud-white.svg
- id: menu-2
name: Build
url: /documentation/build/
icon: blog-white.svg
- id: menu-3
name: Learn
url: /articles/
icon: rocket-white.svg
- id: menu-4
name: API Reference
url: https://api.qdrant.tech/api-reference
external: true
icon: roadmap-white.svg
sitemapExclude: true
---
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
}

.main-menu {
border-bottom: pxToRem(1) solid $neutral-20;
padding: pxToRem(68) $spacer $spacer * 1.5;

&__links {
margin-right: auto;
Expand All @@ -20,10 +20,10 @@

&__buttons {
&-input {
width: pxToRem(300);
height: pxToRem(35);
width: 100%;
padding: 0 $spacer;
height: $spacer * 2.5;
position: relative;
margin-right: $spacer * 1.5;

svg {
position: absolute;
Expand All @@ -33,12 +33,11 @@
}

button {
position: relative;
height: 100%;
padding-left: $spacer * 2.5;
color: $neutral-70;
text-align: left;
font-size: pxToRem(14);
line-height: pxToRem(18);

&:after {
content: '';
Expand All @@ -57,13 +56,132 @@
}

.menu-mobile {
padding-top: pxToRem(12);
gap: $spacer * 1.5;
background: $neutral-20;
padding-top: 0;

&__header {
padding: pxToRem(68) $spacer $spacer * 1.5;
border-bottom: pxToRem(1) solid $neutral-40;
}

&__close {
width: $spacer * 2.5;
height: $spacer * 2.5;
padding: $spacer * 0.5;
border-radius: $spacer * 0.5;
z-index: 1;
background: linear-gradient($neutral-30, #141B2E);
}

&__items {
padding: 0 $spacer;
}

&__item {
border-bottom: none;
font-size: $spacer;
line-height: $spacer * 1.5;

&-content {
padding: $spacer * 0.5 pxToRem(12);
min-height: 0;
}

a {
display: flex;
align-items: center;
gap: pxToRem(12);
color: $neutral-94;

svg {
height: $spacer;
width: $spacer;
}

&.active {
color: $primary-50;

svg {
fill: $primary-50;
}
}
}

&:nth-of-type(4) {
a {
&.active {
svg {
fill: none;
stroke: $primary-50;
}
}
}
}
}

[data-theme='light'] & {
background: $neutral-94;

&__item {
a {
color: $neutral-30;

svg {
fill: $neutral-30;
}

&.active {
color: $primary-50;

svg {
fill: $primary-50;
}
}
}

&:nth-of-type(4) {
a {
svg {
fill: none;
stroke: $neutral-30;
}

&.active {
svg {
fill: none;
stroke: $primary-50;
}
}
}
}
}
}
}

.docs-menu {
display: block;
}

@include media-breakpoint-up(xl) {
.main-menu {
height: $spacer * 5;
padding: pxToRem(22) $spacer * 1.5;
border-bottom: pxToRem(1) solid $neutral-20;

&__buttons {
&-input {
width: pxToRem(300);
height: pxToRem(35);
margin-right: $spacer * 1.5;
padding: 0;

button {
font-size: pxToRem(14);
line-height: pxToRem(18);
}
}
}
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,43 +2,12 @@
@use 'sass:math';

.docs-menu {
display: none;
background-color: $neutral-20;
border-top: 1px solid $neutral-30;
margin: 0 (-$spacer) $spacer * 2;
scrollbar-width: none;

&__header {
display: flex;
align-items: center;
justify-content: space-between;
padding: pxToRem(15) pxToRem(20);
cursor: pointer;
.docs-menu__button svg {
transition: transform 0.2s;
}

&.active {
.docs-menu__button svg {
transform: rotate(180deg);
}
}

h2 {
font-size: pxToRem(18);
line-height: pxToRem(27);
font-weight: 400;
color: $neutral-90;
margin: 0;
}
}

&__content {
display: none;
padding: pxToRem(12) $spacer * 1.5;

&.active {
display: block;
}
padding: 0 $spacer $spacer * 1.5;
}

&__input {
Expand Down Expand Up @@ -85,15 +54,15 @@
&__links {
&-title {
margin-bottom: 0;
padding: math.div($spacer, 2);
padding: pxToRem(12) math.div($spacer, 2) math.div($spacer, 4);
color: $neutral-98;
font-weight: bold;
font-size: $spacer;
line-height: $spacer * 1.5;

&:not(:nth-of-type(1)) {
margin-top: pxToRem(12);
padding-top: $spacer;
margin-top: $spacer;
padding-top: pxToRem(20);
}
}

Expand All @@ -111,8 +80,6 @@
justify-content: space-between;
align-items: center;
color: $neutral-70;
font-size: pxToRem(14);
line-height: pxToRem(21);
font-weight: 400;
}
}
Expand All @@ -123,7 +90,7 @@
width: pxToRem(10);
height: pxToRem(10);
position: absolute;
top: pxToRem(10);
top: pxToRem(15);
right: $spacer;
background-image: url("data:image/svg+xml,%3Csvg width='10' height='11' viewBox='0 0 10 11' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M0.832764 3.41669L4.99943 7.58335L9.1661 3.41669' stroke='%238F98B3' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E%0A");
background-size: cover;
Expand All @@ -141,7 +108,7 @@
}

summary:after {
top: pxToRem(10);
top: pxToRem(15);
}
}

Expand All @@ -152,8 +119,8 @@
}

a {
padding: math.div($spacer, 4) $spacer * 1.5 math.div($spacer, 4) math.div($spacer, 2);
// margin-bottom: math.div($spacer, 4);
margin-top: math.div($spacer, 4);
padding: math.div($spacer, 2) $spacer * 1.5 math.div($spacer, 2) math.div($spacer, 2);
}

&.external-link {
Expand Down Expand Up @@ -186,9 +153,7 @@
justify-content: space-between;
align-items: center;
color: $neutral-70;
font-size: pxToRem(14);
font-weight: 400;
line-height: pxToRem(21);
}

&.active {
Expand All @@ -212,6 +177,7 @@
}

@include media-breakpoint-up(xl) {
display: block;
height: calc(100vh - 80px);
width: pxToRem(256);
flex-shrink: 0;
Expand All @@ -220,23 +186,12 @@
top: $spacer * 5;
padding: $spacer $spacer $spacer;
background-color: transparent;
border-top: none;
margin: 0;
border-right: pxToRem(1) solid $neutral-20;

&__header {
display: none;
}

&__content {
display: block;
padding: 0;
}

&__input {
display: none;
}

&__links {
&-title {
&:not(:nth-of-type(1)) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
@extend .container;
margin: 0;
max-width: 100%;
padding-top: $spacer * 1.5;
}
&__article-wrapper {
width: 100%;
Expand Down
27 changes: 0 additions & 27 deletions qdrant-landing/themes/qdrant-2024/assets/js/documentation.js
Original file line number Diff line number Diff line change
@@ -1,37 +1,10 @@
import ThemeSwitch from './theme-switch.js';
import { XL_BREAKPOINT } from './constants';
import TableOfContents from './table-of-content';

const themeSwitch = new ThemeSwitch();

document.addEventListener('DOMContentLoaded', () => {
themeSwitch.initSwitcher();
const sidebar = document.getElementById('sidebar');
const sidebarToggle = document.getElementById('sidebar-toggle');
const searchbar = document.getElementsByClassName('docs-menu__input')[0];
const docsMenu = document.getElementsByClassName('docs-menu')[0];

sidebarToggle.addEventListener('click', () => {
sidebarToggle.classList.toggle('active');
sidebar.classList.toggle('active');
});

const moveSearchButton = function () {
const checkIfFirstChildIsSearch = (element) => {
return element.children.length > 0 && element.children[0].classList.contains('docs-menu__input');
};

const isMobile = window.innerWidth <= XL_BREAKPOINT;
if (isMobile && !checkIfFirstChildIsSearch(docsMenu)) {
docsMenu.before(searchbar);
} else if (!isMobile && !checkIfFirstChildIsSearch(sidebar)) {
sidebar.before(searchbar);
}
};

moveSearchButton();

window.addEventListener('resize', moveSearchButton);

// if #TableOfContents and .documentation-article exists on the page, initialize TableOfContents class
if (document.getElementById('TableOfContents') && document.querySelector('.documentation-article')) {
Expand Down
Loading
Loading