From fb45297bac498de999b219e9ef049e195b773e73 Mon Sep 17 00:00:00 2001 From: Gion-Andri Cantieni Date: Mon, 9 Oct 2023 17:01:11 +0200 Subject: [PATCH] feat: make menu responsive --- .../components/footer/footer.component.scss | 10 + .../components/header/header.component.html | 42 ++-- .../components/header/header.component.scss | 180 ++++--------- src/app/components/header/header.component.ts | 38 ++- .../events-list/events-list.component.html | 2 + src/styles.scss | 238 +++++++++--------- src/styles/_menu.scss | 72 ++++++ 7 files changed, 304 insertions(+), 278 deletions(-) create mode 100644 src/styles/_menu.scss diff --git a/src/app/components/footer/footer.component.scss b/src/app/components/footer/footer.component.scss index 5c9d847..52cf698 100644 --- a/src/app/components/footer/footer.component.scss +++ b/src/app/components/footer/footer.component.scss @@ -1,10 +1,20 @@ +@import 'node_modules/bootstrap/scss/functions'; +@import 'node_modules/bootstrap/scss/variables'; +@import 'node_modules/bootstrap/scss/mixins'; + :host { display: flex; + flex-direction: column-reverse; justify-content: space-between; padding-bottom: 20px; padding-top: 20px; border-top: 1px solid #BBBFC2; align-items: center; + + @include media-breakpoint-up(md) { + flex-direction: row; + + } } .links { diff --git a/src/app/components/header/header.component.html b/src/app/components/header/header.component.html index 2c95d51..4644913 100644 --- a/src/app/components/header/header.component.html +++ b/src/app/components/header/header.component.html @@ -1,5 +1,3 @@ -
-
CHALENDER.CH
@@ -12,7 +10,7 @@ - - + diff --git a/src/styles.scss b/src/styles.scss index 96637a9..6012870 100644 --- a/src/styles.scss +++ b/src/styles.scss @@ -1,182 +1,192 @@ @import "styles/normalize"; @import "styles/fonts"; +@import "styles/menu"; :root { - --accent: #3CBFA4; + --accent: #3CBFA4; } /* Importing Bootstrap SCSS file. */ @import 'bootstrap/scss/bootstrap'; +@import 'node_modules/bootstrap/scss/functions'; +@import 'node_modules/bootstrap/scss/variables'; +@import 'node_modules/bootstrap/scss/mixins'; @import "styles/bootstrap-overrides"; body { - background-color: #9a9a9a; - font-family: Cadiz, sans-serif; + background-color: #9a9a9a; + font-family: Cadiz, sans-serif; + font-size: 16px; } #container { - background-color: white; - min-height: 100vh; + background-color: white; + min-height: 100vh; } .container { - max-width: 1280px; - margin: 0 auto; + max-width: 1280px; + margin: 0 auto; } #content { - min-height: calc(100vh - 124px - 81px - 2rem); + //min-height: calc(100vh - 124px - 81px - 2rem); } section.content-narrow { - max-width: 800px; - margin: 2rem auto; + padding: 0 0.5rem; + + @include media-breakpoint-up(lg) { + padding: unset; + max-width: 900px; + margin: 2rem auto; + } } section.content-wide { - margin: 2rem; + margin: 2rem; } h1 { - font-family: "CadizBlack", sans-serif; - font-size: 2rem; - margin-bottom: 1rem; + font-family: "CadizBlack", sans-serif; + font-size: 2rem; + margin-bottom: 1rem; } h2 { - font-family: "CadizBlack", sans-serif; + font-family: "CadizBlack", sans-serif; } a { - color: var(--accent); - text-decoration: none; + color: var(--accent); + text-decoration: none; - &:hover { - text-decoration: underline; - } + &:hover { + text-decoration: underline; + } } button.clndr { - background-color: white; - border: 1px solid black; - color: black; - padding: 0.5rem 1rem; - border-radius: 0; - font-size: 1rem; - font-weight: 600; - cursor: pointer; - transition: all 0.2s ease-in-out; - margin-right: 2rem; - - &:hover { - border: 1px solid var(--accent); - color: var(--accent); - } - - &:disabled, &.accent:disabled { - border: 1px solid grey; - color: gray; background-color: white; + border: 1px solid black; + color: black; + padding: 0.5rem 1rem; + border-radius: 0; + font-size: 1rem; + font-weight: 600; + cursor: pointer; + transition: all 0.2s ease-in-out; + margin-right: 2rem; &:hover { - border: 1px solid grey; - color: gray; - background-color: white; + border: 1px solid var(--accent); + color: var(--accent); } - } - &.accent { - border: 1px solid var(--accent); - color: var(--accent); + &:disabled, &.accent:disabled { + border: 1px solid grey; + color: gray; + background-color: white; - &:hover { - background-color: var(--accent); - color: white; + &:hover { + border: 1px solid grey; + color: gray; + background-color: white; + } } - } -} -.tag-element { - border: 1px solid black; - color: black; - padding: 3px 8px; - margin: 0 8px; - // clip-path: polygon(0 0, 0 100%, 100% 100%, 100% 25%, 75% 0); - position: relative; + &.accent { + border: 1px solid var(--accent); + color: var(--accent); + &:hover { + background-color: var(--accent); + color: white; + } + } +} - &.active { - border: 1px solid var(--accent); - color: var(--accent); - - &:before { - content: ''; - position: absolute; - top: 0; - right: 0; - border-top: 8px solid var(--accent); - border-left: 8px solid white; - width: 0; +.tag-element { + border: 1px solid black; + color: black; + padding: 3px 8px; + margin: 0 8px; + // clip-path: polygon(0 0, 0 100%, 100% 100%, 100% 25%, 75% 0); + position: relative; + + + &.active { + border: 1px solid var(--accent); + color: var(--accent); + + &:before { + content: ''; + position: absolute; + top: 0; + right: 0; + border-top: 8px solid var(--accent); + border-left: 8px solid white; + width: 0; + } } - } } #menu-button { - .line { - fill: none; - stroke: black; - stroke-width: 6; - transition: stroke-dasharray 600ms cubic-bezier(0.4, 0, 0.2, 1), - stroke-dashoffset 600ms cubic-bezier(0.4, 0, 0.2, 1); - } - - .line1 { - stroke-dasharray: 60 207; - stroke-width: 6; - } - - .line2 { - stroke-dasharray: 60 60; - stroke-width: 6; - } - - .line3 { - stroke-dasharray: 60 207; - stroke-width: 6; - } - - &.opened { + .line { + fill: none; + stroke: black; + stroke-width: 6; + transition: stroke-dasharray 600ms cubic-bezier(0.4, 0, 0.2, 1), + stroke-dashoffset 600ms cubic-bezier(0.4, 0, 0.2, 1); + } + .line1 { - stroke-dasharray: 90 207; - stroke-dashoffset: -134; - stroke-width: 6; - stroke: white; + stroke-dasharray: 60 207; + stroke-width: 6; } .line2 { - stroke-dasharray: 1 60; - stroke-dashoffset: -30; - stroke-width: 6; - stroke: white; + stroke-dasharray: 60 60; + stroke-width: 6; } .line3 { - stroke-dasharray: 90 207; - stroke-dashoffset: -134; - stroke-width: 6; - stroke: white; + stroke-dasharray: 60 207; + stroke-width: 6; + } + + &.opened { + .line1 { + stroke-dasharray: 90 207; + stroke-dashoffset: -134; + stroke-width: 6; + stroke: white; + } + + .line2 { + stroke-dasharray: 1 60; + stroke-dashoffset: -30; + stroke-width: 6; + stroke: white; + } + + .line3 { + stroke-dasharray: 90 207; + stroke-dashoffset: -134; + stroke-width: 6; + stroke: white; + } } - } } .diff { - .added { - background-color: #cbffcb; - } + .added { + background-color: #cbffcb; + } - .removed { - background-color: #ffbebe; - } + .removed { + background-color: #ffbebe; + } } diff --git a/src/styles/_menu.scss b/src/styles/_menu.scss new file mode 100644 index 0000000..450e7ea --- /dev/null +++ b/src/styles/_menu.scss @@ -0,0 +1,72 @@ +@import 'node_modules/bootstrap/scss/functions'; +@import 'node_modules/bootstrap/scss/variables'; +@import 'node_modules/bootstrap/scss/mixins'; + + +.offcanvas.menu-panel { + height: 100vh !important; + background-color: var(--accent); + + @include media-breakpoint-up(md) { + height: 600px !important; + } + + .menu { + overflow-y: scroll; + display: flex; + flex-direction: column; + + @include media-breakpoint-up(md) { + flex-direction: row; + inset: 100px; + max-width: 1200px; + margin: 0 auto; + padding-top: 80px; + gap: 60px; + } + + @include media-breakpoint-up(lg) { + gap: 200px; + } + + ul { + list-style: none; + margin: 0; + padding: 2rem; + font-size: 1.5rem; + line-height: 2rem; + flex-basis: 50%; + flex-grow: 1; + + @include media-breakpoint-up(md) { + font-size: 2rem; + line-height: 2.25rem; + } + + @include media-breakpoint-up(lg) { + padding: 3rem; + } + + li { + padding-bottom: 0.5rem; + } + } + + ul:nth-of-type(2) { + font-size: 1.5rem; + line-height: 2rem; + } + + a { + color: white; + } + + .main-menu-top { + font-family: CadizBlack, sans-serif; + } + + .main-menu-bottom { + font-family: Cadiz, sans-serif; + } + } +}