Skip to content

Commit

Permalink
Merge pull request #33 from happydesigns/feat/content-3
Browse files Browse the repository at this point in the history
feat: update to Nuxt UI 3 and Content 3
  • Loading branch information
janfrl authored Jan 30, 2025
2 parents 07704d8 + 5a0248d commit 6222794
Show file tree
Hide file tree
Showing 36 changed files with 3,258 additions and 2,781 deletions.
2 changes: 0 additions & 2 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,6 @@
"editor.quickSuggestions": {
"strings": true
},
// Enable the ESlint flat config support
"eslint.experimental.useFlatConfig": true,

// Disable the default formatter, use eslint instead
"prettier.enable": false,
Expand Down
26 changes: 17 additions & 9 deletions app/app.config.ts
Original file line number Diff line number Diff line change
@@ -1,29 +1,37 @@
export default defineAppConfig({
ui: {
primary: 'red',
gray: 'zinc',
colors: {
primary: 'red',
neutral: 'zinc',
},
button: {
variant: {
solid: 'bg-primary-900 hover:bg-primary-800 disabled:bg-primary-900 focus-visible:outline-primary-800',
},
},
},
uiPro: {
footer: {
wrapper: 'bg-cool-800 dark:bg-cool-800',
menu: { background: 'dark:bg-cool-800', option: { active: 'dark:bg-cool-900' } },
wave: 'fill-cool-800 dark:fill-raisinCool',
columns: {
wrapper: 'xl:grid-cols-5',
slots: {
root: 'bg-gradient-to-b from-gray-800 to-raisin-cool dark:from-raisin-cool dark:to-raisin-cool',
container: 'dark',
top: 'dark border-b border-neutral-200 dark:border-gray-700',
wave: 'bg-gray-800 dark:bg-raisin-cool fill-white dark:fill-neutral-900',
},
},
footerColumns: {
slots: {
root: 'xl:grid-cols-5',
center: 'xl:col-span-3',
right: 'xl:col-span-2',
},
},

},
links: {
header: [
{
label: 'Über uns',
icon: 'i-ph-user-duotone',
icon: 'i-ph-users-duotone',
to: '/ueber-uns',
},
{
Expand Down
29 changes: 21 additions & 8 deletions app/app.vue
Original file line number Diff line number Diff line change
Expand Up @@ -18,13 +18,23 @@ useSeoMeta({
description: 'Steingestaltung in Neudenau: Grabmale, Restaurierungen und mehr.',
})
const { page } = useContent()
const route = useRoute()
const { data: page } = await useAsyncData(
route.path,
() => queryCollection('content').path(route.path).first(),
{
watch: [route],
},
)
</script>

<template>
<AppHeader :ui="page?.ui?.header" />
<NuxtPage />
<AppFooter :ui="page?.ui?.footer" />
<UApp>
<AppHeader :ui="page?.ui?.header" />
<NuxtPage />
<AppFooter :ui="page?.ui?.footer" />
</UApp>
<span class="display-none lg:col-span-5 fill-neutral-100 dark:fill-raisin pb-0 sm:pb-0 lg:pb-0 bg-gradient-to-b from:gray-800 to:raisin-cool" />
</template>

<style>
Expand All @@ -43,18 +53,21 @@ h3,
h4,
h5,
h6 {
@apply font-serif;
font-family: var(--font-serif);
}
img.default {
@apply rounded-md border border-gray-200 dark:border-gray-800;
border: 1px solid var(--color-neutral-200);
}
p .iconify {
@apply inline-block align-middle mb-0.5 mr-1;
display: inline-block;
vertical-align: middle;
margin-bottom: calc(var(--spacing) * 0.5);
margin-right: var(--spacing);
}
footer p .iconify {
@apply text-base;
font-size: var(--text-base);
}
</style>
69 changes: 69 additions & 0 deletions app/assets/css/main.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
@import "tailwindcss";
@import "@nuxt/ui-pro";

@theme {
/* Fonts */
--font-serif: 'Lora';
--font-sans: 'Lato';

/* Colors */
--color-red-50: #fef1f4;
--color-red-100: #fcdee5;
--color-red-200: #fac2cd;
--color-red-300: #f693a7;
--color-red-400: #f05678;
--color-red-500: #ec224e;
--color-red-600: #eb1443;
--color-red-700: #d3123c;
--color-red-800: #ae0f31;
--color-red-900: #750019;
--color-red-950: #570013;

--color-primary-50: var(--ui-color-primary-50);
--color-primary-100: var(--ui-color-primary-100);
--color-primary-200: var(--ui-color-primary-200);
--color-primary-300: var(--ui-color-primary-300);
--color-primary-400: var(--ui-color-primary-400);
--color-primary-500: var(--ui-color-primary-500);
--color-primary-600: var(--ui-color-primary-600);
--color-primary-700: var(--ui-color-primary-700);
--color-primary-800: var(--ui-color-primary-800);
--color-primary-900: var(--ui-color-primary-900);
--color-primary-950: var(--ui-color-primary-950);

--color-neutral-50: var(--ui-color-neutral-50);
--color-neutral-100: var(--ui-color-neutral-100);
--color-neutral-200: var(--ui-color-neutral-200);
--color-neutral-300: var(--ui-color-neutral-300);
--color-neutral-400: var(--ui-color-neutral-400);
--color-neutral-500: var(--ui-color-neutral-500);
--color-neutral-600: var(--ui-color-neutral-600);
--color-neutral-700: var(--ui-color-neutral-700);
--color-neutral-800: var(--ui-color-neutral-800);
--color-neutral-900: var(--ui-color-neutral-900);
--color-neutral-950: var(--ui-color-neutral-950);

--color-raisin: #1d1f25;
--color-raisin-cool: #242A32;

--ui-primary: var(--color-primary-900);

/* Sizing */
--radius: var(--radius-sm);
--ui-radius: var(--radius);
}

@layer theme {
.dark {
--ui-primary: var(--color-primary-400);
color: var(--ui-text);
}

:root {
figcaption {
color: var(--ui-text-muted);
font-size: var(--text-sm);
margin-top: calc(var(--spacing) * 3);
}
}
}
100 changes: 54 additions & 46 deletions app/components/AppFooter.vue
Original file line number Diff line number Diff line change
@@ -1,71 +1,79 @@
<script setup lang="ts">
import type { FooterProps } from '@nuxt/ui-pro'
import { tv } from 'tailwind-variants'
type FooterUiProps = Partial<FooterProps['ui'] & {
wave: string
columns: any
}>
const props = withDefaults(defineProps<{
ui?: Partial<typeof config>
class?: any
ui?: FooterUiProps
class?: string
}>(), {
ui: () => ({}),
class: undefined,
})
const appConfig = useAppConfig()
const config = {
wrapper: '',
menu: {},
wave: '',
}
const footer = tv({
slots: appConfig.uiPro?.footer?.slots || {},
extend: props.ui,
})
const footerColumns = tv({
slots: appConfig.uiPro?.footerColumns?.slots || {},
extend: props.ui?.columns,
})
const { ui, attrs } = useUI('footer', toRef(props, 'ui'), config, toRef(props, 'class'), true)
const ui = footer({ class: props.class })
const columnsUi = footerColumns()
</script>

<!-- eslint-disable vue/no-extra-parens -->
<template>
<div v-bind="attrs" :class="props.class">
<Wave class="rotate-180" :class="ui.wave" />
<UFooter
:ui="{
wrapper: 'dark dark:bg-raisinCool',
bottom: { wrapper: 'border-t border-gray-200 dark:border-cool-700', container: '!py-6', left: '~', center: '~', right: '~' },
top: { wrapper: '', container: 'py-8 lg:py-12' },
}"
>
<div>
<Wave :class="ui.wave?.({ class: props.ui?.wave })" />
<UFooter>
<template #top>
<UFooterColumns :links="appConfig.links?.footer">
<template #right>
<div class="flex flex-col lg:grid grid-flow-col auto cols-fr gap-8 xl:col-span-2 grid-cols-3 xl:grid-cols-none text-gray-600 dark:text-gray-300 text-sm">
<div class="space-y-4">
<h3 class="font-semibold text-gray-900 dark:text-white mb-6">
Anschrift
</h3>
<p>Bernd Siegel<br>Steingestaltung</p>
<p>Bahnhofstraße 13<br>74861 Neudenau</p>
</div>
<div class="space-y-4">
<h3 class="text-sm font-semibold text-gray-900 dark:text-white mb-6">
Kontakt
</h3>
<p>
<UIcon name="i-ph-phone-fill" /> 06264 / 92 64 44<br>
<UIcon name="i-ph-printer-fill" /> 06264 / 92 64 45<br>
</p>
<p>
<UIcon name="i-ph-envelope-fill" /> [email protected]
</p>
<UContainer>
<UFooterColumns :columns="appConfig.links?.footer">
<template #right>
<div class="flex flex-col lg:grid grid-flow-col auto cols-fr gap-8 xl:col-span-2 grid-cols-3 xl:grid-cols-none text-gray-600 dark:text-gray-300 text-sm prose">
<div :class="columnsUi.center?.()">
<h3 class="font-semibold text-neutral-900 dark:text-white mb-6">
Anschrift
</h3>
<ProseP>Bernd Siegel<br>Steingestaltung</ProseP>
<ProseP>Bahnhofstraße 13<br>74861 Neudenau</ProseP>
</div>
<div :class="columnsUi.right?.()">
<h3 class="text-sm font-semibold text-neutral-900 dark:text-white mb-6">
Kontakt
</h3>
<ProseP>
<UIcon name="i-ph-phone-fill" /> 06264 / 92 64 44<br>
<UIcon name="i-ph-printer-fill" /> 06264 / 92 64 45<br>
</ProseP>
<ProseP>
<UIcon name="i-ph-envelope-fill" /> [email protected]
</ProseP>
</div>
</div>
</div>
</template>
</UFooterColumns>
</template>
</UFooterColumns>
</UContainer>
</template>
<template #left>
<p class="text-gray-500 dark:text-gray-400 text-sm">
<p class="text-neutral-500 dark:text-neutral-400 text-sm">
Copyright © {{ new Date().getFullYear() }}
<NuxtLink to="https://www.happydesigns.de/" target="_blank">
<ULink to="https://www.happydesigns.de/" target="_blank">
happydesigns
</NuxtLink>
</ULink>
</p>
</template>
<template #right>
<UColorModeSelect class="w-32" select-class="dark:bg-inherit" :ui-menu="ui.menu" />
<UColorModeSelect :ui="{ base: 'w-32 dark:bg-raisin-cool', content: 'dark:bg-raisin-cool' }" />
</template>
</UFooter>
</div>
Expand Down
20 changes: 11 additions & 9 deletions app/components/AppHeader.vue
Original file line number Diff line number Diff line change
Expand Up @@ -3,19 +3,21 @@ const appConfig = useAppConfig()
</script>

<template>
<UHeader :links="appConfig.links.header">
<template #logo>
<Logo class="w-auto h-12 dark:bg-white rounded-md p-1" />
<UHeader>
<template #title>
<Logo class="w-auto h-12 dark:bg-white rounded p-1" />
</template>

<template #panel>
<UAsideLinks :links="appConfig.links.header" :ui="{ active: 'text-primary-900 dark:text-primary-400', icon: { active: 'bg-primary-900 dark:bg-primary', inactive: 'group-hover:bg-primary-900 dark:group-hover:bg-primary', wrapper: '~', base: '~' } }" />
<UDivider class="my-6" />
<UButton to="/kontakt" label="Kontakt" icon="i-ph-phone-duotone" block />
</template>
<UNavigationMenu :items="appConfig.links.header" />

<template #right>
<UButton to="/kontakt" label="Kontakt" color="black" class="hidden lg:flex" icon="i-ph-phone-duotone" />
<UButton to="/kontakt" label="Kontakt" color="neutral" class="hidden lg:flex" icon="i-ph-phone-duotone" />
</template>

<template #content>
<UNavigationMenu :items="appConfig.links.header" orientation="vertical" />
<USeparator class="my-6" />
<UButton to="/kontakt" label="Kontakt" icon="i-ph-phone-duotone" block />
</template>
</UHeader>
</template>
Loading

0 comments on commit 6222794

Please sign in to comment.