From 6ea4f57b727c40b3b16c86460deab8b282af62a4 Mon Sep 17 00:00:00 2001 From: Alice Gaudon Date: Mon, 6 Jul 2020 11:06:50 +0200 Subject: [PATCH 1/5] Add missing 'formidable' types --- package.json | 1 + 1 file changed, 1 insertion(+) diff --git a/package.json b/package.json index aec7d2a..f9bf4df 100644 --- a/package.json +++ b/package.json @@ -18,6 +18,7 @@ "@babel/preset-env": "^7.9.5", "@types/config": "^0.0.36", "@types/express": "^4.17.6", + "@types/formidable": "^1.0.31", "@types/jest": "^25.2.1", "@types/node": "^13.13.2", "babel-loader": "^8.1.0", From 2c649d2030ab243afd98a865c99b8a30cd4332c5 Mon Sep 17 00:00:00 2001 From: Alice Gaudon Date: Mon, 6 Jul 2020 11:08:31 +0200 Subject: [PATCH 2/5] Update default config --- config/default.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/config/default.ts b/config/default.ts index 2d97df0..8f2cf14 100644 --- a/config/default.ts +++ b/config/default.ts @@ -14,13 +14,13 @@ export default Object.assign(require("wms-core/config/default").default, { host: "localhost", user: "root", password: "", - database: "wms2", + database: "example_app", create_database_automatically: false }, redis: { host: "127.0.0.1", port: 6379, - prefix: 'wms' + prefix: 'example_app' }, session: { secret: "very_secret_not_known", From 4ca381a4052bde76420cd0b321644db3acb87fad Mon Sep 17 00:00:00 2001 From: Alice Gaudon Date: Mon, 6 Jul 2020 11:36:37 +0200 Subject: [PATCH 3/5] Make main menu mobile-compatible --- assets/sass/_vars.scss | 3 ++ assets/sass/layout.scss | 77 +++++++++++++++++++++++++++++++---------- views/layouts/base.njk | 1 + 3 files changed, 62 insertions(+), 19 deletions(-) diff --git a/assets/sass/_vars.scss b/assets/sass/_vars.scss index cae690a..21d06e7 100644 --- a/assets/sass/_vars.scss +++ b/assets/sass/_vars.scss @@ -25,3 +25,6 @@ $warningColor: desaturate($warningText, 50%); $error: #ff0000; $errorText: darken($error, 30%); $errorColor: desaturate($errorText, 50%); + +// Responsivity +$menuLayoutSwitchTreshold: 700px; diff --git a/assets/sass/layout.scss b/assets/sass/layout.scss index 9cc7bfd..3537169 100644 --- a/assets/sass/layout.scss +++ b/assets/sass/layout.scss @@ -51,32 +51,71 @@ header { } } - nav ul { - display: flex; - flex-direction: row; - margin: 0; - padding: 0; + nav { + ul { + display: flex; + flex-direction: row; + margin: 0; + padding: 0; - font-size: 20px; + font-size: 20px; - li { - list-style: none; + li { + list-style: none; - a, span { - display: flex; - flex-direction: row; - align-items: center; - height: 64px; - padding: 0 24px; + a, span { + display: flex; + flex-direction: row; + align-items: center; + height: 64px; + padding: 0 24px; - .feather { - --icon-size: 24px; - margin-right: 10px; + .feather { + --icon-size: 24px; + margin-right: 10px; + } + } + + a:hover { + background-color: rgba(255, 255, 255, 0.07); + } + } + } + + .hamburger { + display: none; + } + } + + @media (max-width: $menuLayoutSwitchTreshold) { + flex-direction: row-reverse; + + nav { + flex: 1; + .hamburger { + display: block; + padding: 0 16px; + cursor: pointer; + + width: max-content; + + &:hover { + width: auto; } } - a:hover { - background-color: rgba(255, 255, 255, 0.07); + ul { + flex-direction: column; + position: absolute; + left: 0; + transform: translateX(-100%); + transition: transform ease-out 150ms; + + background-color: $headerBackground; + } + + .hamburger:hover + ul, ul:hover { + transform: translateX(0%); } } } diff --git a/views/layouts/base.njk b/views/layouts/base.njk index 97f72d7..7aafc89 100644 --- a/views/layouts/base.njk +++ b/views/layouts/base.njk @@ -14,6 +14,7 @@ {% block header %}