Files

164 lines
3.4 KiB
Vue

<script setup lang="ts">
import ThemeToggle from "~/components/ThemeToggle.vue";
import SettingsModal from "~/components/SettingsModal.vue";
import ToastNotification from "~/components/ToastNotification.vue";
import { useTheme } from "~/composables/useTheme";
import { useSettings } from "~/composables/useSettings";
useTheme();
const { model, setModel } = useSettings();
const showSettings = ref(false);
function handleModelUpdate(newModel: string) {
setModel(newModel);
}
</script>
<template>
<div class="app-layout">
<header class="app-header">
<div class="container header-container">
<div class="header-text">
<h1 class="app-title">Quick Ling</h1>
<p class="app-subtitle">Fast Translation with translategemma</p>
</div>
<div class="header-actions">
<button
class="header-btn"
@click="showSettings = true"
type="button"
aria-label="Open settings"
title="Settings"
>
&#9881;
</button>
<ThemeToggle />
</div>
</div>
</header>
<main class="app-main">
<div class="container">
<slot />
</div>
</main>
<footer class="app-footer">
<div class="container">
<p>Powered by
<NuxtLink to ="https://ollama.com/library/translategemma" class="nav-link"> translategemma </NuxtLink>
&bull;
<NuxtLink to ="https://ollama.com" class="nav-link"> ollama </NuxtLink>
&bull;
<NuxtLink to="https://gitea.pascalyazid.com/pascalyazid/Quick-Ling" class="nav-link"> Source Code <img src="/gitea.svg" alt="gitea" width="40" height="16" /></NuxtLink>
</p>
</div>
</footer>
<SettingsModal
:visible="showSettings"
:current-model="model"
@update:visible="showSettings = $event"
@update:current-model="handleModelUpdate"
/>
<ToastNotification />
</div>
</template>
<style scoped>
.nav-link {
color: white;
text-decoration: none;
}
.nav-link:hover {
color: var(--primary-color);
}
.app-layout {
min-height: 100vh;
display: flex;
flex-direction: column;
}
.app-header {
background-color: var(--secondary-color);
color: white;
padding: 2rem 0;
transition: background-color 0.3s;
}
.header-container {
display: flex;
align-items: center;
justify-content: space-between;
}
.header-text {
text-align: left;
}
.app-title {
font-size: 2.5rem;
font-weight: 700;
margin-bottom: 0.25rem;
}
.app-subtitle {
font-size: 1rem;
opacity: 0.9;
}
.header-actions {
display: flex;
align-items: center;
gap: 0.5rem;
}
.header-btn {
background: none;
border: 1px solid rgba(255, 255, 255, 0.3);
border-radius: 4px;
color: white;
cursor: pointer;
padding: 0.25rem 0.5rem;
font-size: 1.25rem;
line-height: 1;
transition:
border-color 0.2s,
background-color 0.2s;
display: flex;
align-items: center;
justify-content: center;
}
.header-btn:hover {
border-color: rgba(255, 255, 255, 0.6);
background-color: rgba(255, 255, 255, 0.1);
}
.app-main {
flex: 1;
padding: 2rem 0;
}
.app-footer {
background-color: var(--secondary-color);
color: white;
text-align: center;
padding: 1rem 0;
margin-top: auto;
transition: background-color 0.3s;
}
@media (max-width: 640px) {
.app-title {
font-size: 1.75rem;
}
.app-subtitle {
font-size: 0.875rem;
}
}
</style>