Skip to content

Commit 5c86616

Browse files
committed
Imårove mobile design
1 parent 2a33288 commit 5c86616

File tree

7 files changed

+248
-25
lines changed

7 files changed

+248
-25
lines changed

components/Layout/LayoutCart.vue

Lines changed: 19 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -5,28 +5,38 @@
55
>Error fetching cart. Please refresh the page.</span
66
>
77
</div>
8-
<div v-else>
8+
<div v-else class="mt-4 lg:mt-0">
99
<NuxtLink to="/cart">
1010
<transition name="cart">
1111
<span
1212
v-if="cartLength"
1313
class="text-xl text-white no-underline lg:text-black is-active"
1414
>
15-
<img
16-
alt="Cart icon"
17-
class="h-12 ml-4 lg:ml-2"
18-
aria-label="Cart"
19-
src="~/assets/svg/Cart.svg"
20-
/></span>
15+
<span class="hidden lg:block">
16+
<img
17+
alt="Cart icon"
18+
class="h-12 ml-4 lg:ml-2"
19+
aria-label="Cart"
20+
src="~/assets/svg/Cart.svg"
21+
/>
22+
</span>
23+
<span class="block lg:hidden">
24+
<Icon
25+
name="ri:shopping-cart-2-line"
26+
size="3em"
27+
class="text-white lg:text-black"
28+
/>
29+
</span>
30+
</span>
2131
</transition>
2232
<transition name="cart">
2333
<div v-if="cartLength">
2434
<span
25-
class="absolute w-6 h-6 pb-2 ml-16 -mt-12 text-center text-white bg-black rounded-full lg:ml-14"
35+
class="absolute w-6 h-6 pb-2 ml-16 -mt-12 text-center text-black bg-white lg:text-white lg:bg-black rounded-full lg:ml-14"
2636
>
2737
{{ cartLength }}
2838
</span>
29-
<span>Total: {{ subTotal }}</span>
39+
<span class="text-white lg:text-black">Total: {{ subTotal }}</span>
3040
</div>
3141
</transition>
3242
</NuxtLink>

components/Layout/LayoutMobileMenu.vue

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
<div class="relative">
33
<div
44
v-if="!firstRender"
5-
class="fixed top-0 left-0 w-screen mt-40 bg-white h-full animate__animated z-50"
5+
class="fixed top-0 left-0 h-[650px] w-screen mt-40 bg-white animate__animated z-50"
66
:class="{
77
animate__fadeInLeft: expandedMenu,
88
animate__fadeOutRight: !expandedMenu && !firstRender,
@@ -25,19 +25,14 @@
2525
<li class="text-xl linkStyle">
2626
<NuxtLink to="/search" @click="displayMobileMenu"> Search </NuxtLink>
2727
</li>
28-
<li class="flex justify-center mt-6 text-lg linkStyleCart">
29-
<NuxtLink to="/cart" @click="displayMobileMenu">
30-
<LayoutCart />
31-
</NuxtLink>
32-
</li>
3328
</ul>
3429
</div>
3530
<div class="w-5/12 lg:hidden" />
3631
<div class="flex flex-row w-2/12 px-2 my-2 lg:hidden">
3732
<div class="self-center block w-full mr-4">
3833
<button
3934
id="nav-toggle"
40-
class="mt-6 burger burger-squeeze"
35+
class="mt-2 burger burger-squeeze"
4136
aria-haspopup="true"
4237
:aria-expanded="expandedMenu"
4338
aria-controls="menu"
@@ -80,6 +75,7 @@ const displayMobileMenu = () => {
8075
font-size: 14px;
8176
cursor: pointer;
8277
transition: 0.5s all;
78+
8379
-webkit-tap-highlight-color: transparent;
8480
}
8581
.burger .burger-lines:after {
@@ -111,7 +107,7 @@ const displayMobileMenu = () => {
111107
content: "";
112108
width: 100%;
113109
border-radius: 0.25em;
114-
background-color: #000;
110+
background-color: #fff;
115111
height: 0.25em;
116112
position: absolute;
117113
transform: rotate(0);
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
<template>
2+
<nav
3+
id="footer"
4+
class="fixed bottom-0 z-50 w-full md:hidden lg:hidden xl:hidden"
5+
>
6+
<div
7+
class="container flex flex-wrap items-center justify-between px-6 py-3 mx-auto mt-0 md:min-w-96 bg-blue-800"
8+
>
9+
<LayoutMobileMenu />
10+
<div
11+
class="order-3 hidden w-full md:flex md:items-center md:w-auto md:order-1"
12+
id="menu"
13+
></div>
14+
<div class="flex items-center order-2 md:order-3" id="nav-content">
15+
<LayoutCart />
16+
</div>
17+
</div>
18+
</nav>
19+
</template>

layouts/default.vue

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
<slot />
66
</div>
77
<LayoutFooter />
8+
<LayoutStickyFooter />
89
</div>
910
</template>
1011

nuxt.config.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ export default defineNuxtConfig({
1111
"@nuxtjs/apollo",
1212
"@formkit/nuxt",
1313
"@nuxtjs/algolia",
14+
"nuxt-icon",
1415
],
1516
plugins: ["~/plugins/apollo"],
1617
runtimeConfig: {

0 commit comments

Comments
 (0)