Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/trovster/music-wrapped

A Web Component for end-of-year music statistics.
https://github.com/trovster/music-wrapped

music web-component

Last synced: 3 days ago
JSON representation

A Web Component for end-of-year music statistics.

Awesome Lists containing this project

README

        

![](./screenshot.webp)

# Music Wrapped

This is a Web Component for creating a music card similar to end-of-year
statistics provided by Spotify or Apple Music.

## Installation

```bash
npm install @trovster/music-wrapped --save
```

## Usage

These are [Web
Components](https://developer.mozilla.org/en-US/docs/Web/API/Web_Components) and
must be imported before the custom elements can be used. If you are using the
fitness card, then you do not need to import the activity ring.

```html

import '@trovster/music-wrapped/src/MusicWrapped.js';

```

The card requires the lists inside the component. These should contain a
`title=""` attribute, which is used for the list title. You can add the optional
“Minutes Listened” and ”Top Genre” information by using the `seconds` and
`genre` attributes.

```html


  1. Taylor Swift

  2. Bad Bunny

  3. Post Malone

  4. Ed Sheeran

```

## Development

### Linting and Formatting

To scan the project for linting and formatting errors, run:

```bash
npm run lint
```

To automatically fix linting and formatting errors, run:

```bash
npm run format
```

### Local Demo with `web-dev-server`

To start a local development server that serves the basic demo located in
`docs/index.html`, run:

```bash
npm start
```

### Tooling Configs

For most of the tools, the configuration is in the `package.json` to minimize
the amount of files in your project.

If you customize the configuration a lot, you can consider moving them to
individual files.