Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

react-halloween

Package Overview
Dependencies
Maintainers
1
Versions
12
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

react-halloween

Halloween themed components for React

  • 0.2.0
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
65
decreased by-83.91%
Maintainers
1
Weekly downloads
 
Created
Source

react-halloween

This is a repo with some fun Halloween-themed components. It was made to support the Halloween section of patrickgillespie.com. If you scroll to the bottom of that page, you can see the Haunted and Eyes components in-action. You can see the LightsOut component on the Halloween Houses page, and the MagicalText component in the app's title bar.

Currently this library is still in a 0.* version, so its APIs may change. However, I feel pretty confident in what I have now, and I'm debating moving to version 1.0.0 in my next release.

Install

framer-motion is a peer-dependency.

  npm install framer-motion react-halloween

Demo

Storybook

To see a storybook, which contains demos of all of the components do the following: Clone the repo, install the deps, and then run the storybook.

  npm ci
  npm run storybook

Components

<Eyes />

A set of eyes which open and close and follow the cursor. This component accepts the following props:

NameTypeDefaultDescription
animationTimenumber0.75Time it takes for the eyes to open or close in seconds.
eyeBallColorstring"white"CSS color for the eyeball.
eyeLayoutstring or object'unfriendly'Defines the shape of the eye. Either a string representing a preset ("unfriendly", "menacing", "neutral"), or an object defining the details. See here for more info.
followbooleantrueIf the eyes should follow the cursor.
irisColorstring"#333"CSS color for the iris.
openbooleantrueIndicates if the eyes are open.
styleobject{}Style props to spread onto the container.
pupilColorstring"white"CSS color for the pupil.
pupilSizenumber1Number between 0 and 2, representing the pupil size.
widthnumber200The width of the component. The underlying SVGs will size themselves depending on this.

<Eye />

An eye which can open and close and can follow the cursor. This component accepts the following props:

NameTypeDefaultDescription
animationTimenumber0.75Time it takes the eye to open or close.
closedClipPathstring'M 0 4 C 3 4 7 4 10 4 C 7 4 3 4 0 4'Clip path for a closed eye.
eyeBallColorstring'white'CSS color of the eye.
followbooleantrueIf the eye should follow the cursor.
irisColorstring'#333'CSS color of the iris.
openbooleantrueIndicates if the eye is open.
openedClipPathstring'M 0 4 C 3 7 7 7 10 4 C 7 1 3 1 0 4'Clip path for an opened eye.
pupilColorstring'black'CSS color of the pupil.
pupilCoordsobject{cx:5,cy:4}The coordinates of the pupil.
pupilSizenumber1Pupil size. Should be a number between 0 and 2.
widthnumber50Width of the eye.

<Haunted />

A container which creatures (by default ghosts) will fly out of and which will glow when the cursor is hovered over it. This component accepts the following props:

NameTypeDefaultDescription
Creaturecomponentsee hereProp for overriding the creature that flies out of the container.
creatureOptionsobjectsee hereOptions for the creatures that fly out of the container.
creatureOptions.animationTimenumber1.5Fly-out time in seconds.
creatureOptions.numberOfnumber6Number of creatures/ghosts to fly out.
creatureOptions.distancenumber200Distance creature should travel in pixels.
creatureOptions.dimensionsobject{ width: 44, height: 44 }The height and width of the creature/ghost.
disableFunbooleanfalsetrue to turn off the effects.
glowOptionsobjectsee hereOptions for the glow effect.
glowOptions.animationTimenumber3Duration of glow in seconds.
glowOptions.boxShadowOffstring"0px 0px 0px rgba(255,0,0,0)"Box-shadow value when at glow lowest point.
glowOptions.boxShadowOnstring"0px 0px 40px rgba(255,0,0,1)"Box-shadow value when at glow highest point.
styleobject{}Style props to spread over the container.

<LightsOut />

Puts a website into darkness and creates a spotlight around the mouse. This should not be used for mobile/touch devices. This component accepts the following props:

NameTypeDefaultDescription
sizenumber300Size of the spotlight around the mouse.
darkColorstring'rgba(0,0,0,0.9)'Color of the backdrop.
clickToTurnOnLightsbooleanfalsetrue to turn off the effects.
zIndexnumber100000z-index of overlay

<MagicalText />

Not your granddaddy's color faded text, this component creates a gradient that moves and has (optional) sparkles or other adornments (such as ghosts or hearts). Initial idea was inspired by a Hyperplexed video. The adornments which appear around the text are simple SVG components. This library contains several which can be used with this component. You can see what these look like here.

This component accepts the following props:

NameTypeDefaultDescription
textstring''The text to display.
animationTimenumber10Length of the fade animation in seconds.
colorsArray['darkorange', 'purple']Array of CSS colors to fade.
fadeTextbooleantruetrue if text should be color faded, false otherwise.
disableFunbooleanfalsetrue to disable fade and adornment effects.
styleobject{}Style props to spread over the container.
AdornmentComponentStarCrossSVGComponent to use as the adornment. Several come from the library. See examples.
showAdornmentsbooleantrueIf the adornments/sparkles should be shown.
adornmentOptionsObjectOptions to customize the adornment.
adornmentOptions.animationTypeOne of: 'sparkle', 'scale''sparkle'How the adornment will be animated.
adornmentOptions.widthnumber16Width of adornment.
adornmentOptions.heightnumber16Height of adornment.
adornmentOptions.opacitynumber0.7Opacity of adornment.
adornmentOptions.durationnumber1Duration of adornment in seconds.
adornmentOptions.numberOfnumber3Number of adornments.

FAQs

Package last updated on 04 Sep 2023

Did you know?

Socket

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.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc