Skip to content

Commit

Permalink
Merge pull request #37 from tomhazledine/refactor
Browse files Browse the repository at this point in the history
Refactor
  • Loading branch information
tomhazledine authored Feb 14, 2024
2 parents 974ad9d + eb55601 commit 60fac10
Show file tree
Hide file tree
Showing 31 changed files with 728 additions and 751 deletions.
8 changes: 4 additions & 4 deletions build.js
Original file line number Diff line number Diff line change
Expand Up @@ -31,18 +31,18 @@ const config = {
...globalConfig,
format: "esm",
entryPoints: [
{ out: "picobel", in: "src/js/index.js" },
{ out: "picobel-component", in: "src/js/web-component.js" },
{ out: "picobel", in: "src/js/outputs/index.js" },
{ out: "picobel-component", in: "src/js/wc/web-component.js" },
...components.map(theme => ({
out: `picobel-component-${theme}`,
in: `src/js/web-component.${theme}.js`
in: `src/js/wc/web-component.${theme}.js`
}))
],
loader: { ".css": "text" }
},
legacy: {
...globalConfig,
entryPoints: ["src/js/legacy.js"],
entryPoints: ["src/js/outputs/legacy.js"],
entryNames: `picobel.${version}`,
format: "iife"
},
Expand Down
77 changes: 77 additions & 0 deletions demo/component-default.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,77 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<title>Picobel.js Test Page</title>

<!-- Load the Picobel CSS -->
<link
rel="stylesheet"
href="../src/css/picobel.all.css"
type="text/css"
/>
</head>
<body style="font-family: sans-serif">
<nav>
<ul>
<li><a href="index.html">Home</a></li>
<li>
<a href="composable.html">Composable</a>
</li>
<li><a href="types.html">Types</a></li>
<li><a href="types.html">Manual</a></li>
<li><a href="component.html">Web Component</a></li>
</ul>
</nav>

<div class="generic-wrapper">
<h1>Testing Picobel: web component default</h1>
<h2>
<code>&lt;picobel-player-default&gt;</code>
</h2>

<picobel-player-default class="foo">
<audio
src="https://eatenbymonsters.com/audio/christmas/web/MasterSlashSlave_AllIWantForChristmas.mp3"
title="All I Want for Christmas"
data-artist="Master Slash Slave"
controls
>
Your browser does not support the
<code>audio</code> element.
</audio>
</picobel-player-default>

<h2>
<code>&lt;picobel-player-default&gt;</code> with multiple audio
nodes
</h2>

<picobel-player-default>
<audio
src="https://eatenbymonsters.com/audio/christmas/web/MasterSlashSlave_AllIWantForChristmas.mp3"
title="All I Want for Christmas"
data-artist="Master Slash Slave"
controls
>
Your browser does not support the
<code>audio</code> element.
</audio>
<audio
src="./audio-examples/taken-at-the-flood.mp3"
title="Taken at the Flood"
data-artist="Freeze Them"
controls
>
Your browser does not support the
<code>audio</code> element.
</audio>
</picobel-player-default>
</div>

<script
type="text/javascript"
src="../build/picobel-component-default.js"
></script>
</body>
</html>
33 changes: 15 additions & 18 deletions demo/component.html
Original file line number Diff line number Diff line change
Expand Up @@ -21,11 +21,20 @@
<li><a href="types.html">Types</a></li>
<li><a href="types.html">Manual</a></li>
<li>Web Component</li>
<li>
<a href="component-default.html">Web Component "default"</a>
</li>
</ul>
</nav>

<div class="generic-wrapper">
<h1>Testing Picobel: web component</h1>

<p>
View experimental
<a href="component-default.html">Web Component "default"</a>.
</p>

<h2>
<code>&lt;picobel-player&gt;</code> loaded with no inbuilt
styles
Expand All @@ -44,11 +53,11 @@ <h2>
</picobel-player>

<h2>
<code>&lt;picobel-player-default&gt;</code> loaded (the
"default" theme)
<code>&lt;picobel-player&gt;</code> loaded with
<code>data-theme="skeleton"</code> and external stylesheet
</h2>

<picobel-player-default>
<picobel-player data-theme="skeleton">
<audio
src="https://eatenbymonsters.com/audio/christmas/web/MasterSlashSlave_AllIWantForChristmas.mp3"
title="All I Want for Christmas"
Expand All @@ -58,18 +67,10 @@ <h2>
Your browser does not support the
<code>audio</code> element.
</audio>
</picobel-player-default>

<h2>
<code>&lt;picobel-player&gt;</code> loaded with
<code>data-theme="skeleton"</code> and external stylesheet
</h2>

<picobel-player data-theme="skeleton">
<audio
src="https://eatenbymonsters.com/audio/christmas/web/MasterSlashSlave_AllIWantForChristmas.mp3"
title="All I Want for Christmas"
data-artist="Master Slash Slave"
src="./audio-examples/taken-at-the-flood.mp3"
title="Taken at the Flood"
data-artist="Freeze Them"
controls
>
Your browser does not support the
Expand All @@ -82,9 +83,5 @@ <h2>
type="text/javascript"
src="../build/picobel-component.js"
></script>
<script
type="text/javascript"
src="../build/picobel-component-default.js"
></script>
</body>
</html>
6 changes: 3 additions & 3 deletions demo/manual.html
Original file line number Diff line number Diff line change
Expand Up @@ -68,10 +68,10 @@ <h1>Some stuff...</h1>
</audio>

<!-- Load Scripts -->
<script type="text/javascript" src="../build/picobel.2.1.0.js"></script>
<script type="text/javascript" src="../build/picobel.3.0.3.js"></script>
<script>
console.log({ picobel });
picobel();
const picobelInstance = picobel();
console.log({ picobelInstance });
</script>
</body>
</html>
Loading

0 comments on commit 60fac10

Please sign in to comment.