From 48048e875f77dc2a95c59b14e69547b62a20a19b Mon Sep 17 00:00:00 2001 From: onmax Date: Fri, 11 Jul 2025 20:10:08 +0200 Subject: [PATCH 1/2] Add Beams component and demo with associated code examples --- src/constants/Components.ts | 1 + src/constants/code/Backgrounds/beamsCode.ts | 37 ++ src/content/Backgrounds/Beams/Beams.vue | 469 ++++++++++++++++++++ src/demo/Backgrounds/BeamsDemo.vue | 183 ++++++++ 4 files changed, 690 insertions(+) create mode 100644 src/constants/code/Backgrounds/beamsCode.ts create mode 100644 src/content/Backgrounds/Beams/Beams.vue create mode 100644 src/demo/Backgrounds/BeamsDemo.vue diff --git a/src/constants/Components.ts b/src/constants/Components.ts index ac70fc8..d1c9376 100644 --- a/src/constants/Components.ts +++ b/src/constants/Components.ts @@ -54,6 +54,7 @@ const backgrounds = { 'iridescence': () => import("../demo/Backgrounds/IridescenceDemo.vue"), 'threads': () => import("../demo/Backgrounds/ThreadsDemo.vue"), 'aurora': () => import("../demo/Backgrounds/AuroraDemo.vue"), + 'beams': () => import("../demo/Backgrounds/BeamsDemo.vue"), }; export const componentMap = { diff --git a/src/constants/code/Backgrounds/beamsCode.ts b/src/constants/code/Backgrounds/beamsCode.ts new file mode 100644 index 0000000..8fe6968 --- /dev/null +++ b/src/constants/code/Backgrounds/beamsCode.ts @@ -0,0 +1,37 @@ +import code from '@content/Backgrounds/Beams/Beams.vue?raw' +import type { CodeObject } from '../../../types/code' + +export const beams: CodeObject = { + cli: `npx jsrepo add https://vue-bits.dev/ui/Backgrounds/Beams`, + installation: `npm install three`, + usage: ` + + + +`, + code +} diff --git a/src/content/Backgrounds/Beams/Beams.vue b/src/content/Backgrounds/Beams/Beams.vue new file mode 100644 index 0000000..4f8585f --- /dev/null +++ b/src/content/Backgrounds/Beams/Beams.vue @@ -0,0 +1,469 @@ + + + + + diff --git a/src/demo/Backgrounds/BeamsDemo.vue b/src/demo/Backgrounds/BeamsDemo.vue new file mode 100644 index 0000000..17828ab --- /dev/null +++ b/src/demo/Backgrounds/BeamsDemo.vue @@ -0,0 +1,183 @@ + + + + + From 4d38c713ab8444ab1fdd0f8b6b44188a83c1459c Mon Sep 17 00:00:00 2001 From: onmax Date: Fri, 11 Jul 2025 20:28:53 +0200 Subject: [PATCH 2/2] address PR comments for Beams component --- src/constants/Categories.ts | 3 ++- src/constants/code/Backgrounds/beamsCode.ts | 1 - src/content/Backgrounds/Beams/Beams.vue | 14 -------------- src/demo/Backgrounds/BeamsDemo.vue | 5 +---- 4 files changed, 3 insertions(+), 20 deletions(-) diff --git a/src/constants/Categories.ts b/src/constants/Categories.ts index 646629f..9234c53 100644 --- a/src/constants/Categories.ts +++ b/src/constants/Categories.ts @@ -59,6 +59,7 @@ export const CATEGORIES = [ name: 'Backgrounds', subcategories: [ 'Aurora', + 'Beams', 'Dot Grid', 'Silk', 'Lightning', @@ -70,4 +71,4 @@ export const CATEGORIES = [ 'Threads', ], } -]; \ No newline at end of file +]; diff --git a/src/constants/code/Backgrounds/beamsCode.ts b/src/constants/code/Backgrounds/beamsCode.ts index 8fe6968..753e6d9 100644 --- a/src/constants/code/Backgrounds/beamsCode.ts +++ b/src/constants/code/Backgrounds/beamsCode.ts @@ -15,7 +15,6 @@ export const beams: CodeObject = { :noise-intensity="1.75" :scale="0.2" :rotation="0" - class="w-full h-full" /> diff --git a/src/content/Backgrounds/Beams/Beams.vue b/src/content/Backgrounds/Beams/Beams.vue index 4f8585f..48441d4 100644 --- a/src/content/Backgrounds/Beams/Beams.vue +++ b/src/content/Backgrounds/Beams/Beams.vue @@ -453,17 +453,3 @@ onUnmounted(() => { cleanup() }) - - diff --git a/src/demo/Backgrounds/BeamsDemo.vue b/src/demo/Backgrounds/BeamsDemo.vue index 17828ab..3907233 100644 --- a/src/demo/Backgrounds/BeamsDemo.vue +++ b/src/demo/Backgrounds/BeamsDemo.vue @@ -12,14 +12,11 @@ :noise-intensity="noiseIntensity" :scale="scale" :rotation="rotation" - class="w-full h-full" /> -
- -
+