New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

@adityapurwa/starflies

Package Overview
Dependencies
Maintainers
1
Versions
2
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@adityapurwa/starflies

Add starflies to a website

  • 1.0.1
  • latest
  • npm
  • Socket score

Version published
Maintainers
1
Created
Source

Starflies

Size Version Vulnerabilities License

Add starflies to a website.

Why?

Because starry night is beautiful.

Demo

https://thatskywish.netlify.app

Install

$ npm install --save @adityapurwa/starflies

Usage

const starflies = require('@adityapurwa/starflies');

document.addEventListener('DOMContentLoaded', () => {
    starflies();
});

Parameters

Call the starflies([stars], [background]) function to attach the starflies effect to the current page.

stars

The stars to be rendered.

Default:

[
    ...generateStars(70),
    ...generateStars(100, 2, 0.1, 0.1),
    ...generateStars(400, 1, 0.1, 0.05),
]

By default, it generates three layers of stars with various sizes to simulate a Parallax effect.

The array of stars that will be rendered, you can use the #generateStars function to generate the stars.

background

The background color of the canvas.

Default: #1b1f33

API

generateStars

Generate stars based on the given parameters.

  • count - The number of stars to generate.
  • minSize - The minimum size of the stars.
  • maxSize - The maximum size of the stars.
  • maxVelocity - The maximum velocity of the stars.

starflies

Attach the starflies effect to the current page.

  • stars - The stars to be rendered.
  • background - The background color of the canvas.

License

MIT © Aditya Purwa

Keywords

FAQs

Package last updated on 30 Jan 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