npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@medeeageanovu/grassly-component

v1.1.3

Published

Animated grass Web Component using Canvas and Lit

Readme

Grassly

A lightweight Web Component for rendering animated interactive grass using Canvas and Lit.

Overview

A cosmetic component for decorating your web pages with a corner of nature! The default customization options cover grass density, surface of the repeating pattern, wind intensity and colour themes. This component can be further customized by modifying the source files.

Instalation

Clone the repository or download the source code available here.

Or install from NPM:

npm install @medeeageanovu/grassly-component

Usage

There are multiple ways to integrate grassly-component.

For NPM, import the package in main.js:

import '@medeeageanovu/grassly-component';

For the bundles .js file, import the script in index.html:

<script type="module" src="path/to/script/grassly-component.build.js"></script>

Then use as a usual html element:

<grassly-component></grassly-component>

There are four customizable parameters:

<grassly-component density="number" wind="number" tile="number" theme="string"></grassly-component>

These parameters can me modified directly from the component, or by invoking the method setConfig with key-value pairs representing the corresponding parameters.

setConfig(config){
    Object.assign(this, config);
}

grassly-component.setConfig({density:densityValue, wind:windValue, theme:themeValue, tile:tileValue});

As the component inherits the width and height of the host, it is required to specify these in the host's css style or directly in the component's instantiation:

 .example-style {
    width: 500px;
    height: 200px;
    // resize: both - supported dynamic resizing
}

<div class="example">
    <grassly-component></grassly-component>
</div>
<grassly-component style="width:500px;height:200px"></grassly-component>

The component's animation can paused and resumed through the following methods:

grassly-component.pause();
grassly-component.play();

Documentation

The default parameters are:

| Property | Type | Default | Description | |----------|--------|---------|----------------------------------------------------------------| | density | number | 40 | number of grass blades distributed for the 1st, 2nd, 3rd layer | | wind | number | 1 | the intensity of the grass blades movement | | tile | number | 40 | grid spacing, length of repeating pattern | | theme | string | forest | color theme. cute! |

The avaiable themes are:

| Name | Example | |--------|--------| | forest |img_2.png| | spring |img.png| | summer |img_3.png| | autumn |img_4.png| | winter |img_6.png| | desert |img_5.png| | lilac |img_8.png| | neon |img_7.png|

An event is dispatched when the component is mounted:

this.dispatchEvent(new CustomEvent('grass-ready'));

Demo

demofinal.png Available in the source code /dev folder is a simple playground to become familiar with the provided default options.

Supported Languages

Currently, Grassly was tested on Lit, React, Vue.

Lit

<grassly-component density="40" wind="0.1" tile="25" theme="forest" ></grassly-component>
<script type="module" src="/src/main.js"></script>

React

import '@medeeageanovu/grassly-component';

export default function App() {
  return <grass-floor density="40" wind="0.1" tile="70" theme="autumn"></grass-floor>;
}

Vue

<script setup>
import '@medeeageanovu/grassly-component';
</script>

<template>
  <grassly-component density="10" wind="1" tile="20" theme="winter"/>
</template>

Notes

Requires browser environment (Canvas API) and must add lit to package dependencies.

The program logic is explained in /docs.

License

Permission is hereby granted to any person obtaining a copy of this software and associated documentation files to use, modify, merge, or distribute free of charge.