Skip to content

Commit 723afc8

Browse files
committed
Format example html
1 parent 72b1a9f commit 723afc8

File tree

4 files changed

+78
-84
lines changed

4 files changed

+78
-84
lines changed

examples/minimal/index.html

+31-33
Original file line numberDiff line numberDiff line change
@@ -1,44 +1,42 @@
11
<!DOCTYPE html>
22
<html>
3-
4-
<head>
3+
<head>
54
<meta charset="utf-8" />
6-
</head>
5+
</head>
76

8-
<body>
7+
<body>
98
<div id="app" style="height: 100vh">
10-
<!-- Webamp will attempt to center itself within this div -->
9+
<!-- Webamp will attempt to center itself within this div -->
1110
</div>
1211
<script src="https://unpkg.com/[email protected]/built/webamp.bundle.min.js"></script>
1312
<script>
14-
const Webamp = window.Webamp;
15-
const webamp = new Webamp({
16-
initialTracks: [
17-
{
18-
metaData: {
19-
artist: "DJ Mike Llama",
20-
title: "Llama Whippin' Intro"
21-
},
22-
// NOTE: Your audio file must be served from the same domain as your HTML
23-
// file, or served with permissive CORS HTTP headers:
24-
// https://developer.mozilla.org/en-US/docs/Web/HTTP/CORS
25-
url: "https://cdn.jsdelivr.net/gh/captbaritone/webamp@43434d82cfe0e37286dbbe0666072dc3190a83bc/mp3/llama-2.91.mp3",
26-
duration: 5.322286
27-
},
28-
{
29-
metaData: {
30-
artist: "Some Artist",
31-
title: "Title of Second Track"
32-
},
33-
url: "https://cdn.jsdelivr.net/gh/captbaritone/webamp@43434d82cfe0e37286dbbe0666072dc3190a83bc/mp3/llama-2.91.mp3",
34-
duration: 5.322286
35-
}
36-
],
37-
});
13+
const Webamp = window.Webamp;
14+
const webamp = new Webamp({
15+
initialTracks: [
16+
{
17+
metaData: {
18+
artist: "DJ Mike Llama",
19+
title: "Llama Whippin' Intro",
20+
},
21+
// NOTE: Your audio file must be served from the same domain as your HTML
22+
// file, or served with permissive CORS HTTP headers:
23+
// https://developer.mozilla.org/en-US/docs/Web/HTTP/CORS
24+
url: "https://cdn.jsdelivr.net/gh/captbaritone/webamp@43434d82cfe0e37286dbbe0666072dc3190a83bc/mp3/llama-2.91.mp3",
25+
duration: 5.322286,
26+
},
27+
{
28+
metaData: {
29+
artist: "Some Artist",
30+
title: "Title of Second Track",
31+
},
32+
url: "https://cdn.jsdelivr.net/gh/captbaritone/webamp@43434d82cfe0e37286dbbe0666072dc3190a83bc/mp3/llama-2.91.mp3",
33+
duration: 5.322286,
34+
},
35+
],
36+
});
3837

39-
// Returns a promise indicating when it's done loading.
40-
webamp.renderWhenReady(document.getElementById('app'));
38+
// Returns a promise indicating when it's done loading.
39+
webamp.renderWhenReady(document.getElementById("app"));
4140
</script>
42-
</body>
43-
41+
</body>
4442
</html>

examples/minimalMilkdrop/index.html

+39-39
Original file line numberDiff line numberDiff line change
@@ -1,52 +1,52 @@
11
<!DOCTYPE html>
22
<html>
3-
4-
<head>
3+
<head>
54
<meta charset="utf-8" />
6-
</head>
5+
</head>
76

8-
<body>
7+
<body>
98
<div id="app" style="height: 100vh">
10-
<!-- Webamp will attempt to center itself within this div -->
9+
<!-- Webamp will attempt to center itself within this div -->
1110
</div>
1211
<script src="https://unpkg.com/[email protected]/built/webamp.bundle.min.js"></script>
1312
<script src="https://unpkg.com/[email protected]/lib/butterchurn.min.js"></script>
1413
<script src="https://unpkg.com/[email protected]/lib/butterchurnPresets.min.js"></script>
1514
<script>
16-
const Webamp = window.Webamp;
17-
new Webamp({
18-
initialTracks: [{
19-
metaData: {
20-
artist: "DJ Mike Llama",
21-
title: "Llama Whippin' Intro"
22-
},
23-
// NOTE: Your audio file must be served from the same domain as your HTML
24-
// file, or served with permissive CORS HTTP headers:
25-
// https://developer.mozilla.org/en-US/docs/Web/HTTP/CORS
26-
url: "https://cdn.jsdelivr.net/gh/captbaritone/webamp@43434d82cfe0e37286dbbe0666072dc3190a83bc/mp3/llama-2.91.mp3",
27-
duration: 5.322286
28-
}],
29-
__butterchurnOptions: {
30-
importButterchurn: () => Promise.resolve(window.butterchurn),
31-
getPresets: () => {
32-
const presets = window.butterchurnPresets.getPresets();
33-
return Object.keys(presets).map((name) => {
34-
return {
35-
name,
36-
butterchurnPresetObject: presets[name]
37-
};
38-
});
39-
},
40-
butterchurnOpen: true
15+
const Webamp = window.Webamp;
16+
new Webamp({
17+
initialTracks: [
18+
{
19+
metaData: {
20+
artist: "DJ Mike Llama",
21+
title: "Llama Whippin' Intro",
4122
},
42-
__initialWindowLayout: {
43-
main: { position: { x: 0, y: 0 } },
44-
equalizer: { position: { x: 0, y: 116 } },
45-
playlist: { position: { x: 0, y: 232 }, size: [0, 4] },
46-
milkdrop: { position: { x: 275, y: 0 }, size: [7, 12] }
47-
}
48-
}).renderWhenReady(document.getElementById('app'));
23+
// NOTE: Your audio file must be served from the same domain as your HTML
24+
// file, or served with permissive CORS HTTP headers:
25+
// https://developer.mozilla.org/en-US/docs/Web/HTTP/CORS
26+
url: "https://cdn.jsdelivr.net/gh/captbaritone/webamp@43434d82cfe0e37286dbbe0666072dc3190a83bc/mp3/llama-2.91.mp3",
27+
duration: 5.322286,
28+
},
29+
],
30+
__butterchurnOptions: {
31+
importButterchurn: () => Promise.resolve(window.butterchurn),
32+
getPresets: () => {
33+
const presets = window.butterchurnPresets.getPresets();
34+
return Object.keys(presets).map((name) => {
35+
return {
36+
name,
37+
butterchurnPresetObject: presets[name],
38+
};
39+
});
40+
},
41+
butterchurnOpen: true,
42+
},
43+
__initialWindowLayout: {
44+
main: { position: { x: 0, y: 0 } },
45+
equalizer: { position: { x: 0, y: 116 } },
46+
playlist: { position: { x: 0, y: 232 }, size: [0, 4] },
47+
milkdrop: { position: { x: 275, y: 0 }, size: [7, 12] },
48+
},
49+
}).renderWhenReady(document.getElementById("app"));
4950
</script>
50-
</body>
51-
51+
</body>
5252
</html>

examples/webpack/index.html

+4-6
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,11 @@
11
<!DOCTYPE html>
22
<html>
3-
4-
<head>
3+
<head>
54
<meta charset="utf-8" />
6-
</head>
5+
</head>
76

8-
<body>
7+
<body>
98
<div id="app" style="height: 100vh"></div>
109
<script src="./bundle.js"></script>
11-
</body>
12-
10+
</body>
1311
</html>

examples/webpackLazyLoad/index.html

+4-6
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,11 @@
11
<!DOCTYPE html>
22
<html>
3-
4-
<head>
3+
<head>
54
<meta charset="utf-8" />
6-
</head>
5+
</head>
76

8-
<body>
7+
<body>
98
<div id="app" style="height: 100vh"></div>
109
<script src="./bundle.js"></script>
11-
</body>
12-
10+
</body>
1311
</html>

0 commit comments

Comments
 (0)