Add AppBar

This commit is contained in:
zervo 2025-07-24 00:27:31 +02:00
parent c25141d53d
commit 13255d9846
4 changed files with 47 additions and 6 deletions

View file

@ -8,6 +8,7 @@ export {}
/* prettier-ignore */ /* prettier-ignore */
declare module 'vue' { declare module 'vue' {
export interface GlobalComponents { export interface GlobalComponents {
AppBar: typeof import('./components/AppBar.vue')['default']
HelloWorld: typeof import('./components/HelloWorld.vue')['default'] HelloWorld: typeof import('./components/HelloWorld.vue')['default']
RouterLink: typeof import('vue-router')['RouterLink'] RouterLink: typeof import('vue-router')['RouterLink']
RouterView: typeof import('vue-router')['RouterView'] RouterView: typeof import('vue-router')['RouterView']

View file

@ -0,0 +1,45 @@
<!--
Alpacca: The modern package repository hosting platform.
Copyright (C) 2025, Zervó Zadachin
DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
The full copyright notice can be found at https://git.zervo.org/zervo/Alpacca/src/branch/main/COPYRIGHT.
-->
<template>
<v-app-bar :elevation="5">
<template #prepend>
<v-img
:src="logoSrc"
:width="200"
/>
</template>
<template #append>
<v-btn :icon="themeIsDark ? 'mdi-weather-sunny' : 'mdi-weather-night'" @click="toggleTheme" />
</template>
</v-app-bar>
</template>
<script setup lang="ts">
import { computed } from 'vue'
import { useTheme } from 'vuetify'
import darkLogo from '@/assets/icon_darkmode.png'
import lightLogo from '@/assets/icon_lightmode.png'
const theme = useTheme()
const themeIsDark = computed(() => theme.global.current.value.dark)
const logoSrc = computed(() => {
return themeIsDark.value ? darkLogo : lightLogo
})
function toggleTheme () {
const newTheme = themeIsDark.value ? 'light' : 'dark'
theme.global.name.value = newTheme
localStorage.setItem('theme', newTheme)
}
</script>

View file

@ -10,12 +10,6 @@ The full copyright notice can be found at https://git.zervo.org/zervo/Alpacca/sr
<template> <template>
<v-container class="fill-height" max-width="900"> <v-container class="fill-height" max-width="900">
<div> <div>
<v-img
class="mb-4"
height="150"
src="@/assets/icon_darkmode.png"
/>
<div class="mb-8 text-center"> <div class="mb-8 text-center">
<div class="text-body-1 font-weight-light mb-n1">Welcome to</div> <div class="text-body-1 font-weight-light mb-n1">Welcome to</div>
<h1 class="text-h2 font-weight-bold">Alpacca</h1> <h1 class="text-h2 font-weight-bold">Alpacca</h1>

View file

@ -10,6 +10,7 @@ The full copyright notice can be found at https://git.zervo.org/zervo/Alpacca/sr
<template> <template>
<v-app> <v-app>
<v-main> <v-main>
<AppBar />
<slot /> <slot />
</v-main> </v-main>
</v-app> </v-app>