Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Refactor #37

Merged
merged 4 commits into from
Feb 14, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading