Skip to content

Commit 8e71fe4

Browse files
committed
feat: customise layout
1 parent 1dac1da commit 8e71fe4

File tree

3 files changed

+132
-0
lines changed

3 files changed

+132
-0
lines changed
Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
<script setup lang="ts">
2+
const socialsLinks = [
3+
{
4+
icon: 'ri:github-fill',
5+
url: 'https://github.com/qwikifiers/qwik-storefront-ui',
6+
alt: 'Github',
7+
},
8+
];
9+
</script>
10+
<template>
11+
<footer
12+
class="mt-48 text-sm px-6 lg:px-12 2xl:max-w-7xl w-full flex items-center border-t py-4"
13+
>
14+
<div class="flex-1 text-md mt-0.5">
15+
<NuxtLink
16+
target="_blank"
17+
v-for="{ icon, url, alt } in socialsLinks"
18+
:key="url"
19+
:to="url"
20+
>
21+
<div class="flex">
22+
<span class="t-[5px] mr-2 hidden sm:block">qwik-storefront-ui</span>
23+
<Icon :name="icon" class="h-5 w-5" />
24+
</div>
25+
</NuxtLink>
26+
</div>
27+
<nav class="flex items-center mx-auto font-medium gap-x-8" />
28+
<div class="flex items-center gap-x-4 ml-auto flex-1 justify-end">
29+
<p>© 2023 Vue Storefront.</p>
30+
</div>
31+
</footer>
32+
</template>
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
<template>
2+
<span />
3+
</template>
Lines changed: 97 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,97 @@
1+
<script setup lang="ts">
2+
const isMobileMenuOpen = ref(false);
3+
const { page } = useContent();
4+
5+
const { storefrontUi } = useRuntimeConfig().public;
6+
</script>
7+
<template>
8+
<div>
9+
<div
10+
v-if="storefrontUi"
11+
class="w-full bg-secondary-500 px-6 py-2 flex justify-between items-center"
12+
>
13+
<Icon
14+
name="IconVsfFull"
15+
width="10rem"
16+
height="2.5rem"
17+
class="[&>*]:!fill-white"
18+
/>
19+
<NuxtLink
20+
to="https://qwik.builder.io/"
21+
class="font-xl flex items-center text-sm group text-white"
22+
>
23+
<svg
24+
viewBox="0 0 500 506"
25+
fill="none"
26+
xmlns="http://www.w3.org/2000/svg"
27+
class="w-8 h-8 my-2 mr-2"
28+
>
29+
<path
30+
fill-rule="evenodd"
31+
clip-rule="evenodd"
32+
d="M250 449.707L431.102 505.511L343.037 423.652L129.174 224.859L179.178 174.86L156.157 16.117L8.34822 193.702C-2.78296 212.982 -2.78273 236.736 8.34883 256.016L102.191 418.551C113.323 437.831 133.894 449.707 156.156 449.707L250 449.707Z"
33+
fill="#18B6F6"
34+
/>
35+
<path
36+
d="M343.843 0L156.157 1.74069e-05C133.894 1.94717e-05 113.323 11.8771 102.192 31.1573L8.34822 193.702L156.157 16.117L370.826 224.859L330.828 264.86L343.037 423.652L431.102 505.511C436.18 507.075 440.635 501.755 438.204 497.031L397.809 418.551L491.651 256.016C502.783 236.736 502.783 212.982 491.652 193.702L397.808 31.1572C386.677 11.8771 366.106 -2.06475e-06 343.843 0Z"
37+
fill="#AC7EF4"
38+
/>
39+
<path
40+
d="M370.826 224.859L156.157 16.117L179.178 174.86L129.174 224.859L343.037 423.652L330.828 264.86L370.826 224.859Z"
41+
fill="white"
42+
/>
43+
</svg>
44+
<span class="text-xl font-bold">Qwik</span>
45+
</NuxtLink>
46+
</div>
47+
48+
<div
49+
class="mx-auto min-h-screen text-neutral-900 dark:text-[var(--tw-prose-body)] antialiased relative flex mr-0"
50+
>
51+
<AppSidebar
52+
class="max-lg:fixed lg:relative grow-0 max-lg:top-0 max-lg:left-0 max-lg:z-[100] max-lg:h-full bg-white dark:bg-neutral-950 min-h-screen"
53+
:class="{
54+
'max-lg:hidden': !isMobileMenuOpen,
55+
}"
56+
:mobile-menu-open="isMobileMenuOpen"
57+
@close="isMobileMenuOpen = false"
58+
/>
59+
60+
<div
61+
class="flex flex-col items-center flex-1 border-b-2 min-w-0 max-w-full"
62+
>
63+
<AppHeader class="sticky top-0 bg-white dark:bg-neutral-950 z-50" />
64+
65+
<div
66+
class="flex items-center lg:hidden text-left border-b w-full px-6 py-2 text-sm gap-x-2 sticky top-[57px] bg-white dark:bg-neutral-950 z-40"
67+
>
68+
<button @click="isMobileMenuOpen = true">
69+
<Icon name="ri:menu-2-fill" class="text-lg" />
70+
</button>
71+
<span>
72+
{{ page?.title }}
73+
</span>
74+
</div>
75+
<div
76+
class="flex justify-center px-6 lg:px-12 py-4 2xl:max-w-7xl w-full mx-auto shrink-0 min-h-screen min-w-0"
77+
>
78+
<slot />
79+
</div>
80+
<ClientOnly>
81+
<AppEdit />
82+
</ClientOnly>
83+
<AppFooter />
84+
</div>
85+
</div>
86+
</div>
87+
</template>
88+
89+
<style>
90+
.dark {
91+
@apply bg-neutral-950;
92+
}
93+
94+
.document-driven-page {
95+
@apply w-full;
96+
}
97+
</style>

0 commit comments

Comments
 (0)