TS Fixes + Demo Cleanup

This commit is contained in:
David Haz
2025-09-01 09:53:42 +03:00
parent af455f62d5
commit 74b276c357
91 changed files with 107 additions and 392 deletions

View File

@@ -132,7 +132,7 @@ const keyboardNav = ref(false);
const topGradientOpacity = ref(0); const topGradientOpacity = ref(0);
const bottomGradientOpacity = ref(1); const bottomGradientOpacity = ref(1);
const searchValue = ref(''); const searchValue = ref('');
let debounceTimer: any = null; let debounceTimer: ReturnType<typeof setTimeout> | null = null;
interface SearchResult { interface SearchResult {
categoryName: string; categoryName: string;

View File

@@ -42,12 +42,16 @@ function lerp(p1: number, p2: number, t: number): number {
return p1 + (p2 - p1) * t; return p1 + (p2 - p1) * t;
} }
function autoBind(instance: Record<string, unknown>): void { function autoBind<T extends object>(instance: T): void {
const proto = Object.getPrototypeOf(instance); const proto = Object.getPrototypeOf(instance) as Record<string, unknown> | null;
if (!proto) return;
Object.getOwnPropertyNames(proto).forEach(key => { Object.getOwnPropertyNames(proto).forEach(key => {
if (key !== 'constructor' && typeof instance[key] === 'function') { if (key !== 'constructor') {
// eslint-disable-next-line @typescript-eslint/no-explicit-any const desc = Object.getOwnPropertyDescriptor(proto, key);
instance[key] = (instance[key] as any).bind(instance); if (desc && typeof desc.value === 'function') {
const fn = desc.value as (...args: unknown[]) => unknown;
(instance as Record<string, unknown>)[key] = fn.bind(instance);
}
} }
}); });
} }
@@ -107,8 +111,7 @@ class Title {
mesh!: Mesh; mesh!: Mesh;
constructor({ gl, plane, renderer, text, textColor = '#545050', font = '30px sans-serif' }: TitleProps) { constructor({ gl, plane, renderer, text, textColor = '#545050', font = '30px sans-serif' }: TitleProps) {
// eslint-disable-next-line @typescript-eslint/no-explicit-any autoBind(this);
autoBind(this as any);
this.gl = gl; this.gl = gl;
this.plane = plane; this.plane = plane;
this.renderer = renderer; this.renderer = renderer;
@@ -590,8 +593,9 @@ class App {
onWheel(e: Event) { onWheel(e: Event) {
const wheelEvent = e as WheelEvent; const wheelEvent = e as WheelEvent;
// eslint-disable-next-line @typescript-eslint/no-explicit-any // Support legacy wheel events if present
const delta = wheelEvent.deltaY || (wheelEvent as any).wheelDelta || (wheelEvent as any).detail; const legacy = wheelEvent as unknown as { wheelDelta?: number; detail?: number };
const delta = wheelEvent.deltaY ?? legacy.wheelDelta ?? legacy.detail ?? 0;
this.scroll.target += delta > 0 ? this.scrollSpeed : -this.scrollSpeed; this.scroll.target += delta > 0 ? this.scrollSpeed : -this.scrollSpeed;
this.onCheckDebounce(); this.onCheckDebounce();
} }

View File

@@ -156,8 +156,11 @@ void main() {
} }
`; `;
// eslint-disable-next-line @typescript-eslint/no-explicit-any type MethodNames<T> = {
function AutoBind(self: any, { include, exclude }: AutoBindOptions = {}) { [K in keyof T]: T[K] extends (...args: unknown[]) => unknown ? K : never;
}[keyof T];
function AutoBind<T extends object>(self: T, { include, exclude }: AutoBindOptions = {}) {
const getAllProperties = (object: object): Set<[object, string | symbol]> => { const getAllProperties = (object: object): Set<[object, string | symbol]> => {
const properties = new Set<[object, string | symbol]>(); const properties = new Set<[object, string | symbol]>();
let currentObject: object | null = object; let currentObject: object | null = object;
@@ -178,11 +181,18 @@ function AutoBind(self: any, { include, exclude }: AutoBindOptions = {}) {
return true; return true;
}; };
for (const [object, key] of getAllProperties(self.constructor.prototype)) { const proto = Object.getPrototypeOf(self);
if (!proto) return self;
for (const [object, key] of getAllProperties(proto)) {
if (key === 'constructor' || !filter(key)) continue; if (key === 'constructor' || !filter(key)) continue;
const descriptor = Reflect.getOwnPropertyDescriptor(object, key); const descriptor = Reflect.getOwnPropertyDescriptor(object, key);
if (descriptor && typeof descriptor.value === 'function' && typeof key === 'string') { if (descriptor && typeof descriptor.value === 'function' && typeof key === 'string') {
self[key] = self[key].bind(self); const current = (self as Record<string, unknown>)[key];
if (typeof current === 'function') {
(self as Record<MethodNames<T>, unknown>)[key as MethodNames<T>] = (
current as (...a: unknown[]) => unknown
).bind(self);
}
} }
} }
return self; return self;

View File

@@ -59,14 +59,20 @@ let intervalId: ReturnType<typeof setInterval> | null = null;
const splitIntoCharacters = (text: string): string[] => { const splitIntoCharacters = (text: string): string[] => {
if (typeof Intl !== 'undefined' && 'Segmenter' in Intl) { if (typeof Intl !== 'undefined' && 'Segmenter' in Intl) {
// eslint-disable-next-line @typescript-eslint/no-explicit-any const IntlWithSegmenter = Intl as typeof Intl & {
const segmenter = new (Intl as any).Segmenter('en', { granularity: 'grapheme' }); Segmenter: new (
locales?: string | string[],
options?: { granularity: 'grapheme' | 'word' | 'sentence' }
) => {
segment: (text: string) => Iterable<{ segment: string }>;
};
};
const segmenter = new IntlWithSegmenter.Segmenter('en', { granularity: 'grapheme' });
return [...segmenter.segment(text)].map(({ segment }) => segment); return [...segmenter.segment(text)].map(({ segment }) => segment);
} }
return [...text]; return [...text];
}; };
const elements = computed((): WordElement[] => { const elements = computed((): WordElement[] => {
const currentText = props.texts[currentTextIndex.value]; const currentText = props.texts[currentTextIndex.value];

View File

@@ -86,12 +86,10 @@
} }
.demo-container { .demo-container {
min-height: 500px;
position: relative; position: relative;
width: 100%; width: 100%;
background: #0b0b0b; background: #0b0b0b;
border: 1px solid #333; border: 1px solid #333;
padding: 1em;
margin-top: 1.4rem; margin-top: 1.4rem;
border-radius: 20px; border-radius: 20px;
display: flex; display: flex;

View File

@@ -1,7 +1,7 @@
<template> <template>
<TabbedLayout> <TabbedLayout>
<template #preview> <template #preview>
<div class="demo-container"> <div class="demo-container h-[500px]">
<RefreshButton @click="forceRerender" /> <RefreshButton @click="forceRerender" />
<AnimatedContent <AnimatedContent
:direction="direction" :direction="direction"

View File

@@ -1,7 +1,7 @@
<template> <template>
<TabbedLayout> <TabbedLayout>
<template #preview> <template #preview>
<div class="demo-container"> <div class="demo-container h-[500px]">
<ClickSpark <ClickSpark
:key="rerenderKey" :key="rerenderKey"
:spark-color="sparkColor" :spark-color="sparkColor"
@@ -87,10 +87,6 @@ const propData = [
</script> </script>
<style scoped> <style scoped>
.demo-container {
min-height: 400px;
}
.click-spark-demo-area { .click-spark-demo-area {
position: absolute; position: absolute;
width: 100%; width: 100%;

View File

@@ -3,7 +3,7 @@
<template #preview> <template #preview>
<h2 class="demo-title-extra">Default</h2> <h2 class="demo-title-extra">Default</h2>
<div class="demo-container relative"> <div class="demo-container h-[200px]">
<CountUp <CountUp
:key="keyDefault" :key="keyDefault"
:from="from" :from="from"
@@ -19,9 +19,9 @@
<h2 class="demo-title-extra">Start Programmatically</h2> <h2 class="demo-title-extra">Start Programmatically</h2>
<div class="demo-container flex flex-col justify-center items-center relative min-h-[200px]"> <div class="demo-container h-[200px] flex-col justify-center items-center">
<button <button
class="bg-[#0b0b0b] cursor-pointer rounded-[10px] border border-[#222] text-white px-4 py-2 mb-4" class="bg-[#0b0b0b] cursor-pointer rounded-[10px] border border-[#222] text-white px-4 py-2"
@click="setStartCounting(true)" @click="setStartCounting(true)"
> >
Count to 500! Count to 500!
@@ -166,10 +166,3 @@ const propData = [
} }
]; ];
</script> </script>
<style scoped>
.demo-container {
min-height: 200px;
height: 200px;
}
</style>

View File

@@ -1,7 +1,7 @@
<template> <template>
<TabbedLayout> <TabbedLayout>
<template #preview> <template #preview>
<div ref="containerRef" class="demo-container relative min-h-[300px] overflow-hidden"> <div ref="containerRef" class="demo-container min-h-[300px] overflow-hidden">
<Crosshair :container-ref="targeted ? containerElement : null" :color="color" /> <Crosshair :container-ref="targeted ? containerElement : null" :color="color" />
<div class="flex flex-col justify-center items-center"> <div class="flex flex-col justify-center items-center">

View File

@@ -1,7 +1,7 @@
<template> <template>
<TabbedLayout> <TabbedLayout>
<template #preview> <template #preview>
<div class="demo-container h-[650px]"> <div class="demo-container h-[700px]">
<Cubes <Cubes
:borderStyle="borderStyle" :borderStyle="borderStyle"
:gridSize="gridSize" :gridSize="gridSize"

View File

@@ -1,7 +1,7 @@
<template> <template>
<TabbedLayout> <TabbedLayout>
<template #preview> <template #preview>
<div class="flex-col h-[500px] overflow-hidden demo-container"> <div class="demo-container h-[500px] overflow-hidden">
<ElectricBorder <ElectricBorder
v-if="example === 'card'" v-if="example === 'card'"
:color="cardProps.color" :color="cardProps.color"
@@ -160,9 +160,3 @@ const propData = [
} }
]; ];
</script> </script>
<style scoped>
.demo-container {
padding: 0;
}
</style>

View File

@@ -1,7 +1,7 @@
<template> <template>
<TabbedLayout> <TabbedLayout>
<template #preview> <template #preview>
<div class="demo-container"> <div class="demo-container h-[500px]">
<RefreshButton @refresh="forceRerender" /> <RefreshButton @refresh="forceRerender" />
<FadeContent <FadeContent

View File

@@ -1,7 +1,7 @@
<template> <template>
<TabbedLayout> <TabbedLayout>
<template #preview> <template #preview>
<div class="demo-container min-h-[400px]"> <div class="demo-container h-[400px]">
<GlareHover <GlareHover
background="#111" background="#111"
border-color="#222" border-color="#222"

View File

@@ -1,7 +1,7 @@
<template> <template>
<TabbedLayout> <TabbedLayout>
<template #preview> <template #preview>
<div class="relative flex-col h-[500px] overflow-hidden demo-container demo-container-dots"> <div class="demo-container demo-container-dots h-[500px] overflow-hidden">
<div <div
ref="scrollRef" ref="scrollRef"
class="relative flex flex-col items-center px-6 py-[100px] w-full h-full overflow-x-hidden overflow-y-auto scrollContainer" class="relative flex flex-col items-center px-6 py-[100px] w-full h-full overflow-x-hidden overflow-y-auto scrollContainer"
@@ -237,10 +237,6 @@ const propData = [
</script> </script>
<style scoped> <style scoped>
.demo-container {
padding: 0;
}
.scrollContainer { .scrollContainer {
&::-webkit-scrollbar { &::-webkit-scrollbar {
display: none; display: none;

View File

@@ -1,7 +1,7 @@
<template> <template>
<TabbedLayout> <TabbedLayout>
<template #preview> <template #preview>
<div class="relative h-[500px] overflow-hidden demo-container"> <div class="demo-container h-[500px] overflow-hidden">
<LogoLoop <LogoLoop
:key="key" :key="key"
:logos="items" :logos="items"
@@ -161,9 +161,3 @@ const propData = [
} }
]; ];
</script> </script>
<style scoped>
.demo-container {
padding: 0;
}
</style>

View File

@@ -3,7 +3,7 @@
<template #preview> <template #preview>
<h2 class="demo-title-extra">Container</h2> <h2 class="demo-title-extra">Container</h2>
<div class="demo-container"> <div class="demo-container h-[400px]">
<Magnet :key="rerenderKey" :padding="padding" :disabled="disabled" :magnetStrength="magnetStrength"> <Magnet :key="rerenderKey" :padding="padding" :disabled="disabled" :magnetStrength="magnetStrength">
<div class="magnet-container">Hover Me!</div> <div class="magnet-container">Hover Me!</div>
</Magnet> </Magnet>
@@ -11,7 +11,7 @@
<h2 class="demo-title-extra">Link</h2> <h2 class="demo-title-extra">Link</h2>
<div class="demo-container"> <div class="demo-container h-[400px]">
<Magnet <Magnet
:key="rerenderKey + 1" :key="rerenderKey + 1"
:padding="Math.floor(padding / 2)" :padding="Math.floor(padding / 2)"
@@ -119,11 +119,6 @@ const propData = [
font-weight: 600; font-weight: 600;
} }
.demo-container {
position: relative;
min-height: 300px;
}
.magnet-container { .magnet-container {
width: 200px; width: 200px;
height: 100px; height: 100px;

View File

@@ -1,7 +1,7 @@
<template> <template>
<TabbedLayout> <TabbedLayout>
<template #preview> <template #preview>
<div class="demo-container"> <div class="demo-container h-[600px] overflow-hidden">
<MagnetLines <MagnetLines
:rows="rows" :rows="rows"
:columns="columns" :columns="columns"

View File

@@ -140,9 +140,3 @@ const propData = [
} }
]; ];
</script> </script>
<style scoped>
.demo-container {
padding: 0;
}
</style>

View File

@@ -1,7 +1,7 @@
<template> <template>
<TabbedLayout> <TabbedLayout>
<template #preview> <template #preview>
<div class="demo-container relative h-[500px] overflow-hidden"> <div class="demo-container h-[500px] overflow-hidden">
<MetallicPaint <MetallicPaint
v-if="imageData" v-if="imageData"
:key="rerenderKey" :key="rerenderKey"

View File

@@ -1,7 +1,7 @@
<template> <template>
<TabbedLayout> <TabbedLayout>
<template #preview> <template #preview>
<div class="demo-container min-h-[400px]"> <div class="demo-container h-[400px]">
<PixelTransition <PixelTransition
:key="key" :key="key"
:grid-size="gridSize" :grid-size="gridSize"
@@ -24,7 +24,7 @@
</template> </template>
</PixelTransition> </PixelTransition>
<div class="mt-2 absolute bottom-[2em] text-[#a6a6a6]">Psst, hover the image!</div> <div class="mt-2 absolute bottom-[1em] text-[#a6a6a6]">Psst, hover the image!</div>
</div> </div>
<Customize> <Customize>

View File

@@ -1,7 +1,7 @@
<template> <template>
<TabbedLayout> <TabbedLayout>
<template #preview> <template #preview>
<div class="demo-container"> <div class="demo-container h-[500px] overflow-hidden">
<div class="hover-text">Hover Me.</div> <div class="hover-text">Hover Me.</div>
<Ribbons <Ribbons
:base-thickness="baseThickness" :base-thickness="baseThickness"
@@ -177,13 +177,6 @@ const propData = [
pointer-events: none; pointer-events: none;
} }
.demo-container {
position: relative;
height: 500px;
padding: 0;
overflow: hidden;
}
.count-controls { .count-controls {
display: flex; display: flex;
gap: 1rem; gap: 1rem;

View File

@@ -2,7 +2,7 @@
<div class="shape-blur-demo"> <div class="shape-blur-demo">
<TabbedLayout> <TabbedLayout>
<template #preview> <template #preview>
<div class="demo-container"> <div class="demo-container h-[500px] overflow-hidden">
<ShapeBlur <ShapeBlur
:variation="0" :variation="0"
:pixel-ratio-prop="pixelRatioProp" :pixel-ratio-prop="pixelRatioProp"
@@ -121,9 +121,4 @@ const propData = [
color: #222; color: #222;
pointer-events: none; pointer-events: none;
} }
.demo-container {
overflow: hidden;
padding: 0;
}
</style> </style>

View File

@@ -1,7 +1,7 @@
<template> <template>
<TabbedLayout> <TabbedLayout>
<template #preview> <template #preview>
<div class="demo-container"> <div class="demo-container h-[400px]">
<span class="text-6xl text-center text-[#333] font-black select-none">Move Your Cursor</span> <span class="text-6xl text-center text-[#333] font-black select-none">Move Your Cursor</span>
</div> </div>
@@ -142,11 +142,3 @@ const propData = [
} }
]; ];
</script> </script>
<style scoped>
.demo-container {
overflow: hidden;
min-height: 300px;
padding: 0;
}
</style>

View File

@@ -2,7 +2,7 @@
<TabbedLayout> <TabbedLayout>
<template #preview> <template #preview>
<div <div
class="flex-col bg-[linear-gradient(to_bottom,_#060010,_#0D0716,_#0D0716,_#060010)] h-[500px] overflow-hidden demo-container" class="bg-[linear-gradient(to_bottom,_#060010,_#0D0716,_#0D0716,_#060010)] h-[500px] overflow-hidden demo-container"
> >
<StickerPeel <StickerPeel
:image-src="logo" :image-src="logo"
@@ -143,9 +143,3 @@ const propData = [
} }
]; ];
</script> </script>
<style scoped>
.demo-container {
padding: 0;
}
</style>

View File

@@ -95,9 +95,3 @@ const propData = [
} }
]; ];
</script> </script>
<style scoped>
.demo-container {
padding: 0;
}
</style>

View File

@@ -98,9 +98,3 @@ const propData = [
{ name: 'style', type: 'CSSProperties', default: '{}', description: 'Inline styles for the component.' } { name: 'style', type: 'CSSProperties', default: '{}', description: 'Inline styles for the component.' }
]; ];
</script> </script>
<style scoped>
.demo-container {
padding: 0;
}
</style>

View File

@@ -144,9 +144,3 @@ const propData = [
} }
]; ];
</script> </script>
<style scoped>
.demo-container {
padding: 0;
}
</style>

View File

@@ -122,9 +122,3 @@ const propData = [
} }
]; ];
</script> </script>
<style scoped>
.demo-container {
padding: 0;
}
</style>

View File

@@ -194,9 +194,3 @@ const propData = [
} }
]; ];
</script> </script>
<style scoped>
.demo-container {
padding: 0;
}
</style>

View File

@@ -174,9 +174,3 @@ const propData = [
} }
]; ];
</script> </script>
<style scoped>
.demo-container {
padding: 0;
}
</style>

View File

@@ -182,9 +182,3 @@ const propData = [
} }
]; ];
</script> </script>
<style scoped>
.demo-container {
padding: 0;
}
</style>

View File

@@ -102,9 +102,3 @@ const propData = [
} }
]; ];
</script> </script>
<style scoped>
.demo-container {
padding: 0;
}
</style>

View File

@@ -49,9 +49,3 @@ const imageUrl =
const numberOfImages = 30; const numberOfImages = 30;
const images = Array.from({ length: numberOfImages }, () => imageUrl); const images = Array.from({ length: numberOfImages }, () => imageUrl);
</script> </script>
<style scoped>
.demo-container {
padding: 0;
}
</style>

View File

@@ -64,9 +64,3 @@ const options = [
{ value: 'six', label: 'Deep' } { value: 'six', label: 'Deep' }
]; ];
</script> </script>
<style scoped>
.demo-container {
padding: 0;
}
</style>

View File

@@ -84,9 +84,3 @@ const propData = [
} }
]; ];
</script> </script>
<style scoped>
.demo-container {
padding: 0;
}
</style>

View File

@@ -116,9 +116,3 @@ const propData = [
} }
]; ];
</script> </script>
<style scoped>
.demo-container {
padding: 0;
}
</style>

View File

@@ -180,9 +180,3 @@ const propData = [
} }
]; ];
</script> </script>
<style scoped>
.demo-container {
padding: 0;
}
</style>

View File

@@ -72,9 +72,3 @@ const propData = [
{ name: 'size', type: 'number', default: '1', description: 'Scale factor for the bolt size.' } { name: 'size', type: 'number', default: '1', description: 'Scale factor for the bolt size.' }
]; ];
</script> </script>
<style scoped>
.demo-container {
padding: 0;
}
</style>

View File

@@ -1,7 +1,7 @@
<template> <template>
<TabbedLayout> <TabbedLayout>
<template #preview> <template #preview>
<div class="relative p-0 h-[600px] overflow-hidden demo-container"> <div class="h-[600px] overflow-hidden demo-container">
<LiquidChrome :baseColor="baseColor" :speed="speed" :amplitude="amplitude" :interactive="interactive" /> <LiquidChrome :baseColor="baseColor" :speed="speed" :amplitude="amplitude" :interactive="interactive" />
<BackgroundContent pill-text="New Background" headline="Swirl around in the deep sea of liquid chrome!" /> <BackgroundContent pill-text="New Background" headline="Swirl around in the deep sea of liquid chrome!" />
</div> </div>
@@ -103,9 +103,3 @@ const propData = [
} }
]; ];
</script> </script>
<style scoped>
.demo-container {
padding: 0;
}
</style>

View File

@@ -133,9 +133,3 @@ const propData = [
} }
]; ];
</script> </script>
<style scoped>
.demo-container {
padding: 0;
}
</style>

View File

@@ -190,9 +190,3 @@ const propData = [
} }
]; ];
</script> </script>
<style scoped>
.demo-container {
padding: 0;
}
</style>

View File

@@ -104,9 +104,3 @@ const propData = [
} }
]; ];
</script> </script>
<style scoped>
.demo-container {
padding: 0;
}
</style>

View File

@@ -166,9 +166,3 @@ const propData = [
} }
]; ];
</script> </script>
<style scoped>
.demo-container {
padding: 0;
}
</style>

View File

@@ -146,9 +146,3 @@ const propData = [
} }
]; ];
</script> </script>
<style scoped>
.demo-container {
padding: 0;
}
</style>

View File

@@ -168,9 +168,3 @@ const propData = [
} }
]; ];
</script> </script>
<style scoped>
.demo-container {
padding: 0;
}
</style>

View File

@@ -70,9 +70,3 @@ const propData = [
{ name: 'style', type: 'CSSProperties', default: '{}', description: 'Inline styles for the component.' } { name: 'style', type: 'CSSProperties', default: '{}', description: 'Inline styles for the component.' }
]; ];
</script> </script>
<style scoped>
.demo-container {
padding: 0;
}
</style>

View File

@@ -118,9 +118,3 @@ const propData = [
} }
]; ];
</script> </script>
<style scoped>
.demo-container {
padding: 0;
}
</style>

View File

@@ -79,9 +79,3 @@ const propData = [
} }
]; ];
</script> </script>
<style scoped>
.demo-container {
padding: 0;
}
</style>

View File

@@ -100,9 +100,3 @@ const propData = [
} }
]; ];
</script> </script>
<style scoped>
.demo-container {
padding: 0;
}
</style>

View File

@@ -1,7 +1,7 @@
<template> <template>
<TabbedLayout> <TabbedLayout>
<template #preview> <template #preview>
<div class="demo-container relative min-h-[500px] max-h-[500px] overflow-hidden flex items-center justify-center"> <div class="demo-container h-[500px] overflow-hidden">
<AnimatedList <AnimatedList
:key="rerenderKey" :key="rerenderKey"
:show-gradients="showGradients" :show-gradients="showGradients"

View File

@@ -1,7 +1,7 @@
<template> <template>
<TabbedLayout> <TabbedLayout>
<template #preview> <template #preview>
<div class="demo-container bounce-cards-demo"> <div class="demo-container h-[500px] bounce-cards-demo">
<RefreshButton @refresh="forceRerender" /> <RefreshButton @refresh="forceRerender" />
<BounceCards <BounceCards

View File

@@ -1,7 +1,7 @@
<template> <template>
<TabbedLayout> <TabbedLayout>
<template #preview> <template #preview>
<div class="relative h-[800px] overflow-hidden demo-container demo-container-dots"> <div class="demo-container demo-container-dots h-[800px] overflow-hidden">
<BubbleMenu <BubbleMenu
:logo="logo" :logo="logo"
:menu-bg="menuBg" :menu-bg="menuBg"

View File

@@ -2,7 +2,7 @@
<TabbedLayout> <TabbedLayout>
<template #preview> <template #preview>
<div <div
class="relative overflow-hidden demo-container demo-container-dots" class="demo-container demo-container-dots overflow-hidden"
:style="{ :style="{
backgroundColor: currentTheme.backgroundColor, backgroundColor: currentTheme.backgroundColor,
minHeight: '550px', minHeight: '550px',

View File

@@ -1,7 +1,7 @@
<template> <template>
<TabbedLayout> <TabbedLayout>
<template #preview> <template #preview>
<div class="demo-container h-[500px] overflow-hidden flex flex-col lg:flex-row relative"> <div class="demo-container h-[500px] overflow-hidden">
<div <div
class="w-full lg:w-1/2 h-auto lg:h-full flex flex-col justify-center items-center lg:items-start text-center lg:text-left pt-8 lg:pt-0 pb-4 lg:pb-0 px-4 lg:px-4" class="w-full lg:w-1/2 h-auto lg:h-full flex flex-col justify-center items-center lg:items-start text-center lg:text-left pt-8 lg:pt-0 pb-4 lg:pb-0 px-4 lg:px-4"
> >

View File

@@ -1,7 +1,7 @@
<template> <template>
<TabbedLayout> <TabbedLayout>
<template #preview> <template #preview>
<div class="demo-container relative overflow-hidden"> <div class="demo-container overflow-hidden py-[64px]">
<ChromaGrid :radius="radius" :damping="damping" :fadeOut="fadeOut" :ease="ease" /> <ChromaGrid :radius="radius" :damping="damping" :fadeOut="fadeOut" :ease="ease" />
</div> </div>
@@ -93,10 +93,3 @@ const propData = [
} }
]; ];
</script> </script>
<style scoped>
.demo-container {
height: auto;
padding: 4em 0;
}
</style>

View File

@@ -1,7 +1,7 @@
<template> <template>
<TabbedLayout> <TabbedLayout>
<template #preview> <template #preview>
<div class="demo-container h-[400px] overflow-hidden relative"> <div class="demo-container h-[400px] overflow-hidden">
<Counter <Counter
:value="value" :value="value"
:places="[100, 10, 1]" :places="[100, 10, 1]"

View File

@@ -1,7 +1,7 @@
<template> <template>
<TabbedLayout> <TabbedLayout>
<template #preview> <template #preview>
<div class="demo-container" style="overflow: hidden"> <div class="demo-container h-[500px] overflow-hidden">
<DecayCard> <DecayCard>
<div class="text-[2rem]"> <div class="text-[2rem]">
Decay Decay

View File

@@ -1,7 +1,7 @@
<template> <template>
<TabbedLayout> <TabbedLayout>
<template #preview> <template #preview>
<div class="demo-container"> <div class="demo-container h-[400px]">
<Dock <Dock
:key="rerenderKey" :key="rerenderKey"
:items="items" :items="items"
@@ -140,10 +140,3 @@ const propData = [
} }
]; ];
</script> </script>
<style scoped>
.demo-container {
min-height: 400px;
padding: 2rem;
}
</style>

View File

@@ -2,7 +2,7 @@
<TabbedLayout> <TabbedLayout>
<template #preview> <template #preview>
<div class="demo-section"> <div class="demo-section">
<div class="demo-container relative min-h-[200px] flex items-center justify-center"> <div class="demo-container h-[300px] overflow-hidden">
<ElasticSlider /> <ElasticSlider />
</div> </div>
</div> </div>
@@ -10,7 +10,7 @@
<div class="demo-section"> <div class="demo-section">
<h2 class="demo-title-extra">Using Steps</h2> <h2 class="demo-title-extra">Using Steps</h2>
<div class="demo-container relative min-h-[200px] flex items-center justify-center"> <div class="demo-container h-[300px] overflow-hidden">
<ElasticSlider :is-stepped="true" :step-size="10" /> <ElasticSlider :is-stepped="true" :step-size="10" />
</div> </div>
</div> </div>
@@ -18,7 +18,7 @@
<div class="demo-section"> <div class="demo-section">
<h2 class="demo-title-extra">Custom Range & Icons</h2> <h2 class="demo-title-extra">Custom Range & Icons</h2>
<div class="demo-container relative min-h-[200px] flex items-center justify-center"> <div class="demo-container h-[300px] overflow-hidden">
<ElasticSlider :starting-value="500" :default-value="750" :max-value="1000"> <ElasticSlider :starting-value="500" :default-value="750" :max-value="1000">
<template #left-icon> <template #left-icon>
<i class="pi pi-thumbs-down text-xl"></i> <i class="pi pi-thumbs-down text-xl"></i>
@@ -103,11 +103,3 @@ const propData = [
} }
]; ];
</script> </script>
<style scoped>
.demo-container {
height: 300px;
min-height: 300px;
overflow: hidden;
}
</style>

View File

@@ -1,7 +1,7 @@
<template> <template>
<TabbedLayout> <TabbedLayout>
<template #preview> <template #preview>
<div class="demo-container" style="height: 600px; overflow: hidden; padding: 100px 0"> <div class="demo-container h-[600px] overflow-hidden py-[100px]">
<FlowingMenu :items="demoItems" /> <FlowingMenu :items="demoItems" />
</div> </div>

View File

@@ -1,7 +1,7 @@
<template> <template>
<TabbedLayout> <TabbedLayout>
<template #preview> <template #preview>
<div class="demo-container relative h-[600px] overflow-hidden flex items-center justify-center"> <div class="demo-container h-[600px] overflow-hidden">
<FlyingPosters <FlyingPosters
:key="rerenderKey" :key="rerenderKey"
:items="items" :items="items"

View File

@@ -1,7 +1,7 @@
<template> <template>
<TabbedLayout> <TabbedLayout>
<template #preview> <template #preview>
<div class="demo-container"> <div class="demo-container h-[500px]">
<Folder :size="size" :color="color"></Folder> <Folder :size="size" :color="color"></Folder>
</div> </div>

View File

@@ -1,7 +1,7 @@
<template> <template>
<TabbedLayout> <TabbedLayout>
<template #preview> <template #preview>
<div class="demo-container" style="height: 500px; overflow: hidden"> <div class="demo-container h-[500px] overflow-hidden">
<GlassIcons :items="items" class="my-glass-icons" /> <GlassIcons :items="items" class="my-glass-icons" />
</div> </div>

View File

@@ -1,7 +1,7 @@
<template> <template>
<TabbedLayout> <TabbedLayout>
<template #preview> <template #preview>
<div class="relative overflow-y-auto no-scrollbar demo-container" ref="scrollContainerRef"> <div class="overflow-y-auto no-scrollbar demo-container h-[500px]" ref="scrollContainerRef">
<GlassSurface <GlassSurface
:key="key" :key="key"
:width="360" :width="360"
@@ -293,12 +293,3 @@ const propData = [
} }
]; ];
</script> </script>
<style scoped>
.demo-container {
padding: 0;
}
.demo-container::-webkit-scrollbar {
display: none;
}
</style>

View File

@@ -1,9 +1,7 @@
<template> <template>
<TabbedLayout> <TabbedLayout>
<template #preview> <template #preview>
<div <div class="demo-container h-[500px] overflow-hidden">
class="demo-container relative h-[500px] overflow-hidden bg-gradient-to-br from-purple-900 via-blue-900 to-indigo-900 flex items-center justify-center"
>
<GooeyNav <GooeyNav
:key="rerenderKey" :key="rerenderKey"
:items="navItems" :items="navItems"

View File

@@ -1,7 +1,7 @@
<template> <template>
<TabbedLayout> <TabbedLayout>
<template #preview> <template #preview>
<div class="relative h-auto overflow-hidden demo-container"> <div class="py-[100px] overflow-hidden demo-container">
<MagicBento <MagicBento
:enable-stars="enableStars" :enable-stars="enableStars"
:enable-spotlight="enableSpotlight" :enable-spotlight="enableSpotlight"
@@ -133,9 +133,3 @@ const propData = [
} }
]; ];
</script> </script>
<style scoped>
.demo-container {
padding: 0 8px;
}
</style>

View File

@@ -1,7 +1,7 @@
<template> <template>
<TabbedLayout> <TabbedLayout>
<template #preview> <template #preview>
<div class="relative h-[500px] overflow-hidden demo-container"> <div class="demo-container h-[500px] overflow-hidden">
<RefreshButton <RefreshButton
@refresh=" @refresh="
() => { () => {
@@ -208,9 +208,3 @@ const propData = [
} }
]; ];
</script> </script>
<style scoped>
.demo-container {
padding: 0;
}
</style>

View File

@@ -1,7 +1,7 @@
<template> <template>
<TabbedLayout> <TabbedLayout>
<template #preview> <template #preview>
<div class="demo-container relative py-10"> <div class="demo-container py-10">
<SpotlightCard class-name="custom-spotlight-card"> <SpotlightCard class-name="custom-spotlight-card">
<div class="flex h-full flex-col items-start justify-center"> <div class="flex h-full flex-col items-start justify-center">
<i class="pi pi-star-fill text-4xl mb-3 text-white"></i> <i class="pi pi-star-fill text-4xl mb-3 text-white"></i>
@@ -17,7 +17,7 @@
<h2 class="text-xl font-semibold text-white mb-4 mt-8">Custom Color</h2> <h2 class="text-xl font-semibold text-white mb-4 mt-8">Custom Color</h2>
<div class="demo-container relative py-10"> <div class="demo-container py-10">
<SpotlightCard class-name="custom-spotlight-card" spotlight-color="rgba(39, 255, 100, 0.326)"> <SpotlightCard class-name="custom-spotlight-card" spotlight-color="rgba(39, 255, 100, 0.326)">
<div class="flex h-full flex-col items-start justify-center"> <div class="flex h-full flex-col items-start justify-center">
<i class="pi pi-lock text-3xl mb-3 text-white"></i> <i class="pi pi-lock text-3xl mb-3 text-white"></i>

View File

@@ -1,7 +1,7 @@
<template> <template>
<TabbedLayout> <TabbedLayout>
<template #preview> <template #preview>
<div class="demo-container"> <div class="demo-container h-[500px]">
<Stack <Stack
:key="rerenderKey" :key="rerenderKey"
:randomRotation="randomRotation" :randomRotation="randomRotation"

View File

@@ -14,7 +14,7 @@
/> />
<TabbedLayout> <TabbedLayout>
<template #preview> <template #preview>
<div class="relative demo-container h-[500px] overflow-hidden"> <div class="demo-container h-[500px] overflow-hidden">
<Stepper <Stepper
:initial-step="step" :initial-step="step"
:on-step-change="handleStepChange" :on-step-change="handleStepChange"

View File

@@ -1,7 +1,7 @@
<template> <template>
<TabbedLayout> <TabbedLayout>
<template #preview> <template #preview>
<div class="demo-container" style="min-height: 500px; position: relative; overflow: hidden"> <div class="demo-container h-[500px] overflow-hidden">
<TiltedCard <TiltedCard
image-src="https://i.scdn.co/image/ab67616d0000b273d9985092cd88bffd97653b58" image-src="https://i.scdn.co/image/ab67616d0000b273d9985092cd88bffd97653b58"
alt-text="Kendrick Lamar - GNX Album Cover" alt-text="Kendrick Lamar - GNX Album Cover"

View File

@@ -1,7 +1,7 @@
<template> <template>
<TabbedLayout> <TabbedLayout>
<template #preview> <template #preview>
<div class="demo-container"> <div class="demo-container h-[400px] overflow-hidden">
<AsciiText <AsciiText
:key="rerenderKey" :key="rerenderKey"
:text="text" :text="text"

View File

@@ -1,7 +1,7 @@
<template> <template>
<TabbedLayout> <TabbedLayout>
<template #preview> <template #preview>
<div class="demo-container relative min-h-[400px] overflow-hidden"> <div class="demo-container h-[400px] overflow-hidden">
<RefreshButton @refresh="forceRerender" /> <RefreshButton @refresh="forceRerender" />
<BlurText <BlurText

View File

@@ -1,7 +1,7 @@
<template> <template>
<TabbedLayout> <TabbedLayout>
<template #preview> <template #preview>
<div class="demo-container relative min-h-[400px] overflow-hidden flex items-center justify-center"> <div class="demo-container h-[400px] overflow-hidden">
<CircularText <CircularText
:key="rerenderKey" :key="rerenderKey"
text="VUE * BITS * IS * AWESOME * " text="VUE * BITS * IS * AWESOME * "

View File

@@ -1,7 +1,7 @@
<template> <template>
<TabbedLayout> <TabbedLayout>
<template #preview> <template #preview>
<div class="demo-container relative h-[500px] overflow-hidden p-0"> <div class="demo-container h-[500px] overflow-hidden">
<CurvedLoop <CurvedLoop
:key="rerenderKey" :key="rerenderKey"
:marquee-text="marqueeText" :marquee-text="marqueeText"

View File

@@ -1,7 +1,7 @@
<template> <template>
<TabbedLayout> <TabbedLayout>
<template #preview> <template #preview>
<div class="demo-container relative py-6 overflow-hidden"> <div class="demo-container py-6 overflow-hidden">
<RefreshButton @click="forceRerender" /> <RefreshButton @click="forceRerender" />
<div :key="key" class="pl-6 m-8 w-full flex flex-col justify-start items-start"> <div :key="key" class="pl-6 m-8 w-full flex flex-col justify-start items-start">

View File

@@ -1,7 +1,7 @@
<template> <template>
<TabbedLayout> <TabbedLayout>
<template #preview> <template #preview>
<div class="demo-container relative h-[400px] overflow-hidden p-0 flex justify-center items-center"> <div class="demo-container h-[400px] overflow-hidden">
<FallingText <FallingText
:key="key" :key="key"
text="Vue Bits is a library of animated and interactive Vue components designed to streamline UI development and simplify your workflow." text="Vue Bits is a library of animated and interactive Vue components designed to streamline UI development and simplify your workflow."

View File

@@ -1,7 +1,7 @@
<template> <template>
<TabbedLayout> <TabbedLayout>
<template #preview> <template #preview>
<div class="demo-container relative h-[500px] overflow-hidden"> <div class="demo-container h-[500px] overflow-hidden">
<div class="flex flex-col items-center justify-center h-full"> <div class="flex flex-col items-center justify-center h-full">
<FuzzyText <FuzzyText
:key="`main-${rerenderKey}`" :key="`main-${rerenderKey}`"

View File

@@ -1,7 +1,7 @@
<template> <template>
<TabbedLayout> <TabbedLayout>
<template #preview> <template #preview>
<div class="demo-container relative h-[500px] overflow-hidden"> <div class="demo-container h-[500px] overflow-hidden">
<GlitchText <GlitchText
:children="text" :children="text"
:speed="speed" :speed="speed"

View File

@@ -4,7 +4,7 @@
<template #preview> <template #preview>
<h2 class="demo-title-extra">Default</h2> <h2 class="demo-title-extra">Default</h2>
<div class="demo-container"> <div class="demo-container h-[200px]">
<div class="text-[2rem]"> <div class="text-[2rem]">
<GradientText <GradientText
text="Add a splash of color!" text="Add a splash of color!"
@@ -17,7 +17,7 @@
<h2 class="demo-title-extra">Border Animation</h2> <h2 class="demo-title-extra">Border Animation</h2>
<div class="demo-container"> <div class="demo-container h-[200px]">
<div class="text-[2rem]"> <div class="text-[2rem]">
<GradientText <GradientText
text="Now with a cool border!" text="Now with a cool border!"
@@ -128,9 +128,3 @@ const propData = [
} }
]; ];
</script> </script>
<style scoped>
.demo-container {
min-height: 200px;
}
</style>

View File

@@ -1,7 +1,7 @@
<template> <template>
<TabbedLayout> <TabbedLayout>
<template #preview> <template #preview>
<div class="min-h-[400px] demo-container"> <div class="h-[400px] demo-container">
<div <div
class="flex flex-row justify-center items-center p-12 sm:p-20 md:p-24 w-full h-full overflow-hidden font-light text-[1.5rem] text-white sm:text-[1.875rem] md:text-[3rem] dark:text-muted leading-8 sm:leading-9 md:leading-none" class="flex flex-row justify-center items-center p-12 sm:p-20 md:p-24 w-full h-full overflow-hidden font-light text-[1.5rem] text-white sm:text-[1.875rem] md:text-[3rem] dark:text-muted leading-8 sm:leading-9 md:leading-none"
> >

View File

@@ -1,7 +1,7 @@
<template> <template>
<TabbedLayout> <TabbedLayout>
<template #preview> <template #preview>
<div ref="containerRef" class="demo-container" @wheel="smoothScroll"> <div ref="containerRef" class="demo-container overflow-y-auto h-[600px]" @wheel="smoothScroll">
<div class="scroll-instruction">Scroll Down</div> <div class="scroll-instruction">Scroll Down</div>
<div class="scroll-content"> <div class="scroll-content">
@@ -158,11 +158,6 @@ const propData = [
</script> </script>
<style scoped> <style scoped>
.demo-container {
height: 60vh;
overflow-y: auto;
}
.scroll-content { .scroll-content {
padding-top: 150vh !important; padding-top: 150vh !important;
padding-bottom: 50vh; padding-bottom: 50vh;

View File

@@ -1,7 +1,7 @@
<template> <template>
<TabbedLayout> <TabbedLayout>
<template #preview> <template #preview>
<div ref="containerRef" class="demo-container" @wheel="smoothScroll"> <div ref="containerRef" class="demo-container overflow-y-auto h-[600px]" @wheel="smoothScroll">
<div class="scroll-instruction">Scroll Down</div> <div class="scroll-instruction">Scroll Down</div>
<div class="scroll-content"> <div class="scroll-content">
@@ -171,11 +171,6 @@ const propData = [
</script> </script>
<style scoped> <style scoped>
.demo-container {
height: 60vh;
overflow-y: auto;
}
.scroll-content { .scroll-content {
padding: 150vh 2em 50vh 2em; padding: 150vh 2em 50vh 2em;
} }

View File

@@ -1,7 +1,7 @@
<template> <template>
<TabbedLayout> <TabbedLayout>
<template #preview> <template #preview>
<div class="demo-container overflow-hidden"> <div class="demo-container h-[500px] overflow-hidden">
<div class="relative flex justify-center items-center"> <div class="relative flex justify-center items-center">
<ScrollVelocity <ScrollVelocity
:texts="['Vue Bits', 'Scroll Down']" :texts="['Vue Bits', 'Scroll Down']"
@@ -124,9 +124,3 @@ const propData = [
} }
]; ];
</script> </script>
<style scoped>
.demo-container {
min-height: 400px;
}
</style>

View File

@@ -3,13 +3,13 @@
<template #preview> <template #preview>
<h2 class="demo-title-extra">Basic</h2> <h2 class="demo-title-extra">Basic</h2>
<div class="demo-container"> <div class="demo-container h-[200px]">
<ShinyText text="Just some shiny text!" :disabled="false" :speed="3" class-name="shiny-text-demo" /> <ShinyText text="Just some shiny text!" :disabled="false" :speed="3" class-name="shiny-text-demo" />
</div> </div>
<h2 class="demo-title-extra">Button Text</h2> <h2 class="demo-title-extra">Button Text</h2>
<div class="demo-container"> <div class="demo-container h-[200px]">
<div class="shiny-button"> <div class="shiny-button">
<ShinyText text="Shiny Button" :disabled="false" :speed="3" class-name="shiny-text-demo" /> <ShinyText text="Shiny Button" :disabled="false" :speed="3" class-name="shiny-text-demo" />
</div> </div>
@@ -17,7 +17,7 @@
<h2 class="demo-title-extra">Configurable Speed</h2> <h2 class="demo-title-extra">Configurable Speed</h2>
<div class="demo-container relative min-h-[150px] text-2xl flex items-center justify-center"> <div class="demo-container h-[200px]">
<ShinyText <ShinyText
:text="speed < 2.5 ? '🐎 This is fast!' : '🐌 This is slow!'" :text="speed < 2.5 ? '🐎 This is fast!' : '🐌 This is slow!'"
:disabled="false" :disabled="false"
@@ -85,10 +85,6 @@ const propData = [
</script> </script>
<style scoped> <style scoped>
.demo-container {
min-height: 200px;
}
.shiny-button { .shiny-button {
padding: 12px 24px; padding: 12px 24px;
border-radius: 50px; border-radius: 50px;

View File

@@ -1,7 +1,7 @@
<template> <template>
<TabbedLayout> <TabbedLayout>
<template #preview> <template #preview>
<div class="demo-container"> <div class="demo-container h-[400px]">
<RefreshButton @refresh="forceRerender" /> <RefreshButton @refresh="forceRerender" />
<SplitText <SplitText

View File

@@ -1,7 +1,7 @@
<template> <template>
<TabbedLayout> <TabbedLayout>
<template #preview> <template #preview>
<div class="demo-container min-h-[400px]"> <div class="demo-container h-[400px]">
<TextPressure <TextPressure
:key="rerenderKey" :key="rerenderKey"
:text="text" :text="text"

View File

@@ -143,9 +143,3 @@ const propData = [
} }
]; ];
</script> </script>
<style scoped>
.demo-container {
padding: 0;
}
</style>

View File

@@ -1,7 +1,7 @@
<template> <template>
<TabbedLayout> <TabbedLayout>
<template #preview> <template #preview>
<div class="demo-container"> <div class="demo-container py-[64px] h-[350px]">
<TextType <TextType
:key="key" :key="key"
:text="texts" :text="texts"
@@ -216,13 +216,4 @@ const propData = [
font-size: clamp(1.5rem, 4vw, 4rem); font-size: clamp(1.5rem, 4vw, 4rem);
font-weight: 700; font-weight: 700;
} }
.demo-container {
padding: 64px;
min-height: 350px;
align-items: flex-start;
justify-content: flex-start;
display: flex;
position: relative;
overflow: hidden;
}
</style> </style>

View File

@@ -1,7 +1,7 @@
<template> <template>
<TabbedLayout> <TabbedLayout>
<template #preview> <template #preview>
<div class="demo-container"> <div class="demo-container h-[400px]">
<div :key="key" class="flex flex-col justify-center items-center m-8 pl-6 w-full"> <div :key="key" class="flex flex-col justify-center items-center m-8 pl-6 w-full">
<TrueFocus :key="key" v-bind="config" /> <TrueFocus :key="key" v-bind="config" />
</div> </div>

View File

@@ -1,10 +1,7 @@
<template> <template>
<TabbedLayout> <TabbedLayout>
<template #preview> <template #preview>
<div <div ref="containerRef" class="demo-container h-[400px] overflow-hidden font-['Roboto_Flex',sans-serif]">
ref="containerRef"
class="demo-container relative min-h-[400px] overflow-hidden p-4 font-['Roboto_Flex',sans-serif]"
>
<VariableProximity <VariableProximity
label="Hover me! And then star Vue Bits on GitHub, or else..." label="Hover me! And then star Vue Bits on GitHub, or else..."
class-name="variable-proximity-demo" class-name="variable-proximity-demo"