feat(design): persistent wayfinding and typographic page shells on the token palette

- SiteHeader: brand, section navigation from route meta, section pages nav,
  theme toggle mounted as committed, keyboard menu under 640px.
- SiteFooter, PageHeader, PageSection and TableCard carry the page shells.
- Every view rewritten on the token type scale and reading public/src/data;
  the old layout and ui components it replaced are removed.
- NotFoundView plus the catch-all route, so an unknown path names itself.
- App.vue: skip link that moves focus without changing the hash route, focus
  moved to the main landmark after a page change, unique title from route meta.
- assets/styles/main.css reduced to the base layer on token utilities.
- FontAwesome self-hosted from the npm package instead of the CDN.
- Home carries all five commitments (WP-49).
This commit is contained in:
Locust agent
2026-11-02 23:41:32 +00:00
parent b48787346d
commit b11d9fff9c
34 changed files with 1016 additions and 3666 deletions
-129
View File
@@ -1,129 +0,0 @@
<script setup>
const currentYear = new Date().getFullYear()
const quickLinks = [
{ path: '/values', label: 'Core Values' },
{ path: '/principles', label: '12 Principles' },
{ path: '/framework', label: 'Framework' },
{ path: '/reference', label: 'Quick Reference' },
]
const resources = [
{ path: '/assessment', label: 'Team Assessment' },
{ path: '/anti-patterns', label: 'Anti-Patterns' },
{ path: '/onboarding', label: 'Onboarding' },
{ path: '/practices', label: 'Practices' },
]
</script>
<template>
<footer class="relative bg-gray-50 dark:bg-gray-800/50 border-t border-gray-200 dark:border-gray-700 transition-colors duration-300">
<!-- Top gradient line -->
<div class="absolute top-0 left-0 right-0 h-px bg-gradient-to-r from-transparent via-blue-500/50 to-transparent"></div>
<div class="w-full max-w-7xl mx-auto px-4 sm:px-6 lg:px-8 xl:px-12 py-10 sm:py-12 lg:py-16">
<!-- Main footer content - responsive grid -->
<div class="grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-4 gap-8 lg:gap-12">
<!-- Brand -->
<div class="sm:col-span-2 lg:col-span-1">
<RouterLink to="/" class="flex items-center gap-3 group mb-4">
<div
class="w-10 h-10 sm:w-12 sm:h-12 rounded-xl bg-gradient-to-br from-blue-600 to-purple-600 flex items-center justify-center transition-all duration-300 group-hover:scale-110 group-hover:rotate-3 group-hover:shadow-glow-blue"
>
<span class="text-white font-bold text-lg sm:text-xl">B</span>
</div>
<div>
<span class="text-lg sm:text-xl font-bold gradient-text block">BEAT</span>
<span class="text-xs text-gray-500 dark:text-gray-400">v1.0</span>
</div>
</RouterLink>
<p class="text-gray-600 dark:text-gray-400 text-sm leading-relaxed mb-2">
<strong>B</strong>alanced. <strong>E</strong>mpowered. <strong>A</strong>sync. <strong>T</strong>eams.
</p>
<p class="text-gray-500 dark:text-gray-500 text-sm">
Built for how developers actually work.
</p>
</div>
<!-- Quick Links -->
<div>
<h3 class="font-semibold text-gray-900 dark:text-gray-100 mb-4 flex items-center gap-2 text-sm sm:text-base">
<i class="fas fa-compass text-blue-500 text-sm"></i>
Explore
</h3>
<ul class="space-y-2">
<li v-for="link in quickLinks" :key="link.path">
<RouterLink
:to="link.path"
class="text-sm text-gray-600 dark:text-gray-400 hover:text-blue-600 dark:hover:text-blue-400 transition-colors duration-200 flex items-center gap-2 group"
>
<span class="w-1.5 h-1.5 rounded-full bg-gray-300 dark:bg-gray-600 group-hover:bg-blue-500 transition-colors"></span>
{{ link.label }}
</RouterLink>
</li>
</ul>
</div>
<!-- Resources -->
<div>
<h3 class="font-semibold text-gray-900 dark:text-gray-100 mb-4 flex items-center gap-2 text-sm sm:text-base">
<i class="fas fa-book text-purple-500 text-sm"></i>
Resources
</h3>
<ul class="space-y-2">
<li v-for="link in resources" :key="link.path">
<RouterLink
:to="link.path"
class="text-sm text-gray-600 dark:text-gray-400 hover:text-purple-600 dark:hover:text-purple-400 transition-colors duration-200 flex items-center gap-2 group"
>
<span class="w-1.5 h-1.5 rounded-full bg-gray-300 dark:bg-gray-600 group-hover:bg-purple-500 transition-colors"></span>
{{ link.label }}
</RouterLink>
</li>
</ul>
</div>
<!-- Author -->
<div>
<h3 class="font-semibold text-gray-900 dark:text-gray-100 mb-4 flex items-center gap-2 text-sm sm:text-base">
<i class="fas fa-user text-cyan-500 text-sm"></i>
Created By
</h3>
<p class="text-gray-600 dark:text-gray-400 text-sm mb-4">
The BEAT Manifesto was created by <strong class="text-gray-900 dark:text-gray-100">Lukasz Raczylo</strong>.
</p>
<div class="flex gap-2">
<a
href="https://github.com/lukaszraczylo"
target="_blank"
class="w-10 h-10 rounded-lg bg-gray-100 dark:bg-gray-700 flex items-center justify-center text-gray-500 hover:text-gray-900 dark:hover:text-gray-100 hover:bg-gray-200 dark:hover:bg-gray-600 transition-all duration-300 hover:scale-110"
aria-label="GitHub"
>
<i class="fab fa-github text-lg"></i>
</a>
<a
href="https://www.linkedin.com/in/raczylo/"
target="_blank"
class="w-10 h-10 rounded-lg bg-gray-100 dark:bg-gray-700 flex items-center justify-center text-gray-500 hover:text-blue-600 hover:bg-blue-50 dark:hover:bg-blue-900/30 transition-all duration-300 hover:scale-110"
aria-label="LinkedIn"
>
<i class="fab fa-linkedin text-lg"></i>
</a>
</div>
</div>
</div>
<!-- Bottom bar -->
<div class="mt-8 sm:mt-10 lg:mt-12 pt-6 sm:pt-8 border-t border-gray-200 dark:border-gray-700">
<div class="flex flex-col sm:flex-row justify-between items-center gap-3 sm:gap-4 text-center sm:text-left">
<p class="text-gray-500 dark:text-gray-500 text-xs sm:text-sm">
&copy; {{ currentYear }} BEAT Manifesto by Lukasz Raczylo
</p>
<p class="text-gray-400 dark:text-gray-600 text-xs italic">
Attribution appreciated. Improvement welcomed. Dogma discouraged.
</p>
</div>
</div>
</div>
</footer>
</template>
-229
View File
@@ -1,229 +0,0 @@
<script setup>
import { ref, onMounted, onUnmounted } from 'vue'
import { RouterLink, useRoute } from 'vue-router'
import ThemeToggle from './ThemeToggle.vue'
const route = useRoute()
const mobileMenuOpen = ref(false)
const scrolled = ref(false)
const navItems = [
{ path: '/', label: 'Home', icon: 'fas fa-home' },
{ path: '/values', label: 'Values', icon: 'fas fa-heart' },
{ path: '/principles', label: 'Principles', icon: 'fas fa-compass' },
{ path: '/framework', label: 'Framework', icon: 'fas fa-sitemap' },
{ path: '/practices', label: 'Practices', icon: 'fas fa-cogs' },
{ path: '/onboarding', label: 'Onboarding', icon: 'fas fa-user-plus' },
{ path: '/anti-patterns', label: 'Anti-Patterns', icon: 'fas fa-exclamation-triangle' },
{ path: '/reference', label: 'Reference', icon: 'fas fa-book' },
{ path: '/assessment', label: 'Assessment', icon: 'fas fa-clipboard-check' }
]
const toggleMobileMenu = () => {
mobileMenuOpen.value = !mobileMenuOpen.value
// Prevent body scroll when menu is open
document.body.style.overflow = mobileMenuOpen.value ? 'hidden' : ''
}
const closeMobileMenu = () => {
mobileMenuOpen.value = false
document.body.style.overflow = ''
}
const handleScroll = () => {
scrolled.value = window.scrollY > 20
}
// Close mobile menu on route change
watch(() => route.path, () => {
closeMobileMenu()
})
// Close mobile menu on escape key
const handleEscape = (e) => {
if (e.key === 'Escape' && mobileMenuOpen.value) {
closeMobileMenu()
}
}
onMounted(() => {
window.addEventListener('scroll', handleScroll, { passive: true })
window.addEventListener('keydown', handleEscape)
handleScroll()
})
onUnmounted(() => {
window.removeEventListener('scroll', handleScroll)
window.removeEventListener('keydown', handleEscape)
document.body.style.overflow = ''
})
import { watch } from 'vue'
</script>
<template>
<nav
class="fixed w-full z-50 transition-all duration-500"
:class="[
scrolled
? 'bg-white/90 dark:bg-gray-900/90 backdrop-blur-xl shadow-modern'
: 'bg-transparent'
]"
>
<!-- Top gradient line -->
<div
class="h-1 bg-gradient-to-r from-blue-500 via-purple-500 to-cyan-500 transition-all duration-500"
:class="scrolled ? 'opacity-100' : 'opacity-0'"
></div>
<div class="w-full max-w-7xl mx-auto px-4 sm:px-6 lg:px-8 xl:px-12">
<div class="flex justify-between h-14 sm:h-16 items-center">
<!-- Logo -->
<RouterLink
to="/"
class="flex items-center gap-2 sm:gap-3 group"
>
<div
class="w-8 h-8 sm:w-10 sm:h-10 rounded-lg sm:rounded-xl bg-gradient-to-br from-blue-600 to-purple-600 flex items-center justify-center transition-all duration-300 group-hover:scale-110 group-hover:rotate-3 group-hover:shadow-glow-blue"
>
<span class="text-white font-bold text-sm sm:text-lg">B</span>
</div>
<span
class="text-lg sm:text-xl font-bold gradient-text hidden sm:inline transition-all duration-300 group-hover:tracking-wide"
>BEAT</span>
</RouterLink>
<!-- Desktop Navigation - hidden on mobile, shown on lg+ -->
<div class="hidden lg:flex items-center space-x-1">
<RouterLink
v-for="(item, index) in navItems"
:key="item.path"
:to="item.path"
class="relative px-2 xl:px-3 py-2 text-xs xl:text-sm font-medium rounded-lg transition-all duration-300"
:class="[
route.path === item.path
? 'text-blue-600 dark:text-blue-400 bg-blue-50/50 dark:bg-blue-900/20'
: 'text-gray-600 dark:text-gray-300 hover:text-gray-900 dark:hover:text-gray-100 hover:bg-gray-100/50 dark:hover:bg-gray-800/50'
]"
:style="{ animationDelay: `${index * 50}ms` }"
>
{{ item.label }}
<!-- Active indicator -->
<span
v-if="route.path === item.path"
class="absolute -bottom-1 left-1/2 -translate-x-1/2 w-1 h-1 rounded-full bg-blue-500"
></span>
</RouterLink>
</div>
<!-- Right side actions -->
<div class="flex items-center gap-1 sm:gap-2">
<ThemeToggle />
<a
href="https://github.com/lukaszraczylo"
target="_blank"
class="text-gray-600 dark:text-gray-300 hover:text-gray-900 dark:hover:text-gray-100 p-2 sm:p-2.5 rounded-lg min-w-[40px] min-h-[40px] flex items-center justify-center transition-all duration-300 hover:bg-gray-100/50 dark:hover:bg-gray-800/50 hover:scale-110"
aria-label="View author on GitHub"
>
<i class="fab fa-github text-lg sm:text-xl"></i>
</a>
<!-- Mobile menu button -->
<button
@click="toggleMobileMenu"
class="lg:hidden text-gray-600 dark:text-gray-300 hover:text-gray-900 dark:hover:text-gray-100 p-2 sm:p-2.5 rounded-lg min-w-[44px] min-h-[44px] flex items-center justify-center transition-all duration-300 hover:bg-gray-100/50 dark:hover:bg-gray-800/50"
aria-label="Toggle menu"
aria-expanded="mobileMenuOpen"
aria-controls="mobile-menu"
>
<transition name="rotate" mode="out-in">
<i v-if="!mobileMenuOpen" key="menu" class="fas fa-bars text-lg sm:text-xl"></i>
<i v-else key="close" class="fas fa-times text-lg sm:text-xl"></i>
</transition>
</button>
</div>
</div>
</div>
<!-- Mobile Menu Overlay -->
<transition
enter-active-class="transition duration-300 ease-out"
enter-from-class="opacity-0"
enter-to-class="opacity-100"
leave-active-class="transition duration-200 ease-in"
leave-from-class="opacity-100"
leave-to-class="opacity-0"
>
<div
v-if="mobileMenuOpen"
class="fixed inset-0 bg-black/50 backdrop-blur-sm lg:hidden z-40"
@click="closeMobileMenu"
aria-hidden="true"
></div>
</transition>
<!-- Mobile Menu Panel -->
<transition
enter-active-class="transition duration-300 ease-out"
enter-from-class="opacity-0 -translate-y-4"
enter-to-class="opacity-100 translate-y-0"
leave-active-class="transition duration-200 ease-in"
leave-from-class="opacity-100 translate-y-0"
leave-to-class="opacity-0 -translate-y-4"
>
<div
v-if="mobileMenuOpen"
id="mobile-menu"
class="lg:hidden absolute top-full left-0 right-0 bg-white/95 dark:bg-gray-900/95 backdrop-blur-xl border-b border-gray-200 dark:border-gray-700 shadow-2xl max-h-[80vh] overflow-y-auto"
>
<div class="px-4 py-4 space-y-1 w-full max-w-7xl mx-auto">
<RouterLink
v-for="(item, index) in navItems"
:key="item.path"
:to="item.path"
@click="closeMobileMenu"
class="flex items-center gap-3 px-4 py-3 rounded-xl font-medium transition-all duration-300"
:class="[
route.path === item.path
? 'text-blue-600 dark:text-blue-400 bg-blue-50 dark:bg-blue-900/20'
: 'text-gray-600 dark:text-gray-300 hover:text-gray-900 dark:hover:text-gray-100 hover:bg-gray-50 dark:hover:bg-gray-800'
]"
:style="{ animationDelay: `${index * 30}ms` }"
>
<div
class="w-10 h-10 rounded-lg flex items-center justify-center"
:class="route.path === item.path ? 'bg-blue-100 dark:bg-blue-800' : 'bg-gray-100 dark:bg-gray-800'"
>
<i :class="item.icon" class="text-sm"></i>
</div>
<span class="flex-1">{{ item.label }}</span>
<i
v-if="route.path === item.path"
class="fas fa-chevron-right text-xs text-blue-500"
></i>
</RouterLink>
</div>
<!-- Mobile menu footer -->
<div class="px-4 py-4 border-t border-gray-200 dark:border-gray-700">
<p class="text-xs text-center text-gray-500 dark:text-gray-500">
BEAT Manifesto v1.0
</p>
</div>
</div>
</transition>
</nav>
</template>
<style scoped>
.rotate-enter-active,
.rotate-leave-active {
transition: all 0.2s ease;
}
.rotate-enter-from,
.rotate-leave-to {
opacity: 0;
transform: rotate(-90deg);
}
</style>
@@ -0,0 +1,15 @@
<script setup>
defineProps({
title: { type: String, required: true },
summary: { type: String, default: '' },
eyebrow: { type: String, default: '' }
})
</script>
<template>
<header class="border-b border-border pb-6">
<p v-if="eyebrow" class="text-title font-medium text-muted-foreground">{{ eyebrow }}</p>
<h1 class="mt-1 text-display-sm font-semibold text-large">{{ title }}</h1>
<p v-if="summary" class="mt-4 max-w-prose text-body-lg text-body">{{ summary }}</p>
</header>
</template>
@@ -0,0 +1,16 @@
<script setup>
defineProps({
title: { type: String, required: true },
summary: { type: String, default: '' }
})
</script>
<template>
<section class="mt-12">
<h2 class="text-heading font-semibold text-large">{{ title }}</h2>
<p v-if="summary" class="mt-3 max-w-prose text-body-base text-body">{{ summary }}</p>
<div class="mt-5">
<slot />
</div>
</section>
</template>
@@ -1,63 +0,0 @@
<script setup>
import { ref, onMounted, onUnmounted } from 'vue'
const progress = ref(0)
const showBackToTop = ref(false)
const calculateProgress = () => {
const windowHeight = window.innerHeight
const documentHeight = document.documentElement.scrollHeight - windowHeight
const scrollTop = window.scrollY
if (documentHeight > 0) {
progress.value = Math.min(100, Math.max(0, (scrollTop / documentHeight) * 100))
}
showBackToTop.value = scrollTop > 500
}
const scrollToTop = () => {
window.scrollTo({
top: 0,
behavior: 'smooth'
})
}
onMounted(() => {
window.addEventListener('scroll', calculateProgress, { passive: true })
calculateProgress()
})
onUnmounted(() => {
window.removeEventListener('scroll', calculateProgress)
})
</script>
<template>
<!-- Reading Progress Bar -->
<div class="fixed top-0 left-0 right-0 h-1 z-[60] bg-transparent">
<div
class="h-full bg-gradient-to-r from-blue-500 via-purple-500 to-cyan-500 transition-all duration-150 ease-out"
:style="{ width: `${progress}%` }"
></div>
</div>
<!-- Back to Top Button -->
<transition
enter-active-class="transition duration-300 ease-out"
enter-from-class="opacity-0 translate-y-4"
enter-to-class="opacity-100 translate-y-0"
leave-active-class="transition duration-200 ease-in"
leave-from-class="opacity-100 translate-y-0"
leave-to-class="opacity-0 translate-y-4"
>
<button
v-if="showBackToTop"
@click="scrollToTop"
class="fixed bottom-8 right-8 w-12 h-12 rounded-full bg-gradient-to-br from-blue-600 to-purple-600 text-white shadow-lg hover:shadow-xl hover:scale-110 transition-all duration-300 z-50 flex items-center justify-center group"
aria-label="Back to top"
>
<i class="fas fa-arrow-up group-hover:-translate-y-0.5 transition-transform"></i>
</button>
</transition>
</template>
@@ -0,0 +1,34 @@
<script setup>
import { RouterLink } from 'vue-router'
import { sections } from '@/router'
import { pagesInSection } from '@/router/sections'
const orderedSections = [...sections].sort((a, b) => a.order - b.order)
</script>
<template>
<footer class="mt-16 border-t border-border bg-muted">
<div class="mx-auto w-full max-w-6xl px-4 py-10 sm:px-6">
<nav aria-label="All pages">
<div class="grid grid-cols-1 gap-8 sm:grid-cols-2 lg:grid-cols-3">
<div v-for="section in orderedSections" :key="section.id">
<h2 class="text-title font-semibold text-large">{{ section.label }}</h2>
<ul class="mt-2 space-y-1">
<li v-for="page in pagesInSection(section.id)" :key="page.name">
<RouterLink
:to="page.path"
class="rounded text-body-base text-body hover:text-foreground hover:underline"
>
{{ page.meta.title }}
</RouterLink>
</li>
</ul>
</div>
</div>
</nav>
<p class="mt-10 border-t border-border pt-6 text-body-base text-muted-foreground">
BEAT manifesto by Lukasz Raczylo. Balanced, empowered, async teams.
</p>
</div>
</footer>
</template>
+143
View File
@@ -0,0 +1,143 @@
<script setup>
import { computed, onMounted, onUnmounted, ref, watch } from 'vue'
import { RouterLink, useRoute } from 'vue-router'
import { sections } from '@/router'
import { pagesInSection } from '@/router/sections'
import ThemeToggle from '@/components/theme/ThemeToggle.vue'
const route = useRoute()
const menuOpen = ref(false)
const menuButton = ref(null)
// The current section comes from route meta, so a new page appears in the
// wayfinding as soon as the router lists it.
const currentSection = computed(() => route.meta.section ?? sections[0].id)
const currentSectionLabel = computed(
() => sections.find((section) => section.id === currentSection.value)?.label ?? ''
)
const sectionPages = computed(() => pagesInSection(currentSection.value))
const orderedSections = computed(() => [...sections].sort((a, b) => a.order - b.order))
// A section link lands on the first page of that section. No section is empty,
// and pagesInSection sorts by meta.sectionOrder.
const sectionPath = (sectionId) => pagesInSection(sectionId)[0]?.path ?? '/'
const closeMenu = () => {
menuOpen.value = false
}
const onKeydown = (event) => {
if (event.key === 'Escape' && menuOpen.value) {
closeMenu()
menuButton.value?.focus()
}
}
watch(() => route.fullPath, closeMenu)
onMounted(() => window.addEventListener('keydown', onKeydown))
onUnmounted(() => window.removeEventListener('keydown', onKeydown))
</script>
<template>
<header class="sticky top-0 z-40 border-b border-border bg-background">
<div class="mx-auto w-full max-w-6xl px-4 sm:px-6">
<div class="flex min-h-[3.5rem] items-center justify-between gap-2">
<RouterLink
to="/"
class="rounded px-1 py-2 text-title font-semibold text-foreground"
aria-label="BEAT manifesto, home"
>
BEAT
</RouterLink>
<div class="flex items-center gap-1">
<ThemeToggle />
<button
ref="menuButton"
type="button"
class="inline-flex min-h-[44px] min-w-[44px] items-center justify-center gap-2 rounded px-2 text-body-base font-semibold text-foreground hover:bg-muted lg:hidden"
:aria-expanded="menuOpen"
aria-controls="site-menu"
@click="menuOpen = !menuOpen"
>
<i :class="menuOpen ? 'fas fa-times' : 'fas fa-bars'" aria-hidden="true"></i>
{{ menuOpen ? 'Close' : 'Menu' }}
</button>
</div>
</div>
<!-- Desktop wayfinding: site navigation, then the pages of the current
section. Both are built from the router config. -->
<div class="hidden pb-3 lg:block">
<nav aria-label="Sections">
<ul class="flex flex-wrap items-center gap-x-1">
<li v-for="section in orderedSections" :key="section.id">
<RouterLink
:to="sectionPath(section.id)"
class="inline-block rounded px-2 py-1.5 text-body-base text-body hover:bg-muted hover:text-foreground"
:class="{ 'font-semibold text-accent': section.id === currentSection }"
:aria-current="section.id === currentSection ? 'true' : undefined"
>
{{ section.label }}
</RouterLink>
</li>
</ul>
</nav>
<nav :aria-label="`${currentSectionLabel} pages`" class="mt-1">
<ul class="flex flex-wrap items-center gap-x-1">
<li v-for="page in sectionPages" :key="page.name">
<RouterLink
:to="page.path"
class="inline-block rounded px-2 py-1.5 text-body-base text-muted-foreground hover:bg-muted hover:text-foreground"
:class="{ 'font-semibold text-foreground underline underline-offset-4': page.name === route.name }"
:aria-current="page.name === route.name ? 'page' : undefined"
>
{{ page.meta.title }}
</RouterLink>
</li>
</ul>
</nav>
</div>
<!-- Small screens: both navigations collapse into one keyboard-operated
menu. It is a real button above, so Enter and Space open it. -->
<div v-if="menuOpen" id="site-menu" class="border-t border-border pb-4 lg:hidden">
<nav aria-label="Sections" class="pt-3">
<p class="px-2 text-body-base font-semibold text-muted-foreground">Sections</p>
<ul class="mt-1">
<li v-for="section in orderedSections" :key="section.id">
<RouterLink
:to="sectionPath(section.id)"
class="block rounded px-2 py-2 text-body-base text-body hover:bg-muted hover:text-foreground"
:class="{ 'font-semibold text-accent': section.id === currentSection }"
:aria-current="section.id === currentSection ? 'true' : undefined"
@click="closeMenu"
>
{{ section.label }}
</RouterLink>
</li>
</ul>
</nav>
<nav :aria-label="`${currentSectionLabel} pages`" class="mt-4">
<p class="px-2 text-body-base font-semibold text-muted-foreground">
{{ currentSectionLabel }} pages
</p>
<ul class="mt-1">
<li v-for="page in sectionPages" :key="page.name">
<RouterLink
:to="page.path"
class="block rounded px-2 py-2 text-body-base text-body hover:bg-muted hover:text-foreground"
:class="{ 'font-semibold text-foreground underline underline-offset-4': page.name === route.name }"
:aria-current="page.name === route.name ? 'page' : undefined"
@click="closeMenu"
>
{{ page.meta.title }}
</RouterLink>
</li>
</ul>
</nav>
</div>
</div>
</header>
</template>
@@ -1,7 +0,0 @@
<script setup>
import ThemeToggle from '@/components/theme/ThemeToggle.vue'
</script>
<template>
<ThemeToggle />
</template>
-28
View File
@@ -1,28 +0,0 @@
<script setup>
defineProps({
variant: {
type: String,
default: 'default',
validator: (value) => ['default', 'blue', 'purple', 'green', 'amber', 'red', 'cyan'].includes(value)
}
})
const variantClasses = {
default: 'bg-gray-100 dark:bg-gray-700 text-gray-700 dark:text-gray-300',
blue: 'bg-blue-100 dark:bg-blue-900/30 text-blue-700 dark:text-blue-300',
purple: 'bg-purple-100 dark:bg-purple-900/30 text-purple-700 dark:text-purple-300',
green: 'bg-green-100 dark:bg-green-900/30 text-green-700 dark:text-green-300',
amber: 'bg-amber-100 dark:bg-amber-900/30 text-amber-700 dark:text-amber-300',
red: 'bg-red-100 dark:bg-red-900/30 text-red-700 dark:text-red-300',
cyan: 'bg-cyan-100 dark:bg-cyan-900/30 text-cyan-700 dark:text-cyan-300'
}
</script>
<template>
<span
class="inline-flex items-center px-3 py-1 rounded-full text-xs font-medium"
:class="variantClasses[variant]"
>
<slot></slot>
</span>
</template>
-39
View File
@@ -1,39 +0,0 @@
<script setup>
defineProps({
hover: {
type: Boolean,
default: true
},
gradient: {
type: String,
default: null
},
glow: {
type: String,
default: null
}
})
</script>
<template>
<div
class="card"
:class="{
'hover:-translate-y-2': hover,
[`shadow-glow-${glow}`]: glow
}"
>
<div v-if="gradient" class="flex items-start gap-5">
<div
class="icon-box w-14 h-14 rounded-2xl"
:class="gradient"
>
<slot name="icon"></slot>
</div>
<div class="flex-1 min-w-0">
<slot></slot>
</div>
</div>
<slot v-else></slot>
</div>
</template>
-41
View File
@@ -1,41 +0,0 @@
<script setup>
import { ref } from 'vue'
defineProps({
title: {
type: String,
default: null
}
})
const copied = ref(false)
const codeRef = ref(null)
const copyCode = async () => {
if (codeRef.value) {
const text = codeRef.value.innerText
await navigator.clipboard.writeText(text)
copied.value = true
setTimeout(() => {
copied.value = false
}, 2000)
}
}
</script>
<template>
<div class="rounded-xl overflow-hidden bg-gray-900 dark:bg-gray-950">
<div v-if="title" class="flex items-center justify-between px-3 sm:px-4 py-2 bg-gray-800 dark:bg-gray-900 border-b border-gray-700">
<span class="text-gray-400 text-xs sm:text-sm font-medium truncate mr-2">{{ title }}</span>
<button
@click="copyCode"
class="text-gray-400 hover:text-white transition-colors p-2 min-w-[40px] min-h-[40px] flex items-center justify-center flex-shrink-0"
aria-label="Copy code"
>
<i v-if="copied" class="fas fa-check text-green-400"></i>
<i v-else class="fas fa-copy"></i>
</button>
</div>
<pre class="p-3 sm:p-4 overflow-x-auto text-xs sm:text-sm"><code ref="codeRef" class="text-gray-100 font-mono whitespace-pre-wrap break-words sm:whitespace-pre sm:break-normal"><slot></slot></code></pre>
</div>
</template>
-75
View File
@@ -1,75 +0,0 @@
<script setup>
import { ref } from 'vue'
const props = defineProps({
text: {
type: String,
required: true
},
label: {
type: String,
default: 'Copy'
},
copiedLabel: {
type: String,
default: 'Copied!'
}
})
const copied = ref(false)
const error = ref(false)
const copyToClipboard = async () => {
try {
await navigator.clipboard.writeText(props.text)
copied.value = true
error.value = false
setTimeout(() => {
copied.value = false
}, 2000)
} catch (err) {
error.value = true
setTimeout(() => {
error.value = false
}, 2000)
}
}
</script>
<template>
<button
@click="copyToClipboard"
class="inline-flex items-center gap-2 px-4 py-2 rounded-lg text-sm font-medium transition-all duration-200"
:class="[
copied
? 'bg-emerald-100 dark:bg-emerald-900/30 text-emerald-700 dark:text-emerald-300'
: error
? 'bg-red-100 dark:bg-red-900/30 text-red-700 dark:text-red-300'
: 'bg-gray-100 dark:bg-gray-800 text-gray-600 dark:text-gray-400 hover:bg-gray-200 dark:hover:bg-gray-700'
]"
:title="copied ? copiedLabel : label"
>
<transition name="scale" mode="out-in">
<i v-if="copied" key="check" class="fas fa-check"></i>
<i v-else-if="error" key="error" class="fas fa-exclamation-circle"></i>
<i v-else key="copy" class="fas fa-copy"></i>
</transition>
<span v-if="copied">{{ copiedLabel }}</span>
<span v-else-if="error">Failed</span>
<span v-else>{{ label }}</span>
</button>
</template>
<style scoped>
.scale-enter-active,
.scale-leave-active {
transition: all 0.2s ease;
}
.scale-enter-from,
.scale-leave-to {
opacity: 0;
transform: scale(0.8);
}
</style>
-53
View File
@@ -1,53 +0,0 @@
<script setup>
defineProps({
icon: {
type: String,
required: true
},
title: {
type: String,
required: true
},
description: {
type: String,
default: ''
},
gradient: {
type: String,
default: 'from-blue-500 to-blue-600'
},
href: {
type: String,
default: null
}
})
</script>
<template>
<component
:is="href ? 'a' : 'div'"
:href="href"
class="group card p-6 cursor-pointer"
:class="{ 'hover:-translate-y-2': href }"
>
<div class="flex items-start gap-5">
<div
class="w-14 h-14 rounded-2xl bg-gradient-to-br flex items-center justify-center flex-shrink-0 transition-all duration-300 group-hover:scale-110 group-hover:rotate-3"
:class="gradient"
>
<i :class="icon" class="text-white text-xl"></i>
</div>
<div class="flex-1 min-w-0">
<h3 class="font-semibold text-lg text-gray-900 dark:text-gray-100 mb-2 flex items-center gap-2">
{{ title }}
<i
v-if="href"
class="fas fa-arrow-right text-sm opacity-0 -translate-x-2 group-hover:opacity-100 group-hover:translate-x-0 transition-all duration-300 text-blue-500"
></i>
</h3>
<p v-if="description" class="text-sm text-gray-600 dark:text-gray-400 leading-relaxed">{{ description }}</p>
<slot></slot>
</div>
</div>
</component>
</template>
-101
View File
@@ -1,101 +0,0 @@
<script setup>
import { ref, onMounted, onUnmounted } from 'vue'
const props = defineProps({
delay: {
type: Number,
default: 0
},
direction: {
type: String,
default: 'up', // 'up', 'down', 'left', 'right'
validator: (value) => ['up', 'down', 'left', 'right'].includes(value)
},
distance: {
type: Number,
default: 30
},
duration: {
type: Number,
default: 600
},
once: {
type: Boolean,
default: true
},
threshold: {
type: Number,
default: 0.1
}
})
const elementRef = ref(null)
const isVisible = ref(false)
const getInitialTransform = () => {
switch (props.direction) {
case 'up': return `translateY(${props.distance}px)`
case 'down': return `translateY(-${props.distance}px)`
case 'left': return `translateX(${props.distance}px)`
case 'right': return `translateX(-${props.distance}px)`
default: return `translateY(${props.distance}px)`
}
}
let observer = null
onMounted(() => {
if (!elementRef.value) return
observer = new IntersectionObserver(
(entries) => {
entries.forEach((entry) => {
if (entry.isIntersecting) {
setTimeout(() => {
isVisible.value = true
}, props.delay)
if (props.once && observer) {
observer.unobserve(entry.target)
}
} else if (!props.once) {
isVisible.value = false
}
})
},
{
threshold: props.threshold,
rootMargin: '0px 0px -50px 0px'
}
)
observer.observe(elementRef.value)
})
onUnmounted(() => {
if (observer && elementRef.value) {
observer.unobserve(elementRef.value)
}
})
</script>
<template>
<div
ref="elementRef"
class="scroll-reveal"
:class="{ 'is-visible': isVisible }"
:style="{
opacity: isVisible ? 1 : 0,
transform: isVisible ? 'translate(0)' : getInitialTransform(),
transition: `opacity ${duration}ms cubic-bezier(0.4, 0, 0.2, 1), transform ${duration}ms cubic-bezier(0.4, 0, 0.2, 1)`
}"
>
<slot></slot>
</div>
</template>
<style scoped>
.scroll-reveal {
will-change: opacity, transform;
}
</style>
+40 -63
View File
@@ -1,74 +1,51 @@
<script setup>
defineProps({
title: {
type: String,
default: null
},
headers: {
type: Array,
required: true
},
rows: {
type: Array,
required: true
}
title: { type: String, default: '' },
headers: { type: Array, required: true },
rows: { type: Array, required: true }
})
</script>
<template>
<div class="glass rounded-2xl overflow-hidden">
<div v-if="title" class="px-4 sm:px-6 py-3 sm:py-4 border-b border-gray-200 dark:border-gray-700 bg-gray-50/50 dark:bg-gray-800/50">
<h3 class="font-semibold text-gray-900 dark:text-gray-100 text-sm sm:text-base">{{ title }}</h3>
</div>
<!-- Mobile card view - shown on small screens -->
<div class="block sm:hidden">
<div
v-for="(row, rowIndex) in rows"
:key="rowIndex"
class="p-4 border-b border-gray-200 dark:border-gray-700 last:border-b-0 hover:bg-gray-50/50 dark:hover:bg-gray-800/30 transition-colors"
>
<div
v-for="(cell, cellIndex) in row"
:key="cellIndex"
class="py-1.5"
>
<span class="text-xs font-semibold text-gray-500 dark:text-gray-400 uppercase tracking-wider">{{ headers[cellIndex] }}: </span>
<span class="text-sm text-gray-700 dark:text-gray-300" v-html="cell"></span>
<div class="border border-border">
<h3 v-if="title" class="border-b border-border bg-muted px-4 py-2 text-title font-semibold text-large">
{{ title }}
</h3>
<!-- Small screens: one block per row, so the table never scrolls sideways. -->
<dl class="divide-y divide-border sm:hidden">
<div v-for="(row, rowIndex) in rows" :key="rowIndex" class="px-4 py-3">
<div v-for="(cell, cellIndex) in row" :key="cellIndex" class="py-1">
<dt class="text-body-base font-semibold text-muted-foreground">{{ headers[cellIndex] }}</dt>
<dd class="text-body-base text-body">{{ cell }}</dd>
</div>
</div>
</div>
<!-- Desktop table view - hidden on mobile, shown on sm+ -->
<div class="hidden sm:block overflow-x-auto">
<table class="w-full">
<thead>
<tr class="bg-gray-50/80 dark:bg-gray-800/80">
<th
v-for="header in headers"
:key="header"
class="px-4 md:px-6 py-3 text-left text-xs font-semibold text-gray-600 dark:text-gray-400 uppercase tracking-wider whitespace-nowrap"
>
{{ header }}
</th>
</tr>
</thead>
<tbody class="divide-y divide-gray-200 dark:divide-gray-700">
<tr
v-for="(row, index) in rows"
:key="index"
class="hover:bg-gray-50/50 dark:hover:bg-gray-800/30 transition-all duration-200 group"
</dl>
<table class="hidden w-full table-auto border-collapse text-left sm:table">
<thead>
<tr class="bg-muted">
<th
v-for="header in headers"
:key="header"
scope="col"
class="border-b border-border px-4 py-2 text-body-base font-semibold text-large"
>
<td
v-for="(cell, cellIndex) in row"
:key="cellIndex"
class="px-4 md:px-6 py-3 md:py-4 text-sm text-gray-700 dark:text-gray-300"
>
<span v-html="cell" class="group-hover:text-gray-900 dark:group-hover:text-gray-100 transition-colors"></span>
</td>
</tr>
</tbody>
</table>
</div>
{{ header }}
</th>
</tr>
</thead>
<tbody>
<tr v-for="(row, rowIndex) in rows" :key="rowIndex" class="border-b border-border last:border-b-0">
<td
v-for="(cell, cellIndex) in row"
:key="cellIndex"
class="break-words px-4 py-2 align-top text-body-base text-body"
>
{{ cell }}
</td>
</tr>
</tbody>
</table>
</div>
</template>
-69
View File
@@ -1,69 +0,0 @@
<script setup>
import { ref } from 'vue'
const props = defineProps({
text: {
type: String,
required: true
},
position: {
type: String,
default: 'top',
validator: (value) => ['top', 'bottom', 'left', 'right'].includes(value)
}
})
const show = ref(false)
const positionClasses = {
top: 'bottom-full left-1/2 -translate-x-1/2 mb-2',
bottom: 'top-full left-1/2 -translate-x-1/2 mt-2',
left: 'right-full top-1/2 -translate-y-1/2 mr-2',
right: 'left-full top-1/2 -translate-y-1/2 ml-2'
}
const arrowClasses = {
top: 'top-full left-1/2 -translate-x-1/2 -mt-1 border-l-transparent border-r-transparent border-b-transparent',
bottom: 'bottom-full left-1/2 -translate-x-1/2 -mb-1 border-l-transparent border-r-transparent border-t-transparent',
left: 'left-full top-1/2 -translate-y-1/2 -ml-1 border-t-transparent border-b-transparent border-r-transparent',
right: 'right-full top-1/2 -translate-y-1/2 -mr-1 border-t-transparent border-b-transparent border-l-transparent'
}
</script>
<template>
<div
class="relative inline-block"
@mouseenter="show = true"
@mouseleave="show = false"
@focus="show = true"
@blur="show = false"
>
<slot></slot>
<transition
enter-active-class="transition duration-200 ease-out"
enter-from-class="opacity-0 scale-95"
enter-to-class="opacity-100 scale-100"
leave-active-class="transition duration-150 ease-in"
leave-from-class="opacity-100 scale-100"
leave-to-class="opacity-0 scale-95"
>
<div
v-if="show"
:class="[
'absolute z-50 px-3 py-2 text-sm font-medium text-white bg-gray-900 dark:bg-gray-700 rounded-lg shadow-lg whitespace-nowrap pointer-events-none',
positionClasses[position]
]"
role="tooltip"
>
{{ text }}
<div
:class="[
'absolute w-2 h-2 bg-gray-900 dark:bg-gray-700 rotate-45 border-4 border-gray-900 dark:border-gray-700',
arrowClasses[position]
]"
></div>
</div>
</transition>
</div>
</template>