Skip to content

Commit

Permalink
feat: mobile navigation modal
Browse files Browse the repository at this point in the history
  • Loading branch information
svvimming committed Sep 7, 2023
1 parent f9f90ef commit 41d5f8c
Show file tree
Hide file tree
Showing 4 changed files with 92 additions and 16 deletions.
24 changes: 24 additions & 0 deletions components/navbar.vue
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,9 @@
{{ link.text }}
</ZeroButton>
</div>

<slot></slot>

</nav>
</div>
</template>
Expand All @@ -34,6 +37,27 @@ const props = defineProps({
flex-direction: column;
justify-content: center;
height: 100%;
&.mobile {
.navigation {
flex-direction: column;
}
.nav-item {
justify-content: center;
&:not(:last-child) {
margin-bottom: toRem(40);
}
}
.nav-link {
@include hamburgerCTA;
&:hover {
transform: none;
&:before,
&:after {
display: none;
}
}
}
}
}
.navigation {
Expand Down
77 changes: 62 additions & 15 deletions components/site-header.vue
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,19 @@
<div class="grid">
<div class="col-12">
<div class="mobile-nav">
<Navbar :links="navigation" class="mobile" />
<Navbar
:links="navigation"
class="mobile">
<div class="nav-item">
<ButtonCta
tag="nuxt-link"
to="/"
theme="primary"
class="modal-sign-up-cta">
Sign up
</ButtonCta>
</div>
</Navbar>
</div>
</div>
</div>
Expand Down Expand Up @@ -137,8 +149,13 @@ const getCtaComponent = (icon) => {
flex-direction: column;
justify-content: center;
align-items: center;
// height: $siteHeaderHeight;
padding: 2rem 0;
@include small {
position: absolute;
width: 100%;
height: $siteHeaderHeight;
z-index: 2;
}
@include mini {
padding: 1.25rem 0;
}
Expand All @@ -150,8 +167,11 @@ const getCtaComponent = (icon) => {
.mobile-background-panel {
z-index: 1001;
}
.nav-toggle-wrapper {
top: 0.5rem;
.nav-ctas {
:deep(.theme__icon) {
opacity: 0;
pointer-events: none;
}
}
}
}
Expand Down Expand Up @@ -224,6 +244,9 @@ const getCtaComponent = (icon) => {
display: none;
}
}
// &.mobile {
// .navigation {}
// }
}
.nav-ctas {
Expand Down Expand Up @@ -356,10 +379,7 @@ const getCtaComponent = (icon) => {
// ////////////////////////////////////////////////////////////////////// Mobile
.mobile-nav {
padding-top: toRem(200);
@include mini {
padding-top: toRem(162);
}
padding-top: toRem(96);
}
.mobile-background-panel {
Expand All @@ -373,19 +393,46 @@ const getCtaComponent = (icon) => {
visibility: hidden;
transform: scale(1.1);
opacity: 0;
&:before {
content: '';
position: absolute;
top: 0;
left: 0;
width: 100%;
height: 100%;
background-image: url('/images/ring-of-circular-cross-sections.png');
background-size: toRem(735);
background-position: center toRem(300);
background-repeat: no-repeat;
}
&.open {
opacity: 1;
visibility: visible;
transform: scale(1);
z-index: 1000;
}
// :deep(.navigation) {
// .nav-item {
// }
// .nav-link {
.nav-item {
display: flex;
justify-content: center;
}
}
// }
// }
.modal-sign-up-cta {
height: toRem(55);
:deep(.inner-content) {
height: 100%;
padding: toRem(9) toRem(46) toRem(9) toRem(23);
.detail {
transform: scale(1.36);
top: 7px;
right: calc(100% + 3px);
path {
stroke-width: 1.5;
}
}
}
:deep(.button-content) {
@include hamburgerCTA;
}
}
</style>
2 changes: 1 addition & 1 deletion content/core/index.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
"ctas": [
{
"text": "Sign up",
"to": "",
"to": "/",
"tag": "nuxt-link",
"theme": "primary"
},
Expand Down
5 changes: 5 additions & 0 deletions pages/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -25,11 +25,16 @@ const sections = computed(() => {
<style lang="scss" scoped>
// ///////////////////////////////////////////////////////////////////// General
.page {
position: relative;
flex: 1;
display: flex;
flex-direction: column;
justify-content: center;
align-items: center;
z-index: 1;
@include small {
padding-top: $siteHeaderHeight;
}
}
.top {
Expand Down

0 comments on commit 41d5f8c

Please sign in to comment.