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

spotify-svelte-components

v1.0.1

Published

Each page (or layout), which requires spotify data must run the `fetchSpotifyData()` function, to ensure data loading before the initialisation of components. The fetchSpotifyData() function can be modified as needed to return data from somewhere else, as

Downloads

11

Readme

Using the library

Each page (or layout), which requires spotify data must run the fetchSpotifyData() function, to ensure data loading before the initialisation of components. The fetchSpotifyData() function can be modified as needed to return data from somewhere else, as long as the returned data is parsable by processData().

This library wasn't really intended for external use by third-parties, and as such no support will be provided other than this documentation.

WARNING: This library only supports svelte projects at this time.

Player components

NOTE: All of these components need to listen to stores from the lib/utils directory. If you are modifying the data retrieval method from Spotify's API, and you decide that you want to completely rework the lib/utils functions, ensure that you include stores for:

ColorPalette (colorUtils.ts) CurrentColor (colorUtils.ts) data (spotifyUtils.ts) isLoading (spotifyUtils.ts) error (spotifyUtils.ts)

SpotifyPlayer.svelte

The Player/SpotifyPlayer component is the entrypoint for the Player.

Extras/ThemePickerText.svelte

ThemePickerText creates a span of text which will act as a selector for the player's background-color. When a character is hovered, the corresponding index in the colorPalette() store is set as the text color. ThemePickerText.svelte expects an array of strings to be passed as a prop.

WARNING: ThemePickerText supports no more than 5 characters in an array and will likely error if supplied with more than 5, due to the nature of the returned color data. This may be reworked in the future to allow more than 5 characters, only with regular text appended after the maximum of 5 responsive characters.

Extras/ThemePickerColor.svelte

ThemePickerColor creates a span of elements, all of which are 6rem wide buttons which when clicked, will set the background color of the player element. No other background or elements are included to allow the component to be easily slotted in anywhere and customised as needed.

TrackProgress.svelte

Responsible for creating the player head for the player component. Listens to the $data store from spotifyUtils.ts.

ArtistList.svelte

Creates the artist list based on the [artists] field of the returned spotify data.