210 lines
4.6 KiB
Vue
210 lines
4.6 KiB
Vue
<script setup>
|
|
/**
|
|
* Root component: the app shell. A sidebar on wide screens, a top bar on
|
|
* narrow ones, with the three routes and the two links that leave the app;
|
|
* each page draws its own header and content inside <main>.
|
|
*/
|
|
import { RouterLink, RouterView } from "vue-router";
|
|
import Icon from "@/components/Icon.vue";
|
|
|
|
// Served from web/public/ under the app's base path (/jobs/).
|
|
const userscriptUrl = `${import.meta.env.BASE_URL}job-capture.user.js`;
|
|
|
|
const NAV = [
|
|
{ to: "/dashboard", label: "Dashboard", icon: "chart" },
|
|
{ to: "/", label: "Applications", icon: "briefcase" },
|
|
{ to: "/leads", label: "Leads", icon: "inbox" },
|
|
{ to: "/settings", label: "Settings", icon: "sliders" },
|
|
];
|
|
</script>
|
|
|
|
<template>
|
|
<div class="shell">
|
|
<aside class="sidebar">
|
|
<RouterLink to="/" class="brand">
|
|
<span class="brand-mark">JT</span>
|
|
<span class="brand-name">Job tracker</span>
|
|
</RouterLink>
|
|
|
|
<nav class="nav" aria-label="Main">
|
|
<RouterLink
|
|
v-for="item in NAV"
|
|
:key="item.to"
|
|
:to="item.to"
|
|
class="nav-link"
|
|
exact-active-class="nav-link-active"
|
|
>
|
|
<Icon :name="item.icon" :size="17" />
|
|
<span>{{ item.label }}</span>
|
|
</RouterLink>
|
|
</nav>
|
|
|
|
<div class="sidebar-foot">
|
|
<!-- A plain link to a static file: Violentmonkey intercepts any
|
|
navigation to a URL ending in .user.js and offers to install it.
|
|
The token it then asks for is generated on the Settings page. -->
|
|
<a
|
|
class="nav-link nav-link-quiet"
|
|
:href="userscriptUrl"
|
|
target="_blank"
|
|
rel="noopener"
|
|
title="Violentmonkey userscript that adds the job you are viewing. After installing, generate a capture token on the Settings page and paste it into the script's menu: Configure job capture."
|
|
>
|
|
<Icon name="code" :size="17" />
|
|
<span>Capture script</span>
|
|
</a>
|
|
<!-- The CV is the main site's page, outside this app: a full load. -->
|
|
<a href="/cv" class="nav-link nav-link-quiet">
|
|
<Icon name="arrow-left" :size="17" />
|
|
<span>Back to CV</span>
|
|
</a>
|
|
</div>
|
|
</aside>
|
|
|
|
<main class="main">
|
|
<RouterView />
|
|
</main>
|
|
</div>
|
|
</template>
|
|
|
|
<style scoped>
|
|
.shell {
|
|
display: grid;
|
|
grid-template-columns: 232px minmax(0, 1fr);
|
|
min-height: 100vh;
|
|
}
|
|
|
|
.sidebar {
|
|
position: sticky;
|
|
top: 0;
|
|
display: flex;
|
|
flex-direction: column;
|
|
gap: 1.5rem;
|
|
height: 100vh;
|
|
padding: 1.25rem 0.85rem;
|
|
border-right: 1px solid var(--border);
|
|
background: var(--surface);
|
|
}
|
|
|
|
.brand {
|
|
display: flex;
|
|
align-items: center;
|
|
gap: 0.65rem;
|
|
padding: 0 0.5rem;
|
|
color: var(--text);
|
|
text-decoration: none;
|
|
}
|
|
.brand:hover {
|
|
text-decoration: none;
|
|
}
|
|
|
|
.brand-mark {
|
|
display: grid;
|
|
place-items: center;
|
|
width: 2rem;
|
|
height: 2rem;
|
|
border-radius: 8px;
|
|
background: var(--accent);
|
|
color: var(--accent-fg);
|
|
font-family: var(--font-heading);
|
|
font-size: 1.15rem;
|
|
letter-spacing: 0.04em;
|
|
padding-top: 2px;
|
|
}
|
|
|
|
.brand-name {
|
|
font-family: var(--font-heading);
|
|
font-size: 1.5rem;
|
|
letter-spacing: 0.03em;
|
|
line-height: 1;
|
|
padding-top: 2px;
|
|
}
|
|
|
|
.nav,
|
|
.sidebar-foot {
|
|
display: flex;
|
|
flex-direction: column;
|
|
gap: 0.15rem;
|
|
}
|
|
|
|
.sidebar-foot {
|
|
margin-top: auto;
|
|
}
|
|
|
|
.nav-link {
|
|
display: flex;
|
|
align-items: center;
|
|
gap: 0.65rem;
|
|
height: 2.25rem;
|
|
padding: 0 0.65rem;
|
|
border-radius: var(--radius-sm);
|
|
color: var(--text-2);
|
|
font-size: 0.875rem;
|
|
font-weight: 500;
|
|
text-decoration: none;
|
|
white-space: nowrap;
|
|
}
|
|
.nav-link:hover {
|
|
background: var(--surface-hover);
|
|
color: var(--text);
|
|
text-decoration: none;
|
|
}
|
|
.nav-link-active,
|
|
.nav-link-active:hover {
|
|
background: var(--accent-soft);
|
|
color: var(--accent);
|
|
}
|
|
.nav-link-quiet {
|
|
color: var(--text-3);
|
|
font-size: 0.8125rem;
|
|
}
|
|
|
|
/* Narrow screens: the sidebar folds into a top bar that scrolls sideways. */
|
|
@media (max-width: 900px) {
|
|
.shell {
|
|
grid-template-columns: minmax(0, 1fr);
|
|
/* Otherwise a short page stretches the bar to share the spare height. */
|
|
grid-template-rows: auto 1fr;
|
|
}
|
|
|
|
.sidebar {
|
|
position: sticky;
|
|
z-index: 10;
|
|
flex-direction: row;
|
|
align-items: center;
|
|
gap: 0.75rem;
|
|
height: auto;
|
|
padding: 0.6rem 1rem;
|
|
border-right: none;
|
|
border-bottom: 1px solid var(--border);
|
|
overflow-x: auto;
|
|
}
|
|
|
|
.brand {
|
|
padding: 0;
|
|
}
|
|
|
|
.brand-name {
|
|
display: none;
|
|
}
|
|
|
|
.nav,
|
|
.sidebar-foot {
|
|
flex-direction: row;
|
|
}
|
|
|
|
.sidebar-foot {
|
|
margin-top: 0;
|
|
margin-left: auto;
|
|
}
|
|
|
|
.nav-link {
|
|
padding: 0 0.6rem;
|
|
}
|
|
|
|
.nav-link-quiet span {
|
|
display: none;
|
|
}
|
|
}
|
|
</style>
|