-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #27 from SG60/25-soundcloud-svelte-component
- Loading branch information
Showing
3 changed files
with
44 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
<script type="ts"> | ||
export let url: string; | ||
export let title = 'SoundCloud Player'; | ||
export let height: 166 | 300 | 450 | 600 = 166; | ||
export let color = '4f6cec'; | ||
</script> | ||
|
||
<div> | ||
<iframe | ||
{title} | ||
width="100%" | ||
{height} | ||
scrolling="no" | ||
frameborder="no" | ||
src="https://w.soundcloud.com/player/?url={url}&color={color}&auto_play=false&hide_related=false&show_comments=true&show_user=true&show_reposts=false" | ||
/> | ||
</div> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
<script lang="ts"> | ||
import { Meta, Template, Story } from '@storybook/addon-svelte-csf'; | ||
import SoundCloud from '$lib/SoundCloud.svelte'; | ||
</script> | ||
|
||
<Meta | ||
title="SoundCloud Embed" | ||
component={SoundCloud} | ||
argTypes={{ | ||
// trackId: { control: 'text', defaultValue: '1202071039' }, | ||
title: { control: 'text' }, | ||
url: { control: 'text' }, | ||
height: { control: 'select', options: [166, 300, 450, 600] }, | ||
color: { control: 'text', defaultValue: '4f6cec' } | ||
}} | ||
/> | ||
|
||
<Template let:args><SoundCloud {...args} /></Template> | ||
|
||
<Story name="default" args={{ url: 'https://soundcloud.com/samgreening/frames' }} /> | ||
|
||
<Story | ||
name="playlist" | ||
args={{ url: 'https://soundcloud.com/samgreening/sets/edward-thomas-songs', height: 300 }} | ||
/> |