Skip to content

Commit

Permalink
Add (mobile) header (#38)
Browse files Browse the repository at this point in the history
* Add button reset styles to globals

* Upgrade SDK

* Add dark logo

* Fetch menu data in header

* Remove reset file

* order

* Add togglable sections

* Improvise a mobile nav

* Finish first take on mobile nav

* Fix type issues

* Banner before header please

* wip

* Add some space
  • Loading branch information
rijkvanzanten authored Jul 27, 2023
1 parent 0ad32f8 commit 5a0bc7e
Show file tree
Hide file tree
Showing 12 changed files with 335 additions and 109 deletions.
11 changes: 10 additions & 1 deletion assets/css/global.css
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,8 @@ svg {
}

input,
button,
textarea,
button,
select {
font: inherit;
}
Expand All @@ -41,3 +41,12 @@ h6 {
a {
color: var(--primary);
}

button {
all: unset;
line-height: 0;
}

button:focus {
outline: revert;
}
74 changes: 0 additions & 74 deletions assets/css/reset.css

This file was deleted.

11 changes: 11 additions & 0 deletions assets/svg/logo-dark.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
7 changes: 5 additions & 2 deletions components/Block/MediaFullWidth.vue
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,11 @@ const { data: block } = useAsyncData(props.uuid, () =>
);
const imgSrc = computed(() => {
if (unref(block)?.type !== 'image') return null;
return getFileUrl(unref(block)!.image.id);
const type = unref(block)?.type;
const imageId = unref(block)?.image?.id;
if (type !== 'image' || !imageId) return null;
return getFileUrl(imageId);
});
</script>

Expand Down
5 changes: 4 additions & 1 deletion components/Block/Showcase.vue
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,10 @@ const handleClick = (itemIdx: number) => {
const startTimer = () => {
timer = setInterval(() => {
selectedIdx.value = (selectedIdx.value + 1) % (unref(block)?.items.length ?? 0);
const items = unref(block)?.items;
if (!items) return;
selectedIdx.value = (selectedIdx.value + 1) % items.length;
}, timerLength);
};
Expand Down
4 changes: 2 additions & 2 deletions components/Comp/Media.vue
Original file line number Diff line number Diff line change
Expand Up @@ -20,12 +20,12 @@ const { data: comp } = useAsyncData(props.uuid, () =>
)
);
const imageUrl = computed(() => getFileUrl(unref(comp)?.image.id));
const imageUrl = computed(() => getFileUrl(unref(comp)?.image?.id));
</script>

<template>
<BaseFrame variant="frosted" color="white">
<BaseVideo v-if="comp?.type === 'video' && comp.video.url" :url="comp.video.url" />
<BaseVideo v-if="comp?.type === 'video' && comp.video?.url" :url="comp.video.url" />
<img v-else-if="comp?.type === 'image' && comp.image" :src="imageUrl" :alt="comp.image.description ?? undefined" />
<!-- eslint-disable-next-line vue/no-v-html -->
<div v-else-if="comp?.type === 'embed'" v-html="comp.embed" />
Expand Down
29 changes: 9 additions & 20 deletions components/Nav/Banner.vue
Original file line number Diff line number Diff line change
Expand Up @@ -27,17 +27,15 @@ const dismiss = (id: string) => {
</script>

<template>
<ClientOnly>
<BaseContainer v-if="banner && bannerVisible" class="banner-container">
<NuxtLink class="banner" :href="banner.link ?? undefined">
<BaseIcon v-if="banner.icon" :name="banner.icon" size="small" />
<!-- eslint-disable-next-line vue/no-v-html -->
<span class="content" v-html="banner.content" />
<BaseIcon class="arrow" name="arrow_forward" size="small" />
<button class="dismiss" @click="dismiss(banner.id)"><BaseIcon name="close" size="small" /></button>
</NuxtLink>
</BaseContainer>
</ClientOnly>
<BaseContainer v-if="banner && bannerVisible" class="banner-container">
<NuxtLink class="banner" :href="banner.link ?? undefined">
<BaseIcon v-if="banner.icon" :name="banner.icon" size="small" />
<!-- eslint-disable-next-line vue/no-v-html -->
<span class="content" v-html="banner.content" />
<BaseIcon class="arrow" name="arrow_forward" size="small" />
<button class="dismiss" @click="dismiss(banner.id)"><BaseIcon name="close" size="small" /></button>
</NuxtLink>
</BaseContainer>
</template>
<style scoped lang="scss">
Expand Down Expand Up @@ -66,15 +64,6 @@ const dismiss = (id: string) => {
text-decoration: underline;
}
button {
all: unset;
line-height: 0;
&:focus {
outline: revert;
}
}
.base-icon {
--base-icon-color: var(--white);
}
Expand Down
Loading

0 comments on commit 5a0bc7e

Please sign in to comment.