mirror of
https://github.com/DavidHDev/vue-bits.git
synced 2026-03-07 22:49:31 -07:00
Add mixBlendMode prop to MetaBalls component and demo
This commit is contained in:
@@ -13,6 +13,7 @@ interface MetaBallsProps {
|
|||||||
cursorBallSize?: number;
|
cursorBallSize?: number;
|
||||||
cursorBallColor?: string;
|
cursorBallColor?: string;
|
||||||
enableTransparency?: boolean;
|
enableTransparency?: boolean;
|
||||||
|
mixBlendMode?: string;
|
||||||
}
|
}
|
||||||
|
|
||||||
type BallParams = {
|
type BallParams = {
|
||||||
@@ -33,7 +34,8 @@ const props = withDefaults(defineProps<MetaBallsProps>(), {
|
|||||||
clumpFactor: 1,
|
clumpFactor: 1,
|
||||||
cursorBallSize: 3,
|
cursorBallSize: 3,
|
||||||
cursorBallColor: '#27FF64',
|
cursorBallColor: '#27FF64',
|
||||||
enableTransparency: false
|
enableTransparency: false,
|
||||||
|
mixBlendMode: 'normal'
|
||||||
});
|
});
|
||||||
|
|
||||||
function parseHexColor(hex: string): [number, number, number] {
|
function parseHexColor(hex: string): [number, number, number] {
|
||||||
@@ -263,5 +265,5 @@ watch(
|
|||||||
</script>
|
</script>
|
||||||
|
|
||||||
<template>
|
<template>
|
||||||
<div ref="containerRef" class="relative w-full h-full" />
|
<div ref="containerRef" class="relative w-full h-full" :style="`mix-blend-mode: ${props.mixBlendMode}`" />
|
||||||
</template>
|
</template>
|
||||||
|
|||||||
@@ -12,6 +12,7 @@
|
|||||||
:hoverSmoothness="hoverSmoothness"
|
:hoverSmoothness="hoverSmoothness"
|
||||||
:clumpFactor="clumpFactor"
|
:clumpFactor="clumpFactor"
|
||||||
:speed="speed"
|
:speed="speed"
|
||||||
|
mix-blend-mode="screen"
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
@@ -199,6 +200,18 @@ const propData = [
|
|||||||
type: 'string',
|
type: 'string',
|
||||||
default: '#27FF64',
|
default: '#27FF64',
|
||||||
description: 'Color of the cursor ball.'
|
description: 'Color of the cursor ball.'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
name: 'mixBlendMode',
|
||||||
|
type: 'string',
|
||||||
|
default: 'normal',
|
||||||
|
description: 'CSS mix-blend-mode value for how the metaballs blend with content behind them.'
|
||||||
}
|
}
|
||||||
];
|
];
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
|
<style scoped>
|
||||||
|
.demo-container {
|
||||||
|
padding: 0;
|
||||||
|
}
|
||||||
|
</style>
|
||||||
|
|||||||
Reference in New Issue
Block a user