From 896add93f7ce851840732874c1150fd33e431a02 Mon Sep 17 00:00:00 2001 From: Amaresh S M <30730124+amareshsm@users.noreply.github.com> Date: Sat, 28 Dec 2024 00:29:27 +0530 Subject: [PATCH] feat: add code explorer in the navbar --- src/_data/links.json | 1 + src/_data/sites/de.yml | 3 +++ src/_data/sites/en.yml | 3 +++ src/_data/sites/es.yml | 3 +++ src/_data/sites/fr.yml | 3 +++ src/_data/sites/hi.yml | 3 +++ src/_data/sites/ja.yml | 3 +++ src/_data/sites/pt-br.yml | 3 +++ src/_data/sites/zh-hans.yml | 3 +++ src/assets/js/main.js | 2 +- src/assets/scss/components/index.scss | 11 +---------- src/assets/scss/components/navigation.scss | 8 ++++---- src/assets/scss/header.scss | 2 +- 13 files changed, 32 insertions(+), 16 deletions(-) diff --git a/src/_data/links.json b/src/_data/links.json index b97d0dd09e..0f6da4cf15 100644 --- a/src/_data/links.json +++ b/src/_data/links.json @@ -8,6 +8,7 @@ "blog": "/blog", "docs": "/docs/latest/", "playground": "/play", + "codeExplorer": "https://explorer.eslint.org/", "getStarted": "/docs/latest/use/getting-started", "sponsors": "/sponsors", "branding": "/branding", diff --git a/src/_data/sites/de.yml b/src/_data/sites/de.yml index 178df11df2..ab05685298 100644 --- a/src/_data/sites/de.yml +++ b/src/_data/sites/de.yml @@ -74,6 +74,9 @@ navigation: - text: Demo link: playground target: _blank +- text: Code Explorer + link: codeExplorer + target: _blank #------------------------------------------------------------------------------ # Footer diff --git a/src/_data/sites/en.yml b/src/_data/sites/en.yml index ab8c228269..018709a14a 100644 --- a/src/_data/sites/en.yml +++ b/src/_data/sites/en.yml @@ -79,6 +79,9 @@ navigation: - text: Playground link: playground target: _blank +- text: Code Explorer + link: codeExplorer + target: _blank #------------------------------------------------------------------------------ # Footer diff --git a/src/_data/sites/es.yml b/src/_data/sites/es.yml index 0cb89f31da..f0cfebeb97 100644 --- a/src/_data/sites/es.yml +++ b/src/_data/sites/es.yml @@ -72,6 +72,9 @@ navigation: - text: Prueba ESLint link: playground target: _blank +- text: Code Explorer + link: codeExplorer + target: _blank #------------------------------------------------------------------------------ # Footer diff --git a/src/_data/sites/fr.yml b/src/_data/sites/fr.yml index fa98f5f251..f04ede2641 100644 --- a/src/_data/sites/fr.yml +++ b/src/_data/sites/fr.yml @@ -73,6 +73,9 @@ navigation: - text: Démo link: playground target: _blank +- text: Code Explorer + link: codeExplorer + target: _blank #------------------------------------------------------------------------------ # Footer diff --git a/src/_data/sites/hi.yml b/src/_data/sites/hi.yml index 28fe6a97a8..fc7b31d2c4 100644 --- a/src/_data/sites/hi.yml +++ b/src/_data/sites/hi.yml @@ -71,6 +71,9 @@ navigation: - text: Playground link: playground target: _blank + - text: Code Explorer + link: codeExplorer + target: _blank #------------------------------------------------------------------------------ # Footer diff --git a/src/_data/sites/ja.yml b/src/_data/sites/ja.yml index c26538fb01..cd5947501b 100644 --- a/src/_data/sites/ja.yml +++ b/src/_data/sites/ja.yml @@ -72,6 +72,9 @@ navigation: - text: Playground link: playground target: _blank + - text: Code Explorer + link: codeExplorer + target: _blank #------------------------------------------------------------------------------ # Footer diff --git a/src/_data/sites/pt-br.yml b/src/_data/sites/pt-br.yml index 18b2b0c245..791e42f6f9 100644 --- a/src/_data/sites/pt-br.yml +++ b/src/_data/sites/pt-br.yml @@ -72,6 +72,9 @@ navigation: - text: Playground link: playground target: _blank +- text: Code Explorer + link: codeExplorer + target: _blank #------------------------------------------------------------------------------ # Footer diff --git a/src/_data/sites/zh-hans.yml b/src/_data/sites/zh-hans.yml index 5c7a7bb0d2..f40db22048 100644 --- a/src/_data/sites/zh-hans.yml +++ b/src/_data/sites/zh-hans.yml @@ -71,6 +71,9 @@ navigation: - text: 演练场 link: playground target: _blank +- text: Code Explorer + link: codeExplorer + target: _blank #------------------------------------------------------------------------------ # Footer diff --git a/src/assets/js/main.js b/src/assets/js/main.js index 0b95b9a8aa..a6744eb521 100644 --- a/src/assets/js/main.js +++ b/src/assets/js/main.js @@ -5,7 +5,7 @@ open = false; if (matchMedia) { - const mq = window.matchMedia("(max-width: 680px)"); + const mq = window.matchMedia("(max-width: 810px)"); mq.addEventListener("change", WidthChange); WidthChange(mq); } diff --git a/src/assets/scss/components/index.scss b/src/assets/scss/components/index.scss index 7950a33ddc..ca24c9386b 100644 --- a/src/assets/scss/components/index.scss +++ b/src/assets/scss/components/index.scss @@ -111,17 +111,8 @@ .no-js button { display: none !important; } -@media all and (min-width: 681px) { +@media all and (min-width: 811px) { .enhanced #nav-toggle { display: none; } } -@media all and (max-width: 679px) { - .no-js #nav-list { - display: block !important; - } - - .enhanced #nav-list { - display: none; - } -} diff --git a/src/assets/scss/components/navigation.scss b/src/assets/scss/components/navigation.scss index cce3b04705..fcac543205 100644 --- a/src/assets/scss/components/navigation.scss +++ b/src/assets/scss/components/navigation.scss @@ -11,7 +11,7 @@ margin-top: 1rem; margin-block-start: 1rem; - @media all and (min-width: 681px) { + @media all and (min-width: 811px) { font-size: var(--step-0); margin-top: 0; margin-block-start: 0; @@ -24,7 +24,7 @@ } &[data-open="true"] { - @media all and (min-width: 681px) { + @media all and (min-width: 811px) { display: flex; } } @@ -103,7 +103,7 @@ } } -@media all and (min-width: 681px) { +@media all and (min-width: 811px) { .site-nav { flex-direction: row; grid-column: auto; @@ -126,7 +126,7 @@ } } -@media (max-width: 680px) { +@media (max-width: 810px) { #nav-list[data-open="true"] { display: block !important; } diff --git a/src/assets/scss/header.scss b/src/assets/scss/header.scss index 3fbc0119c4..1d649a7b08 100644 --- a/src/assets/scss/header.scss +++ b/src/assets/scss/header.scss @@ -13,7 +13,7 @@ padding-block-start: 0; padding-block-end: 0; - @media all and (min-width: 681px) { + @media all and (min-width: 811px) { justify-content: space-between; } }