Side bar navigation

This commit is contained in:
LittleSheep 2024-09-22 18:53:32 +08:00
parent 76d9d18587
commit 8763923f33
4 changed files with 51 additions and 62 deletions

View File

@ -1,7 +1,7 @@
<template> <template>
<div class="text-xs text-grey" :class="props.noCentered ? 'text-left' : 'text-center'"> <div class="text-xs text-grey" :class="props.noCentered ? 'text-left' : 'text-center'">
<p>{{ t("copyright") }} © {{ new Date().getFullYear() }} {{ t("brandNameFormal") }}</p> <p>{{ t("copyright") }} © {{ new Date().getFullYear() }} {{ t("brandNameFormal") }}</p>
<p v-if="services" class="flex justify-center"> <p v-if="services" class="flex" :class="props.noCentered ? 'justify-start' : 'justify-center'">
<span>Powered by</span> <span>Powered by</span>
<span class="flex services-list ms-1"> <span class="flex services-list ms-1">
<a class="service underline" v-for="item in services" :href="projects[item][1]"> <a class="service underline" v-for="item in services" :href="projects[item][1]">

View File

@ -1,15 +1,19 @@
<template> <template>
<v-app-bar flat color="primary" scroll-behavior="hide" scroll-threshold="800"> <v-app-bar flat color="primary">
<v-container fluid class="mx-auto d-flex align-center justify-center px-8"> <v-container fluid class="mx-auto d-flex align-center justify-center px-8">
<nuxt-link to="/" exact> <v-tooltip>
<template #activator="{ props }">
<div @click="openDrawer = !openDrawer" v-bind="props" class="cursor-pointer">
<v-img class="me-4 ms-1" width="32" height="32" alt="Logo" :src="Logo" /> <v-img class="me-4 ms-1" width="32" height="32" alt="Logo" :src="Logo" />
</nuxt-link>
<div class="nav-links overflow-y-auto flex">
<v-btn variant="text" :text="t('navProducts')" to="/products" exact />
<v-btn variant="text" :text="t('navActivity')" to="/activity" exact />
<v-btn variant="text" :text="t('navGallery')" to="/gallery" exact />
</div> </div>
</template>
Open / close drawer
</v-tooltip>
<nuxt-link to="/" exact>
<h2 class="mt-1">Solsynth LLC</h2>
</nuxt-link>
<v-spacer></v-spacer> <v-spacer></v-spacer>
@ -40,6 +44,25 @@
</v-container> </v-container>
</v-app-bar> </v-app-bar>
<v-navigation-drawer v-model="openDrawer" location="left" width="300" floating>
<v-list density="compact" nav color="primary">
<v-list-item :title="t('navProducts')" prepend-icon="mdi-shape" to="/products" exact />
<v-list-item :title="t('navActivity')" prepend-icon="mdi-newspaper" to="/activity" exact />
<v-list-item :title="t('navGallery')" prepend-icon="mdi-album" to="/gallery" exact />
</v-list>
<v-divider class="border-opacity-50 mb-4" />
<copyright no-centered service="capital" class="px-5" />
<div class="px-5 mt-3 text-xs text-grey sidebar-footer transition-opacity duration-500">
<div class="flex footer-links flex-wrap">
<nuxt-link to="/terms/privacy-policy" class="hover:underline">Privacy Policy</nuxt-link>
<nuxt-link to="/terms/user-agreement" class="hover:underline">Term of Service</nuxt-link>
</div>
</div>
</v-navigation-drawer>
<v-main> <v-main>
<slot /> <slot />
</v-main> </v-main>
@ -49,15 +72,27 @@
import Logo from "../assets/logo-w-shadow.png" import Logo from "../assets/logo-w-shadow.png"
const { locale, locales, setLocale, t } = useI18n() const { locale, locales, setLocale, t } = useI18n()
const openDrawer = ref(false)
</script> </script>
<style scoped> <style scoped>
.nav-links::-webkit-scrollbar { .sidebar-footer {
display: none; opacity: 0.3;
} }
.nav-links { .sidebar-footer:hover {
-ms-overflow-style: none; opacity: 1;
scrollbar-width: none; }
.footer-links *:not(:last-child):after {
content: "·";
font-family: monospace;
font-weight: bold;
text-align: center;
margin-left: 4px;
margin-right: 4px;
text-decoration: none !important;
display: inline-block;
} }
</style> </style>

View File

@ -1,46 +0,0 @@
<template>
<v-system-bar color="primary">
<span>© {{ new Date().getFullYear() }} {{ t("brandName") }}</span>
<v-spacer />
<span>{{ t("embedWidget") }}</span>
</v-system-bar>
<v-container fluid class="mx-auto justify-center px-8">
<v-main>
<slot />
</v-main>
<div class="text-center flex flex-col justify-center gap-1.5 text-grey text-xs">
<copyright :service="['capital', 'solar-network']" />
<div class="flex gap-2 justify-center">
<v-menu location="top center">
<template v-slot:activator="{ props }">
<span v-bind="props">{{ t("language") }}</span>
</template>
<v-list class="w-fit">
<v-list-item
class="w-48"
density="compact"
v-for="item in locales"
:key="item.code"
:value="item.code"
:active="locale == item.code"
@click.prevent.stop="setLocale(item.code)"
>
<v-list-item-title>{{ item.name }}</v-list-item-title>
</v-list-item>
</v-list>
</v-menu>
<v-divider vertical />
<nuxt-link target="_blank" :to="route.fullPath.replace('/embed', '')">
{{ t("openInSite") }}
</nuxt-link>
</div>
</div>
</v-container>
</template>
<script setup lang="ts">
const route = useRoute()
const { locale, locales, setLocale, t } = useI18n()
</script>

View File

@ -1,5 +1,5 @@
<template> <template>
<v-container class="flex flex-col my-2 gap-[4rem]"> <v-container class="flex flex-col my-2 px-12 gap-[4rem]">
<v-row class="content-section"> <v-row class="content-section">
<v-col cols="12" md="4" class="flex justify-start"> <v-col cols="12" md="4" class="flex justify-start">
<div class="flex flex-col items-start"> <div class="flex flex-col items-start">