- Scaffold packages/site with 11 Vue components: hero (animated terminal), features, showcase, work groups, how-it-works, security, FAQ accordion, footer - i18n EN/FR via vue-i18n with 82+ keys, autodetect navigator.language, toggle without reload - Animated timeline (terminal, dialog, toast) ported from design, scroll-reveal, copy buttons (2 instances) - Self-hosted JetBrains Mono fonts (@fontsource), optimized assets (mark 28KB, og-cover 1200×630) - SEO: canonical, og:image, theme-color, robots.txt, sitemap.xml for git-arboretum.com - Monorepo integration (decoupled from npm release): build:site / dev:site / preview:site scripts - CI: add build:site step to ci.yml for early detection; create .gitea/workflows/prod.yml for FTPS deploy (lftp mirror) to git-arboretum.com - Validated builds ✓ and UI rendering (EN/FR headless test) ✓
25 lines
691 B
TypeScript
25 lines
691 B
TypeScript
import { ref } from 'vue';
|
|
|
|
export const INSTALL_COMMAND = 'npx @johanleroy/git-arboretum';
|
|
|
|
// Bouton « copier la commande » : copie + bascule le label 1800 ms (fidèle au design).
|
|
export function useCopy() {
|
|
const copied = ref(false);
|
|
let timer: ReturnType<typeof setTimeout> | undefined;
|
|
|
|
async function copy(text: string = INSTALL_COMMAND): Promise<void> {
|
|
try {
|
|
if (navigator.clipboard) await navigator.clipboard.writeText(text);
|
|
} catch {
|
|
/* clipboard indisponible (contexte non sécurisé) */
|
|
}
|
|
copied.value = true;
|
|
clearTimeout(timer);
|
|
timer = setTimeout(() => {
|
|
copied.value = false;
|
|
}, 1800);
|
|
}
|
|
|
|
return { copied, copy };
|
|
}
|