Skip to content

Commit 7511bab

Browse files
authored
Merge pull request #93 from Utkarsh-Singhal-26/feat/laser-flow
FEAT: 🎉 New <LaserFlow /> animation
2 parents b2a63c3 + 4110d59 commit 7511bab

File tree

7 files changed

+950
-4
lines changed

7 files changed

+950
-4
lines changed

src/components/landing/Hero/Hero.vue

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,10 +19,10 @@
1919
/>
2020

2121
<div class="hero-main-content">
22-
<router-link to="/backgrounds/liquid-ether" class="hero-new-badge-container">
22+
<router-link to="/backgrounds/laser-flow" class="hero-new-badge-container">
2323
<span class="hero-new-badge">New 🎉</span>
2424
<div class="hero-new-badge-text">
25-
<span>Liquid Ether</span>
25+
<span>Laser Flow</span>
2626
<i class="pi-arrow-right pi" style="font-size: 0.8rem"></i>
2727
</div>
2828
</router-link>

src/constants/Categories.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
// Highlighted sidebar items
2-
export const NEW = ['Liquid Ether', 'Staggered Menu', 'Pixel Blast', 'Gradual Blur', 'Gradient Blinds', 'Bubble Menu', 'Prism', 'Plasma', 'Electric Border', 'Target Cursor', 'Pill Nav', 'Card Nav', 'Logo Loop', 'Prismatic Burst'];
2+
export const NEW = ['Laser Flow', 'Liquid Ether', 'Staggered Menu', 'Pixel Blast', 'Gradual Blur', 'Gradient Blinds', 'Bubble Menu', 'Prism', 'Plasma', 'Electric Border', 'Target Cursor', 'Pill Nav', 'Card Nav', 'Logo Loop', 'Prismatic Burst'];
33
export const UPDATED = [];
44

55
// Used for main sidebar navigation
@@ -37,6 +37,7 @@ export const CATEGORIES = [
3737
'Animated Content',
3838
'Fade Content',
3939
'Gradual Blur',
40+
'Laser Flow',
4041
'Noise',
4142
'Splash Cursor',
4243
'Logo Loop',

src/constants/Components.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ const animations = {
2323
'sticker-peel': () => import('../demo/Animations/StickerPeelDemo.vue'),
2424
'electric-border': () => import('../demo/Animations/ElectricBorderDemo.vue'),
2525
'gradual-blur': () => import('../demo/Animations/GradualBlurDemo.vue'),
26+
'laser-flow': () => import('../demo/Animations/LaserFlowDemo.vue'),
2627
};
2728

2829
const textAnimations = {

src/constants/code/Animations/gradualBlurCode.ts

Lines changed: 18 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,24 @@ import { createCodeObject } from '@/types/code';
33

44
export const gradualBlur = createCodeObject(code, 'Animations/GradualBlur', {
55
installation: `npm install mathjs`,
6-
usage: `
6+
usage: `<template>
7+
<section style="position: relative; height: 500px; overflow: hidden;">
8+
<div style="height: 100%; overflow-y: auto; padding: 6rem 2rem;">
9+
<!-- Content Here - such as an image or text -->
10+
</div>
11+
12+
<GradualBlur
13+
target="parent"
14+
position="bottom"
15+
height="6rem"
16+
:strength="2"
17+
:divCount="5"
18+
curve="bezier"
19+
:exponential="true"
20+
:opacity="1"
21+
/>
22+
</section>
23+
</template>
724
825
<script setup lang="ts">
926
import GradualBlur from "./GradualBlur.vue";
Lines changed: 99 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,99 @@
1+
import code from '@/content/Animations/LaserFlow/LaserFlow.vue?raw';
2+
import { createCodeObject } from '@/types/code';
3+
4+
export const laserFlow = createCodeObject(code, 'Animations/LaserFlow', {
5+
installation: `npm install three`,
6+
usage: `<template>
7+
<div
8+
style="height: 800px; position: relative; overflow: hidden; background-color: #060010;"
9+
@mousemove="handleMouseMove"
10+
@mouseleave="handleMouseLeave"
11+
>
12+
<LaserFlow
13+
:horizontalBeamOffset="0.1"
14+
:verticalBeamOffset="0.0"
15+
color="#FF79C6"
16+
/>
17+
18+
<div
19+
style="
20+
position: absolute;
21+
top: 50%;
22+
left: 50%;
23+
transform: translateX(-50%);
24+
width: 86%;
25+
height: 60%;
26+
background-color: #060010;
27+
border-radius: 20px;
28+
border: 2px solid #FF79C6;
29+
display: flex;
30+
align-items: center;
31+
justify-content: center;
32+
color: white;
33+
font-size: 2rem;
34+
z-index: 6;
35+
"
36+
>
37+
<!-- Your content here -->
38+
Example Box Content
39+
</div>
40+
41+
<img
42+
ref="revealImgRef"
43+
src="/path/to/image.jpg"
44+
alt="Reveal effect"
45+
style="
46+
position: absolute;
47+
width: 100%;
48+
top: -50%;
49+
z-index: 5;
50+
mix-blend-mode: lighten;
51+
opacity: 0.3;
52+
pointer-events: none;
53+
--mx: -9999px;
54+
--my: -9999px;
55+
-webkit-mask-image: radial-gradient(circle at var(--mx) var(--my),
56+
rgba(255,255,255,1) 0px,
57+
rgba(255,255,255,0.95) 60px,
58+
rgba(255,255,255,0.6) 120px,
59+
rgba(255,255,255,0.25) 180px,
60+
rgba(255,255,255,0) 240px);
61+
mask-image: radial-gradient(circle at var(--mx) var(--my),
62+
rgba(255,255,255,1) 0px,
63+
rgba(255,255,255,0.95) 60px,
64+
rgba(255,255,255,0.6) 120px,
65+
rgba(255,255,255,0.25) 180px,
66+
rgba(255,255,255,0) 240px);
67+
-webkit-mask-repeat: no-repeat;
68+
mask-repeat: no-repeat;
69+
"
70+
/>
71+
</div>
72+
</template>
73+
74+
<script setup>
75+
import { useTemplateRef } from 'vue'
76+
import LaserFlow from './LaserFlow.vue'
77+
78+
const revealImgRef = useTemplateRef('revealImgRef')
79+
80+
function handleMouseMove(e) {
81+
const rect = e.currentTarget.getBoundingClientRect()
82+
const x = e.clientX - rect.left
83+
const y = e.clientY - rect.top
84+
const el = revealImgRef.value
85+
if (el) {
86+
el.style.setProperty('--mx', '\${x}px')
87+
el.style.setProperty('--my', '\${y + rect.height * 0.5}px')
88+
}
89+
}
90+
91+
function handleMouseLeave() {
92+
const el = revealImgRef.value
93+
if (el) {
94+
el.style.setProperty('--mx', '-9999px')
95+
el.style.setProperty('--my', '-9999px')
96+
}
97+
}
98+
</script>`
99+
});

0 commit comments

Comments
 (0)