
Research
Two Malicious Rust Crates Impersonate Popular Logger to Steal Wallet Keys
Socket uncovers malicious Rust crates impersonating fast_log to steal Solana and Ethereum wallet keys from source code.
@dragonspark/hikari-preact
Advanced tools
Preact components and hooks for the @dragonspark/hikari WebGL framework.
Preact components and hooks for the @dragonspark/hikari WebGL framework.
npm install @dragonspark/hikari-preact @dragonspark/hikari-effects @dragonspark/hikari
# or
yarn add @dragonspark/hikari-preact @dragonspark/hikari-effects @dragonspark/hikari
Note: @dragonspark/hikari
and @dragonspark/hikari-effects
are peer dependencies and must be installed alongside this package.
A Preact component wrapper for the MorphGradient effect from hikari-effects.
import { MorphGradientCanvas } from '@dragonspark/hikari-preact';
function App() {
return (
<div className="app">
<MorphGradientCanvas
class="gradient-background"
baseColor="#ff0000"
waveColors={['#00ff00', '#0000ff', '#ffff00']}
/>
<div className="content">
<h1>Hello, World!</h1>
</div>
</div>
);
}
You can define gradient colors using CSS variables:
:root {
--gradient-color-1: #ff0000;
--gradient-color-2: #00ff00;
--gradient-color-3: #0000ff;
--gradient-color-4: #ffff00;
}
// The gradient will automatically use the CSS variables
<MorphGradientCanvas class="gradient-background" />
You can also pass CSS variables directly:
<MorphGradientCanvas
class="gradient-background"
baseColor="var(--gradient-color-1)"
waveColors={[
'var(--gradient-color-2)',
'var(--gradient-color-3)',
'var(--gradient-color-4)'
]}
/>
If CSS variables are not available or parsing fails, the component will fall back to these default values:
// Default base color
const defaultBaseColor = '#a960ee'; // Purple
// Default wave colors
const defaultWaveColors = [
'#ff333d', // Red
'#90e0ff', // Light blue
'#ffcb57' // Yellow
];
class
: string (optional) - CSS class name for the canvas elementstyle
: CSSProperties (optional) - Inline styles for the canvas elementbaseColor
: string (optional) - Base color for the gradient. Can be:
waveColors
: string[] (optional) - Array of wave colors for the gradient. Can be:
amplitude
: number (optional) - Wave amplitudeseed
: number (optional) - Random seedfreqX
: number (optional) - X-axis frequencyfreqY
: number (optional) - Y-axis frequencyfreqDelta
: number (optional) - Frequency change ratedarkenTop
: boolean (optional) - Darken the top of the gradientonInit
: (gradient: MorphGradient) => void (optional) - Callback when gradient is initializedA custom hook for using the MorphGradient effect in Preact components.
import { useRef, useEffect } from 'preact/hooks';
import { useMorphGradient } from '@dragonspark/hikari-preact';
function GradientComponent() {
// 1) Generate a stable canvas ID once
const idRef = useRef(`gradient-canvas-${Math.random().toString(36).slice(2, 9)}`);
// 2) Initialize the gradient on that ID
const { gradient, isInitialized, pause } = useMorphGradient({
canvasId: idRef.current,
baseColor: '#3498db',
waveColors: ['#9b59b6', '#e74c3c', '#f1c40f'],
amplitude: 320
// autoPlay defaults to true
});
// 3) Pause after 5s once it’s running
useEffect(() => {
if (!isInitialized) return;
const timer = setTimeout(() => pause(), 5000);
return () => clearTimeout(timer);
}, [isInitialized, pause]);
return (
<div class="gradient-container">
<canvas
id={idRef.current}
class="gradient-canvas"
style={{ width: '100%', height: '100%' }}
/>
</div>
);
}
MIT © DragonSpark
FAQs
Preact components and hooks for the @dragonspark/hikari WebGL framework.
The npm package @dragonspark/hikari-preact receives a total of 1 weekly downloads. As such, @dragonspark/hikari-preact popularity was classified as not popular.
We found that @dragonspark/hikari-preact demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Research
Socket uncovers malicious Rust crates impersonating fast_log to steal Solana and Ethereum wallet keys from source code.
Research
A malicious package uses a QR code as steganography in an innovative technique.
Research
/Security News
Socket identified 80 fake candidates targeting engineering roles, including suspected North Korean operators, exposing the new reality of hiring as a security function.