feat(ui): basic layout

This commit is contained in:
2025-12-07 21:27:23 +01:00
parent dc67c1c16a
commit 4e9b4a19b8
16 changed files with 198 additions and 187 deletions

View File

@@ -7,67 +7,21 @@ useHead({
},
});
const title = 'Nuxt Starter Template';
const title = 'Tímmál - Privacy-First Time Tracking';
const description =
'A production-ready starter template powered by Nuxt UI. Build beautiful, accessible, and performant applications in minutes, not hours.';
'Track time spent on tickets, generate Excel-compatible reports, and streamline your work report workflow. Built for developers and consultants who value privacy and accuracy.';
useSeoMeta({
title,
description,
ogTitle: title,
ogDescription: description,
ogImage: 'https://ui.nuxt.com/assets/templates/nuxt/starter-light.png',
twitterImage: 'https://ui.nuxt.com/assets/templates/nuxt/starter-light.png',
twitterCard: 'summary_large_image',
});
</script>
<template>
<UApp>
<UHeader>
<template #left>
<NuxtLink to="/">
<AppLogo class="w-auto h-6 shrink-0" />
</NuxtLink>
<TemplateMenu />
</template>
<template #right>
<UColorModeButton />
<UButton
to="https://github.com/nuxt-ui-templates/starter"
target="_blank"
icon="i-simple-icons-github"
aria-label="GitHub"
color="neutral"
variant="ghost"
/>
</template>
</UHeader>
<UMain>
<NuxtLayout>
<NuxtPage />
</UMain>
<USeparator icon="i-simple-icons-nuxtdotjs" />
<UFooter>
<template #left>
<p class="text-sm text-muted">Built with Nuxt UI © {{ new Date().getFullYear() }}</p>
</template>
<template #right>
<UButton
to="https://github.com/nuxt-ui-templates/starter"
target="_blank"
icon="i-simple-icons-github"
aria-label="GitHub"
color="neutral"
variant="ghost"
/>
</template>
</UFooter>
</UApp>
</NuxtLayout>
</template>

View File

@@ -1,34 +1,3 @@
<template>
<svg width="1020" height="200" viewBox="0 0 1020 200" fill="none" xmlns="http://www.w3.org/2000/svg">
<path
d="M377 200C379.16 200 381 198.209 381 196V103C381 103 386 112 395 127L434 194C435.785 197.74 439.744 200 443 200H470V50H443C441.202 50 439 51.4941 439 54V148L421 116L385 55C383.248 51.8912 379.479 50 376 50H350V200H377Z"
fill="currentColor"
/>
<path
d="M726 92H739C742.314 92 745 89.3137 745 86V60H773V92H800V116H773V159C773 169.5 778.057 174 787 174H800V200H783C759.948 200 745 185.071 745 160V116H726V92Z"
fill="currentColor"
/>
<path
d="M591 92V154C591 168.004 585.742 179.809 578 188C570.258 196.191 559.566 200 545 200C530.434 200 518.742 196.191 511 188C503.389 179.809 498 168.004 498 154V92H514C517.412 92 520.769 92.622 523 95C525.231 97.2459 526 98.5652 526 102V154C526 162.059 526.457 167.037 530 171C533.543 174.831 537.914 176 545 176C552.217 176 555.457 174.831 559 171C562.543 167.037 563 162.059 563 154V102C563 98.5652 563.769 96.378 566 94C567.96 91.9107 570.028 91.9599 573 92C573.411 92.0055 574.586 92 575 92H591Z"
fill="currentColor"
/>
<path
d="M676 144L710 92H684C680.723 92 677.812 93.1758 676 96L660 120L645 97C643.188 94.1758 639.277 92 636 92H611L645 143L608 200H634C637.25 200 640.182 196.787 642 194L660 167L679 195C680.818 197.787 683.75 200 687 200H713L676 144Z"
fill="currentColor"
/>
<path
d="M168 200H279C282.542 200 285.932 198.756 289 197C292.068 195.244 295.23 193.041 297 190C298.77 186.959 300.002 183.51 300 179.999C299.998 176.488 298.773 173.04 297 170.001L222 41C220.23 37.96 218.067 35.7552 215 34C211.933 32.2448 207.542 31 204 31C200.458 31 197.067 32.2448 194 34C190.933 35.7552 188.77 37.96 187 41L168 74L130 9.99764C128.228 6.95784 126.068 3.75491 123 2C119.932 0.245087 116.542 0 113 0C109.458 0 106.068 0.245087 103 2C99.9323 3.75491 96.7717 6.95784 95 9.99764L2 170.001C0.226979 173.04 0.00154312 176.488 1.90993e-06 179.999C-0.0015393 183.51 0.229648 186.959 2 190C3.77035 193.04 6.93245 195.244 10 197C13.0675 198.756 16.4578 200 20 200H90C117.737 200 137.925 187.558 152 164L186 105L204 74L259 168H186L168 200ZM89 168H40L113 42L150 105L125.491 147.725C116.144 163.01 105.488 168 89 168Z"
fill="var(--ui-primary)"
/>
<path
d="M958 60.0001H938C933.524 60.0001 929.926 59.9395 927 63C924.074 65.8905 925 67.5792 925 72V141C925 151.372 923.648 156.899 919 162C914.352 166.931 908.468 169 899 169C889.705 169 882.648 166.931 878 162C873.352 156.899 873 151.372 873 141V72.0001C873 67.5793 872.926 65.8906 870 63.0001C867.074 59.9396 863.476 60.0001 859 60.0001H840V141C840 159.023 845.016 173.458 855 184C865.156 194.542 879.893 200 899 200C918.107 200 932.844 194.542 943 184C953.156 173.458 958 159.023 958 141V60.0001Z"
fill="var(--ui-primary)"
/>
<path
fill-rule="evenodd"
clip-rule="evenodd"
d="M1000 60.0233L1020 60V77L1020 128V156.007L1020 181L1020 189.004C1020 192.938 1019.98 194.429 1017 197.001C1014.02 199.725 1009.56 200 1005 200H986.001V181.006L986 130.012V70.0215C986 66.1576 986.016 64.5494 989 62.023C991.819 59.6358 995.437 60.0233 1000 60.0233Z"
fill="var(--ui-primary)"
/>
</svg>
<NuxtLink to="/"> <span class="text-xl"> Tímmál </span> </NuxtLink>
</template>

View File

@@ -0,0 +1,5 @@
<template>
<UUser name="name" description="email" />
</template>
<script lang="ts" setup></script>

View File

@@ -1,58 +0,0 @@
<template>
<UDropdownMenu
v-slot="{ open }"
:modal="false"
:items="[
{
label: 'Starter',
to: 'https://starter-template.nuxt.dev/',
color: 'primary',
checked: true,
type: 'checkbox',
},
{
label: 'Landing',
to: 'https://landing-template.nuxt.dev/',
},
{
label: 'Docs',
to: 'https://docs-template.nuxt.dev/',
},
{
label: 'SaaS',
to: 'https://saas-template.nuxt.dev/',
},
{
label: 'Dashboard',
to: 'https://dashboard-template.nuxt.dev/',
},
{
label: 'Chat',
to: 'https://chat-template.nuxt.dev/',
},
{
label: 'Portfolio',
to: 'https://portfolio-template.nuxt.dev/',
},
{
label: 'Changelog',
to: 'https://changelog-template.nuxt.dev/',
},
]"
:content="{ align: 'start' }"
:ui="{ content: 'min-w-fit' }"
size="xs"
>
<UButton
label="Starter"
variant="subtle"
trailing-icon="i-lucide-chevron-down"
size="xs"
class="-mb-[6px] font-semibold rounded-full truncate"
:class="[open && 'bg-primary/15']"
:ui="{
trailingIcon: ['transition-transform duration-200', open ? 'rotate-180' : undefined].filter(Boolean).join(' '),
}"
/>
</UDropdownMenu>
</template>

View File

@@ -0,0 +1,3 @@
<template>
<UButton color="neutral" variant="ghost" icon="i-lucide-log-out" size="xl"> Log Out </UButton>
</template>

View File

@@ -0,0 +1,39 @@
<template>
<UDashboardSidebar collapsible resizable :ui="{ footer: 'border-t border-default' }">
<template #header>
<AppUser class="w-full" />
</template>
<template #default="{ collapsed }">
<UNavigationMenu :collapsed="collapsed" :items="items" orientation="vertical" />
</template>
<template #footer>
<UiLogout class="w-full" />
</template>
</UDashboardSidebar>
</template>
<script setup lang="ts">
import type { NavigationMenuItem } from '@nuxt/ui';
const route = useRoute();
const capitalise = (str: string) => str.charAt(0).toUpperCase() + str.slice(1);
const items = computed<NavigationMenuItem[]>(() => {
const items: { label?: string; path: string; icon: string }[] = [
{ path: 'dashboard', icon: 'i-lucide-layout-dashboard' },
{ path: 'projects', icon: 'i-lucide-folder' },
{ path: 'tasks', icon: 'i-lucide-circle-check' },
{ path: 'reports', icon: 'i-lucide-chart-no-axes-column' },
{ path: 'settings', icon: 'i-lucide-settings' },
];
return items.map(({ label, path, icon }) => ({
icon,
to: `/${path}`,
active: route.path === `/${path}`,
label: label ?? capitalise(path),
}));
});
</script>

View File

@@ -0,0 +1,15 @@
export const usePageTitle = () => {
const pageName = useState<string>('pageName', () => '');
const title = computed<string>(() => (pageName.value.length > 0 ? `${pageName.value} - Tímmál` : 'Tímmál'));
const setPageName = (newName: string) => {
pageName.value = newName;
useHead({ title: title.value });
};
return {
title: readonly(title),
pageName: readonly(pageName),
setPageName,
};
};

22
app/layouts/default.vue Normal file
View File

@@ -0,0 +1,22 @@
<template>
<UDashboardGroup>
<UiSidebar />
<UDashboardPanel>
<template #header>
<UDashboardNavbar :title="pageName">
<template #right>
<UColorModeButton />
</template>
</UDashboardNavbar>
<div class="flex flex-row content-center justify-between w-full" />
</template>
<template #body>
<slot />
</template>
</UDashboardPanel>
</UDashboardGroup>
</template>
<script setup lang="ts">
const { pageName } = usePageTitle();
</script>

View File

@@ -0,0 +1,23 @@
<template>
<UApp>
<UHeader>
<template #left>
<AppLogo />
</template>
<template #right>
<UColorModeButton />
</template>
</UHeader>
<UMain>
<slot />
</UMain>
<UFooter>
<template #left />
<template #right />
</UFooter>
</UApp>
</template>

8
app/pages/dashboard.vue Normal file
View File

@@ -0,0 +1,8 @@
<template>
<span> dashboard </span>
</template>
<script setup lang="ts">
const { setPageName } = usePageTitle();
setPageName('Dashboard');
</script>

View File

@@ -1,95 +1,83 @@
<template>
<div>
<UPageHero
title="Nuxt Starter Template"
description="A production-ready starter template powered by Nuxt UI. Build beautiful, accessible, and performant applications in minutes, not hours."
title="Tímmál"
description="A privacy-first work time tracking application. Track time spent on tickets, generate reports, and streamline your activity report workflow."
:links="[
{
label: 'Get started',
to: 'https://ui.nuxt.com/docs/getting-started/installation/nuxt',
target: '_blank',
label: 'Get Started',
to: '/dashboard',
trailingIcon: 'i-lucide-arrow-right',
size: 'xl',
},
{
label: 'Use this template',
to: 'https://github.com/nuxt-ui-templates/starter',
target: '_blank',
icon: 'i-simple-icons-github',
size: 'xl',
color: 'neutral',
variant: 'subtle',
},
]"
/>
<UPageSection
id="features"
title="Everything you need to build modern Nuxt apps"
description="Start with a solid foundation. This template includes all the essentials for building production-ready applications with Nuxt UI's powerful component system."
title="Track the time you spend on your tickets."
description="Built for developers and consultants who need to track billable hours across multiple projects and tasks. Seamlessly integrate with your existing workflow."
:features="[
{
icon: 'i-lucide-rocket',
title: 'Production-ready from day one',
icon: 'i-lucide-timer',
title: 'Smart Timer',
description:
'Pre-configured with TypeScript, ESLint, Tailwind CSS, and all the best practices. Focus on building features, not setting up tooling.',
'Start and stop timers on tasks with a single click. Timer persists across page refreshes and browser crashes, so you never lose tracking data.',
},
{
icon: 'i-lucide-palette',
title: 'Beautiful by default',
icon: 'i-lucide-calendar-clock',
title: 'Manual Entry',
description:
'Leveraging Nuxt UI\'s design system with automatic dark mode, consistent spacing, and polished components that look great out of the box.',
'Add time entries manually for forgotten work sessions. Automatic overlap detection ensures data integrity and prevents double-counting.',
},
{
icon: 'i-lucide-zap',
title: 'Lightning fast',
icon: 'i-lucide-table',
title: 'Excel-Compatible Reports',
description:
'Optimized for performance with SSR/SSG support, automatic code splitting, and edge-ready deployment. Your users will love the speed.',
'Generate time grid reports showing percentages of your workday (0.0-1.0). Copy directly into Excel for your CRA with tab-separated formatting.',
},
{
icon: 'i-lucide-blocks',
title: '100+ components included',
icon: 'i-lucide-shield',
title: 'Privacy-First',
description:
'Access Nuxt UI\'s comprehensive component library. From forms to navigation, everything is accessible, responsive, and customizable.',
'OAuth authentication with Google or Microsoft. Your data stays yours with Pocketbase backend. No third-party tracking or analytics.',
},
{
icon: 'i-lucide-code-2',
title: 'Developer experience first',
icon: 'i-lucide-workflow',
title: 'Project Organization',
description:
'Auto-imports, hot module replacement, and TypeScript support. Write less boilerplate and ship more features.',
'Group tasks by projects, track time per ticket, and view statistics. Tasks are sorted alphabetically within projects for easy navigation.',
},
{
icon: 'i-lucide-shield-check',
title: 'Built for scale',
title: 'Automatic Validation & Data Integrity',
description:
'Enterprise-ready architecture with proper error handling, SEO optimization, and security best practices built-in.',
'Prevents overlapping time entries, validates duration limits (max 24 hours), and ensures start times are before end times. Never submit invalid data to your reports.',
},
]"
/>
<UPageSection>
<UPageCTA
title="Ready to build your next Nuxt app?"
description="Join thousands of developers building with Nuxt and Nuxt UI. Get this template and start shipping today."
title="Ready to streamline your time tracking?"
description="Stop juggling spreadsheets and timers. Tímmál handles the complexity so you can focus on your work."
variant="subtle"
class="bg-"
:links="[
{
label: 'Start building',
to: 'https://ui.nuxt.com/docs/getting-started/installation/nuxt',
target: '_blank',
label: 'Start tracking',
to: '/dashboard',
trailingIcon: 'i-lucide-arrow-right',
color: 'neutral',
},
{
label: 'View on GitHub',
to: 'https://github.com/nuxt-ui-templates/starter',
target: '_blank',
icon: 'i-simple-icons-github',
color: 'neutral',
variant: 'outline',
},
]"
/>
</UPageSection>
</div>
</template>
<script lang="ts" setup>
definePageMeta({
layout: 'unauthenticated',
});
</script>

8
app/pages/projects.vue Normal file
View File

@@ -0,0 +1,8 @@
<template>
<span> projects </span>
</template>
<script setup lang="ts">
const { setPageName } = usePageTitle();
setPageName('Projects');
</script>

8
app/pages/reports.vue Normal file
View File

@@ -0,0 +1,8 @@
<template>
<span>reports </span>
</template>
<script setup lang="ts">
const { setPageName } = usePageTitle();
setPageName('Reports');
</script>

8
app/pages/settings.vue Normal file
View File

@@ -0,0 +1,8 @@
<template>
<span> settings </span>
</template>
<script setup lang="ts">
const { setPageName } = usePageTitle();
setPageName('Settings');
</script>

11
app/pages/signin.vue Normal file
View File

@@ -0,0 +1,11 @@
<template>
<UPage>
<span> Signin </span>
</UPage>
</template>
<script lang="ts" setup>
definePageMeta({
layout: 'unauthenticated',
});
</script>

8
app/pages/tasks.vue Normal file
View File

@@ -0,0 +1,8 @@
<template>
<span> tasks </span>
</template>
<script setup lang="ts">
const { setPageName } = usePageTitle();
setPageName('Tasks');
</script>