From 4b5cd3d7da96bf497284ecf81a560cc17e75088a Mon Sep 17 00:00:00 2001 From: Alfarish Fizikri Date: Fri, 25 Jul 2025 17:26:36 +0700 Subject: [PATCH 1/4] Create background --- src/constants/Categories.ts | 1 + src/constants/Components.ts | 1 + .../code/Backgrounds/lightRaysCode.ts | 26 + .../Backgrounds/LightRays/LightRays.vue | 525 ++++++++++++++++++ src/demo/Backgrounds/LightRaysDemo.vue | 262 +++++++++ 5 files changed, 815 insertions(+) create mode 100644 src/constants/code/Backgrounds/lightRaysCode.ts create mode 100644 src/content/Backgrounds/LightRays/LightRays.vue create mode 100644 src/demo/Backgrounds/LightRaysDemo.vue diff --git a/src/constants/Categories.ts b/src/constants/Categories.ts index 1e7c583..33fc732 100644 --- a/src/constants/Categories.ts +++ b/src/constants/Categories.ts @@ -112,6 +112,7 @@ export const CATEGORIES = [ 'Liquid Chrome', 'Grid Distortion', 'Galaxy', + 'Light Rays', ] } ]; diff --git a/src/constants/Components.ts b/src/constants/Components.ts index c7d2540..a108ff4 100644 --- a/src/constants/Components.ts +++ b/src/constants/Components.ts @@ -98,6 +98,7 @@ const backgrounds = { 'ripple-grid': () => import('../demo/Backgrounds/RippleGridDemo.vue'), 'galaxy': () => import('../demo/Backgrounds/GalaxyDemo.vue'), 'faulty-terminal': () => import('../demo/Backgrounds/FaultyTerminalDemo.vue'), + 'light-rays': () => import('../demo/Backgrounds/LightRaysDemo.vue'), }; export const componentMap = { diff --git a/src/constants/code/Backgrounds/lightRaysCode.ts b/src/constants/code/Backgrounds/lightRaysCode.ts new file mode 100644 index 0000000..a168350 --- /dev/null +++ b/src/constants/code/Backgrounds/lightRaysCode.ts @@ -0,0 +1,26 @@ +import code from '@content/Backgrounds/LightRays/LightRays.vue?raw'; +import { createCodeObject } from '@/types/code'; + +export const lightRays = createCodeObject(code, 'Backgrounds/LightRays', { + installation: `npm install ogl`, + usage: ` + +` +}); diff --git a/src/content/Backgrounds/LightRays/LightRays.vue b/src/content/Backgrounds/LightRays/LightRays.vue new file mode 100644 index 0000000..1f10b0a --- /dev/null +++ b/src/content/Backgrounds/LightRays/LightRays.vue @@ -0,0 +1,525 @@ + + + diff --git a/src/demo/Backgrounds/LightRaysDemo.vue b/src/demo/Backgrounds/LightRaysDemo.vue new file mode 100644 index 0000000..43e49d8 --- /dev/null +++ b/src/demo/Backgrounds/LightRaysDemo.vue @@ -0,0 +1,262 @@ + + + From 19d3e8b2cb3694ab13bbbedb134a6f9d8ccb44b8 Mon Sep 17 00:00:00 2001 From: Alfarish Fizikri Date: Fri, 25 Jul 2025 21:33:05 +0700 Subject: [PATCH 2/4] refactor(LightRaysDemo): remove unnecessary key-based re-rendering and utilize preview color component --- src/demo/Backgrounds/LightRaysDemo.vue | 65 +++++++------------------- 1 file changed, 17 insertions(+), 48 deletions(-) diff --git a/src/demo/Backgrounds/LightRaysDemo.vue b/src/demo/Backgrounds/LightRaysDemo.vue index 43e49d8..5105e87 100644 --- a/src/demo/Backgrounds/LightRaysDemo.vue +++ b/src/demo/Backgrounds/LightRaysDemo.vue @@ -3,7 +3,6 @@