Skip to content

Commit b502870

Browse files
authored
Merge pull request #13 from adurrr/fix-emoji-replacement
fix: replace decorative emoji with SVG icons (issue #9)
2 parents a86c231 + dc0e1fd commit b502870

3 files changed

Lines changed: 26 additions & 24 deletions

File tree

assets/js/podcast-player.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -198,7 +198,7 @@ class PodcastPlayer extends HTMLElement {
198198
// Phase 5: Apply restored position if the player was reconnected
199199
// (e.g. Turbolinks). The persistence layer saved the position but
200200
// marked paused=true (set in disconnectedCallback), so this only
201-
// restores time/progress without autoplaying — the user sees "▶" and
201+
// restores time/progress without autoplaying — the user sees "play" icon and
202202
// can click to resume from where they left off. If metadata is already
203203
// loaded (audio element survived reconnection), apply eagerly.
204204
if (this._pendingRestoreState && this._audio.readyState >= HTMLMediaElement.HAVE_METADATA) {

exampleSite/content/_index.md

Lines changed: 20 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -6,19 +6,19 @@ title: "Wavecast Demo"
66
<h1>Wavecast</h1>
77
<p>A persistent <strong>&lt;podcast-player&gt;</strong> Web Component for Hugo - drop it into any post with a single shortcode. Supports local audio, AzuraCast radio streams, and iVoox episodes. Works as a <strong>Hugo module</strong> or as a <strong>Hugo theme</strong>.</p>
88
<div class="nav-buttons" style="margin-top:1rem">
9-
<a href="{{< relref "posts/test-episode.md" >}}" class="nav-button nav-button-primary">📻 Test Episode</a>
10-
<a href="{{< relref "posts/second-episode.md" >}}" class="nav-button">▶️ Second Episode</a>
11-
<a href="https://github.com/adurrr/wavecast" class="nav-button" target="_blank" rel="noopener">📖 GitHub</a>
9+
<a href="{{< relref "posts/test-episode.md" >}}" class="nav-button nav-button-primary">Test Episode</a>
10+
<a href="{{< relref "posts/second-episode.md" >}}" class="nav-button">Second Episode</a>
11+
<a href="https://github.com/adurrr/wavecast" class="nav-button" target="_blank" rel="noopener">GitHub</a>
1212
</div>
1313
</section>
1414

1515
<div style="background:var(--surface);border:1px solid var(--border);border-radius:var(--radius);padding:1rem 1.25rem;margin-bottom:2rem;font-size:0.9rem">
16-
<p style="margin-bottom:0.4rem"><strong>🔊 Notice the persistent audio footer at the bottom of the page?</strong> That's the Wavecast sticky footer player - it follows you across all pages, stays in sync with every inline player, and remembers your position, volume, and speed. Try navigating between pages while audio is playing.</p>
16+
<p style="margin-bottom:0.4rem"><strong>Notice the persistent audio footer at the bottom of the page?</strong> That's the Wavecast sticky footer player - it follows you across all pages, stays in sync with every inline player, and remembers your position, volume, and speed. Try navigating between pages while audio is playing.</p>
1717
<p style="margin:0;color:var(--text-muted)">Wavecast works as both a <a href="https://github.com/adurrr/wavecast#option-a-install-as-a-hugo-theme-recommended-for-most-sites">Hugo theme</a> (<code>theme = "wavecast"</code>) and a <a href="https://github.com/adurrr/wavecast#option-b-install-as-a-hugo-module-for-multi-module-sites">Hugo module</a> (<code>hugo mod get</code>). See the <a href="https://github.com/adurrr/wavecast#installation">README</a> for both installation paths.</p>
1818
</div>
1919

2020
<section class="demo-section">
21-
<h2>📻 Basic Player</h2>
21+
<h2>Basic Player</h2>
2222
<p class="desc">Minimal usage - just a <code>src</code> and <code>title</code>. This uses a local <code>.wav</code> asset from <code>assets/demo/</code>.</p>
2323
<div class="demo-player">
2424
<div class="player-wrapper">
@@ -37,7 +37,7 @@ title: "Wavecast Demo"
3737
</section>
3838

3939
<section class="demo-section">
40-
<h2>🎵 Player with Poster</h2>
40+
<h2>Player with Poster</h2>
4141
<p class="desc">Show an album-art poster alongside the controls.</p>
4242
<div class="demo-player">
4343
<div class="player-wrapper">
@@ -58,7 +58,7 @@ title: "Wavecast Demo"
5858
</section>
5959

6060
<section class="demo-section">
61-
<h2>📖 Player with Chapters</h2>
61+
<h2>Player with Chapters</h2>
6262
<p class="desc">Add timestamp-labelled chapters for easy navigation.</p>
6363
<div class="demo-player">
6464
<div class="player-wrapper">
@@ -83,11 +83,11 @@ title: "Wavecast Demo"
8383
</section>
8484

8585
<section class="demo-section">
86-
<h2>💾 Persistence Demo</h2>
86+
<h2>Persistence Demo</h2>
8787
<p class="desc">Toggle <code>persistent="true"</code> - the player saves your position, volume, mute, and playback speed to <code>sessionStorage</code>. Navigate between pages and resume where you left off. Try it on these two instances of the same audio:</p>
8888

8989
<div class="demo-player">
90-
<h3 style="font-size:1rem;margin-bottom:0.5rem">🔁 Player A (with persistence)</h3>
90+
<h3 style="font-size:1rem;margin-bottom:0.5rem">Player A (with persistence)</h3>
9191
<div class="player-wrapper">
9292
{{< podcast-player
9393
src="https://www.soundhelix.com/examples/mp3/SoundHelix-Song-4.mp3"
@@ -101,7 +101,7 @@ title: "Wavecast Demo"
101101
</div>
102102

103103
<div class="demo-player">
104-
<h3 style="font-size:1rem;margin-bottom:0.5rem">🔁 Player B (no persistence)</h3>
104+
<h3 style="font-size:1rem;margin-bottom:0.5rem">Player B (no persistence)</h3>
105105
<div class="player-wrapper">
106106
{{< podcast-player
107107
src="https://www.soundhelix.com/examples/mp3/SoundHelix-Song-4.mp3"
@@ -113,12 +113,12 @@ title: "Wavecast Demo"
113113
<div class="demo-code">
114114
<code>&#123;&#123;&lt; podcast-player src="…" title="SoundHelix: Non-Persistent" &gt;&#125;&#125;</code>
115115
</div>
116-
<p class="desc" style="margin-top:0.75rem;font-size:0.85rem">💡 Play some of Player A, then <a href="{{< relref "posts/second-episode.md" >}}">navigate to the second page</a> and come back - your position, volume, mute, and speed are remembered. Player B always starts fresh. You can also try navigating between <a href="{{< relref "posts/test-episode.md" >}}">Test Episode</a> and <a href="{{< relref "posts/second-episode.md" >}}">Second Episode</a>.</p>
116+
<p class="desc" style="margin-top:0.75rem;font-size:0.85rem">Play some of Player A, then <a href="{{< relref "posts/second-episode.md" >}}">navigate to the second page</a> and come back - your position, volume, mute, and speed are remembered. Player B always starts fresh. You can also try navigating between <a href="{{< relref "posts/test-episode.md" >}}">Test Episode</a> and <a href="{{< relref "posts/second-episode.md" >}}">Second Episode</a>.</p>
117117
</section>
118118

119119
<section class="demo-section">
120-
<h2>🎨 Theming</h2>
121-
<p class="desc">Click the <strong>🌙 Dark / ☀️ Light</strong> toggle in the header to switch between built-in themes. The player responds to <code>data-theme</code> on <code>&lt;html&gt;</code>. You can also customise every visual aspect with <a href="https://github.com/adurrr/wavecast#css-custom-properties" target="_blank" rel="noopener">CSS custom properties</a> - primary colour, background, radius, progress height, and more.</p>
120+
<h2>Theming</h2>
121+
<p class="desc">Click the <strong>Dark / Light</strong> toggle in the header to switch between built-in themes. The player responds to <code>data-theme</code> on <code>&lt;html&gt;</code>. You can also customise every visual aspect with <a href="https://github.com/adurrr/wavecast#css-custom-properties" target="_blank" rel="noopener">CSS custom properties</a> - primary colour, background, radius, progress height, and more.</p>
122122
<div class="demo-player">
123123
<div class="player-wrapper">
124124
{{< podcast-player
@@ -130,7 +130,7 @@ title: "Wavecast Demo"
130130
</section>
131131

132132
<section class="demo-section">
133-
<h2>📋 Shortcode Reference</h2>
133+
<h2>Shortcode Reference</h2>
134134
<p class="desc">All parameters can be passed per-invocation or set globally in <code>hugo.toml</code> under <code>[params.podcastPlayer]</code>:</p>
135135

136136
<table style="width:100%;border-collapse:collapse;font-size:0.9rem">
@@ -157,12 +157,12 @@ title: "Wavecast Demo"
157157
</section>
158158

159159
<section class="demo-section">
160-
<h2>🔗 Links &amp; Resources</h2>
160+
<h2>Links &amp; Resources</h2>
161161
<ul class="link-list">
162-
<li><a href="https://github.com/adurrr/wavecast" target="_blank" rel="noopener">📦 GitHub Repository</a> - source code, issues, contributing</li>
163-
<li><a href="https://github.com/adurrr/wavecast#readme" target="_blank" rel="noopener">📖 README</a> - full documentation, installation (module + theme), CSS custom properties, <code>::part()</code> selectors</li>
164-
<li><a href="https://github.com/adurrr/wavecast?tab=readme-ov-file#keyboard-shortcuts" target="_blank" rel="noopener">⌨️ Keyboard Shortcuts</a> - Space, arrows, M, and more</li>
165-
<li><a href="{{< relref "posts/test-episode.md" >}}">📻 Test Episode</a> - basic player + player with chapters and poster</li>
166-
<li><a href="{{< relref "posts/second-episode.md" >}}">▶️ Second Episode</a> - player with persistence enabled for cross-page testing</li>
162+
<li><a href="https://github.com/adurrr/wavecast" target="_blank" rel="noopener">GitHub Repository</a> - source code, issues, contributing</li>
163+
<li><a href="https://github.com/adurrr/wavecast#readme" target="_blank" rel="noopener">README</a> - full documentation, installation (module + theme), CSS custom properties, <code>::part()</code> selectors</li>
164+
<li><a href="https://github.com/adurrr/wavecast?tab=readme-ov-file#keyboard-shortcuts" target="_blank" rel="noopener">Keyboard Shortcuts</a> - Space, arrows, M, and more</li>
165+
<li><a href="{{< relref "posts/test-episode.md" >}}">Test Episode</a> - basic player + player with chapters and poster</li>
166+
<li><a href="{{< relref "posts/second-episode.md" >}}">Second Episode</a> - player with persistence enabled for cross-page testing</li>
167167
</ul>
168168
</section>

exampleSite/layouts/_default/baseof.html

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@
3333
footer a{color:var(--accent)}
3434

3535
/* ── Theme toggle button ── */
36-
#theme-toggle{background:var(--surface);border:1px solid var(--border);border-radius:var(--radius);color:var(--text);cursor:pointer;font-size:0.85rem;padding:0.35rem 0.75rem;transition:background .15s,border-color .15s;white-space:nowrap}
36+
#theme-toggle{background:var(--surface);border:1px solid var(--border);border-radius:var(--radius);color:var(--text);cursor:pointer;font-size:0.85rem;padding:0.35rem 0.75rem;transition:background .15s,border-color .15s;white-space:nowrap;display:inline-flex;align-items:center;gap:4px}
3737
#theme-toggle:hover{background:var(--border)}
3838

3939
/* ── Hero ── */
@@ -92,7 +92,7 @@
9292
<a href="{{ "posts/second-episode.md" | relref . }}">Second Episode</a>
9393
<a href="https://github.com/adurrr/wavecast" target="_blank" rel="noopener">GitHub</a>
9494
</nav>
95-
<button id="theme-toggle" aria-label="Toggle color theme">🌙 Dark</button>
95+
<button id="theme-toggle" aria-label="Toggle color theme"><svg viewBox="0 0 24 24" width="16" height="16" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" style="vertical-align:middle;margin-right:4px"><path d="M21 12.79A9 9 0 1 1 11.21 3 7 7 0 0 0 21 12.79z"/></svg>Dark</button>
9696
</div>
9797
</header>
9898

@@ -120,7 +120,9 @@
120120
document.documentElement.setAttribute('data-theme', theme);
121121
try { localStorage.setItem(STORAGE_KEY, theme); } catch(e) {}
122122
var btn = document.getElementById('theme-toggle');
123-
if (btn) btn.textContent = theme === 'dark' ? '\u2600\uFE0F Light' : '\uD83C\uDF19 Dark';
123+
if (btn) btn.innerHTML = theme === 'dark'
124+
? '<svg viewBox="0 0 24 24" width="16" height="16" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" style="vertical-align:middle;margin-right:4px"><circle cx="12" cy="12" r="5"/><line x1="12" y1="1" x2="12" y2="3"/><line x1="12" y1="21" x2="12" y2="23"/><line x1="4.22" y1="4.22" x2="5.64" y2="5.64"/><line x1="18.36" y1="18.36" x2="19.78" y2="19.78"/><line x1="1" y1="12" x2="3" y2="12"/><line x1="21" y1="12" x2="23" y2="12"/><line x1="4.22" y1="19.78" x2="5.64" y2="18.36"/><line x1="18.36" y1="5.64" x2="19.78" y2="4.22"/></svg>Light'
125+
: '<svg viewBox="0 0 24 24" width="16" height="16" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" style="vertical-align:middle;margin-right:4px"><path d="M21 12.79A9 9 0 1 1 11.21 3 7 7 0 0 0 21 12.79z"/></svg>Dark';
124126
}
125127
function toggle() {
126128
apply(document.documentElement.getAttribute('data-theme') === 'dark' ? 'light' : 'dark');

0 commit comments

Comments
 (0)