mirror of
https://github.com/lukaszraczylo/beat-delivery-methodology.git
synced 2026-11-26 11:08:13 +00:00
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:
@@ -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>
|
||||
@@ -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>
|
||||
@@ -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>
|
||||
@@ -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>
|
||||
@@ -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>
|
||||
@@ -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>
|
||||
@@ -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>
|
||||
|
||||
@@ -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>
|
||||
Reference in New Issue
Block a user