From fedbbd5bd214a212b21c7b1da960506f9c9b01fb Mon Sep 17 00:00:00 2001 From: Mowkax Date: Tue, 18 Jul 2023 01:16:15 +0300 Subject: [PATCH] feature: different navbar items grouped into a dropdown beneath 'about us' item. Translations updated --- .../public/locales/en/navbar-component.json | 3 +- .../public/locales/ru/navbar-component.json | 1 + .../svelte/src/navbar/navbar-component.svelte | 75 ++++++++++++++++--- .../public/locales/en/navbar-component.json | 3 +- .../public/locales/ru/navbar-component.json | 1 + 5 files changed, 69 insertions(+), 14 deletions(-) diff --git a/Server/app/svelte/public/locales/en/navbar-component.json b/Server/app/svelte/public/locales/en/navbar-component.json index 8767c96..6ecb2b3 100644 --- a/Server/app/svelte/public/locales/en/navbar-component.json +++ b/Server/app/svelte/public/locales/en/navbar-component.json @@ -1,7 +1,8 @@ { "orgName": "Libertarian socialists", "manifesto": "Manifesto", - "joinUs": "Join Us", + "joinUs": "Join us", + "aboutUs": "About us", "groups": "Groups", "communes": "Communes", "cooperatives": "Cooperatives", diff --git a/Server/app/svelte/public/locales/ru/navbar-component.json b/Server/app/svelte/public/locales/ru/navbar-component.json index 7cd713b..ae8f1b9 100644 --- a/Server/app/svelte/public/locales/ru/navbar-component.json +++ b/Server/app/svelte/public/locales/ru/navbar-component.json @@ -2,6 +2,7 @@ "orgName": "Либертарные социалисты", "manifesto": "Манифест", "joinUs": "Присоединяйся", + "aboutUs": "О нас", "groups": "Группы", "communes": "Коммуны", "cooperatives": "Кооперативы", diff --git a/Server/app/svelte/src/navbar/navbar-component.svelte b/Server/app/svelte/src/navbar/navbar-component.svelte index 16fe120..daa80b4 100644 --- a/Server/app/svelte/src/navbar/navbar-component.svelte +++ b/Server/app/svelte/src/navbar/navbar-component.svelte @@ -10,7 +10,7 @@ // Main code let hambInput let navbar - let localesDropdown + let localesDropdown; let loaded = writable(0) let content = writable({}) let logoText @@ -85,7 +85,7 @@ {#key loaded} {#if Object.keys($content).length!=0} - {fixHeading()} + {fixHeading()}{console.log($content)} @@ -131,12 +146,14 @@ @import '/css/common.css'; /* Header */ - #navbar{ + #navbar{ position: relative; top: 0; width: min(100%,116rem); z-index: 1000000000; height: 5.26rem; + padding-left: 4rem; + padding-right: 4rem; } #navbar * { @@ -185,7 +202,7 @@ overflow: hidden; z-index: 0; } - #menu a { + #menu a, #options-button { display: block; padding: 1.2rem; padding-top: 1rem; @@ -282,6 +299,38 @@ top: 0; } + /* Options */ + + #options-dropdown { + position: absolute; + display: none; + border: #404040 solid 0.1rem; + /*padding: 0.5rem;*/ + background-color: white; + overflow: auto; + width: 35%; + } + + #options-list > li a { + padding: 1rem; + font-size: 1.1rem; + } + + #options-list > li:hover { + background-color: rgb(187 53 52 / 96%); + width: 100%; + } + + #options-list > li:hover > a{ + color: white; + } + + #options-container:hover #options-dropdown { + display: block; + } + + + /*Localization*/ #locales { @@ -340,9 +389,11 @@ #navbar { position: relative; - width: min(95%,116rem); + width: min(100%,116rem); left: 50%; transform: translateX(-50%); + padding-right: 4rem; + padding-left: 4rem; } #nav { @@ -363,12 +414,12 @@ float: left; } - #menu a:hover { + #menu a:hover, #options-button:hover { background-color: transparent; color: rgb(127, 127, 127); } - #menu a { + #menu a, #options-button { padding: 1.2rem; padding-top: 1.9rem; padding-bottom: 1.9rem; diff --git a/Server/public/locales/en/navbar-component.json b/Server/public/locales/en/navbar-component.json index 8767c96..6ecb2b3 100644 --- a/Server/public/locales/en/navbar-component.json +++ b/Server/public/locales/en/navbar-component.json @@ -1,7 +1,8 @@ { "orgName": "Libertarian socialists", "manifesto": "Manifesto", - "joinUs": "Join Us", + "joinUs": "Join us", + "aboutUs": "About us", "groups": "Groups", "communes": "Communes", "cooperatives": "Cooperatives", diff --git a/Server/public/locales/ru/navbar-component.json b/Server/public/locales/ru/navbar-component.json index 7cd713b..ae8f1b9 100644 --- a/Server/public/locales/ru/navbar-component.json +++ b/Server/public/locales/ru/navbar-component.json @@ -2,6 +2,7 @@ "orgName": "Либертарные социалисты", "manifesto": "Манифест", "joinUs": "Присоединяйся", + "aboutUs": "О нас", "groups": "Группы", "communes": "Коммуны", "cooperatives": "Кооперативы",