Skip to content

Commit

Permalink
feat: add lrc player
Browse files Browse the repository at this point in the history
  • Loading branch information
surunzi committed Sep 18, 2024
1 parent 0b27fd7 commit ee57623
Show file tree
Hide file tree
Showing 7 changed files with 78 additions and 1 deletion.
9 changes: 9 additions & 0 deletions index.json
Original file line number Diff line number Diff line change
Expand Up @@ -161,6 +161,15 @@
"install": false,
"react": false
},
"lrc-player": {
"version": "0.1.0",
"style": true,
"icon": false,
"test": true,
"install": false,
"react": false,
"dependencies": []
},
"markdown-editor": {
"dependencies": ["markdown-viewer"],
"icon": true,
Expand Down
27 changes: 27 additions & 0 deletions src/lrc-player/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
# Luna Lrc Player

Play lyrics in LRC format.

## Demo

https://luna.liriliri.io/?path=/story/lrc-player

## Install

Add the following script and style to your page.

```html
<link rel="stylesheet" href="//cdn.jsdelivr.net/npm/luna-lrc-player/luna-lrc-player.css" />
<script src="//cdn.jsdelivr.net/npm/luna-lrc-player/luna-lrc-player.js"></script>
```

You can also get it on npm.

```bash
npm install luna-lrc-player --save
```

```javascript
import 'luna-lrc-player/luna-lrc-player.css'
import LunaLrcPlayer from 'luna-lrc-player'
```
15 changes: 15 additions & 0 deletions src/lrc-player/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
import Component from '../share/Component'
import { exportCjs } from '../share/util'

/**
* Play lyrics in LRC format.
*/
export default class LrcPlayer extends Component {
constructor(container: HTMLElement) {
super(container, { compName: 'lrc-player' })
}
}

if (typeof module !== 'undefined') {
exportCjs(module, LrcPlayer)
}
5 changes: 5 additions & 0 deletions src/lrc-player/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"name": "lrc-player",
"version": "0.1.0",
"description": "Play lyrics in LRC format"
}
20 changes: 20 additions & 0 deletions src/lrc-player/story.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
import 'luna-lrc-player.css'
import LrcPlayer from 'luna-lrc-player.js'
import readme from './README.md'
import story from '../share/story'

const def = story(
'lrc-player',
(container) => {
const lrcPlayer = new LrcPlayer(container)

return lrcPlayer
},
{
readme,
story: __STORY__,
}
)

export default def
export const { lrcPlayer } = def
Empty file added src/lrc-player/style.scss
Empty file.
3 changes: 2 additions & 1 deletion tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,8 @@
"luna-image-viewer": ["src/image-viewer/index"],
"luna-painter": ["src/painter/index"],
"luna-mask-editor": ["src/mask-editor/index"],
"luna-image-list": ["src/image-list/index"]
"luna-image-list": ["src/image-list/index"],
"luna-lrc-player": ["src/lrc-player/index"]
}
}
}

0 comments on commit ee57623

Please sign in to comment.