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 🙏

© 2024 – Pkg Stats / Ryan Hefner

floating-brain

v1.0.1

Published

Simple svg of a hoverable, floating brain, displaying different skill areas

Downloads

7

Readme

  • A beautiful API for your portfolio, to present your skills
  • Works with JSON
  • Responsive and easy to use
  • Styling can be easily customized!

➤ Table of Contents

➤ Description

Floating-brain is a simple to use API, allowing you to present your skills and their description in a unique and eye-catching way. In order to use it, all you need is to call a function, where you will pass the data you need.

➤ 0. Installation

Install the component...

npm install floating-brain

...and import it afterwards

<script type="module">
import { floatingBrain } from "./lib/index.js";
</script>

➤ 1. Set your data

You can pass exactly 5 skills with they descriptions. All of them need to be grouped into a one object. The best is for you to define the object, and the pass it in the arguments. You should also chose the placeholder where the descriptions will be displayed after the user hovers over a certain skill. Finally, you need to pass the fallback sentence, to which the placeholder for skills descriptions will be reseted after the user moves the mouse or taps away from the SVG.

Optionally, you may also chose the parent, where you want to append the module. If you don't define the parent, the floating brain will be appended to the body of the document. Another optional argument is the width of the module, to which the whole svg will scale. The default is defined to be "40vw", however you might change it.

 let mySkills = {
            sleeping: "I sleep",
            eating: "I eat",
            running: "I don't run",
            jumping: "I can jump",
            crying: "I cri"
        };
let fallbackText = "Check out my skills";
let placeholder =  document.querySelector("p");
let parent = document.querySelector("#parent");
let width = "35vw"

➤ 2. Feed the module with data

After importing the component and creating your own data, it's time to combine both.

Vanila JS:

let brain = floatingBrain(mySkills, fallbackText, placeholder, width, parent);

➤ 3. Customize styling

The module can be easily customized according to your style needs, just like in the example below:

In order to implement your own styling, all you need is to define the css variables mentioned in the code below. The font is inherited, so you can simply assign it to the module f.ex. through a unique id.

:host{    
    --skill1-background-color: yellow;
    --skill2-background-color: orange;
    --skill3-background-color: red;
    --skill4-background-color: green;
    --skill5-background-color: purple;
    --floating-brain-font-family: "Dosis";
}
#mytreeview {
font-family: "Dosis", sans-serif;
color: purple;
}

If you decide not to apply any styling, the module will fallback to the default styling, as in the demo gif.

➤ License

Licensed under MIT.