Simplify constants declaration

This commit is contained in:
David Haz
2025-07-20 23:42:47 +03:00
parent 9d027c25b7
commit 0c79f0af67
85 changed files with 383 additions and 558 deletions

View File

@@ -1,8 +1,7 @@
import code from '@/content/Animations/AnimatedContent/AnimatedContent.vue?raw'; import code from '@/content/Animations/AnimatedContent/AnimatedContent.vue?raw';
import type { CodeObject } from '@/types/code'; import { createCodeObject } from '@/types/code';
export const animatedContent: CodeObject = { export const animatedContent = createCodeObject(code, 'Animations/AnimatedContent', {
cli: `npx jsrepo add https://vue-bits.dev/ui/Animations/AnimatedContent`,
installation: `npm install gsap`, installation: `npm install gsap`,
usage: `<template> usage: `<template>
<AnimatedContent <AnimatedContent
@@ -28,8 +27,7 @@ export const animatedContent: CodeObject = {
import AnimatedContent from "./AnimatedContent.vue"; import AnimatedContent from "./AnimatedContent.vue";
const handleComplete = () => { const handleComplete = () => {
console.log("Animation completed!"); console.log("Animation completed!");,
}; });
</script>`, </script>`
code });
};

View File

@@ -1,8 +1,7 @@
import code from '@/content/Animations/BlobCursor/BlobCursor.vue?raw'; import code from '@/content/Animations/BlobCursor/BlobCursor.vue?raw';
import type { CodeObject } from '../../../types/code'; import { createCodeObject } from '../../../types/code';
export const blobCursor: CodeObject = { export const blobCursor = createCodeObject(code, 'Animations/BlobCursor', {
cli: `npx jsrepo add https://vue-bits.dev/ui/Animations/BlobCursor`,
installation: `npm install gsap`, installation: `npm install gsap`,
usage: `<template> usage: `<template>
<BlobCursor <BlobCursor
@@ -27,6 +26,5 @@ export const blobCursor: CodeObject = {
<script setup lang="ts"> <script setup lang="ts">
import BlobCursor from "./BlobCursor.vue"; import BlobCursor from "./BlobCursor.vue";
</script>`, </script>`
code });
};

View File

@@ -1,8 +1,7 @@
import code from '@content/Animations/ClickSpark/ClickSpark.vue?raw'; import code from '@content/Animations/ClickSpark/ClickSpark.vue?raw';
import type { CodeObject } from '../../../types/code'; import { createCodeObject } from '@/types/code';
export const clickSpark: CodeObject = { export const clickSpark = createCodeObject(code, 'Animations/ClickSpark', {
cli: `npx jsrepo add https://vue-bits.dev/ui/Animations/ClickSpark`,
usage: `<template> usage: `<template>
<ClickSpark <ClickSpark
spark-color="#ff6b6b" spark-color="#ff6b6b"
@@ -42,6 +41,5 @@ import ClickSpark from '@/content/Animations/ClickSpark/ClickSpark.vue'
pointer-events: none; pointer-events: none;
user-select: none; user-select: none;
} }
</style>`, </style>`
code });
};

View File

@@ -1,8 +1,7 @@
import code from '@/content/Animations/CountUp/CountUp.vue?raw'; import code from '@/content/Animations/CountUp/CountUp.vue?raw';
import type { CodeObject } from '@/types/code'; import { createCodeObject } from '@/types/code';
export const countup: CodeObject = { export const countup = createCodeObject(code, 'Animations/CountUp', {
cli: `npx jsrepo add https://vue-bits.dev/ui/Animations/CountUp`,
usage: `<template> usage: `<template>
<CountUp <CountUp
:from="0" :from="0"
@@ -28,6 +27,5 @@ export const countup: CodeObject = {
const handleEnd = () => { const handleEnd = () => {
console.log("Count animation ended!"); console.log("Count animation ended!");
}; };
</script>`, </script>`
code });
};

View File

@@ -1,9 +1,8 @@
import code from '@/content/Animations/Crosshair/Crosshair.vue?raw'; import code from '@/content/Animations/Crosshair/Crosshair.vue?raw';
import type { CodeObject } from '@/types/code'; import { createCodeObject } from '@/types/code';
export const crosshair: CodeObject = { export const crosshair = createCodeObject(code, 'Animations/Crosshair', {
cli: `npx jsrepo add https://vue-bits.dev/ui/Animations/Crosshair`, installation: `npm install gsap`,
installation: `npm i gsap`,
usage: `<template> usage: `<template>
<div ref="containerRef" style="height: 300px; overflow: hidden;"> <div ref="containerRef" style="height: 300px; overflow: hidden;">
<Crosshair :container-ref="containerElement" color="#ffffff" /> <Crosshair :container-ref="containerElement" color="#ffffff" />
@@ -16,6 +15,5 @@ export const crosshair: CodeObject = {
const containerRef = useTemplateRef<HTMLDivElement>('containerRef'); const containerRef = useTemplateRef<HTMLDivElement>('containerRef');
const containerElement = computed(() => containerRef.value); const containerElement = computed(() => containerRef.value);
</script>`, </script>`
code });
};

View File

@@ -1,8 +1,7 @@
import code from '@content/Animations/Cubes/Cubes.vue?raw'; import code from '@content/Animations/Cubes/Cubes.vue?raw';
import type { CodeObject } from '../../../types/code'; import { createCodeObject } from '@/types/code';
export const cubes: CodeObject = { export const cubes = createCodeObject(code, 'Animations/Cubes', {
cli: `npx jsrepo add https://vue-bits.dev/ui/Animations/Cubes`,
installation: `npm install gsap`, installation: `npm install gsap`,
usage: `// CREDIT usage: `// CREDIT
// Component inspired from Can Tastemel's original work for the lambda.ai landing page // Component inspired from Can Tastemel's original work for the lambda.ai landing page
@@ -27,6 +26,5 @@ export const cubes: CodeObject = {
<script setup lang="ts"> <script setup lang="ts">
import Cubes from "./Cubes.vue"; import Cubes from "./Cubes.vue";
</script>`, </script>`
code });
};

View File

@@ -1,8 +1,7 @@
import code from '@content/Animations/FadeContent/FadeContent.vue?raw'; import code from '@content/Animations/FadeContent/FadeContent.vue?raw';
import type { CodeObject } from '../../../types/code'; import { createCodeObject } from '@/types/code';
export const fadeContent: CodeObject = { export const fadeContent = createCodeObject(code, 'Animations/FadeContent', {
cli: `npx jsrepo add https://vue-bits.dev/ui/Animations/FadeContent`,
usage: `<template> usage: `<template>
<FadeContent <FadeContent
:blur="true" :blur="true"
@@ -22,6 +21,5 @@ export const fadeContent: CodeObject = {
<script setup lang="ts"> <script setup lang="ts">
import FadeContent from "./FadeContent.vue"; import FadeContent from "./FadeContent.vue";
</script>`, </script>`
code });
};

View File

@@ -1,8 +1,7 @@
import code from '@/content/Animations/GlareHover/GlareHover.vue?raw'; import code from '@/content/Animations/GlareHover/GlareHover.vue?raw';
import type { CodeObject } from '@/types/code'; import { createCodeObject } from '@/types/code';
export const glareHover: CodeObject = { export const glareHover = createCodeObject(code, 'Animations/GlareHover', {
cli: `npx jsrepo add https://vue-bits.dev/ui/Animations/GlareHover`,
usage: `<template> usage: `<template>
<GlareHover <GlareHover
width="400px" width="400px"
@@ -24,6 +23,5 @@ export const glareHover: CodeObject = {
<script setup lang="ts"> <script setup lang="ts">
import GlareHover from "./GlareHover.vue"; import GlareHover from "./GlareHover.vue";
</script>`, </script>`
code });
};

View File

@@ -1,8 +1,7 @@
import code from '@/content/Animations/ImageTrail/ImageTrail.vue?raw'; import code from '@/content/Animations/ImageTrail/ImageTrail.vue?raw';
import type { CodeObject } from '../../../types/code'; import { createCodeObject } from '@/types/code';
export const imageTrail: CodeObject = { export const imageTrail = createCodeObject(code, 'Animations/ImageTrail', {
cli: `npx jsrepo add https://vue-bits.dev/ui/Animations/ImageTrail`,
installation: `npm install gsap`, installation: `npm install gsap`,
usage: `<template> usage: `<template>
<div :style="{ height: '500px', position: 'relative', overflow: 'hidden'}"> <div :style="{ height: '500px', position: 'relative', overflow: 'hidden'}">
@@ -24,6 +23,5 @@ export const imageTrail: CodeObject = {
<script setup lang="ts"> <script setup lang="ts">
import ImageTrail from "./ImageTrail.vue"; import ImageTrail from "./ImageTrail.vue";
</script>`, </script>`
code });
};

View File

@@ -1,8 +1,7 @@
import code from '@content/Animations/Magnet/Magnet.vue?raw'; import code from '@content/Animations/Magnet/Magnet.vue?raw';
import type { CodeObject } from '../../../types/code'; import { createCodeObject } from '@/types/code';
export const magnet: CodeObject = { export const magnet = createCodeObject(code, 'Animations/Magnet', {
cli: `npx jsrepo add https://vue-bits.dev/ui/Animations/Magnet`,
usage: `<template> usage: `<template>
<Magnet <Magnet
:padding="120" :padding="120"
@@ -43,6 +42,5 @@ import Magnet from '@/content/Animations/Magnet/Magnet.vue'
margin: 0; margin: 0;
opacity: 0.8; opacity: 0.8;
} }
</style>`, </style>`
code });
};

View File

@@ -1,8 +1,7 @@
import code from '@/content/Animations/MagnetLines/MagnetLines.vue?raw'; import code from '@/content/Animations/MagnetLines/MagnetLines.vue?raw';
import type { CodeObject } from '@/types/code'; import { createCodeObject } from '@/types/code';
export const magnetLines: CodeObject = { export const magnetLines = createCodeObject(code, 'Animations/MagnetLines', {
cli: `npx jsrepo add https://vue-bits.dev/ui/Animations/MagnetLines`,
usage: `<template> usage: `<template>
<MagnetLines <MagnetLines
:rows="10" :rows="10"
@@ -17,6 +16,5 @@ export const magnetLines: CodeObject = {
<script setup lang="ts"> <script setup lang="ts">
import MagnetLines from "./MagnetLines.vue"; import MagnetLines from "./MagnetLines.vue";
</script>`, </script>`
code });
};

View File

@@ -1,8 +1,7 @@
import code from '@/content/Animations/MetaBalls/MetaBalls.vue?raw'; import code from '@/content/Animations/MetaBalls/MetaBalls.vue?raw';
import type { CodeObject } from '../../../types/code'; import { createCodeObject } from '@/types/code';
export const metaBalls: CodeObject = { export const metaBalls = createCodeObject(code, 'Animations/MetaBalls', {
cli: `npx jsrepo add https://vue-bits.dev/ui/Animations/MetaBalls`,
installation: `npm install ogl`, installation: `npm install ogl`,
usage: `<template> usage: `<template>
<MetaBalls <MetaBalls
@@ -21,6 +20,5 @@ export const metaBalls: CodeObject = {
<script setup lang="ts"> <script setup lang="ts">
import MetaBalls from "./MetaBalls.vue"; import MetaBalls from "./MetaBalls.vue";
</script>`, </script>`
code });
};

View File

@@ -1,9 +1,8 @@
import code from '@content/Animations/MetallicPaint/MetallicPaint.vue?raw'; import code from '@content/Animations/MetallicPaint/MetallicPaint.vue?raw';
import utility from '@content/Animations/MetallicPaint/parseImage.ts?raw'; import utility from '@content/Animations/MetallicPaint/parseImage.ts?raw';
import type { CodeObject } from '../../../types/code'; import { createCodeObject } from '@/types/code';
export const metallicPaint: CodeObject = { export const metallicPaint = createCodeObject(code, 'Animations/MetallicPaint', {
cli: `npx jsrepo add https://vue-bits.dev/ui/Animations/MetallicPaint`,
usage: `<template> usage: `<template>
<MetallicPaint <MetallicPaint
:image-data="imageData" :image-data="imageData"
@@ -42,6 +41,5 @@ import { ref, onMounted } from 'vue';
} }
}); });
</script>`, </script>`,
code,
utility utility
}; });

View File

@@ -1,8 +1,7 @@
import code from '@content/Animations/Noise/Noise.vue?raw'; import code from '@content/Animations/Noise/Noise.vue?raw';
import type { CodeObject } from '../../../types/code'; import { createCodeObject } from '@/types/code';
export const noise: CodeObject = { export const noise = createCodeObject(code, 'Animations/Noise', {
cli: `npx jsrepo add https://vue-bits.dev/ui/Animations/Noise`,
usage: `<template> usage: `<template>
<Noise <Noise
:pattern-size="250" :pattern-size="250"
@@ -14,6 +13,5 @@ export const noise: CodeObject = {
<script setup lang="ts"> <script setup lang="ts">
import Noise from './Noise.vue' import Noise from './Noise.vue'
</script>`, </script>`
code });
};

View File

@@ -1,8 +1,7 @@
import code from '@/content/Animations/PixelTransition/PixelTransition.vue?raw'; import code from '@/content/Animations/PixelTransition/PixelTransition.vue?raw';
import type { CodeObject } from '@/types/code'; import { createCodeObject } from '@/types/code';
export const pixelTransition: CodeObject = { export const pixelTransition = createCodeObject(code, 'Animations/PixelTransition', {
cli: `npx jsrepo add https://vue-bits.dev/ui/Animations/PixelTransition`,
installation: `npm install gsap`, installation: `npm install gsap`,
usage: `<template> usage: `<template>
<PixelTransition <PixelTransition
@@ -24,6 +23,5 @@ export const pixelTransition: CodeObject = {
<script setup lang=\"ts\"> <script setup lang=\"ts\">
import PixelTransition from './PixelTransition.vue'; import PixelTransition from './PixelTransition.vue';
</script>`, </script>`
code });
};

View File

@@ -1,8 +1,7 @@
import code from '@content/Animations/Ribbons/Ribbons.vue?raw'; import code from '@content/Animations/Ribbons/Ribbons.vue?raw';
import type { CodeObject } from '../../../types/code'; import { createCodeObject } from '../../../types/code';
export const ribbons: CodeObject = { export const ribbons = createCodeObject(code, 'Animations/Ribbons', {
cli: `npx jsrepo add https://vue-bits.dev/ui/Animations/Ribbons`,
installation: `npm install ogl`, installation: `npm install ogl`,
usage: `<template> usage: `<template>
<Ribbons <Ribbons
@@ -23,6 +22,5 @@ export const ribbons: CodeObject = {
<script setup lang="ts"> <script setup lang="ts">
import Ribbons from "./Ribbons.vue"; import Ribbons from "./Ribbons.vue";
</script>`, </script>`
code });
};

View File

@@ -1,8 +1,7 @@
import code from '@/content/Animations/ShapeBlur/ShapeBlur.vue?raw'; import code from '@/content/Animations/ShapeBlur/ShapeBlur.vue?raw';
import type { CodeObject } from '../../../types/code'; import { createCodeObject } from '@/types/code';
export const shapeBlur: CodeObject = { export const shapeBlur = createCodeObject(code, 'Animations/ShapeBlur', {
cli: `npx jsrepo add https://vue-bits.dev/ui/Animations/ShapeBlur`,
installation: `npm install three @types/three`, installation: `npm install three @types/three`,
usage: `<template> usage: `<template>
<ShapeBlur <ShapeBlur
@@ -19,6 +18,5 @@ export const shapeBlur: CodeObject = {
<script setup lang="ts"> <script setup lang="ts">
import ShapeBlur from "./ShapeBlur.vue"; import ShapeBlur from "./ShapeBlur.vue";
</script>`, </script>`
code });
};

View File

@@ -1,8 +1,7 @@
import code from '@content/Animations/SplashCursor/SplashCursor.vue?raw'; import code from '@content/Animations/SplashCursor/SplashCursor.vue?raw';
import type { CodeObject } from '../../../types/code'; import { createCodeObject } from '@/types/code';
export const splashCursor: CodeObject = { export const splashCursor = createCodeObject(code, 'Animations/SplashCursor', {
cli: `npx jsrepo add https://vue-bits.dev/ui/Animations/SplashCursor`,
usage: `<template> usage: `<template>
<SplashCursor <SplashCursor
:SIM_RESOLUTION="128" :SIM_RESOLUTION="128"
@@ -24,6 +23,5 @@ export const splashCursor: CodeObject = {
<script setup lang="ts"> <script setup lang="ts">
import SplashCursor from "./SplashCursor.vue"; import SplashCursor from "./SplashCursor.vue";
</script>`, </script>`
code });
};

View File

@@ -1,8 +1,7 @@
import code from '@content/Animations/StarBorder/StarBorder.vue?raw'; import code from '@content/Animations/StarBorder/StarBorder.vue?raw';
import type { CodeObject } from '../../../types/code'; import { createCodeObject } from '@/types/code';
export const starBorder: CodeObject = { export const starBorder = createCodeObject(code, 'Animations/StarBorder', {
cli: `npx jsrepo add https://vue-bits.dev/ui/Animations/StarBorder`,
usage: `<template> usage: `<template>
<StarBorder <StarBorder
as="button" as="button"
@@ -16,6 +15,5 @@ export const starBorder: CodeObject = {
<script setup lang="ts"> <script setup lang="ts">
import StarBorder from './StarBorder.vue' import StarBorder from './StarBorder.vue'
</script>`, </script>`
code });
};

View File

@@ -1,8 +1,7 @@
import code from '@/content/Animations/TargetCursor/TargetCursor.vue?raw'; import code from '@/content/Animations/TargetCursor/TargetCursor.vue?raw';
import type { CodeObject } from '../../../types/code'; import { createCodeObject } from '@/types/code';
export const targetCursor: CodeObject = { export const targetCursor = createCodeObject(code, 'Animations/TargetCursor', {
cli: `npx jsrepo add https://vue-bits.dev/ui/Animations/TargetCursor`,
installation: `npm install gsap`, installation: `npm install gsap`,
usage: `<template> usage: `<template>
<TargetCursor <TargetCursor
@@ -17,6 +16,5 @@ export const targetCursor: CodeObject = {
<script setup lang="ts"> <script setup lang="ts">
import TargetCursor from "./TargetCursor.vue"; import TargetCursor from "./TargetCursor.vue";
</script>`, </script>`
code });
};

View File

@@ -1,8 +1,7 @@
import code from '@content/Backgrounds/Aurora/Aurora.vue?raw'; import code from '@content/Backgrounds/Aurora/Aurora.vue?raw';
import type { CodeObject } from '../../../types/code'; import { createCodeObject } from '../../../types/code';
export const aurora: CodeObject = { export const aurora = createCodeObject(code, 'Backgrounds/Aurora', {
cli: `npx jsrepo add https://vue-bits.dev/ui/Backgrounds/Aurora`,
installation: `npm install ogl`, installation: `npm install ogl`,
usage: `<template> usage: `<template>
<div class="aurora-container"> <div class="aurora-container">
@@ -28,6 +27,5 @@ export const aurora: CodeObject = {
position: relative; position: relative;
overflow: hidden; overflow: hidden;
} }
</style>`, </style>`
code });
};

View File

@@ -1,8 +1,7 @@
import code from '@content/Backgrounds/Balatro/Balatro.vue?raw'; import code from '@content/Backgrounds/Balatro/Balatro.vue?raw';
import type { CodeObject } from '../../../types/code'; import { createCodeObject } from '../../../types/code';
export const balatro: CodeObject = { export const balatro = createCodeObject(code, 'Backgrounds/Balatro', {
cli: `npx jsrepo add https://vue-bits.dev/ui/Backgrounds/Balatro`,
installation: `npm install ogl`, installation: `npm install ogl`,
usage: `<template> usage: `<template>
<Balatro <Balatro
@@ -14,6 +13,5 @@ export const balatro: CodeObject = {
<script setup lang="ts"> <script setup lang="ts">
import Balatro from "./Balatro.vue"; import Balatro from "./Balatro.vue";
</script>`, </script>`
code });
};

View File

@@ -1,8 +1,7 @@
import code from '@content/Backgrounds/Ballpit/Ballpit.vue?raw'; import code from '@content/Backgrounds/Ballpit/Ballpit.vue?raw';
import type { CodeObject } from '../../../types/code'; import { createCodeObject } from '../../../types/code';
export const ballpit: CodeObject = { export const ballpit = createCodeObject(code, 'Backgrounds/Ballpit', {
cli: `npx jsrepo add https://vue-bits.dev/ui/Backgrounds/Ballpit`,
installation: `npm install three @types/three gsap`, installation: `npm install three @types/three gsap`,
usage: `//Component inspired by Kevin Levron: usage: `//Component inspired by Kevin Levron:
//https://x.com/soju22/status/1858925191671271801 //https://x.com/soju22/status/1858925191671271801
@@ -21,6 +20,5 @@ export const ballpit: CodeObject = {
<script setup lang="ts"> <script setup lang="ts">
import Ballpit from "./Ballpit.vue"; import Ballpit from "./Ballpit.vue";
</script>`, </script>`
code });
};

View File

@@ -1,8 +1,7 @@
import code from '@content/Backgrounds/Beams/Beams.vue?raw'; import code from '@content/Backgrounds/Beams/Beams.vue?raw';
import type { CodeObject } from '../../../types/code'; import { createCodeObject } from '../../../types/code';
export const beams: CodeObject = { export const beams = createCodeObject(code, 'Backgrounds/Beams', {
cli: `npx jsrepo add https://vue-bits.dev/ui/Backgrounds/Beams`,
installation: `npm install three @types/three`, installation: `npm install three @types/three`,
usage: `<template> usage: `<template>
<div class="beams-container"> <div class="beams-container">
@@ -31,6 +30,5 @@ export const beams: CodeObject = {
overflow: hidden; overflow: hidden;
background: #000; background: #000;
} }
</style>`, </style>`
code });
};

View File

@@ -1,8 +1,7 @@
import code from '@content/Backgrounds/DarkVeil/DarkVeil.vue?raw'; import code from '@content/Backgrounds/DarkVeil/DarkVeil.vue?raw';
import type { CodeObject } from '../../../types/code'; import { createCodeObject } from '../../../types/code';
export const darkVeil: CodeObject = { export const darkVeil = createCodeObject(code, 'Backgrounds/DarkVeil', {
cli: `npx jsrepo add https://vue-bits.dev/ui/Backgrounds/DarkVeil`,
installation: `npm install ogl`, installation: `npm install ogl`,
usage: `<template> usage: `<template>
<div style="width: 100%; height: 600px; position: relative"> <div style="width: 100%; height: 600px; position: relative">
@@ -20,6 +19,5 @@ export const darkVeil: CodeObject = {
<script setup lang="ts"> <script setup lang="ts">
import DarkVeil from "./DarkVeil.vue"; import DarkVeil from "./DarkVeil.vue";
</script>`, </script>`
code });
};

View File

@@ -1,8 +1,7 @@
import code from '@content/Backgrounds/Dither/Dither.vue?raw'; import code from '@content/Backgrounds/Dither/Dither.vue?raw';
import type { CodeObject } from '../../../types/code'; import { createCodeObject } from '../../../types/code';
export const dither: CodeObject = { export const dither = createCodeObject(code, 'Backgrounds/Dither', {
cli: `npx jsrepo add https://vue-bits.dev/ui/Backgrounds/Dither`,
installation: `npm install ogl`, installation: `npm install ogl`,
usage: `<template> usage: `<template>
<div class="relative w-full h-[500px] overflow-hidden"> <div class="relative w-full h-[500px] overflow-hidden">
@@ -22,6 +21,5 @@ export const dither: CodeObject = {
<script setup lang="ts"> <script setup lang="ts">
import Dither from "./Dither.vue"; import Dither from "./Dither.vue";
</script>`, </script>`
code });
};

View File

@@ -1,8 +1,7 @@
import code from '@content/Backgrounds/DotGrid/DotGrid.vue?raw'; import code from '@content/Backgrounds/DotGrid/DotGrid.vue?raw';
import type { CodeObject } from '../../../types/code'; import { createCodeObject } from '../../../types/code';
export const dotGrid: CodeObject = { export const dotGrid = createCodeObject(code, 'Backgrounds/DotGrid', {
cli: `npx jsrepo add https://vue-bits.dev/ui/Backgrounds/DotGrid`,
installation: `npm install gsap`, installation: `npm install gsap`,
usage: `<template> usage: `<template>
<div class="dot-grid-container"> <div class="dot-grid-container">
@@ -34,6 +33,5 @@ export const dotGrid: CodeObject = {
position: relative; position: relative;
overflow: hidden; overflow: hidden;
} }
</style>`, </style>`
code });
};

View File

@@ -1,8 +1,7 @@
import code from '@content/Backgrounds/GridDistortion/GridDistortion.vue?raw'; import code from '@content/Backgrounds/GridDistortion/GridDistortion.vue?raw';
import type { CodeObject } from '../../../types/code'; import { createCodeObject } from '../../../types/code';
export const gridDistortion: CodeObject = { export const gridDistortion = createCodeObject(code, 'Backgrounds/GridDistortion', {
cli: `npx jsrepo add https://vue-bits.dev/ui/Backgrounds/GridDistortion`,
installation: `npm install three @types/three`, installation: `npm install three @types/three`,
usage: `<template> usage: `<template>
<div class="relative w-full h-[600px]"> <div class="relative w-full h-[600px]">
@@ -19,6 +18,5 @@ export const gridDistortion: CodeObject = {
<script setup lang="ts"> <script setup lang="ts">
import GridDistortion from "./GridDistortion.vue"; import GridDistortion from "./GridDistortion.vue";
</script>`, </script>`
code });
};

View File

@@ -1,8 +1,7 @@
import code from '@content/Backgrounds/GridMotion/GridMotion.vue?raw'; import code from '@content/Backgrounds/GridMotion/GridMotion.vue?raw';
import type { CodeObject } from '../../../types/code'; import { createCodeObject } from '../../../types/code';
export const gridMotion: CodeObject = { export const gridMotion = createCodeObject(code, 'Backgrounds/GridMotion', {
cli: `npx jsrepo add https://vue-bits.dev/ui/Backgrounds/GridMotion`,
installation: `npm install gsap`, installation: `npm install gsap`,
usage: `<template> usage: `<template>
<GridMotion <GridMotion
@@ -16,6 +15,5 @@ export const gridMotion: CodeObject = {
const imageUrl = 'https://images.unsplash.com/photo-1723403804231-f4e9b515fe9d?q=80&w=3870&auto=format&fit=crop&ixlib=rb-4.0.3&ixid=M3wxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8fA%3D%3D'; const imageUrl = 'https://images.unsplash.com/photo-1723403804231-f4e9b515fe9d?q=80&w=3870&auto=format&fit=crop&ixlib=rb-4.0.3&ixid=M3wxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8fA%3D%3D';
const numberOfImages = 30; const numberOfImages = 30;
const images = Array.from({ length: numberOfImages }, () => imageUrl); const images = Array.from({ length: numberOfImages }, () => imageUrl);
</script>`, </script>`
code });
};

View File

@@ -1,8 +1,7 @@
import code from '@content/Backgrounds/Hyperspeed/Hyperspeed.vue?raw'; import code from '@content/Backgrounds/Hyperspeed/Hyperspeed.vue?raw';
import type { CodeObject } from '../../../types/code'; import { createCodeObject } from '../../../types/code';
export const hyperspeed: CodeObject = { export const hyperspeed = createCodeObject(code, 'Backgrounds/Hyperspeed', {
cli: `npx jsrepo add https://vue-bits.dev/ui/Backgrounds/Hyperspeed`,
installation: `npm install three postprocessing`, installation: `npm install three postprocessing`,
usage: `<template> usage: `<template>
<div class="hyperspeed-container"> <div class="hyperspeed-container">
@@ -62,6 +61,5 @@ export const hyperspeed: CodeObject = {
height: 100%; height: 100%;
cursor: pointer; cursor: pointer;
} }
</style>`, </style>`
code });
};

View File

@@ -1,8 +1,7 @@
import code from '@content/Backgrounds/Iridescence/Iridescence.vue?raw'; import code from '@content/Backgrounds/Iridescence/Iridescence.vue?raw';
import type { CodeObject } from '../../../types/code'; import { createCodeObject } from '../../../types/code';
export const iridescence: CodeObject = { export const iridescence = createCodeObject(code, 'Backgrounds/Iridescence', {
cli: `npx jsrepo add https://vue-bits.dev/ui/Backgrounds/Iridescence`,
installation: `npm install ogl`, installation: `npm install ogl`,
usage: `<template> usage: `<template>
<div class="w-full h-[400px]"> <div class="w-full h-[400px]">
@@ -17,6 +16,5 @@ export const iridescence: CodeObject = {
<script setup lang="ts"> <script setup lang="ts">
import Iridescence from "./Iridescence.vue"; import Iridescence from "./Iridescence.vue";
</script>`, </script>`
code });
};

View File

@@ -1,8 +1,7 @@
import code from '@content/Backgrounds/LetterGlitch/LetterGlitch.vue?raw'; import code from '@content/Backgrounds/LetterGlitch/LetterGlitch.vue?raw';
import type { CodeObject } from '../../../types/code'; import { createCodeObject } from '../../../types/code';
export const letterGlitch: CodeObject = { export const letterGlitch = createCodeObject(code, 'Backgrounds/LetterGlitch', {
cli: `npx jsrepo add https://vue-bits.dev/ui/Backgrounds/LetterGlitch`,
usage: `<template> usage: `<template>
<div class="letter-glitch-container"> <div class="letter-glitch-container">
<LetterGlitch <LetterGlitch
@@ -27,6 +26,5 @@ export const letterGlitch: CodeObject = {
position: relative; position: relative;
overflow: hidden; overflow: hidden;
} }
</style>`, </style>`
code });
};

View File

@@ -1,8 +1,7 @@
import code from '@content/Backgrounds/Lightning/Lightning.vue?raw'; import code from '@content/Backgrounds/Lightning/Lightning.vue?raw';
import type { CodeObject } from '../../../types/code'; import { createCodeObject } from '../../../types/code';
export const lightning: CodeObject = { export const lightning = createCodeObject(code, 'Backgrounds/Lightning', {
cli: `npx jsrepo add https://vue-bits.dev/ui/Backgrounds/Lightning`,
installation: `No additional dependencies required`, installation: `No additional dependencies required`,
usage: `<template> usage: `<template>
<div class="lightning-container"> <div class="lightning-container">
@@ -28,6 +27,5 @@ export const lightning: CodeObject = {
position: relative; position: relative;
overflow: hidden; overflow: hidden;
} }
</style>`, </style>`
code });
};

View File

@@ -1,8 +1,7 @@
import code from '@content/Backgrounds/LiquidChrome/LiquidChrome.vue?raw'; import code from '@content/Backgrounds/LiquidChrome/LiquidChrome.vue?raw';
import type { CodeObject } from '../../../types/code'; import { createCodeObject } from '../../../types/code';
export const liquidChrome: CodeObject = { export const liquidChrome = createCodeObject(code, 'Backgrounds/LiquidChrome', {
cli: `npx jsrepo add https://vue-bits.dev/ui/Backgrounds/LiquidChrome`,
installation: `npm install ogl`, installation: `npm install ogl`,
usage: `<template> usage: `<template>
<div class="relative w-full h-[600px]"> <div class="relative w-full h-[600px]">
@@ -17,6 +16,5 @@ export const liquidChrome: CodeObject = {
<script setup lang="ts"> <script setup lang="ts">
import LiquidChrome from "./LiquidChrome.vue"; import LiquidChrome from "./LiquidChrome.vue";
</script>`, </script>`
code });
};

View File

@@ -1,8 +1,7 @@
import code from '@content/Backgrounds/Orb/Orb.vue?raw'; import code from '@content/Backgrounds/Orb/Orb.vue?raw';
import type { CodeObject } from '../../../types/code'; import { createCodeObject } from '../../../types/code';
export const orb: CodeObject = { export const orb = createCodeObject(code, 'Backgrounds/Orb', {
cli: `npx jsrepo add https://vue-bits.dev/ui/Backgrounds/Orb`,
installation: `npm install ogl`, installation: `npm install ogl`,
usage: `<template> usage: `<template>
<div class="relative w-full h-[600px]"> <div class="relative w-full h-[600px]">
@@ -12,6 +11,5 @@ export const orb: CodeObject = {
<script setup lang="ts"> <script setup lang="ts">
import Orb from "./Orb.vue"; import Orb from "./Orb.vue";
</script>`, </script>`
code });
};

View File

@@ -1,8 +1,7 @@
import code from '@content/Backgrounds/Particles/Particles.vue?raw'; import code from '@content/Backgrounds/Particles/Particles.vue?raw';
import type { CodeObject } from '../../../types/code'; import { createCodeObject } from '../../../types/code';
export const particles: CodeObject = { export const particles = createCodeObject(code, 'Backgrounds/Particles', {
cli: `npx jsrepo add https://vue-bits.dev/ui/Backgrounds/Particles`,
installation: `npm install ogl`, installation: `npm install ogl`,
usage: `<template> usage: `<template>
<div class="particles-container"> <div class="particles-container">
@@ -34,6 +33,5 @@ export const particles: CodeObject = {
position: relative; position: relative;
overflow: hidden; overflow: hidden;
} }
</style>`, </style>`
code });
};

View File

@@ -1,8 +1,7 @@
import code from '@content/Backgrounds/RippleGrid/RippleGrid.vue?raw'; import code from '@content/Backgrounds/RippleGrid/RippleGrid.vue?raw';
import type { CodeObject } from '../../../types/code'; import { createCodeObject } from '../../../types/code';
export const rippleGrid: CodeObject = { export const rippleGrid = createCodeObject(code, 'Backgrounds/RippleGrid', {
cli: `npx jsrepo add https://vue-bits.dev/ui/Backgrounds/RippleGrid`,
installation: `npm install ogl`, installation: `npm install ogl`,
usage: `<template> usage: `<template>
<div class="relative overflow-hidden h-[600px]"> <div class="relative overflow-hidden h-[600px]">
@@ -21,6 +20,5 @@ export const rippleGrid: CodeObject = {
<script setup lang="ts"> <script setup lang="ts">
import RippleGrid from "./RippleGrid.vue"; import RippleGrid from "./RippleGrid.vue";
</script>`, </script>`
code });
};

View File

@@ -1,8 +1,7 @@
import code from '@content/Backgrounds/Silk/Silk.vue?raw'; import code from '@content/Backgrounds/Silk/Silk.vue?raw';
import type { CodeObject } from '../../../types/code'; import { createCodeObject } from '../../../types/code';
export const silk: CodeObject = { export const silk = createCodeObject(code, 'Backgrounds/Silk', {
cli: `npx jsrepo add https://vue-bits.dev/ui/Backgrounds/Silk`,
installation: `npm install ogl`, installation: `npm install ogl`,
usage: `<template> usage: `<template>
<div class="silk-container"> <div class="silk-container">
@@ -28,6 +27,5 @@ export const silk: CodeObject = {
position: relative; position: relative;
overflow: hidden; overflow: hidden;
} }
</style>`, </style>`
code });
};

View File

@@ -1,8 +1,7 @@
import code from '@content/Backgrounds/Squares/Squares.vue?raw'; import code from '@content/Backgrounds/Squares/Squares.vue?raw';
import type { CodeObject } from '../../../types/code'; import { createCodeObject } from '../../../types/code';
export const squares: CodeObject = { export const squares = createCodeObject(code, 'Backgrounds/Squares', {
cli: `npx jsrepo add https://vue-bits.dev/ui/Backgrounds/Squares`,
usage: `<template> usage: `<template>
<div class="w-full h-[400px]"> <div class="w-full h-[400px]">
<Squares <Squares
@@ -17,6 +16,5 @@ export const squares: CodeObject = {
<script setup lang="ts"> <script setup lang="ts">
import Squares from "./Squares.vue"; import Squares from "./Squares.vue";
</script>`, </script>`
code });
};

View File

@@ -1,8 +1,7 @@
import code from '@content/Backgrounds/Threads/Threads.vue?raw'; import code from '@content/Backgrounds/Threads/Threads.vue?raw';
import type { CodeObject } from '../../../types/code'; import { createCodeObject } from '../../../types/code';
export const threads: CodeObject = { export const threads = createCodeObject(code, 'Backgrounds/Threads', {
cli: `npx jsrepo add https://vue-bits.dev/ui/Backgrounds/Threads`,
installation: `npm install ogl`, installation: `npm install ogl`,
usage: `<template> usage: `<template>
<div class="w-full h-[400px]"> <div class="w-full h-[400px]">
@@ -17,6 +16,5 @@ export const threads: CodeObject = {
<script setup lang="ts"> <script setup lang="ts">
import Threads from "./Threads.vue"; import Threads from "./Threads.vue";
</script>`, </script>`
code });
};

View File

@@ -1,8 +1,7 @@
import code from '@content/Backgrounds/Waves/Waves.vue?raw'; import code from '@content/Backgrounds/Waves/Waves.vue?raw';
import type { CodeObject } from '../../../types/code'; import { createCodeObject } from '../../../types/code';
export const waves: CodeObject = { export const waves = createCodeObject(code, 'Backgrounds/Waves', {
cli: `npx jsrepo add https://vue-bits.dev/ui/Backgrounds/Waves`,
usage: `<template> usage: `<template>
<div class="waves-container"> <div class="waves-container">
<Waves <Waves
@@ -33,6 +32,5 @@ export const waves: CodeObject = {
position: relative; position: relative;
overflow: hidden; overflow: hidden;
} }
</style>`, </style>`
code });
};

View File

@@ -1,8 +1,7 @@
import code from '@content/Components/AnimatedList/AnimatedList.vue?raw'; import code from '@content/Components/AnimatedList/AnimatedList.vue?raw';
import type { CodeObject } from '../../../types/code'; import { createCodeObject } from '../../../types/code';
export const animatedList: CodeObject = { export const animatedList = createCodeObject(code, 'Components/AnimatedList', {
cli: `npx jsrepo add https://vue-bits.dev/ui/Components/AnimatedList`,
installation: `npm install motion-v`, installation: `npm install motion-v`,
usage: `<template> usage: `<template>
<AnimatedList <AnimatedList
@@ -22,6 +21,5 @@ const items = [
'Item 6', 'Item 7', 'Item 8', 'Item 9', 'Item 10', 'Item 6', 'Item 7', 'Item 8', 'Item 9', 'Item 10',
'Item 11', 'Item 12', 'Item 13', 'Item 14', 'Item 15' 'Item 11', 'Item 12', 'Item 13', 'Item 14', 'Item 15'
] ]
</script>`, </script>`
code });
};

View File

@@ -1,8 +1,7 @@
import code from '@content/Components/CardSwap/CardSwap.vue?raw'; import code from '@content/Components/CardSwap/CardSwap.vue?raw';
import type { CodeObject } from '../../../types/code'; import { createCodeObject } from '../../../types/code';
export const cardSwap: CodeObject = { export const cardSwap = createCodeObject(code, 'Components/CardSwap', {
cli: `npx jsrepo add https://vue-bits.dev/ui/Components/CardSwap`,
installation: `npm install gsap`, installation: `npm install gsap`,
usage: `<template> usage: `<template>
<CardSwap <CardSwap
@@ -49,6 +48,5 @@ export const cardSwap: CodeObject = {
const handleCardClick = (index: number) => { const handleCardClick = (index: number) => {
console.log(\`Card \${index} clicked\`); console.log(\`Card \${index} clicked\`);
}; };
</script>`, </script>`
code });
};

View File

@@ -1,8 +1,7 @@
import code from '@content/Components/Carousel/Carousel.vue?raw'; import code from '@content/Components/Carousel/Carousel.vue?raw';
import type { CodeObject } from '../../../types/code'; import { createCodeObject } from '../../../types/code';
export const carousel: CodeObject = { export const carousel = createCodeObject(code, 'Components/Carousel', {
cli: `npx jsrepo add https://vue-bits.dev/ui/Components/Carousel`,
installation: `npm install motion-v`, installation: `npm install motion-v`,
usage: `<template> usage: `<template>
<Carousel <Carousel
@@ -35,6 +34,5 @@ export const carousel: CodeObject = {
}, },
// Add more items as needed // Add more items as needed
]; ];
</script>`, </script>`
code });
};

View File

@@ -1,8 +1,7 @@
import code from '@content/Components/ChromaGrid/ChromaGrid.vue?raw'; import code from '@content/Components/ChromaGrid/ChromaGrid.vue?raw';
import type { CodeObject } from '../../../types/code'; import { createCodeObject } from '../../../types/code';
export const chromaGrid: CodeObject = { export const chromaGrid = createCodeObject(code, 'Components/ChromaGrid', {
cli: `npx jsrepo add https://vue-bits.dev/ui/Components/ChromaGrid`,
installation: `npm install gsap`, installation: `npm install gsap`,
usage: `<template> usage: `<template>
<div class="w-[600px] relative"> <div class="w-[600px] relative">
@@ -39,6 +38,5 @@ export const chromaGrid: CodeObject = {
url: "https://linkedin.com/in/mikechen" url: "https://linkedin.com/in/mikechen"
} }
] ]
</script>`, </script>`
code });
};

View File

@@ -1,8 +1,7 @@
import code from '@content/Components/CircularGallery/CircularGallery.vue?raw'; import code from '@content/Components/CircularGallery/CircularGallery.vue?raw';
import type { CodeObject } from '../../../types/code'; import { createCodeObject } from '../../../types/code';
export const circularGallery: CodeObject = { export const circularGallery = createCodeObject(code, 'Components/CircularGallery', {
cli: `npx jsrepo add https://vue-bits.dev/ui/Components/CircularGallery`,
installation: `npm install ogl`, installation: `npm install ogl`,
usage: `<template> usage: `<template>
<CircularGallery <CircularGallery
@@ -22,6 +21,5 @@ export const circularGallery: CodeObject = {
<script setup lang="ts"> <script setup lang="ts">
import CircularGallery from "./CircularGallery.vue"; import CircularGallery from "./CircularGallery.vue";
</script>`, </script>`
code });
};

View File

@@ -1,8 +1,7 @@
import code from '@content/Components/DecayCard/DecayCard.vue?raw'; import code from '@content/Components/DecayCard/DecayCard.vue?raw';
import type { CodeObject } from '../../../types/code'; import { createCodeObject } from '../../../types/code';
export const decayCard: CodeObject = { export const decayCard = createCodeObject(code, 'Components/DecayCard', {
cli: `npx jsrepo add https://vue-bits.dev/ui/Components/DecayCard`,
installation: `npm install gsap`, installation: `npm install gsap`,
usage: `<template> usage: `<template>
<DecayCard <DecayCard
@@ -18,6 +17,5 @@ export const decayCard: CodeObject = {
<script setup lang="ts"> <script setup lang="ts">
import DecayCard from "./DecayCard.vue"; import DecayCard from "./DecayCard.vue";
</script>`, </script>`
code });
};

View File

@@ -1,8 +1,7 @@
import code from '@content/Components/Dock/Dock.vue?raw'; import code from '@content/Components/Dock/Dock.vue?raw';
import type { CodeObject } from '../../../types/code'; import { createCodeObject } from '../../../types/code';
export const dock: CodeObject = { export const dock = createCodeObject(code, 'Components/Dock', {
cli: `npx jsrepo add https://vue-bits.dev/ui/Components/Dock`,
installation: `npm install motion-v`, installation: `npm install motion-v`,
usage: `<template> usage: `<template>
<Dock <Dock
@@ -42,6 +41,5 @@ export const dock: CodeObject = {
onClick: () => console.log('Settings clicked!') onClick: () => console.log('Settings clicked!')
}, },
]; ];
</script>`, </script>`
code });
};

View File

@@ -1,8 +1,7 @@
import code from '@content/Components/ElasticSlider/ElasticSlider.vue?raw'; import code from '@content/Components/ElasticSlider/ElasticSlider.vue?raw';
import type { CodeObject } from '../../../types/code'; import { createCodeObject } from '../../../types/code';
export const elasticSlider: CodeObject = { export const elasticSlider = createCodeObject(code, 'Components/ElasticSlider', {
cli: `npx jsrepo add https://vue-bits.dev/ui/Components/ElasticSlider`,
usage: `<template> usage: `<template>
<ElasticSlider <ElasticSlider
:default-value="75" :default-value="75"
@@ -25,6 +24,5 @@ export const elasticSlider: CodeObject = {
<script setup lang="ts"> <script setup lang="ts">
import ElasticSlider from "./ElasticSlider.vue"; import ElasticSlider from "./ElasticSlider.vue";
</script>`, </script>`
code });
};

View File

@@ -1,8 +1,7 @@
import code from '@content/Components/FlowingMenu/FlowingMenu.vue?raw'; import code from '@content/Components/FlowingMenu/FlowingMenu.vue?raw';
import type { CodeObject } from '../../../types/code'; import { createCodeObject } from '../../../types/code';
export const flowingMenu: CodeObject = { export const flowingMenu = createCodeObject(code, 'Components/FlowingMenu', {
cli: `npx jsrepo add https://vue-bits.dev/ui/Components/FlowingMenu`,
installation: `npm install gsap`, installation: `npm install gsap`,
usage: `<template> usage: `<template>
<FlowingMenu :items="items" /> <FlowingMenu :items="items" />
@@ -17,6 +16,5 @@ export const flowingMenu: CodeObject = {
{ link: '#', text: 'Monterey', image: 'https://picsum.photos/600/400?random=3' }, { link: '#', text: 'Monterey', image: 'https://picsum.photos/600/400?random=3' },
{ link: '#', text: 'Sequoia', image: 'https://picsum.photos/600/400?random=4' } { link: '#', text: 'Sequoia', image: 'https://picsum.photos/600/400?random=4' }
]; ];
</script>`, </script>`
code });
};

View File

@@ -1,8 +1,7 @@
import code from '@content/Components/FlyingPosters/FlyingPosters.vue?raw'; import code from '@content/Components/FlyingPosters/FlyingPosters.vue?raw';
import type { CodeObject } from '../../../types/code'; import { createCodeObject } from '../../../types/code';
export const flyingPosters: CodeObject = { export const flyingPosters = createCodeObject(code, 'Components/FlyingPosters', {
cli: `npx jsrepo add https://vue-bits.dev/ui/Components/FlyingPosters`,
installation: `npm install ogl`, installation: `npm install ogl`,
usage: `<template> usage: `<template>
<FlyingPosters <FlyingPosters
@@ -32,6 +31,5 @@ export const flyingPosters: CodeObject = {
'https://picsum.photos/800/800?grayscale&random=9', 'https://picsum.photos/800/800?grayscale&random=9',
'https://picsum.photos/800/800?grayscale&random=10', 'https://picsum.photos/800/800?grayscale&random=10',
]; ];
</script>`, </script>`
code });
};

View File

@@ -1,8 +1,7 @@
import code from '@content/Components/Folder/Folder.vue?raw'; import code from '@content/Components/Folder/Folder.vue?raw';
import type { CodeObject } from '../../../types/code'; import { createCodeObject } from '../../../types/code';
export const folder: CodeObject = { export const folder = createCodeObject(code, 'Components/Folder', {
cli: `npx jsrepo add https://vue-bits.dev/ui/Components/Folder`,
usage: `<template> usage: `<template>
<Folder :items="items" :size="2" color="#5227FF" class="my-folder-class" /> <Folder :items="items" :size="2" color="#5227FF" class="my-folder-class" />
</template> </template>
@@ -11,6 +10,5 @@ export const folder: CodeObject = {
import Folder from "./Folder.vue"; import Folder from "./Folder.vue";
const items = ['Doc 1', 'Doc 2', 'Doc 3']; const items = ['Doc 1', 'Doc 2', 'Doc 3'];
</script>`, </script>`
code });
};

View File

@@ -1,8 +1,7 @@
import code from '@content/Components/GlassIcons/GlassIcons.vue?raw'; import code from '@content/Components/GlassIcons/GlassIcons.vue?raw';
import type { CodeObject } from '../../../types/code'; import { createCodeObject } from '../../../types/code';
export const glassIcons: CodeObject = { export const glassIcons = createCodeObject(code, 'Components/GlassIcons', {
cli: `npx jsrepo add https://vue-bits.dev/ui/Components/GlassIcons`,
usage: `<template> usage: `<template>
<GlassIcons :items="items" class="my-glass-icons" /> <GlassIcons :items="items" class="my-glass-icons" />
</template> </template>
@@ -18,6 +17,5 @@ export const glassIcons: CodeObject = {
{ icon: 'pi pi-pencil', color: 'orange', label: 'Notes' }, { icon: 'pi pi-pencil', color: 'orange', label: 'Notes' },
{ icon: 'pi pi-chart-bar', color: 'green', label: 'Stats' } { icon: 'pi pi-chart-bar', color: 'green', label: 'Stats' }
]; ];
</script>`, </script>`
code });
};

View File

@@ -1,8 +1,7 @@
import code from '@content/Components/GooeyNav/GooeyNav.vue?raw'; import code from '@content/Components/GooeyNav/GooeyNav.vue?raw';
import type { CodeObject } from '../../../types/code'; import { createCodeObject } from '../../../types/code';
export const gooeyNav: CodeObject = { export const gooeyNav = createCodeObject(code, 'Components/GooeyNav', {
cli: `npx jsrepo add https://vue-bits.dev/ui/Components/GooeyNav`,
usage: `<template> usage: `<template>
<GooeyNav <GooeyNav
:items="navItems" :items="navItems"
@@ -35,6 +34,5 @@ export const gooeyNav: CodeObject = {
--color-3: #45b7d1; --color-3: #45b7d1;
--color-4: #f9ca24; --color-4: #f9ca24;
} }
</style>`, </style>`
code });
};

View File

@@ -1,8 +1,7 @@
import code from '@content/Components/InfiniteScroll/InfiniteScroll.vue?raw'; import code from '@content/Components/InfiniteScroll/InfiniteScroll.vue?raw';
import type { CodeObject } from '../../../types/code'; import { createCodeObject } from '../../../types/code';
export const infiniteScroll: CodeObject = { export const infiniteScroll = createCodeObject(code, 'Components/InfiniteScroll', {
cli: `npx jsrepo add https://vue-bits.dev/ui/Components/InfiniteScroll`,
installation: `npm install gsap`, installation: `npm install gsap`,
usage: `<template> usage: `<template>
<InfiniteScroll <InfiniteScroll
@@ -29,6 +28,5 @@ export const infiniteScroll: CodeObject = {
{ content: "Item 3" }, { content: "Item 3" },
// Add more items as needed // Add more items as needed
]; ];
</script>`, </script>`
code });
};

View File

@@ -1,8 +1,7 @@
import code from '@content/Components/MagicBento/MagicBento.vue?raw'; import code from '@content/Components/MagicBento/MagicBento.vue?raw';
import type { CodeObject } from '../../../types/code'; import { createCodeObject } from '../../../types/code';
export const magicBento: CodeObject = { export const magicBento = createCodeObject(code, 'Components/MagicBento', {
cli: `npx jsrepo add https://vue-bits.dev/ui/Components/MagicBento`,
installation: `npm install gsap`, installation: `npm install gsap`,
usage: `<template> usage: `<template>
<MagicBento <MagicBento
@@ -21,6 +20,5 @@ export const magicBento: CodeObject = {
<script setup lang="ts"> <script setup lang="ts">
import MagicBento from "./MagicBento.vue"; import MagicBento from "./MagicBento.vue";
</script>`, </script>`
code });
};

View File

@@ -1,8 +1,7 @@
import code from '@content/Components/Masonry/Masonry.vue?raw'; import code from '@content/Components/Masonry/Masonry.vue?raw';
import type { CodeObject } from '../../../types/code'; import { createCodeObject } from '../../../types/code';
export const masonry: CodeObject = { export const masonry = createCodeObject(code, 'Components/Masonry', {
cli: `npx jsrepo add https://vue-bits.dev/ui/Components/Masonry`,
installation: `npm install gsap`, installation: `npm install gsap`,
usage: `<template> usage: `<template>
<Masonry <Masonry
@@ -27,6 +26,5 @@ const items = ref([
{ id: '3', img: 'https://picsum.photos/300/350?random=3', url: 'https://picsum.photos', height: 350 }, { id: '3', img: 'https://picsum.photos/300/350?random=3', url: 'https://picsum.photos', height: 350 },
// ... more items // ... more items
]) ])
</script>`, </script>`
code });
};

View File

@@ -1,8 +1,7 @@
import code from '@content/Components/PixelCard/PixelCard.vue?raw'; import code from '@content/Components/PixelCard/PixelCard.vue?raw';
import type { CodeObject } from '../../../types/code'; import { createCodeObject } from '../../../types/code';
export const pixelCard: CodeObject = { export const pixelCard = createCodeObject(code, 'Components/PixelCard', {
cli: `npx jsrepo add https://vue-bits.dev/ui/Components/PixelCard`,
usage: `<template> usage: `<template>
<PixelCard <PixelCard
variant="default" variant="default"
@@ -16,6 +15,5 @@ export const pixelCard: CodeObject = {
<script setup lang="ts"> <script setup lang="ts">
import PixelCard from "./PixelCard.vue"; import PixelCard from "./PixelCard.vue";
</script>`, </script>`
code });
};

View File

@@ -1,8 +1,7 @@
import code from '@content/Components/ProfileCard/ProfileCard.vue?raw'; import code from '@content/Components/ProfileCard/ProfileCard.vue?raw';
import type { CodeObject } from '../../../types/code'; import { createCodeObject } from '../../../types/code';
export const profileCard: CodeObject = { export const profileCard = createCodeObject(code, 'Components/ProfileCard', {
cli: `npx jsrepo add https://vue-bits.dev/ui/Components/ProfileCard`,
usage: `<template> usage: `<template>
<ProfileCard <ProfileCard
name="Javi A. Torres" name="Javi A. Torres"
@@ -26,6 +25,5 @@ export const profileCard: CodeObject = {
const handleContactClick = () => { const handleContactClick = () => {
console.log('Contact button clicked!'); console.log('Contact button clicked!');
}; };
</script>`, </script>`
code });
};

View File

@@ -1,8 +1,7 @@
import code from '@content/Components/SpotlightCard/SpotlightCard.vue?raw'; import code from '@content/Components/SpotlightCard/SpotlightCard.vue?raw';
import type { CodeObject } from '../../../types/code'; import { createCodeObject } from '../../../types/code';
export const spotlightCard: CodeObject = { export const spotlightCard = createCodeObject(code, 'Components/SpotlightCard', {
cli: `npx jsrepo add https://vue-bits.dev/ui/Components/SpotlightCard`,
usage: `<template> usage: `<template>
<SpotlightCard <SpotlightCard
class-name="custom-spotlight-card" class-name="custom-spotlight-card"
@@ -14,6 +13,5 @@ export const spotlightCard: CodeObject = {
<script setup lang="ts"> <script setup lang="ts">
import SpotlightCard from "./SpotlightCard.vue"; import SpotlightCard from "./SpotlightCard.vue";
</script>`, </script>`
code });
};

View File

@@ -1,8 +1,7 @@
import code from '@content/Components/Stack/Stack.vue?raw'; import code from '@content/Components/Stack/Stack.vue?raw';
import type { CodeObject } from '../../../types/code'; import { createCodeObject } from '../../../types/code';
export const stack: CodeObject = { export const stack = createCodeObject(code, 'Components/Stack', {
cli: `npx jsrepo add https://vue-bits.dev/ui/Components/Stack`,
installation: `npm install motion-v`, installation: `npm install motion-v`,
usage: `<template> usage: `<template>
<Stack <Stack
@@ -22,6 +21,5 @@ export const stack: CodeObject = {
{ id: 3, img: "https://images.unsplash.com/photo-1452626212852-811d58933cae?q=80&w=500&auto=format" }, { id: 3, img: "https://images.unsplash.com/photo-1452626212852-811d58933cae?q=80&w=500&auto=format" },
{ id: 4, img: "https://images.unsplash.com/photo-1572120360610-d971b9d7767c?q=80&w=500&auto=format" } { id: 4, img: "https://images.unsplash.com/photo-1572120360610-d971b9d7767c?q=80&w=500&auto=format" }
]; ];
</script>`, </script>`
code });
};

View File

@@ -1,8 +1,7 @@
import code from '@content/Components/TiltedCard/TiltedCard.vue?raw'; import code from '@content/Components/TiltedCard/TiltedCard.vue?raw';
import type { CodeObject } from '../../../types/code'; import { createCodeObject } from '../../../types/code';
export const tiltedCard: CodeObject = { export const tiltedCard = createCodeObject(code, 'Components/TiltedCard', {
cli: `npx jsrepo add https://vue-bits.dev/ui/Components/TiltedCard`,
installation: `npm install motion-v`, installation: `npm install motion-v`,
usage: `<template> usage: `<template>
<TiltedCard <TiltedCard
@@ -29,6 +28,5 @@ export const tiltedCard: CodeObject = {
<script setup lang="ts"> <script setup lang="ts">
import TiltedCard from "./TiltedCard.vue"; import TiltedCard from "./TiltedCard.vue";
</script>`, </script>`
code });
};

View File

@@ -1,8 +1,7 @@
import code from '@/content/TextAnimations/AsciiText/AsciiText.vue?raw'; import code from '@/content/TextAnimations/AsciiText/AsciiText.vue?raw';
import type { CodeObject } from '../../../types/code'; import { createCodeObject } from '../../../types/code';
export const asciiText: CodeObject = { export const asciiText = createCodeObject(code, 'TextAnimations/AsciiText', {
cli: `npx jsrepo add https://vue-bits.dev/ui/TextAnimations/AsciiText`,
installation: `npm install three @types/three`, installation: `npm install three @types/three`,
usage: `<template> usage: `<template>
<AsciiText <AsciiText
@@ -18,6 +17,5 @@ export const asciiText: CodeObject = {
<script setup lang="ts"> <script setup lang="ts">
import AsciiText from "./AsciiText.vue"; import AsciiText from "./AsciiText.vue";
</script>`, </script>`
code });
};

View File

@@ -1,8 +1,7 @@
import code from '@content/TextAnimations/BlurText/BlurText.vue?raw'; import code from '@content/TextAnimations/BlurText/BlurText.vue?raw';
import type { CodeObject } from '../../../types/code'; import { createCodeObject } from '@/types/code';
export const blurText: CodeObject = { export const blurText = createCodeObject(code, 'TextAnimations/BlurText', {
cli: `npx jsrepo add https://vue-bits.dev/ui/TextAnimations/BlurText`,
installation: `npm install motion-v`, installation: `npm install motion-v`,
usage: `<template> usage: `<template>
<BlurText <BlurText
@@ -22,8 +21,7 @@ export const blurText: CodeObject = {
import BlurText from "./BlurText.vue"; import BlurText from "./BlurText.vue";
const handleAnimationComplete = () => { const handleAnimationComplete = () => {
console.log('All animations complete!'); console.log('All animations complete!');,
}; });
</script>`, </script>`
code });
};

View File

@@ -1,8 +1,7 @@
import code from '@content/TextAnimations/CircularText/CircularText.vue?raw'; import code from '@content/TextAnimations/CircularText/CircularText.vue?raw';
import type { CodeObject } from '../../../types/code'; import { createCodeObject } from '@/types/code';
export const circularText: CodeObject = { export const circularText = createCodeObject(code, 'TextAnimations/CircularText', {
cli: `npx jsrepo add https://vue-bits.dev/ui/TextAnimations/CircularText`,
installation: `npm install motion-v`, installation: `npm install motion-v`,
usage: `<template> usage: `<template>
<CircularText <CircularText
@@ -15,6 +14,5 @@ export const circularText: CodeObject = {
<script setup lang="ts"> <script setup lang="ts">
import CircularText from "./CircularText.vue"; import CircularText from "./CircularText.vue";
</script>`, </script>`
code });
};

View File

@@ -1,8 +1,7 @@
import code from '@content/TextAnimations/CurvedLoop/CurvedLoop.vue?raw'; import code from '@content/TextAnimations/CurvedLoop/CurvedLoop.vue?raw';
import type { CodeObject } from '../../../types/code'; import { createCodeObject } from '@/types/code';
export const curvedLoop: CodeObject = { export const curvedLoop = createCodeObject(code, 'TextAnimations/CurvedLoop', {
cli: `npx jsrepo add https://vue-bits.dev/ui/TextAnimations/CurvedLoop`,
usage: `<template> usage: `<template>
<CurvedLoop <CurvedLoop
marquee-text="Be ✦ Creative ✦ With ✦ Vue ✦ Bits ✦" marquee-text="Be ✦ Creative ✦ With ✦ Vue ✦ Bits ✦"
@@ -15,6 +14,5 @@ export const curvedLoop: CodeObject = {
<script setup lang="ts"> <script setup lang="ts">
import CurvedLoop from "./CurvedLoop.vue"; import CurvedLoop from "./CurvedLoop.vue";
</script>`, </script>`
code });
};

View File

@@ -1,8 +1,7 @@
import code from '@/content/TextAnimations/DecryptedText/DecryptedText.vue?raw'; import code from '@/content/TextAnimations/DecryptedText/DecryptedText.vue?raw';
import type { CodeObject } from '@/types/code'; import { createCodeObject } from '@/types/code';
export const decryptedText: CodeObject = { export const decryptedText = createCodeObject(code, 'TextAnimations/DecryptedText', {
cli: `npx jsrepo add https://vue-bits.dev/ui/TextAnimations/DecryptedText`,
usage: `<template> usage: `<template>
<DecryptedText <DecryptedText
text="Hello World!" text="Hello World!"
@@ -19,6 +18,5 @@ export const decryptedText: CodeObject = {
<script setup lang="ts"> <script setup lang="ts">
import DecryptedText from "./DecryptedText.vue"; import DecryptedText from "./DecryptedText.vue";
</script>`, </script>`
code });
};

View File

@@ -1,8 +1,7 @@
import code from '@/content/TextAnimations/FallingText/FallingText.vue?raw'; import code from '@/content/TextAnimations/FallingText/FallingText.vue?raw';
import type { CodeObject } from '@/types/code'; import { createCodeObject } from '@/types/code';
export const fallingText: CodeObject = { export const fallingText = createCodeObject(code, 'TextAnimations/FallingText', {
cli: `npx jsrepo add https://vue-bits.dev/ui/TextAnimations/FallingText`,
installation: `npm install matter-js @types/matter-js`, installation: `npm install matter-js @types/matter-js`,
usage: `<template> usage: `<template>
<FallingText <FallingText
@@ -17,6 +16,5 @@ export const fallingText: CodeObject = {
<script setup lang="ts"> <script setup lang="ts">
import FallingText from "./FallingText.vue"; import FallingText from "./FallingText.vue";
</script>`, </script>`
code });
};

View File

@@ -1,8 +1,7 @@
import code from '@content/TextAnimations/FuzzyText/FuzzyText.vue?raw'; import code from '@content/TextAnimations/FuzzyText/FuzzyText.vue?raw';
import type { CodeObject } from '../../../types/code'; import { createCodeObject } from '@/types/code';
export const fuzzyText: CodeObject = { export const fuzzyText = createCodeObject(code, 'TextAnimations/FuzzyText', {
cli: `npx jsrepo add https://vue-bits.dev/ui/TextAnimations/FuzzyText`,
usage: `<template> usage: `<template>
<FuzzyText <FuzzyText
text="404" text="404"
@@ -17,6 +16,5 @@ export const fuzzyText: CodeObject = {
<script setup lang="ts"> <script setup lang="ts">
import FuzzyText from "./FuzzyText.vue"; import FuzzyText from "./FuzzyText.vue";
</script>`, </script>`
code });
};

View File

@@ -1,8 +1,7 @@
import code from '@/content/TextAnimations/GlitchText/GlitchText.vue?raw'; import code from '@/content/TextAnimations/GlitchText/GlitchText.vue?raw';
import type { CodeObject } from '../../../types/code'; import { createCodeObject } from '@/types/code';
export const glitchText: CodeObject = { export const glitchText = createCodeObject(code, 'TextAnimations/GlitchText', {
cli: `npx jsrepo add https://vue-bits.dev/ui/TextAnimations/GlitchText`,
usage: `<template> usage: `<template>
<GlitchText <GlitchText
children="Vue Bits" children="Vue Bits"
@@ -14,6 +13,5 @@ export const glitchText: CodeObject = {
<script setup lang="ts"> <script setup lang="ts">
import GlitchText from "./GlitchText.vue"; import GlitchText from "./GlitchText.vue";
</script>`, </script>`
code });
};

View File

@@ -1,8 +1,7 @@
import code from '@content/TextAnimations/GradientText/GradientText.vue?raw'; import code from '@content/TextAnimations/GradientText/GradientText.vue?raw';
import type { CodeObject } from '../../../types/code'; import { createCodeObject } from '@/types/code';
export const gradientText: CodeObject = { export const gradientText = createCodeObject(code, 'TextAnimations/GradientText', {
cli: `npx jsrepo add https://vue-bits.dev/ui/TextAnimations/GradientText`,
usage: `<template> usage: `<template>
<GradientText <GradientText
text="Add a splash of color!" text="Add a splash of color!"
@@ -15,6 +14,5 @@ export const gradientText: CodeObject = {
<script setup lang="ts"> <script setup lang="ts">
import GradientText from "./GradientText.vue"; import GradientText from "./GradientText.vue";
</script>`, </script>`
code });
};

View File

@@ -1,8 +1,7 @@
import code from '@/content/TextAnimations/RotatingText/RotatingText.vue?raw'; import code from '@/content/TextAnimations/RotatingText/RotatingText.vue?raw';
import type { CodeObject } from '../../../types/code'; import { createCodeObject } from '@/types/code';
export const rotatingText: CodeObject = { export const rotatingText = createCodeObject(code, 'TextAnimations/RotatingText', {
cli: `npx jsrepo add https://vue-bits.dev/ui/TextAnimations/RotatingText`,
installation: `npm install motion-v`, installation: `npm install motion-v`,
usage: `<template> usage: `<template>
<RotatingText <RotatingText
@@ -21,6 +20,5 @@ export const rotatingText: CodeObject = {
<script setup lang="ts"> <script setup lang="ts">
import RotatingText from "./RotatingText.vue"; import RotatingText from "./RotatingText.vue";
</script>`, </script>`
code });
};

View File

@@ -1,8 +1,7 @@
import code from '@content/TextAnimations/ScrambleText/ScrambleText.vue?raw'; import code from '@content/TextAnimations/ScrambleText/ScrambleText.vue?raw';
import type { CodeObject } from '../../../types/code'; import { createCodeObject } from '@/types/code';
export const scrambleTextCode: CodeObject = { export const scrambleTextCode = createCodeObject(code, 'TextAnimations/ScrambleText', {
cli: `npx jsrepo add https://vue-bits.dev/ui/TextAnimations/ScrambleText`,
installation: `npm install gsap`, installation: `npm install gsap`,
usage: `// Component inspired by Tom Miller from the GSAP community usage: `// Component inspired by Tom Miller from the GSAP community
// https://codepen.io/creativeocean/pen/NPWLwJM // https://codepen.io/creativeocean/pen/NPWLwJM
@@ -23,6 +22,5 @@ export const scrambleTextCode: CodeObject = {
<script setup lang="ts"> <script setup lang="ts">
import ScrambleText from "./ScrambleText.vue"; import ScrambleText from "./ScrambleText.vue";
</script>`, </script>`
code });
};

View File

@@ -1,8 +1,7 @@
import code from '@content/TextAnimations/ScrollFloat/ScrollFloat.vue?raw'; import code from '@content/TextAnimations/ScrollFloat/ScrollFloat.vue?raw';
import type { CodeObject } from '../../../types/code'; import { createCodeObject } from '@/types/code';
export const scrollFloatCode: CodeObject = { export const scrollFloatCode = createCodeObject(code, 'TextAnimations/ScrollFloat', {
cli: `npx jsrepo add https://vue-bits.dev/ui/TextAnimations/ScrollFloat`,
installation: `npm install gsap`, installation: `npm install gsap`,
usage: `<template> usage: `<template>
<ScrollFloat <ScrollFloat
@@ -21,6 +20,5 @@ export const scrollFloatCode: CodeObject = {
<script setup lang="ts"> <script setup lang="ts">
import ScrollFloat from "./ScrollFloat.vue"; import ScrollFloat from "./ScrollFloat.vue";
</script>`, </script>`
code });
};

View File

@@ -1,8 +1,7 @@
import code from '@content/TextAnimations/ScrollReveal/ScrollReveal.vue?raw'; import code from '@content/TextAnimations/ScrollReveal/ScrollReveal.vue?raw';
import type { CodeObject } from '../../../types/code'; import { createCodeObject } from '@/types/code';
export const scrollRevealCode: CodeObject = { export const scrollRevealCode = createCodeObject(code, 'TextAnimations/ScrollReveal', {
cli: `npx jsrepo add https://vue-bits.dev/ui/TextAnimations/ScrollReveal`,
installation: `npm install gsap`, installation: `npm install gsap`,
usage: `<template> usage: `<template>
<ScrollReveal <ScrollReveal
@@ -22,6 +21,5 @@ export const scrollRevealCode: CodeObject = {
<script setup lang="ts"> <script setup lang="ts">
import ScrollReveal from "./ScrollReveal.vue"; import ScrollReveal from "./ScrollReveal.vue";
</script>`, </script>`
code });
};

View File

@@ -1,8 +1,7 @@
import code from '@content/TextAnimations/ScrollVelocity/ScrollVelocity.vue?raw'; import code from '@content/TextAnimations/ScrollVelocity/ScrollVelocity.vue?raw';
import type { CodeObject } from '../../../types/code'; import { createCodeObject } from '@/types/code';
export const scrollVelocity: CodeObject = { export const scrollVelocity = createCodeObject(code, 'TextAnimations/ScrollVelocity', {
cli: `npx jsrepo add https://vue-bits.dev/ui/TextAnimations/ScrollVelocity`,
installation: `npm install gsap`, installation: `npm install gsap`,
usage: `<template> usage: `<template>
<ScrollVelocity <ScrollVelocity
@@ -19,6 +18,5 @@ export const scrollVelocity: CodeObject = {
<script setup lang="ts"> <script setup lang="ts">
import ScrollVelocity from "./ScrollVelocity.vue"; import ScrollVelocity from "./ScrollVelocity.vue";
</script>`, </script>`
code });
};

View File

@@ -1,8 +1,7 @@
import code from '@content/TextAnimations/ShinyText/ShinyText.vue?raw'; import code from '@content/TextAnimations/ShinyText/ShinyText.vue?raw';
import type { CodeObject } from '../../../types/code'; import { createCodeObject } from '@/types/code';
export const shinyText: CodeObject = { export const shinyText = createCodeObject(code, 'TextAnimations/ShinyText', {
cli: `npx jsrepo add https://vue-bits.dev/ui/TextAnimations/ShinyText`,
usage: `<template> usage: `<template>
<ShinyText <ShinyText
text="Just some shiny text!" text="Just some shiny text!"
@@ -14,6 +13,5 @@ export const shinyText: CodeObject = {
<script setup lang="ts"> <script setup lang="ts">
import ShinyText from "./ShinyText.vue"; import ShinyText from "./ShinyText.vue";
</script>`, </script>`
code });
};

View File

@@ -1,9 +1,8 @@
// Fun fact: this is the first component ever made for Vue Bits! // Fun fact: this is the first component ever made for Vue Bits!
import code from '@content/TextAnimations/SplitText/SplitText.vue?raw'; import code from '@content/TextAnimations/SplitText/SplitText.vue?raw';
import type { CodeObject } from '../../../types/code'; import { createCodeObject } from '@/types/code';
export const splitText: CodeObject = { export const splitText = createCodeObject(code, 'TextAnimations/SplitText', {
cli: `npx jsrepo add https://vue-bits.dev/ui/TextAnimations/SplitText`,
installation: `npm install gsap`, installation: `npm install gsap`,
usage: `<template> usage: `<template>
<SplitText <SplitText
@@ -28,6 +27,5 @@ export const splitText: CodeObject = {
const handleAnimationComplete = () => { const handleAnimationComplete = () => {
console.log('All letters have animated!'); console.log('All letters have animated!');
}; };
</script>`, </script>`
code });
};

View File

@@ -1,8 +1,7 @@
import code from '@/content/TextAnimations/TextCursor/TextCursor.vue?raw'; import code from '@/content/TextAnimations/TextCursor/TextCursor.vue?raw';
import type { CodeObject } from '@/types/code'; import { createCodeObject } from '@/types/code';
export const textCursor: CodeObject = { export const textCursor = createCodeObject(code, 'TextAnimations/TextCursor', {
cli: `npx jsrepo add https://vue-bits.dev/ui/TextAnimations/TextCursor`,
installation: `npm install motion-v`, installation: `npm install motion-v`,
usage: `<template> usage: `<template>
<TextCursor <TextCursor
@@ -19,6 +18,5 @@ export const textCursor: CodeObject = {
<script setup lang="ts"> <script setup lang="ts">
import TextCursor from "./TextCursor.vue"; import TextCursor from "./TextCursor.vue";
</script>`, </script>`
code });
};

View File

@@ -1,8 +1,7 @@
import code from '@content/TextAnimations/TextPressure/TextPressure.vue?raw'; import code from '@content/TextAnimations/TextPressure/TextPressure.vue?raw';
import type { CodeObject } from '../../../types/code'; import { createCodeObject } from '@/types/code';
export const textPressure: CodeObject = { export const textPressure = createCodeObject(code, 'TextAnimations/TextPressure', {
cli: `npx jsrepo add https://vue-bits.dev/ui/TextAnimations/TextPressure`,
usage: `<template> usage: `<template>
<TextPressure <TextPressure
text="Hello!" text="Hello!"
@@ -20,6 +19,5 @@ export const textPressure: CodeObject = {
<script setup lang="ts"> <script setup lang="ts">
import TextPressure from "./TextPressure.vue"; import TextPressure from "./TextPressure.vue";
</script>`, </script>`
code });
};

View File

@@ -1,8 +1,7 @@
import code from '@/content/TextAnimations/TextTrail/TextTrail.vue?raw'; import code from '@/content/TextAnimations/TextTrail/TextTrail.vue?raw';
import type { CodeObject } from '@/types/code'; import { createCodeObject } from '@/types/code';
export const textTrail: CodeObject = { export const textTrail = createCodeObject(code, 'TextAnimations/TextTrail', {
cli: `npx jsrepo add https://vue-bits.dev/ui/TextAnimations/TextTrail`,
installation: `npm install three @types/three`, installation: `npm install three @types/three`,
usage: `<template> usage: `<template>
<TextTrail <TextTrail
@@ -18,6 +17,5 @@ export const textTrail: CodeObject = {
<script setup lang="ts"> <script setup lang="ts">
import TextTrail from "./TextTrail.vue"; import TextTrail from "./TextTrail.vue";
</script>`, </script>`
code });
};

View File

@@ -1,8 +1,7 @@
import code from '@/content/TextAnimations/TrueFocus/TrueFocus.vue?raw'; import code from '@/content/TextAnimations/TrueFocus/TrueFocus.vue?raw';
import type { CodeObject } from '../../../types/code'; import { createCodeObject } from '@/types/code';
export const trueFocus: CodeObject = { export const trueFocus = createCodeObject(code, 'TextAnimations/TrueFocus', {
cli: `npx jsrepo add https://vue-bits.dev/ui/TextAnimations/TrueFocus`,
installation: `npm install motion-v`, installation: `npm install motion-v`,
usage: `<template> usage: `<template>
<TrueFocus <TrueFocus
@@ -17,6 +16,5 @@ export const trueFocus: CodeObject = {
<script setup lang="ts"> <script setup lang="ts">
import TrueFocus from "./TrueFocus.vue"; import TrueFocus from "./TrueFocus.vue";
</script>`, </script>`
code });
};

View File

@@ -148,7 +148,7 @@ onMounted(() => {
renderer = new Renderer({ renderer = new Renderer({
dpr: Math.min(window.devicePixelRatio, 2), dpr: Math.min(window.devicePixelRatio, 2),
canvas, canvas
}); });
const gl = renderer.gl; const gl = renderer.gl;
@@ -164,8 +164,8 @@ onMounted(() => {
uNoise: { value: props.noiseIntensity }, uNoise: { value: props.noiseIntensity },
uScan: { value: props.scanlineIntensity }, uScan: { value: props.scanlineIntensity },
uScanFreq: { value: props.scanlineFrequency }, uScanFreq: { value: props.scanlineFrequency },
uWarp: { value: props.warpAmount }, uWarp: { value: props.warpAmount }
}, }
}); });
mesh = new Mesh(gl, { geometry, program }); mesh = new Mesh(gl, { geometry, program });
@@ -181,7 +181,16 @@ onUnmounted(() => {
cleanup(); cleanup();
}); });
watch(() => [props.hueShift, props.noiseIntensity, props.scanlineIntensity, props.speed, props.scanlineFrequency, props.warpAmount], () => { watch(
() => [
props.hueShift,
props.noiseIntensity,
props.scanlineIntensity,
props.speed,
props.scanlineFrequency,
props.warpAmount
],
() => {
if (program) { if (program) {
program.uniforms.uHueShift.value = props.hueShift; program.uniforms.uHueShift.value = props.hueShift;
program.uniforms.uNoise.value = props.noiseIntensity; program.uniforms.uNoise.value = props.noiseIntensity;
@@ -189,5 +198,6 @@ watch(() => [props.hueShift, props.noiseIntensity, props.scanlineIntensity, prop
program.uniforms.uScanFreq.value = props.scanlineFrequency; program.uniforms.uScanFreq.value = props.scanlineFrequency;
program.uniforms.uWarp.value = props.warpAmount; program.uniforms.uWarp.value = props.warpAmount;
} }
}); }
);
</script> </script>

View File

@@ -11,55 +11,16 @@
:warp-amount="warpAmount" :warp-amount="warpAmount"
/> />
<BackgroundContent <BackgroundContent pill-text="New Background" headline="Become emboldened by the flame of ambition" />
pill-text="New Background"
headline="Become emboldened by the flame of ambition"
/>
</div> </div>
<Customize> <Customize>
<PreviewSlider <PreviewSlider title="Speed" :min="0" :max="3" :step="0.1" v-model="speed" />
title="Speed" <PreviewSlider title="Hue Shift" :min="0" :max="360" :step="1" v-model="hueShift" />
:min="0" <PreviewSlider title="Noise Intensity" :min="0" :max="0.2" :step="0.01" v-model="noiseIntensity" />
:max="3" <PreviewSlider title="Scanline Frequency" :min="0.5" :max="5" :step="0.1" v-model="scanlineFrequency" />
:step="0.1" <PreviewSlider title="Scanline Intensity" :min="0" :max="1" :step="0.01" v-model="scanlineIntensity" />
v-model="speed" <PreviewSlider title="Warp Amount" :min="0" :max="5" :step="0.1" v-model="warpAmount" />
/>
<PreviewSlider
title="Hue Shift"
:min="0"
:max="360"
:step="1"
v-model="hueShift"
/>
<PreviewSlider
title="Noise Intensity"
:min="0"
:max="0.2"
:step="0.01"
v-model="noiseIntensity"
/>
<PreviewSlider
title="Scanline Frequency"
:min="0.5"
:max="5"
:step="0.1"
v-model="scanlineFrequency"
/>
<PreviewSlider
title="Scanline Intensity"
:min="0"
:max="1"
:step="0.01"
v-model="scanlineIntensity"
/>
<PreviewSlider
title="Warp Amount"
:min="0"
:max="5"
:step="0.1"
v-model="warpAmount"
/>
</Customize> </Customize>
<PropTable :data="propData" /> <PropTable :data="propData" />

View File

@@ -5,3 +5,21 @@ export interface CodeObject {
usage?: string; usage?: string;
installation?: string; installation?: string;
} }
export interface CodeObjectInput {
utility?: string;
code?: string;
usage?: string;
installation?: string;
}
export function createCodeObject(code: string, path: string, data: CodeObjectInput): CodeObject {
const [category, componentName] = path.split('/');
return {
cli: `npx jsrepo add https://vue-bits.dev/ui/${category}/${componentName}`,
...(data.installation && { installation: data.installation }),
...(data.usage && { usage: data.usage }),
code,
...(data.utility && { utility: data.utility })
};
}