Skip to content

Commit

Permalink
Format example html
Browse files Browse the repository at this point in the history
  • Loading branch information
captbaritone committed May 7, 2024
1 parent 72b1a9f commit 723afc8
Show file tree
Hide file tree
Showing 4 changed files with 78 additions and 84 deletions.
64 changes: 31 additions & 33 deletions examples/minimal/index.html
Original file line number Diff line number Diff line change
@@ -1,44 +1,42 @@
<!DOCTYPE html>
<html>

<head>
<head>
<meta charset="utf-8" />
</head>
</head>

<body>
<body>
<div id="app" style="height: 100vh">
<!-- Webamp will attempt to center itself within this div -->
<!-- Webamp will attempt to center itself within this div -->
</div>
<script src="https://unpkg.com/[email protected]/built/webamp.bundle.min.js"></script>
<script>
const Webamp = window.Webamp;
const webamp = new Webamp({
initialTracks: [
{
metaData: {
artist: "DJ Mike Llama",
title: "Llama Whippin' Intro"
},
// NOTE: Your audio file must be served from the same domain as your HTML
// file, or served with permissive CORS HTTP headers:
// https://developer.mozilla.org/en-US/docs/Web/HTTP/CORS
url: "https://cdn.jsdelivr.net/gh/captbaritone/webamp@43434d82cfe0e37286dbbe0666072dc3190a83bc/mp3/llama-2.91.mp3",
duration: 5.322286
},
{
metaData: {
artist: "Some Artist",
title: "Title of Second Track"
},
url: "https://cdn.jsdelivr.net/gh/captbaritone/webamp@43434d82cfe0e37286dbbe0666072dc3190a83bc/mp3/llama-2.91.mp3",
duration: 5.322286
}
],
});
const Webamp = window.Webamp;
const webamp = new Webamp({
initialTracks: [
{
metaData: {
artist: "DJ Mike Llama",
title: "Llama Whippin' Intro",
},
// NOTE: Your audio file must be served from the same domain as your HTML
// file, or served with permissive CORS HTTP headers:
// https://developer.mozilla.org/en-US/docs/Web/HTTP/CORS
url: "https://cdn.jsdelivr.net/gh/captbaritone/webamp@43434d82cfe0e37286dbbe0666072dc3190a83bc/mp3/llama-2.91.mp3",
duration: 5.322286,
},
{
metaData: {
artist: "Some Artist",
title: "Title of Second Track",
},
url: "https://cdn.jsdelivr.net/gh/captbaritone/webamp@43434d82cfe0e37286dbbe0666072dc3190a83bc/mp3/llama-2.91.mp3",
duration: 5.322286,
},
],
});

// Returns a promise indicating when it's done loading.
webamp.renderWhenReady(document.getElementById('app'));
// Returns a promise indicating when it's done loading.
webamp.renderWhenReady(document.getElementById("app"));
</script>
</body>

</body>
</html>
78 changes: 39 additions & 39 deletions examples/minimalMilkdrop/index.html
Original file line number Diff line number Diff line change
@@ -1,52 +1,52 @@
<!DOCTYPE html>
<html>

<head>
<head>
<meta charset="utf-8" />
</head>
</head>

<body>
<body>
<div id="app" style="height: 100vh">
<!-- Webamp will attempt to center itself within this div -->
<!-- Webamp will attempt to center itself within this div -->
</div>
<script src="https://unpkg.com/[email protected]/built/webamp.bundle.min.js"></script>
<script src="https://unpkg.com/[email protected]/lib/butterchurn.min.js"></script>
<script src="https://unpkg.com/[email protected]/lib/butterchurnPresets.min.js"></script>
<script>
const Webamp = window.Webamp;
new Webamp({
initialTracks: [{
metaData: {
artist: "DJ Mike Llama",
title: "Llama Whippin' Intro"
},
// NOTE: Your audio file must be served from the same domain as your HTML
// file, or served with permissive CORS HTTP headers:
// https://developer.mozilla.org/en-US/docs/Web/HTTP/CORS
url: "https://cdn.jsdelivr.net/gh/captbaritone/webamp@43434d82cfe0e37286dbbe0666072dc3190a83bc/mp3/llama-2.91.mp3",
duration: 5.322286
}],
__butterchurnOptions: {
importButterchurn: () => Promise.resolve(window.butterchurn),
getPresets: () => {
const presets = window.butterchurnPresets.getPresets();
return Object.keys(presets).map((name) => {
return {
name,
butterchurnPresetObject: presets[name]
};
});
},
butterchurnOpen: true
const Webamp = window.Webamp;
new Webamp({
initialTracks: [
{
metaData: {
artist: "DJ Mike Llama",
title: "Llama Whippin' Intro",
},
__initialWindowLayout: {
main: { position: { x: 0, y: 0 } },
equalizer: { position: { x: 0, y: 116 } },
playlist: { position: { x: 0, y: 232 }, size: [0, 4] },
milkdrop: { position: { x: 275, y: 0 }, size: [7, 12] }
}
}).renderWhenReady(document.getElementById('app'));
// NOTE: Your audio file must be served from the same domain as your HTML
// file, or served with permissive CORS HTTP headers:
// https://developer.mozilla.org/en-US/docs/Web/HTTP/CORS
url: "https://cdn.jsdelivr.net/gh/captbaritone/webamp@43434d82cfe0e37286dbbe0666072dc3190a83bc/mp3/llama-2.91.mp3",
duration: 5.322286,
},
],
__butterchurnOptions: {
importButterchurn: () => Promise.resolve(window.butterchurn),
getPresets: () => {
const presets = window.butterchurnPresets.getPresets();
return Object.keys(presets).map((name) => {
return {
name,
butterchurnPresetObject: presets[name],
};
});
},
butterchurnOpen: true,
},
__initialWindowLayout: {
main: { position: { x: 0, y: 0 } },
equalizer: { position: { x: 0, y: 116 } },
playlist: { position: { x: 0, y: 232 }, size: [0, 4] },
milkdrop: { position: { x: 275, y: 0 }, size: [7, 12] },
},
}).renderWhenReady(document.getElementById("app"));
</script>
</body>

</body>
</html>
10 changes: 4 additions & 6 deletions examples/webpack/index.html
Original file line number Diff line number Diff line change
@@ -1,13 +1,11 @@
<!DOCTYPE html>
<html>

<head>
<head>
<meta charset="utf-8" />
</head>
</head>

<body>
<body>
<div id="app" style="height: 100vh"></div>
<script src="./bundle.js"></script>
</body>

</body>
</html>
10 changes: 4 additions & 6 deletions examples/webpackLazyLoad/index.html
Original file line number Diff line number Diff line change
@@ -1,13 +1,11 @@
<!DOCTYPE html>
<html>

<head>
<head>
<meta charset="utf-8" />
</head>
</head>

<body>
<body>
<div id="app" style="height: 100vh"></div>
<script src="./bundle.js"></script>
</body>

</body>
</html>

0 comments on commit 723afc8

Please sign in to comment.