198 lines
4.1 KiB
Vue
198 lines
4.1 KiB
Vue
<template>
|
|
<aside class="sidebar">
|
|
|
|
<!-- logo -->
|
|
<div class="sidebar-logo">
|
|
<div class="logo-icon">
|
|
<svg width="16" height="16" viewBox="0 0 16 16" fill="none">
|
|
<path d="M2 12V4l6-2 6 2v8l-6 2-6-2z" fill="white" opacity="0.9"/>
|
|
<path d="M8 2v12M2 4l6 2 6-2" stroke="white" stroke-width="1.2" stroke-opacity="0.6" fill="none"/>
|
|
</svg>
|
|
</div>
|
|
<span class="logo-text">Revisi<span class="logo-accent">.one</span></span>
|
|
</div>
|
|
|
|
<!-- nav -->
|
|
<nav class="sidebar-nav">
|
|
<NuxtLink to="/" class="nav-item" :class="{ 'nav-item--active': isActive('/') }" exact-active-class="">
|
|
<svg class="nav-icon" width="17" height="17" viewBox="0 0 20 20" fill="none" stroke="currentColor" stroke-width="1.6" stroke-linecap="round" stroke-linejoin="round">
|
|
<path d="M3 9.5L10 3l7 6.5V17a1 1 0 01-1 1H4a1 1 0 01-1-1V9.5z"/>
|
|
<path d="M7 18V11h6v7"/>
|
|
</svg>
|
|
Dashboard
|
|
</NuxtLink>
|
|
|
|
<NuxtLink to="/new" class="nav-item" active-class="nav-item--active">
|
|
<svg class="nav-icon" width="17" height="17" viewBox="0 0 20 20" fill="none" stroke="currentColor" stroke-width="1.8" stroke-linecap="round">
|
|
<path d="M10 4v12M4 10h12"/>
|
|
</svg>
|
|
New Course
|
|
</NuxtLink>
|
|
</nav>
|
|
|
|
<!-- user -->
|
|
<div class="sidebar-user">
|
|
<div class="user-avatar">
|
|
{{ initials }}
|
|
</div>
|
|
<div class="user-info">
|
|
<div class="user-name">{{ name }}</div>
|
|
<div class="user-sub">Student</div>
|
|
</div>
|
|
</div>
|
|
|
|
</aside>
|
|
</template>
|
|
|
|
<script setup lang="ts">
|
|
const route = useRoute();
|
|
|
|
// just a placeholder — real auth would provide this
|
|
const name = "You";
|
|
const initials = "YO";
|
|
|
|
function isActive(path: string): boolean {
|
|
if (path === "/") {
|
|
return route.path === "/" || route.path.startsWith("/course/");
|
|
}
|
|
return route.path.startsWith(path);
|
|
}
|
|
</script>
|
|
|
|
<style scoped>
|
|
.sidebar {
|
|
width: var(--sidebar-w);
|
|
min-height: 100vh;
|
|
background: var(--surface);
|
|
border-right: 1px solid var(--border);
|
|
display: flex;
|
|
flex-direction: column;
|
|
position: fixed;
|
|
top: 0;
|
|
left: 0;
|
|
bottom: 0;
|
|
z-index: 100;
|
|
}
|
|
|
|
.sidebar-logo {
|
|
padding: 28px 24px 24px;
|
|
border-bottom: 1px solid var(--border);
|
|
display: flex;
|
|
align-items: center;
|
|
gap: 10px;
|
|
}
|
|
|
|
.logo-icon {
|
|
width: 32px;
|
|
height: 32px;
|
|
border-radius: var(--r-sm);
|
|
background: var(--accent);
|
|
display: flex;
|
|
align-items: center;
|
|
justify-content: center;
|
|
flex-shrink: 0;
|
|
}
|
|
|
|
.logo-text {
|
|
font-family: "Lora", serif;
|
|
font-weight: 600;
|
|
font-size: 17px;
|
|
letter-spacing: -0.3px;
|
|
color: var(--text);
|
|
}
|
|
|
|
.logo-accent {
|
|
color: var(--accent);
|
|
}
|
|
|
|
.sidebar-nav {
|
|
padding: 16px 12px;
|
|
flex: 1;
|
|
display: flex;
|
|
flex-direction: column;
|
|
gap: 2px;
|
|
}
|
|
|
|
.nav-item {
|
|
width: 100%;
|
|
display: flex;
|
|
align-items: center;
|
|
gap: 10px;
|
|
padding: 9px 12px;
|
|
border-radius: var(--r-sm);
|
|
background: transparent;
|
|
color: var(--text-2);
|
|
font-weight: 400;
|
|
font-size: 14px;
|
|
text-decoration: none;
|
|
transition: all 0.15s;
|
|
}
|
|
|
|
.nav-item:hover {
|
|
background: var(--surface-2);
|
|
}
|
|
|
|
.nav-item--active {
|
|
background: var(--accent-dim) !important;
|
|
color: var(--accent) !important;
|
|
font-weight: 600;
|
|
}
|
|
|
|
.nav-item--active .nav-icon {
|
|
color: var(--accent);
|
|
}
|
|
|
|
.nav-icon {
|
|
flex-shrink: 0;
|
|
color: var(--text-3);
|
|
transition: color 0.15s;
|
|
}
|
|
|
|
.nav-item:hover .nav-icon {
|
|
color: var(--text-2);
|
|
}
|
|
|
|
.nav-item--active .nav-icon {
|
|
color: var(--accent);
|
|
}
|
|
|
|
.sidebar-user {
|
|
padding: 16px;
|
|
border-top: 1px solid var(--border);
|
|
display: flex;
|
|
align-items: center;
|
|
gap: 10px;
|
|
}
|
|
|
|
.user-avatar {
|
|
width: 34px;
|
|
height: 34px;
|
|
border-radius: 50%;
|
|
background: linear-gradient(135deg, oklch(72% 0.12 65), oklch(58% 0.14 44));
|
|
display: flex;
|
|
align-items: center;
|
|
justify-content: center;
|
|
color: white;
|
|
font-size: 12px;
|
|
font-weight: 600;
|
|
flex-shrink: 0;
|
|
}
|
|
|
|
.user-info {
|
|
flex: 1;
|
|
min-width: 0;
|
|
}
|
|
|
|
.user-name {
|
|
font-size: 13px;
|
|
font-weight: 500;
|
|
color: var(--text);
|
|
line-height: 1.3;
|
|
}
|
|
|
|
.user-sub {
|
|
font-size: 12px;
|
|
color: var(--text-3);
|
|
line-height: 1.3;
|
|
}
|
|
</style>
|